chengjie před 6 roky
rodič
revize
126e8f8db3
35 změnil soubory, kde provedl 1535 přidání a 383 odebrání
  1. 4 3
      app.js
  2. 2 1
      app.json
  3. binární
      pages/images/edit_voicerecorder_illus.png
  4. binární
      pages/images/program_screenshot_l1.png
  5. binární
      pages/images/program_screenshot_l2.png
  6. binární
      pages/images/program_screenshot_l3.png
  7. binární
      pages/images/program_screenshot_l4.png
  8. binární
      pages/images/universalpic_del_white_20x28.png
  9. binární
      pages/images/universalpic_pause_black_24x26.png
  10. binární
      pages/images/universalpic_voicerecorder_black_30x30.png
  11. binární
      pages/images/universalpic_voicerecorder_normal_gray_21x26.png
  12. binární
      pages/images/universalpic_voicerecorder_transmit_black_44x34.png
  13. 4 4
      pages/index/accredit.json
  14. 7 12
      pages/index/accredit.wxml
  15. 17 41
      pages/index/accredit.wxss
  16. 19 0
      pages/index/openSetting.js
  17. 6 0
      pages/index/openSetting.json
  18. 10 0
      pages/index/openSetting.wxml
  19. 35 0
      pages/index/openSetting.wxss
  20. 353 35
      pages/main/add.js
  21. 82 23
      pages/main/add.wxml
  22. 259 6
      pages/main/add.wxss
  23. 12 0
      pages/main/default.js
  24. 114 32
      pages/main/detail.js
  25. 1 5
      pages/main/detail.wxml
  26. 16 0
      pages/main/detail.wxss
  27. 122 90
      pages/main/preview.js
  28. 1 6
      pages/main/preview.wxml
  29. 16 0
      pages/main/preview.wxss
  30. 144 35
      pages/main/searchCardList.js
  31. 45 16
      pages/main/searchCardList.wxml
  32. 235 66
      pages/main/searchCardList.wxss
  33. 2 2
      pages/main/setting.js
  34. 17 6
      pages/template/cardShow.wxml
  35. 12 0
      utils/main.js

+ 4 - 3
app.js

@@ -26,8 +26,8 @@ App({
26 26
     }
27 27
   },
