chengjie il y a 6 ans
Parent
commit
050ad7f41e

+ 1 - 1
app.js

@@ -25,7 +25,7 @@ App({
25 25
     }
26 26
   },
27 27
   globalData: {
28
-    Version: "1.0.0.18",
28
+    Version: "1.0.0.19",
29 29
     IsProduction: true,
30 30
     ShareTitle: "可以用来记忆一切的工具",
31 31
     SharePath: "pages/index/index",

+ 24 - 19
pages/index/index.js

@@ -58,7 +58,7 @@ Page({
58 58
         });
59 59
       }
60 60
 
61
-      if (options.Share==1) {
61
+      if (options.Share == 1) {
62 62
         this.setData({
63 63
           MiaoguoCardID: options.MiaoguoCardID,
64 64
         });
@@ -66,7 +66,7 @@ Page({
66 66
     }
67 67
     this.setData({
68 68
       Containnerheight: main.getWindowHeight(),
69
-      Sentence: arrSentence[common.random(0,arrSentence.length-1)],
69
+      Sentence: arrSentence[common.random(0, arrSentence.length - 1)],
70 70
     });
71 71
 
72 72
     this.updateProgram();
@@ -190,32 +190,37 @@ Page({
190 190
           //   url: url,
191 191
           // });
192 192
 
193
-          var url = '../main/default?IsStart=1';
194 193
 
195
-          if (that.data.MiaoguoCardID){
196
-            url += "&Share=1&MiaoguoCardID=" + that.data.MiaoguoCardID;
194
+          if (that.data.MiaoguoCardID) {
195
+            wx.reLaunch({
196
+              url: '../main/preview?type=share&id=' + that.data.MiaoguoCardID,
197
+            });
197 198
           }
199
+          else {
200
+            var url = '../main/default?IsStart=1';
198 201
 
199
-          setTimeout(function () {
200
-            wx.redirectTo({
201
-              url: url,
202
-            });
203
-          }, 2000);
202
+            setTimeout(function () {
203
+              wx.redirectTo({
204
+                url: url,
205
+              });
206
+            }, 2000);
204 207
 
208
+            that.getTaskTodayList();
209
+          }
205 210
           that.getBaiduToken();
206
-          that.getTaskTodayList();
211
+
207 212
         }
208 213
       });
209 214
 
210 215
     });
211 216
   },
212 217
   getBaiduToken: function () {
213
-      main.getData('GetBaiduToken', function (data) {
214
-        if (data) {
215
-          app.globalData.BaiduToken = data;
216
-          //console.log(app.globalData.BaiduToken);
217
-        }
218
-      });
218
+    main.getData('GetBaiduToken', function (data) {
219
+      if (data) {
220
+        app.globalData.BaiduToken = data;
221
+        //console.log(app.globalData.BaiduToken);
222
+      }
223
+    });
219 224
   },
220 225
   //得到当天任务
221 226
   getTaskTodayList: function () {
@@ -238,8 +243,8 @@ Page({
238 243
                 IsStart: data.IsStart,
239 244
               });
240 245
 
241
-              app.globalData.TaskToday=data;
242
-              app.globalData.CardList=[];
246
+              app.globalData.TaskToday = data;
247
+              app.globalData.CardList = [];
243 248
             }
244 249
           });
245 250
         });

+ 7 - 7
pages/main/detail.wxml

@@ -42,11 +42,11 @@
42 42
         <block wx:for="{{TaskInfo.ContentNew.Field[1]}}" wx:key="index">
43 43
           <text class="textReturn" wx:if="{{index>0 && item.Type=='return'}}"></text>
44 44
 
45
-          <text class="textNormal" wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
45
+          <text class="textNormal" space='nbsp' wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
46 46
 
47
-          <text class="textNormal FlexRow" wx:if="{{item.Type=='line'}}">
47
+          <text class="textNormal FlexRow" space='nbsp' wx:if="{{item.Type=='line'}}">
48 48
             <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem">
49
-              <text wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
49
+              <text space='nbsp' wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
50 50
           <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
51 51
         </block>
52 52
         </text>
@@ -88,11 +88,11 @@
88 88
         <block wx:for="{{TaskInfo.ContentNew.Field[itemParent]}}" wx:key="index">
89 89
           <text class="textReturn" wx:if="{{index>0 && item.Type=='return'}}"></text>
90 90
 
91
-          <text class="textNormal2 textNormal" wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
91
+          <text class="textNormal2 textNormal" space='nbsp' wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
92 92
 
