chengjie лет назад: 6
Родитель
Сommit
8c55b050c7

+ 4 - 0
pages/index/accredit.js

@@ -107,6 +107,10 @@ Page({
107
     wx.showLoading({
107
     wx.showLoading({
108
       title: '数据初始化',
108
       title: '数据初始化',
109
     });
109
     });
110
+    setTimeout(function () {
111
+      wx.hideLoading();
112
+    }, 5000);
113
+    
110
     main.getData('BuildInitData?UserID=' + app.globalData.userInfo.UserID, function (data) {
114
     main.getData('BuildInitData?UserID=' + app.globalData.userInfo.UserID, function (data) {
111
       wx.hideLoading();
115
       wx.hideLoading();
112
       if (data) {
116
       if (data) {

+ 1 - 1
pages/index/index.js

@@ -212,7 +212,7 @@ Page({
212
               });
212
               });
213
             }, 2000);
213
             }, 2000);
214
 
214
 
215
-            main.UpdateMiaoguoCardTodayAll(function () {
215
+            main.UpdateMiaoguoCardTodayAll(false,function () {
216
               that.getTaskTodayList();
216
               that.getTaskTodayList();
217
             });
217
             });
218
           }
218
           }

+ 40 - 25
pages/main/add.js

@@ -6,7 +6,7 @@ var field = [[], [], [], []];
6
 var arrTag = [];
6
 var arrTag = [];
7
 
7
 
8
 var tempCursor = 0,
8
 var tempCursor = 0,
9
-  btnName = "";
9
+  btnName = ""; 
10
 var arrSoundMark = [];
10
 var arrSoundMark = [];
11
 var isUnload = true;
11
 var isUnload = true;
12
 var isEdit = true;
12
 var isEdit = true;
@@ -103,6 +103,7 @@ Page({
103
       app.globalData.CardList=list;
103
       app.globalData.CardList=list;
104
       wx.removeStorageSync("TempCardInfo");
104
       wx.removeStorageSync("TempCardInfo");
105
     }
105
     }
106
+    wx.removeStorageSync("TempCardInfoAddItem");
106
   },
107
   },
