chengjie 6 年之前
父節點
當前提交
60b1ad721c
共有 48 個文件被更改,包括 1610 次插入770 次删除
  1. 3 3
      app.js
  2. 二進制
      pages/images/help_picture_chooseadvice.png
  3. 二進制
      pages/images/help_picture_fourcolor.png
  4. 二進制
      pages/images/study_learning_bgimage_tc01.png
  5. 二進制
      pages/images/study_learning_bgimage_tc02.png
  6. 二進制
      pages/images/study_learning_bgimage_tc03.png
  7. 二進制
      pages/images/study_learning_bgimage_tc04.png
  8. 二進制
      pages/images/study_learning_maskimage_tc01.png
  9. 二進制
      pages/images/study_learning_maskimage_tc02.png
  10. 二進制
      pages/images/study_learning_maskimage_tc03.png
  11. 二進制
      pages/images/study_learning_maskimage_tc04.png
  12. 286 175
      pages/main/add.js
  13. 52 50
      pages/main/add.wxml
  14. 66 38
      pages/main/add.wxss
  15. 1 1
      pages/main/colorplan.js
  16. 46 1
      pages/main/default.js
  17. 14 3
      pages/main/default.wxml
  18. 52 0
      pages/main/default.wxss
  19. 79 75
      pages/main/detail.js
  20. 41 115
      pages/main/detail.wxml
  21. 34 12
      pages/main/detail.wxss
  22. 1 1
      pages/main/memoryLevel.json
  23. 14 9
      pages/main/memoryLevel.wxml
  24. 37 24
      pages/main/memoryLevel.wxss
  25. 142 8
      pages/main/preview.js
  26. 2 1
      pages/main/preview.json
  27. 76 96
      pages/main/preview.wxml
  28. 124 45
      pages/main/preview.wxss
  29. 4 7
      pages/main/recommend.js
  30. 13 6
      pages/main/recommend.wxml
  31. 9 0
      pages/main/recommend.wxss
  32. 8 2
      pages/main/searchCard.js
  33. 35 7
      pages/main/searchCard.wxml
  34. 38 23
      pages/main/searchCard.wxss
  35. 38 0
      pages/main/searchCard1.js
  36. 19 1
      pages/main/searchCard1.wxml
  37. 44 1
      pages/main/searchCard1.wxss
  38. 43 18
      pages/main/searchCardList.js
  39. 2 1
      pages/main/searchCardList.json
  40. 36 10
      pages/main/searchCardList.wxml
  41. 83 9
      pages/main/searchCardList.wxss
  42. 3 4
      pages/main/setting.js
  43. 2 2
      pages/main/setting.wxml
  44. 11 0
      pages/other/test.js
  45. 9 2
      pages/other/test.wxml
  46. 87 0
      pages/template/cardShow.wxml
  47. 10 3
      project.config.json
  48. 46 17
      utils/main.js

+ 3 - 3
app.js

@@ -25,8 +25,8 @@ App({
25
     }
25
     }
26
   },
26
   },
27
   globalData: {
27
   globalData: {
28
-    Version: "1.0.1.5",
29
-    IsProduction: false,
28
+    Version: "1.1.5",
29
+    IsProduction: true,
30
     ShareTitle: "可以用来记忆一切的工具",
30
     ShareTitle: "可以用来记忆一切的工具",
31
     SharePath: "pages/index/index",
31
     SharePath: "pages/index/index",
32
     ShareImage: '',
32
     ShareImage: '',
@@ -63,6 +63,6 @@ App({
63
     MemoryLevel:0,//记忆水平
63
     MemoryLevel:0,//记忆水平
64
     ColorIndex:0,//色彩方案
64
     ColorIndex:0,//色彩方案
65
     ClickType:0,//点击方案
65
     ClickType:0,//点击方案
66
-    SecondConfigArray:[10,30,50],//选择记忆水平建议
66
+    SecondConfigArray:[0,0,0],//选择记忆水平建议
67
   }
67
   }
68
 })
68
 })

二進制
pages/images/help_picture_chooseadvice.png


二進制
pages/images/help_picture_fourcolor.png


二進制
pages/images/study_learning_bgimage_tc01.png


二進制
pages/images/study_learning_bgimage_tc02.png


二進制
pages/images/study_learning_bgimage_tc03.png


二進制
pages/images/study_learning_bgimage_tc04.png


二進制
pages/images/study_learning_maskimage_tc01.png


二進制
pages/images/study_learning_maskimage_tc02.png


二進制
pages/images/study_learning_maskimage_tc03.png


二進制
pages/images/study_learning_maskimage_tc04.png


+ 286 - 175
pages/main/add.js

@@ -2,44 +2,40 @@ import common from '../../utils/util';
2
 import main from '../../utils/main';
2
 import main from '../../utils/main';
3
 
3
 
4
 const app = getApp();
4
 const app = getApp();
5
-var field = [[], [], [], []];
6
 var arrTag = [];
5
 var arrTag = [];
7
 
6
 
8
-var tempCursor = 0,
9
-  btnName = ""; 
7
+var tempCursor = undefined,
8
+  btnName = "";
10
 var arrSoundMark = [];
9
 var arrSoundMark = [];
11
 var isUnload = true;
10
 var isUnload = true;
12
 var isEdit = true;
11
 var isEdit = true;
12
+var isSave = true;
13
 var interval;
13
 var interval;
14
+var timeoutUploadImage = 0;
14
 
15
 