93
-          <text class="textNormal2 FlexRow" wx:if="{{item.Type=='line'}}">
93
+          <text class="textNormal2 FlexRow" space='nbsp' wx:if="{{item.Type=='line'}}">
94 94
             <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem">
95
-              <text wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
95
+              <text space='nbsp' wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
96 96
           <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
97 97
         </block>
98 98
         </text>
@@ -170,7 +170,7 @@
170 170
 <view wx:if="{{IsShowNumberInfo}}" catchtap='closeNumberContainner' class="numberContainer container FlexColumn" style='height:{{Containnerheight}}rpx;'>
171 171
   <view class='numberContainer1 FlexColumn'>
172 172
     <view class="numberContainer11 FlexRow">
173
-      <view class='left'>今天剩余{{NumberNew+NumberReview+NumberHistory}}张</view>
173
+      <view class='left'>今日剩余任务量{{NumberNew+NumberReview+NumberHistory}}张,包括:</view>
174 174
       <view></view>
175 175
     </view>
176 176
     <view class="numberContainer12 FlexRow">

+ 28 - 25
pages/main/preview.js

@@ -39,7 +39,7 @@ Page({
39 39
         var url = "GetMiaoguoCardInfo?UserID=" + app.globalData.introducer + "&MiaoguoCardID=" + that.data.MiaoguoCardID;
40 40
         main.getData(url, function (data) {
41 41
           if (data) {
42
-            app.globalData.CardList=[data];
42
+            app.globalData.CardList = [data];
43 43
             that.init();
44 44
           }
45 45
         });
@@ -52,7 +52,7 @@ Page({
52 52
     clearInterval(intervalSound);
53 53
   },
54 54
   init: function () {
55
-    var that=this;
55
+    var that = this;
56 56
     var list = app.globalData.CardList;
57 57
     var card = {};
58 58
     var prevId = 0;
@@ -86,28 +86,26 @@ Page({
86 86
 
87 87
     var isTodayPractice = true;
88 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;
89
+    if (task && (task.ListNew.length > 0 || task.ListHistory.length>0 || task.ListReview.length>0)) {
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
+        }
94 95
       }
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;
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
+        }
100 101
       }
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;
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
+        }
106 107
       }
107 108
     }
