|
|
@@ -2,29 +2,41 @@ import common from '../../utils/util';
|
|
2
|
2
|
import server from '../../utils/main';
|
|
3
|
3
|
|
|
4
|
4
|
const app = getApp();
|
|
5
|
|
-var times=1;
|
|
|
5
|
+var times = 1;
|
|
|
6
|
+var pageIndex = 0;
|
|
|
7
|
+var QuestionList = [];
|
|
|
8
|
+var isAndroid=false;
|
|
|
9
|
+const waitTime = ["", "10秒钟", "15秒钟", "20秒钟", "25秒钟", "半分钟", "35秒钟", "40秒钟", "45秒钟"];
|
|
6
|
10
|
|
|
7
|
11
|
Page({
|
|
8
|
12
|
data: {
|
|
9
|
13
|
version: app.globalData.version,
|
|
10
|
14
|
FileUrl: app.globalData.fileUrl,
|
|
11
|
|
- IsShowMenu:false,
|
|
12
|
|
- filter:'horizontal',
|
|
13
|
|
- PageNumber:1,
|
|
|
15
|
+ IsShowMenu: false,
|
|
|
16
|
+ filter: 'horizontal',
|
|
|
17
|
+ //filter: 'vertical',
|
|
|
18
|
+ PageNumber: 1,
|
|
|
19
|
+ PageCount: 60,
|
|
14
|
20
|
IsFinished: false,
|
|
|
21
|
+ arrPage:[],
|
|
|
22
|
+ ShowLoading:false,
|
|
15
|
23
|
},
|
|
16
|
24
|
onLoad: function(options) {
|
|
17
|
25
|
var id = options.id;
|
|
18
|
26
|
this.setData({
|
|
19
|
27
|
Containnerheight: server.getWindowHeight(),
|
|
20
|
|
- ID:id,
|
|
|
28
|
+ ID: id,
|
|
21
|
29
|
});
|
|
22
|
30
|
var systemInfo = wx.getSystemInfoSync();
|
|
23
|
31
|
if (systemInfo.system && systemInfo.system.indexOf("Android") >= 0) {
|
|
24
|
|
- times=2;
|
|
|
32
|
+ times = 2;
|
|
25
|
33
|
}
|
|
26
|
34
|
this.getDetail(id);
|
|
27
|
|
-
|
|
|
35
|
+
|
|
|
36
|
+ isAndroid = false;
|
|
|
37
|
+ if (app.globalData.systemInfo.system && app.globalData.systemInfo.system.indexOf("Android") >= 0)
|
|
|
38
|
+ isAndroid=true;
|
|
|
39
|
+
|
|
28
|
40
|
},
|
|
29
|
41
|
getDetail: function(id) {
|
|
30
|
42
|
var item;
|
|
|
@@ -43,41 +55,235 @@ Page({
|
|
43
|
55
|
QuestionTypeItem: item,
|
|
44
|
56
|
});
|
|
45
|
57
|
},
|
|
46
|
|
- gotoAnswer: function (e) {
|
|
|
58
|
+ gotoAnswer: function(e) {
|
|
47
|
59
|
wx.navigateTo({
|
|
48
|
60
|
url: '../main/answer',
|
|
49
|
61
|
});
|
|
50
|
62
|
},
|
|
51
|
|
- getFinish:function(){
|
|
|
63
|
+ getFinish: function() {
|
|
52
|
64
|
this.setData({
|
|
53
|
65
|
IsFinished: true,
|
|
54
|
66
|
});
|
|
55
|
67
|
this.getList(this.data.ID);
|
|
56
|
68
|
},
|
|
57
|
69
|
|
|
58
|
|
- getList: function (id) {
|
|
|
70
|
+ getList: function(id) {
|
|
59
|
71
|
var that = this;
|
|
60
|
|
-
|
|
61
|
|
- server.getLocalHost(function () {
|
|
62
|
|
- server.getData('GetQuestionTypesPrint?ID=' + id, function (data) {
|
|
|
72
|
+ var pageNum = that.data.PageNumber;
|
|
|
73
|
+ var QuestionTypeCategory = 3;
|
|
|
74
|
+ if (that.data.filter == "horizontal")
|
|
|
75
|
+ QuestionTypeCategory = 2;
|
|
|
76
|
+ pageIndex = 0;
|
|
|
77
|
+ server.getLocalHost(function() {
|
|
|
78
|
+ server.getData('GetQuestionTypesPrint?ID=' + id + '&QuestionTypeCategory=' + QuestionTypeCategory + '&PageNum=' + pageNum, function(data) {
|
|
63
|
79
|
//console.log("UserInfo:" + data);
|
|
64
|
80
|
if (data) {
|
|
65
|
|
- that.saveImage(data);
|
|
|
81
|
+ that.setData({
|
|
|
82
|
+ ShowLoading:true,
|
|
|
83
|
+ arrPage: [],
|
|
|
84
|
+ WaitTime: waitTime[that.data.PageNumber],
|
|
|
85
|
+ });
|
|
|
86
|
+ QuestionList = data;
|
|
|
87
|
+
|
|
|
88
|
+
|
|
|
89
|
+ if (isAndroid) {
|
|
|
90
|
+ var ctx = wx.createCanvasContext("Canvas", that);
|
|
|
91
|
+ ctx.fillRect(0, 0, 1050, 1485);
|
|
|
92
|
+ ctx.draw(true, function (n) {
|
|
|
93
|
+ wx.canvasToTempFilePath({
|
|
|
94
|
+ x: 0,
|
|
|
95
|
+ y: 0,
|
|
|
96
|
+ width: 2100,
|
|
|
97
|
+ height: 2970,
|
|
|
98
|
+ canvasId: 'Canvas',
|
|
|
99
|
+ success: function (res2) {
|
|
|
100
|
+ that.saveImage();
|
|
|
101
|
+ }
|
|
|
102
|
+ })
|
|
|
103
|
+ });
|
|
|
104
|
+ }
|
|
|
105
|
+ else{
|
|
|
106
|
+ that.saveImage();
|
|
|
107
|
+ }
|
|
66
|
108
|
}
|
|
67
|
109
|
});
|
|
68
|
|
-
|
|
69
|
110
|
});
|
|
70
|
111
|
},
|
|
71
|
|
- saveImage: function (item) {
|
|
|
112
|
+ saveImage: function() {
|
|
|
113
|
+ var item = QuestionList;
|
|
|
114
|
+
|
|
72
|
115
|
var that = this;
|
|
73
|
116
|
var ctx = wx.createCanvasContext("Canvas", that);
|
|
74
|
117
|
ctx.setFillStyle('white');
|
|
75
|
|
- ctx.fillRect(0, 0, 1050, 1485);
|
|
|
118
|
+ ctx.fillRect(0, 0, 2100, 2970);
|
|
|
119
|
+ ctx.fillStyle = "#000000";
|
|
|
120
|
+
|
|
|
121
|
+ //计算数组最大长度
|
|
|
122
|
+ var maxLength = 0;
|
|
|
123
|
+ for (var l = 0; l < item.QuestionList.length; l++) {
|
|
|
124
|
+ var num1 = item.QuestionList[l];
|
|
|
125
|
+ if (num1.Vertical) {
|
|
|
126
|
+ for (var n = 0; n < num1.Vertical.length; n++) {
|
|
|
127
|
+ if (maxLength < num1.Vertical[n].Array.length)
|
|
|
128
|
+ maxLength = num1.Vertical[n].Array.length;
|
|
|
129
|
+ }
|
|
|
130
|
+ }
|
|
|
131
|
+ }
|
|
|
132
|
+
|
|
|
133
|
+ var xStart = 60;
|
|
|
134
|
+ var yStart = 247;
|
|
|
135
|
+
|
|
|
136
|
+ var height = 150;
|
|
|
137
|
+ if (item.QuestionTypeCategory == 2)
|
|
|
138
|
+ height = 59;
|
|
|
139
|
+ if (item.PageCount == 18)
|
|
|
140
|
+ height = 210;
|
|
|
141
|
+ else if (item.PageCount == 15)
|
|
|
142
|
+ height = 250;
|
|
|
143
|
+ //括号
|
|
|
144
|
+ var index = 0;
|
|
|
145
|
+ ctx.setFontSize(12);
|
|
|
146
|
+ for (var i = 0; i < 3; i++) {
|
|
|
147
|
+ for (var j = 0; j < item.PageCount / 3; j++) {
|
|
|
148
|
+ index++;
|
|
|
149
|
+ ctx.fillText("(", xStart + i * 310, yStart + j * height);
|
|
|
150
|
+ ctx.fillText(")", xStart + i * 310 + 22, yStart + j * height);
|
|
|
151
|
+ }
|
|
|
152
|
+ }
|
|
|
153
|
+
|
|
|
154
|
+ //编号
|
|
|
155
|
+ index = 0;
|
|
|
156
|
+ ctx.setTextAlign('center');
|
|
|
157
|
+ var numberLeft = 12;
|
|
|
158
|
+ if (isAndroid)
|
|
|
159
|
+ numberLeft = 14;
|
|
|
160
|
+ for (var i = 0; i < 3; i++) {
|
|
|
161
|
+ for (var j = 0; j < item.PageCount / 3; j++) {
|
|
|
162
|
+ index++;
|
|
|
163
|
+ ctx.fillText(index, xStart + i * 310 + numberLeft, yStart + j * height);
|
|
|
164
|
+ }
|
|
|
165
|
+ }
|
|
|
166
|
+
|
|
|
167
|
+ //算式
|
|
|
168
|
+ index = 0;
|
|
|
169
|
+ ctx.setFontSize(24);
|
|
|
170
|
+ for (var i = 0; i < 3; i++) {
|
|
|
171
|
+ for (var j = 0; j < item.PageCount / 3; j++) {
|
|
|
172
|
+ index++;
|
|
|
173
|
+
|
|
|
174
|
+ //横式
|
|
|
175
|
+ if (item.QuestionTypeCategory == 2) {
|
|
|
176
|
+
|
|
|
177
|
+ var A = item.QuestionList[index - 1].A.toString();
|
|
|
178
|
+ if (item.QuestionList[index - 1].HiddenColumn == "A")
|
|
|
179
|
+ A = "____";
|
|
|
180
|
+ var OperateAB = item.QuestionList[index - 1].OperateAB.toString();
|
|
|
181
|
+ console.log(OperateAB);
|
|
|
182
|
+ var B = item.QuestionList[index - 1].B.toString();
|
|
|
183
|
+ if (item.QuestionList[index - 1].HiddenColumn == "B")
|
|
|
184
|
+ B = "____";
|
|
|
185
|
+ var equation = A + " " + OperateAB + " " + B;
|
|
|
186
|
+ if (item.QuestionList[index - 1].C) {
|
|
|
187
|
+ var OperateBC = item.QuestionList[index - 1].OperateBC.toString();
|
|
|
188
|
+ var C = item.QuestionList[index - 1].C.toString();
|
|
|
189
|
+ equation += " " + OperateBC + " " + C;
|
|
|
190
|
+ if (item.QuestionList[index - 1].D) {
|
|
|
191
|
+ var OperateCD = item.QuestionList[index - 1].OperateCD.toString();
|
|
|
192
|
+ var D = item.QuestionList[index - 1].D.toString();
|
|
|
193
|
+ equation += " " + OperateCD + " " + D;
|
|
|
194
|
+ }
|
|
|
195
|
+ }
|
|
|
196
|
+ equation += " = ";
|
|
|
197
|
+ var R = item.QuestionList[index - 1].R.toString();
|
|
|
198
|
+ if (item.QuestionList[index - 1].HiddenColumn == "R")
|
|
|
199
|
+ R = "";
|
|
|
200
|
+ equation += R;
|
|
|
201
|
+
|
|
|
202
|
+ var num = xStart + i * 310 + 31;
|
|
|
203
|
+
|
|
|
204
|
+ for (var n = 0; n < equation.length; n++) {
|
|
|
205
|
+ var len = getLength(equation[n]);
|
|
|
206
|
+ num += len;
|
|
|
207
|
+ if (equation[n] == ".") {
|
|
|
208
|
+ ctx.fillText(equation[n], num + 3, yStart + j * 59);
|
|
|
209
|
+ } else {
|
|
|
210
|
+ var h = 0;
|
|
|
211
|
+ if (equation[n] == "_")
|
|
|
212
|
+ h = 8;
|
|
|
213
|
+ ctx.fillText(equation[n], num, yStart + j * 59 + h);
|
|
|
214
|
+ }
|
|
|
215
|
+ }
|
|
|
216
|
+ }
|
|
|
217
|
+ //竖式
|
|
|
218
|
+ else if (item.QuestionTypeCategory == 3) {
|
|
|
219
|
+
|
|
|
220
|
+ var num1 = item.QuestionList[index - 1];
|
|
|
221
|
+ var isAnswer = false;
|
|
|
222
|
+
|
|
|
223
|
+ var width = 250;
|
|
|
224
|
+ if (num1.OperateAB == "÷")
|
|
|
225
|
+ width = 240;
|
|
|
226
|
+
|
|
|
227
|
+ //console.log(num1);
|
|
|
228
|
+ for (var n = 0; n < num1.Vertical.length; n++) {
|
|
|
229
|
+ if (maxLength > num1.Vertical[n].Array.length) {
|
|
|
230
|
+ if (num1.OperateAB != "÷")
|
|
|
231
|
+ num1.Vertical[n].Array.splice(1, 0, "");
|
|
|
232
|
+ }
|
|
|
233
|
+ }
|
|
|
234
|
+ console.log(num1);
|
|
|
235
|
+
|
|
|
236
|
+
|
|
|
237
|
+ for (var n = 0; n < num1.Vertical.length; n++) {
|
|
|
238
|
+ var num = xStart + i * 310 + width;
|
|
|
239
|
+ for (var m = num1.Vertical[n].Array.length - 1; m >= 0; m--) {
|
|
|
240
|
+ var str = "";
|
|
|
241
|
+ if (num1.Vertical[n].Type == "line") {
|
|
|
242
|
+
|
|
|
243
|
+ var lineLength = num1.Vertical[n].Array.length * 30 + 20;
|
|
|
244
|
+ if (num1.OperateAB == "÷") {
|
|
|
245
|
+ lineLength = num1.A.toString().length * 30;
|
|
|
246
|
+ }
|
|
|
247
|
+ ctx.moveTo(num, yStart + j * height + n * 30);
|
|
|
248
|
+ ctx.lineTo(num - lineLength, yStart + j * height + n * 30);
|
|
|
249
|
+ ctx.stroke();
|
|
|
250
|
+
|
|
|
251
|
+ if (num1.OperateAB != "÷")
|
|
|
252
|
+ isAnswer = true;
|
|
|
253
|
+ break;
|
|
|
254
|
+ }
|
|
|
255
|
+ else {
|
|
|
256
|
+ str = num1.Vertical[n].Array[m];
|
|
|
257
|
+
|
|
|
258
|
+ if (num1.OperateAB == "÷" && str == "√") {
|
|
|
259
|
+ isAnswer = true;
|
|
|
260
|
+ ctx.drawImage("../../images/formula_division_size02.png", num - (num1.Vertical[n].Array.length - m) * 30 - 20, yStart + j * height + n * 30 - 31, 56, 76);
|
|
|
261
|
+ //break;
|
|
|
262
|
+ }
|
|
|
263
|
+ else if (num1.OperateAB == "÷" && n == 0) {
|
|
|
264
|
+ }
|
|
|
265
|
+ else if (num1.OperateAB == "÷" && n == 1) {
|
|
|
266
|
+ ctx.fillText(str, num - (num1.Vertical[n].Array.length - m) * 10, yStart + j * height + n * 30);
|
|
|
267
|
+ }
|
|
|
268
|
+ else {
|
|
|
269
|
+ ctx.fillText(str, num - (num1.Vertical[n].Array.length - m) * 30, yStart + j * height + n * 30);
|
|
|
270
|
+ }
|
|
|
271
|
+ }
|
|
|
272
|
+
|
|
|
273
|
+ }
|
|
|
274
|
+ if (isAnswer)
|
|
|
275
|
+ break;
|
|
|
276
|
+ }
|
|
|
277
|
+
|
|
|
278
|
+ }
|
|
|
279
|
+ }
|
|
|
280
|
+ }
|
|
|
281
|
+
|
|
76
|
282
|
ctx.setTextAlign('left');
|
|
77
|
283
|
ctx.setTextBaseline('top');
|
|
78
|
|
- ctx.fillStyle = "#000000";
|
|
79
|
284
|
ctx.setFontSize(32);
|
|
80
|
285
|
ctx.fillText(item.Name, 60, 45);
|
|
|
286
|
+ ctx.fillText("99", 835, 50);
|
|
81
|
287
|
|
|
82
|
288
|
|
|
83
|
289
|
ctx.setFontSize(12);
|
|
|
@@ -90,88 +296,54 @@ Page({
|
|
90
|
296
|
ctx.fillText("出题时间 " + item.CreateTime, 875, 94);
|
|
91
|
297
|
ctx.fillText("微信扫一扫 计时看答案", 875, 111);
|
|
92
|
298
|
ctx.fillText("《数学计算题》选题 打印 扫码 批改", 875, 137);
|
|
93
|
|
- ctx.setFontSize(32);
|
|
94
|
|
- ctx.fillText("99", 875, 50);
|
|
95
|
299
|
ctx.drawImage("../../images/answer.png", 890, 54, 100, 100);
|
|
96
|
300
|
|
|
97
|
|
- ctx.setTextBaseline('middle');
|
|
98
|
|
- var xStart = 60;
|
|
99
|
|
- var yStart = 247;
|
|
100
|
|
- var index = 0;
|
|
101
|
|
- for (var i = 0; i < 3; i++) {
|
|
102
|
|
- for (var j = 0; j < 20; j++) {
|
|
103
|
|
- index++;
|
|
104
|
|
- ctx.setTextAlign('left');
|
|
105
|
|
- ctx.setFontSize(12);
|
|
106
|
|
- ctx.fillText("(", xStart + i * 310, yStart + j * 59);
|
|
107
|
|
- ctx.setTextAlign('center');
|
|
108
|
|
- ctx.fillText(index, xStart + i * 310 + 13, yStart + j * 59);
|
|
109
|
|
- ctx.setTextAlign('left');
|
|
110
|
|
- ctx.fillText(")", xStart + i * 310 + 22, yStart + j * 59);
|
|
111
|
|
-
|
|
112
|
|
- ctx.setFontSize(24);
|
|
113
|
|
-
|
|
114
|
|
- var A = item.QuestionList[index - 1].A.toString();
|
|
115
|
|
- if (item.QuestionList[index - 1].HiddenColumn == "A")
|
|
116
|
|
- A = "____";
|
|
117
|
|
- var OperateAB = item.QuestionList[index - 1].OperateAB.toString();
|
|
118
|
|
- console.log(OperateAB);
|
|
119
|
|
- var B = item.QuestionList[index - 1].B.toString();
|
|
120
|
|
- if (item.QuestionList[index - 1].HiddenColumn == "B")
|
|
121
|
|
- B = "____";
|
|
122
|
|
- var equation = A + " " + OperateAB + " " + B;
|
|
123
|
|
- if (item.QuestionList[index - 1].C) {
|
|
124
|
|
- var OperateBC = item.QuestionList[index - 1].OperateBC.toString();
|
|
125
|
|
- var C = item.QuestionList[index - 1].C.toString();
|
|
126
|
|
- equation += " " + OperateBC + " " + C;
|
|
127
|
|
- if (item.QuestionList[index - 1].D) {
|
|
128
|
|
- var OperateCD = item.QuestionList[index - 1].OperateCD.toString();
|
|
129
|
|
- var D = item.QuestionList[index - 1].D.toString();
|
|
130
|
|
- equation += " " + OperateCD + " " + D;
|
|
131
|
|
- }
|
|
132
|
|
- }
|
|
133
|
|
- equation += " = ";
|
|
134
|
|
- var R = item.QuestionList[index - 1].R.toString();
|
|
135
|
|
- if (item.QuestionList[index - 1].HiddenColumn == "R")
|
|
136
|
|
- R = "";
|
|
137
|
|
- equation += R;
|
|
138
|
|
-
|
|
139
|
|
- var num = xStart + i * 310 + 31;
|
|
140
|
|
- ctx.setTextAlign('center');
|
|
141
|
|
- for (var n = 0; n < equation.length; n++) {
|
|
142
|
|
- var len = getLength(equation[n]);
|
|
143
|
|
- num += len;
|
|
144
|
|
- if (equation[n] == ".") {
|
|
145
|
|
- ctx.fillText(equation[n], num + 3, yStart + j * 59);
|
|
146
|
|
- } else {
|
|
147
|
|
- var h = 0;
|
|
148
|
|
- if (equation[n] == "_")
|
|
149
|
|
- h = 8;
|
|
150
|
|
- ctx.fillText(equation[n], num, yStart + j * 59 + h);
|
|
151
|
|
- }
|
|
152
|
|
- }
|
|
153
|
|
- }
|
|
154
|
|
- }
|
|
155
|
|
-
|
|
|
301
|
+ ctx.draw(true, function(n) {
|
|
|
302
|
+ var w = 1050,
|
|
|
303
|
+ h = 1485;
|
|
156
|
304
|
|
|
157
|
|
- ctx.draw(true, function (n) {
|
|
158
|
|
- var w=1050,h=1485;
|
|
159
|
|
-
|
|
160
|
305
|
|
|
161
|
306
|
wx.canvasToTempFilePath({
|
|
162
|
307
|
x: 0,
|
|
163
|
308
|
y: 0,
|
|
164
|
|
- width: w*times,
|
|
165
|
|
- height: h*times,
|
|
|
309
|
+ width: w * times,
|
|
|
310
|
+ height: h * times,
|
|
166
|
311
|
//destWidth: w*times,
|
|
167
|
312
|
//destHeight: h*times,
|
|
168
|
313
|
canvasId: 'Canvas',
|
|
169
|
|
- success: function (res2) {
|
|
|
314
|
+ success: function(res2) {
|
|
170
|
315
|
console.log(res2.tempFilePath);
|
|
171
|
|
- wx.previewImage({
|
|
172
|
|
- current: res2.tempFilePath, // 当前显示图片的http链接
|
|
173
|
|
- urls: [res2.tempFilePath] // 需要预览的图片http链接列表
|
|
174
|
|
- });
|
|
|
316
|
+
|
|
|
317
|
+ wx.saveImageToPhotosAlbum({
|
|
|
318
|
+ filePath: res2.tempFilePath,
|
|
|
319
|
+ success(res3) {
|
|
|
320
|
+ console.log("save:" + res3.savedFilePath);
|
|
|
321
|
+ that.data.arrPage.push(res2.tempFilePath);
|
|
|
322
|
+
|
|
|
323
|
+ that.setData({
|
|
|
324
|
+ arrPage: that.data.arrPage,
|
|
|
325
|
+ });
|
|
|
326
|
+
|
|
|
327
|
+ if (that.data.arrPage.length < that.data.PageNumber) {
|
|
|
328
|
+ pageIndex++;
|
|
|
329
|
+ that.saveImage();
|
|
|
330
|
+ } else {
|
|
|
331
|
+ that.setData({
|
|
|
332
|
+ ShowLoading: false,
|
|
|
333
|
+ });
|
|
|
334
|
+
|
|
|
335
|
+ wx.previewImage({
|
|
|
336
|
+ current: that.data.arrPage[0], // 当前显示图片的http链接
|
|
|
337
|
+ urls: that.data.arrPage // 需要预览的图片http链接列表
|
|
|
338
|
+ });
|
|
|
339
|
+ }
|
|
|
340
|
+ },
|
|
|
341
|
+ fail(err3) {
|
|
|
342
|
+ console.log(err3);
|
|
|
343
|
+
|
|
|
344
|
+ },
|
|
|
345
|
+ })
|
|
|
346
|
+
|
|
175
|
347
|
}
|
|
176
|
348
|
})
|
|
177
|
349
|
});
|
|
|
@@ -197,31 +369,53 @@ Page({
|
|
197
|
369
|
}
|
|
198
|
370
|
|
|
199
|
371
|
},
|
|
200
|
|
- changePageNumber: function (e) {
|
|
|
372
|
+ changePageNumber: function(e) {
|
|
201
|
373
|
var id = Number(e.currentTarget.dataset.id);
|
|
202
|
|
- this.data.PageNumber+=id;
|
|
203
|
|
- if (this.data.PageNumber<1)
|
|
204
|
|
- this.data.PageNumber=1;
|
|
205
|
|
- else if (this.data.PageNumber > 5)
|
|
206
|
|
- this.data.PageNumber = 5;
|
|
|
374
|
+ this.data.PageNumber += id;
|
|
|
375
|
+ if (this.data.PageNumber < 1)
|
|
|
376
|
+ this.data.PageNumber = 1;
|
|
|
377
|
+ else if (this.data.PageNumber > 8)
|
|
|
378
|
+ this.data.PageNumber = 8;
|
|
207
|
379
|
|
|
208
|
380
|
this.setData({
|
|
209
|
381
|
PageNumber: this.data.PageNumber,
|
|
210
|
382
|
});
|
|
211
|
383
|
},
|
|
212
|
|
- menuClick: function (e) {
|
|
|
384
|
+ showImage:function(e){
|
|
|
385
|
+ var that = this;
|
|
|
386
|
+ var id=e.currentTarget.dataset.id;
|
|
|
387
|
+ wx.previewImage({
|
|
|
388
|
+ current: that.data.arrPage[id], // 当前显示图片的http链接
|
|
|
389
|
+ urls: that.data.arrPage // 需要预览的图片http链接列表
|
|
|
390
|
+ });
|
|
|
391
|
+ },
|
|
|
392
|
+ closeLoading:function(){
|
|
|
393
|
+ var that=this;
|
|
|
394
|
+ that.setData({
|
|
|
395
|
+ ShowLoading: false,
|
|
|
396
|
+ IsFinished:false,
|
|
|
397
|
+ });
|
|
|
398
|
+ },
|
|
|
399
|
+ menuClick: function(e) {
|
|
213
|
400
|
this.data.filter = e.currentTarget.dataset.id;
|
|
|
401
|
+ if (this.data.filter == "horizontal") {
|
|
|
402
|
+ this.data.PageCount = this.data.QuestionTypeItem.QuestionNumber2;
|
|
|
403
|
+ } else if (this.data.filter == "vertical") {
|
|
|
404
|
+ this.data.PageCount = this.data.QuestionTypeItem.QuestionNumber3;
|
|
|
405
|
+ }
|
|
|
406
|
+
|
|
214
|
407
|
this.setData({
|
|
215
|
408
|
filter: this.data.filter,
|
|
216
|
409
|
IsShowMenu: false,
|
|
|
410
|
+ PageCount: this.data.PageCount,
|
|
217
|
411
|
});
|
|
218
|
412
|
},
|
|
219
|
|
- closeMenu: function () {
|
|
|
413
|
+ closeMenu: function() {
|
|
220
|
414
|
this.setData({
|
|
221
|
415
|
IsShowMenu: false,
|
|
222
|
416
|
});
|
|
223
|
417
|
},
|
|
224
|
|
- openMenu: function () {
|
|
|
418
|
+ openMenu: function() {
|
|
225
|
419
|
this.setData({
|
|
226
|
420
|
IsShowMenu: true,
|
|
227
|
421
|
});
|