chengjie hace 6 años
padre
commit
51a6ff1a8e

+ 5 - 1
app.js

@@ -25,7 +25,7 @@ App({
25
     }
25
     }
26
   },
26
   },
27
   globalData: {
27
   globalData: {
28
-    Version: "1.0.0.11",
28
+    Version: "1.0.0.18",
29
     IsProduction: true,
29
     IsProduction: true,
30
     ShareTitle: "可以用来记忆一切的工具",
30
     ShareTitle: "可以用来记忆一切的工具",
31
     SharePath: "pages/index/index",
31
     SharePath: "pages/index/index",
@@ -51,5 +51,9 @@ App({
51
     Key: "kylx365_chengjie",
51
     Key: "kylx365_chengjie",
52
     IV: "kylx365hongliren",
52
     IV: "kylx365hongliren",
53
     IsEnter: true,//是否是刚进来
53
     IsEnter: true,//是否是刚进来
54
+
55
+    CardList:[],//卡列表变量
56
+    TaskToday:[],//今天任务列表
57
+    TempMiaoguoCardID:0,//临时题卡ID,用于资料选取时用
54
   }
58
   }
55
 })
59
 })

+ 1 - 1
app.json

@@ -1,5 +1,5 @@
1
 {
1
 {
2
-  "pages": [    
2
+  "pages": [
3
     "pages/index/index",
3
     "pages/index/index",
4
     "pages/main/addItem",
4
     "pages/main/addItem",
5
     "pages/index/accredit",
5
     "pages/index/accredit",

BIN
pages/images/universalpic_editbar_cube_gray.png


+ 13 - 2
pages/index/index.js

@@ -2,6 +2,16 @@ 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
+const arrSentence = [
6
+  "荀子曰:\n君子博学而日参省乎己,\n则知明而行无过矣",
7
+  "子曰:\n学而时习之,不亦悦乎。",
8
+  "子曰:\n学而不思则罔,\n思而不学则殆。",
9
+  "荀子曰:\n青,取之于蓝,而青于蓝。\n冰,水为之,而寒于水。",
10
+  "荀子曰:\n不积跬步,无以至千里;\n不积小流,无以成江海。",
11
+  "荀子曰:\n骐骥一跃,不能十步;\n驽马十驾,功在不舍。",
12
+  "荀子曰:\n锲而舍之,朽木不折;\n锲而不舍,金石可镂。",
13
+  "孟子曰:\n故天将降大任于是人也,\n必先苦其心志,劳其筋骨,\n饿其体肤……",
14
+];
5
 
15
 
6
 Page({
16
 Page({
7
   data: {
17
   data: {
@@ -56,6 +66,7 @@ Page({
56
     }
66
     }
57
     this.setData({
67
     this.setData({
58
       Containnerheight: main.getWindowHeight(),
68
       Containnerheight: main.getWindowHeight(),
69
+      Sentence: arrSentence[common.random(0,arrSentence.length-1)],
59
     });
70
     });
60
 
71
 
61
     this.updateProgram();
72
     this.updateProgram();
@@ -227,8 +238,8 @@ Page({
227
                 IsStart: data.IsStart,
238
                 IsStart: data.IsStart,
228
               });
239
               });
229
 
240
 
230
-              wx.setStorageSync("TaskToday", data);
231
-
241
+              app.globalData.TaskToday=data;
242
+              app.globalData.CardList=[];
232
             }
243
             }
233
           });
244
           });
234
         });
245
         });

+ 1 - 1
pages/index/index.wxml

@@ -1,4 +1,4 @@
1
 <view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
1
 <view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
2
   <image src='../images/program_start_footer.png' class="program_start_footer" />
2
   <image src='../images/program_start_footer.png' class="program_start_footer" />
3
-  <text class="text1">荀子曰:\n君子博学而日参省乎己,\n则知明而行无过矣</text>  
3
+  <text class="text1">{{Sentence}}</text>  
4
 </view>
4
 </view>

+ 65 - 32
pages/main/add.js

@@ -7,6 +7,7 @@ var arrTag = [];
7
 
7
 