108
-
109
-
110
-
111 109
     this.setData({
112 110
       ID: card.MiaoguoCardID,
113 111
       Field: card.Field,
@@ -145,7 +143,7 @@ Page({
145 143
                 break;
146 144
               }
147 145
             }
148
-            app.globalData.CardList=list;
146
+            app.globalData.CardList = list;
149 147
             wx.showToast({
150 148
               title: '改为今天练',
151 149
               icon: 'none',
@@ -188,7 +186,7 @@ Page({
188 186
                 break;
189 187
               }
190 188
             }
191
-            app.globalData.CardList=list;
189
+            app.globalData.CardList = list;
192 190
             wx.showToast({
193 191
               title: '改为明天练',
194 192
               icon: 'none',
@@ -348,11 +346,11 @@ Page({
348 346
                 break;
349 347
               }
350 348
             }
351
-            app.globalData.CardList=list;
349
+            app.globalData.CardList = list;
352 350
 
353 351
             var taskToday = app.globalData.TaskToday;
354 352
             taskToday.CardNumber--;
355
-            app.globalData.TaskToday=taskToday;
353
+            app.globalData.TaskToday = taskToday;
356 354
 
357 355
             wx.navigateBack({
358 356
               delta: 1,
@@ -417,10 +415,15 @@ Page({
417 415
       that.init();
418 416
     }, 1000);
419 417
   },
418
+  returnDefault: function () {
419
+    wx.reLaunch({
420
+      url: './default?IsStart=1',
421
+    });
422
+  },
420 423
   onShareAppMessage: function () {
421 424
     var that = this;
422 425
     this.setData({
423
-      ShowType: 'preview'
426
+      ShowType: 'sharepreview'
424 427
     });
425 428
     setTimeout(function () {
426 429
       that.setData({

+ 8 - 8
pages/main/preview.wxml

@@ -12,14 +12,14 @@
12 12
     </view>
13 13
     <view class="panelTop1"></view>
14 14
   </block>
15
-  <view class="panelField1 FlexColumn" bindlongpress='editField' data-id="1">
15
+  <view class="panelField{{ShowType}} panelField1 FlexColumn" bindlongpress='editField' data-id="1">
16 16
     <view class="panelField11 panelItem FlexRow" style="font-size:{{FontSize}}rpx;">
17 17
       <block wx:for="{{Field[1]}}" wx:key="index">
18 18
         <text class="textReturn" wx:if="{{index>0 && item.Type=='return'}}"></text>
19
-        <text class="textNormal" wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
20
-        <text class="textNormal FlexRow" wx:if="{{item.Type=='line'}}">
19
+        <text class="textNormal" space='nbsp' wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
20
+        <text class="textNormal FlexRow" space='nbsp' wx:if="{{item.Type=='line'}}">
21 21
           <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem">
22
-              <text wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
22
+              <text space='nbsp' wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
23 23
           <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
24 24
         </block>
25 25
         </text>
@@ -47,11 +47,11 @@
47 47
       <block wx:for="{{Field[itemParent]}}" wx:key="index">
48 48
         <text class="textReturn" wx:if="{{index>0 && item.Type=='return'}}"></text>
49 49
 
50
-        <text class="textNormal" wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
50
+        <text class="textNormal" space='nbsp' wx:if="{{item.Type=='normal'}}">{{item.Content}}</text>
51 51
 
52
-        <text class="textNormal FlexRow" wx:if="{{item.Type=='line'}}">
52
+        <text class="textNormal FlexRow" space='nbsp' wx:if="{{item.Type=='line'}}">
53 53
             <block wx:for="{{item.Content}}" wx:key="contentIndex" wx:for-item="contentItem">
54
-              <text wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
54
+              <text space='nbsp' wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
55 55
           <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
56 56
         </block>
57 57
         </text>
@@ -75,7 +75,7 @@
75 75
   <view class='panelSave' bindtap="close" wx:if="{{ShowType=='preview'}}">关闭</view>
76 76
 
77 77
   <view class='panelSave FlexRow' wx:if="{{ShowType=='share'}}">
78
-    <view class='btn3' bindtap="close">首页</view>
78
+    <view class='btn3' bindtap="returnDefault">首页</view>
79 79
     <view class='btn31 btn3' bindtap="copyCard" wx:if="{{!IsExistCard}}">另存为我的题卡</view>
80 80
   </view>
81 81
 

+ 6 - 2
pages/main/preview.wxss

@@ -50,7 +50,7 @@
50 50
 }
51 51
 
52 52
 .text4 {
53
-  color: #1e1e1e;
53
+  color: #A20602;
54 54
 }
55 55
 
56 56
 .panelItem {
@@ -69,7 +69,11 @@
69 69
   border-bottom-left-radius: 50rpx;
70 70
   border-bottom-right-radius: 50rpx;
71 71
 }
72
-
72
+.panelFieldsharepreview{
73
+  min-height: 0rpx;
74
+  border-bottom-left-radius: 0;
75
+  border-bottom-right-radius: 0;
76
+}
73 77
 .panelField11 {
74 78
   font-size: 46rpx;
75 79
   justify-content: flex-start;

+ 2 - 2
pages/main/setting.js

@@ -4,8 +4,8 @@ import main from '../../utils/main';
4 4
 const app = getApp();
5 5
 const arrSortType = ["时间较早的题卡", "时间较近的题卡"];
6 6
 const arrSortType2 = ["较早的", "较近的"];
7
-var arrUserName = ["程杰", "程晟涵", "大耳兔", "teresa", "古利古拉", "Lucy-chan"];
8
-var arrUserID = [1, 2, 11, 8, 9, 10];
7
+var arrUserName = ["程晟涵", "大耳兔", "teresa", "古利古拉", "Lucy-chan","刘华润"];
8
+var arrUserID = [2, 11, 8, 9, 10,12];
9 9
 
10 10
 Page({
11 11
   data: {

+ 1 - 1
pages/main/setting.wxml

@@ -1,6 +1,6 @@
1 1
 <view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
2 2
   <view class="panelTitle FlexRow">
3
-    <view class="panelTitle1">任务量</view>
3
+    <view class="panelTitle1">初始任务量</view>
4 4
     <view class="panelTitle2">每天{{CardMaxNumberNew+CardMaxNumberHistory}}张题卡</view>
5 5
   </view>
6 6
   <view class="panelItem FlexRow">

+ 2 - 2
project.config.json

@@ -37,13 +37,13 @@
37 37
 			"list": []
38 38
 		},
39 39
 		"miniprogram": {
40
-			"current": 1,
40
+			"current": 0,
41 41
 			"list": [
42 42
 				{
43 43
 					"id": 0,
44 44
 					"name": "分享",
45 45
 					"pathName": "pages/index/index",
46
-					"query": "UserID=1&Share=1&MiaoguoCardID=4024",
46
+					"query": "UserID=1&Share=1&MiaoguoCardID=4769",
47 47
 					"scene": null
48 48
 				},
49 49
 				{