chengjie 3 lat temu
rodzic
commit
143f4db66f

+ 1 - 1
app.js

@@ -26,7 +26,7 @@ App({
26 26
     }
27 27
   },
28 28
   globalData: {
29
-    version: "1.1.13",
29
+    version: "1.1.15",
30 30
     IsProduction: true,
31 31
     ProgramID: 105,
32 32
     AppID: "wx1fef080f74481cbd",

+ 1 - 1
package4/main/activate.wxml

@@ -12,7 +12,7 @@
12 12
   <view class="panelItem FlexRow" wx:for="{{List}}" wx:key="index">
13 13
     <view class="Left FlexRow">
14 14
       <image src='../images/{{item.ImageUrl}}' class="img" />
15
-      <view class="title1">
15
+      <view class="title1">
16 16
         {{item.Name}}
17 17
       </view>
18 18
     </view>

+ 1 - 1
package4/main/activateFinish.wxml

@@ -15,7 +15,7 @@
15 15
   <view class="panelItem FlexRow" wx:for="{{ProgramList}}" wx:key="index" wx:if="{{item.IsShow2}}" bindtap='switchProgram' data-appid='{{item.appId}}' data-path='{{item.path}}'>
16 16
     <view class="Left FlexRow">
17 17
       <image src='../images/{{item.ImageUrl}}' class="img" />
18
-      <view class="title1">
18
+      <view class="title1">
19 19
         {{item.Name}}
20 20
       </view>
21 21
     </view>

+ 9 - 9
package4/main/paylist.wxml

@@ -1,14 +1,14 @@
1 1
 <view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
2 2
   <view style='height:50rpx'></view>
3
-  <view class="panel1 FlexColumn" wx:for="{{PayList}}" wx:key="index" wx:if="{{PayList.length>0}}">
3
+  <view class="panel1 FlexColumn" wx:for="{{PayList}}" wx:key="index" wx:if="{{PayList.length>0}}">
4 4
     <view class="item0 item FlexRow">
5 5
       <view class="left FlowColumn">
6
-        <view class="title0 FlexRow">
7
-          <view class="title0_1">支付时间</view>
6
+        <view class="title0 FlexRow">
7
+          <view class="title0_1">支付时间</view>
8 8
           <view>{{item.PayEndTime}}</view>
9 9
         </view>
10
-        <view class="title0 FlexRow">
11
-          <view class="title0_1">交易单号</view>
10
+        <view class="title0 FlexRow">
11
+          <view class="title0_1">交易单号</view>
12 12
           <view>{{item.TradeNo}}</view>
13 13
         </view>
14 14
       </view>
@@ -19,10 +19,10 @@
19 19
       <view class="item FlexRow">
20 20
         <view class="left FlexRow">
21 21
           <image src='../images/{{item.ImageName}}.png' class="img" />
22
-          <view class="title1">
22
+          <view class="title1">
23 23
             {{item.Name}}
24 24
           </view>
25
-          <view class="title2">
25
+          <view class="title2">
26 26
           </view>
27 27
         </view>
28 28
         <view class="right">
@@ -37,10 +37,10 @@
37 37
       <view class="item FlexRow">
38 38
         <view class="left FlexRow">
39 39
           <image src='../images/{{itemChild.ImageName}}' class="img" />
40
-          <view class="title1">
40
+          <view class="title1">
41 41
             {{itemChild.ProductName}}
42 42
           </view>
43
-          <view class="title2">
43
+          <view class="title2">
44 44
           </view>
45 45
         </view>
46 46
         <view class="right">

+ 1 - 1
pages/index/index.js

@@ -18,7 +18,7 @@ Page({
18 18
         console.log("SourceID:" + options.SourceID);
19 19
         app.globalData.SourceID = options.SourceID;
20 20
       }
21
-      // 扫码介绍人
21
+      // 扫码介绍人
22 22
       if (options.scene) {
23 23
         var scene = decodeURIComponent(options.scene);
24 24
         console.log("scene:" + scene);

+ 3 - 9
pages/index/index.wxml

@@ -1,14 +1,8 @@
1 1
 <view class="container FlexColumn" style="height:{{Containnerheight}}rpx;">
2 2
   <view class="text1">数学计算题</view>
3
-  <view class="panel FlexRow">
4
-    <view class="text2">选题</view>
5
-    <view class="text2">+</view>
6
-    <view class="text2">打印</view>
7
-    <view class="text2">·</view>
8
-    <view class="text2">扫码</view>
9
-    <view class="text2">+</view>
10
-    <view class="text2">批改</view>
11
-  </view>
3
+  <text class="panel FlexRow">
4
+  <text class="text2">选题+打印·扫码+批改</text>
5
+  </text>
12 6
 
13 7
   <image class="programstart_footer_illue" src="../images/programstart_footer_illue.png" />
14 8
 </view>

+ 1 - 1
pages/main/accredit.js

@@ -9,7 +9,7 @@ Page({
9 9
   },
10 10
   onLoad: function (options) {
11 11
     var text0 = "", text1 = "", text2 = "", text3 = "";
12
-    text0 = "会员登录";
12
+    text0 = "会员登录";
13 13
     text1 = "无需注册,微信授权即可登录";
14 14
     text2 = "去登录";
15 15
     text3 = "注意:会员登录后可使用付费功能。授权微信用户信息即可一键登录。为保障消费权益,购买后请尽快授权用户信息。登录后才能正常使用统计、排行、我的订单、套装、礼品卡等功能。";

+ 3 - 3
pages/main/accredit.wxml

@@ -1,10 +1,10 @@
1 1
 <view class="container FlexColumn" style='height:{{Height}}rpx;'>
2 2
   <image src="../images/accredit.png" class="bg" />
3
-  <text class="text0">{{Text0}}</text>
4
-  <text class="text1">{{Text1}}</text>
3
+  <text class="text0">{{Text0}}</text>
4
+  <text class="text1">{{Text1}}</text>
5 5
   <view class="btn">
6 6
     <button  class="btn1" catchtap="getUserInfo">{{Text2}}</button>
7 7
   </view>
8 8
   <view class="line2 {{ipad}}"></view>
9
-  <text class="text3">{{Text3}}</text>
9
+  <text class="text3">{{Text3}}</text>
10 10
 </view>

+ 3 - 3
pages/main/answer.wxml

@@ -19,17 +19,17 @@
19 19
       <view class="btn2 btn" wx:if="{{!IsEdit}}"></view>
20 20
 
21 21
       <view class="textTitle" wx:if="{{IsEdit}}">
22
-        <view class="textTitle1">完成</view>
22
+        <view class="textTitle1">完成</view>
23 23
         <view class="textTitle2">完成</view>
24 24
       </view>
25 25
       <view class="textTitle" wx:if="{{!IsEdit}}">
26
-        <view class="textTitle1">整理</view>
26
+        <view class="textTitle1">整理</view>
27 27
         <view class="textTitle2">整理</view>
28 28
       </view>
29 29
     </view>
30 30
   </view>
31 31
 
32
-  <view class="panel0 FlexColumn">
32
+  <view class="panel0 FlexColumn">
33 33
     <view class="panel00 FlexRow" style='min-height:{{ListHeight2}}rpx;'>
34 34
 
35 35
     </view>

+ 1 - 1
pages/main/default.js

@@ -12,7 +12,7 @@ Page({
12 12
   data: {
13 13
     version: app.globalData.version,
14 14
     FileUrl: app.globalData.fileUrl,
15
-    NickName: "陌生用户",
15
+    NickName: "陌生用户",
16 16
     IsMember: 1,
17 17
     AvatarUrl: "",
18 18
     IsAccredit: false,

+ 4 - 5
pages/main/default.wxml

@@ -35,12 +35,11 @@
35 35
           <view class="panel0020 FlexRow">
36 36
             <view class="panel00200 FlexColumn">
37 37
               <view class="textTitle3">
38
-                <view class="textTitle4">练习记录</view>
39
-                <view class="textTitle5">练习记录</view>
38
+              <view class="textTitle4">练习记录</view>
39
+                <view class="textTitle5">练习记录</view>
40 40
               </view>
41 41
               <view class="line3"></view>
42
-              <view class="panel002000 FlexRow">
43
-                <view class="text1">试卷张数</view>
42
+              <view class="panel002000 FlexRow"><view class="text1">试卷张数</view>
44 43
                 <view class="text2">{{AnswerLength}}</view>
45 44
               </view>
46 45
               <view class="line4 line3"></view>
@@ -85,7 +84,7 @@
85 84
               <view class="panel003000 FlexRow">
86 85
                 <view bindtap='gotoHelp'>帮助</view>
87 86
                 <view class="line"></view>
88
-                <view bindtap='gotoFeedback'>反馈</view>
87
+                <view bindtap='gotoFeedback'>反馈</view>
89 88
                 <view class="line"></view>
90 89
                 <view bindtap='gotoFeedback'>合作</view>
91 90
               </view>

+ 373 - 308
pages/main/detail.js

@@ -31,7 +31,7 @@ Page({
31 31
 
32 32
     ShowAndroidNotice: false,
33 33
   },
34
-  onLoad: function(options) {
34
+  onLoad: function (options) {
35 35
     var that = this;
36 36
     var id = options.id;
37 37
 
@@ -52,20 +52,20 @@ Page({
52 52
 
53 53
 
54 54
     if (id > 0) {
55
-      common.getStorageValue(this, "HelpHidden3", false, function() {
55
+      common.getStorageValue(this, "HelpHidden3", false, function () {
56 56
         that.showHelp();
57 57
       });
58 58
     } else {
59
-      common.getStorageValue(this, "HelpHidden8", false, function() {
59
+      common.getStorageValue(this, "HelpHidden8", false, function () {
60 60
         that.showHelp8();
61 61
       });
62 62
     }
63 63
 
64 64
     common.getStorageValue(this, "IsShare", 0, function () {
65
-      if (that.data.IsShare == 0
66
-        && app.globalData.userInfo.IsMember == 0
67
-        && app.globalData.userInfo.IsShow == 1
68
-        && app.globalData.IsLocked == 1
65
+      if (that.data.IsShare == 0 &&
66
+        app.globalData.userInfo.IsMember == 0 &&
67
+        app.globalData.userInfo.IsShow == 1 &&
68
+        app.globalData.IsLocked == 1
69 69
       ) {
70 70
         wx.navigateTo({
71 71
           url: '../../package4/main/share',
@@ -74,15 +74,15 @@ Page({
74 74
     });
75 75
 
76 76
   },
77
-  onShow: function() {
77
+  onShow: function () {
78 78
     if (this.data.ID == -1)
79 79
       this.getDetail(this.data.ID);
80 80
   },
81
-  onUnload: function() {
81
+  onUnload: function () {
82 82
     wx.hideLoading();
83 83
     this.closeHelp();
84 84
   },
85
-  getDetail: function(id) {
85
+  getDetail: function (id) {
86 86
     var item = {};
87 87
     if (id > 0) {
88 88
       var data = wx.getStorageSync('QuestionTypeList');
@@ -121,18 +121,18 @@ Page({
121 121
       })
122 122
     }
123 123
   },
124
-  gotoError: function(e) {
124
+  gotoError: function (e) {
125 125
     wx.navigateTo({
126 126
       url: '../main/errorlist',
127 127
     });
128 128
   },
129
-  gotoAnswer: function(e) {
129
+  gotoAnswer: function (e) {
130 130
     wx.navigateTo({
131 131
       url: '../main/answer',
132 132
     });
133 133
     this.closeHelp2();
134 134
   },
135
-  getFinish: function() {
135
+  getFinish: function () {
136 136
     server.playSound("/sounds/click.mp3");
137 137
 
138 138
     this.setData({
@@ -152,11 +152,11 @@ Page({
152 152
     this.closeHelp();
153 153
   },
154 154
   //重新生成试卷
155
-  ResetFinish: function() {
155
+  ResetFinish: function () {
156 156
     var that = this;
157 157
     wx.showLoading({
158 158
       title: "正在重置",
159
-      complete: function() {
159
+      complete: function () {
160 160
         var list = that.data.arrPage;
161 161
         for (var i = 0; i < list.length; i++) {
162 162
           wx.removeSavedFile({
@@ -178,7 +178,7 @@ Page({
178 178
     });
179 179
   },
180 180
   //题卡数据列表
181
-  getList: function(id) {
181
+  getList: function (id) {
182 182
     var that = this;
183 183
     var pageNum = that.data.PageNumber;
184 184
     var QuestionTypeCategory = 3;
@@ -186,7 +186,7 @@ Page({
186 186
       QuestionTypeCategory = 2;
187 187
     pageIndex = 0;
188 188
 
189
-    server.getData('GetQuestionTypesPrint?ID=' + id + '&QuestionTypeCategory=' + QuestionTypeCategory + '&PageNum=' + pageNum, function(data) {
189
+    server.getData('GetQuestionTypesPrint?ID=' + id + '&QuestionTypeCategory=' + QuestionTypeCategory + '&PageNum=' + pageNum, function (data) {
190 190
       //console.log("UserInfo:" + data);
191 191
       if (data) {
192 192
         that.setData({
@@ -199,31 +199,41 @@ Page({
199 199
         QuestionItem = data;
200 200
         QuestionItem.IconName = that.data.QuestionTypeItem.IconName;
201 201
 
202
-        if (isAndroid) {
203
-          console.log("android");
204
-          var ctx = wx.createCanvasContext("Canvas", that);
205
-          ctx.fillRect(0, 0, 1050, 1485);
206
-          ctx.draw(true, function(n) {
207
-            wx.canvasToTempFilePath({
208
-              x: 0,
209
-              y: 0,
210
-              width: 2100,
211
-              height: 2970,
212
-              canvasId: 'Canvas',
213
-              success: function(res2) {
214
-                that.saveImage();
215
-              }
216
-            })
217
-          });
218
-        } else {
202
+        
203
+        // if (isAndroid) {
204
+        //   console.log("android");
205
+        //   const query = wx.createSelectorQuery();
206
+        //   query.select('#Canvas')
207
+        //     .fields({ node: true, size: true })
208
+        //     .exec((res) => {
209
+        //       const canvas = res[0].node;
210
+        //       const ctx = canvas.getContext('2d');
211
+
212
+        //       canvas.width = 1050;
213
+        //       canvas.height = 1485;
214
+
215
+        //       wx.canvasToTempFilePath({
216
+        //         x: 0,
217
+        //         y: 0,
218
+        //         width: canvas.width,
219
+        //         height: canvas.height,
220
+        //         canvas: canvas,
221
+        //         success: function(res2) {
222
+        //           that.saveImage();
223
+        //         }
224
+        //       });
225
+        //     });
226
+        // } 
227
+        // else {
219 228
           that.saveImage();
220
-        }
229
+        // }
230
+        
221 231
       }
222 232
     });
223 233
 
224 234
   },
225 235
   //错题列表
226
-  getErrorList: function() {
236
+  getErrorList: function () {
227 237
     var that = this;
228 238
 
229 239
     QuestionItem = that.data.QuestionTypeItem;
@@ -249,26 +259,35 @@ Page({
249 259
         IsDistabled: "",
250 260
         WaitTime: waitTime[that.data.PageNumber],
251 261
       });
252
-
253
-      if (isAndroid) {
254
-        console.log("android");
255
-        var ctx = wx.createCanvasContext("Canvas", that);
256
-        ctx.fillRect(0, 0, 1050, 1485);
257
-        ctx.draw(true, function(n) {
258
-          wx.canvasToTempFilePath({
259
-            x: 0,
260
-            y: 0,
261
-            width: 2100,
262
-            height: 2970,
263
-            canvasId: 'Canvas',
264
-            success: function(res2) {
265
-              that.saveImage();
266
-            }
267
-          })
268
-        });
269
-      } else {
262
+      
263
+      // if (isAndroid) {
264
+      //   console.log("android");
265
+      //   const query = wx.createSelectorQuery();
266
+      //   query.select('#Canvas')
267
+      //     .fields({ node: true, size: true })
268
+      //     .exec((res) => {
269
+      //       const canvas = res[0].node;
270
+      //       const ctx = canvas.getContext('2d');
271
+
272
+      //       canvas.width = 1050;
273
+      //       canvas.height = 1485;
274
+
275
+      //       wx.canvasToTempFilePath({
276
+      //         x: 0,
277
+      //         y: 0,
278
+      //         width: canvas.width,
279
+      //         height: canvas.height,
280
+      //         canvas: canvas,
281
+      //         success: function(res2) {
282
+      //           that.saveImage();
283
+      //         }
284
+      //       });
285
+      //     });
286
+      // } 
287
+      // else {
270 288
         that.saveImage();
271
-      }
289
+      // }
290
+      
272 291
     } else {
273 292
       this.setData({
274 293
         ShowLoading: false,
@@ -280,11 +299,11 @@ Page({
280 299
       });
281 300
     }
282 301
   },
283
-  getAnswerID: function() {
302
+  getAnswerID: function () {
284 303
     var list = wx.getStorageSync("AnswerList");
285 304
     var id = 1;
286 305
     if (list && list.length > 0) {
287
-      list.sort(function(a, b) {
306
+      list.sort(function (a, b) {
288 307
         return b.AnswerID - a.AnswerID;
289 308
       });
290 309
       id = list[0].AnswerID + 1;
@@ -292,269 +311,315 @@ Page({
292 311
     for (var i = 0; i < this.data.PageNumber; i++)
293 312
       arrAnswerID.push(id + i);
294 313
   },
295
-  saveImage: function() {
314
+  saveImage: function () {
296 315
     var that = this;
297 316
     var item = QuestionItem;
298 317
     item.AnswerID = arrAnswerID.shift();
299 318
 
300
-    var ctx = wx.createCanvasContext("Canvas", that);
301
-    ctx.setTextAlign('left');
302
-    ctx.setTextBaseline('top');
303
-    ctx.setFontSize(12);
304
-    ctx.setFillStyle('white');
305
-
306
-    ctx.fillRect(0, 0, 2100, 2970);
307
-    ctx.fillStyle = "#000000";
308
-
309
-    var xStart = 60;
310
-    var yStart = 247;
311
-
312
-    var height = 150;
313
-    if (item.QuestionTypeCategory == 2)
314
-      height = 59;
315
-    if (item.Category > 0) {
316
-      if (item.PageCount == 18)
317
-        height = 210;
318
-      else if (item.PageCount == 15)
319
-        height = 250;
320
-    }
321
-    //括号
322
-    var index = 0;
323
-
324
-    for (var i = 0; i < 3; i++) {
325
-      for (var j = 0; j < item.PageCount / 3; j++) {
326
-        index++;
327
-        if (index <= item.QuestionList.length) {
328
-          ctx.fillText("(", xStart + i * 310, yStart + j * height);
329
-          ctx.fillText(")", xStart + i * 310 + 22, yStart + j * height);
319
+    const query = wx.createSelectorQuery();
320
+    query.select('#Canvas')
321
+      .fields({
322
+        node: true,
323
+        size: true
324
+      })
325
+      .exec((res) => {
326
+        var canvas = res[0].node;
327
+        var ctx = canvas.getContext('2d');
328
+
329
+        canvas.width = 1050;
330
+        canvas.height = 1485;
331
+
332
+        ctx.textAlign="left";
333
+        ctx.textBaseline="top";
334
+        ctx.font = "12px";
335
+        ctx.fillStyle="#ffffff";
336
+
337
+        ctx.fillRect(0, 0, canvas.width, canvas.height);
338
+        ctx.fillStyle = "#000000";
339
+
340
+        var xStart = 60;
341
+        var yStart = 247;
342
+
343
+        var height = 150;
344
+        if (item.QuestionTypeCategory == 2)
345
+          height = 59;
346
+        if (item.Category > 0) {
347
+          if (item.PageCount == 18)
348
+            height = 210;
349
+          else if (item.PageCount == 15)
350
+            height = 250;
330 351
         }
331
-      }
332
-    }
333
-
334
-    //编号
335
-    index = 0;
336
-    ctx.setTextAlign('center');
337
-    var numberLeft = 12;
338
-    if (isAndroid)
339
-      numberLeft = 14;
340
-    for (var i = 0; i < 3; i++) {
341
-      for (var j = 0; j < item.PageCount / 3; j++) {
342
-        index++;
343
-        if (index <= item.QuestionList.length) {
344
-          ctx.fillText(index, xStart + i * 310 + numberLeft, yStart + j * height);
352
+        //括号
353
+        var index = 0;
354
+
355
+        for (var i = 0; i < 3; i++) {
356
+          for (var j = 0; j < item.PageCount / 3; j++) {
357
+            index++;
358
+            if (index <= item.QuestionList.length) {
359
+              ctx.fillText("(", xStart + i * 310, yStart + j * height);
360
+              ctx.fillText(")", xStart + i * 310 + 22, yStart + j * height);
361
+            }
362
+          }
345 363
         }
346
-      }
347
-    }
348 364
 
349
-    //算式
350
-    index = that.data.arrPage.length * item.PageCount;
351
-    ctx.setFontSize(24);
352
-    for (var i = 0; i < 3; i++) {
353
-      for (var j = 0; j < item.PageCount / 3; j++) {
354
-        index++;
355
-
356
-        if (index <= item.QuestionList.length) {
357
-          //横式
358
-          if (item.QuestionTypeCategory == 2) {
359
-
360
-            var A = item.QuestionList[index - 1].A.toString();
361
-            if (item.QuestionList[index - 1].HiddenColumn == "A")
362
-              A = "____";
363
-            var OperateAB = item.QuestionList[index - 1].OperateAB.toString();
364
-            //console.log(OperateAB);
365
-            var B = item.QuestionList[index - 1].B.toString();
366
-            if (item.QuestionList[index - 1].HiddenColumn == "B")
367
-              B = "____";
368
-            var equation = A + " " + OperateAB + " " + B;
369
-            if (item.QuestionList[index - 1].C) {
370
-              var OperateBC = item.QuestionList[index - 1].OperateBC.toString();
371
-              var C = item.QuestionList[index - 1].C.toString();
372
-              equation += " " + OperateBC + " " + C;
373
-              if (item.QuestionList[index - 1].D) {
374
-                var OperateCD = item.QuestionList[index - 1].OperateCD.toString();
375
-                var D = item.QuestionList[index - 1].D.toString();
376
-                equation += " " + OperateCD + " " + D;
377
-              }
378
-            }
379
-            equation += " = ";
380
-            var R = item.QuestionList[index - 1].R.toString();
381
-            if (item.QuestionList[index - 1].HiddenColumn == "R")
382
-              R = "";
383
-            equation += R;
384
-
385
-            var num = xStart + i * 310 + 31;
386
-
387
-            for (var n = 0; n < equation.length; n++) {
388
-              var len = getLength(equation[n]);
389
-              num += len;
390
-              if (equation[n] == ".") {
391
-                ctx.fillText(equation[n], num + 3, yStart + j * 59 - 5);
392
-              } else {
393
-                var h = -8;
394
-                if (equation[n] == "_")
395
-                  h = 0;
396
-                ctx.fillText(equation[n], num, yStart + j * 59 + h);
397
-              }
365
+        //编号
366
+        index = 0;
367
+        ctx.textAlign="center";
368
+        var numberLeft = 12;
369
+        if (isAndroid)
370
+          numberLeft = 14;
371
+        for (var i = 0; i < 3; i++) {
372
+          for (var j = 0; j < item.PageCount / 3; j++) {
373
+            index++;
374
+            if (index <= item.QuestionList.length) {
375
+              ctx.fillText(index, xStart + i * 310 + numberLeft, yStart + j * height);
398 376
             }
399 377
           }
400
-          //竖式
401
-          else if (item.QuestionTypeCategory == 3) {
402
-
403
-            var num1 = item.QuestionList[index - 1];
404
-            var isAnswer = false;
405
-
406
-            var width = 250;
407
-            if (num1.OperateAB == "÷")
408
-              width = 240;
409
-
410
-            for (var n = 0; n < num1.Vertical.length; n++) {
411
-              var num = xStart + i * 310 + width;
412
-              var num2 = 0;
413
-              for (var m = num1.Vertical[n].Array.length - 1; m >= 0; m--) {
414
-                var str = "";
415
-                if (num1.Vertical[n].Type == "line") {
416
-                  if (num1.OperateAB != "÷") {
417
-                    //var lineLength = num1.Vertical[n].Array.length * 30 + 20;
418
-                    var lineLength = 6 * 30 + 20;
419
-                    var lineTop = 4;
420
-
421
-                    //console.log(yStart + j * height + n * 30 + lineTop);
422
-                    ctx.moveTo(num, yStart + j * height + n * 30 + lineTop);
423
-                    ctx.lineTo(num - lineLength, yStart + j * height + n * 30 + lineTop);
424
-                    ctx.stroke();
425
-
426
-                    isAnswer = true;
427
-                    break;
378
+        }
379
+
380
+        //算式
381
+        index = that.data.arrPage.length * item.PageCount;
382
+        //ctx.setFontSize(24);
383
+        ctx.font = "24px";
384
+
385
+        var urlDiv=[];
386
+
387
+        
388
+        for (var i = 0; i < 3; i++) {
389
+          for (var j = 0; j < item.PageCount / 3; j++) {
390
+            index++;
391
+
392
+            if (index <= item.QuestionList.length) {
393
+              //横式
394
+              if (item.QuestionTypeCategory == 2) {
395
+
396
+                var A = item.QuestionList[index - 1].A.toString();
397
+                if (item.QuestionList[index - 1].HiddenColumn == "A")
398
+                  A = "____";
399
+                var OperateAB = item.QuestionList[index - 1].OperateAB.toString();
400
+                //console.log(OperateAB);
401
+                var B = item.QuestionList[index - 1].B.toString();
402
+                if (item.QuestionList[index - 1].HiddenColumn == "B")
403
+                  B = "____";
404
+                var equation = A + " " + OperateAB + " " + B;
405
+                if (item.QuestionList[index - 1].C) {
406
+                  var OperateBC = item.QuestionList[index - 1].OperateBC.toString();
407
+                  var C = item.QuestionList[index - 1].C.toString();
408
+                  equation += " " + OperateBC + " " + C;
409
+                  if (item.QuestionList[index - 1].D) {
410
+                    var OperateCD = item.QuestionList[index - 1].OperateCD.toString();
411
+                    var D = item.QuestionList[index - 1].D.toString();
412
+                    equation += " " + OperateCD + " " + D;
428 413
                   }
429
-                } else {
430
-                  str = num1.Vertical[n].Array[m];
431
-
432
-                  if (num1.OperateAB == "÷" && str == "√") {
433
-                    isAnswer = true;
434
-                    var lineLength = num1.A.toString().length;
435
-                    var lineWidth = Math.floor(57 * (1 + num1.A.toString().length) / 2);
436
-
437
-                    ctx.drawImage("../images/formula_division_size0" + lineLength + ".png", num - (num1.Vertical[n].Array.length - m) * 30 - 8, yStart + j * height + n * 30 - 10, lineWidth, 39);
438
-                    //break;
439
-                  } else if (num1.OperateAB == "÷" && n == 0) {} else if (num1.OperateAB == "÷" && n == 1) {
440
-                    ctx.fillText(str, num - (num1.Vertical[n].Array.length - m) * 10, yStart + j * height + n * 30);
414
+                }
415
+                equation += " = ";
416
+                var R = item.QuestionList[index - 1].R.toString();
417
+                if (item.QuestionList[index - 1].HiddenColumn == "R")
418
+                  R = "";
419
+                equation += R;
420
+
421
+                var num = xStart + i * 310 + 31;
422
+
423
+                for (var n = 0; n < equation.length; n++) {
424
+                  var len = getLength(equation[n]);
425
+                  num += len;
426
+                  if (equation[n] == ".") {
427
+                    ctx.fillText(equation[n], num + 3, yStart + j * 59 - 5);
441 428
                   } else {
442
-                    if (str == ".") {
443
-                      ctx.fillText(str, num - (num1.Vertical[n].Array.length - m) * 30 + 15, yStart + j * height + n * 30);
444
-                      num2 = 30;
445
-                    } 
446
-                    else if (str == "+" || str == "-" || str == "−" || str == "×" || str == "÷") {
447
-                      var lineLength = 6 * 30;
448
-                      ctx.fillText(str, num - lineLength, yStart + j * height + n * 30);
449
-                      num2 = 30;
450
-                    } 
451
-                    else
452
-                      ctx.fillText(str, num - (num1.Vertical[n].Array.length - m) * 30 + num2, yStart + j * height + n * 30);
429
+                    var h = -8;
430
+                    if (equation[n] == "_")
431
+                      h = 0;
432
+                    ctx.fillText(equation[n], num, yStart + j * 59 + h);
453 433
                   }
454 434
                 }
455 435
               }
456
-              if (isAnswer)
457
-                break;
458
-            }
436
+              //竖式
437
+              else if (item.QuestionTypeCategory == 3) {
438
+
439
+                var num1 = item.QuestionList[index - 1];
440
+                var isAnswer = false;
441
+
442
+                var width = 250;
443
+                if (num1.OperateAB == "÷")
444
+                  width = 240;
445
+
446
+                for (var n = 0; n < num1.Vertical.length; n++) {
447
+                  var num = xStart + i * 310 + width;
448
+                  var num2 = 0;
449
+                  for (var m = num1.Vertical[n].Array.length - 1; m >= 0; m--) {
450
+                    var str = "";
451
+                    if (num1.Vertical[n].Type == "line") {
452
+                      if (num1.OperateAB != "÷") {
453
+                        //var lineLength = num1.Vertical[n].Array.length * 30 + 20;
454
+                        var lineLength = 6 * 30 + 20;
455
+                        var lineTop = 4;
456
+
457
+                        //console.log(yStart + j * height + n * 30 + lineTop);
458
+                        ctx.moveTo(num, yStart + j * height + n * 30 + lineTop);
459
+                        ctx.lineTo(num - lineLength, yStart + j * height + n * 30 + lineTop);
460
+                        ctx.stroke();
461
+
462
+                        isAnswer = true;
463
+                        break;
464
+                      }
465
+                    } else {
466
+                      str = num1.Vertical[n].Array[m];
467
+
468
+                      if (num1.OperateAB == "÷" && str == "√") {
469
+                        isAnswer = true;
470
+                        var lineLength = num1.A.toString().length;
471
+                        var lineWidth = Math.floor(57 * (1 + num1.A.toString().length) / 2);
472
+
473
+                        var obj={};
474
+                        obj.url="../images/formula_division_size0" + lineLength + ".png";
475
+                        obj.num1=num - (num1.Vertical[n].Array.length - m) * 30 - 8;
476
+                        obj.num2=yStart + j * height + n * 30 - 10;
477
+                        obj.num3=lineWidth;
478
+                        obj.num4=39;
479
+
480
+                        urlDiv.push(obj);
481
+                        // var img = canvas.createImage();
482
+                        // img.src = "../images/formula_division_size0" + lineLength + ".png";
483
+                        
484
+                        // console.log(img.src);
485
+                        // img.onload = e => {
486
+                        //   ctx.drawImage(img, num - (num1.Vertical[n].Array.length - m) * 30 - 8, yStart + j * height + n * 30 - 10, lineWidth, 39);
487
+                        // };
488
+                      } 
489
+                      else if (num1.OperateAB == "÷" && n == 0) {} else if (num1.OperateAB == "÷" && n == 1) {
490
+                        ctx.fillText(str, num - (num1.Vertical[n].Array.length - m) * 10, yStart + j * height + n * 30);
491
+                      } 
492
+                      else {
493
+                        if (str == ".") {
494
+                          ctx.fillText(str, num - (num1.Vertical[n].Array.length - m) * 30 + 15, yStart + j * height + n * 30);
495
+                          num2 = 30;
496
+                        } else if (str == "+" || str == "-" || str == "−" || str == "×" || str == "÷") {
497
+                          var lineLength = 6 * 30;
498
+                          ctx.fillText(str, num - lineLength, yStart + j * height + n * 30);
499
+                          num2 = 30;
500
+                        } else
501
+                          ctx.fillText(str, num - (num1.Vertical[n].Array.length - m) * 30 + num2, yStart + j * height + n * 30);
502
+                      }
503
+                    }
504
+                  }
505
+                  if (isAnswer)
506
+                    break;
507
+                }
459 508
 
509
+              }
510
+            }
460 511
           }
461 512
         }
462
-      }
463
-    }
464 513
 
465
-    ctx.setTextAlign('left');
466
-    ctx.setFontSize(32);
467
-    ctx.fillText(item.Name, 60, 45);
468
-
469
-
470
-    ctx.setFontSize(12);
471
-    ctx.fillText(item.CategoryName, 60, 90);
472
-    ctx.fillText("共" + item.PageCount + "道题", 60, 125);
473
-    ctx.fillText("第 1 / 1 页", 60, 147);
474
-    ctx.fillText("答案检索号", 768, 60);
475
-
476
-    ctx.setTextAlign('right');
477
-    ctx.fillText("出题时间 " + item.CreateTime, 875, 94);
478
-    ctx.fillText("微信扫一扫 计时看答案", 875, 111);
479
-    ctx.fillText("《数学计算题》选题 打印 扫码 批改", 875, 137);
480
-    ctx.setFontSize(32);
481
-    ctx.fillText(item.AnswerID, 872, 50);
482
-
483
-    ctx.drawImage("../images/answer.png", 890, 54, 100, 100);
484
-
485
-    ctx.draw(true, function(n) {
486
-      var w = 1050,
487
-        h = 1485;
488
-      wx.canvasToTempFilePath({
489
-        x: 0,
490
-        y: 0,
491
-        width: w * times,
492
-        height: h * times,
493
-        destWidth: w * times,
494
-        destHeight: h * times,
495
-        canvasId: 'Canvas',
496
-        success: function(res2) {
497
-          //console.log(res2.tempFilePath);
498
-          that.data.arrPage.push(res2.tempFilePath);
499
-          item.TempImagePath = res2.tempFilePath;
500
-          tempAnswerList.push(JSON.parse(JSON.stringify(item)));
501
-
502
-          that.setData({
503
-            arrPage: that.data.arrPage,
504
-          });
514
+        ctx.textAlign="left";
515
+        //ctx.setFontSize(32);
516
+        ctx.font = "32px";
517
+        
518
+        ctx.fillText(item.Name, 60, 45);
519
+
520
+
521
+        //ctx.setFontSize(12);
522
+        ctx.font = "12px";
523
+        
524
+        ctx.fillText(item.CategoryName, 60, 90);
525
+        ctx.fillText("共" + item.PageCount + "道题", 60, 125);
526
+        ctx.fillText("第 "+(pageIndex+1).toString()+" / "+that.data.PageNumber+" 页", 60, 147);
527
+        ctx.fillText("答案检索号", 768, 60);
528
+
529
+        ctx.textAlign="right";
530
+        ctx.fillText("出题时间 " + item.CreateTime, 875, 94);
531
+        ctx.fillText("微信扫一扫 计时看答案", 875, 111);
532
+        ctx.fillText("《数学计算题》选题 打印 扫码 批改", 875, 137);
533
+        ctx.font = "32px";
534
+        
535
+        ctx.fillText(item.AnswerID, 872, 50);
536
+
537
+        var img=canvas.createImage();
538
+        img.src="../images/answer.png";
539
+        img.onload = e => {
540
+          ctx.drawImage(img, 890, 54, 100, 100);
541
+
542
+          if (urlDiv.length>0){
543
+            var img2=canvas.createImage();
544
+            img2.src=urlDiv[0].url;
545
+            img2.onload = e => {
546
+              for(var k=0;k<urlDiv.length;k++)
547
+                ctx.drawImage(img2, urlDiv[k].num1, urlDiv[k].num2, urlDiv[k].num3, urlDiv[k].num4);
548
+              build();
549
+            };
550
+          }
551
+          else
552
+            build();
553
+        };
554
+
555
+        function build(){
556
+          var w = 1050,h = 1485;
557
+          wx.canvasToTempFilePath({
558
+            x: 0,
559
+            y: 0,
560
+            width: w * times,
561
+            height: h * times,
562
+            destWidth: w * times,
563
+            destHeight: h * times,
564
+            canvas: canvas,
565
+            success: function (res2) {
566
+              //console.log(res2.tempFilePath);
567
+              that.data.arrPage.push(res2.tempFilePath);
568
+              item.TempImagePath = res2.tempFilePath;
569
+              tempAnswerList.push(JSON.parse(JSON.stringify(item)));
505 570
 
506
-          if (that.data.arrPage.length < that.data.PageNumber) {
507
-            pageIndex++;
508
-            that.saveImage();
509
-          } else {
510
-            //生成图片完成
511
-            setTimeout(function() {
512 571
               that.setData({
513
-                ShowLoading: false,
514
-              });
515
-              wx.pageScrollTo({
516
-                scrollTop: 0,
517
-                duration: 300
572
+                arrPage: that.data.arrPage,
518 573
               });
519
-              // wx.previewImage({
520
-              //   current: that.data.arrPage[0], // 当前显示图片的http链接
521
-              //   urls: that.data.arrPage // 需要预览的图片http链接列表
522
-              // });
523
-
524
-              //存列表
525
-              var tempList = wx.getStorageSync("AnswerList");
526
-              if (!tempList)
527
-                tempList = [];
528
-              for (var x = 0; x < tempList.length; x++) {
529
-                tempList[x].IsNew = 0;
530
-              }
531
-              for (var x = 0; x < tempAnswerList.length; x++) {
532
-                var tempItem = tempAnswerList[x];
533
-                var id = x * tempItem.PageCount;
534
-                var arr = [];
535
-                for (var y = 0; y < tempItem.QuestionList.length; y++) {
536
-                  if (y >= id && y < id + tempItem.PageCount) {
537
-                    arr.push(tempItem.QuestionList[y]);
538
-                  }
539
-                }
540
-                tempItem.QuestionList = arr;
541
-                tempItem.IsNew = 1;
542
-                tempList.unshift(tempItem);
543
-              }
544
-              wx.setStorageSync("AnswerList", tempList);
545 574
 
546
-              common.getStorageValue(that, "HelpHidden7", false, function() {
547
-                that.showHelp2();
548
-              });
575
+              if (that.data.arrPage.length < that.data.PageNumber) {
576
+                pageIndex++;
577
+                that.saveImage();
578
+              } else {
579
+                //生成图片完成
580
+                setTimeout(function () {
581
+                  that.setData({
582
+                    ShowLoading: false,
583
+                  });
584
+                  wx.pageScrollTo({
585
+                    scrollTop: 0,
586
+                    duration: 300
587
+                  });
588
+
589
+                  //存列表
590
+                  var tempList = wx.getStorageSync("AnswerList");
591
+                  if (!tempList)
592
+                    tempList = [];
593
+                  for (var x = 0; x < tempList.length; x++) {
594
+                    tempList[x].IsNew = 0;
595
+                  }
596
+                  for (var x = 0; x < tempAnswerList.length; x++) {
597
+                    var tempItem = tempAnswerList[x];
598
+                    var id = x * tempItem.PageCount;
599
+                    var arr = [];
600
+                    for (var y = 0; y < tempItem.QuestionList.length; y++) {
601
+                      if (y >= id && y < id + tempItem.PageCount) {
602
+                        arr.push(tempItem.QuestionList[y]);
603
+                      }
604
+                    }
605
+                    tempItem.QuestionList = arr;
606
+                    tempItem.IsNew = 1;
607
+                    tempList.unshift(tempItem);
608
+                  }
609
+                  wx.setStorageSync("AnswerList", tempList);
549 610
 
550
-            }, 3000);
611
+                  common.getStorageValue(that, "HelpHidden7", false, function () {
612
+                    that.showHelp2();
613
+                  });
551 614
 
615
+                }, 3000);
616
+              }
617
+            }
618
+          });
619
+        };
620
+      });
552 621
 
553 622
 
554
-          }
555
-        }
556
-      })
557
-    });
558 623
 
559 624
     function getLength(str) {
560 625
       switch (str) {
@@ -578,7 +643,7 @@ Page({
578 643
 
579 644
   },
580 645
   //保存图片文件
581
-  saveImageFile: function() {
646
+  saveImageFile: function () {
582 647
     if (this.data.IsDistabled == "") {
583 648
       wx.showLoading({
584 649
         title: "保存中..."
@@ -620,7 +685,7 @@ Page({
620 685
       }
621 686
     }
622 687
   },
623
-  changePageNumber: function(e) {
688
+  changePageNumber: function (e) {
624 689
     var id = Number(e.currentTarget.dataset.id);
625 690
     this.data.PageNumber += id;
626 691
     var addDisabled = "",
@@ -639,7 +704,7 @@ Page({
639 704
       SubDisabled: subDisabled,
640 705
     });
641 706
   },
642
-  showImage: function(e) {
707
+  showImage: function (e) {
643 708
     var that = this;
644 709
     var id = e.currentTarget.dataset.id;
645 710
     wx.previewImage({
@@ -647,14 +712,14 @@ Page({
647 712
       urls: that.data.arrPage // 需要预览的图片http链接列表
648 713
     });
649 714
   },
650
-  closeLoading: function() {
715
+  closeLoading: function () {
651 716
     var that = this;
652 717
     that.setData({
653 718
       ShowLoading: false,
654 719
       IsFinished: false,
655 720
     });
656 721
   },
657
-  menuClick: function(e) {
722
+  menuClick: function (e) {
658 723
     this.data.filter = e.currentTarget.dataset.id;
659 724
     if (this.data.filter == "horizontal") {
660 725
       this.data.PageCount = this.data.QuestionTypeItem.QuestionNumber2;
@@ -668,24 +733,24 @@ Page({
668 733
       PageCount: this.data.PageCount,
669 734
     });
670 735
   },
671
-  closeMenu: function() {
736
+  closeMenu: function () {
672 737
     this.setData({
673 738
       IsShowMenu: false,
674 739
     });
675 740
   },
676
-  openMenu: function() {
741
+  openMenu: function () {
677 742
     this.setData({
678 743
       IsShowMenu: true,
679 744
     });
680 745
   },
681
-  showHelp: function() {
746
+  showHelp: function () {
682 747
     if (!this.data.HelpHidden3) {
683 748
       this.audioCtx = wx.createAudioContext('myAudio');
684 749
       var str = "嘿嘿,找到我了吗?我在车间的窗户里制作例题呢。如果这是你要的题型,去点“出题”按钮就对了。还要告诉你,一张卷子就是一张图片,题目数量请看提示。";
685 750
       server.playAudio(this.audioCtx, str);
686 751
     }
687 752
   },
688
-  closeHelp: function() {
753
+  closeHelp: function () {
689 754
     this.setData({
690 755
       HelpHidden3: true,
691 756
     });
@@ -693,14 +758,14 @@ Page({
693 758
     this.audioCtx = wx.createAudioContext('myAudio');
694 759
     this.audioCtx.pause();
695 760
   },
696
-  showHelp2: function() {
761
+  showHelp2: function () {
697 762
     if (!this.data.HelpHidden7) {
698 763
       this.audioCtx = wx.createAudioContext('myAudio');
699 764
       var str = "卷子出炉咯,棒棒哒!快去手机相册打印吧。我会等在首页上的答案资料室为你继续带路的。";
700 765
       server.playAudio(this.audioCtx, str);
701 766
     }
702 767
   },
703
-  closeHelp2: function() {
768
+  closeHelp2: function () {
704 769
     this.setData({
705 770
       HelpHidden7: true,
706 771
     });
@@ -709,14 +774,14 @@ Page({
709 774
     this.audioCtx.pause();
710 775
   },
711 776
 
712
-  showHelp8: function() {
777
+  showHelp8: function () {
713 778
     if (!this.data.HelpHidden8) {
714 779
       this.audioCtx = wx.createAudioContext('myAudio');
715 780
       var str = "发现错误是提高成绩的第一步。点一下题目数量右侧的图标,当有错题后,能查看和整理错题清单。";
716 781
       server.playAudio(this.audioCtx, str);
717 782
     }
718 783
   },
719
-  closeHelp8: function() {
784
+  closeHelp8: function () {
720 785
     this.setData({
721 786
       HelpHidden8: true,
722 787
     });
@@ -725,7 +790,7 @@ Page({
725 790
     this.audioCtx.pause();
726 791
   },
727 792
 
728
-  onShareAppMessage: function() {
793
+  onShareAppMessage: function () {
729 794
     return {
730 795
       title: app.globalData.ShareTitle,
731 796
       path: 'pages/index/index?UserID=' + app.globalData.userInfo.UserID,

+ 8 - 9
pages/main/detail.wxml

@@ -27,7 +27,7 @@
27 27
       <view class="text1">算式类型</view>
28 28
 
29 29
       <block wx:if="{{QuestionTypeItem.QuestionNumber3==0}}">
30
-        <view class="text2">横式</view>
30
+        <view class="text2">横式</view>
31 31
         <view class="text3 FlexRow">
32 32
           <image class="universalpic_attention_black_size01" src="../images/universalpic_attention_black_size01.png" />
33 33
           <view class="text31">本知识点不适用竖式运算</view>
@@ -67,7 +67,7 @@
67 67
     </view>
68 68
 
69 69
     <view class="error4 panel1 FlexColumn" wx:if="{{ID==-1}}">
70
-      <view class="error1 text4">题目</view>
70
+      <view class="error1 text4">题目</view>
71 71
 
72 72
       <image class="error2 universalpic_indicator_cell_size01" src="../images/universalpic_indicator_cell_size01.png" />
73 73
       <view class="panel10 FlexRow" bindtap='gotoError'>
@@ -106,7 +106,7 @@
106 106
         </view>
107 107
       </view>
108 108
       <image class="universalpic_line_dashed_size01" src="../images/universalpic_line_dashed_size01.png" />
109
-      <view class="text8">保存之后...</view>
109
+      <view class="text8">保存之后...</view>
110 110
       <view class="panel22 FlexRow">
111 111
         <view class="panel220 FlexColumn">
112 112
           <view class="panel2200 FlexColumn">
@@ -131,8 +131,7 @@
131 131
   <view class="menuPanel" style="min-height:{{Containnerheight}}rpx;" wx:if="{{IsShowMenu}}">
132 132
     <view class="menu FlexColumn">
133 133
       <view class="text1">算式类型</view>
134
-      <view class="panel FlexRow" bindtap='menuClick' data-id="horizontal">
135
-        <view>横式</view>
134
+      <view class="panel FlexRow" bindtap='menuClick' data-id="horizontal"><view>横式</view>
136 135
         <image wx:if="{{filter=='horizontal'}}" class="universalpic_select_on_black" src="../images/universalpic_select_on_black.png" />
137 136
 
138 137
       </view>
@@ -146,7 +145,7 @@
146 145
       <view class="line2"></view>
147 146
       <view class="line"></view>
148 147
       <view class="panel FlexRow" bindtap='closeMenu'>
149
-        <view>取消</view>
148
+        <view>取消</view>
150 149
       </view>
151 150
 
152 151
     </view>
@@ -157,11 +156,11 @@
157 156
   <view class="loading1 FlexColumn">
158 157
     <view class="line1"></view>
159 158
     <view class="line2 FlexColumn">
160
-      <view class="textLoading1">正在生成第 {{arrPage.length}} 张图片</view>
159
+      <view class="textLoading1">正在生成第 {{arrPage.length}} 张图片</view>
161 160
       <view class="textLoading2">共有 {{PageNumber}} 张图片,可能需要{{WaitTime}}</view>
162 161
     </view>
163 162
     <view class="line3 FlexColumn">
164
-      <view class="textLoading3">使用建议</view>
163
+      <view class="textLoading3">使用建议</view>
165 164
       <view class="textLoading4">每张卷子里的题目都是动态生成哒,每次出题都会得到不同的结果。</view>
166 165
     </view>
167 166
     <view class="line4"></view>
@@ -180,4 +179,4 @@
180 179
 <image hidden="{{HelpHidden7}}" bindtap='closeHelp2' class="Help_aside_savepaper" src="../images/Help_aside_savepaper.png" />
181 180
 <image hidden="{{HelpHidden8}}" bindtap='closeHelp8' class="Help_aside_makepaper_wrong" src="../images/Help_aside_makepaper_wrong.png" />
182 181
 <audio hidden='true' id="myAudio"></audio>
183
-<canvas class='Canvas' canvas-id="Canvas"></canvas>
182
+<canvas class='Canvas' style="width:1050rpx;height:1485rpx;" type="2d" id="Canvas"></canvas>

+ 2 - 2
pages/main/errorlist.wxml

@@ -40,13 +40,13 @@
40 40
       
41 41
       </view>
42 42
       <view class="panel FlexRow" bindtap='deleteItem'>
43
-        <view>删除记录</view>
43
+        <view>删除记录</view>
44 44
       </view>
45 45
       <view class="line"></view>
46 46
       <view class="line2"></view>
47 47
       <view class="line"></view>
48 48
       <view class="panel FlexRow" bindtap='closeMenu'>
49
-        <view>取消</view>
49
+        <view>取消</view>
50 50
       </view>
51 51
 
52 52
     </view>

+ 1 - 1
pages/main/help.wxml

@@ -3,6 +3,6 @@
3 3
     <image class="welcomeguide_info" src="../images/welcomeguide_info.png" />
4 4
     <image class="welcomeguide_dialogue" src="../images/welcomeguide_dialogue.png" />
5 5
   </view>
6
-  <view class="btn" bindtap='goto'>开始</view>
6
+  <view class="btn" bindtap='goto'>开始</view>
7 7
 </view>
8 8
 <audio hidden='true' id="myAudio"></audio>

+ 1 - 1
pages/main/item.js

@@ -298,7 +298,7 @@ Page({
298 298
   showHelp: function () {
299 299
     if (!this.data.HelpHidden6) {
300 300
       this.audioCtx = wx.createAudioContext('myAudio');
301
-      var str = "对答案可以用听的也可以用看的。答案在左边,题目在右边。想给做错的题目打记号,就点击答案左侧的1、2、3……题目序号,这样就可以去首页的错题集里复习它们了。还有一个特殊功能!在有竖式题目的情况下,题目右侧会有这样的图标      ,点它就能提供完整的解题步骤,这个独门神器是倾力为你准备的,对找出错误所在非常有效。";
301
+      var str = "对答案可以用听的也可以用看的。答案在左边,题目在右边。想给做错的题目打记号,就点击答案左侧的1、2、3……题目序号,这样就可以去首页的错题集里复习它们了。还有一个特殊功能!在有竖式题目的情况下,题目右侧会有这样的图标      ,点它就能提供完整的解题步骤,这个独门神器是倾力为你准备的,对找出错误所在非常有效。";
302 302
       server.playAudio(this.audioCtx, str);
303 303
     }
304 304
   },

+ 11 - 12
pages/main/item.wxml

@@ -1,6 +1,6 @@
1 1
 <view class="container FlexColumn" style="min-height:{{Containnerheight}}rpx;">
2 2
   <view class="panel3 panel0 FlexRow" bindtap='showImage'>
3
-    <view class="panelLeft">试卷预览</view>
3
+    <view class="panelLeft">试卷预览</view>
4 4
     <view>
5 5
       <image class="universalpic_indicator_pink" src="../images/universalpic_indicator_pink.png" />
6 6
     </view>
@@ -12,7 +12,7 @@
12 12
       <view class="btn2" bindtap='playAudioStart'>
13 13
         <view class="btn3 FlexRow">
14 14
           <view wx:if="{{IsPlaying==0 || IsPlaying==-1}}">播放</view>
15
-          <view wx:if="{{IsPlaying==1}}">暂停</view>
15
+          <view wx:if="{{IsPlaying==1}}">暂停</view>
16 16
         </view>
17 17
       </view>
18 18
 
@@ -48,21 +48,22 @@
48 48
   <block wx:for="{{AnswerItem.QuestionList}}" wx:key="index">
49 49
     <block wx:if="{{(index % (PageColumnNum))==0 }}">
50 50
       <view id="panelRowTop{{index / (PageColumnNum)}}" class="panelRowTop FlexRow">
51
-        <view class="panelLeft1 panelLeft">
51
+        <view class="panelLeft1 panelLeft">第
52 52
           <block wx:if="{{index==0}}">一</block>
53 53
           <block wx:if="{{index==PageColumnNum}}">二</block>
54 54
           <block wx:if="{{index==PageColumnNum*2}}">三</block>
55
-          列</view>
55
+          列
56
+        </view>
56 57
         <view>
57 58
         </view>
58 59
       </view>
59 60
     </block>
60 61
     <view class="{{item.ErrorClass}} panelRowBody panel0 FlexRow">
61
-      <view class="FlexRow">
62
+      <view class="FlexRow">
62 63
         <view class="numberPanel FlexRow" bindtap="setErrorItem" data-id="{{item.ID}}">
63 64
           <view class="number">{{index+1}}</view>
64 65
           <image class="universalpic_wrong_red" src="../images/universalpic_wrong_red.png" wx:if="{{item.ErrorClass=='ErrorClass'}}" />
65
-        
66
+
66 67
         </view>
67 68
         <view class="answer">{{item.Result}}</view>
68 69
       </view>
@@ -84,7 +85,7 @@
84 85
     <!-- 算式(加减乘) -->
85 86
     <view class="panelRowBody panel0 FlexColumn" wx:if="{{item.Vertical && item.OperateAB!='÷' && item.IsShowVertical}}">
86 87
       <view class="panelAnswer FlexColumn">
87
-        <view class="panelAnswerRow FlexRow" wx:for='{{item.Vertical}}' wx:key="rowI" wx:for-item="itemChild" >
88
+        <view class="panelAnswerRow FlexRow" wx:for='{{item.Vertical}}' wx:key="rowI" wx:for-item="itemChild">
88 89
           <view class="panelAnswerCol FlexRow" wx:for='{{itemChild.Array}}' wx:key="i" wx:for-item="col" wx:for-index="i">
89 90
             <view class="colNumber" wx:if="{{itemChild.Type=='number' && col!='√' && col!='.'}}">{{col}}</view>
90 91
             <view class="colDot" wx:if="{{itemChild.Type=='number' && col=='.'}}">{{col}}</view>
@@ -105,10 +106,8 @@
105 106
             <view class="colLine" wx:if="{{itemChild.Type=='line' && col=='1'}}"></view>
106 107
             <view class="colLineHalf" wx:if="{{itemChild.Type=='line' && col=='0.5'}}"></view>
107 108
             <view class="colLineNull" wx:if="{{itemChild.Type=='line' && col==''}}"></view>
108
-            <image wx:if="{{itemChild.Type=='number' && col=='√'}}" class="formula_division_size0{{item.LineLength}} formula_division_size"
109
-              style='margin-left:{{ -57*item.LineLength-35 }}rpx;' 
110
-             src="../images/formula_division_size0{{item.LineLength}}.png" />
111
-            
109
+            <image wx:if="{{itemChild.Type=='number' && col=='√'}}" class="formula_division_size0{{item.LineLength}} formula_division_size" style='margin-left:{{ -57*item.LineLength-35 }}rpx;' src="../images/formula_division_size0{{item.LineLength}}.png" />
110
+
112 111
           </view>
113 112
         </view>
114 113
       </view>
@@ -123,4 +122,4 @@
123 122
 </view>
124 123
 <audio hidden='true' id="numberAudio" bindended='onPlayEnded'></audio>
125 124
 <audio hidden='true' id="myAudio"></audio>
126
-<image hidden="{{HelpHidden6}}" bindtap='closeHelp' class="Help_aside_answerroom_detail" src="../images/Help_aside_answerroom_detail.png" />
125
+<image hidden="{{HelpHidden6}}" bindtap='closeHelp' class="Help_aside_answerroom_detail" src="../images/Help_aside_answerroom_detail.png" />

+ 14 - 25
project.config.json

@@ -1,5 +1,5 @@
1 1
 {
2
-  "description": "项目配置文件",
2
+  "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
3 3
   "setting": {
4 4
     "urlCheck": false,
5 5
     "es6": true,
@@ -23,86 +23,75 @@
23 23
     "packNpmManually": false,
24 24
     "packNpmRelationList": [],
25 25
     "minifyWXSS": true,
26
-    "showES6CompileOption": false
26
+    "disableUseStrict": false,
27
+    "showES6CompileOption": false,
28
+    "useCompilerPlugins": false,
29
+    "minifyWXML": true,
30
+    "useStaticServer": true
27 31
   },
28 32
   "compileType": "miniprogram",
29 33
   "libVersion": "2.15.0",
30 34
   "appid": "wx1fef080f74481cbd",
31 35
   "projectname": "%E6%95%B0%E5%AD%A6%E8%AE%A1%E7%AE%97%E9%A2%98",
32
-  "isGameTourist": false,
33 36
   "simulatorType": "wechat",
34 37
   "simulatorPluginLibVersion": {},
35 38
   "condition": {
36
-    "search": {
37
-      "list": []
38
-    },
39
-    "conversation": {
40
-      "list": []
41
-    },
42
-    "plugin": {
43
-      "list": []
44
-    },
45
-    "game": {
46
-      "currentL": -1,
47
-      "list": []
48
-    },
49 39
     "miniprogram": {
50 40
       "list": [
51 41
         {
52
-          "id": 0,
53 42
           "name": "list",
54 43
           "pathName": "pages/main/list",
55 44
           "query": "id=3&name=三年级"
56 45
         },
57 46
         {
58
-          "id": 1,
59 47
           "name": "detail",
60 48
           "pathName": "pages/main/detail",
61 49
           "query": "id=187"
62 50
         },
63 51
         {
64
-          "id": 2,
65 52
           "name": "print",
66 53
           "pathName": "pages/main/print",
67 54
           "query": "id=183"
68 55
         },
69 56
         {
70
-          "id": -1,
71 57
           "name": "item",
72 58
           "pathName": "pages/main/item",
73 59
           "query": "id=46"
74 60
         },
75 61
         {
76
-          "id": -1,
77 62
           "name": "guide",
78 63
           "pathName": "pages/main/guide",
79 64
           "query": ""
80 65
         },
81 66
         {
82
-          "id": -1,
83 67
           "name": "login",
84 68
           "pathName": "pages/about/payfinished",
85 69
           "query": ""
86 70
         },
87 71
         {
88
-          "id": -1,
89 72
           "name": "answer",
90 73
           "pathName": "pages/main/answer",
91 74
           "query": ""
92 75
         },
93 76
         {
94
-          "id": -1,
95 77
           "name": "errorlist",
96 78
           "pathName": "pages/main/errorlist",
97 79
           "query": ""
98 80
         },
99 81
         {
100
-          "id": -1,
101 82
           "name": "share",
102 83
           "pathName": "pages/about/share",
103 84
           "query": ""
104 85
         }
105 86
       ]
106 87
     }
88
+  },
89
+  "packOptions": {
90
+    "ignore": [],
91
+    "include": []
92
+  },
93
+  "editorSetting": {
94
+    "tabIndent": "insertSpaces",
95
+    "tabSize": 2
107 96
   }
108 97
 }

+ 8 - 8
utils/main.js

@@ -36,7 +36,7 @@ function postData(url, postData, callback) {
36 36
     },
37 37
     fail: function () {
38 38
       wx.showToast({
39
-        title: '服务器忙,请稍候再试!',
39
+        title: '服务器忙,请稍候再试!',
40 40
         duration: 3000
41 41
       });
42 42
       wx.redirectTo({
@@ -130,7 +130,7 @@ function payMoney(payType, buyType, money, detail, callback) {
130 130
                 }
131 131
                 else {
132 132
                   wx.showToast({
133
-                    title: '服务器忙,请稍候再试!',
133
+                    title: '服务器忙,请稍候再试!',
134 134
                     duration: 3000
135 135
                   });
136 136
                 }
@@ -142,7 +142,7 @@ function payMoney(payType, buyType, money, detail, callback) {
142 142
       } else {
143 143
         console.log('获取用户登录态失败!' + res.errMsg);
144 144
         wx.showToast({
145
-          title: '服务器忙,请稍候再试!',
145
+          title: '服务器忙,请稍候再试!',
146 146
           duration: 3000
147 147
         });
148 148
       }
@@ -325,35 +325,35 @@ function getProgramListOld() {
325 325
     },
326 326
     {
327 327
       id: 98,
328
-      Name: "语文汉语拼音",
328
+      Name: "语文汉语拼音",
329 329
       appId: 'wx331e8dd070f01d0e',
330 330
       path: 'pages/index/index?SourceID=' + app.globalData.ProgramID,
331 331
       imageName: "universalpic_product_pinyin_icon_size01",
332 332
     },
333 333
     {
334 334
       id: 106,
335
-      Name: "语文识字",
335
+      Name: "语文识字",
336 336
       appId: 'wx313a8f2c0741efe1',
337 337
       path: 'pages/index/index?SourceID=' + app.globalData.ProgramID,
338 338
       imageName: "universalpic_product_shizi_icon_size01",
339 339
     },
340 340
     {
341 341
       id: 99,
342
-      Name: "英语自然拼读",
342
+      Name: "英语自然拼读",
343 343
       appId: 'wxb54a6d5aff836ee3',
344 344
       path: 'pages/index/index?SourceID=' + app.globalData.ProgramID,
345 345
       imageName: "universalpic_product_phonics_icon_size01",
346 346
     },
347 347
     {
348 348
       id: 90,
349
-      Name: "注意力游戏",
349
+      Name: "注意力游戏",
350 350
       appId: 'wxa5e33c61fe37dd01',
351 351
       path: 'pages/index/index?SourceID=' + app.globalData.ProgramID,
352 352
       imageName: "universalpic_product_zhuyili_icon_size01",
353 353
     },
354 354
     {
355 355
       id: 127,
356
-      Name: "空间智力游戏",
356
+      Name: "空间智力游戏",
357 357
       appId: 'wxaa1a8b48d9853872',
358 358
       path: 'pages/index/game?SourceID=' + app.globalData.ProgramID,
359 359
       imageName: "universalpic_product_kongjian_icon_size01",