chengjie пре 7 година
родитељ
комит
3f4d4002df

+ 2 - 2
app.js

@@ -13,13 +13,13 @@ App({
13
     this.globalData.systemInfo = wx.getSystemInfoSync();
13
     this.globalData.systemInfo = wx.getSystemInfoSync();
14
   },
14
   },
15
   globalData: {
15
   globalData: {
16
-    Version: "1.0.0",
16
+    Version: "1.0.0.3",
17
     IsProduction: false,
17
     IsProduction: false,
18
     ShareTitle: "可以用来记忆一切的工具",
18
     ShareTitle: "可以用来记忆一切的工具",
19
     SharePath: "pages/index/index",
19
     SharePath: "pages/index/index",
20
     ShareImage: '',
20
     ShareImage: '',
21
-    
22
     ProgramID: 166,
21
     ProgramID: 166,
22
+    ProgramName:"秒过学习",
23
     serverUrl: "https://www.kylx365.com/apiData/",
23
     serverUrl: "https://www.kylx365.com/apiData/",
24
     serverUrlServer: "https://www.kylx365.com/apiData/",
24
     serverUrlServer: "https://www.kylx365.com/apiData/",
25
     serverUrlLocalhost: "http://localhost:3020/apiData/",
25
     serverUrlLocalhost: "http://localhost:3020/apiData/",

+ 2 - 1
app.json

@@ -1,5 +1,5 @@
1
 {
1
 {
2
-  "pages": [
2
+  "pages": [    
3
     "pages/index/index",
3
     "pages/index/index",
4
     "pages/index/accredit",
4
     "pages/index/accredit",
5
     "pages/main/default",
5
     "pages/main/default",
@@ -15,6 +15,7 @@
15
     "pages/main/searchWeb",
15
     "pages/main/searchWeb",
16
     "pages/main/detail",
16
     "pages/main/detail",
17
     "pages/main/colorplan",
17
     "pages/main/colorplan",
18
+    "pages/main/uploadinmage",
18
     "pages/main/setting"
19
     "pages/main/setting"
19
   ],
20
   ],
20
   "window": {
21
   "window": {

BIN
pages/images/universalpic_picture_gray_26x26.png


+ 17 - 5
pages/index/accredit.js

@@ -1,5 +1,5 @@
1
 import common from '../../utils/util';
1
 import common from '../../utils/util';
2
-import server from '../../utils/main';
2
+import main from '../../utils/main';
3
 
3
 
4
 const app = getApp();
4
 const app = getApp();
5
 var urlRedirectTo = "";
5
 var urlRedirectTo = "";
@@ -72,7 +72,7 @@ Page({
72
   login: function (param, param2) {
72
   login: function (param, param2) {
73
     var that = this;
73
     var that = this;
74
     var url = "MiaoguoLogin";
74
     var url = "MiaoguoLogin";
75
-    server.postData(url, {
75
+    main.postData(url, {
76
       Code: param.Code,
76
       Code: param.Code,
77
       NickName: param2.nickName,
77
       NickName: param2.nickName,
78
       AvatarUrl: param2.avatarUrl,
78
       AvatarUrl: param2.avatarUrl,
@@ -97,10 +97,22 @@ Page({
97
       app.globalData.userInfo.Province = data.Province;
97
       app.globalData.userInfo.Province = data.Province;
98
       app.globalData.userInfo.Country = data.Country;
98
       app.globalData.userInfo.Country = data.Country;
99
       
99
       
100
-      wx.navigateBack({
101
-        delta: 1
102
-      });
100
+      that.buildInitData();
101
+    });
102
+  },
103
+  buildInitData: function () {
104
+    //app.globalData.userInfo.UserID=4;
103
 
105
 
106
+    wx.showLoading({
107
+      title: '数据初始化',
108
+    });
109
+    main.getData('BuildInitData?UserID=' + app.globalData.userInfo.UserID, function (data) {
110
+      wx.hideLoading();
111
+      if (data) {
112
+        wx.navigateBack({
113
+          delta: 1
114
+        });
115
+      }
104
     });
116
     });
105
   },
117
   },
106
   onShareAppMessage: function () {
118
   onShareAppMessage: function () {

+ 17 - 1
pages/main/add.js

@@ -149,7 +149,11 @@ Page({
149
           var item = that.data.Field[i][key];
149
           var item = that.data.Field[i][key];
150
           var str = "";
150
           var str = "";
151
           if (item.Type == "image") {
151
           if (item.Type == "image") {
152
-            str = "[图]" + item.Content + "[/图]";
152
+            if (item.Url){
153
+              str = "[图 url='"+item.Url+"']" + item.Content + "[/图]";
154
+            }
155
+            else
156
+              str = "[图]" + item.Content + "[/图]";
153
           }
157
           }
154
           else if (item.Type == "line") {
158
           else if (item.Type == "line") {
155
             for (var j = 0; j < item.Content.length; j++) {
159
             for (var j = 0; j < item.Content.length; j++) {
@@ -231,6 +235,18 @@ Page({
231
       UpdateType: "add2",
235
       UpdateType: "add2",
232
     });
236
     });
233
   },
237
   },
238
+  onBindError: function (e) {
239
+    for (var i = 1; i < this.data.Field.length; i++) {
240
+      for (var j = 0; j < this.data.Field[i].length; j++) {
241
+        if (this.data.Field[i][j].Type == "image") {
242
+          this.data.Field[i][j].Url = this.data.Field[i][j].Content;
243
+        }
244
+      }
245
+    }
246
+    this.setData({
247
+      Field: this.data.Field,
248
+    });
249
+  },
234
   onShareAppMessage: function () {
250
   onShareAppMessage: function () {
235
     return {
251
     return {
236
       title: app.globalData.ShareTitle,
252
       title: app.globalData.ShareTitle,

+ 4 - 1
pages/main/add.wxml

@@ -39,7 +39,10 @@
39
           <image class="universalpic_read_gray_40x40" wx:if="{{item.Type=='sound'}}" src='../images/universalpic_read_gray_40x40.png' />
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>
40
           <text class="textPinyin" wx:if="{{item.Type=='sound'}}">{{item.Content}}</text>
41
 
41
 
42
-          <image class="imageBishun" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' />
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
+          
43
           <text class="textReturn" wx:if="{{item.Type=='return'}}"></text>
46
           <text class="textReturn" wx:if="{{item.Type=='return'}}"></text>
44
         </block>
47
         </block>
45
       </view>
48
       </view>

+ 3 - 1
pages/main/add.wxss

@@ -120,7 +120,9 @@
120
   width:100rpx;
120
   width:100rpx;
121
   height:100rpx;
121
   height:100rpx;
122
 }
122
 }
123
-
123
+.panelItem .imageFree{
124
+  width:100rpx;
125
+}
124
 
126
 
125
 .panelItem .textReturn{
127
 .panelItem .textReturn{
126
   width:100%;
128
   width:100%;

+ 33 - 1
pages/main/addItem.js

@@ -21,6 +21,7 @@ Page({
21
     wx.hideShareMenu();
21
     wx.hideShareMenu();
22
     var id = options.id;
22
     var id = options.id;
23
     var fieldid = options.fieldid;
23
     var fieldid = options.fieldid;
24
+    field = "", tempCursor = 0, btnName = "", arrSoundMark = [];
24
 
25
 
25
     var that = this;
26
     var that = this;
26
     that.setData({
27
     that.setData({
@@ -94,7 +95,7 @@ Page({
94
       this.setData({
95
       this.setData({
95
         LineSign: "[线]",
96
         LineSign: "[线]",
96
       });
97
       });
97
-    }
98
+    } 
98
 
99
 
99
     if (!this.data.Focus){
100
     if (!this.data.Focus){
100
       field=field+btnName;
101
       field=field+btnName;
@@ -201,6 +202,37 @@ Page({
201
     }
202
     }
202
     wx.setStorageSync("CardList", list);
203
     wx.setStorageSync("CardList", list);
203
   },
204
   },
205
+  uploadImage: function () {
206
+    wx.showLoading({
207
+      title: '请稍候',
208
+    });
209
+    var that=this;
210
+    wx.chooseImage({
211
+      count: 1,
212
+      sizeType: ['compressed'],
213
+      sourceType: ['album', 'camera'],
214
+      success(res) {
215
+        // tempFilePath可以作为img标签的src属性显示图片
216
+        const tempFilePaths = res.tempFilePaths;
217
+        console.log(tempFilePaths[0]);
218
+
219
+        var url = common.Encrypt("MiaoguoUploadFile");
220
+        wx.uploadFile({
221
+          url: app.globalData.serverUrl + url,
222
+          filePath: tempFilePaths[0],
223
+          name: 'file',
224
+          success(res) {
225
+            wx.hideLoading();
226
+            var str = "[图 url='" + tempFilePaths[0] + "']" + "https://#####4#####/" +res.data+ "[/图]";
227
+            that.addSymbol({ currentTarget: { dataset: { id: str } } });
228
+          }
229
+        });
230
+      },
231
+      fail:function(){
232
+        wx.hideLoading();
233
+      }
234
+    });
235
+  },
204
   onShareAppMessage: function () {
236
   onShareAppMessage: function () {
205
     return {
237
     return {
206
       title: app.globalData.ShareTitle,
238
       title: app.globalData.ShareTitle,

+ 3 - 1
pages/main/addItem.wxml

@@ -16,7 +16,9 @@
16
       <view class="panelSave3 panelSave1 FlexRow" bindtap="addSymbol" data-id="{{LineSign}}" wx:if="{{LineSign=='[/线]'}}">
16
       <view class="panelSave3 panelSave1 FlexRow" bindtap="addSymbol" data-id="{{LineSign}}" wx:if="{{LineSign=='[/线]'}}">
17
         <image class="universalpic_underline_end_white_30x22" src='../images/universalpic_underline_end_white_30x22.png' />
17
         <image class="universalpic_underline_end_white_30x22" src='../images/universalpic_underline_end_white_30x22.png' />
18
       </view>
18
       </view>
19
-      <!-- <image class="universalpic_help_gray_26x26" src='../images/universalpic_help_gray_26x26.png' /> -->
19
+      <view class="panelSave2 panelSave1 FlexRow" bindtap="uploadImage">
20
+        <image class="universalpic_picture_gray_26x26" src='../images/universalpic_picture_gray_26x26.png' />
21
+      </view>
20
 
22
 
21
     </view>
23
     </view>
22
     <view class='right FlexRow'>
24
     <view class='right FlexRow'>

+ 6 - 0
pages/main/addItem.wxss

@@ -68,6 +68,11 @@
68
   height: 22rpx;
68
   height: 22rpx;
69
 }
69
 }
70
 
70
 
71
+.universalpic_picture_gray_26x26{
72
+  width: 26rpx;
73
+  height: 26rpx;
74
+}
75
+
71
 .add {
76
 .add {
72
   font-size: 42rpx;
77
   font-size: 42rpx;
73
   font-weight: 600;
78
   font-weight: 600;
@@ -158,6 +163,7 @@
158
 .input {
163
 .input {
159
   margin: 30rpx 30rpx 0 30rpx;
164
   margin: 30rpx 30rpx 0 30rpx;
160
   width: 690rpx;
165
   width: 690rpx;
166
+  height:220rpx;
161
 }
167
 }
162
 
168
 
163
 .panelBtn {
169
 .panelBtn {

+ 55 - 23
pages/main/detail.js

@@ -10,7 +10,8 @@ var innerAudioContext1;
10
 var listTaskFinished = []; //完成的任务
10
 var listTaskFinished = []; //完成的任务
11
 var timeStart; //计算时长
11
 var timeStart; //计算时长
12
 var TaskList = [];
12
 var TaskList = [];
13
-var iTimeout=0;
13
+var iTimeout = 0;
14
+var arrImage = [], arrImage2 = [];
14
 
15
 
15
 Page({
16
 Page({
16
   data: {
17
   data: {
@@ -18,7 +19,7 @@ Page({
18
     NumberReview: 0,
19
     NumberReview: 0,
19
     NumberHistory: 30,
20
     NumberHistory: 30,
20
     IsShowNumberInfo: false,
21
     IsShowNumberInfo: false,
21
-    TaskInfo:{},
22
+    TaskInfo: {},
22
     Color: {//配色1
23
     Color: {//配色1
23
       Name: "黑白",
24
       Name: "黑白",
24
       BackColor: "#ffffff",
25
       BackColor: "#ffffff",
@@ -45,7 +46,7 @@ Page({
45
 
46
 
46
     innerAudioContext1 = wx.createInnerAudioContext();
47
     innerAudioContext1 = wx.createInnerAudioContext();
47
     this.audioCtx = wx.createAudioContext('myAudio');
48
     this.audioCtx = wx.createAudioContext('myAudio');
48
-    
49
+
49
     this.getList();
50
     this.getList();
50
 
51
 
51
     this.getColor();
52
     this.getColor();
@@ -90,11 +91,11 @@ Page({
90
       url += "end.mp3";
91
       url += "end.mp3";
91
       that.getTaskTime();
92
       that.getTaskTime();
92
     }
93
     }
93
-    else if (isFinish == 2 || isFinish==3){
94
+    else if (isFinish == 2 || isFinish == 3) {
94
       url += "short3.mp3";
95
       url += "short3.mp3";
95
     }
96
     }
96
     else {
97
     else {
97
-    url += "short2.mp3";
98
+      url += "short2.mp3";
98
     }
99
     }
99
     if (isFinish >= 0) {
100
     if (isFinish >= 0) {
100
       innerAudioContext1.src = url;
101
       innerAudioContext1.src = url;
@@ -181,7 +182,11 @@ Page({
181
     //处理列表
182
     //处理列表
182
     TaskList = formatList(TaskList);
183
     TaskList = formatList(TaskList);
183
 
184
 
184
-
185
+    if (TaskList.length > 0) {
186
+      arrImage = TaskList[0].ContentNew.Images;
187
+      arrImage2 = TaskList[0].ContentNew.Images2;
188
+    }
189
+    
185
     that.setData({
190
     that.setData({
186
       NumberNew: arrNew.length,
191
       NumberNew: arrNew.length,
187
       NumberReview: that.data.NumberReview,
192
       NumberReview: that.data.NumberReview,
@@ -298,7 +303,10 @@ Page({
298
   },
303
   },
299
   gotoPrev: function () {
304
   gotoPrev: function () {
300
     clearTimeout(iTimeout);
305
     clearTimeout(iTimeout);
301
-
306
+    wx.showLoading({
307
+      title: '请稍候',
308
+      mask: true,
309
+    });
302
     if (listTaskFinished.length > 0) {
310
     if (listTaskFinished.length > 0) {
303
       var card = listTaskFinished.pop();
311
       var card = listTaskFinished.pop();
304
       //console.log(card);
312
       //console.log(card);
@@ -316,6 +324,7 @@ Page({
316
         url += "&LastTime=" + card.Card.LastTime;
324
         url += "&LastTime=" + card.Card.LastTime;
317
 
325
 
318
       main.getData(url, function (data) {
326
       main.getData(url, function (data) {
327
+        wx.hideLoading();
319
         timeStart = new Date();
328
         timeStart = new Date();
320
 
329
 
321
         card.Card.Number0 = card.Number0Old;
330
         card.Card.Number0 = card.Number0Old;
@@ -342,6 +351,9 @@ Page({
342
         if (listTaskFinished.length == 0)
351
         if (listTaskFinished.length == 0)
343
           canUndo = 0;
352
           canUndo = 0;
344
 
353
 
354
+        arrImage = TaskList[0].ContentNew.Images;
355
+        arrImage2 = TaskList[0].ContentNew.Images2;
356
+
345
         that.setData({
357
         that.setData({
346
           IsShowAnswer: [0, 0],
358
           IsShowAnswer: [0, 0],
347
           TaskInfo: TaskList[0],
359
           TaskInfo: TaskList[0],
@@ -350,12 +362,12 @@ Page({
350
           NumberHistory: card.NumberHistory,
362
           NumberHistory: card.NumberHistory,
351
           CanUndo: canUndo,
363
           CanUndo: canUndo,
352
         });
364
         });
353
-      });
354
 
365
 
355
-      wx.showToast({
356
-        title: '回到上一张',
357
-        mask: true,
358
-        image:"../images/universalpic_undo_white_120x90.png",
366
+        wx.showToast({
367
+          title: '回到上一张',
368
+          mask: true,
369
+          image: "../images/universalpic_undo_white_120x90.png",
370
+        });
359
       });
371
       });
360
     }
372
     }
361
     that.setSoundFile(2);
373
     that.setSoundFile(2);
@@ -444,13 +456,6 @@ Page({
444
       }
456
       }
445
 
457
 
446
     }
458
     }
447
-    else {
448
-      wx.showToast({
449
-        title: '今天不练',
450
-        mask: true,
451
-        image: "../images/universalpic_shelve_white_120x120.png",
452
-      });
453
-    }
454
 
459
 
455
     //修改学习任务个数
460
     //修改学习任务个数
456
     var learningType = 0;
461
     var learningType = 0;
@@ -522,6 +527,9 @@ Page({
522
         });
527
         });
523
         that.setSoundFile(1);
528
         that.setSoundFile(1);
524
       } else {
529
       } else {
530
+        arrImage = TaskList[0].ContentNew.Images;
531
+        arrImage2 = TaskList[0].ContentNew.Images2;
532
+
525
         //任务没有完成,下一张卡片
533
         //任务没有完成,下一张卡片
526
         that.setData({
534
         that.setData({
527
           IsShowAnswer: [0, 0],
535
           IsShowAnswer: [0, 0],
@@ -532,11 +540,16 @@ Page({
532
           CanUndo: 1,
540
           CanUndo: 1,
533
         });
541
         });
534
 
542
 
535
-        if (btnnumber == "1")
543
+        if (btnnumber == "1") {
536
           that.setSoundFile(3);
544
           that.setSoundFile(3);
545
+          wx.showToast({
546
+            title: '今天不练',
547
+            mask: true,
548
+            image: "../images/universalpic_shelve_white_120x120.png",
549
+          });
550
+        }
537
         else
551
         else
538
           that.setSoundFile(0);
552
           that.setSoundFile(0);
539
-
540
       }
553
       }
541
     });
554
     });
542
 
555
 
@@ -599,7 +612,7 @@ Page({
599
     that.setData({
612
     that.setData({
600
       TaskInfo: TaskList[0],
613
       TaskInfo: TaskList[0],
601
     });
614
     });
602
-    iTimeout=setTimeout(function () {
615
+    iTimeout = setTimeout(function () {
603
       content[selectIndex].SoundImageName = "png";
616
       content[selectIndex].SoundImageName = "png";
604
       TaskList[0].ContentNew.Field[fieldid] = content;
617
       TaskList[0].ContentNew.Field[fieldid] = content;
605
       that.setData({
618
       that.setData({
@@ -635,6 +648,26 @@ Page({
635
       IsShowNumberInfo: false,
648
       IsShowNumberInfo: false,
636
     });
649
     });
637
   },
650
   },
651
+  showImage: function (e) {
652
+    var name = e.currentTarget.dataset.name;
653
+    wx.previewImage({
654
+      current: name,
655
+      urls: arrImage
656
+    });
657
+  },
658
+  onBindError: function (e) {
659
+    for (var i = 1; i < this.data.TaskInfo.ContentNew.Field.length; i++) {
660
+      for (var j = 0; j < this.data.TaskInfo.ContentNew.Field[i].length; j++) {
661
+        if (this.data.TaskInfo.ContentNew.Field[i][j].Type == "image") {
662
+          this.data.TaskInfo.ContentNew.Field[i][j].Url = this.data.TaskInfo.ContentNew.Field[i][j].Content;
663
+        }
664
+      }
665
+    }
666
+    arrImage = arrImage2;
667
+    this.setData({
668
+      TaskInfo: this.data.TaskInfo,
669
+    });
670
+  },
638
   onShareAppMessage: function () {
671
   onShareAppMessage: function () {
639
     return {
672
     return {
640
       title: app.globalData.ShareTitle,
673
       title: app.globalData.ShareTitle,
@@ -642,5 +675,4 @@ Page({
642
       imageUrl: app.globalData.ShareImage,
675
       imageUrl: app.globalData.ShareImage,
643
     }
676
     }
644
   },
677
   },
645
-
646
 });
678
 });

+ 9 - 4
pages/main/detail.wxml

@@ -57,12 +57,15 @@
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'}}" src='{{item.Content}}' />
60
+        <image class="imageBishun" wx:if="{{item.Type=='image'  && !item.Url}}" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" />
61
+
62
+        <image class="imageFree" mode='widthFix' wx:if="{{item.Type=='image' && item.Url}}" src='{{item.Url}}' bindtap='showImage' data-name="{{item.Url}}" binderror="onBindError" />
63
+
61
   </block>
64
   </block>
62
   </view>
65
   </view>
63
 
66
 
64
   </view>
67
   </view>
65
-  <view class="panelTag FlexRow" bindtouchstart="onShowAnswer" style='background-color:{{Color.BackColor2}};color:{{Color.FrontColor2}};'>
68
+  <view class="panelTag FlexRow" bindtap="onShowAnswer" style='background-color:{{Color.BackColor2}};color:{{Color.FrontColor2}};'>
66
     <view wx:if="{{!TaskInfo.ContentNew.Tags || TaskInfo.ContentNew.Tags.length==0}}"></view>
69
     <view wx:if="{{!TaskInfo.ContentNew.Tags || TaskInfo.ContentNew.Tags.length==0}}"></view>
67
     <view class="panelTag1 FlexRow" wx:if="{{TaskInfo.ContentNew.Tags && TaskInfo.ContentNew.Tags.length>0}}">
70
     <view class="panelTag1 FlexRow" wx:if="{{TaskInfo.ContentNew.Tags && TaskInfo.ContentNew.Tags.length>0}}">
68
       <view class='tagDot' style='background-color:{{Color.TagColor}};'></view>
71
       <view class='tagDot' style='background-color:{{Color.TagColor}};'></view>
@@ -78,7 +81,7 @@
78
 
81
 
79
   </view>
82
   </view>
80
 
83
 
81
-  <view class="panelField20 FlexColumn" style='min-height:{{Containnerheight-480}}rpx;background-color:{{Color.BackColor2}};color:{{Color.FrontColor2}};' bindtouchstart="onShowAnswer">
84
+  <view class="panelField20 FlexColumn" style='min-height:{{Containnerheight-480}}rpx;background-color:{{Color.BackColor2}};color:{{Color.FrontColor2}};' bindtap="onShowAnswer">
82
     <view class="panelField2 FlexColumn" wx:for="{{[2,3]}}" wx:key="indexParent" wx:for-index="indexParent" wx:for-item="itemParent" wx:if="{{TaskInfo.ContentNew.Field[itemParent].length>0 && IsShowAnswer[itemParent-2]}}">
85
     <view class="panelField2 FlexColumn" wx:for="{{[2,3]}}" wx:key="indexParent" wx:for-index="indexParent" wx:for-item="itemParent" wx:if="{{TaskInfo.ContentNew.Field[itemParent].length>0 && IsShowAnswer[itemParent-2]}}">
83
       <view wx:if="{{itemParent==3}}" class="lineField" style='background-color:{{Color.FieldLineColor}};'></view>
86
       <view wx:if="{{itemParent==3}}" class="lineField" style='background-color:{{Color.FieldLineColor}};'></view>
84
       <view class="panelField21 panelItem FlexRow">
87
       <view class="panelField21 panelItem FlexRow">
@@ -100,7 +103,9 @@
100
 
103
 
101
         <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>
102
 
105
 
103
-        <image class="imageBishun" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' />
106
+        <image class="imageBishun" wx:if="{{item.Type=='image' && !item.Url}}" src='{{item.Content}}' bindtap='showImage' data-name="{{item.Content}}" />
107
+
108
+        <image class="imageFree" mode="widthFix" wx:if="{{item.Type=='image' && item.Url}}" src='{{item.Url}}' bindtap='showImage' data-name="{{item.Url}}" binderror="onBindError" />
104
 
109
 
105
         </block>
110
         </block>
106
       </view>
111
       </view>

+ 6 - 0
pages/main/detail.wxss

@@ -199,6 +199,12 @@
199
   margin: 30rpx 0;
199
   margin: 30rpx 0;
200
 }
200
 }
201
 
201
 
202
+.panelItem .imageFree {
203
+  width: 650rpx;
204
+  margin: 30rpx 0;
205
+  border-radius: 20rpx;
206
+}
207
+
202
 .panelItem .textReturn {
208
 .panelItem .textReturn {
203
   width: 100%;
209
   width: 100%;
204
 }
210
 }

+ 35 - 2
pages/main/preview.js

@@ -3,6 +3,7 @@ import main from '../../utils/main';
3
 
3
 
4
 const app = getApp();
4
 const app = getApp();
5
 var iTimeout = 0;
5
 var iTimeout = 0;
6
+var arrImage = [], arrImage2 = [];
6
 
7
 
7
 Page({
8
 Page({
8
   data: {
9
   data: {
@@ -20,8 +21,14 @@ Page({
20
       ShowType: options.type,
21
       ShowType: options.type,
21
       MiaoguoCardID: id,
22
       MiaoguoCardID: id,
22
     });
23
     });
23
-
24
+    console.log("MiaoguoCardID:"+id);
24
     this.audioCtx = wx.createAudioContext('myAudio');
25
     this.audioCtx = wx.createAudioContext('myAudio');
26
+
27
+    if (options.type=="share"){
28
+      wx.setNavigationBarTitle({
29
+        title: "查看共享"
30
+      });
31
+    }
25
   },
32
   },
26
   onShow: function () {
33
   onShow: function () {
27
     var that = this;
34
     var that = this;
@@ -67,6 +74,12 @@ Page({
67
     if (!card.FontSize)
74
     if (!card.FontSize)
68
       card.FontSize = 46;
75
       card.FontSize = 46;
69
 
76
 
77
+    arrImage = card.Images;
78
+    arrImage2 = card.Images2;
79
+
80
+    console.log("arrImage:"+arrImage);
81
+    console.log("arrImage2"+arrImage2);
82
+
70
     this.setData({
83
     this.setData({
71
       ID: card.MiaoguoCardID,
84
       ID: card.MiaoguoCardID,
72
       Field: card.Field,
85
       Field: card.Field,
@@ -129,7 +142,7 @@ Page({
129
   copyCard: function () {
142
   copyCard: function () {
130
     wx.showLoading({
143
     wx.showLoading({
131
       title: '处理中',
144
       title: '处理中',
132
-    })
145
+    });
133
     var that = this;
146
     var that = this;
134
     var url = "CollectMiaoguoCard?";
147
     var url = "CollectMiaoguoCard?";
135
     url += "MiaoguoCardID=" + that.data.MiaoguoCardID;
148
     url += "MiaoguoCardID=" + that.data.MiaoguoCardID;
@@ -276,6 +289,26 @@ Page({
276
       });
289
       });
277
     }
290
     }
278
   },
291
   },
292
+  showImage:function(e){
293
+    var name = e.currentTarget.dataset.name;
294
+    wx.previewImage({
295
+      current: name,
296
+      urls: arrImage,
297
+    });
298
+  },
299
+  onBindError:function(e){
300
+    for(var i=1;i<this.data.Field.length;i++){
301
+      for(var j=0;j<this.data.Field[i].length;j++){
302
+        if (this.data.Field[i][j].Type=="image"){
303
+          this.data.Field[i][j].Url = this.data.Field[i][j].Content;
304
+        }
305
+      }
306
+    }
307
+    arrImage=arrImage2;
308
+    this.setData({
309
+      Field: this.data.Field,
310
+    });
311
+  },
279
   onShareAppMessage: function () {
312
   onShareAppMessage: function () {
280
     var that = this;
313
     var that = this;
281
     this.setData({
314
     this.setData({

+ 2 - 1
pages/main/preview.json

@@ -2,5 +2,6 @@
2
   "navigationBarBackgroundColor": "#ffffff",
2
   "navigationBarBackgroundColor": "#ffffff",
3
   "navigationBarTextStyle": "black",
3
   "navigationBarTextStyle": "black",
4
   "navigationBarTitleText": "预览",
4
   "navigationBarTitleText": "预览",
5
-  "backgroundColor": "#E3E3E3"
5
+  "backgroundColor": "#E3E3E3",
6
+  "backgroundColorTop":"#ffffff"
6
 }
7
 }

+ 30 - 28
pages/main/preview.wxml

@@ -9,8 +9,7 @@
9
         <view class="text3" bindtap='practiceToday'>今天练</view>
9
         <view class="text3" bindtap='practiceToday'>今天练</view>
10
       </view>
10
       </view>
11
     </view>
11
     </view>
12
-    <view class='lineFooter'></view>
13
-    <view style='height:120rpx'></view>
12
+    <view class="panelTop1"></view>
14
   </block>
13
   </block>
15
   <view class="panelField1 FlexColumn" bindlongpress='editField' data-id="1">
14
   <view class="panelField1 FlexColumn" bindlongpress='editField' data-id="1">
16
     <view class="panelField11 panelItem FlexRow" style="font-size:{{FontSize}}rpx;">
15
     <view class="panelField11 panelItem FlexRow" style="font-size:{{FontSize}}rpx;">
@@ -21,18 +20,21 @@
21
 
20
 
22
         <text class="textNormal FlexRow" wx:if="{{item.Type=='line'}}">
21
         <text class="textNormal FlexRow" wx:if="{{item.Type=='line'}}">
23
           <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem">
22
           <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem">
24
-            <text wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
25
-        <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
26
-      </block>
27
-      </text>
23
+              <text wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
24
+          <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
25
+        </block>
26
+        </text>
28
 
27
 
29
-      <view class="panelSound FlexRow" wx:if="{{item.Type=='sound'}}" bindtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="1">
30
-        <image class="universalpic_read_mark_black_20x20" src='../images/universalpic_read_mark_black_20x20.{{item.SoundImageName}}' />
31
-      </view>
28
+        <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}}' />
30
+        </view>
32
 
31
 
33
-      <text class="textPinyin" wx:if="{{item.Type=='sound'}}" catchtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="1">{{item.Content}}</text>
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>
34
 
33
 
35
-      <image class="imageBishun" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' />
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
+      
36
       </block>
38
       </block>
37
     </view>
39
     </view>
38
 
40
 
@@ -43,9 +45,7 @@
43
       <view class='tagDot'></view>
45
       <view class='tagDot'></view>
44
       <view class="tag" wx:for="{{Tags}}" wx:key="index">{{item}}</view>
46
       <view class="tag" wx:for="{{Tags}}" wx:key="index">{{item}}</view>
45
     </view>
47
     </view>
46
-
47
     <view wx:if="{{true}}"></view>
48
     <view wx:if="{{true}}"></view>
48
-
49
   </view>
49
   </view>
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}}">
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}}">
51
     <view wx:if="{{itemParent==3}}" class="lineField"></view>
51
     <view wx:if="{{itemParent==3}}" class="lineField"></view>
@@ -57,20 +57,22 @@
57
         <text class="textNormal" wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
57
         <text class="textNormal" wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
58
 
58
 
59
         <text class="textNormal FlexRow" wx:if="{{item.Type=='line'}}">
59
         <text class="textNormal FlexRow" wx:if="{{item.Type=='line'}}">
60
-          <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem">
61
-            <text wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
62
-        <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
63
-      </block>
64
-      </text>
65
-
66
-      <view class="panelSound FlexRow" wx:if="{{item.Type=='sound'}}" bindtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="{{itemParent}}">
67
-        <image class="universalpic_read_mark_black_20x20" src='../images/universalpic_read_mark_black_20x20.{{item.SoundImageName}}' />
68
-      </view>
69
-
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>
71
-
72
-      <image class="imageBishun" wx:if="{{item.Type=='image'}}" src='{{item.Content}}' />
73
-
60
+            <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem">
61
+              <text wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
62
+          <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
63
+        </block>
64
+        </text>
65
+
66
+        <view class="panelSound FlexRow" wx:if="{{item.Type=='sound'}}" bindtap="playSound" data-content="{{item.Content}}" data-soundmark="{{item.SoundMark}}" data-fieldid="{{itemParent}}">
67
+          <image class="universalpic_read_mark_black_20x20" src='../images/universalpic_read_mark_black_20x20.{{item.SoundImageName}}' />
68
+        </view>
69
+
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>
71
+
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" />
75
+      
74
       </block>
76
       </block>
75
     </view>
77
     </view>
76
   </view>
78
   </view>
@@ -81,7 +83,7 @@
81
 
83
 
82
   <view class='panelSave FlexRow' wx:if="{{ShowType=='share'}}">
84
   <view class='panelSave FlexRow' wx:if="{{ShowType=='share'}}">
83
     <view class='btn3' bindtap="close">首页</view>
85
     <view class='btn3' bindtap="close">首页</view>
84
-    <view class='btn31 btn3' bindtap="copyCard" wx:if="{{!IsExistCard}}">存入我的题卡</view>
86
+    <view class='btn31 btn3' bindtap="copyCard" wx:if="{{!IsExistCard}}">另存为我的题卡</view>
85
   </view>
87
   </view>
86
 
88
 
87
   <view class='panelSave FlexRow' wx:if="{{ShowType=='show'}}">
89
   <view class='panelSave FlexRow' wx:if="{{ShowType=='show'}}">

+ 14 - 1
pages/main/preview.wxss

@@ -14,6 +14,13 @@
14
   position: fixed;
14
   position: fixed;
15
   top:0;
15
   top:0;
16
   z-index: 10;
16
   z-index: 10;
17
+  border-bottom: 1rpx solid #d2d2d2;
18
+}
19
+
20
+.panelTop1{
21
+  width:100%;
22
+  height: 120rpx;
23
+  background-color: #fff;
17
 }
24
 }
18
 
25
 
19
 .left {
26
 .left {
@@ -101,6 +108,12 @@
101
   margin: 30rpx 0;
108
   margin: 30rpx 0;
102
 }
109
 }
103
 
110
 
111
+.panelItem .imageFree {
112
+  width: 650rpx;
113
+  margin: 30rpx 0;
114
+  border-radius: 20rpx;
115
+}
116
+
104
 .panelItem .textReturn {
117
 .panelItem .textReturn {
105
   width: 100%;
118
   width: 100%;
106
 }
119
 }
@@ -158,7 +171,7 @@
158
 .panelField21 {
171
 .panelField21 {
159
   width: 650rpx;
172
   width: 650rpx;
160
   font-size: 36rpx;
173
   font-size: 36rpx;
161
-  margin: 40rpx 30rpx 0 30rpx;
174
+  margin: 40rpx 0 0 0;
162
 }
175
 }
163
 
176
 
164
 .lineField{
177
 .lineField{

+ 0 - 1
pages/main/searchCard.wxml

@@ -5,7 +5,6 @@
5
       <view>搜索题卡</view>
5
       <view>搜索题卡</view>
6
     </view>
6
     </view>
7
   </view>
7
   </view>
8
-  <view class='lineFooter'></view>
9
   <view class='panelBtn FlexRow'>
8
   <view class='panelBtn FlexRow'>
10
     <view class='text1 FlexRow' bindtap="getList" data-id="0">
9
     <view class='text1 FlexRow' bindtap="getList" data-id="0">
11
       <view>全部题卡</view>
10
       <view>全部题卡</view>

+ 1 - 1
pages/main/searchCard1.wxss

@@ -25,7 +25,7 @@
25
 .universalpic_search_gray_30x30{
25
 .universalpic_search_gray_30x30{
26
   width:30rpx;
26
   width:30rpx;
27
   height:30rpx;
27
   height:30rpx;
28
-  margin: 0 10rpx 0 30rpx;
28
+  margin: 0 20rpx 0 30rpx;
29
 }
29
 }
30
 
30
 
31
 .input{
31
 .input{

+ 59 - 32
pages/main/searchCardList.js

@@ -10,15 +10,15 @@ Page({
10
     wx.hideShareMenu();
10
     wx.hideShareMenu();
11
     var that = this;
11
     var that = this;
12
 
12
 
13
-    var Search="",IsToday=0;
13
+    var Search = "", IsToday = 0;
14
 
14
 
15
     if (options.search) {
15
     if (options.search) {
16
-      Search=options.search;
16
+      Search = options.search;
17
       wx.setNavigationBarTitle({
17
       wx.setNavigationBarTitle({
18
         title: options.search
18
         title: options.search
19
       });
19
       });
20
-    } 
21
-    else if (options.type==1) {
20
+    }
21
+    else if (options.type == 1) {
22
       IsToday = 1;
22
       IsToday = 1;
23
       wx.setNavigationBarTitle({
23
       wx.setNavigationBarTitle({
24
         title: "今日的任务"
24
         title: "今日的任务"
@@ -28,61 +28,64 @@ Page({
28
     that.setData({
28
     that.setData({
29
       Search: Search,
29
       Search: Search,
30
       IsToday: IsToday,
30
       IsToday: IsToday,
31
-      Count:options.Count,
31
+      Count: options.Count,
32
       Containnerheight: main.getWindowHeight(),
32
       Containnerheight: main.getWindowHeight(),
33
     });
33
     });
34
   },
34
   },
35
-  onPullDownRefresh:function(){
36
-    var that = this;
37
-    that.getList();
38
-    wx.stopPullDownRefresh();
39
-  },
40
-  onShow:function(){
35
+  onShow: function () {
41
     var that = this;
36
     var that = this;
42
     that.getList();
37
     that.getList();
43
   },
38
   },
44
   getList: function () {
39
   getList: function () {
45
-    var list=wx.getStorageSync("CardList");
46
-    var len=20;
47
-    for(var i=0;i<list.length;i++){
48
-      var item=list[i];
40
+    var list = wx.getStorageSync("CardList");
41
+    var len = 20;
42
+    for (var i = 0; i < list.length; i++) {
43
+      var item = list[i];
49
       item.Content[1].ContentStr = replaceString(item.Content[1].Content);
44
       item.Content[1].ContentStr = replaceString(item.Content[1].Content);
50
       if (item.Content[1].ContentStr.length > len)
45
       if (item.Content[1].ContentStr.length > len)
51
         item.Content[1].ContentStr = replaceString(item.Content[1].ContentStr.substr(0, len)) + "...";
46
         item.Content[1].ContentStr = replaceString(item.Content[1].ContentStr.substr(0, len)) + "...";
52
-        
47
+
53
       item.Content[2].ContentStr = replaceString(item.Content[2].Content);
48
       item.Content[2].ContentStr = replaceString(item.Content[2].Content);
54
       if (item.Content[2].ContentStr.length > len)
49
       if (item.Content[2].ContentStr.length > len)
55
         item.Content[2].ContentStr = replaceString(item.Content[2].ContentStr.substr(0, len)) + "...";
50
         item.Content[2].ContentStr = replaceString(item.Content[2].ContentStr.substr(0, len)) + "...";
56
-      
51
+
57
       var imageUrl = getImage(item.Content[1].Content);
52
       var imageUrl = getImage(item.Content[1].Content);
58
-      if (!imageUrl && item.Content[2].Content)
53
+      if (imageUrl.length == 0 && item.Content[2].Content)
59
         imageUrl = getImage(item.Content[2].Content);
54
         imageUrl = getImage(item.Content[2].Content);
60
-      if (!imageUrl && item.Content[3].Content)
55
+      if (imageUrl.length == 0 && item.Content[3].Content)
61
         imageUrl = getImage(item.Content[3].Content);
56
         imageUrl = getImage(item.Content[3].Content);
62
 
57
 
63
-      if (imageUrl)
64
-        item.ImageUrl=imageUrl;
58
+      if (imageUrl.length > 0)
59
+        item.ImageUrl = imageUrl;
65
     }
60
     }
66
     this.setData({
61
     this.setData({
67
-      List:list,
62
+      List: list,
68
     });
63
     });
69
     wx.hideLoading();
64
     wx.hideLoading();
70
 
65
 
71
-    function getImage(str){
72
-      var result="";
73
-      if (str.indexOf("[图]")>=0){
74
-        result = str.substring(str.indexOf("[图]") + 3, str.indexOf("[/图]"));
66
+    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='") + 7, str.indexOf("]")-1));
74
+          str = str.substring(str.indexOf("]") + 1, str.indexOf("[/图]"));
75
+          result.push(str);
76
+        }
75
       }
77
       }
78
+      //console.log("images:"+result);
76
       return result;
79
       return result;
77
     }
80
     }
78
 
81
 
79
-    function replaceString(str){
82
+    function replaceString(str) {
80
       str = str.replace(/\[读]/g, "");
83
       str = str.replace(/\[读]/g, "");
81
       str = str.replace(/\[\/读\]/g, "");
84
       str = str.replace(/\[\/读\]/g, "");
82
       str = str.replace(/\[图]/g, "");
85
       str = str.replace(/\[图]/g, "");
83
       str = str.replace(/\[\/图\]/g, "");
86
       str = str.replace(/\[\/图\]/g, "");
84
 
87
 
85
-      var str2="";
88
+      var str2 = "";
86
       if (str.indexOf("[读") >= 0) {
89
       if (str.indexOf("[读") >= 0) {
87
         str2 = str.substr(str.indexOf("[读"));
90
         str2 = str.substr(str.indexOf("[读"));
88
         str2 = str2.substring(0, str2.indexOf("]") + 1);
91
         str2 = str2.substring(0, str2.indexOf("]") + 1);
@@ -93,6 +96,15 @@ Page({
93
         str2 = str2.substring(0, str2.indexOf("]") + 1);
96
         str2 = str2.substring(0, str2.indexOf("]") + 1);
94
       }
97
       }
95
       str = str.replace(str2, "");
98
       str = str.replace(str2, "");
99
+
100
+      var str3 = "";
101
+      if (str.indexOf("[图") >= 0) {
102
+        str3 = str.substr(str.indexOf("[图"));
103
+        str3 = str3.substring(0, str3.indexOf("]") + 1);
104
+      }
105
+      str = str.replace(str3, "");
106
+
107
+
96
       str = str.replace(/\[线]/g, "");
108
       str = str.replace(/\[线]/g, "");
97
       str = str.replace(/\[\/线\]/g, "");
109
       str = str.replace(/\[\/线\]/g, "");
98
       str = main.encryptUrl(str);
110
       str = main.encryptUrl(str);
@@ -102,16 +114,31 @@ Page({
102
   onPreview: function (e) {
114
   onPreview: function (e) {
103
     var id = e.currentTarget.dataset.id;
115
     var id = e.currentTarget.dataset.id;
104
     wx.navigateTo({
116
     wx.navigateTo({
105
-      url: './preview?type=show&id='+id,
117
+      url: './preview?type=show&id=' + id,
106
     })
118
     })
107
   },
119
   },
120
+  onBindError: function (e) {
121
+    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]);
128
+        }
129
+      }
130
+    }
131
+    this.setData({
132
+      List: this.data.List,
133
+    });
134
+  },
108
   gotoNextPage: function (e) {
135
   gotoNextPage: function (e) {
109
     wx.showLoading({
136
     wx.showLoading({
110
       title: '请稍候',
137
       title: '请稍候',
111
     });
138
     });
112
     var that = this;
139
     var that = this;
113
     var id = e.currentTarget.dataset.id;
140
     var id = e.currentTarget.dataset.id;
114
-    var url = 'GetMiaoguoCardList?UserID=' + app.globalData.userInfo.UserID+"&IsToday="+that.data.IsToday + "&PageID=" + id;
141
+    var url = 'GetMiaoguoCardList?UserID=' + app.globalData.userInfo.UserID + "&IsToday=" + that.data.IsToday + "&PageID=" + id;
115
     if (that.data.Search)
142
     if (that.data.Search)
116
       url += "&Key=" + that.data.Search;
143
       url += "&Key=" + that.data.Search;
117
 
144
 
@@ -119,7 +146,7 @@ Page({
119
       if (data) {
146
       if (data) {
120
 
147
 
121
         var list = wx.getStorageSync("CardList");
148
         var list = wx.getStorageSync("CardList");
122
-        for(var i=0;i<data.List.length;i++){
149
+        for (var i = 0; i < data.List.length; i++) {
123
           list.push(data.List[i]);
150
           list.push(data.List[i]);
124
         }
151
         }
125
         wx.setStorageSync("CardList", list);
152
         wx.setStorageSync("CardList", list);
@@ -127,7 +154,7 @@ Page({
127
       }
154
       }
128
     });
155
     });
129
   },
156
   },
130
-  addCard:function(){
157
+  addCard: function () {
131
     wx.redirectTo({
158
     wx.redirectTo({
132
       url: './add?type=add&id=0',
159
       url: './add?type=add&id=0',
133
     });
160
     });

+ 1 - 2
pages/main/searchCardList.json

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

+ 2 - 3
pages/main/searchCardList.wxml

@@ -5,16 +5,15 @@
5
       <image class="universalpic_add_gray_30x30" src='../images/universalpic_add_gray_30x30.png' />
5
       <image class="universalpic_add_gray_30x30" src='../images/universalpic_add_gray_30x30.png' />
6
     </view>
6
     </view>
7
   </view>
7
   </view>
8
-  <view class='lineFooter'></view>
9
   <block wx:if="{{List.length>0}}">
8
   <block wx:if="{{List.length>0}}">
10
-    <view style='width:100%;height:150rpx;'></view>
9
+    <view style='width:100%;height:150rpx;margin-top:0rpx;'></view>
11
     <block wx:for="{{List}}" wx:key="index">
10
     <block wx:for="{{List}}" wx:key="index">
12
       <view class="lineWidthAll FlexRow" wx:if="{{index>0}}">
11
       <view class="lineWidthAll FlexRow" wx:if="{{index>0}}">
13
         <view class="lineWidth720"></view>
12
         <view class="lineWidth720"></view>
14
       </view>
13
       </view>
15
       <view class="panelItem FlexRow" bindtap='onPreview' data-id="{{item.MiaoguoCardID}}">
14
       <view class="panelItem FlexRow" bindtap='onPreview' data-id="{{item.MiaoguoCardID}}">
16
         <view class="panelItem1 FlexRow">
15
         <view class="panelItem1 FlexRow">
17
-          <image class="ImageCSS" src='{{item.ImageUrl}}' wx:if="{{item.ImageUrl}}" />
16
+          <image class="ImageCSS" mode="aspectFill" src='{{item.ImageUrl[0]}}' wx:if="{{item.ImageUrl[0]}}" binderror="onBindError" data-id="{{item.MiaoguoCardID}}" />
18
           <view class="panelItem11 FlexColumn">
17
           <view class="panelItem11 FlexColumn">
19
             <view class='Text1'>{{item.Content[1].ContentStr}}</view>
18
             <view class='Text1'>{{item.Content[1].ContentStr}}</view>
20
             <view class='Text2'>{{item.Content[2].ContentStr}}</view>
19
             <view class='Text2'>{{item.Content[2].ContentStr}}</view>

+ 1 - 0
pages/main/searchCardList.wxss

@@ -15,6 +15,7 @@
15
   position: fixed;
15
   position: fixed;
16
   top:0;
16
   top:0;
17
   z-index: 10;
17
   z-index: 10;
18
+  border-bottom: 1rpx solid #d2d2d2;
18
 }
19
 }
19
 
20
 
20
 .left{
21
 .left{

+ 4 - 2
pages/main/setting.js

@@ -4,13 +4,15 @@ 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 = ["程杰", "程晟涵", "洪立人"];
8
-var arrUserID = [1, 2, 3];
7
+var arrUserName = ["程杰", "程晟涵", "洪立人", "唱意班主任"];
8
+var arrUserID = [1, 2, 3, 4];
9
 
9
 
10
 Page({
10
 Page({
11
   data: {
11
   data: {
12
     CardNumber: [],
12
     CardNumber: [],
13
     IsShowChange: false,
13
     IsShowChange: false,
14
+    ProgramName: app.globalData.ProgramName,
15
+    Version:app.globalData.Version,
14
   },
16
   },
15
   onLoad: function () {
17
   onLoad: function () {
16
     wx.hideShareMenu();
18
     wx.hideShareMenu();

+ 3 - 1
pages/main/setting.wxml

@@ -75,5 +75,7 @@
75
     <view class='lineFooter'></view>
75
     <view class='lineFooter'></view>
76
   </block>
76
   </block>
77
 
77
 
78
-  <view style='height:350rpx'></view>
78
+  <view style='height:100rpx'></view>
79
+  <text class='text1' bindtap='updateMember'>©2019 {{ProgramName}}\n微信小程序 版本 {{Version}}</text>
80
+  <view style='height:100rpx;'></view>
79
 </view>
81
 </view>

+ 7 - 0
pages/main/setting.wxss

@@ -52,4 +52,11 @@
52
   width:16rpx;
52
   width:16rpx;
53
   height:26rpx;
53
   height:26rpx;
54
   margin-left: 30rpx;
54
   margin-left: 30rpx;
55
+}
56
+
57
+
58
+.text1{
59
+  margin-top: 50rpx;
60
+  font-size:20rpx;
61
+  text-align: center;
55
 }
62
 }

+ 39 - 0
pages/main/uploadinmage.js

@@ -0,0 +1,39 @@
1
+import common from '../../utils/util';
2
+import main from '../../utils/main';
3
+
4
+const app = getApp();
5
+
6
+Page({
7
+  data: {
8
+  },
9
+  onLoad: function () {
10
+    wx.hideShareMenu();
11
+    var that = this;
12
+    that.setData({
13
+      Containnerheight: main.getWindowHeight(),
14
+    });
15
+  },
16
+  upload:function(){
17
+    wx.chooseImage({
18
+      count: 1,
19
+      sizeType: ['original', 'compressed'],
20
+      sourceType: ['album', 'camera'],
21
+      success(res) {
22
+        // tempFilePath可以作为img标签的src属性显示图片
23
+        const tempFilePaths = res.tempFilePaths;
24
+        var url = common.Encrypt("MiaoguoUploadFile");
25
+        wx.uploadFile({
26
+          url: app.globalData.serverUrlLocalhost +url, // 仅为示例,非真实的接口地址
27
+          filePath: tempFilePaths[0],
28
+          name: 'file',
29
+          formData: {
30
+            filename: 'test'
31
+          },
32
+          success(res) {
33
+            
34
+          }
35
+        })
36
+      }
37
+    });
38
+  },
39
+});

+ 3 - 0
pages/main/uploadinmage.json

@@ -0,0 +1,3 @@
1
+{
2
+  "usingComponents": {}
3
+}

+ 2 - 0
pages/main/uploadinmage.wxml

@@ -0,0 +1,2 @@
1
+<!--pages/main/uploadinmage.wxml-->
2
+<button bindtap='upload'>上传图片</button>

+ 1 - 0
pages/main/uploadinmage.wxss

@@ -0,0 +1 @@
1
+/* pages/main/uploadinmage.wxss */

+ 4 - 4
project.config.json

@@ -37,7 +37,7 @@
37
 			"list": []
37
 			"list": []
38
 		},
38
 		},
39
 		"miniprogram": {
39
 		"miniprogram": {
40
-			"current": 0,
40
+			"current": 1,
41
 			"list": [
41
 			"list": [
42
 				{
42
 				{
43
 					"id": 0,
43
 					"id": 0,
@@ -47,9 +47,9 @@
47
 					"scene": null
47
 					"scene": null
48
 				},
48
 				},
49
 				{
49
 				{
50
-					"id": -1,
51
-					"name": "帮助",
52
-					"pathName": "pages/main/searchWeb2",
50
+					"id": 1,
51
+					"name": "上传",
52
+					"pathName": "pages/main/uploadinmage",
53
 					"query": "",
53
 					"query": "",
54
 					"scene": null
54
 					"scene": null
55
 				}
55
 				}

+ 21 - 34
utils/main.js

@@ -145,37 +145,6 @@ function payMoney(payType, money, callback) {
145
     }
145
     }
146
   });
146
   });
147
 }
147
 }
148
-function downloadImage(scoreID) {
149
-  wx.showLoading({
150
-    title: '下载中_然后长按保存',
151
-  });
152
-
153
-  var that = this;
154
-  getData('MakeSchulteShare?ScoreID=' + scoreID, function (data) {
155
-
156
-    setTimeout(function () {
157
-      wx.downloadFile({
158
-        url: "https://schulte-1253256735.file.myqcloud.com/share" + scoreID + ".jpg",
159
-        success: function (res) {
160
-          wx.hideLoading();
161
-          wx.previewImage({
162
-            current: res.tempFilePath, // 当前显示图片的http链接
163
-            urls: [res.tempFilePath] // 需要预览的图片http链接列表
164
-          })
165
-        },
166
-        fail: function () {
167
-          wx.hideLoading();
168
-          getData('MakeSchulteShare?ScoreID=' + scoreID, function (data) { });
169
-          wx.showToast({
170
-            title: '请稍候再试!',
171
-            duration: 2000
172
-          });
173
-        }
174
-      });
175
-    }, 2000);
176
-
177
-  });
178
-}
179
 
148
 
180
 function getTimeFormat(duration) {
149
 function getTimeFormat(duration) {
181
   //console.log("duration:" + duration);
150
   //console.log("duration:" + duration);
@@ -309,6 +278,8 @@ function EncryptUrl(str) {
309
     str = str.replace(/baidu.com/g, "#####1#####");
278
     str = str.replace(/baidu.com/g, "#####1#####");
310
     str = str.replace(/iciba.com/g, "#####2#####");
279
     str = str.replace(/iciba.com/g, "#####2#####");
311
     str = str.replace(/kylx365.com/g, "#####3#####");
280
     str = str.replace(/kylx365.com/g, "#####3#####");
281
+    str = str.replace(/miaguo-1253256735.file.myqcloud.com/g, "#####4#####");
282
+
312
   }
283
   }
313
 
284
 
314
   if (str.substr(0,1)=="\n")
285
   if (str.substr(0,1)=="\n")
@@ -326,6 +297,7 @@ function DecryptUrl(str) {
326
     str = str.replace(/#####1#####/g, "baidu.com");
297
     str = str.replace(/#####1#####/g, "baidu.com");
327
     str = str.replace(/#####2#####/g, "iciba.com");
298
     str = str.replace(/#####2#####/g, "iciba.com");
328
     str = str.replace(/#####3#####/g, "kylx365.com");
299
     str = str.replace(/#####3#####/g, "kylx365.com");
300
+    str = str.replace(/#####4#####/g, "miaguo-1253256735.file.myqcloud.com");
329
   }
301
   }
330
   return str;
302
   return str;
331
 }
303
 }
@@ -333,6 +305,9 @@ function DecryptUrl(str) {
333
 function changeStringToView(field) {
305
 function changeStringToView(field) {
334
   var result = {};
306
   var result = {};
335
   result.Field = [[]];
307
   result.Field = [[]];
308
+  result.Images = [];
309
+  result.Images2 = [];
310
+
336
   for (var j = 0; j < field.length; j++) {
311
   for (var j = 0; j < field.length; j++) {
337
     if (j == 0) {
312
     if (j == 0) {
338
       if (field[j].ContentType == 0 && field[j].Content && field[j].Content.length > 0) {
313
       if (field[j].ContentType == 0 && field[j].Content && field[j].Content.length > 0) {
@@ -358,11 +333,24 @@ function changeStringToView(field) {
358
 
333
 
359
         var arr = str.split("\n");
334
         var arr = str.split("\n");
360
         for (var k = 0; k < arr.length; k++) {
335
         for (var k = 0; k < arr.length; k++) {
361
-          if (arr[k].indexOf("[图]") >= 0 && arr[k].indexOf("[/图]") > 0) {
336
+          if (arr[k].indexOf("[图") >= 0 && arr[k].indexOf("[/图]") > 0) {
362
             var obj = {};
337
             var obj = {};
363
             obj.Type = "image";
338
             obj.Type = "image";
364
-            obj.Content = arr[k].substring(arr[k].indexOf("[图]") + 3, arr[k].indexOf("[/图]"));
339
+            if (arr[k].indexOf("[图]") >= 0){
340
+              obj.Content = arr[k].substring(arr[k].indexOf("[图]") + 3, arr[k].indexOf("[/图]"));
341
+              result.Images.push(obj.Content);
342
+              result.Images2.push(obj.Content);
343
+            }
344
+            else {
345
+              var temp = arr[k].substring(arr[k].indexOf("[图"), arr[k].indexOf("[/图]"));
346
+              obj.Url = temp.substring(temp.indexOf("url=") + 5, temp.indexOf("]") - 1);
347
+              temp=temp.substr(temp.indexOf("]")+1);
348
+              obj.Content=temp;
349
+              result.Images.push(obj.Url);
350
+              result.Images2.push(obj.Content);
351
+            }
365
             arrResult.push(obj);
352
             arrResult.push(obj);
353
+
366
           }
354
           }
367
           else if (arr[k].indexOf("[线]") >= 0 && arr[k].indexOf("[/线]") > 0) {
355
           else if (arr[k].indexOf("[线]") >= 0 && arr[k].indexOf("[/线]") > 0) {
368
             var obj;
356
             var obj;
@@ -2096,7 +2084,6 @@ module.exports = {
2096
   postData: postData,
2084
   postData: postData,
2097
   shareGroup: shareGroup,
2085
   shareGroup: shareGroup,
2098
   payMoney: payMoney,
2086
   payMoney: payMoney,
2099
-  downloadImage: downloadImage,
2100
   getLocalHost: getLocalHost,
2087
   getLocalHost: getLocalHost,
2101
   getTimeFormat: getTimeFormat,
2088
   getTimeFormat: getTimeFormat,
2102
   getWindowHeight: getWindowHeight,
2089
   getWindowHeight: getWindowHeight,