|
|
@@ -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,
|