chengjie лет назад: 7
Родитель
Сommit
b4e950a8e9

+ 1 - 0
pages/main/answer.js

@@ -8,6 +8,7 @@ Page({
8
     FileUrl: app.globalData.fileUrl,
8
     FileUrl: app.globalData.fileUrl,
9
     IsEdit: false,
9
     IsEdit: false,
10
     ListHeight: 1320,
10
     ListHeight: 1320,
11
+    ListHeight2: 1490,
11
     SelectedCount: 0,
12
     SelectedCount: 0,
12
   },
13
   },
13
   onLoad: function () {
14
   onLoad: function () {

+ 2 - 2
pages/main/answer.wxml

@@ -47,7 +47,7 @@
47
     <view class="line21 line2"></view>
47
     <view class="line21 line2"></view>
48
 
48
 
49
     <!-- 列表 -->
49
     <!-- 列表 -->
50
-     <view class="panel0MainBG panel0Main" style='min-height:{{ListHeight}}rpx;'>
50
+    <view class="panel0MainBG panel0Main" style='min-height:{{ListHeight2}}rpx;'>
51
       <view class="line2"></view>
51
       <view class="line2"></view>
52
       <view class="item FlexColumn" wx:for="{{AnswerList}}" wx:key="index" bindtap='selectItem' data-id='{{item.AnswerID}}'>
52
       <view class="item FlexColumn" wx:for="{{AnswerList}}" wx:key="index" bindtap='selectItem' data-id='{{item.AnswerID}}'>
53
         <view class="itemLine00 itemLine0"></view>
53
         <view class="itemLine00 itemLine0"></view>
@@ -76,6 +76,6 @@
76
 
76
 
77
         </view>
77
         </view>
78
       </view>
78
       </view>
79
-    </view> 
79
+    </view>
80
   </view>
80
   </view>
81
 </view>
81
 </view>

+ 80 - 62
pages/main/detail.js

@@ -5,8 +5,10 @@ const app = getApp();
5
 var times = 1;
5
 var times = 1;
6
 var pageIndex = 0;
6
 var pageIndex = 0;
7
 var QuestionItem = [];
7
 var QuestionItem = [];
8
+var tempAnswerList=[];
9
+var arrAnswerID=[];
8
 var isAndroid = false;
10
 var isAndroid = false;
9
-const waitTime = ["", "10秒钟", "15秒钟", "20秒钟", "25秒钟", "半分钟", "35秒钟", "40秒钟", "45秒钟"];
11
+const waitTime = ["", "10秒钟", "15秒钟", "20秒钟", "25秒钟"];
10
 
12
 
11
 Page({
13
 Page({
12
   data: {
14
   data: {
@@ -20,6 +22,7 @@ Page({
20
     IsFinished: false,
22
     IsFinished: false,
21
     arrPage: [],
23
     arrPage: [],
22
     ShowLoading: false,
24
     ShowLoading: false,
25
+    IsDistabled: "",
23
   },
26
   },
24
   onLoad: function (options) {
27
   onLoad: function (options) {
25
     var id = options.id;
28
     var id = options.id;
@@ -61,9 +64,8 @@ Page({
61
     });
64
     });
62
   },
65
   },
63
   getFinish: function () {
66
   getFinish: function () {
64
-    this.setData({
65
-      IsFinished: true,
66
-    });
67
+    arrAnswerID = [];
68
+    this.getAnswerID();
67
     this.getList(this.data.ID);
69
     this.getList(this.data.ID);
68
   },
70
   },
69
 
71
 
@@ -80,7 +82,9 @@ Page({
80
       if (data) {
82
       if (data) {
81
         that.setData({
83
         that.setData({
82
           ShowLoading: true,
84
           ShowLoading: true,
85
+          IsFinished: true,
83
           arrPage: [],
86
           arrPage: [],
87
+          IsDistabled: "",
84
           WaitTime: waitTime[that.data.PageNumber],
88
           WaitTime: waitTime[that.data.PageNumber],
85
         });
89
         });
86
 
90
 
@@ -109,41 +113,22 @@ Page({
109
     });
113
     });
110
 
114
 
111
   },
115
   },
112
-  saveLocalData: function (data) {
116
+  getAnswerID: function () {
113
     var list = wx.getStorageSync("AnswerList");
117
     var list = wx.getStorageSync("AnswerList");
118
+    var id=1;
114
     if (list && list.length > 0) {
119
     if (list && list.length > 0) {
115
       list.sort(function (a, b) {
120
       list.sort(function (a, b) {
116
-        if (a.CreateTime == b.CreateTime) {
117
           return b.AnswerID - b.AnswerID;
121
           return b.AnswerID - b.AnswerID;
118
-        } else {
119
-          return b.CreateTime > a.CreateTime;
120
-        }
121
       });
122
       });
122
-      var id = list[0].AnswerID + 1;
123
-      if (list.length >= 100) {
124
-        id = list[list.length-1].AnswerID;
125
-      }
126
-      for (var i = 0; i < list.length; i++) {
127
-        if (list[i].AnswerID == id) {
128
-          list.splice(i, 1);
129
-        }
130
-      }
131
-      data.AnswerID = id;
132
-      list.unshift(data);
133
-    }
134
-    else {
135
-      data.AnswerID = 1;
136
-      list = [];
137
-      list.push(data);
123
+      id = list[0].AnswerID + 1;
138
     }
124
     }
139
-    
140
-    wx.setStorageSync("AnswerList", list);
141
-    return data;
125
+    for (var i = 0; i < this.data.PageNumber;i++)
126
+      arrAnswerID.push(id+i);
142
   },
127
   },
143
   saveImage: function () {
128
   saveImage: function () {
144
     var that = this;
129
     var that = this;
145
     var item = QuestionItem;
130
     var item = QuestionItem;
146
-    item = that.saveLocalData(item);
131
+    item.AnswerID = arrAnswerID.pop();
147
 
132
 
148
     var ctx = wx.createCanvasContext("Canvas", that);
133
     var ctx = wx.createCanvasContext("Canvas", that);
149
     ctx.setFillStyle('white');
134
     ctx.setFillStyle('white');
@@ -197,7 +182,7 @@ Page({
197
     }
182
     }
198
 
183
 
199
     //算式
184
     //算式
200
-    index = that.data.arrPage.length*item.PageCount;
185
+    index = that.data.arrPage.length * item.PageCount;
201
     ctx.setFontSize(24);
186
     ctx.setFontSize(24);
202
     for (var i = 0; i < 3; i++) {
187
     for (var i = 0; i < 3; i++) {
203
       for (var j = 0; j < item.PageCount / 3; j++) {
188
       for (var j = 0; j < item.PageCount / 3; j++) {
@@ -335,8 +320,6 @@ Page({
335
     ctx.draw(true, function (n) {
320
     ctx.draw(true, function (n) {
336
       var w = 1050,
321
       var w = 1050,
337
         h = 1485;
322
         h = 1485;
338
-
339
-
340
       wx.canvasToTempFilePath({
323
       wx.canvasToTempFilePath({
341
         x: 0,
324
         x: 0,
342
         y: 0,
325
         y: 0,
@@ -347,37 +330,32 @@ Page({
347
         canvasId: 'Canvas',
330
         canvasId: 'Canvas',
348
         success: function (res2) {
331
         success: function (res2) {
349
           console.log(res2.tempFilePath);
332
           console.log(res2.tempFilePath);
333
+          that.data.arrPage.push(res2.tempFilePath);
350
 
334
 
351
-          wx.saveImageToPhotosAlbum({
352
-            filePath: res2.tempFilePath,
353
-            success(res3) {
354
-              console.log("save:" + res3.savedFilePath);
355
-              that.data.arrPage.push(res2.tempFilePath);
335
+          tempAnswerList.push(item);
356
 
336
 
357
-              that.setData({
358
-                arrPage: that.data.arrPage,
359
-              });
360
-
361
-              if (that.data.arrPage.length < that.data.PageNumber) {
362
-                pageIndex++;
363
-                that.saveImage();
364
-              } else {
365
-                that.setData({
366
-                  ShowLoading: false,
367
-                });
368
-
369
-                wx.previewImage({
370
-                  current: that.data.arrPage[0], // 当前显示图片的http链接
371
-                  urls: that.data.arrPage // 需要预览的图片http链接列表
372
-                });
373
-              }
374
-            },
375
-            fail(err3) {
376
-              console.log(err3);
377
-
378
-            },
379
-          })
337
+          that.setData({
338
+            arrPage: that.data.arrPage,
339
+          });
380
 
340
 
341
+          if (that.data.arrPage.length < that.data.PageNumber) {
342
+            pageIndex++;
343
+            that.saveImage();
344
+          } else {
345
+            that.setData({
346
+              ShowLoading: false,
347
+            });
348
+
349
+            wx.pageScrollTo({
350
+              scrollTop: 710,
351
+              duration: 300
352
+            });
353
+
354
+            wx.previewImage({
355
+              current: that.data.arrPage[0], // 当前显示图片的http链接
356
+              urls: that.data.arrPage // 需要预览的图片http链接列表
357
+            });
358
+          }
381
         }
359
         }
382
       })
360
       })
383
     });
361
     });
@@ -403,13 +381,53 @@ Page({
403
     }
381
     }
404
 
382
 
405
   },
383
   },
384
+  //保存图片文件
385
+  saveImageFile: function () {
386
+    if (this.data.IsDistabled == "") {
387
+      wx.showLoading({ title: "保存中..." });
388
+      var that = this;
389
+      var count = 0;
390
+      for (var i = 0; i < that.data.arrPage.length; i++) {
391
+        wx.saveImageToPhotosAlbum({
392
+          filePath: that.data.arrPage[i],
393
+          success(res3) {
394
+            //存列表
395
+            wx.setStorageSync("AnswerList", tempAnswerList);
396
+
397
+            console.log("save:" + res3.savedFilePath);
398
+            count++
399
+            if (count == that.data.arrPage.length) {
400
+              wx.hideLoading();
401
+              wx.showModal({
402
+                title: "保存完成",
403
+                showCancel: false,
404
+                content: "请打开手机相册查看图片!",
405
+              });
406
+              that.setData({
407
+                IsDistabled: "Distabled",
408
+              });
409
+
410
+              wx.pageScrollTo({
411
+                scrollTop: 1010,
412
+                duration: 300
413
+              });
414
+
415
+            }
416
+          },
417
+          fail(err3) {
418
+            console.log(err3);
419
+          },
420
+        })
421
+      }
422
+    }
423
+  },
406
   changePageNumber: function (e) {
424
   changePageNumber: function (e) {
407
     var id = Number(e.currentTarget.dataset.id);
425
     var id = Number(e.currentTarget.dataset.id);
408
     this.data.PageNumber += id;
426
     this.data.PageNumber += id;
409
     if (this.data.PageNumber < 1)
427
     if (this.data.PageNumber < 1)
410
       this.data.PageNumber = 1;
428
       this.data.PageNumber = 1;
411
-    else if (this.data.PageNumber > 8)
412
-      this.data.PageNumber = 8;
429
+    else if (this.data.PageNumber > 4)
430
+      this.data.PageNumber = 4;
413
 
431
 
414
     this.setData({
432
     this.setData({
415
       PageNumber: this.data.PageNumber,
433
       PageNumber: this.data.PageNumber,

+ 17 - 13
pages/main/detail.wxml

@@ -51,7 +51,7 @@
51
 
51
 
52
     <image class="universalpic_line_dashed_size01" src="../../images/universalpic_line_dashed_size01.png" />
52
     <image class="universalpic_line_dashed_size01" src="../../images/universalpic_line_dashed_size01.png" />
53
 
53
 
54
-    <view class="text4">制作几</view>
54
+    <view class="text4">制作几</view>
55
 
55
 
56
     <image class="universalpic_value_cell_size01" src="../../images/universalpic_value_cell_size01.png" />
56
     <image class="universalpic_value_cell_size01" src="../../images/universalpic_value_cell_size01.png" />
57
     <view class="panel10 FlexRow">
57
     <view class="panel10 FlexRow">
@@ -60,7 +60,7 @@
60
       <view class="btnAddSub" bindtap='changePageNumber' data-id="1"></view>
60
       <view class="btnAddSub" bindtap='changePageNumber' data-id="1"></view>
61
     </view>
61
     </view>
62
 
62
 
63
-    <view class="text5">每份含 {{PageCount}} 道题目,至多 8 份</view>
63
+    <view class="text5">每张含 {{PageCount}} 道题目</view>
64
 
64
 
65
     <image class="universalpic_line_dashed_size01" src="../../images/universalpic_line_dashed_size01.png" />
65
     <image class="universalpic_line_dashed_size01" src="../../images/universalpic_line_dashed_size01.png" />
66
 
66
 
@@ -77,27 +77,31 @@
77
       <view class="panel20 FlexRow">
77
       <view class="panel20 FlexRow">
78
         <image class="universalpic_right_white_size01" src="../../images/universalpic_right_white_size01.png" />
78
         <image class="universalpic_right_white_size01" src="../../images/universalpic_right_white_size01.png" />
79
       </view>
79
       </view>
80
-      <view class="text6">完成了</view>
81
-      <view class="text7">题目以图片格式保存到手机相册,共 {{arrPage.length}} 张</view>
80
+      <view class="text6">题目出好了,共有 {{arrPage.length}} 张卷子图片</view>
82
       <view class="panel21 FlexRow">
81
       <view class="panel21 FlexRow">
83
         <image class="panel210" wx:for="{{arrPage}}" wx:key="index" src="{{item}}" data-id='{{index}}' bindtap='showImage' />
82
         <image class="panel210" wx:for="{{arrPage}}" wx:key="index" src="{{item}}" data-id='{{index}}' bindtap='showImage' />
84
       </view>
83
       </view>
85
-
84
+      <view class="btn2{{IsDistabled}} btn" bindtap='saveImageFile'>
85
+        <view class="btn1{{IsDistabled}} btn1">
86
+          全部保存到相册
87
+        </view>
88
+      </view>
86
       <image class="universalpic_line_dashed_size01" src="../../images/universalpic_line_dashed_size01.png" />
89
       <image class="universalpic_line_dashed_size01" src="../../images/universalpic_line_dashed_size01.png" />
87
-      <view class="text8">然后...</view>
90
+      <view class="text8">保存之后...</view>
88
       <view class="panel22 FlexRow">
91
       <view class="panel22 FlexRow">
89
         <view class="panel220 FlexColumn">
92
         <view class="panel220 FlexColumn">
90
           <view class="panel2200 FlexColumn">
93
           <view class="panel2200 FlexColumn">
91
             <image class="universalpic_print_gray_size01" src="../../images/universalpic_print_gray_size01.png" />
94
             <image class="universalpic_print_gray_size01" src="../../images/universalpic_print_gray_size01.png" />
92
           </view>
95
           </view>
93
-          <text class="text9">请到手机相册打印图片或转存到PC</text>
96
+          <text class="text9">1. 请到手机相册打印图片或转存到PC</text>
94
         </view>
97
         </view>
95
         <view class="panel220 FlexColumn">
98
         <view class="panel220 FlexColumn">
96
           <view class="panel2200 FlexColumn">
99
           <view class="panel2200 FlexColumn">
97
             <image class="universalpic_write_gray_size01" src="../../images/universalpic_write_gray_size01.png" />
100
             <image class="universalpic_write_gray_size01" src="../../images/universalpic_write_gray_size01.png" />
98
           </view>
101
           </view>
99
-          <text class="text9">题目做完后,在首页的批改栏目中看查看答案</text>
100
-          <text class="text10" bindtap='gotoAnswer'>看答案</text>
102
+          <view class="text9" bindtap="gotoAnswer">2. 题目做完后,在首页 的批改栏目中
103
+            <text class="text10">对答案</text>
104
+          </view>
101
         </view>
105
         </view>
102
       </view>
106
       </view>
103
     </view>
107
     </view>
@@ -138,8 +142,8 @@
138
   <view class="loading1 FlexColumn">
142
   <view class="loading1 FlexColumn">
139
     <view class="line1"></view>
143
     <view class="line1"></view>
140
     <view class="line2 FlexColumn">
144
     <view class="line2 FlexColumn">
141
-      <view class="text">共 {{PageNumber}} 张图片</view>
142
-      <view class="text2">正在保存第 {{arrPage.length}} 张... 可能需要{{WaitTime}}</view>
145
+      <view class="text">正在生成第 {{arrPage.length}} 张图片</view>
146
+      <view class="text2">共有 {{PageNumber}} 张图片,可能需要{{WaitTime}}</view>
143
     </view>
147
     </view>
144
     <view class="line3 FlexColumn">
148
     <view class="line3 FlexColumn">
145
       <view class="text3">使用建议</view>
149
       <view class="text3">使用建议</view>
@@ -148,11 +152,11 @@
148
     <view class="line4"></view>
152
     <view class="line4"></view>
149
     <image class="universalpic_attention_light_red_bg" src="../../images/universalpic_attention_light_red_bg.png" />
153
     <image class="universalpic_attention_light_red_bg" src="../../images/universalpic_attention_light_red_bg.png" />
150
     <image class="universalpic_attention_light_red" src="../../images/universalpic_attention_light_red.gif" />
154
     <image class="universalpic_attention_light_red" src="../../images/universalpic_attention_light_red.gif" />
151
-    
155
+
152
   </view>
156
   </view>
153
   <view class="close FlexRow">
157
   <view class="close FlexRow">
154
     <view class="close1 FlexRow" bindtap='closeLoading'>
158
     <view class="close1 FlexRow" bindtap='closeLoading'>
155
-    <image class="universalpic_close_white_size01" src="../../images/universalpic_close_white_size01.png" />
159
+      <image class="universalpic_close_white_size01" src="../../images/universalpic_close_white_size01.png" />
156
     </view>
160
     </view>
157
   </view>
161
   </view>
158
 
162
 

+ 19 - 13
pages/main/detail.wxss

@@ -177,6 +177,7 @@
177
   border-radius: 10rpx;
177
   border-radius: 10rpx;
178
   position: relative;
178
   position: relative;
179
   margin-top: 80rpx;
179
   margin-top: 80rpx;
180
+  margin-bottom: 60rpx;
180
 }
181
 }
181
 
182
 
182
 .btn1 {
183
 .btn1 {
@@ -190,6 +191,16 @@
190
   font-size: 48rpx;
191
   font-size: 48rpx;
191
 }
192
 }
192
 
193
 
194
+.btn2Distabled {
195
+  background-color: #1E1E1E;
196
+  margin-top: 60rpx;
197
+}
198
+
199
+.btn1Distabled {
200
+  background-color: #2E2E2E;
201
+  color: #4D4D4D;
202
+}
203
+
193
 .universalpic_line_zigzag_black_down{
204
 .universalpic_line_zigzag_black_down{
194
   width: 680rpx;
205
   width: 680rpx;
195
   height: 49rpx;
206
   height: 49rpx;
@@ -198,6 +209,7 @@
198
 .universalpic_line_zigzag_black_up{
209
 .universalpic_line_zigzag_black_up{
199
   width: 680rpx;
210
   width: 680rpx;
200
   height: 79rpx;
211
   height: 79rpx;
212
+  margin-top: 10rpx;
201
 }
213
 }
202
 
214
 
203
 
215
 
@@ -218,27 +230,25 @@
218
   width: 100rpx;
230
   width: 100rpx;
219
   height: 100rpx;
231
   height: 100rpx;
220
   background-color: #19C575;
232
   background-color: #19C575;
221
-  margin-top: 50rpx;
233
+  margin-top: 80rpx;
222
   border-radius: 50%;
234
   border-radius: 50%;
223
 }
235
 }
224
 
236
 
225
 .panel2 .text6{
237
 .panel2 .text6{
226
   font-size:32rpx;
238
   font-size:32rpx;
227
-  margin-top: 30rpx;
239
+  margin-top: 50rpx;
228
   color:#9B9B9B;
240
   color:#9B9B9B;
229
 }
241
 }
230
-.panel2 .text7{
231
-  font-size:24rpx;
232
-  margin-top: 50rpx;
233
-  color:#868686;
234
-  font-weight: 400;
242
+
243
+.btn2 {
244
+  margin-top: 60rpx;
235
 }
245
 }
246
+
236
 .panel2 .panel21{
247
 .panel2 .panel21{
237
   width: 600rpx;
248
   width: 600rpx;
238
   margin-top: 40rpx;
249
   margin-top: 40rpx;
239
   flex-wrap: wrap;
250
   flex-wrap: wrap;
240
   justify-content: flex-start;
251
   justify-content: flex-start;
241
-  margin-bottom: 40rpx;
242
 }
252
 }
243
 .panel2 .panel210{
253
 .panel2 .panel210{
244
   width: 130rpx;
254
   width: 130rpx;
@@ -296,11 +306,7 @@
296
 }
306
 }
297
 
307
 
298
 .panel2 .text10{
308
 .panel2 .text10{
299
-  width:260rpx;
300
-  font-size:24rpx;
301
-  margin-top: 40rpx;
302
-  color:#F0F0F0;
303
-  text-align: center;
309
+  color:#fff;
304
   text-decoration:underline;
310
   text-decoration:underline;
305
 }
311
 }
306
 
312
 

+ 9 - 0
pages/main/item.js

@@ -44,6 +44,15 @@ Page({
44
           break;
44
           break;
45
         }
45
         }
46
       }
46
       }
47
+      
48
+      var list = item.QuestionList;
49
+      for (var i = 0; i < list.length; i++) {
50
+        if (i==0 && list[i].Vertical) {
51
+          list[i].IsShowVertical = true;
52
+          break;
53
+        }
54
+      }
55
+      
47
       that.setData({
56
       that.setData({
48
         AnswerItem: item,
57
         AnswerItem: item,
49
       });
58
       });

+ 5 - 5
pages/main/item.wxml

@@ -42,7 +42,7 @@
42
         </view>
42
         </view>
43
       </view>
43
       </view>
44
     </block>
44
     </block>
45
-    <view class="panelRowBody panel0 FlexRow">
45
+    <view class="panelRowBody panel0 FlexRow" bindtap='selectedItem' data-id="{{item.ID}}">
46
       <view class="panelLeft FlexRow">
46
       <view class="panelLeft FlexRow">
47
         <view class="number">{{index+1}}</view>
47
         <view class="number">{{index+1}}</view>
48
         <view class="answer">{{item.Result}}</view>
48
         <view class="answer">{{item.Result}}</view>
@@ -58,11 +58,11 @@
58
           <block wx:if="{{item.HiddenColumn=='R'}}">___ </block>
58
           <block wx:if="{{item.HiddenColumn=='R'}}">___ </block>
59
           <block wx:if="{{item.HiddenColumn!='R'}}">{{item.R}} </block>
59
           <block wx:if="{{item.HiddenColumn!='R'}}">{{item.R}} </block>
60
         </view>
60
         </view>
61
-        <image class="formula_btn_show" src="../../images/formula_btn_show.png" wx:if="{{item.Vertical && !item.IsShowVertical}}" bindtap='selectedItem' data-id="{{item.ID}}" />
62
-        <image class="formula_btn_show" src="../../images/formula_btn_hide.png" wx:if="{{item.Vertical && item.IsShowVertical}}" bindtap='selectedItem' data-id="{{item.ID}}"/>
61
+        <image class="formula_btn_show" src="../../images/formula_btn_show.png" wx:if="{{item.Vertical && !item.IsShowVertical}}" />
62
+        <image class="formula_btn_show" src="../../images/formula_btn_hide.png" wx:if="{{item.Vertical && item.IsShowVertical}}" />
63
     </view>
63
     </view>
64
     </view>
64
     </view>
65
-    <!-- 算式 -->
65
+    <!-- 算式(加减乘) -->
66
     <view class="panelRowBody panel0 FlexColumn" wx:if="{{item.Vertical && item.OperateAB!='÷' && item.IsShowVertical}}">
66
     <view class="panelRowBody panel0 FlexColumn" wx:if="{{item.Vertical && item.OperateAB!='÷' && item.IsShowVertical}}">
67
       <view class="panelAnswer FlexColumn">
67
       <view class="panelAnswer FlexColumn">
68
         <view class="panelAnswerRow FlexRow" wx:for='{{item.Vertical}}' wx:key="index">
68
         <view class="panelAnswerRow FlexRow" wx:for='{{item.Vertical}}' wx:key="index">
@@ -77,7 +77,7 @@
77
         </view>
77
         </view>
78
       </view>
78
       </view>
79
     </view>
79
     </view>
80
-    <!-- 算式 -->
80
+    <!-- 算式(除) -->
81
     <view class="panelRowBody panel0 FlexColumn" wx:if="{{item.Vertical && item.OperateAB=='÷' && item.IsShowVertical}}">
81
     <view class="panelRowBody panel0 FlexColumn" wx:if="{{item.Vertical && item.OperateAB=='÷' && item.IsShowVertical}}">
82
       <view class="panelAnswer FlexColumn">
82
       <view class="panelAnswer FlexColumn">
83
         <view class="panelAnswerRow FlexRow" wx:for='{{item.Vertical}}' wx:key="index">
83
         <view class="panelAnswerRow FlexRow" wx:for='{{item.Vertical}}' wx:key="index">

+ 1 - 1
pages/main/item.wxss

@@ -178,7 +178,7 @@
178
   margin: 10rpx 15rpx;
178
   margin: 10rpx 15rpx;
179
 }
179
 }
180
 .panelAnswer .colLineHalf{
180
 .panelAnswer .colLineHalf{
181
-  width:14rpx;
181
+  width:34rpx;
182
   height:2rpx;
182
   height:2rpx;
183
   margin: 0rpx 0 0 28rpx;
183
   margin: 0rpx 0 0 28rpx;
184
   background-color: #000;
184
   background-color: #000;

+ 26 - 45
pages/main/list.js

@@ -11,36 +11,36 @@ Page({
11
   data: {
11
   data: {
12
     version: app.globalData.version,
12
     version: app.globalData.version,
13
     FileUrl: app.globalData.fileUrl,
13
     FileUrl: app.globalData.fileUrl,
14
-    filter:'all',
15
-    IsShowMenu:false,
16
-    CategoryID:1,
14
+    filter: 'all',
15
+    IsShowMenu: false,
16
+    CategoryID: 1,
17
   },
17
   },
18
-  onLoad: function(options) {
18
+  onLoad: function (options) {
19
     categoryID = options.id;
19
     categoryID = options.id;
20
     categoryName = options.name;
20
     categoryName = options.name;
21
     categoryNum = options.num;
21
     categoryNum = options.num;
22
     //console.log(category);
22
     //console.log(category);
23
-    this.getList();
24
     this.setData({
23
     this.setData({
25
-      CategoryNum:categoryNum,
24
+      CategoryNum: categoryNum,
26
       CategoryID: categoryID,
25
       CategoryID: categoryID,
27
       Containnerheight: server.getWindowHeight(),
26
       Containnerheight: server.getWindowHeight(),
28
     });
27
     });
28
+    this.getList();
29
   },
29
   },
30
-  getList: function() {
30
+  getList: function () {
31
     this.buildList();
31
     this.buildList();
32
     wx.setNavigationBarTitle({
32
     wx.setNavigationBarTitle({
33
       title: categoryName + " 题卡仓库",
33
       title: categoryName + " 题卡仓库",
34
     });
34
     });
35
   },
35
   },
36
-  gotoDetail:function(e){
36
+  gotoDetail: function (e) {
37
     SelectID = e.currentTarget.dataset.id;
37
     SelectID = e.currentTarget.dataset.id;
38
     var arr = wx.getStorageSync('SelectIDArray');
38
     var arr = wx.getStorageSync('SelectIDArray');
39
     if (!arr)
39
     if (!arr)
40
-      arr=[];
41
-    for(var i=0;i<arr.length;i++){
42
-      if (arr[i] == SelectID){
43
-        arr.splice(i,0);
40
+      arr = [];
41
+    for (var i = 0; i < arr.length; i++) {
42
+      if (arr[i] == SelectID) {
43
+        arr.splice(i, 0);
44
         break;
44
         break;
45
       }
45
       }
46
     }
46
     }
@@ -53,8 +53,8 @@ Page({
53
       url: '../main/detail?id=' + SelectID,
53
       url: '../main/detail?id=' + SelectID,
54
     });
54
     });
55
   },
55
   },
56
-  buildList:function(){
57
-    var that=this;
56
+  buildList: function () {
57
+    var that = this;
58
 
58
 
59
     var arrID = categoryID.split(",");
59
     var arrID = categoryID.split(",");
60
     var list = [];
60
     var list = [];
@@ -67,11 +67,11 @@ Page({
67
           for (var k = 0; k < data[i].List.length; k++) {
67
           for (var k = 0; k < data[i].List.length; k++) {
68
             data[i].List[k].CategoryLevel = data[i].Name;
68
             data[i].List[k].CategoryLevel = data[i].Name;
69
 
69
 
70
-            
70
+
71
             for (var n = 0; n < arr.length; n++) {
71
             for (var n = 0; n < arr.length; n++) {
72
               //data[i].List[k].SelectItem = "";
72
               //data[i].List[k].SelectItem = "";
73
-              if (arr[n] == data[i].List[k].ID){
74
-                data[i].List[k].SelectItem ="boxLeft";
73
+              if (arr[n] == data[i].List[k].ID) {
74
+                data[i].List[k].SelectItem = "boxLeft";
75
               }
75
               }
76
             }
76
             }
77
 
77
 
@@ -79,46 +79,27 @@ Page({
79
             if (SelectID == data[i].List[k].ID)
79
             if (SelectID == data[i].List[k].ID)
80
               data[i].List[k].Select = true;
80
               data[i].List[k].Select = true;
81
 
81
 
82
-            if (this.data.filter == "vertical"){
83
-              if (data[i].List[k].QuestionNumber3>0)
82
+            if (this.data.filter == "vertical") {
83
+              if (data[i].List[k].QuestionNumber3 > 0)
84
                 list.push(data[i].List[k]);
84
                 list.push(data[i].List[k]);
85
             }
85
             }
86
-            else{
87
-                list.push(data[i].List[k]);
86
+            else {
87
+              list.push(data[i].List[k]);
88
             }
88
             }
89
           }
89
           }
90
           break;
90
           break;
91
         }
91
         }
92
       }
92
       }
93
     }
93
     }
94
-
94
+    var LineLongHeight = (list.length+1) * 190;
95
+    
95
     this.setData({
96
     this.setData({
96
       QuestionTypeList: list,
97
       QuestionTypeList: list,
98
+      LineLongHeight: LineLongHeight,
97
     });
99
     });
98
 
100
 
99
-    setTimeout(function(){
100
-      var query = wx.createSelectorQuery();
101
-      query.select('.line4').boundingClientRect();
102
-      query.exec(function (res) {
103
-        //console.log("top2:" + (res[0].top));
104
-        var LineLongHeight = Number(res[0].top) * 2-200;
105
-        // if (that.data.CategoryNum == 1 )
106
-        //   LineLongHeight+=430;
107
-        // else if (that.data.CategoryNum == 2)
108
-        //   LineLongHeight += 320;
109
-        // else if (that.data.CategoryNum == 3)
110
-        //   LineLongHeight += 280;
111
-        // else if (that.data.CategoryNum == 4)
112
-        //   LineLongHeight += 30;
113
-        console.log("LineLongHeight:" + LineLongHeight);
114
-        that.setData({
115
-          LineLongHeight: LineLongHeight,
116
-        });
117
-      });
118
-    },200);
119
-    
120
   },
101
   },
121
-  menuClick:function(e){
102
+  menuClick: function (e) {
122
     this.data.filter = e.currentTarget.dataset.id;
103
     this.data.filter = e.currentTarget.dataset.id;
123
     this.setData({
104
     this.setData({
124
       filter: this.data.filter,
105
       filter: this.data.filter,
@@ -136,7 +117,7 @@ Page({
136
       IsShowMenu: true,
117
       IsShowMenu: true,
137
     });
118
     });
138
   },
119
   },
139
-  onShareAppMessage: function() {
120
+  onShareAppMessage: function () {
140
     return {
121
     return {
141
       title: app.globalData.ShareTitle,
122
       title: app.globalData.ShareTitle,
142
       path: 'pages/index/index?UserID=' + app.globalData.userInfo.UserID,
123
       path: 'pages/index/index?UserID=' + app.globalData.userInfo.UserID,

+ 1 - 1
pages/main/list.wxml

@@ -37,7 +37,7 @@
37
     </view>
37
     </view>
38
 
38
 
39
   </block>
39
   </block>
40
-
40
+  <!-- 锁住 -->
41
   <!-- <image class="questioncollection_shelf_board" src="../../images/questioncollection_shelf_board.png" />
41
   <!-- <image class="questioncollection_shelf_board" src="../../images/questioncollection_shelf_board.png" />
42
   <view class="boxRight questioncard FlexRow desaturate">
42
   <view class="boxRight questioncard FlexRow desaturate">
43
     <image class=" questioncollection_shelf_box" src="../../images/questioncollection_shelf_box.png" />
43
     <image class=" questioncollection_shelf_box" src="../../images/questioncollection_shelf_box.png" />

+ 1 - 1
project.config.json

@@ -30,7 +30,7 @@
30
 			"list": []
30
 			"list": []
31
 		},
31
 		},
32
 		"miniprogram": {
32
 		"miniprogram": {
33
-			"current": -1,
33
+			"current": 1,
34
 			"list": [
34
 			"list": [
35
 				{
35
 				{
36
 					"id": 0,
36
 					"id": 0,