107
   onClose: function () {
108
   onClose: function () {
108
     wx.navigateBack({
109
     wx.navigateBack({
@@ -120,6 +121,7 @@ Page({
120
         break;
121
         break;
121
       }
122
       }
122
     }
123
     }
124
+    wx.setStorageSync("TempCardInfoAddItem", content);
123
     that.setData({
125
     that.setData({
124
       HiddenFieldEdit: false,
126
       HiddenFieldEdit: false,
125
       Focus: true,
127
       Focus: true,
@@ -196,7 +198,7 @@ Page({
196
             var item = that.data.Field[i][key];
198
             var item = that.data.Field[i][key];
197
             var str = "";
199
             var str = "";
198
             if (item.Type == "image") {
200
             if (item.Type == "image") {
199
-              str = "[图]" + item.Content + "[/图]";
201
+              str = "[图 w='"+item.Width+"' h='"+item.Height+"']" + item.Content + "[/图]";
200
             }
202
             }
201
             else if (item.Type == "line") {
203
             else if (item.Type == "line") {
202
               for (var j = 0; j < item.Content.length; j++) {
204
               for (var j = 0; j < item.Content.length; j++) {
@@ -416,6 +418,9 @@ Page({
416
       wx.showLoading({
418
       wx.showLoading({
417
         title: '请稍候',
419
         title: '请稍候',
418
       });
420
       });
421
+      setTimeout(function () {
422
+        wx.hideLoading();
423
+      }, 5000);
419
       var url = 'GetMiaoguoCardList?UserID=' + app.globalData.userInfo.UserID;
424
       var url = 'GetMiaoguoCardList?UserID=' + app.globalData.userInfo.UserID;
420
       main.getData(url, function (data) {
425
       main.getData(url, function (data) {
421
         wx.hideLoading();
426
         wx.hideLoading();
@@ -444,7 +449,6 @@ Page({
444
     this.setData({
449
     this.setData({
445
       FieldContent: e.detail.value,
450
       FieldContent: e.detail.value,
446
     });
451
     });
447
-    //this.updateField();
448
 
452
 
449
   },
453
   },
450
   //加符号
454
   //加符号
@@ -577,9 +581,16 @@ Page({
577
     var isSave = e.currentTarget.dataset.idsave;
581
     var isSave = e.currentTarget.dataset.idsave;
578
     if (isSave == "true") {
582
     if (isSave == "true") {
579
       isUnload = false;
583
       isUnload = false;
580
-      wx.removeStorageSync("TempCardInfoAddItem");
581
       this.updateField();
584
       this.updateField();
582
     }
585
     }
586
+    else if (isSave == "false") {
587
+      var content = wx.getStorageSync("TempCardInfoAddItem");
588
+      this.setData({
589
+        FieldContent:content,
590
+      })
591
+      this.updateField();
592
+    }
593
+    
583
     this.setData({
594
     this.setData({
584
       HiddenFieldEdit:true,
595
       HiddenFieldEdit:true,
585
     });
596
     });
@@ -593,17 +604,13 @@ Page({
593
     });
604
     });
594
   },
605
   },
595
 
606
 
596
-  updateField: function (history) {
607
+  updateField: function () {
597
     var str = this.data.FieldContent;
608
     var str = this.data.FieldContent;
598
     var list = app.globalData.CardList;
609
     var list = app.globalData.CardList;
599
     var card={};
610
     var card={};
600
     for (var i = 0; i < list.length; i++) {
611
     for (var i = 0; i < list.length; i++) {
601
       if (this.data.MiaoguoCardID == list[i].MiaoguoCardID) {
612
       if (this.data.MiaoguoCardID == list[i].MiaoguoCardID) {
602
-        if (history != undefined)
603
-          list[i].Content[this.data.FieldNumber].Content = history;
604
-        else
605
-          list[i].Content[this.data.FieldNumber].Content = str;
606
-        
613
+        list[i].Content[this.data.FieldNumber].Content = str;
607
         card = main.changeStringToView(list[i].Content);
614
         card = main.changeStringToView(list[i].Content);
608
         break;
615
         break;
609
       }
616
       }
@@ -630,26 +637,34 @@ Page({
630
         //console.log(tempFilePaths[0]);
637
         //console.log(tempFilePaths[0]);
631
         //that.data.FieldContent = that.data.FieldContent + "[图 url='" + tempFilePaths[0] + "']" + tempFilePaths[0] + "[/图]";
638
         //that.data.FieldContent = that.data.FieldContent + "[图 url='" + tempFilePaths[0] + "']" + tempFilePaths[0] + "[/图]";
632
 
639
 
633
-        if (tempCursor == undefined)
634
-          tempCursor = that.data.FieldContent.length;
635
-        var str1 = "",
636
-          str2 = "";
637
-        if (that.data.FieldContent.length > 0) {
638
-          str1 = that.data.FieldContent.substr(0, tempCursor);
639
-          str2 = that.data.FieldContent.substring(tempCursor, that.data.FieldContent.length);
640
-        }
640
+        wx.getImageInfo({
641
+          src: res.tempFilePaths[0],
642
+          success(res) {
643
+            console.log(res.width)
644
+            console.log(res.height)
645
+            if (tempCursor == undefined)
646
+              tempCursor = that.data.FieldContent.length;
647
+            var str1 = "",
648
+              str2 = "";
649
+            if (that.data.FieldContent.length > 0) {
650
+              str1 = that.data.FieldContent.substr(0, tempCursor);
651
+              str2 = that.data.FieldContent.substring(tempCursor, that.data.FieldContent.length);
652
+            }
641
 
653
 
642
-        var str0 = "[图]" + tempFilePaths[0] + "[/图]";
654
+            var str0 = "[图 w='"+res.width+"' h='"+res.height+"']" + tempFilePaths[0]+ "[/图]";
643
 
655
 
644
-        that.data.FieldContent = str1 + str0 + str2;
656
+            that.data.FieldContent = str1 + str0 + str2;
645
 
657
 
646
-        //console.log("uploadImageEnd:" + that.data.FieldContent);
658
+            //console.log("uploadImageEnd:" + that.data.FieldContent);
647
 
659
 
648
-        that.setData({
649
-          FieldContent: that.data.FieldContent,
650
-          Focus: false,
660
+            that.setData({
661
+              FieldContent: that.data.FieldContent,
662
+              Focus: false,
663
+            });
664
+            that.updateField();
665
+
666
+          }
651
         });
667
         });
652
-        that.updateField();
653
       },
668
       },
654
       fail: function () {
669
       fail: function () {
655
 
670
 

+ 0 - 4
pages/main/add.wxss

@@ -130,10 +130,6 @@
130
   text-decoration: underline;
130
   text-decoration: underline;
131
   margin-right: 10rpx;
131
   margin-right: 10rpx;
132
 }
132
 }
133
-.panelItem .imageBishun {
134
-  width:100rpx;
135
-  height:100rpx;
136
-}
137
 .panelItem .imageFree{
133
 .panelItem .imageFree{
138
   width:100rpx;
134
   width:100rpx;
139
 }
135
 }

+ 13 - 7
pages/main/detail.js

@@ -50,6 +50,12 @@ Page({
50
 
50
 
51
     this.getMemoryLevel();
51
     this.getMemoryLevel();
52
 
52
 
53
+    if (app.globalData.IsIPad) {
54
+      that.setData({
55
+        IsIPad: "_iPad",
56
+      });
57
+    }
58
+
53
   },
59
   },
54
   onShow: function () {
60
   onShow: function () {
55
     var that = this;
61
     var that = this;
@@ -86,7 +92,7 @@ Page({
86
   },
92
   },
87
   onUnload: function () {
93
   onUnload: function () {
88
     clearInterval(intervalSound);
94
     clearInterval(intervalSound);
89
-    main.UpdateMiaoguoCardTodayAll(function(){
95
+    main.UpdateMiaoguoCardTodayAll(false,function(){
90
       listTaskFinished = [];
96
       listTaskFinished = [];
91
     });
97
     });
92
   },
98
   },
@@ -303,7 +309,7 @@ Page({
303
     if (listTaskFinished.length > 0) {
309
     if (listTaskFinished.length > 0) {
304
       var card = listTaskFinished.pop();
310
       var card = listTaskFinished.pop();
305
       wx.setStorageSync("ListTaskFinished", listTaskFinished);
311
       wx.setStorageSync("ListTaskFinished", listTaskFinished);
306
-
312
+      timeStart  =  new  Date();
307
 
313
 
308
       card.Card.Number0 = card.Number0Old;
314
       card.Card.Number0 = card.Number0Old;
309
       card.Card.Number0Str = card.Number0StrOld;
315
       card.Card.Number0Str = card.Number0StrOld;
@@ -343,7 +349,6 @@ Page({
343
 
349
 
344
       wx.showToast({
350
       wx.showToast({
345
         title: '回到上一张',
351
         title: '回到上一张',
346
-        mask: true,
347
         image: "../images/universalpic_undo_white_120x90.png",
352
         image: "../images/universalpic_undo_white_120x90.png",
348
       });
353
       });
349
       that.setSoundFile(2);
354
       that.setSoundFile(2);
@@ -413,9 +418,6 @@ Page({
413
         finishCard.IsReviewOld = TaskList[0].IsReview;
418
         finishCard.IsReviewOld = TaskList[0].IsReview;
414
 
419
 
415
         TaskList[0].IsReview = true;
420
         TaskList[0].IsReview = true;
416
-
417
-
418
-
419
         TaskList.push(TaskList[0]);
421
         TaskList.push(TaskList[0]);
420
       }
422
       }
421
       //若是天月年
423
       //若是天月年
@@ -451,6 +453,7 @@ Page({
451
     if (finishCard.btnnumber == 1)
453
     if (finishCard.btnnumber == 1)
452
       duration = 0;
454
       duration = 0;
453
     finishCard.Duration = duration;
455
     finishCard.Duration = duration;
456
+    timeStart  =  new  Date();
454
 
457
 
455
     //添加完成列表,去掉任务列表数据
458
     //添加完成列表,去掉任务列表数据
456
     listTaskFinished.push(finishCard);
459
     listTaskFinished.push(finishCard);
@@ -490,7 +493,7 @@ Page({
490
         CanUndo: 1,
493
         CanUndo: 1,
491
       });
494
       });
492
       that.setSoundFile(1);
495
       that.setSoundFile(1);
493
-      main.UpdateMiaoguoCardTodayAll(function () {
496
+      main.UpdateMiaoguoCardTodayAll(true,function () {
494
         listTaskFinished = [];
497
         listTaskFinished = [];
495
         that.getTaskTime();
498
         that.getTaskTime();
496
       });
499
       });
@@ -677,6 +680,9 @@ Page({
677
     wx.showLoading({
680
     wx.showLoading({
678
       title: '生成中',
681
       title: '生成中',
679
     });
682
     });
683
+    setTimeout(function () {
684
+      wx.hideLoading();
685
+    }, 5000);
680
     //console.log(app.globalData.userInfo.AvatarUrl);
686
     //console.log(app.globalData.userInfo.AvatarUrl);
681
     var avatarUrl = app.globalData.userInfo.AvatarUrl;
687
     var avatarUrl = app.globalData.userInfo.AvatarUrl;
682
     avatarUrl = avatarUrl.substring(0, avatarUrl.lastIndexOf("/") + 1);
688
     avatarUrl = avatarUrl.substring(0, avatarUrl.lastIndexOf("/") + 1);

+ 10 - 5
pages/main/detail.wxml

@@ -65,8 +65,10 @@
65
           </view>
65
           </view>
66
 
66
 
67
           <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>
67
           <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>
68
-          <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" />
69
-
68
+          
69
+          <view class="imageContainer FlexColumn" wx:if="{{item.Type=='image'}}" style='width:{{item.Width}}rpx;height:{{item.Height}}rpx;'>
70
+            <image class="imageFree" mode="widthFix" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" data-serverurl="{{item.ContentServer}}" binderror="onBindError" />
71
+          </view>
70
         </block>
72
         </block>
71
       </view>
73
       </view>
72
     </view>
74
     </view>
@@ -102,8 +104,11 @@
102
           </view>
104
           </view>
103
 
105
 
104
           <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>
106
           <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>
105
-          <image class="imageFree2" mode="widthFix" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" data-serverurl="{{item.ContentServer}}" binderror="onBindError" />
106
-          </block>
107
+          
108
+          <view class="imageContainer2 FlexColumn" wx:if="{{item.Type=='image'}}" style='width:{{item.Width}}rpx;height:{{item.Height}}rpx;'>
109
+            <image class="imageFree2" mode="widthFix" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" data-serverurl="{{item.ContentServer}}" binderror="onBindError" />
110
+          </view>
111
+        </block>
107
         </view>
112
         </view>
108
       </view>
113
       </view>
109
     </view>
114
     </view>
@@ -154,7 +159,7 @@
154
   <!-- 最后一页 -->
159
   <!-- 最后一页 -->
155
   <block wx:if="{{NumberNew+NumberReview+NumberHistory==0}}">
160
   <block wx:if="{{NumberNew+NumberReview+NumberHistory==0}}">
156
     <view class='panelLast FlexColumn' style='height:{{Containnerheight}}rpx;background-color:{{Color.BackColor}};'>
161
     <view class='panelLast FlexColumn' style='height:{{Containnerheight}}rpx;background-color:{{Color.BackColor}};'>
157
-      <view class='text1'>做完了</view>
162
+      <view class='text1{{IsIPad}}' >做完了</view>
158
 
163
 
159
       <view class="panelLastTime FlexColumn">
164
       <view class="panelLastTime FlexColumn">
160
         <view style='color:{{Color.FrontColor1}};'>今日练习总共用时</view>
165
         <view style='color:{{Color.FrontColor1}};'>今日练习总共用时</view>

+ 17 - 4
pages/main/detail.wxss

@@ -223,18 +223,25 @@
223
   margin-right: 10rpx;
223
   margin-right: 10rpx;
224
 }
224
 }
225
 
225
 
226
-.panelItem .imageBishun {
227
-  width: 360rpx;
228
-  height: 360rpx;
226
+
227
+.panelItem .imageContainer {
228
+  width: 650rpx;
229
   margin: 6rpx 0;
229
   margin: 6rpx 0;
230
+  border-radius: 20rpx;
231
+  background-color: rgba(0,0,0,0.1);
230
 }
232
 }
231
 
233
 
232
 .panelItem .imageFree {
234
 .panelItem .imageFree {
233
   width: 650rpx;
235
   width: 650rpx;
234
-  margin: 6rpx 0;
235
   border-radius: 20rpx;
236
   border-radius: 20rpx;
236
 }
237
 }
237
 
238
 
239
+
240
+.panelItem .imageContainer2 {
241
+  width: 650rpx;
242
+  border-radius: 10rpx;
243
+  background-color: rgba(0,0,0,0.1);
244
+}
238
 .panelItem .imageFree2 {
245
 .panelItem .imageFree2 {
239
   width: 650rpx;
246
   width: 650rpx;
240
   border-radius: 10rpx;
247
   border-radius: 10rpx;
@@ -362,11 +369,17 @@
362
   z-index: 20;
369
   z-index: 20;
363
 }
370
 }
364
 
371
 
372
+
365
 .text1 {
373
 .text1 {
366
   margin: 100rpx 0 60rpx 40rpx;
374
   margin: 100rpx 0 60rpx 40rpx;
367
   font-size: 90rpx;
375
   font-size: 90rpx;
368
 }
376
 }
369
 
377
 
378
+.text1_iPad {
379
+  margin: 20rpx 0 60rpx 40rpx;
380
+  font-size: 90rpx;
381
+}
382
+
370
 .panelLastTime {
383
 .panelLastTime {
371
   font-size: 28rpx;
384
   font-size: 28rpx;
372
   font-weight: 400;
385
   font-weight: 400;

+ 3 - 0
pages/main/preview.js

@@ -255,6 +255,9 @@ Page({
255
       wx.showLoading({
255
       wx.showLoading({
256
         title: '处理中',
256
         title: '处理中',
257
       });
257
       });
258
+      setTimeout(function () {
259
+        wx.hideLoading();
260
+      }, 5000);
258
       var that = this;
261
       var that = this;
259
       var url = "CollectMiaoguoCard?";
262
       var url = "CollectMiaoguoCard?";
260
       url += "MiaoguoCardID=" + that.data.MiaoguoCardID;
263
       url += "MiaoguoCardID=" + that.data.MiaoguoCardID;

+ 8 - 3
pages/main/preview.wxml

@@ -44,8 +44,10 @@
44
       </view>
44
       </view>
45
 
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>
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
-      <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" />
48
-
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" />
50
+      </view>
49
       </block>
51
       </block>
50
     </view>
52
     </view>
51
   </view>
53
   </view>
@@ -85,7 +87,10 @@
85
         </view>
87
         </view>
86
 
88
 
87
         <view class="textPinyin" hover-class='panelPinyinHover1' hover-stay-time="1000" wx:if="{{item.Type=='sound'}}" catchtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="{{itemParent}}">{{item.Content}}</view>
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>
88
-        <image class="imageFree2" mode="widthFix" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" data-serverurl="{{item.ContentServer}}" binderror="onBindError" />
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" />
93
+        </view>
89
         </block>
94
         </block>
90
       </view>
95
       </view>
91
     </view>
96
     </view>

+ 10 - 4
pages/main/preview.wxss

@@ -232,18 +232,24 @@
232
   margin-right: 10rpx;
232
   margin-right: 10rpx;
233
 }
233
 }
234
 
234
 
235
-.panelItem .imageBishun {
236
-  width: 360rpx;
237
-  height: 360rpx;
235
+.panelItem .imageContainer {
236
+  width: 650rpx;
238
   margin: 6rpx 0;
237
   margin: 6rpx 0;
238
+  border-radius: 20rpx;
239
+  background-color: rgba(0,0,0,0.1);
239
 }
240
 }
240
 
241
 
241
 .panelItem .imageFree {
242
 .panelItem .imageFree {
242
   width: 650rpx;
243
   width: 650rpx;
243
-  margin: 6rpx 0;
244
   border-radius: 20rpx;
244
   border-radius: 20rpx;
245
 }
245
 }
246
 
246
 
247
+
248
+.panelItem .imageContainer2 {
249
+  width: 650rpx;
250
+  border-radius: 10rpx;
251
+  background-color: rgba(0,0,0,0.1);
252
+}
247
 .panelItem .imageFree2 {
253
 .panelItem .imageFree2 {
248
   width: 650rpx;
254
   width: 650rpx;
249
   border-radius: 10rpx;
255
   border-radius: 10rpx;

+ 4 - 0
pages/main/searchCard.js

@@ -39,6 +39,10 @@ Page({
39
     wx.showLoading({
39
     wx.showLoading({
40
       title: '请稍候',
40
       title: '请稍候',
41
     });
41
     });
42
+    setTimeout(function () {
43
+      wx.hideLoading();
44
+    }, 5000);
45
+    
42
     var IsToday=e.currentTarget.dataset.id;
46
     var IsToday=e.currentTarget.dataset.id;
43
     var that = this;
47
     var that = this;
44
 
48
 

+ 6 - 1
pages/main/searchCardList.js

@@ -90,8 +90,9 @@ Page({
90
 
90
 
91
     function getImage(str) {
91
     function getImage(str) {
92
       var result = "";
92
       var result = "";
93
-      if (str.indexOf("[图]") >= 0) {
93
+      if (str.indexOf("[图") >= 0) {
94
         result = str.substring(str.indexOf("[图]") + 3, str.indexOf("[/图]"));
94
         result = str.substring(str.indexOf("[图]") + 3, str.indexOf("[/图]"));
95
+        result = result.substring(result.indexOf("]") + 1);
95
       }
96
       }
96
       return result;
97
       return result;
97
     }
98
     }
@@ -158,6 +159,10 @@ Page({
158
     wx.showLoading({
159
     wx.showLoading({
159
       title: '请稍候',
160
       title: '请稍候',
160
     });
161
     });
162
+    setTimeout(function () {
163
+      wx.hideLoading();
164
+    }, 5000);
165
+    
161
     var that = this;
166
     var that = this;
162
     var id = e.currentTarget.dataset.id;
167
     var id = e.currentTarget.dataset.id;
163
     var url = 'GetMiaoguoCardList?UserID=' + app.globalData.userInfo.UserID + "&IsToday=" + that.data.IsToday + "&PageID=" + id;
168
     var url = 'GetMiaoguoCardList?UserID=' + app.globalData.userInfo.UserID + "&IsToday=" + that.data.IsToday + "&PageID=" + id;

+ 4 - 0
pages/main/searchWeb1.js

@@ -118,6 +118,10 @@ Page({
118
     wx.showLoading({
118
     wx.showLoading({
119
       title: '查询中',
119
       title: '查询中',
120
     });
120
     });
121
+    setTimeout(function () {
122
+      wx.hideLoading();
123
+    }, 5000);
124
+    
121
     var that = this;
125
     var that = this;
122
 
126
 
123
     var url = 'GetMiaoguoAISearch?UserID=' + app.globalData.userInfo.UserID;
127
     var url = 'GetMiaoguoAISearch?UserID=' + app.globalData.userInfo.UserID;

+ 57 - 21
utils/main.js

@@ -339,8 +339,24 @@ function changeStringToView(field) {
339
           if (arr[k].indexOf("[图") >= 0 && arr[k].indexOf("[/图]") > 0) {
339
           if (arr[k].indexOf("[图") >= 0 && arr[k].indexOf("[/图]") > 0) {
340
             var obj = {};
340
             var obj = {};
341
             obj.Type = "image";
341
             obj.Type = "image";
342
-            if (arr[k].indexOf("[图]") >= 0) {
343
-              obj.ContentServer = arr[k].substring(arr[k].indexOf("[图]") + 3, arr[k].indexOf("[/图]"));
342
+            if (arr[k].indexOf("[图") >= 0) {
343
+              obj.ContentServer = arr[k].substring(arr[k].indexOf("[图") + 3, arr[k].indexOf("[/图]"));
344
+
345
+              const w = 650;
346
+              if (obj.ContentServer.indexOf("w='") >= 0 && obj.ContentServer.indexOf("h='") >= 0) {
347
+                obj.Width = obj.ContentServer.substring(obj.ContentServer.indexOf("w='") + 3, obj.ContentServer.indexOf("h='") - 2);
348
+                obj.Height = obj.ContentServer.substring(obj.ContentServer.indexOf("h='") + 3, obj.ContentServer.indexOf("']"));
349
+
350
+                obj.Height = Math.round((w * Number(obj.Height)) / Number(obj.Width));
351
+                obj.Width = w;
352
+
353
+              }
354
+              else {
355
+                obj.Width = "";
356
+                obj.Height = "";
357
+              }
358
+
359
+              obj.ContentServer = obj.ContentServer.substring(obj.ContentServer.indexOf("]") + 1);
344
               obj.Content = getTempImage(obj.ContentServer);
360
               obj.Content = getTempImage(obj.ContentServer);
345
               result.Images.push(obj.Content);
361
               result.Images.push(obj.Content);
346
             }
362
             }
@@ -460,10 +476,19 @@ function changeStringToView(field) {
460
 
476
 
461
 //得到当天任务
477
 //得到当天任务
462
 function getTaskTodayList(callback) {
478
 function getTaskTodayList(callback) {
463
-  wx.showLoading({
464
-    title: '请稍候',
465
-    mask: true,
466
-  })
479
+  var isNotData = true;
480
+  var intervalTask = setTimeout(function () {
481
+    if (isNotData) {
482
+      wx.showLoading({
483
+        title: '请稍候',
484
+        mask: true,
485
+      });
486
+      setTimeout(function(){
487
+        wx.hideLoading();
488
+      },5000);
489
+    }
490
+  }, 2000);
491
+
467
   var that = this;
492
   var that = this;
468
   var CardMaxNumberNew = wx.getStorageSync("CardMaxNumberNew");
493
   var CardMaxNumberNew = wx.getStorageSync("CardMaxNumberNew");
469
   if (!CardMaxNumberNew)
494
   if (!CardMaxNumberNew)
@@ -483,7 +508,11 @@ function getTaskTodayList(callback) {
483
   url += "&SortTypeIndex=" + SortTypeIndex;
508
   url += "&SortTypeIndex=" + SortTypeIndex;
484
 
509
 
485
   getData(url, function (data) {
510
   getData(url, function (data) {
486
-    wx.hideLoading();
511
+    clearTimeout(intervalTask);
512
+    if (isNotData) {
513
+      wx.hideLoading();
514
+    }
515
+    isNotData = false;
487
 
516
 
488
     if (data) {
517
     if (data) {
489
       app.globalData.TaskToday = data;
518
       app.globalData.TaskToday = data;
@@ -531,17 +560,22 @@ function saveTempImage(serverUrl, tempUrl) {
531
   wx.setStorageSync("TempImageList", list);
560
   wx.setStorageSync("TempImageList", list);
532
 }
561
 }
533
 
562
 
534
-function UpdateMiaoguoCardTodayAll(callback){
563
+function UpdateMiaoguoCardTodayAll(isShowLoading, callback) {
535
   var that = this;
564
   var that = this;
536
-  wx.showLoading({
537
-    title: '请稍候',
538
-    mask: true,
539
-  });
565
+  if (isShowLoading) {
566
+    wx.showLoading({
567
+      title: '请稍候',
568
+      mask: true,
569
+    });
570
+    setTimeout(function () {
571
+      wx.hideLoading();
572
+    }, 10000);
573
+  }
540
   var list = wx.getStorageSync("ListTaskFinished");
574
   var list = wx.getStorageSync("ListTaskFinished");
541
   if (list && list.length > 0) {
575
   if (list && list.length > 0) {
542
-    var arr=[];
543
-    for(var i=0;i<list.length;i++){
544
-      var obj={};
576
+    var arr = [];
577
+    for (var i = 0; i < list.length; i++) {
578
+      var obj = {};
545
       obj.MiaoguoCardID = list[i].Card.MiaoguoCardID;
579
       obj.MiaoguoCardID = list[i].Card.MiaoguoCardID;
546
       obj.IntervalTime = list[i].IntervalTime;
580
       obj.IntervalTime = list[i].IntervalTime;
547
       obj.BtnNumber = list[i].BtnNumber;
581
       obj.BtnNumber = list[i].BtnNumber;
@@ -553,16 +587,18 @@ function UpdateMiaoguoCardTodayAll(callback){
553
     that.postData('UpdateMiaoguoCardTodayAll?UserID=' + app.globalData.userInfo.UserID, {
587
     that.postData('UpdateMiaoguoCardTodayAll?UserID=' + app.globalData.userInfo.UserID, {
554
       List: arr,
588
       List: arr,
555
     }, function (data) {
589
     }, function (data) {
556
-      wx.hideLoading();
590
+      if (isShowLoading) {
591
+        wx.hideLoading();
592
+      }
557
       if (data) {
593
       if (data) {
558
         wx.removeStorageSync("ListTaskFinished");
594
         wx.removeStorageSync("ListTaskFinished");
559
       }
595
       }
560
-      if (callback){
596
+      if (callback) {
561
         callback();
597
         callback();
562
       }
598
       }
563
     });
599
     });
564
   }
600
   }
565
-  else{
601
+  else {
566
     if (callback) {
602
     if (callback) {
567
       callback();
603
       callback();
568
     }
604
     }
@@ -584,18 +620,18 @@ function updateSearchList(obj) {
584
       && arr[i].Author == obj.Author
620
       && arr[i].Author == obj.Author
585
     ) {
621
     ) {
586
       if (obj.Type == "shici") {
622
       if (obj.Type == "shici") {
587
-        if (arr[i].ShiciUrl==obj.ShiciUrl){
623
+        if (arr[i].ShiciUrl == obj.ShiciUrl) {
588
           obj.Value = arr[i].Value;
624
           obj.Value = arr[i].Value;
589
           arr.splice(i, 1);
625
           arr.splice(i, 1);
590
           break;
626
           break;
591
         }
627
         }
592
       }
628
       }
593
-      else{
629
+      else {
594
         obj.Value = arr[i].Value;
630
         obj.Value = arr[i].Value;
595
         arr.splice(i, 1);
631
         arr.splice(i, 1);
596
         break;
632
         break;
597
       }
633
       }
598
-      
634
+
599
     }
635
     }
600
   }
636
   }
601
   arr.unshift(obj);
637
   arr.unshift(obj);