15
 Page({
16
 Page({
16
   data: {
17
   data: {
17
-    PracticeTimeStr:"智能安排",
18
-    HiddenFieldEdit:true,
18
+    PracticeTimeStr: "智能安排",
19
+    HiddenFieldEdit: true,
19
     FieldContent: "",
20
     FieldContent: "",
20
     SoundSign: "[读]",
21
     SoundSign: "[读]",
21
     LineSign: "[线]",
22
     LineSign: "[线]",
22
-    IsTodayStudy:false,
23
+    IsTodayStudy: false,
23
     BtnArray: ["+", "-", "×", "÷", "=", "<", ">"],
24
     BtnArray: ["+", "-", "×", "÷", "=", "<", ">"],
24
   },
25
   },
25
   onLoad: function (options) {
26
   onLoad: function (options) {
26
     wx.hideShareMenu();
27
     wx.hideShareMenu();
27
     var that = this;
28
     var that = this;
28
 
29
 
29
-    var type2=0;
30
-    if (options.type2)
31
-      type2=options.type2;
32
-
33
-    var fieldNumber=0;
30
+    var fieldNumber = 0;
34
     if (options.fieldid)
31
     if (options.fieldid)
35
-      fieldNumber=options.fieldid;
32
+      fieldNumber = options.fieldid;
36
 
33
 
37
     that.setData({
34
     that.setData({
38
       Containnerheight: main.getWindowHeight(),
35
       Containnerheight: main.getWindowHeight(),
39
       UpdateType: options.type,
36
       UpdateType: options.type,
40
-      ShowType:type2,
41
       MiaoguoCardID: options.id,
37
       MiaoguoCardID: options.id,
42
-      FieldNumber:fieldNumber,
38
+      FieldNumber: fieldNumber,
43
     });
39
     });
44
 
40
 
45
     var list = app.globalData.CardList;
41
     var list = app.globalData.CardList;
@@ -49,25 +45,25 @@ Page({
49
         break;
45
         break;
50
       }
46
       }
51
     }
47
     }
52
-    app.globalData.TempFieldNumber=0;
53
-    app.globalData.TempMiaoguoCardID=that.data.MiaoguoCardID;
48
+    app.globalData.TempFieldNumber = 0;
49
+    app.globalData.TempMiaoguoCardID = that.data.MiaoguoCardID;
54
 
50
 
55
   },
51
   },
52
+
56
   onShow: function () {
53
   onShow: function () {
57
     var that = this;
54
     var that = this;
58
-
59
     if (that.data.UpdateType == "add") {
55
     if (that.data.UpdateType == "add") {
60
       that.initAddCard();
56
       that.initAddCard();
61
     }
57
     }
62
     else {
58
     else {
63
-      var card = {},content="";
59
+      var card = {}, content = "";
64
       var list = app.globalData.CardList;
60
       var list = app.globalData.CardList;
65
       for (var i = 0; i < list.length; i++) {
61
       for (var i = 0; i < list.length; i++) {
66
         if (that.data.MiaoguoCardID == list[i].MiaoguoCardID) {
62
         if (that.data.MiaoguoCardID == list[i].MiaoguoCardID) {
67
           card = main.changeStringToView(list[i].Content);
63
           card = main.changeStringToView(list[i].Content);
68
           card.MiaoguoCardID = list[i].MiaoguoCardID;
64
           card.MiaoguoCardID = list[i].MiaoguoCardID;
69
           card.LimitTime = list[i].LimitTime;
65
           card.LimitTime = list[i].LimitTime;
70
-          if (that.data.FieldNumber && that.data.FieldNumber>0)
66
+          if (that.data.FieldNumber && that.data.FieldNumber > 0)
71
             content = main.encryptUrl(list[i].Content[that.data.FieldNumber].Content);
67
             content = main.encryptUrl(list[i].Content[that.data.FieldNumber].Content);
72
           break;
68
           break;
73
         }
69
         }
@@ -76,7 +72,7 @@ Page({
76
         MiaoguoCardID: card.MiaoguoCardID,
72
         MiaoguoCardID: card.MiaoguoCardID,
77
         Field: card.Field,
73
         Field: card.Field,
78
         Tags: card.Tags,
74
         Tags: card.Tags,
79
-        FieldContent:content,
75
+        FieldContent: content,
80
       });
76
       });
81
 
77
 
82
       if (that.data.UpdateType != "add2") {
78
       if (that.data.UpdateType != "add2") {
@@ -86,12 +82,45 @@ Page({
86
       }
82
       }
87
 
83
 
88
       if (that.data.UpdateType == "edit3") {
84
       if (that.data.UpdateType == "edit3") {
89
-        that.gotoAddItem({ currentTarget: { dataset: { fieldid: that.data.FieldNumber}}});
85
+        that.gotoAddItem({ currentTarget: { dataset: { fieldid: that.data.FieldNumber } } });
90
       }
86
       }
91
     }
87
     }
92
   },
88
   },
89
+  onHide: function () {
90
+    //用于恢复未保存的新题卡
91
+    console.log("onHide");
92
+    var that = this;
93
+    if (!that.data.HiddenFieldEdit) {
94
+      that.updateField();
95
+    }
96
+    if (!(that.data && that.data.Field && that.data.Field[1].length == 0
97
+      && that.data.Field[2].length == 0
98
+      && that.data.Field[3].length == 0)) {
99
+      if (that.data.UpdateType == "add" || that.data.UpdateType == "add2") {
100
+        var card = {};
101
+        card.MiaoguoCardID = that.data.MiaoguoCardID;
102
+        card.Content = [];
103
+        var param1 = {};
104
+        param1 = that.formatField(that.data.Field);
105
+
106
+        for (var i = 0; i < 4; i++) {
107
+          var obj = {};
108
+          obj.ContentType = i;
109
+          if (i == 0)
110
+            obj.Content = that.data.Tags;
111
+          else
112
+            obj.Content = param1["Field" + i];
113
+          card.Content.push(obj);
114
+        }
115
+
116
+        wx.setStorageSync("TempCardNoSaved", card);
117
+      }
118
+    }
119
+
120
+  },
93
   onUnload: function () {
121
   onUnload: function () {
94
-    field = [[], [], [], []];
122
+    this.onHide();
123
+
95
     var card = wx.getStorageSync("TempCardInfo");
124
     var card = wx.getStorageSync("TempCardInfo");
96
     if (card) {
125
     if (card) {
97
       var list = app.globalData.CardList;
126
       var list = app.globalData.CardList;
@@ -101,11 +130,11 @@ Page({
101
           break;
130
           break;
102
         }
131
         }
103
       }
132
       }
104
-      app.globalData.CardList=list;
133
+      app.globalData.CardList = list;
105
       wx.removeStorageSync("TempCardInfo");
134
       wx.removeStorageSync("TempCardInfo");
106
     }
135
     }
107
-    wx.removeStorageSync("TempCardInfoAddItem");
108
     clearInterval(interval);
136
     clearInterval(interval);
137
+    clearTimeout(timeoutUploadImage);
109
   },
138
   },
110
   onClose: function () {
139
   onClose: function () {
111
     wx.navigateBack({
140
     wx.navigateBack({
@@ -113,7 +142,7 @@ Page({
113
     });
142
     });
114
   },
143
   },
115
   gotoAddItem: function (e) {
144
   gotoAddItem: function (e) {
116
-    var that=this;
145
+    var that = this;
117
     var fieldid = e.currentTarget.dataset.fieldid;
146
     var fieldid = e.currentTarget.dataset.fieldid;
118
     var content;
147
     var content;
119
     var list = app.globalData.CardList;
148
     var list = app.globalData.CardList;
@@ -128,7 +157,7 @@ Page({
128
       HiddenFieldEdit: false,
157
       HiddenFieldEdit: false,
129
       Focus: true,
158
       Focus: true,
130
       FieldNumber: fieldid,
159
       FieldNumber: fieldid,
131
-      FieldContent:content,
160
+      FieldContent: content,
132
     });
161
     });
133
     wx.setNavigationBarTitle({
162
     wx.setNavigationBarTitle({
134
       title: '编辑 段落' + fieldid,
163
       title: '编辑 段落' + fieldid,
@@ -156,9 +185,9 @@ Page({
156
   },
185
   },
157
   switch1Change(e) {
186
   switch1Change(e) {
158
 
187
 
159
-    var str="智能安排";
160
-    if (e.detail.value){
161
-      str="今日必练";
188
+    var str = "智能安排";
189
+    if (e.detail.value) {
190
+      str = "今日必练";
162
     }
191
     }
163
     this.setData({
192
     this.setData({
164
       IsTodayStudy: e.detail.value,
193
       IsTodayStudy: e.detail.value,
@@ -175,116 +204,157 @@ Page({
175
       });
204
       });
176
     }
205
     }
177
     else {
206
     else {
178
-      that.uploadImageAll(that.data.Field, function (field) {
179
-        that.data.Field=field;
180
-        var userid = app.globalData.userInfo.UserID;
181
-        var isTodayStudy = 0;
182
-        if (that.data.IsTodayStudy && that.data.UpdateType == "add2")
183
-          isTodayStudy = 1;
184
-
185
-        var tags = [];
186
-        for (var i = 0; i < that.data.Tags.length; i++) {
187
-          if (that.data.Tags[i])
188
-            tags.push(that.data.Tags[i]);
189
-        }
190
-        var param1 = {
191
-          Tags: tags,
192
-          Field1: "",
193
-          Field2: "",
194
-          Field3: "",
195
-          IsTodayStudy: isTodayStudy,
196
-          ID: that.data.MiaoguoCardID,
197
-        };
198
-        for (var i = 1; i <= 3; i++) {
199
-          for (var key in that.data.Field[i]) {
200
-            var item = that.data.Field[i][key];
201
-            var str = "";
202
-            if (item.Type == "image") {
203
-              str = "[图 w='"+item.Width+"' h='"+item.Height+"']" + item.Content + "[/图]";
204
-            }
205
-            else if (item.Type == "line") {
206
-              for (var j = 0; j < item.Content.length; j++) {
207
-                if (item.Content[j].key == "normal")
208
-                  str += item.Content[j].value;
209
-                if (item.Content[j].key == "line") {
210
-                  str += "[线]" + item.Content[j].value + "[/线]";
211
-                }
212
-              }
213
-            }
214
-            else if (item.Type == "sound") {
215
-              if (item.SoundMark)
216
-                str = "[读 src='" + item.SoundMark + "']" + item.Content + "[/读]";
217
-              else
218
-                str = "[读]" + item.Content + "[/读]";
219
-            }
220
-            else if (item.Type == "normal") {
221
-              str = item.Content;
222
-            }
223
-            else if (item.Type == "return") {
224
-              str = "\n";
225
-            }
226
-            param1["Field" + i] += str;
207
+      if (isSave) {
208
+        isSave = false;
209
+        setTimeout(function () {
210
+          isSave = true;
211
+        }, 5000);
212
+
213
+        that.uploadImageAll(that.data.Field, function (field) {
214
+          that.data.Field = field;
215
+          var userid = app.globalData.userInfo.UserID;
216
+          var isTodayStudy = 0;
217
+          if (that.data.IsTodayStudy && that.data.UpdateType == "add2")
218
+            isTodayStudy = 1;
219
+
220
+          var tags = [];
221
+          for (var i = 0; i < that.data.Tags.length; i++) {
222
+            if (that.data.Tags[i])
223
+              tags.push(that.data.Tags[i]);
227
           }
224
           }
228
-          param1["Field" + i] = main.changeViewToString(param1["Field" + i]);
229
-
230
-        }
231
-
232
-        that.saveLocalCardList(param1);
225
+          var param1 = {};
226
+          param1 = that.formatField(that.data.Field);
227
+          param1.Tags = tags;
228
+          param1.IsTodayStudy = isTodayStudy;
229
+          param1.ID = that.data.MiaoguoCardID;
230
+          that.saveLocalCardList(param1);
231
+
232
+          // var param2 = {
233
+          //   param: common.Encrypt(JSON.stringify(param1))
234
+          // }
235
+          wx.hideLoading();
236
+          wx.showLoading({
237
+            title: '保存数据请稍候',
238
+            mask: true,
239
+          });
240
+          timeoutUploadImage = setTimeout(function () {
241
+            wx.hideLoading();
242
+          }, 15000);
233
 
243
 
234
-        // var param2 = {
235
-        //   param: common.Encrypt(JSON.stringify(param1))
236
-        // }
237
-        main.postData('AddMiaoguoCard?Type=' + that.data.UpdateType + '&UserID=' + userid, param1, function (data) {
238
-          if (that.data.UpdateType == "edit" || that.data.UpdateType == "edit2" || that.data.UpdateType == "edit3") {
239
-            that.onClose();
240
-          }
241
-          else {
242
-            wx.showToast({
243
-              title: '已保存!',
244
-              image: "../images/universalpic_saved_white_120x120.png",
245
-            });
244
+          main.postData('AddMiaoguoCard?Type=' + that.data.UpdateType + '&UserID=' + userid, param1, function (data) {
245
+            wx.removeStorageSync("TempCardNoSaved");
246
 
246
 
247
-            if (that.data.UpdateType == "add2") {
248
-              that.initAddCard();
247
+            if (that.data.UpdateType == "edit" || that.data.UpdateType == "edit2" || that.data.UpdateType == "edit3") {
248
+              that.onClose();
249
             }
249
             }
250
+            else {
251
+              wx.hideLoading();
252
+              wx.showToast({
253
+                title: '已保存!',
254
+                image: "../images/universalpic_saved_white_120x120.png",
255
+              });
256
+
257
+              if (that.data.UpdateType == "add2") {
258
+                that.initAddCard();
259
+              }
250
 
260
 
251
-            var taskToday = app.globalData.TaskToday;
252
-            taskToday.CardNumber++;
253
-            app.globalData.TaskToday=taskToday;
261
+              var taskToday = app.globalData.TaskToday;
262
+              taskToday.CardNumber++;
263
+              app.globalData.TaskToday = taskToday;
254
 
264
 
255
-          }
256
-          wx.removeStorageSync("TempCardInfo");
265
+            }
266
+            wx.removeStorageSync("TempCardInfo");
267
+          });
257
         });
268
         });
258
-      });
269
+      }
270
+      else {
271
+        wx.showToast({
272
+          title: '点击太频繁',
273
+          mask: true,
274
+        });
275
+      }
259
     }
276
     }
260
   },
277
   },
278
+  formatField: function (field) {
279
+    var result = {};
280
+
281
+    for (var i = 1; i <= 3; i++) {
282
+      result["Field" + i] = "";
283
+      for (var key in field[i]) {
284
+        var item = field[i][key];
285
+        var str = "";
286
+        if (item.Type == "image") {
287
+          str = "[图 w='" + item.Width + "' h='" + item.Height + "']" + item.Content + "[/图]";
288
+        }
289
+        else if (item.Type == "line") {
290
+          for (var j = 0; j < item.Content.length; j++) {
291
+            if (item.Content[j].key == "normal")
292
+              str += item.Content[j].value;
293
+            if (item.Content[j].key == "line") {
294
+              str += "[线]" + item.Content[j].value + "[/线]";
295
+            }
296
+          }
297
+        }
298
+        else if (item.Type == "sound") {
299
+          if (item.SoundMark)
300
+            str = "[读 src='" + item.SoundMark + "']" + item.Content + "[/读]";
301
+          else
302
+            str = "[读]" + item.Content + "[/读]";
303
+        }
304
+        else if (item.Type == "normal") {
305
+          str = item.Content;
306
+        }
307
+        else if (item.Type == "return") {
308
+          str = "\n";
309
+        }
310
+        result["Field" + i] += str;
311
+      }
312
+      result["Field" + i] = main.changeViewToString(result["Field" + i]);
313
+
314
+    }
315
+    return result;
316
+  },
261
   uploadImageAll: function (arr, callback) {
317
   uploadImageAll: function (arr, callback) {
262
-    var that=this;
263
-    var arrSource=[], arrResult=[];
264
-    for(var i=0;i<arr.length;i++){
265
-      for(var j=0;j<arr[i].length;j++){
266
-        if (arr[i][j].Type == "image" && arr[i][j].Content){
318
+    var that = this;
319
+    var b = false;
320
+    var arrSource = [], arrResult = [];
321
+    for (var i = 0; i < arr.length; i++) {
322
+      for (var j = 0; j < arr[i].length; j++) {
323
+        if (arr[i][j].Type == "image" && arr[i][j].Content) {
267
           arrSource.push(arr[i][j].Content);
324
           arrSource.push(arr[i][j].Content);
268
-          if (arr[i][j].ContentServer.indexOf(app.globalData.uploadImageUrl)>=0 
269
-          || arr[i][j].ContentServer.indexOf("baidu.com")>=0 ){
325
+          if (arr[i][j].ContentServer.indexOf(app.globalData.uploadImageUrl) >= 0
326
+            || arr[i][j].ContentServer.indexOf("baidu.com") >= 0) {
270
             arrResult.push(arr[i][j].ContentServer);
327
             arrResult.push(arr[i][j].ContentServer);
271
           }
328
           }
272
-          else{
329
+          else {
273
             that.uploadImage(arr[i][j].Content, function (data) {
330
             that.uploadImage(arr[i][j].Content, function (data) {
274
               //console.log("Target:"+data);
331
               //console.log("Target:"+data);
275
               data = app.globalData.uploadImageUrl + data;
332
               data = app.globalData.uploadImageUrl + data;
276
               arrResult.push(data);
333
               arrResult.push(data);
277
             });
334
             });
278
           }
335
           }
336
+          b = true;
279
         }
337
         }
280
       }
338
       }
281
     }
339
     }
282
 
340
 
283
-    interval=setInterval(function(){
341
+    if (b) {
342
+      wx.showLoading({
343
+        title: '上传图片请稍候',
344
+        mask: true,
345
+      });
346
+      timeoutUploadImage = setTimeout(function () {
347
+        wx.hideLoading();
348
+      }, 15000);
349
+    }
350
+
351
+    interval = setInterval(function () {
284
       //console.log(arrResult.length);
352
       //console.log(arrResult.length);
285
-      if (arrResult.length >= arrSource.length){
353
+      if (arrResult.length >= arrSource.length) {
354
+        wx.hideLoading();
355
+
286
         clearInterval(interval);
356
         clearInterval(interval);
287
-        var ari=0;
357
+        var ari = 0;
288
         for (var i = 0; i < arr.length; i++) {
358
         for (var i = 0; i < arr.length; i++) {
289
           for (var j = 0; j < arr[i].length; j++) {
359
           for (var j = 0; j < arr[i].length; j++) {
290
             if (arr[i][j].Type == "image" && arr[i][j].Content) {
360
             if (arr[i][j].Type == "image" && arr[i][j].Content) {
@@ -300,16 +370,17 @@ Page({
300
         //console.log(JSON.stringify(arr));
370
         //console.log(JSON.stringify(arr));
301
         callback(arr);
371
         callback(arr);
302
       }
372
       }
303
-    },500);
373
+    }, 500);
304
   },
374
   },
305
-  uploadImage:function(file,callback){
375
+  uploadImage: function (file, callback) {
376
+
377
+
306
     var url = common.Encrypt("MiaoguoUploadFile");
378
     var url = common.Encrypt("MiaoguoUploadFile");
307
     wx.uploadFile({
379
     wx.uploadFile({
308
       url: app.globalData.serverUrl + url,
380
       url: app.globalData.serverUrl + url,
309
       filePath: file,
381
       filePath: file,
310
       name: 'file',
382
       name: 'file',
311
       success(res) {
383
       success(res) {
312
-        wx.hideLoading();
313
         callback(res.data);
384
         callback(res.data);
314
       },
385
       },
315
       fail: function (err) {
386
       fail: function (err) {
@@ -323,20 +394,20 @@ Page({
323
     });
394
     });
324
 
395
 
325
   },
396
   },
326
-  saveLocalCardList:function(param1){
327
-    var that=this;
397
+  saveLocalCardList: function (param1) {
398
+    var that = this;
328
     var list = app.globalData.CardList;
399
     var list = app.globalData.CardList;
329
     for (var i = 0; i < list.length; i++) {
400
     for (var i = 0; i < list.length; i++) {
330
       if (that.data.MiaoguoCardID == list[i].MiaoguoCardID) {
401
       if (that.data.MiaoguoCardID == list[i].MiaoguoCardID) {
331
         for (var j = 0; j < 4; j++) {
402
         for (var j = 0; j < 4; j++) {
332
-          if (j == 0){
403
+          if (j == 0) {
333
             if (param1.tags && param1.tags.length > 0)
404
             if (param1.tags && param1.tags.length > 0)
334
               list[i].Content[j].Content = param1.tags.join(",");
405
               list[i].Content[j].Content = param1.tags.join(",");
335
           }
406
           }
336
           else
407
           else
337
             list[i].Content[j].Content = param1["Field" + j];
408
             list[i].Content[j].Content = param1["Field" + j];
338
         }
409
         }
339
-        app.globalData.CardList=list;
410
+        app.globalData.CardList = list;
340
         break;
411
         break;
341
       }
412
       }
342
     }
413
     }
@@ -351,7 +422,7 @@ Page({
351
       obj.Content = [];
422
       obj.Content = [];
352
       card.Content.push(obj);
423
       card.Content.push(obj);
353
     }
424
     }
354
-    app.globalData.CardList=[card];
425
+    app.globalData.CardList = [card];
355
     this.setData({
426
     this.setData({
356
       MiaoguoCardID: 0,
427
       MiaoguoCardID: 0,
357
       Field: [[], [], [], []],
428
       Field: [[], [], [], []],
@@ -377,7 +448,7 @@ Page({
377
 
448
 
378
     wx.showModal({
449
     wx.showModal({
379
       title: '提醒',
450
       title: '提醒',
380
-      content: '记号“'+that.data.Tags[index]+'”要删除吗?',
451
+      content: '记号“' + that.data.Tags[index] + '”要删除吗?',
381
       success(res) {
452
       success(res) {
382
         if (res.confirm) {
453
         if (res.confirm) {
383
           that.data.Tags.splice(index, 1);
454
           that.data.Tags.splice(index, 1);
@@ -396,15 +467,15 @@ Page({
396
         }
467
         }
397
       }
468
       }
398
     });
469
     });
399
-    
470
+
400
   },
471
   },
401
-  onGotoList:function(){
472
+  onGotoList: function () {
402
     var that = this;
473
     var that = this;
403
     if (that.data.Field[1] != "" && that.data.Field[2] != "" && that.data.Field[2] != "") {
474
     if (that.data.Field[1] != "" && that.data.Field[2] != "" && that.data.Field[2] != "") {
404
       wx.showModal({
475
       wx.showModal({
405
         title: '尚未保存',
476
         title: '尚未保存',
406
         content: '即将前往“全部题卡”,但当前题卡尚未保存,按继续将放弃保存。',
477
         content: '即将前往“全部题卡”,但当前题卡尚未保存,按继续将放弃保存。',
407
-        confirmText:'继续',
478
+        confirmText: '继续',
408
         success(res) {
479
         success(res) {
409
           if (res.confirm) {
480
           if (res.confirm) {
410
             goto();
481
             goto();
@@ -412,11 +483,11 @@ Page({
412
         }
483
         }
413
       });
484
       });
414
     }
485
     }
415
-    else{
486
+    else {
416
       goto();
487
       goto();
417
     }
488
     }
418
 
489
 
419
-    function goto(){
490
+    function goto() {
420
       wx.showLoading({
491
       wx.showLoading({
421
         title: '请稍候',
492
         title: '请稍候',
422
       });
493
       });
@@ -579,7 +650,7 @@ Page({
579
 
650
 
580
   },
651
   },
581
   closeAddItem: function (e) {
652
   closeAddItem: function (e) {
582
-    var that=this;
653
+    var that = this;
583
     var isSave = e.currentTarget.dataset.idsave;
654
     var isSave = e.currentTarget.dataset.idsave;
584
     if (isSave == "true") {
655
     if (isSave == "true") {
585
       isUnload = false;
656
       isUnload = false;
@@ -588,13 +659,13 @@ Page({
588
     else if (isSave == "false") {
659
     else if (isSave == "false") {
589
       var content = wx.getStorageSync("TempCardInfoAddItem");
660
       var content = wx.getStorageSync("TempCardInfoAddItem");
590
       this.setData({
661
       this.setData({
591
-        FieldContent:content,
662
+        FieldContent: content,
592
       })
663
       })
593
       this.updateField();
664
       this.updateField();
594
     }
665
     }
595
-    
666
+
596
     this.setData({
667
     this.setData({
597
-      HiddenFieldEdit:true,
668
+      HiddenFieldEdit: true,
598
     });
669
     });
599
 
670
 
600
     var title = "编辑题卡";
671
     var title = "编辑题卡";
@@ -609,7 +680,7 @@ Page({
609
   updateField: function () {
680
   updateField: function () {
610
     var str = this.data.FieldContent;
681
     var str = this.data.FieldContent;
611
     var list = app.globalData.CardList;
682
     var list = app.globalData.CardList;
612
-    var card={};
683
+    var card = {};
613
     for (var i = 0; i < list.length; i++) {
684
     for (var i = 0; i < list.length; i++) {
614
       if (this.data.MiaoguoCardID == list[i].MiaoguoCardID) {
685
       if (this.data.MiaoguoCardID == list[i].MiaoguoCardID) {
615
         list[i].Content[this.data.FieldNumber].Content = str;
686
         list[i].Content[this.data.FieldNumber].Content = str;
@@ -620,62 +691,102 @@ Page({
620
     app.globalData.CardList = list;
691
     app.globalData.CardList = list;
621
 
692
 
622
     this.setData({
693
     this.setData({
623
-        Field: card.Field,
624
-        Tags: card.Tags,
694
+      Field: card.Field,
695
+      Tags: card.Tags,
625
     });
696
     });
626
   },
697
   },
627
-
698
+  //选择图片上传
628
   uploadImageField: function () {
699
   uploadImageField: function () {
629
     //console.log("uploadImageStart");
700
     //console.log("uploadImageStart");
630
     var that = this;
701
     var that = this;
631
 
702
 
632
-    wx.chooseImage({
633
-      count: 1,
634
-      sizeType: ['compressed'],
635
-      sourceType: ['album', 'camera'],
636
-      success(res) {
637
-        // tempFilePath可以作为img标签的src属性显示图片
638
-        const tempFilePaths = res.tempFilePaths;
639
-        //console.log(tempFilePaths[0]);
640
-        //that.data.FieldContent = that.data.FieldContent + "[图 url='" + tempFilePaths[0] + "']" + tempFilePaths[0] + "[/图]";
641
-
642
-        wx.getImageInfo({
643
-          src: res.tempFilePaths[0],
644
-          success(res) {
645
-            console.log(res.width)
646
-            console.log(res.height)
647
-            if (tempCursor == undefined)
648
-              tempCursor = that.data.FieldContent.length;
649
-            var str1 = "",
650
-              str2 = "";
651
-            if (that.data.FieldContent.length > 0) {
652
-              str1 = that.data.FieldContent.substr(0, tempCursor);
653
-              str2 = that.data.FieldContent.substring(tempCursor, that.data.FieldContent.length);
654
-            }
703
+    //若是安卓机
704
+    if (app.globalData.IsAndroid) {
705
+      selectImage(that);
706
+    }
707
+    else{
708
+      wx.showActionSheet({
709
+        itemList: ['拍照', '从手机相册选择'],
710
+        success(res) {
711
+          if (res.tapIndex==0){
712
+            wx.chooseImage({
713
+              count: 1,
714
+              sizeType: ['compressed'],
715
+              sourceType: ['camera'],
716
+              success(res2) {
717
+                wx.showLoading({
718
+                  title: '请秒候',
719
+                  mask:true,
720
+                });
721
+                setTimeout(function(){
722
+                  wx.hideLoading();
723
+                  selectImage(that);
724
+                },2000);
725
+              },
726
+            });
727
+          }
728
+          else if (res.tapIndex == 1) {
729
+            selectImage(that);
730
+          }
731
+        },
732
+        fail(res) {
733
+          console.log(res.errMsg)
734
+        }
735
+      });
736
+    }
655
 
737
 
656
-            var str0 = "[图 w='"+res.width+"' h='"+res.height+"']" + tempFilePaths[0]+ "[/图]";
738
+    function selectImage(that){
739
+      var sizeType = ['album'];
740
+      //若是安卓机
741
+      if (app.globalData.IsAndroid)
742
+        sizeType = ['album', 'camera'];
657
 
743
 
658
-            that.data.FieldContent = str1 + str0 + str2;
744
+      wx.chooseImage({
745
+        count: 1,
746
+        sizeType: ['compressed'],
747
+        sourceType: sizeType,
748
+        success(res) {
749
+          // tempFilePath可以作为img标签的src属性显示图片
750
+          const tempFilePaths = res.tempFilePaths;
751
+          //console.log(tempFilePaths[0]);
752
+          //that.data.FieldContent = that.data.FieldContent + "[图 url='" + tempFilePaths[0] + "']" + tempFilePaths[0] + "[/图]";
753
+
754
+          wx.getImageInfo({
755
+            src: res.tempFilePaths[0],
756
+            success(res) {
757
+              console.log(res.width)
758
+              console.log(res.height)
759
+              if (tempCursor == undefined)
760
+                tempCursor = that.data.FieldContent.length;
761
+              var str1 = "",
762
+                str2 = "";
763
+              if (that.data.FieldContent.length > 0) {
764
+                str1 = that.data.FieldContent.substr(0, tempCursor);
765
+                str2 = that.data.FieldContent.substring(tempCursor, that.data.FieldContent.length);
766
+              }
659
 
767
 
660
-            //console.log("uploadImageEnd:" + that.data.FieldContent);
768
+              var str0 = "[图 w='" + res.width + "' h='" + res.height + "']" + tempFilePaths[0] + "[/图]";
661
 
769
 
662
-            that.setData({
663
-              FieldContent: that.data.FieldContent,
664
-              Focus: false,
665
-            });
666
-            that.updateField();
770
+              that.data.FieldContent = str1 + str0 + str2;
667
 
771
 
668
-          }
669
-        });
670
-      },
671
-      fail: function () {
772
+              tempCursor = that.data.FieldContent.length;
773
+              //console.log("uploadImageEnd:" + that.data.FieldContent);
672
 
774
 
673
-      }
674
-    });
775
+              that.setData({
776
+                FieldContent: that.data.FieldContent,
777
+                Focus: false,
778
+              });
779
+              that.updateField();
675
 
780
 
676
-  },
677
-  
781
+            }
782
+          });
783
+        },
784
+        fail: function () {
678
 
785
 
786
+        }
787
+      });
788
+    }
789
+  },
679
   onShareAppMessage: function () {
790
   onShareAppMessage: function () {
680
     return {
791
     return {
681
       title: app.globalData.ShareTitle,
792
       title: app.globalData.ShareTitle,

+ 52 - 50
pages/main/add.wxml

@@ -1,12 +1,10 @@
1
 <view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;' hidden='{{!HiddenFieldEdit}}'>
1
 <view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;' hidden='{{!HiddenFieldEdit}}'>
2
-  <view class="panelTimePlan FlexRow" wx:if="{{UpdateType=='add' || UpdateType=='add2'}}">
3
-    <view class="panelItem1">
4
-      练习时间
2
+  <view class="panelTop FlexRow">
3
+    <view class="panelTopLeft FlexRow" catchtap="onSearch">
4
+      <view class="add">+</view> 资料
5
     </view>
5
     </view>
6
-    <view class="panelItem2 FlexRow">
7
-      <view class="panelTimePlan1" hidden="{{IsTodayStudy}}">智能安排</view>
8
-      <view class="panelTimePlan1" hidden="{{!IsTodayStudy}}">今日必练</view>
9
-      <switch class='panelTimePlan2' checked="{{IsTodayStudy}}" bindchange="switch1Change" />
6
+    <view class='panelTopRight FlexRow' catchtap='onGotoList'>
7
+      <image src='../images/universalpic_card_gray_26x26.png' class="universalpic_card_gray_26x26" />
10
     </view>
8
     </view>
11
   </view>
9
   </view>
12
   <view style='height:120rpx' wx:if="{{UpdateType=='add' || UpdateType=='add2'}}"></view>
10
   <view style='height:120rpx' wx:if="{{UpdateType=='add' || UpdateType=='add2'}}"></view>
@@ -35,7 +33,9 @@
35
           <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
33
           <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
36
         </block>
34
         </block>
37
         </text>
35
         </text>
38
-        <image class="universalpic_read_gray_40x40" wx:if="{{item.Type=='sound'}}" src='../images/universalpic_read_gray_40x40.png' />
36
+        <view class="sound FlexRow" wx:if="{{item.Type=='sound'}}">
37
+          <image class="universalpic_read_mark_black_20x20" src='../images/universalpic_read_mark_black_20x20.png' />
38
+        </view>
39
         <text class="textPinyin" wx:if="{{item.Type=='sound'}}">{{item.Content}}</text>
39
         <text class="textPinyin" wx:if="{{item.Type=='sound'}}">{{item.Content}}</text>
40
         <image class="imageFree" mode="widthFix" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' binderror="onBindError" />
40
         <image class="imageFree" mode="widthFix" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' binderror="onBindError" />
41
         <view class="textBr" wx:if="{{item.Type=='br'}}"></view>
41
         <view class="textBr" wx:if="{{item.Type=='br'}}"></view>
@@ -64,24 +64,25 @@
64
   </block>
64
   </block>
65
   <view class='lineFooter'></view>
65
   <view class='lineFooter'></view>
66
 
66
 
67
+  <view class="panelTimePlan FlexRow" wx:if="{{UpdateType=='add' || UpdateType=='add2'}}">
68
+    <view class="panelItem1 FlexRow">
69
+      <image src='../images/universalpic_clock_gray_24x24.png' class="universalpic_clock_gray_24x24" />
70
+      <view>练习时间</view>
71
+    </view>
72
+    <view class="panelItem2 FlexRow">
73
+      <view class="panelTimePlan1" hidden="{{IsTodayStudy}}">智能安排</view>
74
+      <view class="panelTimePlan1" hidden="{{!IsTodayStudy}}">今日必练</view>
75
+      <switch class='panelTimePlan2' checked="{{IsTodayStudy}}" bindchange="switch1Change" />
76
+    </view>
77
+  </view>
67
   <view style='height:300rpx;'></view>
78
   <view style='height:300rpx;'></view>
68
 
79
 
69
   <view class='panelSave FlexRow'>
80
   <view class='panelSave FlexRow'>
70
-    <view class="panelSave1 FlexRow" bindtap="onSearch">
71
-      <view class="add">+</view> 资料
81
+    <view class="panelSave1" bindtap="onPreview">
82
+      预览
72
     </view>
83
     </view>
73
-    <view class='panelSave0' bindtap="saveCard">保存</view>
74
-
75
-    <view class='panelSave00 FlexRow'>
76
-      <view class="panelSave4 panelSave2 panelSave1" bindtap="onPreview">
77
-        预览
78
-      </view>
79
-      <!-- <view class="panelSave2 panelSave1" bindtap="onPreview" wx:if="{{ShowType==0}}">
80
-        预览
81
-      </view>
82
-      <view class="panelSave3 panelSave1 FlexRow" bindtap="onGotoList" wx:if="{{ShowType==0}}">
83
-        <image src='../images/universalpic_card_gray_26x26.png' class="universalpic_card_gray_26x26" />
84
-      </view> -->
84
+    <view class='panelSave2' bindtap="saveCard">
85
+      保存
85
     </view>
86
     </view>
86
   </view>
87
   </view>
87
 </view>
88
 </view>
@@ -100,7 +101,7 @@
100
         <image class="universalpic_read_end_white_38x22" src='../images/universalpic_read_end_white_38x22.png' />
101
         <image class="universalpic_read_end_white_38x22" src='../images/universalpic_read_end_white_38x22.png' />
101
       </view>
102
       </view>
102
       <view class="panelSaveTag2 panelSaveTag1 FlexRow" bindtap="addSymbol" data-id="{{LineSign}}" hidden="{{LineSign=='[/线]'}}">
103
       <view class="panelSaveTag2 panelSaveTag1 FlexRow" bindtap="addSymbol" data-id="{{LineSign}}" hidden="{{LineSign=='[/线]'}}">
103
-        <image class="universalpic_editbar_underline_gray_14x20" src='../images/universalpic_editbar_underline_gray_14x20.png' />
104
+        <image class="universalpic_underline_begin_gray_14x20" src='../images/universalpic_underline_begin_gray_14x20.png' />
104
       </view>
105
       </view>
105
       <view class="panelSaveTag3 panelSaveTag1 FlexRow" bindtap="addSymbol" data-id="{{LineSign}}" hidden="{{LineSign=='[线]'}}">
106
       <view class="panelSaveTag3 panelSaveTag1 FlexRow" bindtap="addSymbol" data-id="{{LineSign}}" hidden="{{LineSign=='[线]'}}">
106
         <image class="universalpic_underline_end_white_30x22" src='../images/universalpic_underline_end_white_30x22.png' />
107
         <image class="universalpic_underline_end_white_30x22" src='../images/universalpic_underline_end_white_30x22.png' />
@@ -108,40 +109,41 @@
108
       <view class="panelSaveTag2 panelSaveTag1 FlexRow" catchtap="uploadImageField">
109
       <view class="panelSaveTag2 panelSaveTag1 FlexRow" catchtap="uploadImageField">
109
         <image class="universalpic_picture_gray_26x26" src='../images/universalpic_picture_gray_26x26.png' />
110
         <image class="universalpic_picture_gray_26x26" src='../images/universalpic_picture_gray_26x26.png' />
110
       </view>
111
       </view>
111
-
112
     </view>
112
     </view>
113
     <view class='right FlexRow'>
113
     <view class='right FlexRow'>
114
       <view class="clear" catchtap="clear">清空</view>
114
       <view class="clear" catchtap="clear">清空</view>
115
     </view>
115
     </view>
116
   </view>
116
   </view>
117
   <view class='lineFooter'></view>
117
   <view class='lineFooter'></view>
118
+  
118
   <view class='panelInput'>
119
   <view class='panelInput'>
119
     <textarea class="input" maxlength='-1' show-confirm-bar="true" value="{{FieldContent}}" focus="{{Focus}}" cursor="{{Cursor}}" bindinput="bindinputField" bindblur="onBindblur" bindfocus="onBindFocus" data-id='{{FieldNumber}}' />
120
     <textarea class="input" maxlength='-1' show-confirm-bar="true" value="{{FieldContent}}" focus="{{Focus}}" cursor="{{Cursor}}" bindinput="bindinputField" bindblur="onBindblur" bindfocus="onBindFocus" data-id='{{FieldNumber}}' />
120
   </view>
121
   </view>
121
-  <cover-view class='lineFooter'></cover-view>
122
-  <cover-view class='panelBtnItem FlexColumn'>
123
-    <cover-view class="panelBtnSmall FlexRow">
124
-      <cover-view class="btn0"></cover-view>
125
-      <cover-view class="btn1 FlexRow" bindtap="addSymbol" data-id="(     )">
126
-        <cover-image class="universalpic_editbar_brackets_gray" src='../images/universalpic_editbar_brackets_gray.png' />
127
-      </cover-view>
128
-      <cover-view class="btn1 FlexRow" bindtap="addSymbol" data-id="_____">
129
-        <cover-image class="universalpic_editbar_underline_gray" src='../images/universalpic_editbar_underline_gray.png' />
130
-      </cover-view>
131
-      <cover-view class="btn" bindtap="addSymbol" wx:for="{{BtnArray}}" wx:key="index" data-id="{{item}}">{{item}}</cover-view>
132
-      <cover-view class="btn1 FlexRow" bindtap="addSymbol" data-id="²">
133
-        <cover-image class="universalpic_editbar_sqr_gray" src='../images/universalpic_editbar_sqr_gray.png' />
134
-      </cover-view>
135
-      <cover-view class="btn1 FlexRow" bindtap="addSymbol" data-id="³">
136
-        <cover-image class="universalpic_editbar_sqr_gray" src='../images/universalpic_editbar_cube_gray.png' />
137
-      </cover-view>
138
-    </cover-view>
139
-    <cover-view class='lineFooter'></cover-view>
140
-    <cover-view class='panelBtn FlexRow'>
141
-      <cover-view class='text1' bindtap="closeAddItem" data-idsave="false">取消</cover-view>
142
-      <cover-view class='line1'></cover-view>
143
-      <cover-view class='text2 text1' bindtap="closeAddItem" data-idsave="true">确定</cover-view>
144
-    </cover-view>
145
-    <cover-view class='lineFooter'></cover-view>
146
-  </cover-view>
122
+
123
+  <view class='lineFooter'></view>
124
+  <view class='panelBtnItem FlexColumn'>
125
+    <view class="panelBtnSmall FlexRow">
126
+      <view class="btn0"></view>
127
+      <view class="btn1 FlexRow" bindtap="addSymbol" data-id="(     )">
128
+        <image class="universalpic_editbar_brackets_gray" src='../images/universalpic_editbar_brackets_gray.png' />
129
+      </view>
130
+      <view class="btn1 FlexRow" bindtap="addSymbol" data-id="_____">
131
+        <image class="universalpic_editbar_underline_gray" src='../images/universalpic_editbar_underline_gray.png' />
132
+      </view>
133
+      <view class="btn" bindtap="addSymbol" wx:for="{{BtnArray}}" wx:key="index" data-id="{{item}}">{{item}}</view>
134
+      <view class="btn1 FlexRow" bindtap="addSymbol" data-id="²">
135
+        <image class="universalpic_editbar_sqr_gray" src='../images/universalpic_editbar_sqr_gray.png' />
136
+      </view>
137
+      <view class="btn1 FlexRow" bindtap="addSymbol" data-id="³">
138
+        <image class="universalpic_editbar_sqr_gray" src='../images/universalpic_editbar_cube_gray.png' />
139
+      </view>
140
+    </view>
141
+    <view class='lineFooter'></view>
142
+    <view class='panelBtn FlexRow'>
143
+      <view class='text1' bindtap="closeAddItem" data-idsave="false">取消</view>
144
+      <view class='line1'></view>
145
+      <view class='text2 text1' bindtap="closeAddItem" data-idsave="true">确定</view>
146
+    </view>
147
+    <view class='lineFooter'></view>
148
+  </view>
147
 </view>
149
 </view>

+ 66 - 38
pages/main/add.wxss

@@ -5,7 +5,7 @@
5
   background-color: #F0F0F0;
5
   background-color: #F0F0F0;
6
 }
6
 }
7
 
7
 
8
-.panelTimePlan {
8
+.panelTop{
9
   height: 120rpx;
9
   height: 120rpx;
10
   width: 100%;
10
   width: 100%;
11
   justify-content: space-between;
11
   justify-content: space-between;
@@ -18,6 +18,46 @@
18
 }
18
 }
19
 
19
 
20
 
20
 
21
+.panelTop .panelTopLeft {
22
+  width: 148rpx;
23
+  background-color: #fff;
24
+  border:1rpx solid #9B9B9B;
25
+  color:#787878;
26
+  text-align: center;
27
+  line-height: 80rpx;
28
+  height:80rpx;
29
+  border-radius: 10rpx;
30
+  font-size:28rpx;
31
+  margin:0 20rpx;
32
+}
33
+
34
+.add {
35
+  font-size: 42rpx;
36
+  font-weight: 600;
37
+  margin: 0 10rpx 10rpx 0;
38
+}
39
+
40
+.panelTop .panelTopRight{
41
+  width:100rpx;
42
+  height:100rpx;
43
+}
44
+
45
+.universalpic_card_gray_26x26{
46
+  height: 26rpx;
47
+  width: 26rpx;
48
+}
49
+
50
+.panelTimePlan {
51
+  margin-top: 20rpx;
52
+  height: 100rpx;
53
+  width: 100%;
54
+  justify-content: space-between;
55
+  font-size: 28rpx;
56
+  background-color: #fff;
57
+  border-bottom: 1rpx solid #d2d2d2;
58
+}
59
+
60
+
21
 .panelTimePlan .panelTimePlan2 {
61
 .panelTimePlan .panelTimePlan2 {
22
   margin-left: 30rpx;
62
   margin-left: 30rpx;
23
 }
63
 }
@@ -26,7 +66,11 @@
26
   color:#787878;
66
   color:#787878;
27
   font-weight: 500;
67
   font-weight: 500;
28
 }
68
 }
29
-
69
+.universalpic_clock_gray_24x24{
70
+  width:24rpx;
71
+  height:24rpx;
72
+  margin-right: 10rpx;
73
+}
30
 .panelTimePlanRemark{
74
 .panelTimePlanRemark{
31
   font-size:24rpx;
75
   font-size:24rpx;
32
   margin-top:30rpx;
76
   margin-top:30rpx;
@@ -116,11 +160,16 @@
116
   font-weight: 400;
160
   font-weight: 400;
117
 }
161
 }
118
 
162
 
119
-
120
-.panelItem .universalpic_read_gray_40x40 {
163
+.panelItem .sound{
121
   width:40rpx;
164
   width:40rpx;
122
   height:40rpx;
165
   height:40rpx;
123
   margin: 5rpx 10rpx 0 10rpx;
166
   margin: 5rpx 10rpx 0 10rpx;
167
+  border-radius: 50%;
168
+  background-color: #F0F0F0;
169
+}
170
+.panelItem .universalpic_read_mark_black_20x20 {
171
+  width:21rpx;
172
+  height:20rpx;
124
 }
173
 }
125
 
174
 
126
 .panelItem .textLine {
175
 .panelItem .textLine {
@@ -192,58 +241,37 @@
192
   position: fixed;
241
   position: fixed;
193
   bottom: 0;
242
   bottom: 0;
194
   height: 120rpx;
243
   height: 120rpx;
195
-  font-size: 36rpx;
196
   z-index: 10;
244
   z-index: 10;
197
-  color: #0071ef;
198
   justify-content: space-between;
245
   justify-content: space-between;
199
   border-top: 1rpx solid #d2d2d2;
246
   border-top: 1rpx solid #d2d2d2;
200
 }
247
 }
201
 
248
 
202
 .panelSave .panelSave1 {
249
 .panelSave .panelSave1 {
203
-  width: 148rpx;
250
+  width: 128rpx;
251
+  line-height: 120rpx;
252
+  text-align: center;
253
+  font-size: 24rpx;
254
+  color:#787878;
255
+}
256
+
257
+.panelSave .panelSave2 {
258
+  width: 602rpx;
204
   background-color: #fff;
259
   background-color: #fff;
205
   border:1rpx solid #9B9B9B;
260
   border:1rpx solid #9B9B9B;
206
-  color:#787878;
261
+  color:#0071EF;
207
   text-align: center;
262
   text-align: center;
208
   line-height: 80rpx;
263
   line-height: 80rpx;
209
   height:80rpx;
264
   height:80rpx;
210
   border-radius: 10rpx;
265
   border-radius: 10rpx;
211
-  font-size:28rpx;
212
-  margin:0 20rpx;
213
-}
214
-
215
-.panelSave .panelSave00 {
216
-  justify-content: flex-end;
217
-  margin:0 20rpx;
266
+  font-size:32rpx;
267
+  margin:0 20rpx 0 0;
218
 }
268
 }
219
 
269
 
220
-.panelSave .panelSave2 {
221
-  width: 108rpx;
222
-  margin:0;
223
-}
224
-
225
-.panelSave .panelSave3 {
226
-  width: 80rpx;
227
-  margin:0;
228
-}
229
-
230
-.panelSave .panelSave4 {
231
-  width: 108rpx;
232
-  margin:0;
233
-  font-size:24rpx;
234
-}
235
-
236
-
237
 .universalpic_card_gray_26x26{
270
 .universalpic_card_gray_26x26{
238
   width: 26rpx;
271
   width: 26rpx;
239
   height:26rpx;
272
   height:26rpx;
240
 }
273
 }
241
 
274
 
242
-.add {
243
-  font-size: 42rpx;
244
-  font-weight: 600;
245
-  margin: 0 10rpx 10rpx 0;
246
-}
247
 
275
 
248
 .panelSave .panelSave0{
276
 .panelSave .panelSave0{
249
   width:290rpx;
277
   width:290rpx;
@@ -327,7 +355,7 @@
327
   height: 22rpx;
355
   height: 22rpx;
328
 }
356
 }
329
 
357
 
330
-.universalpic_editbar_underline_gray_14x20 {
358
+.universalpic_underline_begin_gray_14x20 {
331
   width: 14rpx;
359
   width: 14rpx;
332
   height: 20rpx;
360
   height: 20rpx;
333
 }
361
 }

+ 1 - 1
pages/main/colorplan.js

@@ -20,7 +20,7 @@ Page({
20
     var arr = main.getDetailColor(-1);
20
     var arr = main.getDetailColor(-1);
21
 
21
 
22
 
22
 
23
-    common.getStorageValue(this, "ColorIndexArr", [1], function () {
23
+    common.getStorageValue(this, "ColorIndexArr", [1,2,3,4], function () {
24
       
24
       
25
       for (var i = 1; i < arr.length; i++) {
25
       for (var i = 1; i < arr.length; i++) {
26
         for(var j=0;j<that.data.ColorIndexArr.length;j++){
26
         for(var j=0;j<that.data.ColorIndexArr.length;j++){

+ 46 - 1
pages/main/default.js

@@ -5,6 +5,8 @@ const app = getApp();
5
 
5
 
6
 Page({
6
 Page({
7
   data: {
7
   data: {
8
+    IsTempCardNoSaved:false,
9
+    IsExit:false,
8
   },
10
   },
9
   onLoad: function (options) {
11
   onLoad: function (options) {
10
     wx.hideShareMenu();
12
     wx.hideShareMenu();
@@ -24,7 +26,14 @@ Page({
24
       that.setData({
26
       that.setData({
25
         IsIPad: "_iPad",
27
         IsIPad: "_iPad",
26
       });
28
       });
29
+
30
+      if (app.globalData.systemInfo.windowHeight < app.globalData.systemInfo.windowWidth){
31
+        that.setData({
32
+          IsExit:true,
33
+        });
34
+      }
27
     }
35
     }
36
+    
28
   },
37
   },
29
   onShow: function () {
38
   onShow: function () {
30
     var that = this;
39
     var that = this;
@@ -51,6 +60,8 @@ Page({
51
           that.init();
60
           that.init();
52
 
61
 
53
           that.getTaskTodayList();
62
           that.getTaskTodayList();
63
+
64
+          that.isNoSavedCard();
54
         }
65
         }
55
         else {
66
         else {
56
           wx.navigateTo({
67
           wx.navigateTo({
@@ -64,7 +75,7 @@ Page({
64
     //题卡主题色
75
     //题卡主题色
65
     var arrColorIndex = wx.getStorageSync("ColorIndexArr");
76
     var arrColorIndex = wx.getStorageSync("ColorIndexArr");
66
     if (!arrColorIndex) {
77
     if (!arrColorIndex) {
67
-      app.globalData.ColorIndex = 1;
78
+      app.globalData.ColorIndex = common.random(1,4);
68
     }
79
     }
69
     else {
80
     else {
70
       app.globalData.ColorIndex = arrColorIndex[common.random(0, arrColorIndex.length - 1)];
81
       app.globalData.ColorIndex = arrColorIndex[common.random(0, arrColorIndex.length - 1)];
@@ -104,6 +115,40 @@ Page({
104
       url: './searchCard',
115
       url: './searchCard',
105
     })
116
     })
106
   },
117
   },
118
+  isNoSavedCard:function(){
119
+    var that=this;
120
+    //判断是否有未保存的卡
121
+    if (wx.getStorageSync("TempCardNoSaved")) {
122
+      that.setData({
123
+        IsTempCardNoSaved: true,
124
+      });
125
+      wx.setNavigationBarColor({
126
+        frontColor: "#ffffff",
127
+        backgroundColor: "#0B8457",
128
+      })
129
+    }
130
+    else{
131
+      that.setData({
132
+        IsTempCardNoSaved: false,
133
+      });
134
+      wx.setNavigationBarColor({
135
+        frontColor: "#ffffff",
136
+        backgroundColor: "#3157BA",
137
+      });
138
+    }
139
+  },
140
+  onOpenTempCard:function(){
141
+    var card = wx.getStorageSync("TempCardNoSaved");
142
+    app.globalData.CardList=[card];
143
+    wx.navigateTo({
144
+      url: './add?type=add2&id='+card.MiaoguoCardID,
145
+    });
146
+  },
147
+  onGiveupTempCard:function(){
148
+    var that=this;
149
+    wx.removeStorageSync("TempCardNoSaved");
150
+    that.isNoSavedCard();
151
+  },
107
   onShareAppMessage: function () {
152
   onShareAppMessage: function () {
108
     return {
153
     return {
109
       title: app.globalData.ShareTitle,
154
       title: app.globalData.ShareTitle,

+ 14 - 3
pages/main/default.wxml

@@ -8,8 +8,8 @@
8
     </view>
8
     </view>
9
   </view>
9
   </view>
10
   <image wx:if="{{TodayTaskNumber>0 && IsStart==1}}" class="study_index_start{{IsIPad}}" src='../images/study_index_start.png' bindtap="goto" data-url="detail" />
10
   <image wx:if="{{TodayTaskNumber>0 && IsStart==1}}" class="study_index_start{{IsIPad}}" src='../images/study_index_start.png' bindtap="goto" data-url="detail" />
11
-  <image wx:if="{{TodayTaskNumber>0 && IsStart==0}}" class="study_index_start{{IsIPad}}" src='../images/study_index_goon.png'  bindtap="goto" data-url="detail" />
12
-  <image wx:if="{{TodayTaskNumber==0}}" class="study_index_start{{IsIPad}}" src='../images/study_index_report.png'  bindtap="goto" data-url="detail" />
11
+  <image wx:if="{{TodayTaskNumber>0 && IsStart==0}}" class="study_index_start{{IsIPad}}" src='../images/study_index_goon.png' bindtap="goto" data-url="detail" />
12
+  <image wx:if="{{TodayTaskNumber==0}}" class="study_index_start{{IsIPad}}" src='../images/study_index_report.png' bindtap="goto" data-url="detail" />
13
 
13
 
14
   <view class='panelBottom FlexColumn'>
14
   <view class='panelBottom FlexColumn'>
15
 
15
 
@@ -21,7 +21,7 @@
21
         <view class='text5'>学习</view>
21
         <view class='text5'>学习</view>
22
       </view>
22
       </view>
23
       <view class='line1'></view>
23
       <view class='line1'></view>
24
-      <view class='panelBottom11 FlexColumn' bindtap="goto" data-url="add?type=add&type2=1&id=0">
24
+      <view class='panelBottom11 FlexColumn' bindtap="goto" data-url="add?type=add&id=0">
25
         <image class="program_tabbar_study_default" src='../images/program_tabbar_add_default.png' />
25
         <image class="program_tabbar_study_default" src='../images/program_tabbar_add_default.png' />
26
         <view>添加</view>
26
         <view>添加</view>
27
       </view>
27
       </view>
@@ -34,3 +34,14 @@
34
     </view>
34
     </view>
35
   </view>
35
   </view>
36
 </view>
36
 </view>
37
+<view wx:if="{{IsTempCardNoSaved}}" class="TempCardNoSaved container FlexColumn" style='height:{{Containnerheight}}rpx;'>
38
+  <image class="Avatar" src='../images/universalpic_logo_200x200.png' />
39
+  <text class='RemindText'>新消息\n刚刚救回了一张尚未\n保存的题卡</text>
40
+  <view class='btn1' catchtap="onOpenTempCard">打开</view>
41
+  <view class='btn1' catchtap="onGiveupTempCard">丢弃</view>
42
+</view>
43
+
44
+<view wx:if="{{IsExit}}" class="IsExitContainer container FlexColumn" style='height:{{Containnerheight}}rpx;'>
45
+  <view class='IsExitText'>请竖起屏幕再打开小程序</view>
46
+  <navigator class='isExit' open-type="exit" target="miniProgram">确认</navigator>
47
+</view>

+ 52 - 0
pages/main/default.wxss

@@ -76,3 +76,55 @@
76
   height: 54rpx;
76
   height: 54rpx;
77
   margin: 10rpx 0 4rpx 0;
77
   margin: 10rpx 0 4rpx 0;
78
 }
78
 }
79
+
80
+.TempCardNoSaved{
81
+  background-color: #0B8457;
82
+  position: fixed;
83
+  top:0;
84
+}
85
+.TempCardNoSaved .Avatar{
86
+  width:200rpx;
87
+  height:200rpx;
88
+  margin-top: 150rpx;
89
+  z-index: 10;
90
+  border-radius: 50%;
91
+}
92
+.TempCardNoSaved .RemindText{
93
+  font-size:54rpx;
94
+  color:#fff;
95
+  margin-top: 170rpx;
96
+  text-align: center;
97
+}
98
+.TempCardNoSaved .btn1{
99
+  font-size:36rpx;
100
+  color:#fff;
101
+  margin-top: 40rpx;
102
+  border:5rpx solid #fff;
103
+  text-align: center;
104
+  width:520rpx;
105
+  line-height: 90rpx;
106
+  border-radius: 14rpx;
107
+}
108
+
109
+
110
+.IsExitContainer{
111
+  background-color: #3157ba;
112
+  position: fixed;
113
+  z-index: 100;
114
+  top:0;
115
+}
116
+.IsExitText{
117
+  margin-top: 200rpx;
118
+  color:#fff;
119
+  font-size:36rpx;
120
+}
121
+.isExit{
122
+  border: 1rpx solid #fff;
123
+  color:#fff;
124
+  border-radius: 10rpx;
125
+  margin-top: 80rpx;
126
+  padding: 20rpx;
127
+  width:100rpx;
128
+  font-size:36rpx;
129
+  text-align: center;
130
+}

+ 79 - 75
pages/main/detail.js

@@ -3,12 +3,12 @@ import main from '../../utils/main';
3
 
3
 
4
 const app = getApp();
4
 const app = getApp();
5
 
5
 
6
-const arrFontSize=[
7
-  {Name:"紧凑",Value:36},
8
-  {Name:"标准",Value:48},
9
-  {Name:"宽松",Value:68},
10
-  {Name:"超大",Value:108}
11
-  ];
6
+const arrFontSize = [
7
+  { Name: "紧凑", Value: 36 },
8
+  { Name: "标准", Value: 48 },
9
+  { Name: "宽松", Value: 68 },
10
+  { Name: "超大", Value: 108 }
11
+];
12
 
12
 
13
 var innerAudioContext1;
13
 var innerAudioContext1;
14
 
14
 
@@ -19,18 +19,21 @@ var arrImage = [],
19
   arrImage2 = [];
19
   arrImage2 = [];
20
 var intervalSound = 0,
20
 var intervalSound = 0,
21
   intervalRefresh = 0;
21
   intervalRefresh = 0;
22
+var isCollecting=false;
22
 
23
 
23
 Page({
24
 Page({
24
   data: {
25
   data: {
26
+    ImagePath: app.globalData.uploadImageUrl,
25
     NumberNew: 10,
27
     NumberNew: 10,
26
     NumberReview: 0,
28
     NumberReview: 0,
27
     NumberHistory: 30,
29
     NumberHistory: 30,
28
     IsShowNumberInfo: false,
30
     IsShowNumberInfo: false,
29
-    IsMore:false,
31
+    IsMore: false,
30
     FontSizeArray: arrFontSize,
32
     FontSizeArray: arrFontSize,
31
     TaskInfo: {},
33
     TaskInfo: {},
34
+    Color: { ID: 1 },
32
   },
35
   },
33
-  onLoad: function() {
36
+  onLoad: function () {
34
     wx.hideShareMenu();
37
     wx.hideShareMenu();
35
     var that = this;
38
     var that = this;
36
     var height = app.globalData.systemInfo.screenHeight * 2 - 90;
39
     var height = app.globalData.systemInfo.screenHeight * 2 - 90;
@@ -47,7 +50,6 @@ Page({
47
       CanUndo: 1,
50
       CanUndo: 1,
48
       TaskInfo: {},
51
       TaskInfo: {},
49
       ClickType: app.globalData.ClickType,
52
       ClickType: app.globalData.ClickType,
50
-      IsIphoneX: main.checkIsIPhoneX(),
51
       Color: main.getDetailColor(app.globalData.ColorIndex),
53
       Color: main.getDetailColor(app.globalData.ColorIndex),
52
     });
54
     });
53
 
55
 
@@ -67,7 +69,7 @@ Page({
67
     }
69
     }
68
 
70
 
69
   },
71
   },
70
-  onShow: function() {
72
+  onShow: function () {
71
     var that = this;
73
     var that = this;
72
     if (that.data.NumberNew == 0 &&
74
     if (that.data.NumberNew == 0 &&
73
       that.data.NumberReview == 0 &&
75
       that.data.NumberReview == 0 &&
@@ -102,13 +104,13 @@ Page({
102
       IsMore: false,
104
       IsMore: false,
103
     });
105
     });
104
   },
106
   },
105
-  onUnload: function() {
107
+  onUnload: function () {
106
     clearInterval(intervalSound);
108
     clearInterval(intervalSound);
107
-    main.UpdateMiaoguoCardTodayAll(false, function() {
109
+    main.UpdateMiaoguoCardTodayAll(false, function () {
108
       listTaskFinished = [];
110
       listTaskFinished = [];
109
     });
111
     });
110
   },
112
   },
111
-  onPullDownRefresh: function() {
113
+  onPullDownRefresh: function () {
112
     this.onShowAnswer({
114
     this.onShowAnswer({
113
       currentTarget: {
115
       currentTarget: {
114
         dataset: {
116
         dataset: {
@@ -118,7 +120,7 @@ Page({
118
     });
120
     });
119
     wx.stopPullDownRefresh();
121
     wx.stopPullDownRefresh();
120
   },
122
   },
121
-  setSoundFile: function(isFinish) { //isFinish=3搁置 =2撤退 =1结束 =0正常 =-1开始
123
+  setSoundFile: function (isFinish) { //isFinish=3搁置 =2撤退 =1结束 =0正常 =-1开始
122
     var that = this;
124
     var that = this;
123
     var url = "/pages/sounds/";
125
     var url = "/pages/sounds/";
124
     if (isFinish == 1) {
126
     if (isFinish == 1) {
@@ -139,7 +141,7 @@ Page({
139
       scrollTop: 0,
141
       scrollTop: 0,
140
     });
142
     });
141
   },
143
   },
142
-  getColor: function() {
144
+  getColor: function () {
143
     var that = this;
145
     var that = this;
144
 
146
 
145
     if (wx.setBackgroundColor) {
147
     if (wx.setBackgroundColor) {
@@ -157,7 +159,7 @@ Page({
157
     }
159
     }
158
 
160
 
159
   },
161
   },
160
-  getList: function() {
162
+  getList: function () {
161
     var task = app.globalData.TaskToday;
163
     var task = app.globalData.TaskToday;
162
     var that = this;
164
     var that = this;
163
     var arrNew = task.ListNew;
165
     var arrNew = task.ListNew;
@@ -266,17 +268,17 @@ Page({
266
     }
268
     }
267
   },
269
   },
268
 
270
 
269
-  onShowAnswer: function(e) {
271
+  onShowAnswer: function (e) {
270
     var clicktype = e.currentTarget.dataset.type;
272
     var clicktype = e.currentTarget.dataset.type;
271
     if (!(clicktype && clicktype == "all" && app.globalData.ClickType == 0)) {
273
     if (!(clicktype && clicktype == "all" && app.globalData.ClickType == 0)) {
272
 
274
 
273
       var start = e.currentTarget.dataset.start;
275
       var start = e.currentTarget.dataset.start;
274
       var that = this;
276
       var that = this;
275
       if (!(that.data.NumberNew == 0 &&
277
       if (!(that.data.NumberNew == 0 &&
276
-          that.data.NumberReview == 0 &&
277
-          that.data.NumberHistory == 0) && !that.data.IsShowNumberInfo) {
278
+        that.data.NumberReview == 0 &&
279
+        that.data.NumberHistory == 0) && !that.data.IsShowNumberInfo) {
278
 
280
 
279
-        var recommend=0;
281
+        var recommend = 0;
280
         if (start) {
282
         if (start) {
281
           that.data.IsShowAnswer[0] = 0;
283
           that.data.IsShowAnswer[0] = 0;
282
           that.data.IsShowAnswer[1] = 0;
284
           that.data.IsShowAnswer[1] = 0;
@@ -285,16 +287,16 @@ Page({
285
             that.data.IsShowAnswer[0] = 1;
287
             that.data.IsShowAnswer[0] = 1;
286
             if (TaskList[0].ContentNew.Field[3].length == 0) {
288
             if (TaskList[0].ContentNew.Field[3].length == 0) {
287
               that.data.IsShowAnswer[1] = 1;
289
               that.data.IsShowAnswer[1] = 1;
288
-              recommend = getRecommendTime();
290
+              if (!that.data.TaskInfo.IsNew)
291
+                recommend = getRecommendTime();
289
               that.setData({
292
               that.setData({
290
                 Recommend: recommend,
293
                 Recommend: recommend,
291
               });
294
               });
292
             }
295
             }
293
-
294
-            scroll(1000);
295
           } else if (that.data.IsShowAnswer[0] && !that.data.IsShowAnswer[1]) {
296
           } else if (that.data.IsShowAnswer[0] && !that.data.IsShowAnswer[1]) {
296
             that.data.IsShowAnswer[1] = 1;
297
             that.data.IsShowAnswer[1] = 1;
297
-            recommend = getRecommendTime();
298
+            if (!that.data.TaskInfo.IsNew)
299
+              recommend = getRecommendTime();
298
             that.setData({
300
             that.setData({
299
               Recommend: recommend,
301
               Recommend: recommend,
300
             });
302
             });
@@ -312,7 +314,7 @@ Page({
312
         });
314
         });
313
       }
315
       }
314
 
316
 
315
-      function getRecommendTime(recommend) {
317
+      function getRecommendTime() {
316
         if (app.globalData.SecondConfigArray[0] > 0) {
318
         if (app.globalData.SecondConfigArray[0] > 0) {
317
           var duration = common.diffDate("s", timeStart, new Date());
319
           var duration = common.diffDate("s", timeStart, new Date());
318
           if (duration <= app.globalData.SecondConfigArray[0])
320
           if (duration <= app.globalData.SecondConfigArray[0])
@@ -329,31 +331,31 @@ Page({
329
       }
331
       }
330
     }
332
     }
331
   },
333
   },
332
-  gotoEdit: function() {
334
+  gotoEdit: function () {
333
     var that = this;
335
     var that = this;
334
     //console.log(res.tapIndex);
336
     //console.log(res.tapIndex);
335
     var list = [];
337
     var list = [];
336
     list.push(TaskList[0]);
338
     list.push(TaskList[0]);
337
     app.globalData.CardList = list;
339
     app.globalData.CardList = list;
338
     wx.navigateTo({
340
     wx.navigateTo({
339
-      url: './add?type=edit&type2=1&id=' + TaskList[0].MiaoguoCardID,
341
+      url: './add?type=edit&id=' + TaskList[0].MiaoguoCardID,
340
     });
342
     });
341
   },
343
   },
342
-  onFontSize: function(e) {
343
-    var value=e.currentTarget.dataset.value;
344
+  onFontSize: function (e) {
345
+    var value = e.currentTarget.dataset.value;
344
     TaskList[0].FontSize = value;
346
     TaskList[0].FontSize = value;
345
     this.setData({
347
     this.setData({
346
       TaskInfo: TaskList[0],
348
       TaskInfo: TaskList[0],
347
-      IsMore:false,
349
+      IsMore: false,
348
     });
350
     });
349
   },
351
   },
350
-  gotoPrev: function() {
352
+  gotoPrev: function () {
351
     var that = this;
353
     var that = this;
352
 
354
 
353
     if (listTaskFinished.length > 0) {
355
     if (listTaskFinished.length > 0) {
354
       var card = listTaskFinished.pop();
356
       var card = listTaskFinished.pop();
355
       wx.setStorageSync("ListTaskFinished", listTaskFinished);
357
       wx.setStorageSync("ListTaskFinished", listTaskFinished);
356
-      timeStart  =  new  Date();
358
+      timeStart = new Date();
357
 
359
 
358
       card.Card.Number0 = card.Number0Old;
360
       card.Card.Number0 = card.Number0Old;
359
       card.Card.Number0Str = card.Number0StrOld;
361
       card.Card.Number0Str = card.Number0StrOld;
@@ -399,7 +401,7 @@ Page({
399
       that.setSoundFile(2);
401
       that.setSoundFile(2);
400
     }
402
     }
401
   },
403
   },
402
-  gotoNext: function(e) {
404
+  gotoNext: function (e) {
403
     var that = this;
405
     var that = this;
404
 
406
 
405
     var btnnumber = e.currentTarget.dataset.btnnumber;
407
     var btnnumber = e.currentTarget.dataset.btnnumber;
@@ -536,7 +538,7 @@ Page({
536
         Recommend: 0,
538
         Recommend: 0,
537
       });
539
       });
538
       that.setSoundFile(1);
540
       that.setSoundFile(1);
539
-      main.UpdateMiaoguoCardTodayAll(true, function() {
541
+      main.UpdateMiaoguoCardTodayAll(true, function () {
540
         listTaskFinished = [];
542
         listTaskFinished = [];
541
         that.getTaskTime();
543
         that.getTaskTime();
542
       });
544
       });
@@ -567,31 +569,27 @@ Page({
567
         that.setSoundFile(0);
569
         that.setSoundFile(0);
568
     }
570
     }
569
   },
571
   },
570
-  gotoCollect:function(){
571
-    var that=this;
572
-    if (!TaskList[0].IsCollect){
573
-      TaskList[0].IsCollect=1;
574
-      wx.showToast({
575
-        title: '添加到幻灯片',
576
-        duration:2000,
577
-        image: "../images/universalpic_fav_enable_white_120x110.png",
578
-      });
579
-    }
580
-    else{
581
-      TaskList[0].IsCollect=0;
582
-      wx.showToast({
583
-        title: '幻灯片中移除',
584
-        duration: 2000,
585
-        image: "../images/universalpic_fav_enable_white_120x110.png",
572
+  gotoCollect: function () {
573
+    var that = this;
574
+    if (!isCollecting) {
575
+      isCollecting = true;
576
+      setTimeout(function () {
577
+        isCollecting = false;
578
+      }, 3000);
579
+      var that = this;
580
+      if (!TaskList[0].IsCollect) {
581
+        TaskList[0].IsCollect = 1;
582
+      }
583
+      else {
584
+        TaskList[0].IsCollect = 0;
585
+      }
586
+      that.setData({
587
+        TaskInfo: TaskList[0],
586
       });
588
       });
589
+      main.setCollect(TaskList[0].MiaoguoCardID, TaskList[0].IsCollect);
587
     }
590
     }
588
-    that.setData({
589
-      TaskInfo:TaskList[0],
590
-    });
591
-    
592
-    main.getData("UpdateMiaoguoCardInfo?UserID=" + app.globalData.userInfo.UserID + "&MiaoguoCardID=" + TaskList[0].MiaoguoCardID + "&IsCollect=" + TaskList[0].IsCollect, function (data) {});
593
   },
591
   },
594
-  playSound: function(e) {
592
+  playSound: function (e) {
595
     var that = this;
593
     var that = this;
596
     var str = e.currentTarget.dataset.content;
594
     var str = e.currentTarget.dataset.content;
597
     var url = "";
595
     var url = "";
@@ -622,7 +620,7 @@ Page({
622
 
620
 
623
     var index = 0;
621
     var index = 0;
624
     if (arr.length > 1) {
622
     if (arr.length > 1) {
625
-      intervalSound = setInterval(function() {
623
+      intervalSound = setInterval(function () {
626
         that.audioCtx[index].setSrc(arr[index]);
624
         that.audioCtx[index].setSrc(arr[index]);
627
         that.audioCtx[index].play();
625
         that.audioCtx[index].play();
628
 
626
 
@@ -641,11 +639,11 @@ Page({
641
       that.audioCtx[index].play();
639
       that.audioCtx[index].play();
642
     }
640
     }
643
   },
641
   },
644
-  getTaskTime: function() {
642
+  getTaskTime: function () {
645
     var that = this;
643
     var that = this;
646
     var url = "GetMiaoguoTaskTime?";
644
     var url = "GetMiaoguoTaskTime?";
647
     url += "UserID=" + app.globalData.userInfo.UserID;
645
     url += "UserID=" + app.globalData.userInfo.UserID;
648
-    main.getData(url, function(data) {
646
+    main.getData(url, function (data) {
649
       if (data) {
647
       if (data) {
650
         var duration = data.Duration;
648
         var duration = data.Duration;
651
         if (duration > 0) {
649
         if (duration > 0) {
@@ -666,25 +664,25 @@ Page({
666
       }
664
       }
667
     });
665
     });
668
   },
666
   },
669
-  showNumberContainner: function() {
667
+  showNumberContainner: function () {
670
     this.setData({
668
     this.setData({
671
       IsShowNumberInfo: true,
669
       IsShowNumberInfo: true,
672
     });
670
     });
673
   },
671
   },
674
-  closeNumberContainner: function() {
672
+  closeNumberContainner: function () {
675
     this.setData({
673
     this.setData({
676
       IsShowNumberInfo: false,
674
       IsShowNumberInfo: false,
677
       IsMore: false,
675
       IsMore: false,
678
     });
676
     });
679
   },
677
   },
680
-  showImage: function(e) {
678
+  showImage: function (e) {
681
     var name = e.currentTarget.dataset.name;
679
     var name = e.currentTarget.dataset.name;
682
     wx.previewImage({
680
     wx.previewImage({
683
       current: name,
681
       current: name,
684
       urls: arrImage
682
       urls: arrImage
685
     });
683
     });
686
   },
684
   },
687
-  onBindError: function(e) {
685
+  onBindError: function (e) {
688
     var that = this;
686
     var that = this;
689
     var serverUrl = e.currentTarget.dataset.serverurl;
687
     var serverUrl = e.currentTarget.dataset.serverurl;
690
     var oldTempUrl = e.currentTarget.dataset.name;
688
     var oldTempUrl = e.currentTarget.dataset.name;
@@ -707,7 +705,7 @@ Page({
707
     });
705
     });
708
 
706
 
709
     clearTimeout(intervalRefresh);
707
     clearTimeout(intervalRefresh);
710
-    intervalRefresh = setTimeout(function() {
708
+    intervalRefresh = setTimeout(function () {
711
       TaskList[0].ContentNew = main.changeStringToView(TaskList[0].Content);
709
       TaskList[0].ContentNew = main.changeStringToView(TaskList[0].Content);
712
       that.setData({
710
       that.setData({
713
         TaskInfo: TaskList[0],
711
         TaskInfo: TaskList[0],
@@ -726,30 +724,36 @@ Page({
726
     });
724
     });
727
   },
725
   },
728
   onMore: function () {
726
   onMore: function () {
727
+    for (var i = 0; i < this.data.FontSizeArray.length; i++) {
728
+      if (this.data.FontSizeArray[i].Value == this.data.TaskInfo.FontSize)
729
+        this.data.FontSizeArray[i].CSS = "border:3rpx solid " + this.data.Color.LineColor + ";color:" + this.data.Color.LineColor;
730
+      else
731
+        this.data.FontSizeArray[i].CSS = "";
732
+    }
729
     this.setData({
733
     this.setData({
730
-      IsMore:true,
734
+      IsMore: true,
735
+      FontSizeArray: this.data.FontSizeArray,
731
     });
736
     });
732
   },
737
   },
733
-  onClose: function() {
738
+  onClose: function () {
734
     wx.navigateBack({
739
     wx.navigateBack({
735
       delta: 1,
740
       delta: 1,
736
     });
741
     });
737
   },
742
   },
738
-  getMemoryLevel: function() {
743
+  getMemoryLevel: function () {
739
     var index = wx.getStorageSync("MemoryLevel");
744
     var index = wx.getStorageSync("MemoryLevel");
740
     if (!index) {
745
     if (!index) {
741
       index = 0;
746
       index = 0;
742
-      wx.setStorageSync("MemoryLevel", index);
743
     }
747
     }
744
     app.globalData.MemoryLevel = index;
748
     app.globalData.MemoryLevel = index;
745
   },
749
   },
746
 
750
 
747
-  buildShareImage: function() {
751
+  buildShareImage: function () {
748
     var that = this;
752
     var that = this;
749
     wx.showLoading({
753
     wx.showLoading({
750
       title: '生成中',
754
       title: '生成中',
751
     });
755
     });
752
-    setTimeout(function() {
756
+    setTimeout(function () {
753
       wx.hideLoading();
757
       wx.hideLoading();
754
     }, 5000);
758
     }, 5000);
755
     //console.log(app.globalData.userInfo.AvatarUrl);
759
     //console.log(app.globalData.userInfo.AvatarUrl);
@@ -802,7 +806,7 @@ Page({
802
           canvas.setFontSize(32);
806
           canvas.setFontSize(32);
803
           canvas.fillText(app.globalData.TaskToday.DayNumber + "次", 390, 295);
807
           canvas.fillText(app.globalData.TaskToday.DayNumber + "次", 390, 295);
804
 
808
 
805
-          canvas.draw(1, function(n) {
809
+          canvas.draw(1, function (n) {
806
             wx.canvasToTempFilePath({
810
             wx.canvasToTempFilePath({
807
               x: 0,
811
               x: 0,
808
               y: 0,
812
               y: 0,
@@ -811,7 +815,7 @@ Page({
811
               destWidth: 600,
815
               destWidth: 600,
812
               destHeight: 360,
816
               destHeight: 360,
813
               canvasId: 'shareCanvas',
817
               canvasId: 'shareCanvas',
814
-              success: function(res2) {
818
+              success: function (res2) {
815
                 wx.hideLoading();
819
                 wx.hideLoading();
816
 
820
 
817
                 wx.previewImage({
821
                 wx.previewImage({
@@ -819,7 +823,7 @@ Page({
819
                   urls: [res2.tempFilePath] // 需要预览的图片http链接列表
823
                   urls: [res2.tempFilePath] // 需要预览的图片http链接列表
820
                 });
824
                 });
821
               },
825
               },
822
-              fail: function() {
826
+              fail: function () {
823
                 wx.hideLoading();
827
                 wx.hideLoading();
824
               }
828
               }
825
             })
829
             })
@@ -828,12 +832,12 @@ Page({
828
           wx.hideLoading();
832
           wx.hideLoading();
829
         }
833
         }
830
       },
834
       },
831
-      fail: function() {
835
+      fail: function () {
832
         wx.hideLoading();
836
         wx.hideLoading();
833
       }
837
       }
834
     });
838
     });
835
   },
839
   },
836
-  onShareAppMessage: function() {
840
+  onShareAppMessage: function () {
837
     return {
841
     return {
838
       title: app.globalData.ShareTitle,
842
       title: app.globalData.ShareTitle,
839
       path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
843
       path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,

+ 41 - 115
pages/main/detail.wxml

@@ -1,3 +1,5 @@
1
+<import src="../template/cardShow.wxml" />
2
+
1
 <view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;background-color:{{Color.BackColor}}' bindtap='onShowAnswer' data-type="all">
3
 <view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;background-color:{{Color.BackColor}}' bindtap='onShowAnswer' data-type="all">
2
   <!-- 练习中 -->
4
   <!-- 练习中 -->
3
   <block wx:if="{{(NumberNew+NumberReview+NumberHistory)>0}}">
5
   <block wx:if="{{(NumberNew+NumberReview+NumberHistory)>0}}">
@@ -50,131 +52,55 @@
50
 
52
 
51
     </view>
53
     </view>
52
 
54
 
53
-    <!-- 第一段 -->
54
-
55
     <view class="panelField10" style='background-color:{{Color.BackColor}};'></view>
55
     <view class="panelField10" style='background-color:{{Color.BackColor}};'></view>
56
-
57
-    <view class="panelField1 FlexColumn" style='background-color:{{Color.BackColor}};'>
58
-      <view class="editFieldNull"></view>
59
-      <view class="panelField11 panelItem FlexRow" style="font-size:{{TaskInfo.FontSize}}rpx;">
60
-        <text class="textProblem" wx:if="{{TaskInfo.ContentNew.Field[1][0].Type!='line'}}">题目</text>
61
-        <block wx:for="{{TaskInfo.ContentNew.Field[1]}}" wx:key="index">
62
-
63
-          <text class="textReturn" wx:if="{{index>0 && item.Type=='return'}}"></text>
64
-          <view class="textBr" wx:if="{{index>0 && item.Type=='br'}}" style="height:{{TaskInfo.FontSize/2}}rpx;"></view>
65
-          <text class="textNormal" selectable="true" space='ensp' wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
66
-          <text class="textNormal" selectable="true" space='ensp' wx:if="{{item.Type=='line'}}">
67
-            <text class="textProblem" wx:if="{{index==0}}">题目</text>
68
-          <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem" wx:for-index="contentIndex">
69
-            <text space='ensp' wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
70
-            <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
71
-          </block>
72
-          </text>
73
-
74
-          <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">
75
-            <image class="universalpic_read_mark_black_20x20" src='../images/universalpic_read_mark_black_20x20.png' />
76
-          </view>
77
-
78
-          <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>
79
-
80
-          <view class="imageContainer FlexColumn" wx:if="{{item.Type=='image'}}" style='width:{{item.Width}}rpx;height:{{item.Height}}rpx;'>
81
-            <image class="imageFree" mode="widthFix" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" data-serverurl="{{item.ContentServer}}" binderror="onBindError" />
82
-          </view>
83
-        </block>
56
+    <template is="CardShow" data="{{Color:Color,Field:TaskInfo.ContentNew.Field,Tags:TaskInfo.ContentNew.Tags,IsShowAnswer:IsShowAnswer,TagWidth:TaskInfo.TagWidth,FontSize:TaskInfo.FontSize}}" />
57
+    
58
+    <view class='footer0'></view>
59
+
60
+    <!-- 下方按钮 -->
61
+    <image class="footerShade" src="../images/study_learning_bgimage_tc0{{Color.ID}}.png" />
62
+    <view class='footer FlexColumn'>
63
+      <image class="footerImage" src="../images/study_learning_maskimage_tc0{{Color.ID}}.png" />
64
+      <view class="panelFooter FlexColumn" wx:if="{{!IsShowAnswer[0] && !IsShowAnswer[1] && ClickType!=1}}" catchtouchstart="onShowAnswer">
65
+        看答案
84
       </view>
66
       </view>
85
-    </view>
86
-
87
-    <!-- 标签 -->
88
-    <view class="panelTag FlexColumn" wx:if="{{TaskInfo.ContentNew.Tags.length>0}}">
89
-      <view class="panelTag1 FlexRow">
90
-        <view class="tag" wx:for="{{TaskInfo.ContentNew.Tags}}" wx:key="index">{{item}}</view>
67
+      <view class="panelFooter FlexColumn" wx:if="{{IsShowAnswer[0] && !IsShowAnswer[1] && ClickType!=1}}" catchtouchstart="onShowAnswer">
68
+        下一段
91
       </view>
69
       </view>
92
-      <view class='panelTagLine' style='width:{{TaskInfo.TagWidth}}rpx;background-color:{{Color.LineColor}};'></view>
93
-
94
-    </view>
95
-
96
-    <!-- 第二段和第三段 -->
97
-    <view class="panelField20 FlexColumn">
98
-      <view class="editFieldNull2"></view>
99
-      <view id="ViewField{{itemParent}}" class="panelField2 FlexColumn" wx:for="{{[2,3]}}" wx:key="indexParent" wx:for-index="indexParent" wx:for-item="itemParent" wx:if="{{TaskInfo.ContentNew.Field[itemParent].length>0 && IsShowAnswer[itemParent-2]}}" style='background-color:{{Color.FieldBackColor}};'>
100
-        <view class="panelField21 panelItem FlexRow" style='color:{{Color.FieldColor}};'>
101
-          <image class="universalpic_starting_tc01_26x26" src='../images/universalpic_starting_tc01_26x26.png' />
102
-
103
-          <block wx:for="{{TaskInfo.ContentNew.Field[itemParent]}}" wx:key="index">
104
-            <text class="textReturn" wx:if="{{index>0 && item.Type=='return'}}"></text>
105
-            <view class="textBr" wx:if="{{index>0 && item.Type=='br'}}"></view>
106
-
107
-            <text class="textNormal2 textNormal" selectable="true" space='ensp' wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
108
-
109
-            <text class="textNormal2 FlexRow" selectable="true" space='ensp' wx:if="{{item.Type=='line'}}">
110
-              <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem">
111
-                <text space='ensp' wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
112
-            <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
113
-          </block>
114
-          </text>
115
-
116
-          <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="{{itemParent}}">
117
-            <image class="universalpic_read_mark_black_20x20" src='../images/universalpic_read_mark_black_20x20.png' />
70
+      <view class="panelFooter0 panelFooter FlexColumn" wx:if="{{IsShowAnswer[1]}}">
71
+        <view class='panelBottomAnswer panelBottom FlexRow'>
72
+          <view class="AnswerLeft Answer FlexColumn" hover-class='AnswerHover' catchtap='gotoNext' data-time="{{TaskInfo.Number0}}" data-btnnumber="0">
73
+            <view class="btnTime">
74
+              {{TaskInfo.Number0Str}}
75
+            </view>
76
+            <view class="Answer0 btnColor"></view>
118
           </view>
77
           </view>
119
-
120
-          <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>
121
-
122
-          <view class="imageContainer2 FlexColumn" wx:if="{{item.Type=='image'}}" style='width:{{item.Width}}rpx;height:{{item.Height}}rpx;'>
123
-            <image class="imageFree2" mode="widthFix" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" data-serverurl="{{item.ContentServer}}" binderror="onBindError" />
78
+          <view class="Answer FlexColumn" hover-class='AnswerHover' catchtap='gotoNext' data-time="{{TaskInfo.Number1}}" data-btnnumber="3" wx:if="{{TaskInfo.Number1}}">
79
+            <view class="btnTime">
80
+              {{TaskInfo.Number1Str}}
81
+            </view>
82
+            <view wx:if='{{Recommend!=1}}' class="Answer1 btnColor"></view>
83
+            <view wx:if='{{Recommend==1}}' class="Answer1Recommend Answer1 btnColor"></view>
124
           </view>
84
           </view>
125
-  </block>
126
-  </view>
127
-  </view>
128
-  </view>
85
+          <view class="Answer FlexColumn" hover-class='AnswerHover' catchtap='gotoNext' data-time="{{TaskInfo.Number2}}" data-btnnumber="4">
86
+            <view class="btnTime">
87
+              {{TaskInfo.Number2Str}}
88
+            </view>
89
+            <view wx:if='{{Recommend!=2}}' class="Answer2 btnColor"></view>
90
+            <view wx:if='{{Recommend==2}}' class="Answer1Recommend Answer2 btnColor"></view>
129
 
91
 
130
-  <view class='footer0'></view>
131
-
132
-
133
-
134
-  <!-- 下方按钮 -->
135
-  <view class="footerShade" style='background-image:url(../images/study_learning_bgimage_tc0{{Color.ID}}.png);'></view>
136
-  <view class='footer FlexColumn' style='background-color:{{Color.BackColor}}'>
137
-    <view class="panelFooter FlexColumn" wx:if="{{!IsShowAnswer[0] && !IsShowAnswer[1] && ClickType!=1}}" catchtouchstart="onShowAnswer">
138
-      看答案
139
-    </view>
140
-    <view class="panelFooter FlexColumn" wx:if="{{IsShowAnswer[0] && !IsShowAnswer[1] && ClickType!=1}}" catchtouchstart="onShowAnswer">
141
-      下一段
142
-    </view>
143
-    <view class="panelFooter0 panelFooter FlexColumn" wx:if="{{IsShowAnswer[1]}}">
144
-      <view class='panelBottomAnswer panelBottom FlexRow'>
145
-        <view class="AnswerLeft Answer FlexColumn" hover-class='AnswerHover' catchtap='gotoNext' data-time="{{TaskInfo.Number0}}" data-btnnumber="0">
146
-          <view class="btnTime">
147
-            {{TaskInfo.Number0Str}}
148
           </view>
92
           </view>
149
-          <view class="Answer0 btnColor"></view>
150
-        </view>
151
-        <view class="Answer FlexColumn" hover-class='AnswerHover' catchtap='gotoNext' data-time="{{TaskInfo.Number1}}" data-btnnumber="3" wx:if="{{TaskInfo.Number1}}">
152
-          <view class="btnTime">
153
-            {{TaskInfo.Number1Str}}
93
+          <view class="AnswerRight Answer FlexColumn" hover-class='AnswerHover' catchtap='gotoNext' data-time="{{TaskInfo.Number3}}" data-btnnumber="5" wx:if="{{TaskInfo.Number3}}">
94
+            <view class="btnTime">
95
+              {{TaskInfo.Number3Str}}
96
+            </view>
97
+            <view wx:if='{{Recommend!=3}}' class="Answer3 btnColor"></view>
98
+            <view wx:if='{{Recommend==3}}' class="Answer1Recommend Answer3 btnColor"></view>
154
           </view>
99
           </view>
155
-          <view wx:if='{{Recommend!=1}}' class="Answer1 btnColor"></view>
156
-          <view wx:if='{{Recommend==1}}' class="Answer1Recommend Answer1 btnColor"></view>
157
-        </view>
158
-        <view class="Answer FlexColumn" hover-class='AnswerHover' catchtap='gotoNext' data-time="{{TaskInfo.Number2}}" data-btnnumber="4">
159
-          <view class="btnTime">
160
-            {{TaskInfo.Number2Str}}
161
-          </view>
162
-          <view wx:if='{{Recommend!=2}}' class="Answer2 btnColor"></view>
163
-          <view wx:if='{{Recommend==2}}' class="Answer1Recommend Answer2 btnColor"></view>
164
-
165
-        </view>
166
-        <view class="AnswerRight Answer FlexColumn" hover-class='AnswerHover' catchtap='gotoNext' data-time="{{TaskInfo.Number3}}" data-btnnumber="5" wx:if="{{TaskInfo.Number3}}">
167
-          <view class="btnTime">
168
-            {{TaskInfo.Number3Str}}
169
-          </view>
170
-          <view wx:if='{{Recommend!=3}}' class="Answer3 btnColor"></view>
171
-          <view wx:if='{{Recommend==3}}' class="Answer1Recommend Answer3 btnColor"></view>
172
         </view>
100
         </view>
173
       </view>
101
       </view>
174
-      <!-- <view class="iphoneX" wx:if="{{IsIphoneX}}" style='background-color:{{Color.BackColor2}};'></view> -->
175
-    </view>
176
 
102
 
177
-  </view>
103
+    </view>
178
   </block>
104
   </block>
179
   <!-- 最后一页 -->
105
   <!-- 最后一页 -->
180
   <block wx:if="{{NumberNew+NumberReview+NumberHistory==0}}">
106
   <block wx:if="{{NumberNew+NumberReview+NumberHistory==0}}">
@@ -259,7 +185,7 @@
259
         <view class='numberContainerFooter11 FlexColumn'>
185
         <view class='numberContainerFooter11 FlexColumn'>
260
           <view class='numberContainerFooter111'>调整题目字号</view>
186
           <view class='numberContainerFooter111'>调整题目字号</view>
261
           <view class='numberContainerFooter112 FlexRow'>
187
           <view class='numberContainerFooter112 FlexRow'>
262
-            <view class='numberContainerFooter1121' wx:for="{{FontSizeArray}}" wx:key="index" catchtap='onFontSize' data-value='{{item.Value}}'>{{item.Name}}</view>
188
+            <view class='numberContainerFooter1121' wx:for="{{FontSizeArray}}" wx:key="index" catchtap='onFontSize' data-value='{{item.Value}}' style='{{item.CSS}}'>{{item.Name}}</view>
263
           </view>
189
           </view>
264
         </view>
190
         </view>
265
       </view>
191
       </view>

+ 34 - 12
pages/main/detail.wxss

@@ -74,13 +74,19 @@
74
   margin-top: -7rpx;
74
   margin-top: -7rpx;
75
 }
75
 }
76
 
76
 
77
+
78
+.panelField10 {
79
+  width: 100%;
80
+  height: 110rpx;
81
+}
82
+
77
 /* 段落显示************************ */
83
 /* 段落显示************************ */
78
 
84
 
79
 .editFieldNull{
85
 .editFieldNull{
80
-  height:60rpx;
86
+  height:50rpx;
81
 }
87
 }
82
 .editFieldNull2{
88
 .editFieldNull2{
83
-  height:80rpx;
89
+  height:60rpx;
84
 }
90
 }
85
 
91
 
86
 .panelItem {
92
 .panelItem {
@@ -91,11 +97,6 @@
91
   z-index: 5;
97
   z-index: 5;
92
 }
98
 }
93
 
99
 
94
-.panelField10 {
95
-  width: 100%;
96
-  height: 110rpx;
97
-}
98
-
99
 .panelField1 {
100
 .panelField1 {
100
   width: 100%;
101
   width: 100%;
101
   justify-content: flex-start;
102
   justify-content: flex-start;
@@ -112,7 +113,7 @@
112
   min-height: 95rpx;
113
   min-height: 95rpx;
113
   align-items: flex-start;
114
   align-items: flex-start;
114
   justify-content: flex-start;
115
   justify-content: flex-start;
115
-  margin-top: 80rpx;
116
+  margin-top: 60rpx;
116
   z-index: 5;
117
   z-index: 5;
117
 }
118
 }
118
 
119
 
@@ -173,7 +174,7 @@
173
 .panelField21 {
174
 .panelField21 {
174
   width: 650rpx;
175
   width: 650rpx;
175
   font-size: 36rpx;
176
   font-size: 36rpx;
176
-  margin: 50rpx 40rpx;
177
+  margin: 40rpx;
177
   line-height: 66rpx;
178
   line-height: 66rpx;
178
 }
179
 }
179
 
180
 
@@ -204,15 +205,21 @@
204
 }
205
 }
205
 
206
 
206
 .panelItem .textProblem{
207
 .panelItem .textProblem{
207
-  padding: 0 20rpx;
208
+  padding: 3rpx 20rpx;
208
   background-color: #F1AB1E;
209
   background-color: #F1AB1E;
209
   border-radius: 22rpx;
210
   border-radius: 22rpx;
210
   text-align: center;
211
   text-align: center;
211
-  line-height: 45rpx;
212
   font-size:28rpx;
212
   font-size:28rpx;
213
+  line-height: 45rpx;
213
   font-weight: 500;
214
   font-weight: 500;
214
   color:#1e1e1e;
215
   color:#1e1e1e;
215
-  margin: 10rpx 20rpx 10rpx 0;
216
+  margin: 0 0 10rpx 0;
217
+}
218
+
219
+.panelItem .textDot{
220
+  color: #F1AB1E;
221
+  font-size:36rpx;
222
+  margin-right: 20rpx;
216
 }
223
 }
217
 
224
 
218
 .panelItem .textLine {
225
 .panelItem .textLine {
@@ -290,6 +297,15 @@
290
   border-top-left-radius: 20rpx;
297
   border-top-left-radius: 20rpx;
291
   border-top-right-radius: 20rpx;
298
   border-top-right-radius: 20rpx;
292
 }
299
 }
300
+
301
+.footerImage{
302
+  width:710rpx;
303
+  position: absolute;
304
+  bottom:0;
305
+  height:80rpx;
306
+  z-index: 10;
307
+}
308
+
293
 .panelFooter {
309
 .panelFooter {
294
   width: 710rpx;
310
   width: 710rpx;
295
   margin-bottom: 20rpx;
311
   margin-bottom: 20rpx;
@@ -299,6 +315,7 @@
299
   font-size: 48rpx;
315
   font-size: 48rpx;
300
   text-align: center;
316
   text-align: center;
301
   line-height: 140rpx;
317
   line-height: 140rpx;
318
+  z-index: 15;
302
 }
319
 }
303
 
320
 
304
 .panelFooter0 {
321
 .panelFooter0 {
@@ -617,4 +634,9 @@
617
   text-align: center;
634
   text-align: center;
618
   margin: 30rpx 30rpx 0 0;
635
   margin: 30rpx 30rpx 0 0;
619
   font-size:24rpx;
636
   font-size:24rpx;
637
+}
638
+
639
+.numberContainerFooter1121Select{
640
+  border:3rpx solid #F1AB1E;
641
+  color:#F1AB1E
620
 }
642
 }

+ 1 - 1
pages/main/memoryLevel.json

@@ -1,4 +1,4 @@
1
 {
1
 {
2
-  "navigationBarTitleText": "辨识方案",
2
+  "navigationBarTitleText": "命名方式",
3
   "backgroundColor": "#F0F0F0"
3
   "backgroundColor": "#F0F0F0"
4
 }
4
 }

+ 14 - 9
pages/main/memoryLevel.wxml

@@ -1,15 +1,20 @@
1
 <view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
1
 <view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
2
-  <view class="panelTitle FlexRow">
3
-    <view class="panelTitle1">用途说明</view>
4
-  </view>
5
-  <view class="panelItem FlexRow">
6
-    <view class="panelItem1">在“学习中”,界面底部有一行4色(红、黄、绿、蓝)按钮供家长根据孩子答题时的表现选择对应的“记忆评价”。可根据您的习惯,选择“记忆评价栏”的格式(各种格式的功能是相同的)。</view>
2
+  <view style='height:20rpx'></view>
3
+  <view class="panelItem FlexColumn">
4
+    <view class="panelTitle FlexRow">
5
+      <view class="panelTitle1">用途说明</view>
6
+    </view>
7
+    <view class="panelItem2">“记忆评价”是位于“学习中”界面底部的一行4色按钮。从左向最右分别是:红色、黄色、绿色和蓝色,它们的作用如下图:</view>
8
+
9
+    <image class="help_picture_fourcolor" src='../images/help_picture_fourcolor.png' />
10
+    <text class="panelItem1">请您根据孩子答题时的表现,从AI给出的选项中选择对应的“记忆评价”。\n
11
+为了方便辨识,您可根据自己的喜好选择一款更舒服的命名方式。名称虽有不同,但其背后的功能是一致的。</text>
7
   </view>
12
   </view>
8
-  
13
+
9
   <view class="panelTitle0 panelTitle FlexRow">
14
   <view class="panelTitle0 panelTitle FlexRow">
10
-    <view class="panelTitle1">款式</view>
15
+    <view class="panelTitle1">式</view>
11
   </view>
16
   </view>
12
-  
17
+
13
   <view class='panel FlexColumn'>
18
   <view class='panel FlexColumn'>
14
     <view class="panelTitle FlexRow">
19
     <view class="panelTitle FlexRow">
15
       <view class="panelTitle2 panelTitle1">通俗易懂,对照孩子的表现</view>
20
       <view class="panelTitle2 panelTitle1">通俗易懂,对照孩子的表现</view>
@@ -54,7 +59,7 @@
54
     </view>
59
     </view>
55
 
60
 
56
     <view class="panelItem FlexRow">
61
     <view class="panelItem FlexRow">
57
-      <view class="panelItem2">再现间隔是对“记忆评价”的最直观和科学的理解方式(官方推荐)。它的重点是,告知该题卡根据正常记忆规律可在多长时间后再现。由此,家长可依据孩子答题时不同程度的表现进行判断,希望该题卡在多久后再次练习。建议,越熟练的间隔越久,越生疏的间隔越短。</view>
62
+      <view class="panelItem3">再现间隔是对“记忆评价”的最直观和科学的理解方式(官方推荐)。它的重点是,告知该题卡根据正常记忆规律可在多长时间后再现。由此,家长可依据孩子答题时不同程度的表现进行判断,希望该题卡在多久后再次练习。建议,越熟练的间隔越久,越生疏的间隔越短。</view>
58
     </view>
63
     </view>
59
   </view>
64
   </view>
60
   <view style='height:100rpx'></view>
65
   <view style='height:100rpx'></view>

+ 37 - 24
pages/main/memoryLevel.wxss

@@ -5,39 +5,50 @@
5
   justify-content: flex-start;
5
   justify-content: flex-start;
6
 }
6
 }
7
 
7
 
8
-.panelTitle{
9
-  width:100%;
10
-  margin-top: 20rpx;
8
+.panelTitle {
9
+  width: 100%;
10
+  margin-top: 50rpx;
11
   justify-content: flex-start;
11
   justify-content: flex-start;
12
-  background-color: #fff;
13
 }
12
 }
14
 
13
 
14
+.panelTitle0 {
15
+  margin-top: 50rpx;
16
+}
15
 
17
 
16
-.panelTitle .panelTitle1{
17
-  font-size:32rpx;
18
+.panelTitle .panelTitle1 {
19
+  font-size: 32rpx;
18
   margin-left: 30rpx;
20
   margin-left: 30rpx;
19
-  margin-top: 40rpx;
20
-  font-weight: 500;
21
+  margin-bottom: 30rpx;
21
 }
22
 }
22
 
23
 
23
-.panelItem{
24
-  width:100%;
24
+.panelItem {
25
+  width: 100%;
26
+  justify-content: space-between;
27
+  font-size: 28rpx;
28
+  min-height: 100rpx;
25
   background-color: #fff;
29
   background-color: #fff;
26
 }
30
 }
27
 
31
 
28
-.panelItem .panelItem1{
32
+
33
+.panelItem2 {
34
+  width: 690rpx;
35
+  font-weight: 400;
36
+  font-size: 24rpx;
37
+  margin: 0 0 30rpx 0;
38
+}
39
+
40
+.help_picture_fourcolor{
41
+  width:688rpx;
42
+  height:730rpx;
43
+}
44
+
45
+.panelItem1{
29
   width:690rpx;
46
   width:690rpx;
30
   margin: 40rpx 0 40rpx 0;
47
   margin: 40rpx 0 40rpx 0;
31
   font-weight: 400;
48
   font-weight: 400;
32
   font-size:24rpx;
49
   font-size:24rpx;
33
 }
50
 }
34
 
51
 
35
-.panelTitle0{
36
-  margin-top: 10rpx;
37
-  margin-bottom: 30rpx;
38
-  background-color: #f0f0f0;
39
-}
40
-
41
 .panel{
52
 .panel{
42
   width:100%;
53
   width:100%;
43
   background-color: #fff;
54
   background-color: #fff;
@@ -54,13 +65,6 @@
54
   font-weight: 400;
65
   font-weight: 400;
55
 }
66
 }
56
 
67
 
57
-.panelItem .panelItem2{
58
-  width:690rpx;
59
-  margin: 0 0 30rpx 0;
60
-  font-weight: 400;
61
-  font-size:24rpx;
62
-  color:#787878;
63
-}
64
 
68
 
65
 .panelSelected{
69
 .panelSelected{
66
   width:690rpx;
70
   width:690rpx;
@@ -139,4 +143,13 @@
139
   border:5rpx solid #0071EF;
143
   border:5rpx solid #0071EF;
140
   width:686rpx;
144
   width:686rpx;
141
   height:170rpx;
145
   height:170rpx;
146
+}
147
+
148
+
149
+.panelItem3 {
150
+  width: 690rpx;
151
+  font-weight: 400;
152
+  font-size: 24rpx;
153
+  margin: 0 0 30rpx 30rpx;
154
+  color: #787878;
142
 }
155
 }

+ 142 - 8
pages/main/preview.js

@@ -6,6 +6,8 @@ var intervalSound = 0, intervalRefresh = 0;
6
 var arrImage = [];
6
 var arrImage = [];
7
 var isCopying = false;
7
 var isCopying = false;
8
 var isPlaying = false;
8
 var isPlaying = false;
9
+var isCollecting = false;
10
+var playList=[];
9
 
11
 
10
 Page({
12
 Page({
11
   data: {
13
   data: {
@@ -35,6 +37,14 @@ Page({
35
       wx.setNavigationBarTitle({
37
       wx.setNavigationBarTitle({
36
         title: "查看题卡"
38
         title: "查看题卡"
37
       });
39
       });
40
+
41
+      if (wx.setBackgroundColor) {
42
+        wx.setBackgroundColor({
43
+          backgroundColor: that.data.Color.BackColor,
44
+          backgroundColorTop: "#ffffff",
45
+          backgroundColorBottom: that.data.Color.BackColor,
46
+        })
47
+      }
38
     }
48
     }
39
     else{
49
     else{
40
       if (options.type == "share") {
50
       if (options.type == "share") {
@@ -42,7 +52,25 @@ Page({
42
           title: "来自分享"
52
           title: "来自分享"
43
         });
53
         });
44
       }
54
       }
45
-    
55
+      else if (options.type == "play") {
56
+        wx.setNavigationBarTitle({
57
+          title: "幻灯片"
58
+        });
59
+        if (that.data.ShowType == "play") {
60
+          playList = [];
61
+          for (var i = 0; i < app.globalData.CardList.length;i++){
62
+            playList.push(app.globalData.CardList[i].MiaoguoCardID);
63
+          }
64
+          playList = common.randomArray(playList);
65
+          that.data.MiaoguoCardID = playList[0];
66
+          that.setData({
67
+            MiaoguoCardID: that.data.MiaoguoCardID,
68
+            CurrentIndex:0,
69
+            PlayListCount:playList.length,
70
+          });
71
+        }
72
+      }
73
+
46
       if (wx.setBackgroundColor) {
74
       if (wx.setBackgroundColor) {
47
         wx.setBackgroundColor({
75
         wx.setBackgroundColor({
48
           backgroundColor: that.data.Color.BackColor,
76
           backgroundColor: that.data.Color.BackColor,
@@ -76,12 +104,21 @@ Page({
76
   onUnload: function () {
104
   onUnload: function () {
77
     clearInterval(intervalSound);
105
     clearInterval(intervalSound);
78
   },
106
   },
107
+  onPullDownRefresh: function () {
108
+    var that=this;
109
+    if (that.data.ShowType == "play") {
110
+      that.setData({
111
+        IsShowAnswer: [0,0],
112
+      });
113
+    }
114
+    wx.stopPullDownRefresh();
115
+  },
79
   init: function () {
116
   init: function () {
80
     var that = this;
117
     var that = this;
81
     var list = app.globalData.CardList;
118
     var list = app.globalData.CardList;
119
+    
82
     var card = {};
120
     var card = {};
83
-    var prevId = 0;
84
-    var nextId = 0;
121
+    var prevId = 0,nextId = 0;
85
     for (var i = 0; i < list.length; i++) {
122
     for (var i = 0; i < list.length; i++) {
86
       if (this.data.MiaoguoCardID == list[i].MiaoguoCardID) {
123
       if (this.data.MiaoguoCardID == list[i].MiaoguoCardID) {
87
         if (i > 0)
124
         if (i > 0)
@@ -97,6 +134,7 @@ Page({
97
         card.MiaoguoCardID = list[i].MiaoguoCardID;
134
         card.MiaoguoCardID = list[i].MiaoguoCardID;
98
         card.LimitTime = list[i].LimitTime;
135
         card.LimitTime = list[i].LimitTime;
99
         card.FontSize = list[i].FontSize;
136
         card.FontSize = list[i].FontSize;
137
+        card.IsCollect=list[i].IsCollect;
100
         break;
138
         break;
101
       }
139
       }
102
     }
140
     }
@@ -141,6 +179,22 @@ Page({
141
         }
179
         }
142
       }
180
       }
143
     }
181
     }
182
+
183
+    var IsShowAnswer=[1,1];
184
+    if (that.data.ShowType == "play") {
185
+      IsShowAnswer=[0, 0];
186
+      if (this.data.CurrentIndex <= 0) {
187
+        prevId = 0;
188
+      }
189
+      else 
190
+        prevId = 1;
191
+
192
+      if (this.data.CurrentIndex >=playList.length-1) {
193
+        nextId = 0;
194
+      }
195
+      else
196
+        nextId=1;
197
+    }
144
     this.setData({
198
     this.setData({
145
       ID: card.MiaoguoCardID,
199
       ID: card.MiaoguoCardID,
146
       Field: card.Field,
200
       Field: card.Field,
@@ -151,6 +205,12 @@ Page({
151
       FontSize: card.FontSize,
205
       FontSize: card.FontSize,
152
       LimitTimeStr: limitTimeStr,
206
       LimitTimeStr: limitTimeStr,
153
       IsTodayPractice: isTodayPractice,
207
       IsTodayPractice: isTodayPractice,
208
+      IsCollect: card.IsCollect,
209
+      IsShowAnswer: IsShowAnswer,
210
+    });
211
+
212
+    wx.pageScrollTo({
213
+      scrollTop: 0,
154
     });
214
     });
155
   },
215
   },
156
   practiceToday: function () {
216
   practiceToday: function () {
@@ -384,12 +444,15 @@ Page({
384
       }
444
       }
385
     });
445
     });
386
   },
446
   },
387
-  onPreview: function (e) {
447
+  previewNext: function (e) {
448
+    var that = this;
388
     var id = e.currentTarget.dataset.id;
449
     var id = e.currentTarget.dataset.id;
389
-    wx.redirectTo({
390
-      url: './preview?type=show&id=' + id,
450
+    that.setData({
451
+      MiaoguoCardID: id,
391
     });
452
     });
453
+    that.init();
392
   },
454
   },
455
+  
393
   close: function () {
456
   close: function () {
394
     wx.navigateBack({
457
     wx.navigateBack({
395
       delta: 1,
458
       delta: 1,
@@ -398,11 +461,82 @@ Page({
398
   editField: function (e) {
461
   editField: function (e) {
399
     if (this.data.ShowType == "show") {
462
     if (this.data.ShowType == "show") {
400
       var that = this;
463
       var that = this;
401
-      var fieldid = e.currentTarget.dataset.id;
464
+      // var fieldid = e.currentTarget.dataset.id;
465
+      // wx.navigateTo({
466
+      //   url: './add?type=edit3&id=' + that.data.MiaoguoCardID + '&fieldid=' + fieldid,
467
+      // });
468
+
402
       wx.navigateTo({
469
       wx.navigateTo({
403
-        url: './add?type=edit3&id=' + that.data.MiaoguoCardID + '&fieldid=' + fieldid,
470
+        url: './add?type=edit&id=' + that.data.MiaoguoCardID,
471
+      });
472
+    }
473
+  },
474
+  gotoCollect: function () {
475
+    var that = this;
476
+    if (!isCollecting){
477
+      isCollecting = true;
478
+      setTimeout(function () {
479
+        isCollecting = false;
480
+      }, 3000);
481
+
482
+      if (!that.data.IsCollect) {
483
+        that.data.IsCollect = 1;
484
+      }
485
+      else {
486
+        that.data.IsCollect = 0;
487
+      }
488
+      that.setData({
489
+        IsCollect: that.data.IsCollect
490
+      });
491
+      main.setCollect(that.data.MiaoguoCardID, that.data.IsCollect, function () {
492
+        var list = app.globalData.CardList;
493
+        for (var i = 0; i < list.length; i++) {
494
+          if (that.data.MiaoguoCardID == list[i].MiaoguoCardID) {
495
+            list[i].IsCollect = that.data.IsCollect;
496
+            break;
497
+          }
498
+        }
404
       });
499
       });
405
     }
500
     }
501
+    
502
+  },
503
+  onShowAnswer:function(){
504
+    this.setData({
505
+      IsShowAnswer:[1,1]
506
+    });
507
+  },
508
+  onPlayAgain:function(){
509
+    playList.push(this.data.MiaoguoCardID);
510
+    this.setData({
511
+      PlayListCount: playList.length,
512
+      NextID:1,
513
+    });
514
+    wx.showToast({
515
+      title: '稍后回放',
516
+      mask:true,
517
+      duration:500,
518
+    });
519
+  },
520
+  playNext: function (e) {
521
+    var that = this;
522
+    var div = e.currentTarget.dataset.div;
523
+    if (div==1){
524
+      this.data.CurrentIndex++;
525
+      if (this.data.CurrentIndex>=playList.length){
526
+        this.data.CurrentIndex = playList.length-1;
527
+      }
528
+    }
529
+    else {
530
+      this.data.CurrentIndex--;
531
+      if (this.data.CurrentIndex<0)
532
+        this.data.CurrentIndex=0;
533
+    }
534
+    that.setData({
535
+      CurrentIndex: this.data.CurrentIndex,
536
+      MiaoguoCardID: playList[this.data.CurrentIndex],
537
+      PlayListCount: playList.length,
538
+    });
539
+    that.init();
406
   },
540
   },
407
   showImage: function (e) {
541
   showImage: function (e) {
408
     var name = e.currentTarget.dataset.name;
542
     var name = e.currentTarget.dataset.name;

+ 2 - 1
pages/main/preview.json

@@ -1,3 +1,4 @@
1
 {
1
 {
2
-  "navigationBarTitleText": "格式预览"
2
+  "navigationBarTitleText": "格式预览",
3
+  "enablePullDownRefresh": true
3
 }
4
 }

+ 76 - 96
pages/main/preview.wxml

@@ -1,126 +1,106 @@
1
+<import src="../template/cardShow.wxml" />
2
+
1
 <view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;background-color:{{Color.BackColor}}'>
3
 <view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;background-color:{{Color.BackColor}}'>
2
   <!-- 顶端工具栏 -->
4
   <!-- 顶端工具栏 -->
3
   <block wx:if="{{ShowType=='show'}}">
5
   <block wx:if="{{ShowType=='show'}}">
4
     <view class="panelTop FlexRow">
6
     <view class="panelTop FlexRow">
5
       <view class='left FlexColumn'>
7
       <view class='left FlexColumn'>
6
-        <view class="text1">到期时间</view>
7
-        <view class="text2">{{LimitTimeStr}}</view>
8
+        <view class="text3" bindtap='practiceToday' hidden="{{!IsTodayPractice}}">今天必练</view>
9
+        <view class="text4 text3" bindtap='shelveTask' hidden="{{IsTodayPractice}}">今天不练</view>
8
       </view>
10
       </view>
9
       <view class='right FlexRow'>
11
       <view class='right FlexRow'>
10
-        <view class="panelTopBtn FlexRow" bindtap='deleteCard'>
11
-          <image class="universalpic_del_black_20x28" src='../images/universalpic_del_black_20x28.png' />
12
-        </view>
13
         <view class="panelTopBtn FlexRow" bindtap='getDetailInfo'>
12
         <view class="panelTopBtn FlexRow" bindtap='getDetailInfo'>
14
           <image class="universalpic_info_black_26x26" src='../images/universalpic_info_black_26x26.png' />
13
           <image class="universalpic_info_black_26x26" src='../images/universalpic_info_black_26x26.png' />
15
         </view>
14
         </view>
16
-        <view class="text3" bindtap='practiceToday' hidden="{{!IsTodayPractice}}">今天必练</view>
17
-        <view class="text4 text3" bindtap='shelveTask' hidden="{{IsTodayPractice}}">今天不练</view>
15
+        <view class="panelTopBtn FlexRow" bindtap='editField' data-id="0">
16
+          <image class="universalpic_edit_black_25x25" src='../images/universalpic_edit_black_25x25.png' />
17
+        </view>
18
+        <view class="panelTopBtn FlexRow" bindtap='gotoCollect'>
19
+          <image class="universalpic_fav_default_black_26x24" src='../images/universalpic_fav_default_black_26x24.png' wx:if="{{!IsCollect}}" />
20
+          <image class="universalpic_fav_default_black_26x24" src='../images/universalpic_fav_enable_red_26x24.png'  wx:if="{{IsCollect}}" />
21
+        </view>
22
+        <view class="panelTopBtn FlexRow" bindtap='deleteCard'>
23
+          <image class="universalpic_del_black_20x28" src='../images/universalpic_del_black_20x28.png' />
24
+        </view>
18
       </view>
25
       </view>
19
     </view>
26
     </view>
20
-    <view class="panelTop1"></view>
27
+    <view class="panelTop1" style='background-color:{{Color.BackColor}};'></view>
21
   </block>
28
   </block>
22
 
29
 
23
-  <!-- 第一段 -->
24
-  <view class="panelField1 FlexColumn" style='background-color:{{Color.BackColor}};'>
25
-    <view class="editFieldNull" hidden="{{ShowType=='sharepreview'}}"></view>
26
-    <view class="editFieldNull1" hidden="{{ShowType!='sharepreview'}}"></view>
27
-    
28
-    <view class="editField" bindtap='editField' data-id="1" wx:if="{{ShowType == 'show'}}">编辑段落1</view>
29
-    <view class="panelField11 panelItem FlexRow" style="font-size:46rpx;">
30
-      <block wx:for="{{Field[1]}}" wx:key="index">
31
-        <text class="textReturn" wx:if="{{index>0 && item.Type=='return'}}"></text>
32
-        <view class="textBr" wx:if="{{index>0 && item.Type=='br'}}"></view>
33
-        <text class="textNormal" selectable="true" space='ensp' wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
34
-
35
-        <text class="textNormal FlexRow" selectable="true" space='ensp' wx:if="{{item.Type=='line'}}">
36
-            <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem">
37
-              <text space='ensp' wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
38
-        <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
39
-      </block>
40
-      </text>
41
-
42
-      <view class="panelSound FlexRow" hover-class='panelSoundHover' hover-stay-time="1000" wx:if="{{item.Type=='sound'}}" bindtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="1">
43
-        <image class="universalpic_read_mark_black_20x20" src='../images/universalpic_read_mark_black_20x20.png' />
44
-      </view>
45
-
46
-      <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>
47
-      
48
-      <view class="imageContainer FlexColumn" wx:if="{{item.Type=='image'}}" style='width:{{item.Width}}rpx;height:{{item.Height}}rpx;'>
49
-        <image class="imageFree" mode="widthFix" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" data-serverurl="{{item.ContentServer}}" binderror="onBindError" />
30
+  <!-- 幻灯片播放 -->
31
+  <block wx:if="{{ShowType=='play'}}">
32
+    <view class="panelTop FlexRow"  style='background-color:{{Color.BackColor}};border-bottom:0;'>
33
+      <view class='left' catchtouchstart='gotoCollect'>
34
+      <view class='panelCancel0 FlexRow'>
35
+          <image hidden='{{IsCollect}}' src="../images/universalpic_fav_default_gray_26x24.png" class='universalpic_fav_default_gray_26x24' />
36
+          <image hidden='{{!IsCollect}}' src="../images/universalpic_fav_enable_tc0{{Color.ID}}_26x24.png" class='universalpic_fav_default_gray_26x24' />
37
+        </view>
50
       </view>
38
       </view>
51
-      </block>
52
-    </view>
53
-  </view>
54
-
55
-  <!-- 标签 -->
56
-  <view class="panelTag FlexColumn" wx:if="{{Tags.length>0}}">
57
-    <view class='panelTagLine' style='width:{{TagWidth}}rpx;background-color:{{Color.LineColor}};'></view>
58
-    <view class="panelTag1 FlexRow">
59
-      <view class="tag" wx:for="{{Tags}}" wx:key="index">{{item}}</view>
60
-    </view>
61
-  </view>
62
-
63
-  <!-- 第二段和第三段 -->
64
-  <view class="panelField20 FlexColumn">
65
-    <view class="editFieldNull2"  hidden="{{ShowType=='sharepreview'}}"></view>
66
-    <view class="editFieldNull3"  hidden="{{ShowType!='sharepreview'}}"></view>
67
-    
68
-    <block wx:for="{{[2,3]}}" wx:key="indexParent" wx:for-index="indexParent" wx:for-item="itemParent" wx:if="{{Field[itemParent].length>0}}" >
69
-    <view class="editField" bindtap='editField' data-id="{{itemParent}}" wx:if="{{ShowType == 'show'}}">编辑段落{{itemParent}}</view>
70
-    <view class="panelField2 FlexColumn" style='background-color:{{Color.FieldBackColor}};'>
71
-      <view class="panelField21 panelItem FlexRow" style='color:{{Color.FieldColor}};'>
72
-        <block wx:for="{{Field[itemParent]}}" wx:key="index">
73
-          <text class="textReturn" wx:if="{{index>0 && item.Type=='return'}}"></text>
74
-          <view class="textBr" wx:if="{{index>0 && item.Type=='br'}}"></view>
75
-
76
-          <text class="textNormal2 textNormal" selectable="true" space='ensp' wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
77
-
78
-          <text class="textNormal2 FlexRow" selectable="true" space='ensp' wx:if="{{item.Type=='line'}}">
79
-            <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem">
80
-              <text space='ensp' wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
81
-          <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
82
-        </block>
83
-        </text>
84
-
85
-        <view class="panelSound FlexRow" hover-class='panelSoundHover' hover-stay-time="1000" wx:if="{{item.Type=='sound'}}" bindtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="{{itemParent}}">
86
-          <image class="universalpic_read_mark_black_20x20" src='../images/universalpic_read_mark_black_20x20.png' />
39
+      <view class='right FlexRow'>
40
+        <view class="FlexColumn">
41
+          <view class='panelNumber1'>{{CurrentIndex+1}}</view>
42
+          <view class='panelNumber2Line' style='background-color:{{Color.LineColor}};'></view>
87
         </view>
43
         </view>
88
-
89
-        <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>
90
-        
91
-        <view class="imageContainer2 FlexColumn" wx:if="{{item.Type=='image'}}" style='width:{{item.Width}}rpx;height:{{item.Height}}rpx;'>
92
-          <image class="imageFree2" mode="widthFix" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" data-serverurl="{{item.ContentServer}}" binderror="onBindError" />
44
+        <view class="FlexColumn">
45
+          <view class='panelNumber2 panelNumber1'>{{PlayListCount}}</view>
93
         </view>
46
         </view>
94
-        </block>
95
       </view>
47
       </view>
96
     </view>
48
     </view>
97
-    </block>
98
-  </view>
99
-
49
+    <view class="panelTop1" style='background-color:{{Color.BackColor}};'></view>
50
+  </block>
100
 
51
 
52
+  <template is="CardShow" data="{{Color:Color,Field:Field,Tags:Tags,IsShowAnswer:IsShowAnswer,TagWidth:TagWidth,FontSize:FontSize,LimitTimeStr:LimitTimeStr,ShowType:ShowType}}" />
53
+  
101
   <view style='height:150rpx'></view>
54
   <view style='height:150rpx'></view>
102
 
55
 
103
-  <view class='panelSave' bindtap="close" wx:if="{{ShowType=='preview'}}">退出预览</view>
104
-
105
-  <view class='panelSaveShare panelSave FlexRow' wx:if="{{ShowType=='share'}}">
106
-    <view class='text5 text3' bindtap="returnDefault">首页</view>
107
-    <view class='btn3' bindtap="copyCard">另存为我的题卡</view>
108
-    <view class='text5'></view>
109
-  </view>
56
+  <view class='footer FlexColumn' style='background-color:{{Color.BackColor}}'>
57
+    <view class="panelFooter FlexRow" wx:if="{{ShowType=='preview'}}" catchtouchstart="close">
58
+      退出预览
59
+    </view>
110
 
60
 
111
-  <view class='panelSave FlexRow' wx:if="{{ShowType=='show'}}">
112
-    <view class='btn1' wx:if="{{PrevID==0}}"></view>
113
-    <view class='btn1 FlexRow' bindtap="onPreview" data-id="{{PrevID}}" wx:if="{{PrevID>0}}">
114
-      <image class="universalpic_prev_black_30x30" src='../images/universalpic_prev_black_30x30.png' />
61
+    <view class="panelFooter FlexRow" wx:if="{{ShowType=='show'}}">
62
+      <view class='btn1' wx:if="{{PrevID==0}}"></view>
63
+      <view class='btn1 FlexRow' catchtap="previewNext" data-id="{{PrevID}}" wx:if="{{PrevID>0}}">
64
+        <image class="universalpic_next_gray_30x30" src='../images/universalpic_prev_gray_30x30.png' />
65
+      </view>
66
+      <view class='btn2 FlexRow'>
67
+        <button class="btn21" open-type='share'>分享给大家</button>
68
+      </view>
69
+      <view class='btn1 FlexRow' catchtap="previewNext" data-id="{{NextID}}" wx:if="{{NextID>0}}">
70
+        <image class="universalpic_next_gray_30x30" src='../images/universalpic_next_gray_30x30.png' />
71
+      </view>
72
+      <view class='btn1' wx:if="{{NextID==0}}"></view>
115
     </view>
73
     </view>
116
-    <view class='btn2 FlexRow'>
117
-      <button class="btn21" open-type='share'>分享给大家</button>
74
+
75
+    <view class="panelFooter FlexRow" wx:if="{{ShowType=='share'}}">
76
+      <view class='btn1 FlexRow' catchtap="returnDefault">
77
+        <image class="universalpic_home_gray_28x28" src='../images/universalpic_home_gray_28x28.png' />
78
+      </view>
79
+      <view class='btn2 FlexRow'>
80
+        <button class="btn21" catchtap="copyCard">另存为我的题卡</button>
81
+      </view>
82
+      
83
+      <view class='btn1'></view>
118
     </view>
84
     </view>
119
-    <view class='btn1 FlexRow' bindtap="onPreview" data-id="{{NextID}}" wx:if="{{NextID>0}}">
120
-      <image class="universalpic_prev_black_30x30" src='../images/universalpic_next_black_30x30.png' />
85
+
86
+    <view class="panelFooter FlexRow" wx:if="{{ShowType=='play'}}">
87
+      <view class='btn1' wx:if="{{PrevID==0}}"></view>
88
+      <view class='btn1 FlexRow' catchtap="playNext" data-div="-1" wx:if="{{PrevID>0}}">
89
+        <image class="universalpic_next_gray_30x30" src='../images/universalpic_prev_gray_30x30.png' />
90
+      </view>
91
+      <view class='btn3 FlexRow' catchtouchstart='onPlayAgain'>
92
+        稍后回放
93
+      </view>
94
+      <view class='btn4 FlexRow' catchtouchstart='onShowAnswer'>
95
+        看答案
96
+      </view>
97
+      <view class='btn1 FlexRow' catchtap="playNext" data-div="1" wx:if="{{NextID>0}}">
98
+        <image class="universalpic_next_gray_30x30" src='../images/universalpic_next_gray_30x30.png' />
99
+      </view>
100
+      <view class='btn1' wx:if="{{NextID==0}}"></view>
121
     </view>
101
     </view>
122
-    <view class='btn1' wx:if="{{NextID==0}}"></view>
123
   </view>
102
   </view>
103
+  
124
 </view>
104
 </view>
125
 
105
 
126
 <audio hidden='true' id="myAudio0"></audio>
106
 <audio hidden='true' id="myAudio0"></audio>

+ 124 - 45
pages/main/preview.wxss

@@ -33,6 +33,42 @@
33
   margin-right: 20rpx;
33
   margin-right: 20rpx;
34
 }
34
 }
35
 
35
 
36
+.panelCancel0 {
37
+  width: 70rpx;
38
+  height: 70rpx;
39
+  background-color: rgba(0, 0, 0, 0.1);
40
+  border-radius: 50%;
41
+  margin-left: 15rpx;
42
+}
43
+.universalpic_fav_default_gray_26x24 {
44
+  width: 26rpx;
45
+  height: 24rpx;
46
+}
47
+
48
+
49
+.panelNumber1 {
50
+  font-family: 'Roboto-Black';
51
+  font-size: 20rpx;
52
+  margin: 0 3rpx;
53
+  height: 50rpx;
54
+  min-width: 50rpx;
55
+  text-align: center;
56
+  line-height: 50rpx;
57
+  color: rgba(255, 255, 255, 0.5);
58
+}
59
+
60
+.panelNumber2 {
61
+  color: #fff;
62
+  margin-right:25rpx; 
63
+}
64
+
65
+.panelNumber2Line {
66
+  width: 70%;
67
+  height: 6rpx;
68
+  margin-top: -7rpx;
69
+}
70
+
71
+
36
 .panelTopBtn{
72
 .panelTopBtn{
37
   width:100rpx;
73
   width:100rpx;
38
   height:120rpx;
74
   height:120rpx;
@@ -48,13 +84,25 @@
48
   height:26rpx;
84
   height:26rpx;
49
 }
85
 }
50
 
86
 
87
+.universalpic_edit_black_25x25{
88
+  width: 25rpx;
89
+  height: 25rpx;
90
+}
91
+
92
+.universalpic_fav_default_black_26x24{
93
+  width: 26rpx;
94
+  height: 24rpx;
95
+}
96
+
97
+.LimitTime{
98
+  align-items: flex-start;
99
+  width: 100%;
100
+}
101
+
51
 .text1 {
102
 .text1 {
52
   font-size:24rpx;
103
   font-size:24rpx;
53
-}
54
-.text2 {
55
-  color: #787878;
56
-  font-weight: 500;
57
-  font-size:28rpx;
104
+  color:#fff;
105
+  margin-left: 50rpx;
58
 }
106
 }
59
 
107
 
60
 .text3 {
108
 .text3 {
@@ -66,7 +114,6 @@
66
   border:1rpx solid #9B9B9B;
114
   border:1rpx solid #9B9B9B;
67
   border-radius: 10rpx;
115
   border-radius: 10rpx;
68
   font-size: 24rpx;
116
   font-size: 24rpx;
69
-  margin-left: 20rpx;
70
 }
117
 }
71
 
118
 
72
 .text4 {
119
 .text4 {
@@ -83,13 +130,13 @@
83
 /* 段落显示************************ */
130
 /* 段落显示************************ */
84
 
131
 
85
 .editFieldNull{
132
 .editFieldNull{
86
-  height:60rpx;
133
+  height:50rpx;
87
 }
134
 }
88
 .editFieldNull1{
135
 .editFieldNull1{
89
   height:40rpx;
136
   height:40rpx;
90
 }
137
 }
91
 .editFieldNull2{
138
 .editFieldNull2{
92
-  height:80rpx;
139
+  height:60rpx;
93
 }
140
 }
94
 .editFieldNull3{
141
 .editFieldNull3{
95
   height:30rpx;
142
   height:30rpx;
@@ -103,11 +150,6 @@
103
   z-index: 5;
150
   z-index: 5;
104
 }
151
 }
105
 
152
 
106
-.panelField10 {
107
-  width: 100%;
108
-  height: 110rpx;
109
-}
110
-
111
 .panelField1 {
153
 .panelField1 {
112
   width: 100%;
154
   width: 100%;
113
   justify-content: flex-start;
155
   justify-content: flex-start;
@@ -124,7 +166,7 @@
124
   min-height: 95rpx;
166
   min-height: 95rpx;
125
   align-items: flex-start;
167
   align-items: flex-start;
126
   justify-content: flex-start;
168
   justify-content: flex-start;
127
-  margin-top: 80rpx;
169
+  margin-top: 60rpx;
128
   z-index: 5;
170
   z-index: 5;
129
 }
171
 }
130
 
172
 
@@ -144,9 +186,9 @@
144
 
186
 
145
 .panelTag .tag {
187
 .panelTag .tag {
146
   font-size: 46rpx;
188
   font-size: 46rpx;
147
-  margin: 20rpx 30rpx 0 0;
189
+  margin: 0 30rpx 20rpx 0;
148
   font-weight: 400;
190
   font-weight: 400;
149
-  color: #d2d2d2;
191
+  color: #F1AB1E;
150
 }
192
 }
151
 
193
 
152
 .right2 {
194
 .right2 {
@@ -158,13 +200,6 @@
158
   align-items: flex-start;
200
   align-items: flex-start;
159
 }
201
 }
160
 
202
 
161
-.line1 {
162
-  width: 4rpx;
163
-  height: 30rpx;
164
-  background-color: rgba(255, 255, 255, 0.2);
165
-  margin-top: 66rpx;
166
-}
167
-
168
 .universalpic_show_white_30x30 {
203
 .universalpic_show_white_30x30 {
169
   width: 36rpx;
204
   width: 36rpx;
170
   height: 36rpx;
205
   height: 36rpx;
@@ -192,7 +227,8 @@
192
 .panelField21 {
227
 .panelField21 {
193
   width: 650rpx;
228
   width: 650rpx;
194
   font-size: 36rpx;
229
   font-size: 36rpx;
195
-  margin: 50rpx 40rpx;
230
+  margin: 40rpx;
231
+  line-height: 66rpx;
196
 }
232
 }
197
 
233
 
198
 .panelItem .panelSound {
234
 .panelItem .panelSound {
@@ -210,11 +246,35 @@
210
   color: #d2d2d2;
246
   color: #d2d2d2;
211
 }
247
 }
212
 
248
 
249
+.panelItem .universalpic_starting_tc01_26x26{
250
+  width: 26rpx;
251
+  height: 26rpx;
252
+  margin: 10rpx 20rpx 10rpx 0;
253
+}
254
+
213
 .panelItem .universalpic_read_mark_black_20x20 {
255
 .panelItem .universalpic_read_mark_black_20x20 {
214
   width: 21rpx;
256
   width: 21rpx;
215
   height: 20rpx;
257
   height: 20rpx;
216
 }
258
 }
217
 
259
 
260
+.panelItem .textProblem{
261
+  padding: 3rpx 20rpx;
262
+  background-color: #F1AB1E;
263
+  border-radius: 22rpx;
264
+  text-align: center;
265
+  font-size:28rpx;
266
+  line-height: 45rpx;
267
+  font-weight: 500;
268
+  color:#1e1e1e;
269
+  margin: 0 0 10rpx 0;
270
+}
271
+
272
+.panelItem .textDot{
273
+  color: #F1AB1E;
274
+  font-size:36rpx;
275
+  margin-right: 20rpx;
276
+}
277
+
218
 .panelItem .textLine {
278
 .panelItem .textLine {
219
   text-decoration: underline;
279
   text-decoration: underline;
220
 }
280
 }
@@ -232,6 +292,7 @@
232
   margin-right: 10rpx;
292
   margin-right: 10rpx;
233
 }
293
 }
234
 
294
 
295
+
235
 .panelItem .imageContainer {
296
 .panelItem .imageContainer {
236
   width: 650rpx;
297
   width: 650rpx;
237
   margin: 6rpx 0;
298
   margin: 6rpx 0;
@@ -241,7 +302,7 @@
241
 
302
 
242
 .panelItem .imageFree {
303
 .panelItem .imageFree {
243
   width: 650rpx;
304
   width: 650rpx;
244
-  border-radius: 20rpx;
305
+  border-radius: 6rpx;
245
 }
306
 }
246
 
307
 
247
 
308
 
@@ -270,17 +331,31 @@
270
 }
331
 }
271
 
332
 
272
 /* ******************************** */
333
 /* ******************************** */
273
-.panelSave {
274
-  width: 100%;
275
-  background-color: #fff;
334
+
335
+
336
+
337
+.footer{
338
+  width: 710rpx;
276
   position: fixed;
339
   position: fixed;
277
   bottom: 0;
340
   bottom: 0;
278
-  font-size: 36rpx;
279
   z-index: 10;
341
   z-index: 10;
280
-  color: #0071ef;
342
+  border-top-left-radius: 20rpx;
343
+  border-top-right-radius: 20rpx;
344
+}
345
+.panelFooter {
346
+  width: 710rpx;
347
+  margin-bottom: 20rpx;
348
+  background-color: #181a21;
349
+  border-radius: 20rpx;
350
+  color: #d2d2d2;
351
+  font-size: 48rpx;
281
   text-align: center;
352
   text-align: center;
282
-  line-height: 120rpx;
283
-  border-top: 1rpx solid #d2d2d2;
353
+  line-height: 140rpx;
354
+}
355
+
356
+.universalpic_next_gray_30x30{
357
+  width:28rpx;
358
+  height:26rpx;
284
 }
359
 }
285
 
360
 
286
 .btn1 {
361
 .btn1 {
@@ -291,39 +366,38 @@
291
 .btn2 {
366
 .btn2 {
292
   width: 450rpx;
367
   width: 450rpx;
293
   height: 120rpx;
368
   height: 120rpx;
294
-  background-color: #fff;
295
 }
369
 }
296
 
370
 
297
 .btn21 {
371
 .btn21 {
298
-  font-size: 36rpx;
299
-  color: #0071ef;
372
+  font-size: 48rpx;
373
+  color: #D2D2D2;
300
   text-align: center;
374
   text-align: center;
301
   padding-left: 0;
375
   padding-left: 0;
302
   padding-right: 0;
376
   padding-right: 0;
303
-  background-color: #fff;
377
+  background-color: #181a21;
304
 }
378
 }
305
 
379
 
306
 .btn21::after {
380
 .btn21::after {
307
   border: 0px;
381
   border: 0px;
308
 }
382
 }
309
 
383
 
310
-.universalpic_prev_black_30x30 {
311
-  width: 28rpx;
312
-  height: 26rpx;
313
-}
314
-
315
 .panelSaveShare{
384
 .panelSaveShare{
316
   justify-content: space-between;
385
   justify-content: space-between;
317
 }
386
 }
318
 
387
 
319
 .btn3 {
388
 .btn3 {
320
-  width: 375rpx;
389
+  width: 200rpx;
390
+  line-height: 120rpx;
391
+  text-align: center;
392
+  font-size:36rpx;
393
+}
394
+.btn4 {
395
+  width: 254rpx;
321
   line-height: 120rpx;
396
   line-height: 120rpx;
322
-  height:120rpx;
323
-  background-color: #fff;
324
   text-align: center;
397
   text-align: center;
325
-  color: #0071ef;
398
+  font-size:48rpx;
326
 }
399
 }
400
+
327
 .text5{
401
 .text5{
328
   width:108rpx;
402
   width:108rpx;
329
   margin: 0 20rpx;
403
   margin: 0 20rpx;
@@ -333,3 +407,8 @@
333
   width: 40rpx;
407
   width: 40rpx;
334
   height: 10rpx;
408
   height: 10rpx;
335
 }
409
 }
410
+
411
+.universalpic_home_gray_28x28{
412
+  width: 28rpx;
413
+  height: 28rpx;
414
+}

+ 4 - 7
pages/main/recommend.js

@@ -8,13 +8,10 @@ Page({
8
     IsChangeRecommend: true,
8
     IsChangeRecommend: true,
9
     SecondConfig: [{
9
     SecondConfig: [{
10
       Key: "蓝色",
10
       Key: "蓝色",
11
-      Value: 10,
12
     }, {
11
     }, {
13
       Key: "绿色",
12
       Key: "绿色",
14
-      Value: 30,
15
     }, {
13
     }, {
16
       Key: "黄色",
14
       Key: "黄色",
17
-      Value: 50,
18
     }
15
     }
19
     ]
16
     ]
20
   },
17
   },
@@ -31,13 +28,13 @@ Page({
31
   init:function(){
28
   init:function(){
32
     var that=this;
29
     var that=this;
33
     var secondConfig = wx.getStorageSync("SecondConfigArray");
30
     var secondConfig = wx.getStorageSync("SecondConfigArray");
34
-    if (!secondConfig)
35
-      secondConfig = [10, 30, 50];
36
-
37
-    if (secondConfig[0]==0){
31
+    
32
+    if (!secondConfig || secondConfig[0]==0){
38
       that.data.IsChangeRecommend = false;
33
       that.data.IsChangeRecommend = false;
34
+      secondConfig=[0,0,0];
39
     }
35
     }
40
     else{
36
     else{
37
+      secondConfig = [5, 40, 60];
41
       that.data.IsChangeRecommend = true;
38
       that.data.IsChangeRecommend = true;
42
       for (var j = 0; j < 3; j++) {
39
       for (var j = 0; j < 3; j++) {
43
         var arr = [];
40
         var arr = [];

文件差異過大導致無法顯示
+ 13 - 6
pages/main/recommend.wxml


+ 9 - 0
pages/main/recommend.wxss

@@ -79,4 +79,13 @@
79
   width:16rpx;
79
   width:16rpx;
80
   height:26rpx;
80
   height:26rpx;
81
   margin-left: 30rpx;
81
   margin-left: 30rpx;
82
+}
83
+
84
+
85
+.panelItem4 {
86
+  width: 690rpx;
87
+  font-weight: 400;
88
+  font-size: 24rpx;
89
+  margin: 30rpx;
90
+  color: #787878;
82
 }
91
 }

+ 8 - 2
pages/main/searchCard.js

@@ -66,13 +66,19 @@ Page({
66
     }
66
     }
67
     else{
67
     else{
68
       var url = 'GetMiaoguoCardList?UserID=' + app.globalData.userInfo.UserID;
68
       var url = 'GetMiaoguoCardList?UserID=' + app.globalData.userInfo.UserID;
69
+      var isCollect = e.currentTarget.dataset.iscollect;
70
+      if (!isCollect) 
71
+        isCollect=0;
72
+
73
+      url+="&IsCollect="+isCollect;
74
+      
69
       main.getData(url, function (data) {
75
       main.getData(url, function (data) {
70
         wx.hideLoading();
76
         wx.hideLoading();
71
         if (data) {
77
         if (data) {
72
           app.globalData.CardList= data.List;
78
           app.globalData.CardList= data.List;
73
           wx.navigateTo({
79
           wx.navigateTo({
74
-            url: './searchCardList?type=0&Count=' + data.Count,
75
-          })
80
+            url: './searchCardList?type=0&Count=' + data.Count+'&IsCollect='+isCollect,
81
+          });
76
         }
82
         }
77
       });
83
       });
78
     }
84
     }

+ 35 - 7
pages/main/searchCard.wxml

@@ -6,13 +6,41 @@
6
         <view>搜索题卡</view>
6
         <view>搜索题卡</view>
7
       </view>
7
       </view>
8
     </view>
8
     </view>
9
-    <view class='panelBtn FlexRow'>
10
-      <view class='text1 FlexRow' bindtap="getList" data-id="0">
11
-        <view>全部题卡</view>
12
-        <view class="text2">{{CardNumber}}</view>
9
+    <view class='panelBtn FlexColumn'>
10
+      <view class="panelItem FlexRow" bindtap="getList" data-id="0">
11
+        <view class="panelItem1">
12
+          全部题卡
13
+        </view>
14
+        <view class="panelItem2 FlexRow">
15
+          <view>{{CardNumber}}</view>
16
+          <image class="universalpic_indicator_right_gray" src='../images/universalpic_indicator_right_gray.png' />
17
+        
18
+        </view>
13
       </view>
19
       </view>
14
-      <view class='line1'></view>
15
-      <view class='text1' bindtap="getList" data-id="1">剩余任务</view>
20
+      <view class="lineWidthAll FlexRow">
21
+        <view class="lineWidth720"></view>
22
+      </view>
23
+      <view class="panelItem FlexRow" bindtap="getList" data-id="1">
24
+        <view class="panelItem1">
25
+          今天剩余任务量
26
+        </view>
27
+        <view class="panelItem2 FlexRow">
28
+          <image class="universalpic_indicator_right_gray" src='../images/universalpic_indicator_right_gray.png' />
29
+        </view>
30
+      </view>
31
+      <view class="lineWidthAll FlexRow">
32
+        <view class="lineWidth720"></view>
33
+      </view>
34
+      <view class="panelItem FlexRow" bindtap="getList" data-id="0" data-iscollect="1">
35
+        <view class="panelItem1 FlexRow">
36
+          <image class="universalpic_fav_default_gray_26x24" src='../images/universalpic_fav_default_gray_26x24.png' />
37
+          <view>幻灯片</view>
38
+        </view>
39
+        <view class="panelItem2 FlexRow">
40
+          <image class="universalpic_indicator_right_gray" src='../images/universalpic_indicator_right_gray.png' />
41
+        </view>
42
+      </view>
43
+      
16
     </view>
44
     </view>
17
     <view class='lineFooter'></view>
45
     <view class='lineFooter'></view>
18
   </view>
46
   </view>
@@ -24,7 +52,7 @@
24
         <view>学习</view>
52
         <view>学习</view>
25
       </view>
53
       </view>
26
       <view class='line1'></view>
54
       <view class='line1'></view>
27
-      <view class='panelBottom11 FlexColumn' bindtap="goto" data-url="add?type=add&type2=1&id=0">
55
+      <view class='panelBottom11 FlexColumn' bindtap="goto" data-url="add?type=add&id=0">
28
         <image class="program_tabbar_study_default" src='../images/program_tabbar_add_default.png' />
56
         <image class="program_tabbar_study_default" src='../images/program_tabbar_add_default.png' />
29
         <view>添加</view>
57
         <view>添加</view>
30
       </view>
58
       </view>

+ 38 - 23
pages/main/searchCard.wxss

@@ -36,29 +36,6 @@
36
 }
36
 }
37
 
37
 
38
 
38
 
39
-.panelBtn{
40
-  width:100%;
41
-  margin-top: 50rpx;
42
-  background-color: #F8F8F8;
43
-}
44
-.panelBtn .line1{
45
-  width:4rpx;
46
-  height:30rpx;
47
-  background-color: #D2D2D2;
48
-}
49
-.panelBtn .text1{
50
-  width:374rpx;
51
-  line-height:100rpx;
52
-  text-align: center;
53
-  font-size:28rpx;
54
-  font-weight: 400;
55
-}
56
-.panelBtn .text2{
57
-  font-family: 'Roboto-Black';
58
-  margin-left: 20rpx;
59
-}
60
-
61
-
62
 .panelBottom {
39
 .panelBottom {
63
   position: fixed;
40
   position: fixed;
64
   bottom: 0;
41
   bottom: 0;
@@ -89,4 +66,42 @@
89
 
66
 
90
 .text5{
67
 .text5{
91
   color:#000000;
68
   color:#000000;
69
+}
70
+
71
+.panelBtn{
72
+  margin-top: 20rpx;
73
+}
74
+
75
+.panelItem {
76
+  width: 100%;
77
+  justify-content: space-between;
78
+  font-size: 28rpx;
79
+  height: 100rpx;
80
+  background-color: #fff;
81
+}
82
+
83
+.panelItem1 {
84
+  margin-left: 30rpx;
85
+  justify-content: flex-start;
86
+  font-weight: 400;
87
+  font-size:28rpx;
88
+}
89
+
90
+.panelItem2 {
91
+  margin-right: 30rpx;
92
+  color: #787878;
93
+  font-size:28rpx;
94
+  font-weight: 400;
95
+}
96
+
97
+.universalpic_indicator_right_gray{
98
+  width:16rpx;
99
+  height:26rpx;
100
+  margin-left: 30rpx;
101
+}
102
+
103
+.universalpic_fav_default_gray_26x24{
104
+  width:26rpx;
105
+  height:24rpx;
106
+  margin-right: 20rpx;
92
 }
107
 }

+ 38 - 0
pages/main/searchCard1.js

@@ -12,6 +12,15 @@ Page({
12
     that.setData({
12
     that.setData({
13
       Containnerheight: main.getWindowHeight(),
13
       Containnerheight: main.getWindowHeight(),
14
       IsShowNull: false,
14
       IsShowNull: false,
15
+      
16
+    });
17
+
18
+    common.getStorageValue(that, "SearchCardTextList", [], function () {
19
+    });
20
+  },
21
+  onShow:function(){
22
+    this.setData({
23
+      Focus: true,
15
     });
24
     });
16
   },
25
   },
17
   onKeyInput: function (e) {
26
   onKeyInput: function (e) {
@@ -22,6 +31,8 @@ Page({
22
     });
31
     });
23
   },
32
   },
24
   onSearch: function (e) {
33
   onSearch: function (e) {
34
+    if (e.currentTarget.dataset.search)
35
+      this.data.SearchInfo = e.currentTarget.dataset.search;
25
     if (this.data.SearchInfo && this.data.SearchInfo.length > 0) {
36
     if (this.data.SearchInfo && this.data.SearchInfo.length > 0) {
26
       var search = this.data.SearchInfo;
37
       var search = this.data.SearchInfo;
27
       
38
       
@@ -38,6 +49,26 @@ Page({
38
           })
49
           })
39
         }
50
         }
40
       });
51
       });
52
+
53
+      setTimeout(function () {
54
+        var arr = that.data.SearchCardTextList;
55
+        for (var i = 0; i < arr.length; i++) {
56
+          if (arr[i] == search) {
57
+            arr.splice(i, 1);
58
+            break;
59
+          }
60
+        }
61
+        arr.unshift(search);
62
+
63
+        while (arr.length > 10) {
64
+          arr.pop();
65
+        }
66
+
67
+        wx.setStorageSync("SearchCardTextList", arr);
68
+        that.setData({
69
+          SearchCardTextList: arr,
70
+        });
71
+      }, 2000);
41
     }
72
     }
42
     else {
73
     else {
43
       wx.showToast({
74
       wx.showToast({
@@ -50,6 +81,13 @@ Page({
50
       delta: 1,
81
       delta: 1,
51
     });
82
     });
52
   },
83
   },
84
+  deleteItem: function (e) {
85
+    var that = this;
86
+    that.setData({
87
+      SearchCardTextList: [],
88
+    });
89
+    wx.removeStorageSync("SearchCardTextList");
90
+  },
53
   onShareAppMessage: function () {
91
   onShareAppMessage: function () {
54
     return {
92
     return {
55
       title: app.globalData.ShareTitle,
93
       title: app.globalData.ShareTitle,

+ 19 - 1
pages/main/searchCard1.wxml

@@ -3,7 +3,7 @@
3
     <view class="panelSearch FlexRow">
3
     <view class="panelSearch FlexRow">
4
       <view class="panelSearch1 FlexRow">
4
       <view class="panelSearch1 FlexRow">
5
         <image class="universalpic_search_gray_30x30" src='../images/universalpic_search_gray_30x30.png' />
5
         <image class="universalpic_search_gray_30x30" src='../images/universalpic_search_gray_30x30.png' />
6
-        <input class='input' maxlength='50' auto-focus bindinput="onKeyInput" value="{{SearchInfo}}" />
6
+        <input class='input' maxlength='50' focus='{{Focus}}' bindinput="onKeyInput" value="{{SearchInfo}}" />
7
       </view>
7
       </view>
8
     </view>
8
     </view>
9
     <view class='lineFooter'></view>
9
     <view class='lineFooter'></view>
@@ -13,5 +13,23 @@
13
       <view class='text2 text1' bindtap="onSearch">搜索</view>
13
       <view class='text2 text1' bindtap="onSearch">搜索</view>
14
     </view>
14
     </view>
15
     <view class='lineFooter'></view>
15
     <view class='lineFooter'></view>
16
+
17
+    <block wx:if="{{SearchCardTextList.length>0}}">
18
+      <view class="panelTitle0 panelTitle FlexRow">
19
+        <view class="panelTitle3">近期搜索</view>
20
+        <view class="panelTitle4 FlexRow" bindtap='deleteItem'>
21
+          <image class="universalpic_del_black_20x28" src='../images/universalpic_del_black_20x28.png' />
22
+        </view>
23
+      </view>
24
+
25
+      <view class='panelItemSearch0 FlexRow'>
26
+        <view class="panelTag FlexRow" wx:for="{{SearchCardTextList}}" wx:key="index" bindtap='onSearch' data-search="{{item}}">
27
+          <view class="panelTag0">{{item}}</view>
28
+        </view>
29
+      </view>
30
+
31
+      <view class='lineFooter'></view>
32
+    </block>
33
+
16
   </view>
34
   </view>
17
 </view>
35
 </view>

+ 44 - 1
pages/main/searchCard1.wxss

@@ -118,4 +118,47 @@
118
   margin-right: 30rpx;
118
   margin-right: 30rpx;
119
   color: #1e1e1e;
119
   color: #1e1e1e;
120
   font-weight: 400;
120
   font-weight: 400;
121
-}
121
+}
122
+
123
+
124
+.panelTitle0 {
125
+  background-color: #fff;
126
+  margin-top: 10rpx;
127
+}
128
+
129
+.panelTitle .panelTitle3 {
130
+  font-size: 32rpx;
131
+  margin: 30rpx;
132
+}
133
+
134
+.panelTitle .panelTitle4 {
135
+  width:80rpx;
136
+  height:88rpx;
137
+}
138
+
139
+.universalpic_del_black_20x28{
140
+  width:20rpx;
141
+  height:28rpx;
142
+}
143
+
144
+
145
+.panelItemSearch0 {
146
+  width: 100%;
147
+  justify-content: flex-start;
148
+  font-size: 24rpx;
149
+  background-color: #fff;
150
+  flex-wrap: wrap;
151
+}
152
+
153
+
154
+.panelItemSearch0 .panelTag{
155
+  line-height: 73rpx;
156
+  height:73rpx;
157
+  border:1rpx solid #9B9B9B;
158
+  margin: 0 0 30rpx 30rpx;
159
+  border-radius: 10rpx;
160
+  color:#787878;
161
+}
162
+.panelItemSearch0 .panelTag0{
163
+  margin: 0 30rpx;
164
+}

+ 43 - 18
pages/main/searchCardList.js

@@ -12,12 +12,12 @@ Page({
12
     wx.hideShareMenu();
12
     wx.hideShareMenu();
13
     var that = this;
13
     var that = this;
14
 
14
 
15
-    var Search = "", IsToday = 0;
15
+    var Search = "", IsToday = 0, IsCollect = 0;
16
 
16
 
17
     if (options.search) {
17
     if (options.search) {
18
       Search = options.search;
18
       Search = options.search;
19
       wx.setNavigationBarTitle({
19
       wx.setNavigationBarTitle({
20
-        title: options.search
20
+        title: "搜索结果"
21
       });
21
       });
22
     }
22
     }
23
     else if (options.type == 1) {
23
     else if (options.type == 1) {
@@ -26,8 +26,15 @@ Page({
26
         title: "剩余任务"
26
         title: "剩余任务"
27
       });
27
       });
28
     }
28
     }
29
+    else if (options.IsCollect == 1) {
30
+      wx.setNavigationBarTitle({
31
+        title: "幻灯片"
32
+      });
33
+      IsCollect=1;
34
+    }
29
 
35
 
30
     that.setData({
36
     that.setData({
37
+      IsCollect:IsCollect,
31
       Search: Search,
38
       Search: Search,
32
       IsToday: IsToday,
39
       IsToday: IsToday,
33
       Count: options.Count,
40
       Count: options.Count,
@@ -38,10 +45,16 @@ Page({
38
     var that = this;
45
     var that = this;
39
     that.getList();
46
     that.getList();
40
   },
47
   },
48
+  onPullDownRefresh: function () {
49
+    var that = this;
50
+    app.globalData.CardList=[];
51
+    that.gotoNextPage({currentTarget:{dataset:{id:0}}});
52
+    wx.stopPullDownRefresh();
53
+  },
41
   getList: function () {
54
   getList: function () {
42
     var that=this;
55
     var that=this;
43
     var list = app.globalData.CardList;
56
     var list = app.globalData.CardList;
44
-    var len = 20;
57
+    var len = 16;
45
     for (var i = 0; i < list.length; i++) {
58
     for (var i = 0; i < list.length; i++) {
46
       var item = list[i];
59
       var item = list[i];
47
       item.Content[1].ContentStr = replaceString(item.Content[1].Content);
60
       item.Content[1].ContentStr = replaceString(item.Content[1].Content);
@@ -64,19 +77,19 @@ Page({
64
       }
77
       }
65
     }
78
     }
66
 
79
 
67
-    if (that.data.IsToday==1){
68
-      var tempList=[];
69
-      for (var i = 0; i < list.length; i++) {
70
-        var item = list[i];
71
-        var limitTimeStr = common.formatDateCHS(item.LimitTime);
72
-        var today = common.formatDateCHS(common.formatTime(new Date()));
73
-        if (limitTimeStr <= today) {
74
-          tempList.push(list[i]);
75
-        }
76
-      }
77
-      list=tempList;
78
-      app.globalData.CardList=list;
79
-    }
80
+    // if (that.data.IsToday==1){
81
+    //   var tempList=[];
82
+    //   for (var i = 0; i < list.length; i++) {
83
+    //     var item = list[i];
84
+    //     var limitTimeStr = common.formatDateCHS(item.LimitTime);
85
+    //     var today = common.formatDateCHS(common.formatTime(new Date()));
86
+    //     if (limitTimeStr <= today) {
87
+    //       tempList.push(list[i]);
88
+    //     }
89
+    //   }
90
+    //   list=tempList;
91
+    //   app.globalData.CardList=list;
92
+    // }
80
 
93
 
81
     var hasPage=false;
94
     var hasPage=false;
82
     if (list.length<that.data.Count && that.data.IsToday==0)
95
     if (list.length<that.data.Count && that.data.IsToday==0)
@@ -135,6 +148,11 @@ Page({
135
       url: './preview?type=show&id=' + id,
148
       url: './preview?type=show&id=' + id,
136
     })
149
     })
137
   },
150
   },
151
+  playPPT:function(){
152
+    wx.navigateTo({
153
+      url: './preview?type=play',
154
+    })
155
+  },
138
   onBindError: function (e) {
156
   onBindError: function (e) {
139
     var that = this;
157
     var that = this;
140
     var id = e.currentTarget.dataset.id;
158
     var id = e.currentTarget.dataset.id;
@@ -165,7 +183,9 @@ Page({
165
     
183
     
166
     var that = this;
184
     var that = this;
167
     var id = e.currentTarget.dataset.id;
185
     var id = e.currentTarget.dataset.id;
168
-    var url = 'GetMiaoguoCardList?UserID=' + app.globalData.userInfo.UserID + "&IsToday=" + that.data.IsToday + "&PageID=" + id;
186
+    var url = 'GetMiaoguoCardList?UserID=' + app.globalData.userInfo.UserID + "&IsToday=" + that.data.IsToday;
187
+    if (id && id>0)
188
+      url+="&PageID=" + id;
169
     if (that.data.Search)
189
     if (that.data.Search)
170
       url += "&Key=" + that.data.Search;
190
       url += "&Key=" + that.data.Search;
171
 
191
 
@@ -183,7 +203,12 @@ Page({
183
   },
203
   },
184
   addCard: function () {
204
   addCard: function () {
185
     wx.redirectTo({
205
     wx.redirectTo({
186
-      url: './add?type=add&type2=1&id=0',
206
+      url: './add?type=add&id=0',
207
+    });
208
+  },
209
+  onSearch:function(){
210
+    wx.navigateBack({
211
+      delta: 1,
187
     });
212
     });
188
   },
213
   },
189
   onShareAppMessage: function () {
214
   onShareAppMessage: function () {

+ 2 - 1
pages/main/searchCardList.json

@@ -1,4 +1,5 @@
1
 {
1
 {
2
   "navigationBarTitleText": "全部题卡",
2
   "navigationBarTitleText": "全部题卡",
3
-  "backgroundColor": "#F0F0F0"
3
+  "backgroundColor": "#F0F0F0",
4
+  "enablePullDownRefresh": true
4
 }
5
 }

+ 36 - 10
pages/main/searchCardList.wxml

@@ -1,12 +1,26 @@
1
 <view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
1
 <view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
2
-  <view class="panelTop FlexRow">
3
-    <view class='left'>{{Count}}张题卡</view>
4
-    <view class='right FlexRow' bindtap='addCard'>
5
-      <image class="universalpic_add_gray_30x30" src='../images/universalpic_add_gray_30x30.png' />
2
+  <view class="panelTop FlexColumn">
3
+    <view class="panelSearch FlexRow" wx:if="{{Search}}">
4
+      <view class="panelSearch1 FlexRow" bindtap='onSearch'>
5
+        <image class="universalpic_search_gray_30x30" src='../images/universalpic_search_gray_30x30.png' />
6
+        <view class='input'>{{Search}}</view>
7
+      </view>
8
+    </view>
9
+    <view class="panelTop0 FlexRow">
10
+      <view class='panelTop1 FlexRow' bindtap='addCard'>
11
+        <image class="universalpic_add_black_30x30" src='../images/universalpic_add_black_30x30.png' />
12
+      </view>
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' /> -->
16
+      </view>
17
+      <view class='panelTop1 FlexRow' wx:if='{{List.length==0}}'>
18
+      </view>
6
     </view>
19
     </view>
7
   </view>
20
   </view>
8
   <block wx:if="{{List.length>0}}">
21
   <block wx:if="{{List.length>0}}">
9
-    <view style='width:100%;height:150rpx;margin-top:0rpx;'></view>
22
+    <view style='width:100%;height:120rpx;margin-top:0rpx;' wx:if="{{!Search}}"></view>
23
+    <view style='width:100%;height:250rpx;margin-top:0rpx;' wx:if="{{Search}}"></view>
10
     <block wx:for="{{List}}" wx:key="index">
24
     <block wx:for="{{List}}" wx:key="index">
11
       <view class="lineWidthAll FlexRow" wx:if="{{index>0}}">
25
       <view class="lineWidthAll FlexRow" wx:if="{{index>0}}">
12
         <view class="lineWidth720"></view>
26
         <view class="lineWidth720"></view>
@@ -19,8 +33,11 @@
19
             <view class='Text2'>{{item.Content[2].ContentStr}}</view>
33
             <view class='Text2'>{{item.Content[2].ContentStr}}</view>
20
           </view>
34
           </view>
21
         </view>
35
         </view>
22
-        <view class="panelItem2">
23
-          {{item.CreateTimeStr}}
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}}" />
40
+          </view>
24
         </view>
41
         </view>
25
       </view>
42
       </view>
26
     </block>
43
     </block>
@@ -32,11 +49,20 @@
32
     </view>
49
     </view>
33
     <view class='lineFooter'></view>
50
     <view class='lineFooter'></view>
34
 
51
 
35
-    <view style='width:100%;height:100rpx;'></view>
52
+    <view style='width:100%;height:100rpx;' wx:if="{{IsCollect!=1}}"></view>
53
+    <view style='width:100%;height:200rpx;' wx:if="{{IsCollect==1}}"></view>
54
+
55
+    <view class='panelFooter FlexRow' wx:if="{{IsCollect==1}}" bindtap='playPPT'>
56
+      <view class="btn">播放幻灯片</view>
57
+    </view>
36
   </block>
58
   </block>
37
 
59
 
38
   <block wx:if="{{List.length==0}}">
60
   <block wx:if="{{List.length==0}}">
39
-    <view class='Text3'>无此题卡</view>
40
-    <view class='Text4'>可按右上角添加</view>
61
+
62
+    <view style="height:110rpx;" wx:if="{{Search}}"></view>
63
+    <view class='panelNull FlexColumn'>
64
+      <view class='Text3'>无匹配</view>
65
+      <view class='Text4'>从左上角按钮添加新题卡</view>
66
+    </view>
41
   </block>
67
   </block>
42
 </view>
68
 </view>

+ 83 - 9
pages/main/searchCardList.wxss

@@ -7,26 +7,62 @@
7
 
7
 
8
 .panelTop{
8
 .panelTop{
9
   width: 100%;
9
   width: 100%;
10
-  height:100rpx;
11
   background-color: #fff;
10
   background-color: #fff;
12
-  font-size: 28rpx;
13
-  font-weight: 400;
14
-  justify-content: space-between;
15
   position: fixed;
11
   position: fixed;
16
   top:0;
12
   top:0;
17
   z-index: 10;
13
   z-index: 10;
18
   border-bottom: 1rpx solid #d2d2d2;
14
   border-bottom: 1rpx solid #d2d2d2;
19
 }
15
 }
20
 
16
 
21
-.left{
22
-  margin-left: 30rpx;
17
+.panelTop0{
18
+  width: 100%;
19
+  height:100rpx;
20
+  font-size: 28rpx;
21
+  font-weight: 400;
22
+  justify-content: space-between;
23
+}
24
+
25
+.panelSearch{
26
+  width:100%;
27
+  background-color: #fff;
28
+}
29
+.panelSearch1{
30
+  width:690rpx;
31
+  height:80rpx;
32
+  margin: 20rpx 0 10rpx 0;
33
+  border-radius: 14rpx;
34
+  background-color: #F0F0F0;
35
+  color:#787878;
36
+  font-size:28rpx;
37
+  font-weight: 400;
38
+  justify-content: flex-start;
39
+}
40
+
41
+.universalpic_search_gray_30x30{
42
+  width:30rpx;
43
+  height:30rpx;
44
+  margin: 0 20rpx 0 30rpx;
45
+}
46
+
47
+.input{
48
+  font-size:28rpx;
49
+  font-weight: 400;
50
+  color:#1e1e1e;
51
+  width:600rpx;
52
+  height:40rpx;
23
 }
53
 }
24
 
54
 
25
-.right{
55
+.panelTop1 {
26
   width:90rpx;
56
   width:90rpx;
27
   height:100rpx;
57
   height:100rpx;
28
 }
58
 }
29
-.universalpic_add_gray_30x30{
59
+
60
+.universalpic_add_black_30x30{
61
+  width:30rpx;
62
+  height:30rpx;
63
+}
64
+
65
+.universalpic_sequence_black_30x30{
30
   width:30rpx;
66
   width:30rpx;
31
   height:30rpx;
67
   height:30rpx;
32
 }
68
 }
@@ -71,17 +107,30 @@
71
   color: #9B9B9B;
107
   color: #9B9B9B;
72
   font-size:22rpx;
108
   font-size:22rpx;
73
   font-weight: 400;
109
   font-weight: 400;
110
+  align-items: flex-end;
111
+}
112
+
113
+.panelItem21 {
114
+  width:26rpx;
115
+  height:24rpx;
116
+  margin-top: 14rpx;
74
 }
117
 }
75
 
118
 
119
+.panelNull{
120
+  margin-top: 150rpx;
121
+  width:100%;
122
+  align-items: flex-start;
123
+}
76
 .Text3{
124
 .Text3{
77
-  margin-top: 491rpx;
78
   font-size:32rpx;
125
   font-size:32rpx;
126
+  margin-left: 30rpx;
79
 }
127
 }
80
 .Text4{
128
 .Text4{
81
   margin-top: 10rpx;
129
   margin-top: 10rpx;
82
   font-size:24rpx;
130
   font-size:24rpx;
83
   color:#787878;
131
   color:#787878;
84
   font-weight: 400;
132
   font-weight: 400;
133
+  margin-left: 30rpx;
85
 }
134
 }
86
 
135
 
87
 .panelItem3 {
136
 .panelItem3 {
@@ -92,4 +141,29 @@
92
 .more{
141
 .more{
93
   font-size:28rpx;
142
   font-size:28rpx;
94
   color:#0071EF;
143
   color:#0071EF;
144
+}
145
+
146
+.panelFooter{
147
+  width:100%;
148
+  height:120rpx;
149
+  border-top:1rpx solid #D2D2D2;
150
+  position: fixed;
151
+  bottom:0;
152
+  background-color: #fff;
153
+}
154
+.panelFooter .btn{
155
+  width: 602rpx;
156
+  background-color: #fff;
157
+  border:1rpx solid #9B9B9B;
158
+  color:#0071EF;
159
+  text-align: center;
160
+  line-height: 80rpx;
161
+  height:80rpx;
162
+  border-radius: 10rpx;
163
+  font-size:32rpx;
164
+}
165
+
166
+.universalpic_fav_default_gray_26x24{
167
+  width:26rpx;
168
+  height:24rpx;
95
 }
169
 }

+ 3 - 4
pages/main/setting.js

@@ -5,8 +5,8 @@ const app = getApp();
5
 const arrSortType = ["时间较早的题卡", "时间较近的题卡"];
5
 const arrSortType = ["时间较早的题卡", "时间较近的题卡"];
6
 const arrSortType2 = ["较早的", "较近的"];
6
 const arrSortType2 = ["较早的", "较近的"];
7
 const arrClickType=["专属按钮","点击空白","两种方式"];
7
 const arrClickType=["专属按钮","点击空白","两种方式"];
8
-var arrUserName = ["程晟涵", "大耳兔", "teresa", "古利古拉", "Lucy-chan","刘华润"];
9
-var arrUserID = [2, 11, 8, 9, 10,12];
8
+var arrUserName = ["程晟涵", "大耳兔", "teresa", "古利古拉", "Lucy-chan","临时"];
9
+var arrUserID = [2, 11, 8, 9, 10, 12];
10
 
10
 
11
 Page({
11
 Page({
12
   data: {
12
   data: {
@@ -79,7 +79,7 @@ Page({
79
     }
79
     }
80
 
80
 
81
     var secondConfig = wx.getStorageSync("SecondConfigArray");
81
     var secondConfig = wx.getStorageSync("SecondConfigArray");
82
-    if (!secondConfig || (secondConfig[0] > 0)) {
82
+    if (secondConfig && secondConfig[0] > 0) {
83
       that.setData({
83
       that.setData({
84
         RecommendName: "启用",
84
         RecommendName: "启用",
85
       });
85
       });
@@ -174,7 +174,6 @@ Page({
174
     var index = wx.getStorageSync("MemoryLevel");
174
     var index = wx.getStorageSync("MemoryLevel");
175
     if (!index) {
175
     if (!index) {
176
       index = 0;
176
       index = 0;
177
-      wx.setStorageSync("MemoryLevel", index);
178
     }
177
     }
179
     app.globalData.MemoryLevel = index;
178
     app.globalData.MemoryLevel = index;
180
     var list = main.getMemoryLevelAll();
179
     var list = main.getMemoryLevelAll();

+ 2 - 2
pages/main/setting.wxml

@@ -51,7 +51,7 @@
51
     <view class="panelTitle2"></view>
51
     <view class="panelTitle2"></view>
52
   </view>
52
   </view>
53
   <view class="panelItem FlexRow" bindtap='setMemoryLevel'>
53
   <view class="panelItem FlexRow" bindtap='setMemoryLevel'>
54
-    <view class="panelItem1">辨识方案</view>
54
+    <view class="panelItem1">命名方式</view>
55
     <view class="panelItem2 FlexRow">
55
     <view class="panelItem2 FlexRow">
56
       <view class="picker">
56
       <view class="picker">
57
         {{MemoryLevelName}}
57
         {{MemoryLevelName}}
@@ -63,7 +63,7 @@
63
     <view class="lineWidth720"></view>
63
     <view class="lineWidth720"></view>
64
   </view>
64
   </view>
65
   <view class="panelItem FlexRow" bindtap='setRecommend'>
65
   <view class="panelItem FlexRow" bindtap='setRecommend'>
66
-    <view class="panelItem1">选择建议</view>
66
+    <view class="panelItem1">计时参考</view>
67
     <view class="panelItem2 FlexRow">
67
     <view class="panelItem2 FlexRow">
68
       <view class="picker">
68
       <view class="picker">
69
         {{RecommendName}}
69
         {{RecommendName}}

+ 11 - 0
pages/other/test.js

@@ -14,6 +14,17 @@ Page({
14
   onLoad: function (options) {
14
   onLoad: function (options) {
15
 
15
 
16
   },
16
   },
17
+  takePhoto() {
18
+    const ctx = wx.createCameraContext()
19
+    ctx.takePhoto({
20
+      quality: 'high',
21
+      success: (res) => {
22
+        this.setData({
23
+          src: res.tempImagePath
24
+        })
25
+      }
26
+    })
27
+  },
17
 
28
 
18
   /**
29
   /**
19
    * 生命周期函数--监听页面初次渲染完成
30
    * 生命周期函数--监听页面初次渲染完成

+ 9 - 2
pages/other/test.wxml

@@ -1,2 +1,9 @@
1
-<!--pages/other/test.wxml-->
2
-<text class='textPinyin'>鲜花盛开</text>
1
+<camera
2
+  device-position="back"
3
+  flash="off"
4
+  binderror="error"
5
+  style="width: 100%; height: 300px;"
6
+></camera>
7
+<button type="primary" bindtap="takePhoto">拍照</button>
8
+<view>预览</view>
9
+<image mode="widthFix" src="{{src}}"></image>

+ 87 - 0
pages/template/cardShow.wxml

@@ -0,0 +1,87 @@
1
+<template name="CardShow">
2
+  <!-- 第一段 -->
3
+  <view class="panelField1 FlexColumn" style='background-color:{{Color.BackColor}};'>
4
+    <view class="editFieldNull"></view>
5
+    <block wx:if="{{ShowType=='show'}}">
6
+      <view class="LimitTime FlexColumn">
7
+        <view class="text1">到期时间</view>
8
+        <view class="text1">{{LimitTimeStr}}</view>
9
+      </view>
10
+      <view class="editFieldNull"></view>
11
+    </block>
12
+    <view class="panelField11 panelItem FlexRow" style="font-size:{{FontSize}}rpx;">
13
+      <text class="textProblem" style='background-color:{{Color.LineColor}};'>题目</text>
14
+      <view class="textReturn"></view>
15
+      <block wx:for="{{Field[1]}}" wx:key="index">
16
+
17
+        <text class="textReturn" wx:if="{{index>0 && item.Type=='return'}}"></text>
18
+        <view class="textBr" wx:if="{{index>0 && item.Type=='br'}}" style="height:{{FontSize/2}}rpx;"></view>
19
+        <text class="textNormal" selectable="true" space='ensp' wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
20
+        <text class="textNormal" selectable="true" space='ensp' wx:if="{{item.Type=='line'}}">
21
+            <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem" wx:for-index="contentIndex">
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
+      </block>
25
+      </text>
26
+
27
+      <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">
28
+        <image class="universalpic_read_mark_black_20x20" src='../images/universalpic_read_mark_black_20x20.png' />
29
+      </view>
30
+
31
+      <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>
32
+
33
+      <view class="imageContainer FlexColumn" wx:if="{{item.Type=='image'}}" style='width:{{item.Width}}rpx;height:{{item.Height}}rpx;'>
34
+        <image class="imageFree" mode="widthFix" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" data-serverurl="{{item.ContentServer}}" binderror="onBindError" />
35
+      </view>
36
+      </block>
37
+    </view>
38
+  </view>
39
+
40
+  <!-- 标签 -->
41
+  <view class="panelTag FlexColumn" wx:if="{{Tags.length>0}}">
42
+    <view class="panelTag1 FlexRow">
43
+      <view class="tag" wx:for="{{Tags}}" wx:key="index" style='color:{{Color.LineColor}};'>{{item}}</view>
44
+    </view>
45
+    <view class='panelTagLine' style='width:{{TagWidth}}rpx;background-color:{{Color.LineColor}};'></view>
46
+
47
+  </view>
48
+
49
+  <!-- 第二段和第三段 -->
50
+  <view class="panelField20 FlexColumn">
51
+    <view class="editFieldNull2"></view>
52
+    <view id="ViewField{{itemParent}}" class="panelField2 FlexColumn" wx:for="{{[2,3]}}" wx:key="indexParent" wx:for-index="indexParent" wx:for-item="itemParent" wx:if="{{Field[itemParent].length>0 && IsShowAnswer[itemParent-2]}}" style='background-color:{{Color.BackColor2}};'>
53
+      <view class="panelField21 panelItem FlexRow" style='color:{{Color.FieldColor}};'>
54
+        <!-- <image class="universalpic_starting_tc01_26x26" src='../images/universalpic_starting_tc0{{Color.ID}}_26x26.png' /> -->
55
+        <text class='textDot' wx:if="{{Field[itemParent][0].Type!='normal' && Field[itemParent][0].Type!='line'}}" style='color:{{Color.LineColor}};'>●</text>
56
+        <block wx:for="{{Field[itemParent]}}" wx:key="index">
57
+          <text class="textReturn" wx:if="{{index>0 && item.Type=='return'}}"></text>
58
+          <view class="textBr" wx:if="{{index>0 && item.Type=='br'}}"></view>
59
+
60
+          <text class="textNormal2 textNormal" selectable="true" space='ensp' wx:if="{{item.Type=='normal'}}">
61
+              <text class='textDot' wx:if="{{index==0}}" style='color:{{Color.LineColor}};'>●</text>
62
+          <text>{{item.Content}}</text>
63
+          </text>
64
+
65
+          <text class="textNormal2 FlexRow" selectable="true" space='ensp' wx:if="{{item.Type=='line'}}">
66
+              <text class='textDot' wx:if="{{index==0}}" style='color:{{Color.LineColor}};'>●</text>
67
+
68
+          <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem">
69
+            <text space='ensp' wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
70
+            <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
71
+          </block>
72
+          </text>
73
+
74
+          <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="{{itemParent}}">
75
+            <image class="universalpic_read_mark_black_20x20" src='../images/universalpic_read_mark_black_20x20.png' />
76
+          </view>
77
+
78
+          <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>
79
+
80
+          <view class="imageContainer2 FlexColumn" wx:if="{{item.Type=='image'}}" style='width:{{item.Width}}rpx;height:{{item.Height}}rpx;'>
81
+            <image class="imageFree2" mode="widthFix" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" data-serverurl="{{item.ContentServer}}" binderror="onBindError" />
82
+          </view>
83
+        </block>
84
+      </view>
85
+    </view>
86
+  </view>
87
+</template>

+ 10 - 3
project.config.json

@@ -40,7 +40,7 @@
40
 			"list": []
40
 			"list": []
41
 		},
41
 		},
42
 		"miniprogram": {
42
 		"miniprogram": {
43
-			"current": 2,
43
+			"current": 3,
44
 			"list": [
44
 			"list": [
45
 				{
45
 				{
46
 					"id": 0,
46
 					"id": 0,
@@ -58,8 +58,15 @@
58
 				},
58
 				},
59
 				{
59
 				{
60
 					"id": 2,
60
 					"id": 2,
61
-					"name": "点击方式",
62
-					"pathName": "pages/main/clicktype",
61
+					"name": "临时",
62
+					"pathName": "pages/main/recommend",
63
+					"query": "",
64
+					"scene": null
65
+				},
66
+				{
67
+					"id": -1,
68
+					"name": "临时",
69
+					"pathName": "pages/other/test",
63
 					"query": "",
70
 					"query": "",
64
 					"scene": null
71
 					"scene": null
65
 				}
72
 				}

+ 46 - 17
utils/main.js

@@ -652,6 +652,29 @@ function checkIsIPhoneX() {
652
   return isIphoneX;
652
   return isIphoneX;
653
 }
653
 }
654
 
654
 
655
+//设置收藏
656
+function setCollect(id,collect,callback) {
657
+  var that = this;
658
+  if (collect) {
659
+    wx.showToast({
660
+      title: '添加到幻灯片',
661
+      duration: 2000,
662
+      image: "../images/universalpic_fav_enable_white_120x110.png",
663
+    });
664
+  }
665
+  else {
666
+    wx.showToast({
667
+      title: '从幻灯片移除',
668
+      duration: 2000,
669
+      image: "../images/universalpic_fav_enable_white_120x110.png",
670
+    });
671
+  }
672
+  getData("UpdateMiaoguoCardInfo?UserID=" + app.globalData.userInfo.UserID + "&MiaoguoCardID=" + id+ "&IsCollect=" + collect, function (data) { 
673
+    if (callback)
674
+      callback();
675
+  });
676
+}
677
+
655
 function getMemoryLevelAll() {
678
 function getMemoryLevelAll() {
656
   return [
679
   return [
657
     {
680
     {
@@ -710,28 +733,33 @@ function getDetailColor(index) {
710
       Name: "阿拉斯加海湾",
733
       Name: "阿拉斯加海湾",
711
       BackColor: "#1F3C88",
734
       BackColor: "#1F3C88",
712
       BackColor2: "#19306C",
735
       BackColor2: "#19306C",
713
-      LineColor: "#D38E02",
714
-      FieldBackColor: "#15295E",
736
+      LineColor: "#F1AB1E",
715
       FieldColor: "#ACC3DC",
737
       FieldColor: "#ACC3DC",
716
     },
738
     },
717
     {
739
     {
718
       ID: 2,
740
       ID: 2,
719
-      Name: "塔斯马尼亚的尤加利",
720
-      BackColor: "#1B5E20",
721
-      BackColor2: "#1C4417",
722
-      LineColor: "#FF945B",
723
-      FieldBackColor: "#1C4417",
724
-      FieldColor: "#AFEFB4",
741
+      Name: "维多利亚",
742
+      BackColor: "#5D4188",
743
+      BackColor2: "#4D3571",
744
+      LineColor: "#FCA0BE",
745
+      FieldColor: "#C6BFD1",
746
+    },
747
+    {
748
+      ID: 3,
749
+      Name: "骤雨后的港口",
750
+      BackColor: "#693648",
751
+      BackColor2: "#532938",
752
+      LineColor: "#F19E84",
753
+      FieldColor: "#D3A9B8",
754
+    },
755
+    {
756
+      ID: 4,
757
+      Name: "暖房",
758
+      BackColor: "#365711",
759
+      BackColor2: "#27420B",
760
+      LineColor: "#ADD303",
761
+      FieldColor: "#ADC493",
725
     },
762
     },
726
-    // {
727
-    //   ID: 3,
728
-    //   Name: "特立尼达的傍晚",
729
-    //   BackColor: "#E64A19",
730
-    //   BackColor2: "#C12A16",
731
-    //   LineColor: "#ADD303",
732
-    //   FieldBackColor: "#A9361D",
733
-    //   FieldColor: "#FBCAC4",
734
-    // },
735
   ];
763
   ];
736
   if (index > 0)
764
   if (index > 0)
737
     return arr[index];
765
     return arr[index];
@@ -2286,4 +2314,5 @@ module.exports = {
2286
   getMemoryLevel: getMemoryLevel,
2314
   getMemoryLevel: getMemoryLevel,
2287
   getShareImageBackColor: getShareImageBackColor,
2315
   getShareImageBackColor: getShareImageBackColor,
2288
   UpdateMiaoguoCardTodayAll: UpdateMiaoguoCardTodayAll,
2316
   UpdateMiaoguoCardTodayAll: UpdateMiaoguoCardTodayAll,
2317
+  setCollect: setCollect,
2289
 }
2318
 }