8
 Page({
8
 Page({
9
   data: {
9
   data: {
10
+    PracticeTimeStr:"智能安排"
10
   },
11
   },
11
   onLoad: function (options) {
12
   onLoad: function (options) {
12
     wx.hideShareMenu();
13
     wx.hideShareMenu();
@@ -21,9 +22,15 @@ Page({
21
       FieldID: fieldid,
22
       FieldID: fieldid,
22
     });
23
     });
23
 
24
 
24
-    wx.setStorageSync("TempMiaoguoCardID", that.data.MiaoguoCardID);
25
+    var list = app.globalData.CardList;
26
+    for (var i = 0; i < list.length; i++) {
27
+      if (that.data.MiaoguoCardID == list[i].MiaoguoCardID) {
28
+        wx.setStorageSync("TempCardInfo", list[i]);
29
+        break;
30
+      }
31
+    }
32
+    app.globalData.TempMiaoguoCardID=that.data.MiaoguoCardID;
25
 
33
 
26
-    common.getStorageValue(that, "IsTodayStudy", true, function () {});
27
   },
34
   },
28
   onShow: function () {
35
   onShow: function () {
29
     var that = this;
36
     var that = this;
@@ -33,12 +40,13 @@ Page({
33
     }
40
     }
34
     else {
41
     else {
35
       var card = {};
42
       var card = {};
36
-      var list = wx.getStorageSync("CardList");
43
+      var list = app.globalData.CardList;
37
       for (var i = 0; i < list.length; i++) {
44
       for (var i = 0; i < list.length; i++) {
38
         if (that.data.MiaoguoCardID == list[i].MiaoguoCardID) {
45
         if (that.data.MiaoguoCardID == list[i].MiaoguoCardID) {
39
           card = main.changeStringToView(list[i].Content);
46
           card = main.changeStringToView(list[i].Content);
40
           card.MiaoguoCardID = list[i].MiaoguoCardID;
47
           card.MiaoguoCardID = list[i].MiaoguoCardID;
41
           card.LimitTime = list[i].LimitTime;
48
           card.LimitTime = list[i].LimitTime;
49
+          
42
           break;
50
           break;
43
         }
51
         }
44
       }
52
       }
@@ -66,14 +74,15 @@ Page({
66
     field = [[], [], [], []];
74
     field = [[], [], [], []];
67
     var card = wx.getStorageSync("TempCardInfo");
75
     var card = wx.getStorageSync("TempCardInfo");
68
     if (card) {
76
     if (card) {
69
-      var list = wx.getStorageSync("CardList");
77
+      var list = app.globalData.CardList;
70
       for (var i = 0; i < list.length; i++) {
78
       for (var i = 0; i < list.length; i++) {
71
         if (this.data.MiaoguoCardID == list[i].MiaoguoCardID) {
79
         if (this.data.MiaoguoCardID == list[i].MiaoguoCardID) {
72
           list[i] = card;
80
           list[i] = card;
73
           break;
81
           break;
74
         }
82
         }
75
       }
83
       }
76
-      wx.setStorageSync("CardList", list);
84
+      app.globalData.CardList=list;
85
+      wx.removeStorageSync("TempCardInfo");
77
     }
86
     }
78
   },
87
   },
79
   onClose: function () {
88
   onClose: function () {
@@ -109,12 +118,14 @@ Page({
109
   },
118
   },
110
   switch1Change(e) {
119
   switch1Change(e) {
111
 
120
 
121
+    var str="智能安排";
122
+    if (e.detail.value){
123
+      str="今日必练";
124
+    }
112
     this.setData({
125
     this.setData({
113
       IsTodayStudy: e.detail.value,
126
       IsTodayStudy: e.detail.value,
114
     });
127
     });
115
 
128
 
116
-    wx.setStorageSync("IsTodayStudy", e.detail.value);
117
-
118
   },
129
   },
119
   saveCard: function () {
130
   saveCard: function () {
120
     var that = this;
131
     var that = this;
@@ -151,11 +162,7 @@ Page({
151
             var item = that.data.Field[i][key];
162
             var item = that.data.Field[i][key];
152
             var str = "";
163
             var str = "";
153
             if (item.Type == "image") {
164
             if (item.Type == "image") {
154
-              if (item.Url) {
155
-                str = "[图 url='" + item.Url + "']" + item.Content + "[/图]";
156
-              }
157
-              else
158
-                str = "[图]" + item.Content + "[/图]";
165
+              str = "[图]" + item.Content + "[/图]";
159
             }
166
             }
160
             else if (item.Type == "line") {
167
             else if (item.Type == "line") {
161
               for (var j = 0; j < item.Content.length; j++) {
168
               for (var j = 0; j < item.Content.length; j++) {
@@ -183,17 +190,20 @@ Page({
183
           param1["Field" + i] = main.changeViewToString(param1["Field" + i]);
190
           param1["Field" + i] = main.changeViewToString(param1["Field" + i]);
184
 
191
 
185
         }
192
         }
193
+
194
+        that.saveLocalCardList(param1);
195
+
186
         // var param2 = {
196
         // var param2 = {
187
         //   param: common.Encrypt(JSON.stringify(param1))
197
         //   param: common.Encrypt(JSON.stringify(param1))
188
         // }
198
         // }
189
         main.postData('AddMiaoguoCard?Type=' + that.data.UpdateType + '&UserID=' + userid, param1, function (data) {
199
         main.postData('AddMiaoguoCard?Type=' + that.data.UpdateType + '&UserID=' + userid, param1, function (data) {
190
           if (that.data.UpdateType == "edit" || that.data.UpdateType == "edit2") {
200
           if (that.data.UpdateType == "edit" || that.data.UpdateType == "edit2") {
191
-            that.saveNewData();
201
+            
192
             that.onClose();
202
             that.onClose();
193
           }
203
           }
194
           else {
204
           else {
195
             wx.showToast({
205
             wx.showToast({
196
-              title: '已保存!',
206
+              title: '已保存!',
197
               image: "../images/universalpic_saved_white_120x120.png",
207
               image: "../images/universalpic_saved_white_120x120.png",
198
             });
208
             });
199
 
209
 
@@ -201,12 +211,15 @@ Page({
201
               that.initAddCard();
211
               that.initAddCard();
202
             }
212
             }
203
 
213
 
204
-            var taskToday = wx.getStorageSync("TaskToday");
214
+            var taskToday = app.globalData.TaskToday;
205
             taskToday.CardNumber++;
215
             taskToday.CardNumber++;
206
-            wx.setStorageSync("TaskToday", taskToday);
216
+            app.globalData.TaskToday=taskToday;
207
 
217
 
208
-            that.saveNewData();
218
+            that.setData({
219
+              IsTodayStudy:false,
220
+            })
209
           }
221
           }
222
+          wx.removeStorageSync("TempCardInfo");
210
         });
223
         });
211
       });
224
       });
212
     }
225
     }
@@ -216,14 +229,19 @@ Page({
216
     var arrSource=[], arrResult=[];
229
     var arrSource=[], arrResult=[];
217
     for(var i=0;i<arr.length;i++){
230
     for(var i=0;i<arr.length;i++){
218
       for(var j=0;j<arr[i].length;j++){
231
       for(var j=0;j<arr[i].length;j++){
219
-        if (arr[i][j].Type == "image" && arr[i][j].Url && !arr[i][j].Content){
220
-          //console.log("Source:" +arr[i][j].Url);
221
-          arrSource.push(arr[i][j].Url);
222
-          that.uploadImage(arr[i][j].Url, function (data) {
223
-            //console.log("Target:"+data);
224
-            data = app.globalData.uploadImageUrl+data;
225
-            arrResult.push(data);
226
-          });
232
+        if (arr[i][j].Type == "image" && arr[i][j].Content){
233
+          arrSource.push(arr[i][j].Content);
234
+          if (arr[i][j].ContentServer.indexOf(app.globalData.uploadImageUrl)>=0 
235
+          || arr[i][j].ContentServer.indexOf("baidu.com")>=0 ){
236
+            arrResult.push(arr[i][j].ContentServer);
237
+          }
238
+          else{
239
+            that.uploadImage(arr[i][j].Content, function (data) {
240
+              //console.log("Target:"+data);
241
+              data = app.globalData.uploadImageUrl + data;
242
+              arrResult.push(data);
243
+            });
244
+          }
227
         }
245
         }
228
       }
246
       }
229
     }
247
     }
@@ -235,8 +253,13 @@ Page({
235
         var ari=0;
253
         var ari=0;
236
         for (var i = 0; i < arr.length; i++) {
254
         for (var i = 0; i < arr.length; i++) {
237
           for (var j = 0; j < arr[i].length; j++) {
255
           for (var j = 0; j < arr[i].length; j++) {
238
-            if (arr[i][j].Type == "image" && arr[i][j].Url && !arr[i][j].Content) {
239
-              arr[i][j].Content=arrResult[ari++];
256
+            if (arr[i][j].Type == "image" && arr[i][j].Content) {
257
+              var tempUrl = arr[i][j].Content;
258
+              var serverUrl = arrResult[ari++];
259
+              main.saveTempImage(serverUrl, tempUrl);
260
+              arr[i][j].Content = serverUrl;
261
+              arr[i][j].ContentServer = serverUrl;
262
+
240
             }
263
             }
241
           }
264
           }
242
         }
265
         }
@@ -266,11 +289,20 @@ Page({
266
     });
289
     });
267
 
290
 
268
   },
291
   },
269
-  saveNewData: function () {
270
-    var list = wx.getStorageSync("CardList");
292
+  saveLocalCardList:function(param1){
293
+    var that=this;
294
+    var list = app.globalData.CardList;
271
     for (var i = 0; i < list.length; i++) {
295
     for (var i = 0; i < list.length; i++) {
272
-      if (this.data.MiaoguoCardID == list[i].MiaoguoCardID) {
273
-        wx.setStorageSync("TempCardInfo", list[i]);
296
+      if (that.data.MiaoguoCardID == list[i].MiaoguoCardID) {
297
+        for (var j = 0; j < 4; j++) {
298
+          if (j == 0){
299
+            if (param1.tags && param1.tags.length > 0)
300
+              list[i].Content[j].Content = param1.tags.join(",");
301
+          }
302
+          else
303
+            list[i].Content[j].Content = param1["Field" + j];
304
+        }
305
+        app.globalData.CardList=list;
274
         break;
306
         break;
275
       }
307
       }
276
     }
308
     }
@@ -285,7 +317,7 @@ Page({
285
       obj.Content = [];
317
       obj.Content = [];
286
       card.Content.push(obj);
318
       card.Content.push(obj);
287
     }
319
     }
288
-    wx.setStorageSync("CardList", [card]);
320
+    app.globalData.CardList=[card];
289
     this.setData({
321
     this.setData({
290
       MiaoguoCardID: 0,
322
       MiaoguoCardID: 0,
291
       Field: [[], [], [], []],
323
       Field: [[], [], [], []],
@@ -305,6 +337,7 @@ Page({
305
       Field: this.data.Field,
337
       Field: this.data.Field,
306
     });
338
     });
307
   },
339
   },
340
+  
308
   onShareAppMessage: function () {
341
   onShareAppMessage: function () {
309
     return {
342
     return {
310
       title: app.globalData.ShareTitle,
343
       title: app.globalData.ShareTitle,

+ 22 - 19
pages/main/add.wxml

@@ -28,42 +28,46 @@
28
         <block wx:for="{{Field[itemParent]}}" wx:key="index">
28
         <block wx:for="{{Field[itemParent]}}" wx:key="index">
29
 
29
 
30
           <text class="textNormal" wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
30
           <text class="textNormal" wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
31
-          
31
+
32
           <text class="textNormal FlexRow" wx:if="{{item.Type=='line'}}">
32
           <text class="textNormal FlexRow" wx:if="{{item.Type=='line'}}">
33
             <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem">
33
             <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem">
34
               <text wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
34
               <text wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
35
-              <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
36
-            </block>
37
-          </text>
35
+          <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
36
+        </block>
37
+        </text>
38
 
38
 
39
-          <image class="universalpic_read_gray_40x40" wx:if="{{item.Type=='sound'}}" src='../images/universalpic_read_gray_40x40.png' />
40
-          <text class="textPinyin" wx:if="{{item.Type=='sound'}}">{{item.Content}}</text>
39
+        <image class="universalpic_read_gray_40x40" wx:if="{{item.Type=='sound'}}" src='../images/universalpic_read_gray_40x40.png' />
40
+        <text class="textPinyin" wx:if="{{item.Type=='sound'}}">{{item.Content}}</text>
41
 
41
 
42
-          <image class="imageBishun" wx:if="{{item.Type=='image' && !item.Url}}" src='{{item.Content}}' />
43
-          
44
-          <image class="imageFree" mode="widthFix" wx:if="{{item.Type=='image' && item.Url}}" src='{{item.Url}}' binderror="onBindError" />
45
-          
46
-          <text class="textReturn" wx:if="{{item.Type=='return'}}"></text>
47
-        </block>
48
-      </view>
49
-    </view>
42
+        <image class="imageBishun" wx:if="{{item.Type=='image' && !item.Url}}" src='{{item.Content}}' />
43
+
44
+        <image class="imageFree" mode="widthFix" wx:if="{{item.Type=='image' && item.Url}}" src='{{item.Url}}' binderror="onBindError" />
45
+
46
+        <text class="textReturn" wx:if="{{item.Type=='return'}}"></text>
47
+  </block>
48
+  </view>
49
+  </view>
50
 
50
 
51
   </block>
51
   </block>
52
   <view class='lineFooter'></view>
52
   <view class='lineFooter'></view>
53
 
53
 
54
   <view class="panelItem3 FlexRow" wx:if="{{UpdateType=='add' || UpdateType=='add2'}}">
54
   <view class="panelItem3 FlexRow" wx:if="{{UpdateType=='add' || UpdateType=='add2'}}">
55
     <view class="panelItem1">
55
     <view class="panelItem1">
56
-      今天练
56
+      练习时间
57
+    </view>
58
+    <view class="panelItem2 FlexRow">
59
+      <view class="panelItem31" hidden="{{IsTodayStudy}}">智能安排</view>
60
+      <view class="panelItem311 panelItem31" hidden="{{!IsTodayStudy}}">今日必练</view>
61
+      <switch class='panelItem32' checked="{{IsTodayStudy}}" bindchange="switch1Change" />
57
     </view>
62
     </view>
58
-    <switch class='panelItem32' checked="{{IsTodayStudy}}" bindchange="switch1Change" />
59
   </view>
63
   </view>
60
   <view class='lineFooter'></view>
64
   <view class='lineFooter'></view>
61
-
65
+  <view class="panelItem3Remark" wx:if="{{UpdateType=='add' || UpdateType=='add2'}}">指定该题卡必定出现在今天任务中,可能增加额外的任务量</view>
62
   <view style='height:300rpx;'></view>
66
   <view style='height:300rpx;'></view>
63
 
67
 
64
   <view class='panelSave FlexRow'>
68
   <view class='panelSave FlexRow'>
65
     <view class="panelSave1 FlexRow" bindtap="onSearch">
69
     <view class="panelSave1 FlexRow" bindtap="onSearch">
66
-      <view class="add">+</view>  资料
70
+      <view class="add">+</view> 资料
67
     </view>
71
     </view>
68
     <view class='panelSave0' bindtap="saveCard">保存</view>
72
     <view class='panelSave0' bindtap="saveCard">保存</view>
69
     <view class="panelSave2 FlexRow" bindtap='onPreview'>
73
     <view class="panelSave2 FlexRow" bindtap='onPreview'>
@@ -71,5 +75,4 @@
71
       <image class="universalpic_preview_black_30x30" src='../images/universalpic_preview_black_30x30.png' />
75
       <image class="universalpic_preview_black_30x30" src='../images/universalpic_preview_black_30x30.png' />
72
     </view>
76
     </view>
73
   </view>
77
   </view>
74
-
75
 </view>
78
 </view>

+ 15 - 1
pages/main/add.wxss

@@ -142,7 +142,21 @@
142
 }
142
 }
143
 
143
 
144
 .panelItem3 .panelItem32 {
144
 .panelItem3 .panelItem32 {
145
-  margin-right: 30rpx;
145
+  margin-left: 30rpx;
146
+}
147
+
148
+.panelItem3 .panelItem31{
149
+  color:#787878;
150
+}
151
+.panelItem3 .panelItem311{
152
+  color:#0071ef;
153
+}
154
+
155
+.panelItem3Remark{
156
+  font-size:24rpx;
157
+  margin-top:30rpx;
158
+  color:#787878;
159
+  font-weight: 400;
146
 }
160
 }
147
 
161
 
148
 .panelSave {
162
 .panelSave {

+ 23 - 17
pages/main/addItem.js

@@ -14,7 +14,7 @@ Page({
14
     Field: "",
14
     Field: "",
15
     SoundSign: "[读]",
15
     SoundSign: "[读]",
16
     LineSign: "[线]",
16
     LineSign: "[线]",
17
-    BtnArray: ["+", "-", "×", "÷", "="],
17
+    BtnArray: ["+", "-", "×", "÷", "=", "<", ">"],
18
   },
18
   },
19
   onLoad: function (options) {
19
   onLoad: function (options) {
20
     wx.hideShareMenu();
20
     wx.hideShareMenu();
@@ -35,15 +35,15 @@ Page({
35
 
35
 
36
   },
36
   },
37
   onShow: function () {
37
   onShow: function () {
38
-    console.log("onShow");
38
+    //console.log("onShow");
39
     var that = this;
39
     var that = this;
40
 
40
 
41
-    console.log("onShow:" + isEdit);
41
+    //console.log("onShow:" + isEdit);
42
     if (app.globalData.IsAndroid && !isEdit) {
42
     if (app.globalData.IsAndroid && !isEdit) {
43
       return;
43
       return;
44
     }
44
     }
45
 
45
 
46
-    var list = wx.getStorageSync("CardList");
46
+    var list = app.globalData.CardList;
47
     var card = {};
47
     var card = {};
48
     for (var i = 0; i < list.length; i++) {
48
     for (var i = 0; i < list.length; i++) {
49
       if (that.data.MiaoguoCardID == list[i].MiaoguoCardID) {
49
       if (that.data.MiaoguoCardID == list[i].MiaoguoCardID) {
@@ -55,7 +55,6 @@ Page({
55
         if (!wx.getStorageSync("TempCardInfoAddItem")) {
55
         if (!wx.getStorageSync("TempCardInfoAddItem")) {
56
           wx.setStorageSync("TempCardInfoAddItem", content);
56
           wx.setStorageSync("TempCardInfoAddItem", content);
57
         }
57
         }
58
-
59
         break;
58
         break;
60
       }
59
       }
61
     }
60
     }
@@ -73,6 +72,8 @@ Page({
73
     isEdit = true;
72
     isEdit = true;
74
   },
73
   },
75
   bindinputField: function (e) {
74
   bindinputField: function (e) {
75
+    console.log("bindinputField:" + e.detail.value + " isEdit:" + isEdit);
76
+
76
     var that = this;
77
     var that = this;
77
     if (app.globalData.IsAndroid && !isEdit) {
78
     if (app.globalData.IsAndroid && !isEdit) {
78
       return;
79
       return;
@@ -81,12 +82,11 @@ Page({
81
     this.setData({
82
     this.setData({
82
       Field: e.detail.value,
83
       Field: e.detail.value,
83
     });
84
     });
84
-    console.log("bindinputField:" + e.detail.value);
85
     //this.updateField();
85
     //this.updateField();
86
 
86
 
87
   },
87
   },
88
   addSymbol: function (e) {
88
   addSymbol: function (e) {
89
-    console.log("addSymbol");
89
+    //console.log("addSymbol");
90
     isEdit = true;
90
     isEdit = true;
91
     var that = this;
91
     var that = this;
92
 
92
 
@@ -130,15 +130,22 @@ Page({
130
   },
130
   },
131
   onBindblur: function (e) {
131
   onBindblur: function (e) {
132
     var that = this;
132
     var that = this;
133
-    console.log("onBindblur:" + isEdit + " Filed:" + this.data.Field);
133
+    //console.log("onBindblur:" + isEdit + " Filed:" + this.data.Field);
134
     if (app.globalData.IsAndroid && !isEdit) {
134
     if (app.globalData.IsAndroid && !isEdit) {
135
       setTimeout(function () {
135
       setTimeout(function () {
136
         isEdit = true;
136
         isEdit = true;
137
+        console.log("onBindblur2:" + isEdit);
137
       }, 500);
138
       }, 500);
138
       return;
139
       return;
139
     }
140
     }
140
     isEdit = false;
141
     isEdit = false;
141
-    console.log("onBindblur:"+isEdit);
142
+    if (app.globalData.IsAndroid && !isEdit) {
143
+      setTimeout(function () {
144
+        isEdit = true;
145
+        console.log("onBindblur2:" + isEdit);
146
+      }, 500);
147
+    }
148
+    //console.log("onBindblur:"+isEdit);
142
 
149
 
143
     this.updateField();
150
     this.updateField();
144
     tempCursor = e.detail.cursor;
151
     tempCursor = e.detail.cursor;
@@ -184,12 +191,12 @@ Page({
184
     
191
     
185
     setTimeout(function () {
192
     setTimeout(function () {
186
       isEdit = true;
193
       isEdit = true;
187
-      console.log("onSearchEnd");
194
+      //console.log("onSearchEnd");
188
     }, 1000);
195
     }, 1000);
189
   },
196
   },
190
   clear: function () {
197
   clear: function () {
191
     var that = this;
198
     var that = this;
192
-    console.log("clear");
199
+    //console.log("clear");
193
     this.setData({
200
     this.setData({
194
       Field: "",
201
       Field: "",
195
       Focus: true,
202
       Focus: true,
@@ -213,7 +220,7 @@ Page({
213
   },
220
   },
214
 
221
 
215
   uploadImage: function () {
222
   uploadImage: function () {
216
-    console.log("uploadImageStart");
223
+    //console.log("uploadImageStart");
217
     var that = this;
224
     var that = this;
218
 
225
 
219
     wx.chooseImage({
226
     wx.chooseImage({
@@ -226,7 +233,6 @@ Page({
226
         //console.log(tempFilePaths[0]);
233
         //console.log(tempFilePaths[0]);
227
         //that.data.Field = that.data.Field + "[图 url='" + tempFilePaths[0] + "']" + tempFilePaths[0] + "[/图]";
234
         //that.data.Field = that.data.Field + "[图 url='" + tempFilePaths[0] + "']" + tempFilePaths[0] + "[/图]";
228
 
235
 
229
-
230
         if (tempCursor == undefined)
236
         if (tempCursor == undefined)
231
           tempCursor = that.data.Field.length;
237
           tempCursor = that.data.Field.length;
232
         var str1 = "",
238
         var str1 = "",
@@ -236,11 +242,11 @@ Page({
236
           str2 = that.data.Field.substring(tempCursor, that.data.Field.length);
242
           str2 = that.data.Field.substring(tempCursor, that.data.Field.length);
237
         }
243
         }
238
 
244
 
239
-        var str0 = "[图 url='" + tempFilePaths[0] + "'][/图]";
245
+        var str0 = "[图]" + tempFilePaths[0] + "[/图]";
240
 
246
 
241
         that.data.Field = str1 + str0 + str2;
247
         that.data.Field = str1 + str0 + str2;
242
 
248
 
243
-        console.log("uploadImageEnd:" + that.data.Field);
249
+        //console.log("uploadImageEnd:" + that.data.Field);
244
 
250
 
245
         that.setData({
251
         that.setData({
246
           Field: that.data.Field,
252
           Field: that.data.Field,
@@ -264,7 +270,7 @@ Page({
264
     str = str.replace(/\[\/图\]/g, "[\/图]\n");
270
     str = str.replace(/\[\/图\]/g, "[\/图]\n");
265
     str = str.replace(/\n\n/g, "\n");
271
     str = str.replace(/\n\n/g, "\n");
266
 
272
 
267
-    var list = wx.getStorageSync("CardList");
273
+    var list = app.globalData.CardList;
268
     for (var i = 0; i < list.length; i++) {
274
     for (var i = 0; i < list.length; i++) {
269
       if (this.data.MiaoguoCardID == list[i].MiaoguoCardID) {
275
       if (this.data.MiaoguoCardID == list[i].MiaoguoCardID) {
270
         if (history != undefined)
276
         if (history != undefined)
@@ -274,7 +280,7 @@ Page({
274
         break;
280
         break;
275
       }
281
       }
276
     }
282
     }
277
-    wx.setStorageSync("CardList", list);
283
+    app.globalData.CardList=list;
278
   },
284
   },
279
   onShareAppMessage: function () {
285
   onShareAppMessage: function () {
280
     return {
286
     return {

+ 22 - 18
pages/main/addItem.wxml

@@ -30,25 +30,29 @@
30
     <textarea class="input" maxlength='-1' show-confirm-bar="true" value="{{Field}}" focus="{{Focus}}" cursor="{{Cursor}}" bindinput="bindinputField" bindblur="onBindblur" bindfocus="onBindFocus" data-id='{{FieldNumber}}' />
30
     <textarea class="input" maxlength='-1' show-confirm-bar="true" value="{{Field}}" focus="{{Focus}}" cursor="{{Cursor}}" bindinput="bindinputField" bindblur="onBindblur" bindfocus="onBindFocus" data-id='{{FieldNumber}}' />
31
   </view>
31
   </view>
32
   <cover-view class='lineFooter'></cover-view>
32
   <cover-view class='lineFooter'></cover-view>
33
-  <cover-view class="panelTag0 panelTag FlexRow">
34
-    <cover-view class="btn0"></cover-view>
35
-    <cover-view class="btn1 FlexRow" bindtap="addSymbol" data-id="(     )">
36
-      <cover-image class="universalpic_editbar_brackets_gray" src='../images/universalpic_editbar_brackets_gray.png' />
33
+  <cover-view class='panel2 FlexColumn'>
34
+    <cover-view class="panelBtnSmall FlexRow">
35
+      <cover-view class="btn0"></cover-view>
36
+      <cover-view class="btn1 FlexRow" bindtap="addSymbol" data-id="(     )">
37
+        <cover-image class="universalpic_editbar_brackets_gray" src='../images/universalpic_editbar_brackets_gray.png' />
38
+      </cover-view>
39
+      <cover-view class="btn1 FlexRow" bindtap="addSymbol" data-id="_____">
40
+        <cover-image class="universalpic_editbar_underline_gray" src='../images/universalpic_editbar_underline_gray.png' />
41
+      </cover-view>
42
+      <cover-view class="btn" bindtap="addSymbol" wx:for="{{BtnArray}}" wx:key="index" data-id="{{item}}">{{item}}</cover-view>
43
+      <cover-view class="btn1 FlexRow" bindtap="addSymbol" data-id="²">
44
+        <cover-image class="universalpic_editbar_sqr_gray" src='../images/universalpic_editbar_sqr_gray.png' />
45
+      </cover-view>
46
+      <cover-view class="btn1 FlexRow" bindtap="addSymbol" data-id="³">
47
+        <cover-image class="universalpic_editbar_sqr_gray" src='../images/universalpic_editbar_cube_gray.png' />
48
+      </cover-view>
37
     </cover-view>
49
     </cover-view>
38
-    <cover-view class="btn1 FlexRow" bindtap="addSymbol" data-id="_____">
39
-      <cover-image class="universalpic_editbar_underline_gray" src='../images/universalpic_editbar_underline_gray.png' />
50
+    <cover-view class='lineFooter'></cover-view>
51
+    <cover-view class='panelBtn FlexRow'>
52
+      <cover-view class='text1' bindtap="closeAddItem" data-idsave="false">取消</cover-view>
53
+      <cover-view class='line1'></cover-view>
54
+      <cover-view class='text2 text1' bindtap="closeAddItem" data-idsave="true">确定</cover-view>
40
     </cover-view>
55
     </cover-view>
41
-    <cover-view class="btn" bindtap="addSymbol" wx:for="{{BtnArray}}" wx:key="index" data-id="{{item}}">{{item}}</cover-view>
42
-    <cover-view class="btn1 FlexRow" bindtap="addSymbol" data-id="²">
43
-      <cover-image class="universalpic_editbar_sqr_gray" src='../images/universalpic_editbar_sqr_gray.png' />
44
-    </cover-view>
45
-  </cover-view>
46
-  <cover-view class='lineFooter'></cover-view>
47
-  <cover-view class='panelBtn FlexRow'>
48
-    <cover-view class='text1' bindtap="closeAddItem" data-idsave="false">取消</cover-view>
49
-    <cover-view class='line1'></cover-view>
50
-    <cover-view class='text2 text1' bindtap="closeAddItem" data-idsave="true">确定</cover-view>
56
+    <cover-view class='lineFooter'></cover-view>
51
   </cover-view>
57
   </cover-view>
52
-  <cover-view class='lineFooter'></cover-view>
53
-
54
 </view>
58
 </view>

+ 49 - 37
pages/main/addItem.wxss

@@ -3,6 +3,8 @@
3
   font-weight: 500;
3
   font-weight: 500;
4
   color: #1e1e1e;
4
   color: #1e1e1e;
5
   background-color: #f0f0f0;
5
   background-color: #f0f0f0;
6
+  position: fixed;
7
+  top: 0;
6
 }
8
 }
7
 
9
 
8
 .left {
10
 .left {
@@ -23,8 +25,8 @@
23
 .panelSave1 {
25
 .panelSave1 {
24
   width: 148rpx;
26
   width: 148rpx;
25
   background-color: #fff;
27
   background-color: #fff;
26
-  border:1rpx solid #9B9B9B;
27
-  color:#787878;
28
+  border: 1rpx solid #9b9b9b;
29
+  color: #787878;
28
   text-align: center;
30
   text-align: center;
29
   height: 80rpx;
31
   height: 80rpx;
30
   line-height: 80rpx;
32
   line-height: 80rpx;
@@ -36,7 +38,7 @@
36
   width: 80rpx;
38
   width: 80rpx;
37
   height: 80rpx;
39
   height: 80rpx;
38
   background-color: #fff;
40
   background-color: #fff;
39
-  border:1rpx solid #9B9B9B;
41
+  border: 1rpx solid #9b9b9b;
40
   margin-left: 10rpx;
42
   margin-left: 10rpx;
41
 }
43
 }
42
 
44
 
@@ -44,8 +46,8 @@
44
   width: 80rpx;
46
   width: 80rpx;
45
   height: 80rpx;
47
   height: 80rpx;
46
   margin-left: 10rpx;
48
   margin-left: 10rpx;
47
-  background-color: #0071EF;
48
-  border:1rpx solid #0071EF;
49
+  background-color: #0071ef;
50
+  border: 1rpx solid #0071ef;
49
 }
51
 }
50
 
52
 
51
 .universalpic_read_begin_gray_20x20 {
53
 .universalpic_read_begin_gray_20x20 {
@@ -53,22 +55,22 @@
53
   height: 20rpx;
55
   height: 20rpx;
54
 }
56
 }
55
 
57
 
56
-.universalpic_read_end_white_38x22{
58
+.universalpic_read_end_white_38x22 {
57
   width: 38rpx;
59
   width: 38rpx;
58
   height: 22rpx;
60
   height: 22rpx;
59
 }
61
 }
60
 
62
 
61
-.universalpic_editbar_underline_gray_14x20{
63
+.universalpic_editbar_underline_gray_14x20 {
62
   width: 14rpx;
64
   width: 14rpx;
63
   height: 20rpx;
65
   height: 20rpx;
64
 }
66
 }
65
 
67
 
66
-.universalpic_underline_end_white_30x22{
68
+.universalpic_underline_end_white_30x22 {
67
   width: 31rpx;
69
   width: 31rpx;
68
   height: 22rpx;
70
   height: 22rpx;
69
 }
71
 }
70
 
72
 
71
-.universalpic_picture_gray_26x26{
73
+.universalpic_picture_gray_26x26 {
72
   width: 26rpx;
74
   width: 26rpx;
73
   height: 26rpx;
75
   height: 26rpx;
74
 }
76
 }
@@ -84,7 +86,7 @@
84
   height: 80rpx;
86
   height: 80rpx;
85
   color: #0071ef;
87
   color: #0071ef;
86
   background-color: #fff;
88
   background-color: #fff;
87
-  border:1rpx solid #9B9B9B;
89
+  border: 1rpx solid #9b9b9b;
88
   text-align: center;
90
   text-align: center;
89
   border-radius: 10rpx;
91
   border-radius: 10rpx;
90
   line-height: 80rpx;
92
   line-height: 80rpx;
@@ -104,21 +106,46 @@
104
   margin: 0 0 0 40rpx;
106
   margin: 0 0 0 40rpx;
105
 }
107
 }
106
 
108
 
107
-.panelTag0 {
108
-  justify-content: flex-start;
109
+.panelInput {
110
+  width: 100%;
111
+  height: 250rpx;
112
+  margin-top: 10rpx;
113
+  background-color: #fff;
114
+  font-size: 36rpx;
115
+  font-weight: 400;
116
+}
117
+
118
+.input {
119
+  margin: 30rpx 30rpx 0 30rpx;
120
+  width: 690rpx;
121
+  height: 220rpx;
122
+}
123
+
124
+.panel2 {
125
+  position: fixed;
126
+  top: 382rpx;
127
+  width: 100%;
128
+  background-color: #fff;
129
+}
130
+
131
+.panelBtnSmall {
109
   z-index: 10;
132
   z-index: 10;
133
+  width:100%;
134
+  height: 120rpx;
135
+  background-color: #fff;
136
+  justify-content: flex-start;
110
 }
137
 }
111
 
138
 
112
-.panelTag .btn0 {
113
-  width: 20rpx;
139
+.panelBtnSmall .btn0 {
140
+  width: 10rpx;
114
 }
141
 }
115
 
142
 
116
-.panelTag .btn {
143
+.panelBtnSmall .btn {
117
   font-family: 'Roboto-Black';
144
   font-family: 'Roboto-Black';
118
   width: 80rpx;
145
   width: 80rpx;
119
   background-color: #fff;
146
   background-color: #fff;
120
-  border:1rpx solid #9B9B9B;
121
-  color:#787878;
147
+  border: 1rpx solid #9b9b9b;
148
+  color: #787878;
122
   border-radius: 10rpx;
149
   border-radius: 10rpx;
123
   text-align: center;
150
   text-align: center;
124
   line-height: 80rpx;
151
   line-height: 80rpx;
@@ -127,11 +154,11 @@
127
   font-size: 36rpx;
154
   font-size: 36rpx;
128
 }
155
 }
129
 
156
 
130
-.panelTag .btn1 {
157
+.panelBtnSmall .btn1 {
131
   width: 80rpx;
158
   width: 80rpx;
132
   height: 80rpx;
159
   height: 80rpx;
133
   background-color: #fff;
160
   background-color: #fff;
134
-  border:1rpx solid #9B9B9B;
161
+  border: 1rpx solid #9b9b9b;
135
   border-radius: 10rpx;
162
   border-radius: 10rpx;
136
   margin-right: 10rpx;
163
   margin-right: 10rpx;
137
 }
164
 }
@@ -141,7 +168,7 @@
141
   height: 26rpx;
168
   height: 26rpx;
142
 }
169
 }
143
 
170
 
144
-.universalpic_editbar_underline_gray{
171
+.universalpic_editbar_underline_gray {
145
   width: 18rpx;
172
   width: 18rpx;
146
   height: 28rpx;
173
   height: 28rpx;
147
 }
174
 }
@@ -151,21 +178,6 @@
151
   height: 22rpx;
178
   height: 22rpx;
152
 }
179
 }
153
 
180
 
154
-.panelInput {
155
-  width: 100%;
156
-  height: 250rpx;
157
-  margin-top: 10rpx;
158
-  background-color: #fff;
159
-  font-size: 36rpx;
160
-  font-weight: 400;
161
-}
162
-
163
-.input {
164
-  margin: 30rpx 30rpx 0 30rpx;
165
-  width: 690rpx;
166
-  height:220rpx;
167
-}
168
-
169
 .panelBtn {
181
 .panelBtn {
170
   width: 100%;
182
   width: 100%;
171
   background-color: #f8f8f8;
183
   background-color: #f8f8f8;
@@ -190,6 +202,6 @@
190
   color: #0071ef;
202
   color: #0071ef;
191
 }
203
 }
192
 
204
 
193
-.lineFooter{
205
+.lineFooter {
194
   z-index: 10;
206
   z-index: 10;
195
-}
207
+}

+ 1 - 1
pages/main/cardInfo.js

@@ -18,7 +18,7 @@ Page({
18
   init: function (id) {
18
   init: function (id) {
19
     var that = this;
19
     var that = this;
20
     var card={};
20
     var card={};
21
-    var list = wx.getStorageSync("CardList");
21
+    var list = app.globalData.CardList;
22
     for (var i = 0; i < list.length; i++) {
22
     for (var i = 0; i < list.length; i++) {
23
       if (id == list[i].MiaoguoCardID) {
23
       if (id == list[i].MiaoguoCardID) {
24
         card.CreateTimeStr = common.formatDateCHS(list[i].CreateTime);
24
         card.CreateTimeStr = common.formatDateCHS(list[i].CreateTime);

+ 8 - 31
pages/main/default.js

@@ -59,39 +59,16 @@ Page({
59
   },
59
   },
60
   //得到当天任务
60
   //得到当天任务
61
   getTaskTodayList: function () {
61
   getTaskTodayList: function () {
62
-    wx.showLoading({
63
-      title: '请稍候',
64
-      mask:true,
65
-    })
66
-    var that = this;
67
-    common.getStorageValue(that, "CardMaxNumberNew", 10, function () {
68
-      common.getStorageValue(that, "CardMaxNumberHistory", 30, function () {
69
-        common.getStorageValue(that, "SortTypeIndex", 0, function () {
70
-          var url = 'GetMiaoguoCardToday?UserID=' + app.globalData.userInfo.UserID;
71
-          url += "&New=" + that.data.CardMaxNumberNew;
72
-          url += "&History=" + that.data.CardMaxNumberHistory;
73
-          url += "&SortTypeIndex=" + that.data.SortTypeIndex;
74
-
75
-          main.getData(url, function (data) {
76
-            wx.hideLoading();
77
-
78
-            if (data) {
79
-              var TodayTaskNumber = data.ListNew.length + data.ListReview.length + data.ListHistory.length;
80
-              that.setData({
81
-                List: data,
82
-                DayNumber: data.DayNumber,
83
-                TodayTaskNumber: TodayTaskNumber,
84
-                IsStart: data.IsStart,
85
-              });
86
-
87
-              wx.setStorageSync("TaskToday", data);
88
-
89
-            }
90
-          });
91
-        });
62
+    var that=this;
63
+    main.getTaskTodayList(function(data){
64
+      var TodayTaskNumber = data.ListNew.length + data.ListReview.length + data.ListHistory.length;
65
+      that.setData({
66
+        List: data,
67
+        DayNumber: data.DayNumber,
68
+        TodayTaskNumber: TodayTaskNumber,
69
+        IsStart: data.IsStart,
92
       });
70
       });
93
     });
71
     });
94
-    
95
   },
72
   },
96
   gotoCard: function () {
73
   gotoCard: function () {
97
     wx.redirectTo({
74
     wx.redirectTo({

+ 49 - 17
pages/main/detail.js

@@ -12,7 +12,7 @@ var timeStart; //计算时长
12
 var TaskList = [];
12
 var TaskList = [];
13
 var iTimeout = 0;
13
 var iTimeout = 0;
14
 var arrImage = [], arrImage2 = [];
14
 var arrImage = [], arrImage2 = [];
15
-var intervalSound;
15
+var intervalSound = 0, intervalRefresh=0;
16
 
16
 
17
 Page({
17
 Page({
18
   data: {
18
   data: {
@@ -72,17 +72,16 @@ Page({
72
       that.setSoundFile(-1);
72
       that.setSoundFile(-1);
73
 
73
 
74
 
74
 
75
-      var list = wx.getStorageSync("CardList");
75
+      var list = app.globalData.CardList;
76
       if (list && list.length > 0) {
76
       if (list && list.length > 0) {
77
         for (var i = 0; i < list.length; i++) {
77
         for (var i = 0; i < list.length; i++) {
78
           if (TaskList[0].MiaoguoCardID == list[i].MiaoguoCardID) {
78
           if (TaskList[0].MiaoguoCardID == list[i].MiaoguoCardID) {
79
-            var card = {};
80
             TaskList[0].Content = list[i].Content;
79
             TaskList[0].Content = list[i].Content;
81
             TaskList[0].ContentNew = main.changeStringToView(list[i].Content);
80
             TaskList[0].ContentNew = main.changeStringToView(list[i].Content);
82
             that.setData({
81
             that.setData({
83
               TaskInfo: TaskList[0],
82
               TaskInfo: TaskList[0],
84
             });
83
             });
85
-            wx.removeStorageSync("CardList");
84
+            app.globalData.CardList=[];
86
             break;
85
             break;
87
           }
86
           }
88
         }
87
         }
@@ -140,7 +139,7 @@ Page({
140
     });
139
     });
141
   },
140
   },
142
   getList: function () {
141
   getList: function () {
143
-    var task = wx.getStorageSync("TaskToday");
142
+    var task = app.globalData.TaskToday;
144
     var that = this;
143
     var that = this;
145
     var arrNew = task.ListNew;
144
     var arrNew = task.ListNew;
146
     var arrHistory = task.ListHistory;
145
     var arrHistory = task.ListHistory;
@@ -291,9 +290,8 @@ Page({
291
     var that = this;
290
     var that = this;
292
     //console.log(res.tapIndex);
291
     //console.log(res.tapIndex);
293
     var list = [];
292
     var list = [];
294
-    TaskList[0].MiaoguoCardID = TaskList[0].ID;
295
     list.push(TaskList[0]);
293
     list.push(TaskList[0]);
296
-    wx.setStorageSync("CardList", list);
294
+    app.globalData.CardList=list;
297
     wx.navigateTo({
295
     wx.navigateTo({
298
       url: './add?type=edit&id=' + TaskList[0].MiaoguoCardID,
296
       url: './add?type=edit&id=' + TaskList[0].MiaoguoCardID,
299
     });
297
     });
@@ -325,7 +323,7 @@ Page({
325
 
323
 
326
       var that = this;
324
       var that = this;
327
       var url = "UndoMiaoguoCard?";
325
       var url = "UndoMiaoguoCard?";
328
-      url += "ID=" + card.Card.ID;
326
+      url += "ID=" + card.Card.MiaoguoCardID;
329
       url += "&UserID=" + app.globalData.userInfo.UserID;
327
       url += "&UserID=" + app.globalData.userInfo.UserID;
330
       url += "&IntervalTime=" + card.IntervalTime;
328
       url += "&IntervalTime=" + card.IntervalTime;
331
       url += "&IntervalDay=" + card.Card.IntervalDay;
329
       url += "&IntervalDay=" + card.Card.IntervalDay;
@@ -353,7 +351,7 @@ Page({
353
 
351
 
354
         //去除重复
352
         //去除重复
355
         for (var i = 0; i < TaskList.length; i++) {
353
         for (var i = 0; i < TaskList.length; i++) {
356
-          if (TaskList[i].ID == card.Card.ID) {
354
+          if (TaskList[i].MiaoguoCardID == card.Card.MiaoguoCardID) {
357
             TaskList.splice(i, 1);
355
             TaskList.splice(i, 1);
358
           }
356
           }
359
         }
357
         }
@@ -491,7 +489,7 @@ Page({
491
 
489
 
492
     //保存上传
490
     //保存上传
493
     var obj = {
491
     var obj = {
494
-      ID: TaskList[0].ID,
492
+      MiaoguoCardID: TaskList[0].MiaoguoCardID,
495
       IntervalTime: time,
493
       IntervalTime: time,
496
       BtnNumber: btnnumber,
494
       BtnNumber: btnnumber,
497
       LearningType: learningType,
495
       LearningType: learningType,
@@ -569,7 +567,7 @@ Page({
569
   },
567
   },
570
   saveCard: function (obj, callback) {
568
   saveCard: function (obj, callback) {
571
     var url = "UpdateMiaoguoCardToday?";
569
     var url = "UpdateMiaoguoCardToday?";
572
-    url += "ID=" + obj.ID;
570
+    url += "ID=" + obj.MiaoguoCardID;
573
     url += "&UserID=" + app.globalData.userInfo.UserID;
571
     url += "&UserID=" + app.globalData.userInfo.UserID;
574
     url += "&IntervalTime=" + obj.IntervalTime;
572
     url += "&IntervalTime=" + obj.IntervalTime;
575
     url += "&BtnNumber=" + obj.BtnNumber;
573
     url += "&BtnNumber=" + obj.BtnNumber;
@@ -577,6 +575,8 @@ Page({
577
     url += "&FontSize=" + TaskList[0].FontSize;
575
     url += "&FontSize=" + TaskList[0].FontSize;
578
 
576
 
579
     var duration = common.diffDate("s", timeStart, new Date());
577
     var duration = common.diffDate("s", timeStart, new Date());
578
+    if (obj.btnnumber==1)
579
+      duration=0;
580
     url += "&Duration=" + duration;
580
     url += "&Duration=" + duration;
581
 
581
 
582
     url += "&IsUndo=" + obj.IsUndo;
582
     url += "&IsUndo=" + obj.IsUndo;
@@ -598,7 +598,15 @@ Page({
598
       url = e.currentTarget.dataset.soundmark;
598
       url = e.currentTarget.dataset.soundmark;
599
     }
599
     }
600
     else if (e.currentTarget.dataset.soundmark && e.currentTarget.dataset.soundmark != "undefined") {
600
     else if (e.currentTarget.dataset.soundmark && e.currentTarget.dataset.soundmark != "undefined") {
601
-      url = e.currentTarget.dataset.soundmark;
601
+      var soundmark = e.currentTarget.dataset.soundmark;
602
+      if (soundmark && soundmark.indexOf("http") < 0) {
603
+        url = app.globalData.audioUrlBaidu;
604
+        url = url.replace("[token]", app.globalData.BaiduToken);
605
+        url = url.replace("[word]", soundmark);
606
+      }
607
+      else {
608
+        url = soundmark;
609
+      }
602
     }
610
     }
603
     else {
611
     else {
604
       url = app.globalData.audioUrlBaidu;
612
       url = app.globalData.audioUrlBaidu;
@@ -681,6 +689,35 @@ Page({
681
     });
689
     });
682
   },
690
   },
683
   onBindError: function (e) {
691
   onBindError: function (e) {
692
+    var that = this;
693
+    var serverUrl = e.currentTarget.dataset.serverurl;
694
+    var oldTempUrl = e.currentTarget.dataset.name;
695
+    //console.log("serverUrl1:" + serverUrl);
696
+    wx.downloadFile({
697
+      url: serverUrl, // 仅为示例,并非真实的资源
698
+      success(res) {
699
+        // 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容
700
+        if (res.statusCode === 200) {
701
+          //console.log("serverUrl2:" + serverUrl);
702
+          //console.log(res.tempFilePath);
703
+          main.saveTempImage(serverUrl, res.tempFilePath);
704
+          for(var i=0;i<arrImage.length;i++){
705
+            if (arrImage[i] == oldTempUrl){
706
+              arrImage[i] = res.tempFilePath;
707
+            }
708
+          }
709
+        }
710
+      }
711
+    });
712
+
713
+    clearTimeout(intervalRefresh);
714
+    intervalRefresh = setTimeout(function () {
715
+      TaskList[0].ContentNew = main.changeStringToView(TaskList[0].Content);
716
+      that.setData({
717
+        TaskInfo: TaskList[0],
718
+      });
719
+    }, 1000);
720
+
684
     for (var i = 1; i < this.data.TaskInfo.ContentNew.Field.length; i++) {
721
     for (var i = 1; i < this.data.TaskInfo.ContentNew.Field.length; i++) {
685
       for (var j = 0; j < this.data.TaskInfo.ContentNew.Field[i].length; j++) {
722
       for (var j = 0; j < this.data.TaskInfo.ContentNew.Field[i].length; j++) {
686
         if (this.data.TaskInfo.ContentNew.Field[i][j].Type == "image") {
723
         if (this.data.TaskInfo.ContentNew.Field[i][j].Type == "image") {
@@ -688,14 +725,9 @@ Page({
688
         }
725
         }
689
       }
726
       }
690
     }
727
     }
691
-    arrImage = arrImage2;
692
     this.setData({
728
     this.setData({
693
       TaskInfo: this.data.TaskInfo,
729
       TaskInfo: this.data.TaskInfo,
694
     });
730
     });
695
-
696
-    main.getData('UpdateCardImageUrl?MiaoguoCardID=' + this.data.TaskInfo[0].ID, function (data) {
697
-
698
-    });
699
   },
731
   },
700
   onClose:function(){
732
   onClose:function(){
701
     wx.navigateBack({
733
     wx.navigateBack({

+ 7 - 7
pages/main/detail.wxml

@@ -57,10 +57,10 @@
57
 
57
 
58
         <text class="textPinyin" wx:if="{{item.Type=='sound'}}" catchtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="1">{{item.Content}}</text>
58
         <text class="textPinyin" wx:if="{{item.Type=='sound'}}" catchtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="1">{{item.Content}}</text>
59
 
59
 
60
-        <image class="imageBishun" wx:if="{{item.Type=='image'  && !item.Url}}" src='{{item.Content}}' catchtap='showImage' data-name="{{item.Content}}" />
61
-
62
-        <image class="imageFree" mode='widthFix' wx:if="{{item.Type=='image' && item.Url}}" src='{{item.Url}}' catchtap='showImage' data-name="{{item.Url}}" binderror="onBindError" />
60
+        <!-- <image class="imageBishun" wx:if="{{item.Type=='image'  && !item.Url}}" src='{{item.Content}}' catchtap='showImage' data-name="{{item.Content}}" /> -->
63
 
61
 
62
+        <image class="imageFree" mode="widthFix" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" data-serverurl="{{item.ContentServer}}" binderror="onBindError" />
63
+      
64
   </block>
64
   </block>
65
   </view>
65
   </view>
66
 
66
 
@@ -103,10 +103,10 @@
103
 
103
 
104
         <text class="textPinyin" wx:if="{{item.Type=='sound'}}" catchtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="{{itemParent}}">{{item.Content}}</text>
104
         <text class="textPinyin" wx:if="{{item.Type=='sound'}}" catchtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="{{itemParent}}">{{item.Content}}</text>
105
 
105
 
106
-        <image class="imageBishun" wx:if="{{item.Type=='image' && !item.Url}}" src='{{item.Content}}' catchtap='showImage' data-name="{{item.Content}}" />
107
-
108
-        <image class="imageFree" mode="widthFix" wx:if="{{item.Type=='image' && item.Url}}" src='{{item.Url}}' catchtap='showImage' data-name="{{item.Url}}" binderror="onBindError" />
106
+        <!-- <image class="imageBishun" wx:if="{{item.Type=='image' && !item.Url}}" src='{{item.Content}}' catchtap='showImage' data-name="{{item.Content}}" /> -->
109
 
107
 
108
+        <image class="imageFree" mode="widthFix" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" data-serverurl="{{item.ContentServer}}" binderror="onBindError" />
109
+      
110
         </block>
110
         </block>
111
       </view>
111
       </view>
112
     </view>
112
     </view>
@@ -188,7 +188,7 @@
188
       <view class="lineWidth700"></view>
188
       <view class="lineWidth700"></view>
189
     </view>
189
     </view>
190
     <view class="numberContainer12 FlexRow">
190
     <view class="numberContainer12 FlexRow">
191
-      <view class='left'>重点回顾</view>
191
+      <view class='left'>及时强化</view>
192
       <view class='right3'>{{NumberReview}}张</view>
192
       <view class='right3'>{{NumberReview}}张</view>
193
     </view>
193
     </view>
194
     <view class='lineFooter'></view>
194
     <view class='lineFooter'></view>

+ 130 - 37
pages/main/preview.js

@@ -2,8 +2,8 @@ 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 iTimeout = 0, intervalSound=0;
6
-var arrImage = [], arrImage2 = [];
5
+var iTimeout = 0, intervalSound = 0, intervalRefresh = 0;
6
+var arrImage = [];
7
 
7
 
8
 Page({
8
 Page({
9
   data: {
9
   data: {
@@ -22,9 +22,9 @@ Page({
22
       MiaoguoCardID: id,
22
       MiaoguoCardID: id,
23
     });
23
     });
24
     //console.log("MiaoguoCardID:" + id);
24
     //console.log("MiaoguoCardID:" + id);
25
-    
25
+
26
     this.audioCtx = [];
26
     this.audioCtx = [];
27
-    
27
+
28
 
28
 
29
     if (options.type == "share") {
29
     if (options.type == "share") {
30
       wx.setNavigationBarTitle({
30
       wx.setNavigationBarTitle({
@@ -34,30 +34,31 @@ Page({
34
   },
34
   },
35
   onShow: function () {
35
   onShow: function () {
36
     var that = this;
36
     var that = this;
37
-    if (that.data.ShowType == "share") {
38
-      var url = "GetMiaoguoCardInfo?UserID=" + app.globalData.introducer + "&MiaoguoCardID=" + that.data.MiaoguoCardID;
39
-      main.getData(url, function (data) {
40
-        if (data) {
41
-          wx.setStorageSync("CardList", [data]);
42
-          that.init();
43
-        }
44
-      });
45
-    }
46
-    else
47
-      that.init();
37
+    if (that.data.ShowType)
38
+      if (that.data.ShowType == "share") {
39
+        var url = "GetMiaoguoCardInfo?UserID=" + app.globalData.introducer + "&MiaoguoCardID=" + that.data.MiaoguoCardID;
40
+        main.getData(url, function (data) {
41
+          if (data) {
42
+            app.globalData.CardList=[data];
43
+            that.init();
44
+          }
45
+        });
46
+      }
47
+      else
48
+        that.init();
48
   },
49
   },
49
   onUnload: function () {
50
   onUnload: function () {
50
     clearTimeout(iTimeout);
51
     clearTimeout(iTimeout);
51
     clearInterval(intervalSound);
52
     clearInterval(intervalSound);
52
   },
53
   },
53
   init: function () {
54
   init: function () {
54
-    var list = wx.getStorageSync("CardList");
55
+    var that=this;
56
+    var list = app.globalData.CardList;
55
     var card = {};
57
     var card = {};
56
     var prevId = 0;
58
     var prevId = 0;
57
     var nextId = 0;
59
     var nextId = 0;
58
     for (var i = 0; i < list.length; i++) {
60
     for (var i = 0; i < list.length; i++) {
59
       if (this.data.MiaoguoCardID == list[i].MiaoguoCardID) {
61
       if (this.data.MiaoguoCardID == list[i].MiaoguoCardID) {
60
-        wx.setStorageSync("TempCardInfo", list[i]);
61
         if (i > 0)
62
         if (i > 0)
62
           prevId = list[i - 1].MiaoguoCardID;
63
           prevId = list[i - 1].MiaoguoCardID;
63
         else
64
         else
@@ -78,10 +79,34 @@ Page({
78
       card.FontSize = 46;
79
       card.FontSize = 46;
79
 
80
 
80
     arrImage = card.Images;
81
     arrImage = card.Images;
81
-    arrImage2 = card.Images2;
82
 
82
 
83
-    console.log("arrImage:" + arrImage);
84
-    console.log("arrImage2" + arrImage2);
83
+    //console.log("arrImage:" + arrImage);
84
+
85
+    var limitTimeStr = common.formatDateCHS(card.LimitTime);
86
+
87
+    var isTodayPractice = true;
88
+    var task = app.globalData.TaskToday;
89
+
90
+    for (var i = 0; i < task.ListNew.length; i++) {
91
+      if (task.ListNew[i].MiaoguoCardID == that.data.MiaoguoCardID) {
92
+        isTodayPractice = false;
93
+        break;
94
+      }
95
+    }
96
+    for (var i = 0; i < task.ListHistory.length; i++) {
97
+      if (task.ListHistory[i].MiaoguoCardID == that.data.MiaoguoCardID) {
98
+        isTodayPractice = false;
99
+        break;
100
+      }
101
+    }
102
+    for (var i = 0; i < task.ListReview.length; i++) {
103
+      if (task.ListReview[i].MiaoguoCardID == that.data.MiaoguoCardID) {
104
+        isTodayPractice = false;
105
+        break;
106
+      }
107
+    }
108
+
109
+
85
 
110
 
86
     this.setData({
111
     this.setData({
87
       ID: card.MiaoguoCardID,
112
       ID: card.MiaoguoCardID,
@@ -90,7 +115,8 @@ Page({
90
       PrevID: prevId,
115
       PrevID: prevId,
91
       NextID: nextId,
116
       NextID: nextId,
92
       FontSize: card.FontSize,
117
       FontSize: card.FontSize,
93
-      LimitTimeStr: common.formatDateCHS(card.LimitTime),
118
+      LimitTimeStr: limitTimeStr,
119
+      IsTodayPractice: isTodayPractice,
94
     });
120
     });
95
   },
121
   },
96
   practiceToday: function () {
122
   practiceToday: function () {
@@ -109,8 +135,9 @@ Page({
109
             var time = common.formatTime(new Date());
135
             var time = common.formatTime(new Date());
110
             that.setData({
136
             that.setData({
111
               LimitTimeStr: common.formatDateCHS(time),
137
               LimitTimeStr: common.formatDateCHS(time),
138
+              IsTodayPractice: false,
112
             });
139
             });
113
-            var list = wx.getStorageSync("CardList");
140
+            var list = app.globalData.CardList;
114
             for (var i = 0; i < list.length; i++) {
141
             for (var i = 0; i < list.length; i++) {
115
               if (that.data.ID == list[i].MiaoguoCardID) {
142
               if (that.data.ID == list[i].MiaoguoCardID) {
116
                 list[i].LimitTime = time;
143
                 list[i].LimitTime = time;
@@ -118,7 +145,7 @@ Page({
118
                 break;
145
                 break;
119
               }
146
               }
120
             }
147
             }
121
-            wx.setStorageSync("CardList", list);
148
+            app.globalData.CardList=list;
122
             wx.showToast({
149
             wx.showToast({
123
               title: '改为今天练',
150
               title: '改为今天练',
124
               icon: 'none',
151
               icon: 'none',
@@ -131,6 +158,49 @@ Page({
131
       }
158
       }
132
     })
159
     })
133
   },
160
   },
161
+  shelveTask: function () {
162
+    //搁置题卡,今天不练
163
+    var that = this;
164
+    wx.showModal({
165
+      title: '今天不练吗?',
166
+      content: '这张题卡今天不练习',
167
+      success(res) {
168
+        if (res.confirm) {
169
+          var url = "UpdateMiaoguoCardToday?";
170
+          url += "ID=" + that.data.MiaoguoCardID;
171
+          url += "&UserID=" + app.globalData.userInfo.UserID;
172
+          url += "&IntervalTime=1d";
173
+          url += "&BtnNumber=1";
174
+          url += "&LearningType=3";
175
+          url += "&Duration=0";
176
+          url += "&IsUndo=0";
177
+          main.getData(url, function (data) {
178
+            var time = common.formatTime(common.addDate("d", 1, new Date()));
179
+            that.setData({
180
+              LimitTimeStr: common.formatDateCHS(time),
181
+              IsTodayPractice: true,
182
+            });
183
+            var list = app.globalData.CardList;
184
+            for (var i = 0; i < list.length; i++) {
185
+              if (that.data.ID == list[i].MiaoguoCardID) {
186
+                list[i].LimitTime = time;
187
+                list[i].LimitTimeStr = "明天";
188
+                break;
189
+              }
190
+            }
191
+            app.globalData.CardList=list;
192
+            wx.showToast({
193
+              title: '改为明天练',
194
+              icon: 'none',
195
+            });
196
+          });
197
+        }
198
+        else if (res.cancel) {
199
+
200
+        }
201
+      }
202
+    })
203
+  },
134
   saveCard: function (obj, callback) {
204
   saveCard: function (obj, callback) {
135
     var url = "UpdateMiaoguoCardToday?";
205
     var url = "UpdateMiaoguoCardToday?";
136
     url += "ID=" + obj.ID;
206
     url += "ID=" + obj.ID;
@@ -184,10 +254,18 @@ Page({
184
       url = e.currentTarget.dataset.soundmark;
254
       url = e.currentTarget.dataset.soundmark;
185
     }
255
     }
186
     else if (e.currentTarget.dataset.soundmark && e.currentTarget.dataset.soundmark != "undefined") {
256
     else if (e.currentTarget.dataset.soundmark && e.currentTarget.dataset.soundmark != "undefined") {
187
-      url = e.currentTarget.dataset.soundmark;
257
+      var soundmark = e.currentTarget.dataset.soundmark;
258
+      if (soundmark && soundmark.indexOf("http") < 0) {
259
+        url = app.globalData.audioUrlBaidu;
260
+        url = url.replace("[token]", app.globalData.BaiduToken);
261
+        url = url.replace("[word]", soundmark);
262
+      }
263
+      else {
264
+        url = soundmark;
265
+      }
188
     }
266
     }
189
     else {
267
     else {
190
-      var url = app.globalData.audioUrlBaidu;
268
+      url = app.globalData.audioUrlBaidu;
191
       url = url.replace("[token]", app.globalData.BaiduToken);
269
       url = url.replace("[token]", app.globalData.BaiduToken);
192
       url = url.replace("[word]", str);
270
       url = url.replace("[word]", str);
193
     }
271
     }
@@ -252,6 +330,7 @@ Page({
252
       },
330
       },
253
     })
331
     })
254
   },
332
   },
333
+
255
   deleteCard: function () {
334
   deleteCard: function () {
256
     var that = this;
335
     var that = this;
257
     wx.showModal({
336
     wx.showModal({
@@ -262,18 +341,18 @@ Page({
262
           var url = 'DeleteMiaoguoCard?UserID=' + app.globalData.userInfo.UserID;
341
           var url = 'DeleteMiaoguoCard?UserID=' + app.globalData.userInfo.UserID;
263
           url += "&ID=" + that.data.MiaoguoCardID;
342
           url += "&ID=" + that.data.MiaoguoCardID;
264
           main.getData(url, function (data) {
343
           main.getData(url, function (data) {
265
-            var list = wx.getStorageSync("CardList");
344
+            var list = app.globalData.CardList;
266
             for (var i = 0; i < list.length; i++) {
345
             for (var i = 0; i < list.length; i++) {
267
               if (that.data.MiaoguoCardID == list[i].MiaoguoCardID) {
346
               if (that.data.MiaoguoCardID == list[i].MiaoguoCardID) {
268
                 list.splice(i, 1);
347
                 list.splice(i, 1);
269
                 break;
348
                 break;
270
               }
349
               }
271
             }
350
             }
272
-            wx.setStorageSync("CardList", list);
351
+            app.globalData.CardList=list;
273
 
352
 
274
-            var taskToday = wx.getStorageSync("TaskToday");
353
+            var taskToday = app.globalData.TaskToday;
275
             taskToday.CardNumber--;
354
             taskToday.CardNumber--;
276
-            wx.setStorageSync("TaskToday", taskToday);
355
+            app.globalData.TaskToday=taskToday;
277
 
356
 
278
             wx.navigateBack({
357
             wx.navigateBack({
279
               delta: 1,
358
               delta: 1,
@@ -312,17 +391,31 @@ Page({
312
     });
391
     });
313
   },
392
   },
314
   onBindError: function (e) {
393
   onBindError: function (e) {
315
-    for (var i = 1; i < this.data.Field.length; i++) {
316
-      for (var j = 0; j < this.data.Field[i].length; j++) {
317
-        if (this.data.Field[i][j].Type == "image") {
318
-          this.data.Field[i][j].Url = this.data.Field[i][j].Content;
394
+    var that = this;
395
+    var serverUrl = e.currentTarget.dataset.serverurl;
396
+    var oldTempUrl = e.currentTarget.dataset.name;
397
+    //console.log("serverUrl1:" + serverUrl);
398
+    wx.downloadFile({
399
+      url: serverUrl, // 仅为示例,并非真实的资源
400
+      success(res) {
401
+        // 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容
402
+        if (res.statusCode === 200) {
403
+          //console.log("serverUrl2:" + serverUrl);
404
+          //console.log(res.tempFilePath);
405
+          main.saveTempImage(serverUrl, res.tempFilePath);
406
+          for (var i = 0; i < arrImage.length; i++) {
407
+            if (arrImage[i] == oldTempUrl) {
408
+              arrImage[i] = res.tempFilePath;
409
+            }
410
+          }
319
         }
411
         }
320
       }
412
       }
321
-    }
322
-    arrImage = arrImage2;
323
-    this.setData({
324
-      Field: this.data.Field,
325
     });
413
     });
414
+
415
+    clearTimeout(intervalRefresh);
416
+    intervalRefresh = setTimeout(function () {
417
+      that.init();
418
+    }, 1000);
326
   },
419
   },
327
   onShareAppMessage: function () {
420
   onShareAppMessage: function () {
328
     var that = this;
421
     var that = this;

+ 7 - 14
pages/main/preview.wxml

@@ -6,7 +6,8 @@
6
         <view class="text2">{{LimitTimeStr}}</view>
6
         <view class="text2">{{LimitTimeStr}}</view>
7
       </view>
7
       </view>
8
       <view class='right FlexRow'>
8
       <view class='right FlexRow'>
9
-        <view class="text3" bindtap='practiceToday'>今天练</view>
9
+        <view class="text3" bindtap='practiceToday' hidden="{{!IsTodayPractice}}">今天必练</view>
10
+        <view class="text4 text3" bindtap='shelveTask' hidden="{{IsTodayPractice}}">今天不练</view>
10
       </view>
11
       </view>
11
     </view>
12
     </view>
12
     <view class="panelTop1"></view>
13
     <view class="panelTop1"></view>
@@ -15,29 +16,20 @@
15
     <view class="panelField11 panelItem FlexRow" style="font-size:{{FontSize}}rpx;">
16
     <view class="panelField11 panelItem FlexRow" style="font-size:{{FontSize}}rpx;">
16
       <block wx:for="{{Field[1]}}" wx:key="index">
17
       <block wx:for="{{Field[1]}}" wx:key="index">
17
         <text class="textReturn" wx:if="{{index>0 && item.Type=='return'}}"></text>
18
         <text class="textReturn" wx:if="{{index>0 && item.Type=='return'}}"></text>
18
-
19
         <text class="textNormal" wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
19
         <text class="textNormal" wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
20
-
21
         <text class="textNormal FlexRow" wx:if="{{item.Type=='line'}}">
20
         <text class="textNormal FlexRow" wx:if="{{item.Type=='line'}}">
22
           <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem">
21
           <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem">
23
               <text wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
22
               <text wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
24
           <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
23
           <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
25
         </block>
24
         </block>
26
         </text>
25
         </text>
27
-
28
         <view class="panelSound FlexRow" wx:if="{{item.Type=='sound'}}" bindtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="1">
26
         <view class="panelSound FlexRow" wx:if="{{item.Type=='sound'}}" bindtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="1">
29
           <image class="universalpic_read_mark_black_20x20" src='../images/universalpic_read_mark_black_20x20.{{item.SoundImageName}}' />
27
           <image class="universalpic_read_mark_black_20x20" src='../images/universalpic_read_mark_black_20x20.{{item.SoundImageName}}' />
30
         </view>
28
         </view>
31
-
32
         <text class="textPinyin" wx:if="{{item.Type=='sound'}}" catchtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="1">{{item.Content}}</text>
29
         <text class="textPinyin" wx:if="{{item.Type=='sound'}}" catchtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="1">{{item.Content}}</text>
33
-
34
-        <image class="imageBishun" wx:if="{{item.Type=='image' && !item.Url}}" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" />
35
-        
36
-        <image class="imageFree" mode="widthFix" wx:if="{{item.Type=='image' && item.Url}}" src='{{item.Url}}' bindtap='showImage' data-name="{{item.Url}}" binderror="onBindError" />
37
-      
30
+        <image class="imageFree" mode="widthFix" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" data-serverurl="{{item.ContentServer}}" binderror="onBindError" />
38
       </block>
31
       </block>
39
     </view>
32
     </view>
40
-
41
   </view>
33
   </view>
42
 
34
 
43
   <view class="panelTag FlexRow" wx:if="{{Tags && Tags.length>0}}">
35
   <view class="panelTag FlexRow" wx:if="{{Tags && Tags.length>0}}">
@@ -47,6 +39,7 @@
47
     </view>
39
     </view>
48
     <view wx:if="{{true}}"></view>
40
     <view wx:if="{{true}}"></view>
49
   </view>
41
   </view>
42
+  
50
   <view class="panelField2 FlexColumn" wx:for="{{[2,3]}}" wx:key="indexParent" wx:for-index="indexParent" wx:for-item="itemParent" wx:if="{{Field[itemParent].length>0}}" bindlongpress='editField' data-id="{{itemParent}}">
43
   <view class="panelField2 FlexColumn" wx:for="{{[2,3]}}" wx:key="indexParent" wx:for-index="indexParent" wx:for-item="itemParent" wx:if="{{Field[itemParent].length>0}}" bindlongpress='editField' data-id="{{itemParent}}">
51
     <view wx:if="{{itemParent==3}}" class="lineField"></view>
44
     <view wx:if="{{itemParent==3}}" class="lineField"></view>
52
 
45
 
@@ -69,9 +62,9 @@
69
 
62
 
70
         <text class="textPinyin" wx:if="{{item.Type=='sound'}}" catchtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="{{itemParent}}">{{item.Content}}</text>
63
         <text class="textPinyin" wx:if="{{item.Type=='sound'}}" catchtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="{{itemParent}}">{{item.Content}}</text>
71
 
64
 
72
-        <image class="imageBishun" wx:if="{{item.Type=='image' && !item.Url}}" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" />
73
-        
74
-        <image class="imageFree" mode="widthFix" wx:if="{{item.Type=='image' && item.Url}}" src='{{item.Url}}' bindtap='showImage' data-name="{{item.Url}}" binderror="onBindError" />
65
+        <!-- <image class="imageBishun" wx:if="{{item.Type=='image' && !item.Url}}" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" />
66
+         -->
67
+        <image class="imageFree" mode="widthFix" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" data-serverurl="{{item.ContentServer}}" binderror="onBindError" />
75
       
68
       
76
       </block>
69
       </block>
77
     </view>
70
     </view>

+ 3 - 1
pages/main/preview.wxss

@@ -49,7 +49,9 @@
49
   font-size: 24rpx;
49
   font-size: 24rpx;
50
 }
50
 }
51
 
51
 
52
-
52
+.text4 {
53
+  color: #1e1e1e;
54
+}
53
 
55
 
54
 .panelItem {
56
 .panelItem {
55
   width: 650rpx;
57
   width: 650rpx;

+ 30 - 12
pages/main/searchCard.js

@@ -14,7 +14,7 @@ Page({
14
     });
14
     });
15
   },
15
   },
16
   onShow:function(){
16
   onShow:function(){
17
-    var taskToday=wx.getStorageSync("TaskToday");
17
+    var taskToday = app.globalData.TaskToday;
18
     this.setData({
18
     this.setData({
19
       CardNumber: taskToday.CardNumber,
19
       CardNumber: taskToday.CardNumber,
20
     })
20
     })
@@ -41,19 +41,37 @@ Page({
41
     });
41
     });
42
     var IsToday=e.currentTarget.dataset.id;
42
     var IsToday=e.currentTarget.dataset.id;
43
     var that = this;
43
     var that = this;
44
-    var url = 'GetMiaoguoCardList?UserID=' + app.globalData.userInfo.UserID;
45
-    if (IsToday)
46
-      url += "&IsToday=" + IsToday;
47
 
44
 
48
-    main.getData(url, function (data) {
49
-      wx.hideLoading();
50
-      if (data) {
51
-        wx.setStorageSync("CardList", data.List);
45
+    if (IsToday==1){
46
+      main.getTaskTodayList(function(task){
47
+        var list = [];
48
+        for (var i = 0; i < task.ListNew.length; i++) {
49
+          list.push(task.ListNew[i]);
50
+        }
51
+        for (var i = 0; i < task.ListHistory.length; i++) {
52
+          list.push(task.ListHistory[i]);
53
+        }
54
+        for (var i = 0; i < task.ListReview.length; i++) {
55
+          list.push(task.ListReview[i]);
56
+        }
57
+        app.globalData.CardList=list;
52
         wx.navigateTo({
58
         wx.navigateTo({
53
-          url: './searchCardList?type='+IsToday+"&Count="+data.Count,
54
-        })
55
-      }
56
-    });
59
+          url: './searchCardList?type=1&Count=' + list.length,
60
+        });
61
+      });
62
+    }
63
+    else{
64
+      var url = 'GetMiaoguoCardList?UserID=' + app.globalData.userInfo.UserID;
65
+      main.getData(url, function (data) {
66
+        wx.hideLoading();
67
+        if (data) {
68
+          app.globalData.CardList= data.List;
69
+          wx.navigateTo({
70
+            url: './searchCardList?type=0&Count=' + data.Count,
71
+          })
72
+        }
73
+      });
74
+    }
57
   },
75
   },
58
   onShareAppMessage: function () {
76
   onShareAppMessage: function () {
59
     return {
77
     return {

+ 1 - 1
pages/main/searchCard.wxml

@@ -12,7 +12,7 @@
12
         <view class="text2">{{CardNumber}}</view>
12
         <view class="text2">{{CardNumber}}</view>
13
       </view>
13
       </view>
14
       <view class='line1'></view>
14
       <view class='line1'></view>
15
-      <view class='text1' bindtap="getList" data-id="1">今日的任务</view>
15
+      <view class='text1' bindtap="getList" data-id="1">剩余任务</view>
16
     </view>
16
     </view>
17
     <view class='lineFooter'></view>
17
     <view class='lineFooter'></view>
18
   </view>
18
   </view>

+ 1 - 1
pages/main/searchCard1.js

@@ -32,7 +32,7 @@ Page({
32
 
32
 
33
       main.getData(url, function (data) {
33
       main.getData(url, function (data) {
34
         if (data) {
34
         if (data) {
35
-          wx.setStorageSync("CardList", data.List);
35
+          app.globalData.CardList= data.List;
36
           wx.navigateTo({
36
           wx.navigateTo({
37
             url: './searchCardList?search=' + search+'&Count='+data.Count,
37
             url: './searchCardList?search=' + search+'&Count='+data.Count,
38
           })
38
           })

+ 47 - 29
pages/main/searchCardList.js

@@ -2,9 +2,11 @@ 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 intervalRefresh = 0;
5
 
6
 
6
 Page({
7
 Page({
7
   data: {
8
   data: {
9
+    HasPage:false,
8
   },
10
   },
9
   onLoad: function (options) {
11
   onLoad: function (options) {
10
     wx.hideShareMenu();
12
     wx.hideShareMenu();
@@ -21,7 +23,7 @@ Page({
21
     else if (options.type == 1) {
23
     else if (options.type == 1) {
22
       IsToday = 1;
24
       IsToday = 1;
23
       wx.setNavigationBarTitle({
25
       wx.setNavigationBarTitle({
24
-        title: "今日的任务"
26
+        title: "剩余任务"
25
       });
27
       });
26
     }
28
     }
27
 
29
 
@@ -37,7 +39,8 @@ Page({
37
     that.getList();
39
     that.getList();
38
   },
40
   },
39
   getList: function () {
41
   getList: function () {
40
-    var list = wx.getStorageSync("CardList");
42
+    var that=this;
43
+    var list = app.globalData.CardList;
41
     var len = 20;
44
     var len = 20;
42
     for (var i = 0; i < list.length; i++) {
45
     for (var i = 0; i < list.length; i++) {
43
       var item = list[i];
46
       var item = list[i];
@@ -55,27 +58,41 @@ Page({
55
       if (imageUrl.length == 0 && item.Content[3].Content)
58
       if (imageUrl.length == 0 && item.Content[3].Content)
56
         imageUrl = getImage(item.Content[3].Content);
59
         imageUrl = getImage(item.Content[3].Content);
57
 
60
 
58
-      if (imageUrl.length > 0)
59
-        item.ImageUrl = imageUrl;
61
+      if (imageUrl.length > 0) {
62
+        item.ImageUrlTemp = main.getTempImage(imageUrl);
63
+        item.ImageUrlServer = imageUrl;
64
+      }
60
     }
65
     }
66
+
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
+
81
+    var hasPage=false;
82
+    if (list.length % 20 == 0 && that.data.IsToday==0)
83
+      hasPage=true;
84
+    
61
     this.setData({
85
     this.setData({
62
       List: list,
86
       List: list,
87
+      HasPage:hasPage,
63
     });
88
     });
64
     wx.hideLoading();
89
     wx.hideLoading();
65
 
90
 
66
     function getImage(str) {
91
     function getImage(str) {
67
-      var result = [];
68
-      if (str.indexOf("[图") >= 0) {
69
-        if (str.indexOf("[图]") >= 0)
70
-          result.push(str.substring(str.indexOf("[图]") + 3, str.indexOf("[/图]")));
71
-        else {
72
-          str = str.substr(str.indexOf("[图") + 2);
73
-          result.push(str.substring(str.indexOf(" url='") + 6, str.indexOf("]")-1));
74
-          str = str.substring(str.indexOf("]") + 1, str.indexOf("[/图]"));
75
-          result.push(str);
76
-        }
92
+      var result = "";
93
+      if (str.indexOf("[图]") >= 0) {
94
+        result = str.substring(str.indexOf("[图]") + 3, str.indexOf("[/图]"));
77
       }
95
       }
78
-      //console.log("images:"+result);
79
       return result;
96
       return result;
80
     }
97
     }
81
 
98
 
@@ -118,23 +135,24 @@ Page({
118
     })
135
     })
119
   },
136
   },
120
   onBindError: function (e) {
137
   onBindError: function (e) {
138
+    var that = this;
121
     var id = e.currentTarget.dataset.id;
139
     var id = e.currentTarget.dataset.id;
122
-    for (var i = 0; i < this.data.List.length; i++) {
123
-      if (this.data.List[i].ImageUrl && this.data.List[i].ImageUrl.length>1) {
124
-        if (id == this.data.List[i].MiaoguoCardID){
125
-          this.data.List[i].ImageUrl[0] = this.data.List[i].ImageUrl[1];
126
-          //console.log("Image1:" + this.data.List[i].ImageUrl[0]);
127
-          //console.log("Image2:" + this.data.List[i].ImageUrl[1]);
140
+
141
+    var serverUrl = e.currentTarget.dataset.serverurl;
142
+    wx.downloadFile({
143
+      url: serverUrl, // 仅为示例,并非真实的资源
144
+      success(res) {
145
+        // 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容
146
+        if (res.statusCode === 200) {
147
+          main.saveTempImage(serverUrl, res.tempFilePath);
128
         }
148
         }
129
       }
149
       }
130
-    }
131
-    this.setData({
132
-      List: this.data.List,
133
     });
150
     });
134
 
151
 
135
-    main.getData('UpdateCardImageUrl?MiaoguoCardID='+id, function (data) {
136
-      
137
-    });
152
+    clearTimeout(intervalRefresh);
153
+    intervalRefresh = setTimeout(function () {
154
+      that.getList();
155
+    }, 1000);
138
   },
156
   },
139
   gotoNextPage: function (e) {
157
   gotoNextPage: function (e) {
140
     wx.showLoading({
158
     wx.showLoading({
@@ -149,11 +167,11 @@ Page({
149
     main.getData(url, function (data) {
167
     main.getData(url, function (data) {
150
       if (data) {
168
       if (data) {
151
 
169
 
152
-        var list = wx.getStorageSync("CardList");
170
+        var list = app.globalData.CardList;
153
         for (var i = 0; i < data.List.length; i++) {
171
         for (var i = 0; i < data.List.length; i++) {
154
           list.push(data.List[i]);
172
           list.push(data.List[i]);
155
         }
173
         }
156
-        wx.setStorageSync("CardList", list);
174
+        app.globalData.CardList=list;
157
         that.getList();
175
         that.getList();
158
       }
176
       }
159
     });
177
     });

+ 3 - 3
pages/main/searchCardList.wxml

@@ -13,7 +13,7 @@
13
       </view>
13
       </view>
14
       <view class="panelItem FlexRow" bindtap='onPreview' data-id="{{item.MiaoguoCardID}}">
14
       <view class="panelItem FlexRow" bindtap='onPreview' data-id="{{item.MiaoguoCardID}}">
15
         <view class="panelItem1 FlexRow">
15
         <view class="panelItem1 FlexRow">
16
-          <image class="ImageCSS" mode="aspectFill" src='{{item.ImageUrl[0]}}' wx:if="{{item.ImageUrl[0]}}" binderror="onBindError" data-id="{{item.MiaoguoCardID}}" />
16
+          <image class="ImageCSS" mode="aspectFill" src='{{item.ImageUrlTemp}}' wx:if="{{item.ImageUrlServer}}" binderror="onBindError" data-id="{{item.MiaoguoCardID}}" data-serverurl="{{item.ImageUrlServer}}" />
17
           <view class="panelItem11 FlexColumn">
17
           <view class="panelItem11 FlexColumn">
18
             <view class='Text1'>{{item.Content[1].ContentStr}}</view>
18
             <view class='Text1'>{{item.Content[1].ContentStr}}</view>
19
             <view class='Text2'>{{item.Content[2].ContentStr}}</view>
19
             <view class='Text2'>{{item.Content[2].ContentStr}}</view>
@@ -24,10 +24,10 @@
24
         </view>
24
         </view>
25
       </view>
25
       </view>
26
     </block>
26
     </block>
27
-    <view class="lineWidthAll FlexRow" wx:if="{{List.length % 20 ==0}}">
27
+    <view class="lineWidthAll FlexRow" wx:if="{{HasPage}}">
28
       <view class="lineWidth750"></view>
28
       <view class="lineWidth750"></view>
29
     </view>
29
     </view>
30
-    <view class='panelItem3 panelItem FlexRow' wx:if="{{List.length % 20 ==0}}" bindtap='gotoNextPage' data-id="{{List[List.length-1].MiaoguoCardID}}">
30
+    <view class='panelItem3 panelItem FlexRow' wx:if="{{HasPage}}" bindtap='gotoNextPage' data-id="{{List[List.length-1].MiaoguoCardID}}">
31
       <view class="more">更多</view>
31
       <view class="more">更多</view>
32
     </view>
32
     </view>
33
     <view class='lineFooter'></view>
33
     <view class='lineFooter'></view>

+ 5 - 9
pages/main/searchWeb2.js

@@ -135,13 +135,9 @@ Page({
135
       this.data.CSS[css].Tag = tag;
135
       this.data.CSS[css].Tag = tag;
136
       if (tag == "发音")
136
       if (tag == "发音")
137
         this.data.CSS[css].SoundMark = soundmark;
137
         this.data.CSS[css].SoundMark = soundmark;
138
-      if (tag == "拼音") {
139
-        var pinyin = main.getPinyin(content);
140
-        if (pinyin)
141
-          this.data.CSS[css].SoundMark = pinyin;
142
-      } 
138
+      
143
       if (tag == "读写") {
139
       if (tag == "读写") {
144
-        var pinyin = main.getPinyin(e.currentTarget.dataset.pinyin);
140
+        var pinyin = e.currentTarget.dataset.pinyin;
145
         if (pinyin)
141
         if (pinyin)
146
           this.data.CSS[css].SoundMark = pinyin;
142
           this.data.CSS[css].SoundMark = pinyin;
147
       }
143
       }
@@ -179,8 +175,8 @@ Page({
179
         wx.removeStorageSync("TempFieldNumber");
175
         wx.removeStorageSync("TempFieldNumber");
180
       }
176
       }
181
 
177
 
182
-      var id = wx.getStorageSync("TempMiaoguoCardID");
183
-      var list = wx.getStorageSync("CardList");
178
+      var id = app.globalData.TempMiaoguoCardID;
179
+      var list = app.globalData.CardList;
184
       for (var i = 0; i < list.length; i++) {
180
       for (var i = 0; i < list.length; i++) {
185
         if (id == list[i].MiaoguoCardID) {
181
         if (id == list[i].MiaoguoCardID) {
186
           for (var key in this.data.CSS) {
182
           for (var key in this.data.CSS) {
@@ -225,7 +221,7 @@ Page({
225
           break;
221
           break;
226
         }
222
         }
227
       }
223
       }
228
-      wx.setStorageSync("CardList", list);
224
+      app.globalData.CardList=list;
229
 
225
 
230
       wx.navigateBack({
226
       wx.navigateBack({
231
         delta: back,
227
         delta: back,

+ 1 - 1
pages/main/searchWeb2.wxml

@@ -195,7 +195,7 @@
195
     <view class="numberContainer12 FlexRow">
195
     <view class="numberContainer12 FlexRow">
196
       <text class='numberContainer121'>
196
       <text class='numberContainer121'>
197
       点一下,添加到段落1;\n
197
       点一下,添加到段落1;\n
198
-      第下,添加到段落2;\n
198
+      第下,添加到段落2;\n
199
       第三下,添加到段落3;\n
199
       第三下,添加到段落3;\n
200
       第四下,不添加;\n
200
       第四下,不添加;\n
201
       1、2、3是段落号码,和点选的先后顺序无关。
201
       1、2、3是段落号码,和点选的先后顺序无关。

+ 7 - 2
pages/main/setting.js

@@ -4,8 +4,8 @@ import main from '../../utils/main';
4
 const app = getApp();
4
 const app = getApp();
5
 const arrSortType = ["时间较早的题卡", "时间较近的题卡"];
5
 const arrSortType = ["时间较早的题卡", "时间较近的题卡"];
6
 const arrSortType2 = ["较早的", "较近的"];
6
 const arrSortType2 = ["较早的", "较近的"];
7
-var arrUserName = ["程杰", "程晟涵", "唱意班主任", "teresa", "古利古拉"];
8
-var arrUserID = [1, 2, 4, 8, 9];
7
+var arrUserName = ["程杰", "程晟涵", "大耳兔", "teresa", "古利古拉", "Lucy-chan"];
8
+var arrUserID = [1, 2, 11, 8, 9, 10];
9
 
9
 
10
 Page({
10
 Page({
11
   data: {
11
   data: {
@@ -131,6 +131,11 @@ Page({
131
       url: './colorplan',
131
       url: './colorplan',
132
     })
132
     })
133
   },
133
   },
134
+  updateMember:function(){
135
+    wx.reLaunch({
136
+      url: '../index/index',
137
+    })
138
+  },
134
   onShareAppMessage: function () {
139
   onShareAppMessage: function () {
135
     return {
140
     return {
136
       title: app.globalData.ShareTitle,
141
       title: app.globalData.ShareTitle,

+ 74 - 12
utils/main.js

@@ -187,7 +187,7 @@ function getWindowHeight() {
187
   else {
187
   else {
188
     height = height + 50;
188
     height = height + 50;
189
   }
189
   }
190
-  console.log("height:" + height);
190
+  //console.log("height:" + height);
191
 
191
 
192
   //var height = app.globalData.systemInfo.screenHeight * 2;
192
   //var height = app.globalData.systemInfo.screenHeight * 2;
193
   return height;
193
   return height;
@@ -310,7 +310,6 @@ function changeStringToView(field) {
310
   var result = {};
310
   var result = {};
311
   result.Field = [[]];
311
   result.Field = [[]];
312
   result.Images = [];
312
   result.Images = [];
313
-  result.Images2 = [];
314
 
313
 
315
   for (var j = 0; j < field.length; j++) {
314
   for (var j = 0; j < field.length; j++) {
316
     if (j == 0) {
315
     if (j == 0) {
@@ -341,17 +340,9 @@ function changeStringToView(field) {
341
             var obj = {};
340
             var obj = {};
342
             obj.Type = "image";
341
             obj.Type = "image";
343
             if (arr[k].indexOf("[图]") >= 0) {
342
             if (arr[k].indexOf("[图]") >= 0) {
344
-              obj.Content = arr[k].substring(arr[k].indexOf("[图]") + 3, arr[k].indexOf("[/图]"));
343
+              obj.ContentServer = arr[k].substring(arr[k].indexOf("[图]") + 3, arr[k].indexOf("[/图]"));
344
+              obj.Content = getTempImage(obj.ContentServer);
345
               result.Images.push(obj.Content);
345
               result.Images.push(obj.Content);
346
-              result.Images2.push(obj.Content);
347
-            }
348
-            else {
349
-              var temp = arr[k].substring(arr[k].indexOf("[图"), arr[k].indexOf("[/图]"));
350
-              obj.Url = temp.substring(temp.indexOf("url=") + 5, temp.indexOf("]") - 1);
351
-              temp = temp.substr(temp.indexOf("]") + 1);
352
-              obj.Content = temp;
353
-              result.Images.push(obj.Url);
354
-              result.Images2.push(obj.Content);
355
             }
346
             }
356
             arrResult.push(obj);
347
             arrResult.push(obj);
357
 
348
 
@@ -446,6 +437,41 @@ function changeStringToView(field) {
446
   return result;
437
   return result;
447
 }
438
 }
448
 
439
 
440
+//得到当天任务
441
+function getTaskTodayList(callback) {
442
+  wx.showLoading({
443
+    title: '请稍候',
444
+    mask: true,
445
+  })
446
+  var that = this;
447
+  var CardMaxNumberNew = wx.getStorageSync("CardMaxNumberNew");
448
+  if (!CardMaxNumberNew)
449
+    CardMaxNumberNew = 10;
450
+
451
+  var CardMaxNumberHistory = wx.getStorageSync("CardMaxNumberHistory");
452
+  if (!CardMaxNumberHistory)
453
+    CardMaxNumberHistory = 30;
454
+
455
+  var SortTypeIndex = wx.getStorageSync("SortTypeIndex");
456
+  if (!SortTypeIndex)
457
+    SortTypeIndex = 0;
458
+
459
+  var url = 'GetMiaoguoCardToday?UserID=' + app.globalData.userInfo.UserID;
460
+  url += "&New=" + CardMaxNumberNew;
461
+  url += "&History=" + CardMaxNumberHistory;
462
+  url += "&SortTypeIndex=" + SortTypeIndex;
463
+
464
+  getData(url, function (data) {
465
+    wx.hideLoading();
466
+
467
+    if (data) {
468
+      app.globalData.TaskToday= data;
469
+      callback(data);
470
+
471
+    }
472
+  });
473
+}
474
+
449
 function getDetailColor(index) {
475
 function getDetailColor(index) {
450
   var arr = [
476
   var arr = [
451
     {//随机
477
     {//随机
@@ -588,6 +614,39 @@ function getDetailColor(index) {
588
     return arr;
614
     return arr;
589
 }
615
 }
590
 
616
 
617
+function getTempImage(serverUrl) {
618
+  if (serverUrl.indexOf("miaguo-1253256735") >= 0) {
619
+    var list = wx.getStorageSync("TempImageList");
620
+    if (!list)
621
+      list = [];
622
+    for (var i = 0; i < list.length; i++) {
623
+      if (list[i].ServerUrl == serverUrl) {
624
+        return list[i].TempUrl;
625
+        break;
626
+      }
627
+    }
628
+  }
629
+  return serverUrl;
630
+}
631
+
632
+function saveTempImage(serverUrl, tempUrl) {
633
+  var list = wx.getStorageSync("TempImageList");
634
+  if (!list)
635
+    list = [];
636
+  var b = false;
637
+  for (var i = 0; i < list.length; i++) {
638
+    if (list[i].ServerUrl == serverUrl) {
639
+      list[i].TempUrl = tempUrl;
640
+      b = true;
641
+      break;
642
+    }
643
+  }
644
+  if (!b) {
645
+    list.push({ "ServerUrl": serverUrl, "TempUrl": tempUrl });
646
+  }
647
+  wx.setStorageSync("TempImageList", list);
648
+}
649
+
591
 function getPinyin(pinyin) {
650
 function getPinyin(pinyin) {
592
   var result = [];
651
   var result = [];
593
   var arr = getPinyinArray();
652
   var arr = getPinyinArray();
@@ -2106,4 +2165,7 @@ module.exports = {
2106
   encryptUrl: EncryptUrl,
2165
   encryptUrl: EncryptUrl,
2107
   decryptUrl: DecryptUrl,
2166
   decryptUrl: DecryptUrl,
2108
   getPinyin: getPinyin,
2167
   getPinyin: getPinyin,
2168
+  saveTempImage: saveTempImage,
2169
+  getTempImage: getTempImage,
2170
+  getTaskTodayList: getTaskTodayList,
2109
 }
2171
 }