28 28
   globalData: {
29
-    Version: "1.1.29",
30
-    IsProduction: false,
29
+    Version: "1.1.33",
30
+    IsProduction: true,
31 31
     ShareTitle: "刻意学习,高效成长",
32 32
     SharePath: "pages/index/index",
33 33
     ShareImage: '../images/program_screenshot_main.png',
@@ -53,7 +53,8 @@ App({
53 53
     IV: "kylx365hongliren",
54 54
     IsEnter: true,//是否是刚进来
55 55
     LessonID:0,//听课ID
56
-
56
+    CardWaitTimeMax:3,//每张卡最长等待时间(分钟)
57
+    IsRecorderAccredit:0,
57 58
     CardList:[],//卡列表变量
58 59
     TaskToday:[],//今天任务列表
59 60
     SearchResultList: [],//搜索获得要选择的字词或古诗词列表

+ 2 - 1
app.json

@@ -1,12 +1,13 @@
1 1
 {
2 2
   "pages": [
3 3
     "pages/index/index",
4
+    "pages/index/accredit",
4 5
     "pages/main/recommend",
5 6
     "pages/main/clicktype",
6 7
     "pages/other/lesson",
7 8
     "pages/main/colorplan",
8 9
     "pages/index/notice",
9
-    "pages/index/accredit",
10
+    "pages/index/openSetting",
10 11
     "pages/main/default",
11 12
     "pages/main/cardInfo",
12 13
     "pages/main/preview",

binární
pages/images/edit_voicerecorder_illus.png


binární
pages/images/program_screenshot_l1.png


binární
pages/images/program_screenshot_l2.png


binární
pages/images/program_screenshot_l3.png


binární
pages/images/program_screenshot_l4.png


binární
pages/images/universalpic_del_white_20x28.png


binární
pages/images/universalpic_pause_black_24x26.png


binární
pages/images/universalpic_voicerecorder_black_30x30.png


binární
pages/images/universalpic_voicerecorder_normal_gray_21x26.png


binární
pages/images/universalpic_voicerecorder_transmit_black_44x34.png


+ 4 - 4
pages/index/accredit.json

@@ -1,6 +1,6 @@
1 1
 {
2
-  "navigationBarTitleText": "登录",
3
-  "navigationBarBackgroundColor": "#ffffff",
4
-  "navigationBarTextStyle": "black",
5
-  "backgroundColor": "#ffffff"
2
+  "navigationBarTitleText": "秒过",
3
+  "navigationBarBackgroundColor": "#0B8457",
4
+  "navigationBarTextStyle": "white",
5
+  "backgroundColor": "#0B8457"
6 6
 }

+ 7 - 12
pages/index/accredit.wxml

@@ -1,16 +1,11 @@
1 1
 <view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
2
-  <image src="../images/universalpic_face_default_green_240x240.png" class="universalpic_face_default_green_240x240" />
3
-
2
+  <image src="../images/universalpic_logo_200x200.png" class='img' />
4 3
   <text class="text0">请登录</text>
5 4
 
6
-  <view class="btn">
7
-    <button open-type="getUserInfo" bindgetuserinfo="goto" class="btn1 FlexRow">
8
-      <image src="../images/universalpic_share_white_52x40.png" class="universalpic_share_white_52x40" />
9
-
10
-      <view>用微信一键登录</view>
11
-
12
-    </button>
13
-  </view>
5
+  <button open-type="getUserInfo" bindgetuserinfo="goto" class="btn FlexRow">
6
+    <image src="../images/universalpic_share_white_52x40.png" class="universalpic_share_white_52x40" />
7
+    <view>微信登录</view>
8
+  </button>
14 9
 
15
-  <view class="text3">本产品仅对受邀用户开放</view>
16
-</view>
10
+  <text class="text1">本产品仅对受邀用户开放</text>
11
+</view>

+ 17 - 41
pages/index/accredit.wxss

@@ -1,53 +1,37 @@
1 1
 .container {
2
-  background-color: #fff;
2
+  background-color: #0B8457;
3 3
   position: fixed;
4 4
   top:0;
5
+  color:#fff;
5 6
 }
6 7
 
7
-.universalpic_face_default_green_240x240{
8
-  width: 240rpx;
9
-  height:240rpx;
8
+.img{
9
+  width:200rpx;
10
+  height:200rpx;
10 11
   border-radius: 50%;
11
-  margin-top: 60rpx;
12
+  margin-top: 150rpx;
12 13
 }
13 14
 
14 15
 .text0{
15 16
   font-size:54rpx;
17
+  margin-top: 170rpx;
16 18
   text-align: center;
17
-  margin-top: 30rpx;
18
-  z-index: 10;
19
-  color:#03AF69;
20
-}
21
-
22
-.text1{
23
-  font-size:36rpx;
24
-  text-align: center;
25
-  margin-top: 0rpx;
26
-  z-index: 10;
27
-  color:#fff;
28 19
 }
29 20
 
30
-
31
-.btn {
32
-  width: 520rpx;
33
-  height: 100rpx;
34
-  background-color:#13925C;
21
+.btn{
22
+  width:600rpx;
23
+  height:90rpx;
35 24
   border-radius: 14rpx;
36
-  margin-top: 60rpx;
37
-  z-index: 10;
25
+  border:1rpx solid #fff;
26
+  background-color: #0B8457;
27
+  margin-top: 40rpx;
28
+  color:#fff;
38 29
 }
39 30
 
40
-.btn1 {
41
-  width: 100%;
42
-  height: 90rpx;
43
-  background-color: #03AF69;
44
-  border-radius: 10rpx;
45
-  position:relative;
46
-  top:0;
47
-  font-size: 36rpx;
31
+.text1{
32
+  font-size:28rpx;
33
+  margin-top: 40rpx;
48 34
   text-align: center;
49
-  line-height: 90rpx;
50
-  color:#fff;
51 35
 }
52 36
 
53 37
 .universalpic_share_white_52x40{
@@ -55,11 +39,3 @@
55 39
   height: 41rpx;
56 40
   margin-right: 20rpx;
57 41
 }
58
-
59
-.text3{
60
-  font-size:24rpx;
61
-  margin-top: 30rpx;
62
-  z-index: 10;
63
-  font-weight: 400;
64
-  color:#000;
65
-}

+ 19 - 0
pages/index/openSetting.js

@@ -0,0 +1,19 @@
1
+import common from '../../utils/util';
2
+import main from '../../utils/main';
3
+
4
+const app = getApp();
5
+
6
+Page({
7
+  data: {
8
+  },
9
+  onLoad: function (options) {
10
+    this.setData({
11
+      Containnerheight: main.getWindowHeight(),
12
+    });
13
+  },
14
+  callback:function(){
15
+    wx.navigateBack({
16
+      delta: 1,
17
+    });
18
+  },
19
+});

+ 6 - 0
pages/index/openSetting.json

@@ -0,0 +1,6 @@
1
+{
2
+  "navigationBarTitleText": "秒过",
3
+  "navigationBarBackgroundColor": "#0B8457",
4
+  "navigationBarTextStyle": "white",
5
+  "backgroundColor": "#0B8457"
6
+}

+ 10 - 0
pages/index/openSetting.wxml

@@ -0,0 +1,10 @@
1
+<view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
2
+  
3
+  <image src="../images/universalpic_logo_200x200.png" class='img' />
4
+  <text class="text0">录音功能需要\n使用您的麦克风</text>
5
+
6
+  <button class='btn' open-type="openSetting" bindopensetting="callback">去开启</button>
7
+
8
+  <text class="text1">点击“去开启”,把麦克风调到打开状态即可</text>
9
+
10
+</view>

+ 35 - 0
pages/index/openSetting.wxss

@@ -0,0 +1,35 @@
1
+.container {
2
+  background-color: #0B8457;
3
+  position: fixed;
4
+  top:0;
5
+  color:#fff;
6
+}
7
+
8
+.img{
9
+  width:200rpx;
10
+  height:200rpx;
11
+  border-radius: 50%;
12
+  margin-top: 150rpx;
13
+}
14
+
15
+.text0{
16
+  font-size:54rpx;
17
+  margin-top: 170rpx;
18
+  text-align: center;
19
+}
20
+
21
+.btn{
22
+  width:600rpx;
23
+  height:90rpx;
24
+  border-radius: 14rpx;
25
+  border:1rpx solid #fff;
26
+  background-color: #0B8457;
27
+  margin-top: 40rpx;
28
+  color:#fff;
29
+}
30
+
31
+.text1{
32
+  font-size:28rpx;
33
+  margin-top: 40rpx;
34
+  text-align: center;
35
+}

+ 353 - 35
pages/main/add.js

@@ -2,7 +2,13 @@ import common from '../../utils/util';
2 2
 import main from '../../utils/main';
3 3
 
4 4
 const app = getApp();
5
-const PracticeTimeArr = ["智能安排", "今天必练", "推迟一周", "推迟一个月", "推迟三个月"];
5
+const PracticeTimeArr = [
6
+  { Name: "智能安排", CSS: "numberContainerFooter1121Select" },
7
+  { Name: "今天必练", },
8
+  { Name: "推迟一周", },
9
+  { Name: "推迟一个月", },
10
+  { Name: "推迟三个月", }
11
+];
6 12
 var arrTag = [];
7 13
 
8 14
 var tempCursor = undefined,
@@ -13,7 +19,10 @@ var isEdit = true;
13 19
 var isSave = true;
14 20
 var interval;
15 21
 var timeoutUploadImage = 0;
16
-
22
+var intervalRecorder = 0;//录音计时器
23
+var recorderManager;
24
+var tempRecorderFile = "";
25
+var innerAudioContext;
17 26
 
18 27
 Page({
19 28
   data: {
@@ -23,6 +32,27 @@ Page({
23 32
     LineSign: "[线]",
24 33
     HighlighterSign: "[光]",
25 34
     BtnArray: ["+", "-", "×", "÷", "=", "<", ">"],
35
+    IsPracticeTime: false,
36
+    IsRecorder: false,
37
+    PracticeTimeArr: PracticeTimeArr
38
+  },
39
+  onReady: function () {
40
+    recorderManager = wx.getRecorderManager();
41
+    recorderManager.onStart(() => {
42
+      console.log('recorder start')
43
+    });
44
+    recorderManager.onStop((res) => {
45
+      console.log('recorder stop', res);
46
+      tempRecorderFile = res.tempFilePath;
47
+    });
48
+    recorderManager.onError((err) => {
49
+      // console.log('err', err);
50
+      // if (err.errMsg =="operateRecorder:fail auth deny"){
51
+      //   wx.navigateTo({
52
+      //     url: '../index/openSetting',
53
+      //   })
54
+      // }
55
+    });
26 56
   },
27 57
   onLoad: function (options) {
28 58
     var that = this;
@@ -36,7 +66,7 @@ Page({
36 66
       UpdateType: options.type,
37 67
       MiaoguoCardID: options.id,
38 68
       FieldNumber: fieldNumber,
39
-      PracticeTimeStr: PracticeTimeArr[0],
69
+      PracticeTimeStr: PracticeTimeArr[0].Name,
40 70
     });
41 71
 
42 72
     var list = app.globalData.CardList;
@@ -50,7 +80,6 @@ Page({
50 80
     app.globalData.TempMiaoguoCardID = that.data.MiaoguoCardID;
51 81
 
52 82
   },
53
-
54 83
   onShow: function () {
55 84
     var that = this;
56 85
     if (that.data.UpdateType == "add") {
@@ -136,11 +165,18 @@ Page({
136 165
     }
137 166
     clearInterval(interval);
138 167
     clearTimeout(timeoutUploadImage);
168
+    clearInterval(intervalRecorder);
169
+
170
+    if (this.data.IsRecorder)
171
+      this.closeRecorder();
172
+
139 173
   },
140 174
   onClose: function () {
141 175
     wx.navigateBack({
142 176
       delta: 1,
143 177
     });
178
+
179
+    clearInterval(intervalRecorder);
144 180
   },
145 181
   gotoAddItem: function (e) {
146 182
     var that = this;
@@ -184,26 +220,8 @@ Page({
184 220
       });
185 221
     }
186 222
   },
187
-  changePracticeTime: function () {
188
-    var that = this;
189
-    wx.showActionSheet({
190
-      itemList: PracticeTimeArr,
191
-      success(res) {
192
-        for (var i = 0; i < PracticeTimeArr.length; i++) {
193
-          if (i == res.tapIndex) {
194
-            that.setData({
195
-              PracticeTimeStr: PracticeTimeArr[i],
196
-            });
197
-            break;
198
-          }
199
-        }
200
-      },
201
-    })
202
-
203
-  },
204 223
   saveCard: function () {
205 224
     var that = this;
206
-
207 225
     if (that.data.Field[1] == "") {
208 226
       wx.showToast({
209 227
         title: '第一段必填',
@@ -233,15 +251,15 @@ Page({
233 251
               param1.Tags = tags;
234 252
 
235 253
               param1.IsTodayStudy = 0;
236
-              if (that.data.PracticeTimeStr == PracticeTimeArr[1])
254
+              if (that.data.PracticeTimeStr == PracticeTimeArr[1].Name)
237 255
                 param1.IsTodayStudy = 1;
238 256
 
239
-              if (that.data.PracticeTimeStr == PracticeTimeArr[2])
240
-                param1.LimitTime = common.addDate("w", 1, new Date());
241
-              else if (that.data.PracticeTimeStr == PracticeTimeArr[3])
242
-                param1.LimitTime = common.addDate("m", 1, new Date());
243
-              else if (that.data.PracticeTimeStr == PracticeTimeArr[4])
244
-                param1.LimitTime = common.addDate("m", 3, new Date());
257
+              if (that.data.PracticeTimeStr == PracticeTimeArr[2].Name)
258
+                param1.LimitTime = common.formatTime(common.addDate("w", 1, new Date()));
259
+              else if (that.data.PracticeTimeStr == PracticeTimeArr[3].Name)
260
+                param1.LimitTime = common.formatTime(common.addDate("m", 1, new Date()));
261
+              else if (that.data.PracticeTimeStr == PracticeTimeArr[4].Name)
262
+                param1.LimitTime = common.formatTime(common.addDate("m", 3, new Date()));
245 263
 
246 264
 
247 265
               param1.ID = that.data.MiaoguoCardID;
@@ -318,13 +336,17 @@ Page({
318 336
               str += "[光]" + item.Content[j].value + "[/光]";
319 337
             }
320 338
           }
321
-        } 
339
+        }
322 340
         else if (item.Type == "sound") {
323 341
           if (item.SoundMark)
324 342
             str = "[读 src='" + item.SoundMark + "']" + item.Content + "[/读]";
325 343
           else
326 344
             str = "[读]" + item.Content + "[/读]";
327 345
         }
346
+        else if (item.Type == "recorder") {
347
+          if (item.SoundMark)
348
+            str = "[音 url='" + item.SoundMark + "'][/音]";
349
+        }
328 350
         else if (item.Type == "normal") {
329 351
           str = item.Content;
330 352
         }
@@ -366,7 +388,8 @@ Page({
366 388
         if (arr[i][j].Type == "image" && arr[i][j].Content) {
367 389
           arrSource.push(arr[i][j].Content);
368 390
           if (arr[i][j].ContentServer.indexOf(app.globalData.uploadImageUrl) >= 0
369
-            || arr[i][j].ContentServer.indexOf("baidu.com") >= 0) {
391
+            || arr[i][j].ContentServer.indexOf("baidu.com") >= 0
392
+            || arr[i][j].ContentServer.indexOf("bcebos.com") >= 0) {
370 393
             var result = {};
371 394
             result.Source = arr[i][j].ContentServer;
372 395
             result.Target = arr[i][j].ContentServer;
@@ -375,7 +398,7 @@ Page({
375 398
           }
376 399
           else {
377 400
             var source = arr[i][j].Content;
378
-            that.uploadImage(source, function (data) {
401
+            that.uploadFileToServer(source, function (data) {
379 402
               if (data) {
380 403
                 data = JSON.parse(data);
381 404
                 var result = data.result;
@@ -441,7 +464,7 @@ Page({
441 464
       }
442 465
     }, 500);
443 466
   },
444
-  uploadImage: function (file, callback) {
467
+  uploadFileToServer: function (file, callback) {
445 468
     var url = common.Encrypt("MiaoguoUploadFile2");
446 469
     wx.uploadFile({
447 470
       url: app.globalData.serverUrl + url,
@@ -453,13 +476,12 @@ Page({
453 476
       fail: function (err) {
454 477
         wx.hideLoading();
455 478
         wx.showModal({
456
-          title: '上传图片失败',
479
+          title: '上传文件失败',
457 480
           showCancel: false,
458 481
           content: JSON.stringify(err),
459 482
         });
460 483
       }
461 484
     });
462
-
463 485
   },
464 486
   saveLocalCardList: function (param1) {
465 487
     var that = this;
@@ -866,6 +888,24 @@ Page({
866 888
               });
867 889
               that.updateField();
868 890
 
891
+              if (!wx.getStorageSync("NoRemindImage")) {
892
+                wx.showModal({
893
+                  title: '图片已插到段落中',
894
+                  showCancel: true,
895
+                  content: "图片显示为[图...][/图]。如要移动到别的段落,剪切时请确保其完整性。",
896
+                  confirmText: "知道了",
897
+                  cancelText: "不再提示",
898
+                  confirmColor: "#0071EF",
899
+                  success(res) {
900
+                    if (res.confirm) {
901
+                    }
902
+                    else {
903
+                      wx.setStorageSync("NoRemindImage", true);
904
+                    }
905
+                  },
906
+                });
907
+              }
908
+
869 909
             }
870 910
           });
871 911
         },
@@ -875,6 +915,284 @@ Page({
875 915
       });
876 916
     }
877 917
   },
918
+  onPracticeTime: function (e) {
919
+    var that = this;
920
+    var value = e.currentTarget.dataset.value;
921
+    for (var i = 0; i < this.data.PracticeTimeArr.length; i++) {
922
+      if (this.data.PracticeTimeArr[i].Name == value)
923
+        this.data.PracticeTimeArr[i].CSS = "numberContainerFooter1121Select";
924
+      else
925
+        this.data.PracticeTimeArr[i].CSS = "";
926
+    }
927
+    that.setData({
928
+      PracticeTimeStr: value,
929
+      PracticeTimeArr: that.data.PracticeTimeArr,
930
+      IsPracticeTime: false,
931
+    });
932
+  },
933
+  showPracticeTime: function () {
934
+    this.setData({
935
+      IsPracticeTime: true,
936
+    });
937
+  },
938
+  closePracticeTime: function () {
939
+    this.setData({
940
+      IsPracticeTime: false,
941
+    });
942
+  },
943
+
944
+  //录音授权
945
+  recorderAccredit: function () {
946
+    var that = this;
947
+    if (app.globalData.IsRecorderAccredit == 1)
948
+      that.showRecorder();
949
+    else if (app.globalData.IsRecorderAccredit == 0) {
950
+      recorderManager.stop();
951
+      app.globalData.IsRecorderAccredit=-1;
952
+      that.showRecorder();
953
+    }
954
+    else if (app.globalData.IsRecorderAccredit == -1) {
955
+      wx.getSetting({
956
+        success(res) {
957
+          if (res.authSetting['scope.record'] === true) {
958
+            app.globalData.IsRecorderAccredit = 1;
959
+            that.showRecorder();
960
+          }
961
+          else if (res.authSetting['scope.record'] === false) {
962
+            wx.navigateTo({
963
+              url: '../index/openSetting',
964
+            });
965
+          }
966
+        }
967
+      });
968
+      
969
+    }
970
+  },
971
+  showRecorder: function () {
972
+    var that = this;
973
+    if (that.checkRecorderCount()) {
974
+      that.recorderInit();
975
+      tempRecorderFile="";
976
+      wx.setNavigationBarTitle({
977
+        title: '录音',
978
+      });
979
+      that.setData({
980
+        IsRecorder: true,
981
+        IsRecorderFinished: false,
982
+        BtnRecorderName: "按住录音",
983
+        RecorderTime: "00:00",
984
+        RecorderTimeCss: "",
985
+        RecorderPlayName: "播放",
986
+      });
987
+
988
+      innerAudioContext = wx.createInnerAudioContext();
989
+      innerAudioContext.onPlay(() => {
990
+        console.log('开始播放');
991
+        that.setData({
992
+          RecorderTimeCss: "RecorderPanel1121",
993
+          RecorderTime: "00:00",
994
+          RecorderPlayName: "停止",
995
+        });
996
+      });
997
+
998
+      innerAudioContext.onEnded(() => {
999
+        console.log('结束播放');
1000
+        clearInterval(intervalRecorder);
1001
+        that.setData({
1002
+          RecorderTime: "00:00",
1003
+          RecorderTimeCss: "",
1004
+          RecorderPlayName: "播放",
1005
+        });
1006
+      });
1007
+    }
1008
+  },
1009
+  closeRecorder: function () {
1010
+    var that = this;
1011
+    this.recorderInit();
1012
+
1013
+    if (tempRecorderFile) {
1014
+      wx.showModal({
1015
+        title: '提醒',
1016
+        content: '录音还没上传,要继续退出并放弃录音吗?',
1017
+        showCancel: true,
1018
+        confirmText: "取消",
1019
+        cancelColor: "#000000",
1020
+        cancelText: "继续",
1021
+        confirmColor: "#000000",
1022
+        success(res) {
1023
+          if (res.cancel) {
1024
+            closeRecorder2();
1025
+          }
1026
+        },
1027
+      })
1028
+    }
1029
+    else {
1030
+      closeRecorder2();
1031
+    }
1032
+
1033
+    function closeRecorder2() {
1034
+      wx.setNavigationBarTitle({
1035
+        title: '编辑 段落' + that.data.FieldNumber,
1036
+      });
1037
+      that.setData({
1038
+        IsRecorder: false,
1039
+        IsRecorderFinished: false,
1040
+      });
1041
+      tempRecorderFile = "";
1042
+    }
1043
+  },
1044
+  //录音初始化
1045
+  recorderInit: function () {
1046
+    if (innerAudioContext)
1047
+      innerAudioContext.stop();
1048
+    if (recorderManager)
1049
+      recorderManager.stop();
1050
+
1051
+    clearInterval(intervalRecorder);
1052
+  },
1053
+  checkRecorderCount: function (arr) {
1054
+    var that = this;
1055
+    var count = 0;
1056
+    if (that.data.FieldContent.indexOf("[音 url=") >= 0
1057
+      || that.data.FieldContent.indexOf("[/音]") >= 0) {
1058
+      count = 1;
1059
+    }
1060
+    if (count > 0) {
1061
+      wx.showToast({
1062
+        title: '仅能上传一段',
1063
+      });
1064
+      return false;
1065
+    }
1066
+    else
1067
+      return true;
1068
+  },
1069
+  btnRecorderStart: function () {
1070
+    var that = this;
1071
+    if (app.globalData.IsRecorderAccredit == 1) {
1072
+      that.setData({
1073
+        BtnRecorderName: "松手结束",
1074
+        RecorderTimeCss: "RecorderPanel1121",
1075
+      });
1076
+      that.showRecorderTime();
1077
+      recorderManager.start();
1078
+    }
1079
+  },
1080
+  btnRecorderEnd: function () {
1081
+    var that = this;
1082
+    if (app.globalData.IsRecorderAccredit == 1) {
1083
+      if (that.data.RecorderTime == "00:00") {
1084
+        //小于1秒处理
1085
+        wx.showToast({
1086
+          title: '时间过短',
1087
+          image: "../images/universalpic_wrong_white_120x120.png",
1088
+        });
1089
+        that.showRecorder();
1090
+      }
1091
+      else {
1092
+        that.setData({
1093
+          IsRecorderFinished: true,
1094
+          RecorderTimeCss: "",
1095
+        });
1096
+        that.recorderInit();
1097
+      }
1098
+    }
1099
+    else {
1100
+      that.recorderAccredit();
1101
+    }
1102
+  },
1103
+  showRecorderTime: function () {
1104
+    var that = this;
1105
+    var second = 0;
1106
+    clearInterval(intervalRecorder);
1107
+    intervalRecorder = setInterval(function () {
1108
+      second++;
1109
+      var secondStr = second.toString();
1110
+      if (second < 10)
1111
+        secondStr = "0" + secondStr;
1112
+      that.setData({
1113
+        RecorderTime: "00:" + secondStr,
1114
+      });
1115
+
1116
+      if (second >= 59) {
1117
+        that.setData({
1118
+          IsRecorderFinished: true,
1119
+          RecorderTimeCss: "",
1120
+        });
1121
+        that.recorderInit();
1122
+
1123
+        if (that.data.RecorderPlayName == "播放") {
1124
+          wx.showToast({
1125
+            title: '录音超时',
1126
+            image: "../images/universalpic_wrong_white_120x120.png",
1127
+          });
1128
+        }
1129
+      }
1130
+
1131
+    }, 1000);
1132
+  },
1133
+  btnRecorderPlay: function () {
1134
+    var that = this;
1135
+    if (tempRecorderFile && this.data.RecorderPlayName == "播放") {
1136
+      innerAudioContext.src = tempRecorderFile;
1137
+      innerAudioContext.play();
1138
+      this.showRecorderTime();
1139
+    }
1140
+    else if (this.data.RecorderPlayName == "停止") {
1141
+      if (innerAudioContext)
1142
+        innerAudioContext.stop();
1143
+      clearInterval(intervalRecorder);
1144
+      that.setData({
1145
+        RecorderTime: "00:00",
1146
+        RecorderTimeCss: "",
1147
+        RecorderPlayName: "播放",
1148
+      });
1149
+    }
1150
+  },
1151
+  btnRecorderSave: function () {
1152
+    var that = this;
1153
+    this.recorderInit();
1154
+    wx.showLoading({
1155
+      title: '上传中请稍候',
1156
+    });
1157
+    setTimeout(function () {
1158
+      wx.hideLoading();
1159
+    }, 60000);
1160
+    that.uploadFileToServer(tempRecorderFile, function (data) {
1161
+      if (data) {
1162
+        data = JSON.parse(data);
1163
+        //console.log(data);
1164
+        wx.hideLoading();
1165
+        var result = data.result;
1166
+        result.Target = app.globalData.uploadImageUrl + result.Target;
1167
+        that.data.FieldContent = that.data.FieldContent + "[音 url='" + result.Target + "'][/音]";
1168
+        that.data.FieldContent = main.encryptUrl(that.data.FieldContent);
1169
+        that.setData({
1170
+          FieldContent: that.data.FieldContent,
1171
+        });
1172
+
1173
+        tempRecorderFile = "";
1174
+        that.closeRecorder();
1175
+
1176
+        if (!wx.getStorageSync("NoRemindRecorder")) {
1177
+          wx.showModal({
1178
+            title: '录音已插到段落中',
1179
+            showCancel: true,
1180
+            content: "录音显示为[音...][/音]。如要移动到别的段落,剪切时请确保其完整性。",
1181
+            confirmText: "知道了",
1182
+            cancelText: "不再提示",
1183
+            confirmColor: "#0071EF",
1184
+            success(res) {
1185
+              if (res.confirm) {
1186
+              }
1187
+              else {
1188
+                wx.setStorageSync("NoRemindRecorder", true);
1189
+              }
1190
+            },
1191
+          });
1192
+        }
1193
+      }
1194
+    });
1195
+  },
878 1196
   onShareAppMessage: function () {
879 1197
     return {
880 1198
       title: app.globalData.ShareTitle,

+ 82 - 23
pages/main/add.wxml

@@ -30,19 +30,22 @@
30 30
           <text class="textNormal FlexRow" wx:if="{{item.Type=='line'}}">
31 31
             <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem">
32 32
               <text wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
33
-              <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
34
-              <text class="textHighlighter" wx:if="{{contentItem.key=='highlighter'}}">{{contentItem.value}}</text>
35
-            </block>
36
-          </text>
37
-          
38
-          <view class="sound FlexRow" wx:if="{{item.Type=='sound'}}">
39
-            <image class="universalpic_read_mark_black_20x20" src='../images/universalpic_read_mark_black_20x20.png' />
40
-          </view>
41
-          <text class="textPinyin" wx:if="{{item.Type=='sound'}}">{{item.Content}}</text>
42
-          <image class="imageFree" mode="widthFix" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' binderror="onBindError" />
43
-          <view class="textBr" wx:if="{{item.Type=='br'}}"></view>
44
-          <text class="textReturn" wx:if="{{item.Type=='return'}}"></text>
33
+          <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
34
+          <text class="textHighlighter" wx:if="{{contentItem.key=='highlighter'}}">{{contentItem.value}}</text>
45 35
         </block>
36
+        </text>
37
+
38
+        <view class="sound FlexRow" wx:if="{{item.Type=='sound'}}">
39
+          <image class="universalpic_read_mark_black_20x20" src='../images/universalpic_read_mark_black_20x20.png' />
40
+        </view>
41
+        <text class="textPinyin" wx:if="{{item.Type=='sound'}}">{{item.Content}}</text>
42
+        <view class="panelRecorder FlexRow" wx:if="{{item.Type=='recorder'}}">
43
+          <image class="universalpic_voicerecorder_transmit_black_44x34" src='../images/universalpic_voicerecorder_transmit_black_44x34.png' />
44
+        </view>
45
+        <image class="imageFree" mode="widthFix" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' binderror="onBindError" />
46
+        <view class="textBr" wx:if="{{item.Type=='br'}}"></view>
47
+        <text class="textReturn" wx:if="{{item.Type=='return'}}"></text>
48
+  </block>
46 49
   </view>
47 50
   </view>
48 51
   <block wx:if="{{Tags && Tags.length>0 && indexParent==0}}">
@@ -66,7 +69,7 @@
66 69
   </block>
67 70
   <view class='lineFooter'></view>
68 71
 
69
-  <view class="panelTimePlan FlexRow" bindtap="changePracticeTime">
72
+  <view class="panelTimePlan FlexRow" bindtap="showPracticeTime">
70 73
     <view class="panelItem1 FlexRow">
71 74
       <image src='../images/universalpic_clock_gray_24x24.png' class="universalpic_clock_gray_24x24" />
72 75
       <view>练习时间</view>
@@ -76,7 +79,7 @@
76 79
       <view class="panelTimePlan2" hidden="{{PracticeTimeStr=='智能安排'}}">{{PracticeTimeStr}}</view>
77 80
       <!-- <switch class='panelTimePlan2' checked="{{IsTodayStudy}}" bindchange="switch1Change" /> -->
78 81
       <image src='../images/universalpic_indicator_right_gray.png' class="Arrow" />
79
-    
82
+
80 83
     </view>
81 84
   </view>
82 85
   <view style='height:300rpx;'></view>
@@ -91,20 +94,34 @@
91 94
   </view>
92 95
 </view>
93 96
 
97
+<!-- 更多功能 -->
98
+<view wx:if="{{IsPracticeTime}}" class="numberContainer FlexColumn" style='height:{{Containnerheight}}rpx;'>
99
+  <view class="numberContainerFooter1 FlexColumn">
100
+    <view class='lineFooter'></view>
101
+    <view class='numberContainerFooter101 FlexRow'>
102
+      <image class="universalpic_bell_black_30x30" src='../images/universalpic_bell_black_30x30.png' />
103
+      <view class='numberContainerFooter11 FlexColumn'>
104
+        <view class='numberContainerFooter111'>练习时间</view>
105
+        <view class='numberContainerFooter112 FlexRow'>
106
+          <view class='{{item.CSS}} numberContainerFooter1121' wx:for="{{PracticeTimeArr}}" wx:key="index" catchtap='onPracticeTime' data-value='{{item.Name}}'>{{item.Name}}</view>
107
+        </view>
108
+      </view>
109
+    </view>
110
+  </view>
111
+  <view class='lineFooter'></view>
112
+  <view class="numberContaineFooter FlexRow" catchtap='closePracticeTime'>
113
+    <view>关闭</view>
114
+  </view>
115
+</view>
116
+
94 117
 <!-- 字段编辑 -->
95
-<view class="addItem container FlexColumn" style='height:{{Containnerheight}}rpx;' hidden='{{HiddenFieldEdit}}'>
118
+<view class="addItem container FlexColumn" style='height:{{Containnerheight}}rpx;' hidden='{{HiddenFieldEdit || IsRecorder}}'>
96 119
   <view class="panelItemTag FlexRow">
97 120
     <view class='left FlexRow'>
98 121
       <view class="panelSaveTag1 FlexRow" bindtap="onSearchField">
99 122
         <view class="add">+</view> 资料
100 123
       </view>
101
-      <view class="panelSaveTag2 panelSaveTag1 FlexRow" bindtap="addSymbol" data-id="{{SoundSign}}" hidden="{{SoundSign=='[/读]'}}">
102
-        <image class="universalpic_read_begin_gray_20x20" src='../images/universalpic_read_begin_gray_20x20.png' />
103
-      </view>
104
-      <view class="panelSaveTag3 panelSaveTag1 FlexRow" bindtap="addSymbol" data-id="{{SoundSign}}" hidden="{{SoundSign=='[读]'}}">
105
-        <image class="universalpic_read_end_white_38x22" src='../images/universalpic_read_end_white_38x22.png' />
106
-      </view>
107
-      
124
+
108 125
       <view class="panelSaveTag2 panelSaveTag1 FlexRow" bindtap="addSymbol" data-id="{{LineSign}}" hidden="{{LineSign=='[/线]'}}">
109 126
         <image class="universalpic_underline_begin_gray_14x20" src='../images/universalpic_underline_begin_gray_14x20.png' />
110 127
       </view>
@@ -119,16 +136,27 @@
119 136
         <image class="universalpic_highlighter_begin_gray_24x20" src='../images/universalpic_highlighter_end_white_24x20.png' />
120 137
       </view>
121 138
 
139
+      <view class="panelSaveTag2 panelSaveTag1 FlexRow" bindtap="addSymbol" data-id="{{SoundSign}}" hidden="{{SoundSign=='[/读]'}}">
140
+        <image class="universalpic_read_begin_gray_20x20" src='../images/universalpic_read_begin_gray_20x20.png' />
141
+      </view>
142
+      <view class="panelSaveTag3 panelSaveTag1 FlexRow" bindtap="addSymbol" data-id="{{SoundSign}}" hidden="{{SoundSign=='[读]'}}">
143
+        <image class="universalpic_read_end_white_38x22" src='../images/universalpic_read_end_white_38x22.png' />
144
+      </view>
145
+
122 146
       <view class="panelSaveTag2 panelSaveTag1 FlexRow" catchtap="uploadImageField">
123 147
         <image class="universalpic_picture_gray_26x26" src='../images/universalpic_picture_gray_26x26.png' />
124 148
       </view>
149
+
150
+      <view class="panelSaveTag2 panelSaveTag1 FlexRow" catchtap="recorderAccredit">
151
+        <image class="universalpic_voicerecorder_normal_gray_21x26" src='../images/universalpic_voicerecorder_normal_gray_21x26.png' />
152
+      </view>
125 153
     </view>
126 154
     <view class='right FlexRow'>
127 155
       <view class="clear" catchtap="clear">清空</view>
128 156
     </view>
129 157
   </view>
130 158
   <view class='lineFooter'></view>
131
-  
159
+
132 160
   <view class='panelInput'>
133 161
     <textarea class="input" maxlength='-1' show-confirm-bar="true" value="{{FieldContent}}" focus="{{Focus}}" cursor="{{Cursor}}" bindinput="bindinputField" bindblur="onBindblur" bindfocus="onBindFocus" data-id='{{FieldNumber}}' />
134 162
   </view>
@@ -159,4 +187,35 @@
159 187
     </view>
160 188
     <view class='lineFooter'></view>
161 189
   </view>
190
+</view>
191
+
192
+<!-- 录音功能 -->
193
+<view wx:if="{{IsRecorder}}" class="numberContainer FlexColumn" style='height:{{Containnerheight}}rpx;'>
194
+  <view class='RecorderPanel2 FlexRow' wx:if="{{!FieldContent}}">
195
+    <image class="edit_voicerecorder_illus" src='../images/edit_voicerecorder_illus.png' />
196
+  </view>
197
+  <view class="RecorderPanel3 FlexColumn" wx:if="{{FieldContent}}" style='height:{{Containnerheight-449}}rpx;'>
198
+    <view class='RecorderPanel31 FlexColumn'>
199
+      <text class='RecorderPanel311'>以下是段落中的内容\n可以把材料提前写入段落,方便照着录音</text>
200
+    </view>
201
+    <textarea class="RecorderPanel32" maxlength='-1' value="{{FieldContent}}" />
202
+  </view>
203
+  <view class='RecorderPanel1 FlexColumn'>
204
+    <view class='RecorderPanel11 FlexRow'>
205
+      <view class='RecorderPanel111 FlexRow'>
206
+        <image class="universalpic_voicerecorder_black_30x30" src='../images/universalpic_voicerecorder_black_30x30.png' />
207
+        <view class='RecorderPanel1111'>1分钟录音</view>
208
+      </view>
209
+      <view class='{{RecorderTimeCss}} RecorderPanel112'>{{RecorderTime}}</view>
210
+    </view>
211
+    <view class='btnRecorderStart' hover-start-time="50" hover-class="btnRecorderEnd" catchtouchstart='btnRecorderStart' catchtouchend='btnRecorderEnd' wx:if="{{!IsRecorderFinished}}">{{BtnRecorderName}}</view>
212
+    <view class='RecorderPanel12 FlexRow' wx:if="{{IsRecorderFinished}}">
213
+      <view class='btnRecorderStart2 btnRecorderStart' hover-class="btnRecorderEnd" catchtap='showRecorder'>重录</view>
214
+      <view class='btnRecorderStart2 btnRecorderStart' hover-class="btnRecorderEnd" catchtap='btnRecorderPlay'>{{RecorderPlayName}}</view>
215
+      <view class='btnRecorderStart3 btnRecorderStart' hover-class="btnRecorderEnd" catchtap='btnRecorderSave'>上传</view>
216
+    </view>
217
+  </view>
218
+  <view class="numberContaineFooter2 numberContaineFooter FlexRow" catchtap='closeRecorder'>
219
+    <view>退出录音</view>
220
+  </view>
162 221
 </view>

+ 259 - 6
pages/main/add.wxss

@@ -11,7 +11,6 @@
11 11
   border-bottom: 1rpx solid #d2d2d2;
12 12
 }
13 13
 
14
-
15 14
 .panelTop .panelTopLeft {
16 15
   width: 148rpx;
17 16
   background-color: #fff;
@@ -189,6 +188,20 @@
189 188
   text-decoration: underline;
190 189
   margin-right: 10rpx;
191 190
 }
191
+
192
+.panelItem .panelRecorder {
193
+  width: 70rpx;
194
+  height: 70rpx;
195
+  background-color: #fff;
196
+  border-radius: 10rpx;
197
+  border:1rpx solid #9B9B9B;
198
+}
199
+
200
+.panelItem .universalpic_voicerecorder_transmit_black_44x34{
201
+  width: 44rpx;
202
+  height: 34rpx;
203
+}
204
+
192 205
 .panelItem .imageFree{
193 206
   width:100rpx;
194 207
 }
@@ -313,11 +326,11 @@
313 326
 }
314 327
 
315 328
 .left {
316
-  margin-left: 25rpx;
329
+  margin-left: 20rpx;
317 330
 }
318 331
 
319 332
 .right {
320
-  margin-right: 25rpx;
333
+  margin-right: 20rpx;
321 334
 }
322 335
 
323 336
 .panelItemTag {
@@ -344,13 +357,13 @@
344 357
   height: 80rpx;
345 358
   background-color: #fff;
346 359
   border: 1rpx solid #9b9b9b;
347
-  margin-left: 10rpx;
360
+  margin-left: 6rpx;
348 361
 }
349 362
 
350 363
 .panelSaveTag3 {
351 364
   width: 80rpx;
352 365
   height: 80rpx;
353
-  margin-left: 10rpx;
366
+  margin-left: 6rpx;
354 367
   background-color: #0071ef;
355 368
   border: 1rpx solid #0071ef;
356 369
 }
@@ -385,6 +398,11 @@
385 398
   height: 26rpx;
386 399
 }
387 400
 
401
+.universalpic_voicerecorder_normal_gray_21x26{
402
+  width: 21rpx;
403
+  height: 26rpx;
404
+}
405
+
388 406
 .add {
389 407
   font-size: 42rpx;
390 408
   font-weight: 600;
@@ -392,7 +410,7 @@
392 410
 }
393 411
 
394 412
 .clear {
395
-  width: 108rpx;
413
+  width: 88rpx;
396 414
   height: 80rpx;
397 415
   color:#787878;
398 416
   background-color: #fff;
@@ -521,4 +539,239 @@
521 539
   width:16rpx;
522 540
   height:26rpx;
523 541
   margin-left: 30rpx;
542
+}
543
+
544
+/* 更多功能 */
545
+
546
+.numberContainer {
547
+  width: 100%;
548
+  justify-content: flex-start;
549
+  align-items: flex-start;
550
+  position: fixed;
551
+  top: 0;
552
+  background-color: #fff;
553
+  color:#1e1e1e;
554
+  z-index: 20;
555
+  border-top: 1 solid #fff;
556
+}
557
+
558
+.universalpic_bell_black_30x30{
559
+  width:42rpx;
560
+  height:30rpx;
561
+  margin: 50rpx 20rpx 0 30rpx;
562
+}
563
+.numberContainer .numberContaineFooter{
564
+  width: 100%;
565
+  position: fixed;
566
+  bottom: 0;
567
+  align-items: flex-start;
568
+  font-size: 36rpx;
569
+  border-top: 1rpx solid rgba(0, 0, 0, 0.2);
570
+  text-align: center;
571
+  line-height: 131rpx;
572
+}
573
+.numberContainer .numberContaineFooter2{
574
+  color:#B3443B;
575
+  font-weight: 500;
576
+}
577
+
578
+.universalpic_sequence_black_30x30_2{
579
+  margin: 50rpx 20rpx 0 30rpx;
580
+}
581
+
582
+.numberContainerFooter1{
583
+  width:100%;
584
+  position: fixed;
585
+  bottom:131rpx;
586
+}
587
+
588
+.numberContainerFooter102{
589
+  width:100%;
590
+  height: 132rpx;
591
+  justify-content: flex-start;
592
+}
593
+.numberContainerFooter103{
594
+  width:100%;
595
+  height: 111rpx;
596
+  justify-content: flex-start;
597
+}
598
+.numberContainerFooter104{
599
+  width:100%;
600
+  height: 100rpx;
601
+  justify-content: flex-start;
602
+}
603
+.numberContainerFooter101{
604
+  width:100%;
605
+  height: 337rpx;
606
+  justify-content: flex-start;
607
+  align-items: flex-start;
608
+}
609
+
610
+.universalpic_edit_gray_25x25{
611
+  width: 25rpx; 
612
+  height: 25rpx;
613
+  margin: 0 30rpx 0 30rpx;
614
+}
615
+
616
+.universalpic_bell_gray_30x30{
617
+  width:30rpx;
618
+  height:30rpx;
619
+  margin: 40rpx 20rpx 0 30rpx;
620
+}
621
+.universalpic_typesize_gray_30x18{
622
+  width: 30rpx; 
623
+  height: 18rpx;
624
+  margin: 57rpx 20rpx 0 30rpx;
625
+}
626
+
627
+.numberContainerFooter11{
628
+  align-items: flex-start;
629
+  margin-top: 40rpx;
630
+}
631
+
632
+.numberContainerFooter111{
633
+  font-size:36rpx;
634
+  font-weight: 400;
635
+}
636
+.numberContainerFooter1111{
637
+  margin-top: 40rpx;
638
+}
639
+.numberContainerFooter113{
640
+  font-size:28rpx;
641
+  font-weight: 400;
642
+  margin-left: 80rpx;
643
+}
644
+
645
+.numberContainerFooter112{
646
+  justify-content: flex-start;
647
+  flex-wrap: wrap;
648
+}
649
+
650
+.numberContainerFooter1121{
651
+  line-height:73rpx;
652
+  border:3rpx solid #D2D2D2;
653
+  border-radius: 10rpx;
654
+  text-align: center;
655
+  margin: 30rpx 30rpx 0 0;
656
+  font-size:24rpx;
657
+  padding: 0 30rpx;
658
+}
659
+
660
+.numberContainerFooter1121Select{
661
+  border:3rpx solid #0071EF;
662
+  color:#fff;
663
+  background-color: #0071EF;
664
+}
665
+
666
+.RecorderPanel1{
667
+  width:100%;
668
+  height:360rpx;
669
+  background-color: #f8f8f8;
670
+  position: fixed;
671
+  bottom:131rpx;
672
+  border-top: 1rpx solid #d2d2d2;
673
+  justify-content: flex-start;
674
+}
675
+
676
+
677
+.RecorderPanel11{
678
+  width:100%;
679
+  justify-content: space-between;
680
+  margin-top: 40rpx;
681
+}
682
+.universalpic_voicerecorder_black_30x30{
683
+  width:30rpx;
684
+  height:30rpx;
685
+}
686
+
687
+.RecorderPanel111{
688
+  margin-left: 30rpx;
689
+}
690
+.RecorderPanel1111{
691
+  margin-left: 20rpx;
692
+  font-size:36rpx;
693
+}
694
+
695
+.RecorderPanel112{
696
+  font-family: 'Roboto-Black';
697
+  font-size:36rpx;
698
+  color:#787878;
699
+  margin-right: 30rpx;
700
+}
701
+.RecorderPanel1121{
702
+  color:#0071EF;
703
+}
704
+
705
+.btnRecorderStart{
706
+  width:690rpx;
707
+  line-height:110rpx;
708
+  background-color: #fff;
709
+  border:1rpx solid #9B9B9B;
710
+  text-align: center;
711
+  font-size:32rpx;
712
+  font-weight: 500;
713
+  color:#0071EF;
714
+  margin-top: 40rpx;
715
+  border-radius: 10rpx;
716
+}
717
+
718
+.RecorderPanel12{
719
+  width:690rpx;
720
+  height:110rpx;
721
+  margin-top: 20rpx;
722
+  justify-content: space-between;
723
+}
724
+
725
+.btnRecorderStart2{
726
+  width:216rpx;
727
+  color:#1E1E1E;
728
+}
729
+.btnRecorderStart3{
730
+  width:216rpx;
731
+}
732
+
733
+.btnRecorderEnd{
734
+  color:#fff;
735
+  background-color: #0071EF;
736
+  border:1rpx solid #0071EF;
737
+}
738
+
739
+.RecorderPanel2{
740
+  width:100%;
741
+  height:449rpx;
742
+  position: fixed;
743
+  bottom:492rpx;
744
+}
745
+
746
+.edit_voicerecorder_illus{
747
+  width:222rpx;
748
+  height:449rpx;
749
+}
750
+
751
+.RecorderPanel3{
752
+  width:100%;
753
+  min-height:714rpx;
754
+  position: fixed;
755
+  top:0;
756
+  justify-content: flex-start;
757
+}
758
+
759
+.RecorderPanel31{
760
+  width:100%;
761
+  height:116rpx;
762
+  justify-content: flex-start;
763
+  align-items: flex-start;
764
+}
765
+
766
+.RecorderPanel311{
767
+  font-size:24rpx;
768
+  font-weight: 400;
769
+  color:#787878;
770
+  margin: 10rpx 0 0 30rpx;
771
+}
772
+
773
+.RecorderPanel32{
774
+  width:690rpx;
775
+  height:500rpx;
776
+  font-size:36rpx;
524 777
 }

+ 12 - 0
pages/main/default.js

@@ -30,6 +30,11 @@ Page({
30 30
       });
31 31
     }
32 32
 
33
+    // //测试跳转
34
+    // wx.navigateTo({
35
+    //   url: './add?type=add&id=0',
36
+    // });
37
+
33 38
     if (app.globalData.IsIPad){
34 39
       that.setData({
35 40
         IsIPad: "_iPad",
@@ -97,6 +102,13 @@ Page({
97 102
             url: '../index/accredit',
98 103
           });
99 104
         }
105
+
106
+        if (res.authSetting['scope.record'] === true) {
107
+          app.globalData.IsRecorderAccredit = 1;
108
+        }
109
+        else if (res.authSetting['scope.record'] === false) {
110
+          app.globalData.IsRecorderAccredit = -1;
111
+        }
100 112
       }
101 113
     });
102 114
   },

+ 114 - 32
pages/main/detail.js

@@ -27,6 +27,7 @@ var innerAudioContext1;
27 27
 
28 28
 var listTaskFinished = []; //完成的任务
29 29
 var timeStart; //计算时长
30
+var timeHistory=0;//已经过去的时间
30 31
 var TaskList = [];
31 32
 var arrImage = [],
32 33
   arrImage2 = [];
@@ -34,6 +35,13 @@ var intervalSound = 0,
34 35
   intervalRefresh = 0;
35 36
 var isCollecting = false;
36 37
 
38
+var isPlaying = false;
39
+var innerAudioContext;
40
+
41
+var timeoutPlayAudio;
42
+var tempPlayUrl = "";
43
+var timeoutEveryCard=0;
44
+
37 45
 Page({
38 46
   data: {
39 47
     ImagePath: app.globalData.uploadImageUrl,
@@ -67,7 +75,15 @@ Page({
67 75
     });
68 76
 
69 77
     innerAudioContext1 = wx.createInnerAudioContext();
70
-    this.audioCtx = [];
78
+    
79
+    innerAudioContext = wx.createInnerAudioContext();
80
+    innerAudioContext.onPlay(() => {
81
+      //console.log('开始播放');
82
+    });
83
+    innerAudioContext.onEnded(() => {
84
+      //console.log('结束播放');
85
+    });
86
+
71 87
 
72 88
     this.getList();
73 89
 
@@ -119,7 +135,12 @@ Page({
119 135
   },
120 136
   onUnload: function () {
121 137
     clearInterval(intervalSound);
138
+    clearTimeout(timeoutEveryCard);
122 139
     listTaskFinished = [];
140
+    if (innerAudioContext) {
141
+      innerAudioContext.stop();
142
+      isPlaying = false;
143
+    }
123 144
   },
124 145
   onPullDownRefresh: function () {
125 146
     this.onShowAnswer({
@@ -243,7 +264,7 @@ Page({
243 264
     });
244 265
 
245 266
     listTaskFinished = [];
246
-    timeStart = new Date(); //起始时间
267
+    that.timeCompute(); //起始时间
247 268
 
248 269
     function formatList(list) {
249 270
       for (var i = 0; i < list.length; i++) {
@@ -360,13 +381,20 @@ Page({
360 381
       IsMore: false,
361 382
     });
362 383
   },
384
+  //回到上一张题卡
363 385
   gotoPrev: function () {
364 386
     var that = this;
387
+    if (innerAudioContext) {
388
+      innerAudioContext.stop();
389
+      isPlaying = false;
390
+    }
365 391
 
366 392
     if (listTaskFinished.length > 0) {
367 393
       var card = listTaskFinished.pop();
368 394
       wx.setStorageSync("ListTaskFinished", listTaskFinished);
369
-      timeStart = new Date();
395
+      
396
+      timeHistory=0;
397
+      that.timeCompute();
370 398
 
371 399
       card.Card.Number0 = card.Number0Old;
372 400
       card.Card.Number0Str = card.Number0StrOld;
@@ -412,8 +440,13 @@ Page({
412 440
       that.setSoundFile(2);
413 441
     }
414 442
   },
443
+  //进入下一张题卡
415 444
   gotoNext: function (e) {
416 445
     var that = this;
446
+    if (innerAudioContext) {
447
+      innerAudioContext.stop();
448
+      isPlaying = false;
449
+    }
417 450
 
418 451
     var btnnumber = e.currentTarget.dataset.btnnumber;
419 452
     var time = e.currentTarget.dataset.time;
@@ -509,8 +542,12 @@ Page({
509 542
     var duration = common.diffDate("s", timeStart, new Date());
510 543
     if (finishCard.btnnumber == 1)
511 544
       duration = 0;
512
-    finishCard.Duration = duration;
513
-    timeStart = new Date();
545
+    finishCard.Duration = timeHistory + duration;
546
+
547
+    //console.log("CardTime:"+finishCard.Duration);
548
+
549
+    timeHistory = 0;
550
+    that.timeCompute();
514 551
 
515 552
     //添加完成列表,去掉任务列表数据
516 553
     listTaskFinished.push(finishCard);
@@ -591,6 +628,27 @@ Page({
591 628
         that.setSoundFile(0);
592 629
     }
593 630
   },
631
+  timeCompute:function(){
632
+    var that=this;
633
+    timeStart = new Date();
634
+    clearTimeout(timeoutEveryCard);
635
+    timeoutEveryCard=setTimeout(function(){
636
+      //计算暂停时已经用掉的时长
637
+      timeHistory += common.diffDate("s", timeStart, new Date());
638
+      //console.log("timeHistory:"+timeHistory);
639
+      wx.showModal({
640
+        title: '提醒',
641
+        content: '您已等待了' + app.globalData.CardWaitTimeMax+'分钟',
642
+        showCancel: false,
643
+        confirmText: "知道了",
644
+        success(res) {
645
+          if (res.confirm) {
646
+            that.timeCompute();
647
+          }
648
+        },
649
+      })
650
+    }, app.globalData.CardWaitTimeMax*60*1000);
651
+  },
594 652
   gotoCollect: function () {
595 653
     var that = this;
596 654
     if (!isCollecting) {
@@ -612,53 +670,77 @@ Page({
612 670
     }
613 671
   },
614 672
   playSound: function (e) {
673
+    clearTimeout(timeoutPlayAudio);
674
+
615 675
     var that = this;
616 676
     var str = e.currentTarget.dataset.content;
617
-    var url = "";
618
-    if (str.indexOf("英 [") >= 0 || str.indexOf("美 [") >= 0) {
677
+    var url;
678
+    if (str == "recorder") {
679
+      url = e.currentTarget.dataset.soundmark;
680
+    }
681
+    else if (str.indexOf("英 [") >= 0 || str.indexOf("美 [") >= 0) {
619 682
       str = str.replace("英 [", "[");
620 683
       str = str.replace("美 [", "[");
621 684
       url = e.currentTarget.dataset.soundmark;
622
-    } else if (e.currentTarget.dataset.soundmark && e.currentTarget.dataset.soundmark != "undefined") {
685
+    }
686
+    else if (e.currentTarget.dataset.soundmark && e.currentTarget.dataset.soundmark != "undefined") {
623 687
       var soundmark = e.currentTarget.dataset.soundmark;
624 688
       if (soundmark && soundmark.indexOf("http") < 0) {
625 689
         url = app.globalData.audioUrlBaidu;
626 690
         url = url.replace("[token]", app.globalData.BaiduToken);
627 691
         url = url.replace("[word]", soundmark);
628
-      } else {
692
+      }
693
+      else {
629 694
         url = soundmark;
630 695
       }
631
-    } else {
696
+    }
697
+    else {
632 698
       url = app.globalData.audioUrlBaidu;
633 699
       url = url.replace("[token]", app.globalData.BaiduToken);
634 700
       url = url.replace("[word]", str);
635 701
     }
636 702
 
637
-    var arr = url.split(",");
638
-    this.audioCtx = [];
639
-    for (var i = 0; i < arr.length; i++) {
640
-      this.audioCtx.push(wx.createAudioContext('myAudio' + i));
641
-    }
642 703
 
643
-    var index = 0;
644
-    if (arr.length > 1) {
645
-      intervalSound = setInterval(function () {
646
-        that.audioCtx[index].setSrc(arr[index]);
647
-        that.audioCtx[index].play();
704
+    if (url.indexOf("http") > 0)
705
+      url = url.substr(url.indexOf("http"));
706
+    url = url.replace("http://", "https://");
648 707
 
649
-        index++;
650
-        if (index >= arr.length) {
651
-          clearInterval(intervalSound);
652
-        }
653
-      }, 1000);
654
-    } else {
655
-      if (arr[index].indexOf("http") > 0)
656
-        arr[index] = arr[index].substr(arr[index].indexOf("http"));
657
-      arr[index] = arr[index].replace("http://", "https://");
708
+    if (!isPlaying || tempPlayUrl == "" || url != tempPlayUrl) {
709
+      isPlaying = true;
710
+      timeoutPlayAudio = setTimeout(function () {
711
+        isPlaying = false;
712
+      }, 60000);
713
+      if (innerAudioContext) {
714
+        innerAudioContext.stop();
715
+      }
716
+      wx.showLoading({
717
+        title: '音频下载中',
718
+        mask: true,
719
+      });
720
+      setTimeout(function () {
721
+        wx.hideLoading();
722
+      }, 30000);
658 723
 
659
-      //console.log("play:" + arr[index]);
660
-      that.audioCtx[index].setSrc(arr[index]);
661
-      that.audioCtx[index].play();
724
+      wx.downloadFile({
725
+        url: encodeURI(url),
726
+        success(res) {
727
+          wx.hideLoading();
728
+          if (res.statusCode === 200) {
729
+            innerAudioContext.src = res.tempFilePath;
730
+            innerAudioContext.play();
731
+            tempPlayUrl = url;
732
+          }
733
+        },
734
+        fail(err) {
735
+          wx.hideLoading();
736
+        }
737
+      });
738
+    }
739
+    else {
740
+      if (innerAudioContext) {
741
+        innerAudioContext.stop();
742
+        isPlaying = false;
743
+      }
662 744
     }
663 745
   },
664 746
   getTaskTime: function () {

+ 1 - 5
pages/main/detail.wxml

@@ -211,8 +211,4 @@
211 211
   </view>
212 212
 </view>
213 213
 
214
-<canvas class='Canvas' canvas-id="shareCanvas"></canvas>
215
-<audio hidden='true' id="myAudio0"></audio>
216
-<audio hidden='true' id="myAudio1"></audio>
217
-<audio hidden='true' id="myAudio2"></audio>
218
-<audio hidden='true' id="myAudio3"></audio>
214
+<canvas class='Canvas' canvas-id="shareCanvas"></canvas>

+ 16 - 0
pages/main/detail.wxss

@@ -243,6 +243,22 @@
243 243
 }
244 244
 
245 245
 
246
+.panelItem .panelRecorder {
247
+  width:100%;
248
+  justify-content: flex-start;
249
+}
250
+.panelItem .panelRecorder0 {
251
+  width: 168rpx;
252
+  height: 70rpx;
253
+  background-color: #fff;
254
+  border-radius: 10rpx;
255
+}
256
+
257
+.panelItem .universalpic_voicerecorder_transmit_black_44x34{
258
+  width: 44rpx;
259
+  height: 34rpx;
260
+}
261
+
246 262
 .panelItem .imageContainer {
247 263
   width: 650rpx;
248 264
   margin: 6rpx 0;

+ 122 - 90
pages/main/preview.js

@@ -7,7 +7,10 @@ var arrImage = [];
7 7
 var isCopying = false;
8 8
 var isPlaying = false;
9 9
 var isCollecting = false;
10
-var playList=[];
10
+var playList = [];
11
+var innerAudioContext;
12
+var timeoutPlayAudio;
13
+var tempPlayUrl = "";
11 14
 
12 15
 Page({
13 16
   data: {
@@ -20,7 +23,7 @@ Page({
20 23
     var id = 0;
21 24
     if (options.id)
22 25
       id = options.id;
23
-    
26
+
24 27
     that.setData({
25 28
       Containnerheight: main.getWindowHeight(),
26 29
       ShowType: options.type,
@@ -29,7 +32,14 @@ Page({
29 32
     });
30 33
     console.log("MiaoguoCardID:" + id);
31 34
 
32
-    this.audioCtx = [];
35
+    innerAudioContext = wx.createInnerAudioContext();
36
+    innerAudioContext.onPlay(() => {
37
+      console.log('开始播放');
38
+    });
39
+    innerAudioContext.onEnded(() => {
40
+      console.log('结束播放');
41
+      isPlaying = false;
42
+    });
33 43
 
34 44
 
35 45
     if (options.type == "show") {
@@ -45,7 +55,7 @@ Page({
45 55
         })
46 56
       }
47 57
     }
48
-    else{
58
+    else {
49 59
       if (options.type == "share") {
50 60
         wx.setNavigationBarTitle({
51 61
           title: "来自分享"
@@ -57,15 +67,15 @@ Page({
57 67
         });
58 68
         if (that.data.ShowType == "play") {
59 69
           playList = [];
60
-          for (var i = 0; i < app.globalData.CardList.length;i++){
70
+          for (var i = 0; i < app.globalData.CardList.length; i++) {
61 71
             playList.push(app.globalData.CardList[i].MiaoguoCardID);
62 72
           }
63 73
           playList = common.randomArray(playList);
64 74
           that.data.MiaoguoCardID = playList[0];
65 75
           that.setData({
66 76
             MiaoguoCardID: that.data.MiaoguoCardID,
67
-            CurrentIndex:0,
68
-            PlayListCount:playList.length,
77
+            CurrentIndex: 0,
78
+            PlayListCount: playList.length,
69 79
           });
70 80
         }
71 81
       }
@@ -95,14 +105,14 @@ Page({
95 105
             app.globalData.CardList = [data];
96 106
             that.init();
97 107
           }
98
-          else{
99
-            var time=2000;
108
+          else {
109
+            var time = 2000;
100 110
             wx.showToast({
101 111
               title: '分享人已删除',
102
-              mask:true,
112
+              mask: true,
103 113
               duration: time,
104
-              complete:function(){
105
-                setTimeout(function(){
114
+              complete: function () {
115
+                setTimeout(function () {
106 116
                   wx.reLaunch({
107 117
                     url: './default?IsStart=1',
108 118
                   });
@@ -116,13 +126,16 @@ Page({
116 126
         that.init();
117 127
   },
118 128
   onUnload: function () {
119
-    clearInterval(intervalSound);
129
+    if (innerAudioContext) {
130
+      innerAudioContext.stop();
131
+      isPlaying = false;
132
+    }
120 133
   },
121 134
   onPullDownRefresh: function () {
122
-    var that=this;
135
+    var that = this;
123 136
     if (that.data.ShowType == "play") {
124 137
       that.setData({
125
-        IsShowAnswer: [0,0],
138
+        IsShowAnswer: [0, 0],
126 139
       });
127 140
     }
128 141
     wx.stopPullDownRefresh();
@@ -130,9 +143,9 @@ Page({
130 143
   init: function () {
131 144
     var that = this;
132 145
     var list = app.globalData.CardList;
133
-    
146
+
134 147
     var card = {};
135
-    var prevId = 0,nextId = 0;
148
+    var prevId = 0, nextId = 0;
136 149
     for (var i = 0; i < list.length; i++) {
137 150
       if (this.data.MiaoguoCardID == list[i].MiaoguoCardID) {
138 151
         if (i > 0)
@@ -148,7 +161,7 @@ Page({
148 161
         card.MiaoguoCardID = list[i].MiaoguoCardID;
149 162
         card.LimitTime = list[i].LimitTime;
150 163
         card.FontSize = list[i].FontSize;
151
-        card.IsCollect=list[i].IsCollect;
164
+        card.IsCollect = list[i].IsCollect;
152 165
         break;
153 166
       }
154 167
     }
@@ -194,20 +207,20 @@ Page({
194 207
       }
195 208
     }
196 209
 
197
-    var IsShowAnswer=[1,1];
210
+    var IsShowAnswer = [1, 1];
198 211
     if (that.data.ShowType == "play") {
199
-      IsShowAnswer=[0, 0];
212
+      IsShowAnswer = [0, 0];
200 213
       if (this.data.CurrentIndex <= 0) {
201 214
         prevId = 0;
202 215
       }
203
-      else 
216
+      else
204 217
         prevId = 1;
205 218
 
206
-      if (this.data.CurrentIndex >=playList.length-1) {
219
+      if (this.data.CurrentIndex >= playList.length - 1) {
207 220
         nextId = 0;
208 221
       }
209 222
       else
210
-        nextId=1;
223
+        nextId = 1;
211 224
     }
212 225
     this.setData({
213 226
       ID: card.MiaoguoCardID,
@@ -226,6 +239,11 @@ Page({
226 239
     wx.pageScrollTo({
227 240
       scrollTop: 0,
228 241
     });
242
+
243
+    if (innerAudioContext) {
244
+      innerAudioContext.stop();
245
+      isPlaying = false;
246
+    }
229 247
   },
230 248
   practiceToday: function () {
231 249
     var that = this;
@@ -235,9 +253,9 @@ Page({
235 253
       success(res) {
236 254
         if (res.confirm) {
237 255
 
238
-          var arr=[];
256
+          var arr = [];
239 257
           var obj = {};
240
-          obj.Card={};
258
+          obj.Card = {};
241 259
           obj.Card.MiaoguoCardID = that.data.ID;
242 260
           obj.BtnNumber = -1;
243 261
           obj.LearningType = 2;
@@ -360,68 +378,82 @@ Page({
360 378
         });
361 379
       });
362 380
     }
363
-
364 381
   },
365 382
   playSound: function (e) {
366
-    if (!isPlaying) {
367
-      isPlaying = true;
368
-      setTimeout(function () {
369
-        isPlaying = false;
370
-      }, 3000);
383
+    clearTimeout(timeoutPlayAudio);
371 384
 
372
-      var that = this;
373
-      var str = e.currentTarget.dataset.content;
374
-      var url;
375
-      if (str.indexOf("英 [") >= 0 || str.indexOf("美 [") >= 0) {
376
-        str = str.replace("英 [", "[");
377
-        str = str.replace("美 [", "[");
378
-        url = e.currentTarget.dataset.soundmark;
379
-      }
380
-      else if (e.currentTarget.dataset.soundmark && e.currentTarget.dataset.soundmark != "undefined") {
381
-        var soundmark = e.currentTarget.dataset.soundmark;
382
-        if (soundmark && soundmark.indexOf("http") < 0) {
383
-          url = app.globalData.audioUrlBaidu;
384
-          url = url.replace("[token]", app.globalData.BaiduToken);
385
-          url = url.replace("[word]", soundmark);
386
-        }
387
-        else {
388
-          url = soundmark;
389
-        }
390
-      }
391
-      else {
385
+    var that = this;
386
+    var str = e.currentTarget.dataset.content;
387
+    var url;
388
+    if (str == "recorder") {
389
+      url = e.currentTarget.dataset.soundmark;
390
+    }
391
+    else if (str.indexOf("英 [") >= 0 || str.indexOf("美 [") >= 0) {
392
+      str = str.replace("英 [", "[");
393
+      str = str.replace("美 [", "[");
394
+      url = e.currentTarget.dataset.soundmark;
395
+    }
396
+    else if (e.currentTarget.dataset.soundmark && e.currentTarget.dataset.soundmark != "undefined") {
397
+      var soundmark = e.currentTarget.dataset.soundmark;
398
+      if (soundmark && soundmark.indexOf("http") < 0) {
392 399
         url = app.globalData.audioUrlBaidu;
393 400
         url = url.replace("[token]", app.globalData.BaiduToken);
394
-        url = url.replace("[word]", str);
401
+        url = url.replace("[word]", soundmark);
402
+      }
403
+      else {
404
+        url = soundmark;
395 405
       }
406
+    }
407
+    else {
408
+      url = app.globalData.audioUrlBaidu;
409
+      url = url.replace("[token]", app.globalData.BaiduToken);
410
+      url = url.replace("[word]", str);
411
+    }
396 412
 
397
-      var arr = url.split(",");
398
-      for (var i = 0; i < arr.length; i++) {
399
-        this.audioCtx.push(wx.createAudioContext('myAudio' + i));
413
+
414
+    if (url.indexOf("http") > 0)
415
+      url = url.substr(url.indexOf("http"));
416
+    url = url.replace("http://", "https://");
417
+
418
+    if (!isPlaying || tempPlayUrl=="" || url!=tempPlayUrl) {
419
+      isPlaying = true;
420
+      timeoutPlayAudio = setTimeout(function () {
421
+        isPlaying = false;
422
+      }, 60000);
423
+      if (innerAudioContext) {
424
+        innerAudioContext.stop();
400 425
       }
401
-      var index = 0;
402
-      if (arr.length > 1) {
403
-        
404
-        intervalSound = setInterval(function () {
405
-          that.audioCtx[index].setSrc(arr[index]);
406
-          that.audioCtx[index].play();
407
-
408
-          index++;
409
-          if (index >= arr.length) {
410
-            clearInterval(intervalSound);
426
+      wx.showLoading({
427
+        title: '音频下载中',
428
+        mask: true,
429
+      });
430
+      setTimeout(function () {
431
+        wx.hideLoading();
432
+      }, 30000);
433
+
434
+      wx.downloadFile({
435
+        url: encodeURI(url),
436
+        success(res) {
437
+          wx.hideLoading();
438
+          if (res.statusCode === 200) {
439
+            innerAudioContext.src = res.tempFilePath;
440
+            innerAudioContext.play();
441
+            tempPlayUrl=url;
411 442
           }
412
-        }, 1000);
413
-      }
414
-      else {
415
-        if (arr[index].indexOf("http") > 0)
416
-          arr[index] = arr[index].substr(arr[index].indexOf("http"));
417
-        arr[index] = arr[index].replace("http://", "https://");
418
-
419
-        that.audioCtx[index].setSrc(arr[index]);
420
-        that.audioCtx[index].play();
443
+        },
444
+        fail(err) {
445
+          wx.hideLoading();
446
+        }
447
+      });
448
+    }
449
+    else {
450
+      if (innerAudioContext) {
451
+        innerAudioContext.stop();
452
+        isPlaying = false;
421 453
       }
422 454
     }
423 455
   },
424
-  getDetailInfo:function(){
456
+  getDetailInfo: function () {
425 457
     wx.navigateTo({
426 458
       url: './cardInfo?id=' + this.data.MiaoguoCardID,
427 459
     });
@@ -465,7 +497,7 @@ Page({
465 497
     });
466 498
     that.init();
467 499
   },
468
-  
500
+
469 501
   close: function () {
470 502
     wx.navigateBack({
471 503
       delta: 1,
@@ -481,7 +513,7 @@ Page({
481 513
   },
482 514
   gotoCollect: function () {
483 515
     var that = this;
484
-    if (!isCollecting){
516
+    if (!isCollecting) {
485 517
       isCollecting = true;
486 518
       setTimeout(function () {
487 519
         isCollecting = false;
@@ -506,38 +538,38 @@ Page({
506 538
         }
507 539
       });
508 540
     }
509
-    
541
+
510 542
   },
511
-  onShowAnswer:function(){
543
+  onShowAnswer: function () {
512 544
     this.setData({
513
-      IsShowAnswer:[1,1]
545
+      IsShowAnswer: [1, 1]
514 546
     });
515 547
   },
516
-  onPlayAgain:function(){
548
+  onPlayAgain: function () {
517 549
     playList.push(this.data.MiaoguoCardID);
518 550
     this.setData({
519 551
       PlayListCount: playList.length,
520
-      NextID:1,
552
+      NextID: 1,
521 553
     });
522 554
     wx.showToast({
523 555
       title: '稍后回放',
524
-      mask:true,
525
-      duration:500,
556
+      mask: true,
557
+      duration: 500,
526 558
     });
527 559
   },
528 560
   playNext: function (e) {
529 561
     var that = this;
530 562
     var div = e.currentTarget.dataset.div;
531
-    if (div==1){
563
+    if (div == 1) {
532 564
       this.data.CurrentIndex++;
533
-      if (this.data.CurrentIndex>=playList.length){
534
-        this.data.CurrentIndex = playList.length-1;
565
+      if (this.data.CurrentIndex >= playList.length) {
566
+        this.data.CurrentIndex = playList.length - 1;
535 567
       }
536 568
     }
537 569
     else {
538 570
       this.data.CurrentIndex--;
539
-      if (this.data.CurrentIndex<0)
540
-        this.data.CurrentIndex=0;
571
+      if (this.data.CurrentIndex < 0)
572
+        this.data.CurrentIndex = 0;
541 573
     }
542 574
     that.setData({
543 575
       CurrentIndex: this.data.CurrentIndex,
@@ -604,7 +636,7 @@ Page({
604 636
     }, 1000);
605 637
     return {
606 638
       title: '我的分享',
607
-      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID + '&Share=1&ColorIndex='+app.globalData.ColorIndex+'&MiaoguoCardID=' + this.data.MiaoguoCardID,
639
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID + '&Share=1&ColorIndex=' + app.globalData.ColorIndex + '&MiaoguoCardID=' + this.data.MiaoguoCardID,
608 640
     }
609 641
   },
610 642
 })

+ 1 - 6
pages/main/preview.wxml

@@ -101,9 +101,4 @@
101 101
     </view>
102 102
   </view>
103 103
   
104
-</view>
105
-
106
-<audio hidden='true' id="myAudio0"></audio>
107
-<audio hidden='true' id="myAudio1"></audio>
108
-<audio hidden='true' id="myAudio2"></audio>
109
-<audio hidden='true' id="myAudio3"></audio>
104
+</view>

+ 16 - 0
pages/main/preview.wxss

@@ -258,6 +258,22 @@
258 258
   height: 20rpx;
259 259
 }
260 260
 
261
+.panelItem .panelRecorder {
262
+  width:100%;
263
+  justify-content: flex-start;
264
+}
265
+.panelItem .panelRecorder0 {
266
+  width: 168rpx;
267
+  height: 70rpx;
268
+  background-color: #fff;
269
+  border-radius: 10rpx;
270
+}
271
+
272
+.panelItem .universalpic_voicerecorder_transmit_black_44x34{
273
+  width: 44rpx;
274
+  height: 34rpx;
275
+}
276
+
261 277
 .panelItem .textProblem{
262 278
   padding: 3rpx 20rpx;
263 279
   background-color: #F1AB1E;

+ 144 - 35
pages/main/searchCardList.js

@@ -3,10 +3,17 @@ import main from '../../utils/main';
3 3
 
4 4
 const app = getApp();
5 5
 var intervalRefresh = 0;
6
+var arrOrder = [
7
+  { Name: "最近添加", Value: "ac.MiaoguoCardID desc", CSS: "numberContainerFooter1121Select" },
8
+  { Name: "较早添加", Value: "ac.MiaoguoCardID asc" },
9
+  { Name: "练习次数", Value: "ac.LearnNumber desc,ac.MiaoguoCardID desc" }
10
+];
6 11
 
7 12
 Page({
8 13
   data: {
9
-    HasPage:false,
14
+    HasPage: false,
15
+    ArrOrder: arrOrder,
16
+    OrderType: arrOrder[0].Value,
10 17
   },
11 18
   onLoad: function (options) {
12 19
     var that = this;
@@ -29,27 +36,20 @@ Page({
29 36
       wx.setNavigationBarTitle({
30 37
         title: "幻灯片"
31 38
       });
32
-      IsCollect=1;
39
+      IsCollect = 1;
33 40
     }
34 41
 
35 42
     that.setData({
36
-      IsCollect:IsCollect,
43
+      IsCollect: IsCollect,
37 44
       Search: Search,
38 45
       IsToday: IsToday,
39
-      Count: options.Count,
46
+      Count: options.count,
40 47
       Containnerheight: main.getWindowHeight(),
41 48
     });
42 49
   },
43 50
   onShow: function () {
44 51
     var that = this;
45 52
     that.getList();
46
-    main.getData("GetUserCardCount?UserID=" + app.globalData.userInfo.UserID, function (data) {
47
-      if (data) {
48
-        that.setData({
49
-          Count: data.CardNumber,
50
-        });
51
-      }
52
-    });
53 53
 
54 54
     //题卡主题色
55 55
     var arrColorIndex = wx.getStorageSync("ColorIndexArr");
@@ -63,17 +63,19 @@ Page({
63 63
   onPullDownRefresh: function () {
64 64
     var that = this;
65 65
     if (!that.data.IsCollect && !that.data.IsToday) {
66
-      app.globalData.CardList=[];
67
-      that.gotoNextPage({currentTarget:{dataset:{id:0}}});
66
+      app.globalData.CardList = [];
67
+      that.gotoNextPage({ currentTarget: { dataset: { id: 0 } } });
68 68
     }
69 69
     wx.stopPullDownRefresh();
70 70
   },
71 71
   getList: function () {
72
-    var that=this;
72
+    var that = this;
73 73
     var list = app.globalData.CardList;
74 74
     var len = 16;
75 75
     for (var i = 0; i < list.length; i++) {
76 76
       var item = list[i];
77
+      item.ScrollLeft = 0;
78
+      item.DeleteStr = "删除";
77 79
       item.Content[1].ContentStr = replaceString(item.Content[1].Content);
78 80
       if (item.Content[1].ContentStr.length > len)
79 81
         item.Content[1].ContentStr = replaceString(item.Content[1].ContentStr.substr(0, len)) + "...";
@@ -108,22 +110,50 @@ Page({
108 110
     //   app.globalData.CardList=list;
109 111
     // }
110 112
 
111
-    var hasPage=false;
112
-    if (list.length<that.data.Count && that.data.IsToday==0 && !that.data.IsCollect)
113
-      hasPage=true;
114
-    
115
-    this.setData({
116
-      List: list,
117
-      HasPage:hasPage,
118
-    });
113
+
114
+    if (!that.data.IsCollect && !that.data.IsToday) {
115
+      main.getData("GetUserCardCount?UserID=" + app.globalData.userInfo.UserID, function (data) {
116
+        if (data) {
117
+          that.setData({
118
+            Count: data.CardNumber,
119
+          });
120
+          var hasPage = false;
121
+          if (list.length < that.data.Count && that.data.IsToday == 0 && !that.data.IsCollect)
122
+            hasPage = true;
123
+
124
+          that.setData({
125
+            List: list,
126
+            HasPage: hasPage,
127
+          });
128
+
129
+
130
+        }
131
+      });
132
+    }
133
+    else {
134
+      that.setData({
135
+        Count: list.length,
136
+      });
137
+      var hasPage = false;
138
+      if (list.length < that.data.Count && that.data.IsToday == 0 && !that.data.IsCollect)
139
+        hasPage = true;
140
+
141
+      that.setData({
142
+        List: list,
143
+        HasPage: hasPage,
144
+      });
145
+
146
+    }
147
+
119 148
     wx.hideLoading();
120 149
 
121 150
     function getImage(str) {
122 151
       var result = "";
123 152
       if (str.indexOf("[图") >= 0) {
124
-        result = str.substring(str.indexOf("[图]") + 3, str.indexOf("[/图]"));
153
+        result = str.substring(str.indexOf("[图") + 3, str.indexOf("[/图]"));
125 154
         result = result.substring(result.indexOf("]") + 1);
126 155
       }
156
+      //console.log(result);
127 157
       return result;
128 158
     }
129 159
 
@@ -165,7 +195,7 @@ Page({
165 195
       url: './preview?type=show&id=' + id,
166 196
     })
167 197
   },
168
-  playPPT:function(){
198
+  playPPT: function () {
169 199
     wx.navigateTo({
170 200
       url: './preview?type=play',
171 201
     })
@@ -178,17 +208,16 @@ Page({
178 208
     wx.downloadFile({
179 209
       url: serverUrl, // 仅为示例,并非真实的资源
180 210
       success(res) {
181
-        // 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容
182 211
         if (res.statusCode === 200) {
183 212
           main.saveTempImage(serverUrl, res.tempFilePath);
184 213
         }
185 214
       }
186 215
     });
187 216
 
188
-    clearTimeout(intervalRefresh);
189
-    intervalRefresh = setTimeout(function () {
190
-      that.getList();
191
-    }, 1000);
217
+    // clearTimeout(intervalRefresh);
218
+    // intervalRefresh = setTimeout(function () {
219
+    //   that.getList();
220
+    // }, 1000);
192 221
   },
193 222
   gotoNextPage: function (e) {
194 223
     wx.showLoading({
@@ -197,15 +226,20 @@ Page({
197 226
     setTimeout(function () {
198 227
       wx.hideLoading();
199 228
     }, 5000);
200
-    
229
+
201 230
     var that = this;
202
-    var id = e.currentTarget.dataset.id;
203 231
     var url = 'GetMiaoguoCardList?UserID=' + app.globalData.userInfo.UserID + "&IsToday=" + that.data.IsToday;
204
-    if (id && id>0)
205
-      url+="&PageID=" + id;
232
+    var id = e.currentTarget.dataset.id;
233
+    if (id && id > 0)
234
+      url += "&PageID=" + id;
206 235
     if (that.data.Search)
207 236
       url += "&Key=" + that.data.Search;
208 237
 
238
+    var orderType = that.data.OrderType;
239
+    if (orderType)
240
+      url += "&OrderType=" + orderType;
241
+
242
+
209 243
     main.getData(url, function (data) {
210 244
       if (data) {
211 245
 
@@ -213,7 +247,7 @@ Page({
213 247
         for (var i = 0; i < data.List.length; i++) {
214 248
           list.push(data.List[i]);
215 249
         }
216
-        app.globalData.CardList=list;
250
+        app.globalData.CardList = list;
217 251
         that.getList();
218 252
       }
219 253
     });
@@ -223,11 +257,86 @@ Page({
223 257
       url: './add?type=add&id=0',
224 258
     });
225 259
   },
226
-  onSearch:function(){
260
+  onSearch: function () {
227 261
     wx.navigateBack({
228 262
       delta: 1,
229 263
     });
230 264
   },
265
+  onOrder: function (e) {
266
+    var that = this;
267
+    var value = e.currentTarget.dataset.value;
268
+    for (var i = 0; i < this.data.ArrOrder.length; i++) {
269
+      if (this.data.ArrOrder[i].Value == value)
270
+        this.data.ArrOrder[i].CSS = "numberContainerFooter1121Select";
271
+      else
272
+        this.data.ArrOrder[i].CSS = "";
273
+    }
274
+    this.setData({
275
+      IsOrder: false,
276
+      ArrOrder: this.data.ArrOrder,
277
+      OrderType: value,
278
+    });
279
+
280
+    if (!that.data.IsCollect && !that.data.IsToday) {
281
+      app.globalData.CardList = [];
282
+      that.gotoNextPage({ currentTarget: { dataset: { id: 0, OrderType: value } } });
283
+    }
284
+  },
285
+  showOrder: function () {
286
+    this.setData({
287
+      IsOrder: true,
288
+    });
289
+  },
290
+  closeOrder: function () {
291
+    this.setData({
292
+      IsOrder: false,
293
+    });
294
+  },
295
+  DeleteItem: function (e) {
296
+    var that = this;
297
+    var id = e.currentTarget.dataset.id;
298
+    var list = this.data.List;
299
+    var b = true;
300
+    for (var i = 0; i < list.length; i++) {
301
+      var item = list[i];
302
+      if (id == item.MiaoguoCardID) {
303
+        if (item.DeleteStr == "删除") {
304
+          item.ScrollLeft = 160;
305
+          item.DeleteStr = "确认删除";
306
+        }
307
+        else if (item.DeleteStr == "确认删除") {
308
+          b = false;
309
+          item.DeleteStr = "删除";
310
+          item.ScrollLeft = 0;
311
+          var url = 'DeleteMiaoguoCard?UserID=' + app.globalData.userInfo.UserID;
312
+          url += "&ID=" + id;
313
+          main.getData(url, function (data) {
314
+            var list = app.globalData.CardList;
315
+            for (var i = 0; i < list.length; i++) {
316
+              if (id == list[i].MiaoguoCardID) {
317
+                list.splice(i, 1);
318
+                break;
319
+              }
320
+            }
321
+            app.globalData.CardList = list;
322
+            that.setData({
323
+              List: list,
324
+              Count:--that.data.Count,
325
+            });
326
+          });
327
+        }
328
+      }
329
+      else {
330
+        item.DeleteStr = "删除";
331
+        item.ScrollLeft = 0;
332
+      }
333
+    }
334
+    if (b) {
335
+      that.setData({
336
+        List: list,
337
+      });
338
+    }
339
+  },
231 340
   onShareAppMessage: function () {
232 341
     return {
233 342
       title: app.globalData.ShareTitle,

+ 45 - 16
pages/main/searchCardList.wxml

@@ -11,10 +11,10 @@
11 11
         <image class="universalpic_add_black_30x30" src='../images/universalpic_add_black_30x30.png' />
12 12
       </view>
13 13
       <view>{{Count}}张题卡</view>
14
-      <view class='panelTop1 FlexRow' bindtap='' wx:if="{{List.length>0}}">
15
-        <!-- <image class="universalpic_sequence_black_30x30" src='../images/universalpic_sequence_black_30x30.png' /> -->
14
+      <view class='panelTop1 FlexRow' bindtap='showOrder' wx:if="{{List.length>0 && !IsCollect && !IsToday}}">
15
+        <image class="universalpic_sequence_black_30x30" src='../images/universalpic_sequence_black_30x30.png' />
16 16
       </view>
17
-      <view class='panelTop1 FlexRow' wx:if='{{List.length==0}}'>
17
+      <view class='panelTop1 FlexRow' wx:if='{{List.length==0 || IsCollect || IsToday}}'>
18 18
       </view>
19 19
     </view>
20 20
   </view>
@@ -25,29 +25,38 @@
25 25
       <view class="lineWidthAll FlexRow" wx:if="{{index>0}}">
26 26
         <view class="lineWidth720"></view>
27 27
       </view>
28
-      <view class="panelItem FlexRow" bindtap='onPreview' data-id="{{item.MiaoguoCardID}}">
29
-        <view class="panelItem1 FlexRow">
30
-          <image class="ImageCSS" mode="aspectFill" src='{{item.ImageUrlTemp}}' wx:if="{{item.ImageUrlServer}}" binderror="onBindError" data-id="{{item.MiaoguoCardID}}" data-serverurl="{{item.ImageUrlServer}}" />
31
-          <view class="panelItem11 FlexColumn">
32
-            <view class='Text1'>{{item.Content[1].ContentStr}}</view>
33
-            <view class='Text2'>{{item.Content[2].ContentStr}}</view>
28
+      <scroll-view class="ScrollView" scroll-left="{{item.ScrollLeft}}" scroll-x="true" data-index="{{index}}">
29
+        <view class='CellItem'>
30
+          <view class="panelItem FlexRow" bindtap='onPreview' data-id="{{item.MiaoguoCardID}}">
31
+            <view class="panelItem1 FlexRow">
32
+              <image class="ImageCSS" mode="aspectFill" src='{{item.ImageUrlTemp}}' wx:if="{{item.ImageUrlServer}}" binderror="onBindError" data-id="{{item.MiaoguoCardID}}" data-serverurl="{{item.ImageUrlServer}}" />
33
+              <view class="panelItem11 FlexColumn">
34
+                <view class='Text1'>{{item.Content[1].ContentStr}}</view>
35
+                <view class='Text2'>{{item.Content[2].ContentStr}}</view>
36
+              </view>
37
+            </view>
38
+            <view class="panelItem2 FlexColumn">
39
+              <view>{{item.CreateTimeStr}}</view>
40
+              <view class='panelItem21'>
41
+                <image class="universalpic_fav_default_gray_26x24" src='../images/universalpic_fav_default_gray_26x24.png' wx:if="{{item.IsCollect==1}}" />
42
+              </view>
43
+            </view>
34 44
           </view>
35 45
         </view>
36
-        <view class="panelItem2 FlexColumn">
37
-          <view>{{item.CreateTimeStr}}</view>
38
-          <view class='panelItem21'>
39
-            <image class="universalpic_fav_default_gray_26x24" src='../images/universalpic_fav_default_gray_26x24.png' wx:if="{{item.IsCollect==1}}" />
46
+        <view class='CellDelete'>
47
+          <view class='DeleteItem' catchtap='DeleteItem' data-id="{{item.MiaoguoCardID}}">
48
+            <block wx:if="{{item.DeleteStr=='确认删除'}}">{{item.DeleteStr}}</block>
49
+            <image class="universalpic_del_white_20x28" src='../images/universalpic_del_white_20x28.png' wx:if="{{item.DeleteStr=='删除'}}" />
40 50
           </view>
41 51
         </view>
42
-      </view>
52
+      </scroll-view>
43 53
     </block>
44 54
     <view class="lineWidthAll FlexRow" wx:if="{{HasPage}}">
45 55
       <view class="lineWidth750"></view>
46 56
     </view>
47
-    <view class='panelItem3 panelItem FlexRow' wx:if="{{HasPage}}" bindtap='gotoNextPage' data-id="{{List[List.length-1].MiaoguoCardID}}">
57
+    <view class='panelItem3' wx:if="{{HasPage}}" bindtap='gotoNextPage' data-id="{{List[List.length-1].MiaoguoCardID}}">
48 58
       <view class="more">更多</view>
49 59
     </view>
50
-    <view class='lineFooter'></view>
51 60
 
52 61
     <view style='width:100%;height:100rpx;' wx:if="{{IsCollect!=1}}"></view>
53 62
     <view style='width:100%;height:200rpx;' wx:if="{{IsCollect==1}}"></view>
@@ -65,4 +74,24 @@
65 74
       <view class='Text4'>从左上角按钮添加新题卡</view>
66 75
     </view>
67 76
   </block>
77
+</view>
78
+
79
+<!-- 更多功能 -->
80
+<view wx:if="{{IsOrder}}" class="numberContainer FlexColumn" style='height:{{Containnerheight}}rpx;'>
81
+  <view class="numberContainerFooter1 FlexColumn">
82
+    <view class='lineFooter'></view>
83
+    <view class='numberContainerFooter101 FlexRow'>
84
+      <image class="universalpic_sequence_black_30x30_2 universalpic_sequence_black_30x30" src='../images/universalpic_sequence_black_30x30.png' />
85
+      <view class='numberContainerFooter11 FlexColumn'>
86
+        <view class='numberContainerFooter111'>调整排序</view>
87
+        <view class='numberContainerFooter112 FlexRow'>
88
+          <view class='{{item.CSS}} numberContainerFooter1121' wx:for="{{ArrOrder}}" wx:key="index" catchtap='onOrder' data-value='{{item.Value}}'>{{item.Name}}</view>
89
+        </view>
90
+      </view>
91
+    </view>
92
+  </view>
93
+  <view class='lineFooter'></view>
94
+  <view class="numberContaineFooter FlexRow" catchtap='closeOrder'>
95
+    <view>关闭</view>
96
+  </view>
68 97
 </view>

+ 235 - 66
pages/main/searchCardList.wxss

@@ -1,71 +1,96 @@
1
-.panelTop{
1
+.panelTop {
2 2
   width: 100%;
3 3
   background-color: #fff;
4 4
   position: fixed;
5
-  top:0;
5
+  top: 0;
6 6
   z-index: 10;
7 7
   border-bottom: 1rpx solid #d2d2d2;
8 8
 }
9 9
 
10
-.panelTop0{
10
+.panelTop0 {
11 11
   width: 100%;
12
-  height:100rpx;
12
+  height: 100rpx;
13 13
   font-size: 28rpx;
14 14
   font-weight: 400;
15 15
   justify-content: space-between;
16 16
 }
17 17
 
18
-.panelSearch{
19
-  width:100%;
18
+.panelSearch {
19
+  width: 100%;
20 20
   background-color: #fff;
21 21
 }
22
-.panelSearch1{
23
-  width:690rpx;
24
-  height:80rpx;
22
+
23
+.panelSearch1 {
24
+  width: 690rpx;
25
+  height: 80rpx;
25 26
   margin: 20rpx 0 10rpx 0;
26 27
   border-radius: 14rpx;
27
-  background-color: #F0F0F0;
28
-  color:#787878;
29
-  font-size:28rpx;
28
+  background-color: #f0f0f0;
29
+  color: #787878;
30
+  font-size: 28rpx;
30 31
   font-weight: 400;
31 32
   justify-content: flex-start;
32 33
 }
33 34
 
34
-.universalpic_search_gray_30x30{
35
-  width:30rpx;
36
-  height:30rpx;
35
+.universalpic_search_gray_30x30 {
36
+  width: 30rpx;
37
+  height: 30rpx;
37 38
   margin: 0 20rpx 0 30rpx;
38 39
 }
39 40
 
40
-.input{
41
-  font-size:28rpx;
41
+.input {
42
+  font-size: 28rpx;
42 43
   font-weight: 400;
43
-  color:#1e1e1e;
44
-  width:600rpx;
45
-  height:40rpx;
44
+  color: #1e1e1e;
45
+  width: 600rpx;
46
+  height: 40rpx;
46 47
 }
47 48
 
48 49
 .panelTop1 {
49
-  width:90rpx;
50
-  height:100rpx;
50
+  width: 90rpx;
51
+  height: 100rpx;
51 52
 }
52 53
 
53
-.universalpic_add_black_30x30{
54
-  width:30rpx;
55
-  height:30rpx;
54
+.universalpic_add_black_30x30 {
55
+  width: 30rpx;
56
+  height: 30rpx;
56 57
 }
57 58
 
58
-.universalpic_sequence_black_30x30{
59
-  width:30rpx;
60
-  height:30rpx;
59
+.universalpic_sequence_black_30x30 {
60
+  width: 30rpx;
61
+  height: 30rpx;
61 62
 }
62 63
 
63
-.panelItem {
64
+.ScrollView {
64 65
   width: 100%;
66
+  height: 136rpx;
67
+  display: flex;
68
+  white-space: nowrap;
69
+}
70
+
71
+.CellItem {
72
+  width: 750rpx;
73
+  display: inline-block;
74
+  height: 136rpx;
75
+  position: relative;
76
+}
77
+
78
+.CellDelete {
79
+  width: 160rpx;
80
+  display: inline-block;
81
+  height: 136rpx;
82
+  position: relative;
83
+}
84
+
85
+.panelItem {
86
+  width: 750rpx;
65 87
   justify-content: space-between;
66 88
   font-size: 28rpx;
67 89
   height: 136rpx;
68 90
   background-color: #fff;
91
+  position: absolute;
92
+  top: 0;
93
+  left: 0;
69 94
 }
70 95
 
71 96
 .panelItem1 {
@@ -73,9 +98,9 @@
73 98
   justify-content: flex-start;
74 99
 }
75 100
 
76
-.ImageCSS{
77
-  width:75rpx;
78
-  height:75rpx;
101
+.ImageCSS {
102
+  width: 75rpx;
103
+  height: 75rpx;
79 104
   margin-right: 20rpx;
80 105
 }
81 106
 
@@ -83,80 +108,224 @@
83 108
   align-items: flex-start;
84 109
 }
85 110
 
86
-.panelItem1 .Text1{
111
+.panelItem1 .Text1 {
87 112
   font-weight: 400;
88
-  font-size:30rpx;
113
+  font-size: 30rpx;
89 114
   overflow: hidden;
90 115
 }
91
-.panelItem1 .Text2{
116
+
117
+.panelItem1 .Text2 {
92 118
   font-weight: 400;
93
-  font-size:24rpx;
119
+  font-size: 24rpx;
94 120
   overflow: hidden;
95
-  color:#787878;
121
+  color: #787878;
96 122
 }
97 123
 
98 124
 .panelItem2 {
99 125
   margin-right: 30rpx;
100
-  color: #9B9B9B;
101
-  font-size:22rpx;
126
+  color: #9b9b9b;
127
+  font-size: 22rpx;
102 128
   font-weight: 400;
103 129
   align-items: flex-end;
104 130
 }
105 131
 
106 132
 .panelItem21 {
107
-  width:26rpx;
108
-  height:24rpx;
133
+  width: 26rpx;
134
+  height: 24rpx;
109 135
   margin-top: 14rpx;
110 136
 }
111 137
 
112
-.panelNull{
138
+.panelNull {
113 139
   margin-top: 150rpx;
114
-  width:100%;
140
+  width: 100%;
115 141
   align-items: flex-start;
116 142
 }
117
-.Text3{
118
-  font-size:32rpx;
143
+
144
+.Text3 {
145
+  font-size: 32rpx;
119 146
   margin-left: 30rpx;
120 147
 }
121
-.Text4{
148
+
149
+.Text4 {
122 150
   margin-top: 10rpx;
123
-  font-size:24rpx;
124
-  color:#787878;
151
+  font-size: 24rpx;
152
+  color: #787878;
125 153
   font-weight: 400;
126 154
   margin-left: 30rpx;
127 155
 }
128 156
 
129 157
 .panelItem3 {
130 158
   justify-content: center;
131
-  height:100rpx;
159
+  height: 100rpx;
160
+  width: 100%;
161
+}
162
+
163
+.DeleteItem {
164
+  background-color: #B3443B;
165
+  width: 160rpx;
166
+  height: 136rpx;
167
+  line-height: 136rpx;
168
+  color: #fff;
169
+  text-align: center;
170
+  font-size: 30rpx;
171
+  position: absolute;
172
+  top: 0;
173
+  left: 0;
132 174
 }
133 175
 
134
-.more{
135
-  font-size:28rpx;
136
-  color:#0071EF;
176
+.universalpic_del_white_20x28 {
177
+  width: 20rpx;
178
+  height: 28rpx;
137 179
 }
138 180
 
139
-.panelFooter{
140
-  width:100%;
141
-  height:120rpx;
142
-  border-top:1rpx solid #D2D2D2;
181
+.more {
182
+  font-size: 28rpx;
183
+  color: #0071ef;
184
+  width: 100%;
185
+  height: 100rpx;
186
+  text-align: center;
187
+  line-height: 100rpx;
188
+}
189
+
190
+.panelFooter {
191
+  width: 100%;
192
+  height: 120rpx;
193
+  border-top: 1rpx solid #d2d2d2;
143 194
   position: fixed;
144
-  bottom:0;
195
+  bottom: 0;
145 196
   background-color: #fff;
146 197
 }
147
-.panelFooter .btn{
198
+
199
+.panelFooter .btn {
148 200
   width: 602rpx;
149 201
   background-color: #fff;
150
-  border:1rpx solid #9B9B9B;
151
-  color:#0071EF;
202
+  border: 1rpx solid #9b9b9b;
203
+  color: #0071ef;
152 204
   text-align: center;
153 205
   line-height: 80rpx;
154
-  height:80rpx;
206
+  height: 80rpx;
207
+  border-radius: 10rpx;
208
+  font-size: 32rpx;
209
+}
210
+
211
+.universalpic_fav_default_gray_26x24 {
212
+  width: 26rpx;
213
+  height: 24rpx;
214
+}
215
+
216
+/* 更多功能 */
217
+
218
+.numberContainer {
219
+  width: 100%;
220
+  justify-content: flex-start;
221
+  align-items: flex-start;
222
+  position: fixed;
223
+  top: 0;
224
+  background-color: #fff;
225
+  color: #1e1e1e;
226
+  z-index: 20;
227
+}
228
+
229
+.numberContainer .numberContaineFooter {
230
+  width: 100%;
231
+  position: fixed;
232
+  bottom: 0;
233
+  align-items: flex-start;
234
+  font-size: 36rpx;
235
+  border-top: 1rpx solid rgba(0, 0, 0, 0.2);
236
+  text-align: center;
237
+  line-height: 131rpx;
238
+}
239
+
240
+.universalpic_sequence_black_30x30_2 {
241
+  margin: 50rpx 20rpx 0 30rpx;
242
+}
243
+
244
+.numberContainerFooter1 {
245
+  width: 100%;
246
+  position: fixed;
247
+  bottom: 131rpx;
248
+}
249
+
250
+.numberContainerFooter102 {
251
+  width: 100%;
252
+  height: 132rpx;
253
+  justify-content: flex-start;
254
+}
255
+
256
+.numberContainerFooter103 {
257
+  width: 100%;
258
+  height: 111rpx;
259
+  justify-content: flex-start;
260
+}
261
+
262
+.numberContainerFooter104 {
263
+  width: 100%;
264
+  height: 100rpx;
265
+  justify-content: flex-start;
266
+}
267
+
268
+.numberContainerFooter101 {
269
+  width: 100%;
270
+  height: 234rpx;
271
+  justify-content: flex-start;
272
+  align-items: flex-start;
273
+}
274
+
275
+.universalpic_edit_gray_25x25 {
276
+  width: 25rpx;
277
+  height: 25rpx;
278
+  margin: 0 30rpx 0 30rpx;
279
+}
280
+
281
+.universalpic_bell_gray_30x30 {
282
+  width: 30rpx;
283
+  height: 30rpx;
284
+  margin: 40rpx 20rpx 0 30rpx;
285
+}
286
+
287
+.universalpic_typesize_gray_30x18 {
288
+  width: 30rpx;
289
+  height: 18rpx;
290
+  margin: 57rpx 20rpx 0 30rpx;
291
+}
292
+
293
+.numberContainerFooter11 {
294
+  align-items: flex-start;
295
+  margin-top: 40rpx;
296
+}
297
+
298
+.numberContainerFooter111 {
299
+  font-size: 36rpx;
300
+  font-weight: 400;
301
+}
302
+
303
+.numberContainerFooter1111 {
304
+  margin-top: 40rpx;
305
+}
306
+
307
+.numberContainerFooter113 {
308
+  font-size: 28rpx;
309
+  font-weight: 400;
310
+  margin-left: 80rpx;
311
+}
312
+
313
+.numberContainerFooter112 {
314
+  justify-content: flex-start;
315
+}
316
+
317
+.numberContainerFooter1121 {
318
+  width: 156rpx;
319
+  line-height: 73rpx;
320
+  border: 3rpx solid #d2d2d2;
155 321
   border-radius: 10rpx;
156
-  font-size:32rpx;
322
+  text-align: center;
323
+  margin: 30rpx 30rpx 0 0;
324
+  font-size: 24rpx;
157 325
 }
158 326
 
159
-.universalpic_fav_default_gray_26x24{
160
-  width:26rpx;
161
-  height:24rpx;
162
-}
327
+.numberContainerFooter1121Select {
328
+  border: 3rpx solid #0071ef;
329
+  color: #fff;
330
+  background-color: #0071ef;
331
+}

+ 2 - 2
pages/main/setting.js

@@ -5,8 +5,8 @@ const app = getApp();
5 5
 const arrSortType = ["随机抽取的题卡", "时间较早的题卡", "时间较近的题卡"];
6 6
 const arrSortType2 = ["随机的", "较早的", "较近的"];
7 7
 const arrClickType = ["专属按钮", "点击空白", "两种方式"];
8
-var arrUserName = ["程晟涵", "大耳兔", "teresa", "古利古拉", "Lucy-chan", "临时"];
9
-var arrUserID = [2, 11, 8, 9, 10, 309];
8
+var arrUserName = ["程晟涵", "临时"];
9
+var arrUserID = [2, 787];
10 10
 
11 11
 Page({
12 12
   data: {

+ 17 - 6
pages/template/cardShow.wxml

@@ -1,6 +1,6 @@
1 1
 <template name="CardShow">
2 2
   <!-- 第一段 -->
3
-  <view class="panelField1 FlexColumn" >
3
+  <view class="panelField1 FlexColumn">
4 4
     <view class="editFieldNull"></view>
5 5
     <block wx:if="{{ShowType=='show'}}">
6 6
       <view class="LimitTime FlexColumn">
@@ -20,10 +20,10 @@
20 20
         <text class="textNormal" selectable="true" space='ensp' wx:if="{{item.Type=='line'}}">
21 21
             <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem" wx:for-index="contentIndex">
22 22
               <text space='ensp' wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
23
-              <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
24
-              <text class="textHighlighter" wx:if="{{contentItem.key=='highlighter'}}" style='background-color:{{Color.LineColor}};'>{{contentItem.value}}</text>
25
-            </block>
26
-        </text>
23
+        <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
24
+        <text class="textHighlighter" wx:if="{{contentItem.key=='highlighter'}}" style='background-color:{{Color.LineColor}};'>{{contentItem.value}}</text>
25
+      </block>
26
+      </text>
27 27
 
28 28
       <view class="panelSound FlexRow" hover-class='panelSoundHover' hover-stay-time="1000" wx:if="{{item.Type=='sound'}}" catchtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="1">
29 29
         <image class="universalpic_read_mark_black_20x20" src='../images/universalpic_read_mark_black_20x20.png' />
@@ -31,6 +31,12 @@
31 31
 
32 32
       <view class="textPinyin" hover-class='panelSoundHover1' hover-stay-time="1000" wx:if="{{item.Type=='sound'}}" catchtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="1">{{item.Content}}</view>
33 33
 
34
+      <view class="panelRecorder FlexRow" wx:if="{{item.Type=='recorder'}}">
35
+        <view class="panelRecorder0 FlexRow" hover-class='panelSoundHover' hover-stay-time="1000" catchtap="playSound" data-content="recorder" data-soundmark="{{item.SoundMark}}" data-fieldid="1">
36
+          <image class="universalpic_voicerecorder_transmit_black_44x34" src='../images/universalpic_voicerecorder_transmit_black_44x34.png' />
37
+        </view>
38
+      </view>
39
+
34 40
       <view class="imageContainer FlexColumn" wx:if="{{item.Type=='image'}}" style='width:{{item.Width}}rpx;height:{{item.Height}}rpx;'>
35 41
         <image class="imageFree" mode="widthFix" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" data-serverurl="{{item.ContentServer}}" binderror="onBindError" />
36 42
       </view>
@@ -70,7 +76,7 @@
70 76
             <text space='ensp' wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
71 77
             <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
72 78
             <text class="textHighlighter" wx:if="{{contentItem.key=='highlighter'}}" style='background-color:{{Color.LineColor}};'>{{contentItem.value}}</text>
73
-            
79
+
74 80
           </block>
75 81
           </text>
76 82
 
@@ -80,6 +86,11 @@
80 86
 
81 87
           <view class="textPinyin" hover-class='panelPinyinHover1' hover-stay-time="1000" wx:if="{{item.Type=='sound'}}" catchtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="{{itemParent}}">{{item.Content}}</view>
82 88
 
89
+          <view class="panelRecorder FlexRow" wx:if="{{item.Type=='recorder'}}">
90
+            <view class="panelRecorder0 FlexRow" hover-class='panelSoundHover' hover-stay-time="1000" catchtap="playSound" data-content="recorder" data-soundmark="{{item.SoundMark}}" data-fieldid="{{itemParent}}">
91
+              <image class="universalpic_voicerecorder_transmit_black_44x34" src='../images/universalpic_voicerecorder_transmit_black_44x34.png' />
92
+            </view>
93
+          </view>
83 94
           <view class="imageContainer2 FlexColumn" wx:if="{{item.Type=='image'}}" style='width:{{item.Width}}rpx;height:{{item.Height}}rpx;'>
84 95
             <image class="imageFree2" mode="widthFix" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" data-serverurl="{{item.ContentServer}}" binderror="onBindError" />
85 96
           </view>

+ 12 - 0
utils/main.js

@@ -299,8 +299,10 @@ function changeStringToView(field) {
299 299
 
300 300
         str = str.replace(/\[读/g, "\n[读");
301 301
         str = str.replace(/\[图/g, "\n[图");
302
+        str = str.replace(/\[音/g, "\n[音");
302 303
         str = str.replace(/\[\/读\]/g, "[\/读]\n");
303 304
         str = str.replace(/\[\/图\]/g, "[\/图]\n");
305
+        str = str.replace(/\[\/音\]/g, "[\/音]\n");
304 306
         str = str.replace(/\n\n\n/g, "\n\n");
305 307
 
306 308
         var arr = str.split("\n");
@@ -464,6 +466,16 @@ function changeStringToView(field) {
464 466
             }
465 467
             arrResult.push(obj);
466 468
           }
469
+          else if (arr[k].indexOf("[音") >= 0 && arr[k].indexOf("[/音]") > 0) {
470
+            var obj = {};
471
+            obj.Type = "recorder";
472
+            
473
+            var tempIndex = arr[k].indexOf("\']") + 2;
474
+            //obj.Content = arr[k].substring(tempIndex, arr[k].indexOf("[/音]"));
475
+            obj.SoundMark = arr[k].substring(arr[k].indexOf("url='") + 5, arr[k].indexOf("']"));;
476
+            
477
+            arrResult.push(obj);
478
+          }
467 479
           else if (arr[k] != "") {
468 480
             var obj = {};
469 481
             obj.Type = "normal";