|
|
@@ -62,8 +62,7 @@ function getLocalHost(callback) {
|
|
62
|
62
|
callback();
|
|
63
|
63
|
},
|
|
64
|
64
|
});
|
|
65
|
|
- }
|
|
66
|
|
- else {
|
|
|
65
|
+ } else {
|
|
67
|
66
|
app.globalData.serverUrl = app.globalData.serverUrlServer;
|
|
68
|
67
|
callback();
|
|
69
|
68
|
}
|
|
|
@@ -88,7 +87,7 @@ function payMoney(payType, remark, money, detail, callback) {
|
|
88
|
87
|
if (res.code) {
|
|
89
|
88
|
console.log('获取用户登录态成功!' + res.code);
|
|
90
|
89
|
//预支付
|
|
91
|
|
- getData('ProductPayLogin500?code=' + res.code + '&payType=7&money=' + money + '&detail=' + detail + '&productID=' + app.globalData.ProgramID+'&Remark='+remark, function (data) {
|
|
|
90
|
+ getData('ProductPayLogin500?code=' + res.code + '&payType=7&money=' + money + '&detail=' + detail + '&productID=' + app.globalData.ProgramID + '&Remark=' + remark, function (data) {
|
|
92
|
91
|
if (data && data.timeStamp) {
|
|
93
|
92
|
//微信支付
|
|
94
|
93
|
wx.requestPayment({
|
|
|
@@ -104,8 +103,7 @@ function payMoney(payType, remark, money, detail, callback) {
|
|
104
|
103
|
'fail': function (err) {
|
|
105
|
104
|
if (err && err.errMsg && err.errMsg.indexOf("fail cancel")) {
|
|
106
|
105
|
|
|
107
|
|
- }
|
|
108
|
|
- else {
|
|
|
106
|
+ } else {
|
|
109
|
107
|
wx.showToast({
|
|
110
|
108
|
title: '服务器忙,请稍候再试!',
|
|
111
|
109
|
duration: 3000
|
|
|
@@ -135,8 +133,7 @@ function getTimeFormat(duration) {
|
|
135
|
133
|
if (duration.indexOf(".") > 0) {
|
|
136
|
134
|
arr[1] = duration.substring(duration.indexOf("'") + 1, duration.indexOf(".") + 1);
|
|
137
|
135
|
arr[2] = duration.substring(duration.indexOf(".") + 1, duration.indexOf('"'));
|
|
138
|
|
- }
|
|
139
|
|
- else {
|
|
|
136
|
+ } else {
|
|
140
|
137
|
arr[1] = duration.substring(duration.indexOf("'") + 1, duration.indexOf('"'));
|
|
141
|
138
|
}
|
|
142
|
139
|
return arr;
|
|
|
@@ -148,15 +145,14 @@ function getWindowHeight() {
|
|
148
|
145
|
//console.log("app.globalData.systemInfo.windowHeight:" + app.globalData.systemInfo.windowHeight * 2);
|
|
149
|
146
|
if (app.globalData.systemInfo.model) {
|
|
150
|
147
|
if (height == 504 && (
|
|
151
|
|
- app.globalData.systemInfo.model.indexOf("iPhone 6<") >= 0
|
|
152
|
|
- || app.globalData.systemInfo.model.indexOf("iPhone 7<") >= 0
|
|
153
|
|
- || app.globalData.systemInfo.model.indexOf("iPhone 6s<") >= 0
|
|
154
|
|
- || app.globalData.systemInfo.model.indexOf("iPhone 5") >= 0
|
|
155
|
|
- || app.globalData.systemInfo.model.indexOf("iPhone SE") >= 0
|
|
156
|
|
- )) {
|
|
|
148
|
+ app.globalData.systemInfo.model.indexOf("iPhone 6<") >= 0 ||
|
|
|
149
|
+ app.globalData.systemInfo.model.indexOf("iPhone 7<") >= 0 ||
|
|
|
150
|
+ app.globalData.systemInfo.model.indexOf("iPhone 6s<") >= 0 ||
|
|
|
151
|
+ app.globalData.systemInfo.model.indexOf("iPhone 5") >= 0 ||
|
|
|
152
|
+ app.globalData.systemInfo.model.indexOf("iPhone SE") >= 0
|
|
|
153
|
+ )) {
|
|
157
|
154
|
height = 596;
|
|
158
|
|
- }
|
|
159
|
|
- else if (app.globalData.systemInfo.model.indexOf("iPad") >= 0) {
|
|
|
155
|
+ } else if (app.globalData.systemInfo.model.indexOf("iPad") >= 0) {
|
|
160
|
156
|
height = 470;
|
|
161
|
157
|
}
|
|
162
|
158
|
}
|
|
|
@@ -164,8 +160,7 @@ function getWindowHeight() {
|
|
164
|
160
|
height = height * 2;
|
|
165
|
161
|
if (app.globalData.systemInfo.system && app.globalData.systemInfo.system.indexOf("Android") >= 0) {
|
|
166
|
162
|
height = height + 168;
|
|
167
|
|
- }
|
|
168
|
|
- else {
|
|
|
163
|
+ } else {
|
|
169
|
164
|
height = height + 50;
|
|
170
|
165
|
}
|
|
171
|
166
|
//console.log("height:" + height);
|
|
|
@@ -192,8 +187,7 @@ function getStorageValue(obj, name, defaultStatus, callback) {
|
|
192
|
187
|
}
|
|
193
|
188
|
|
|
194
|
189
|
function getProgramList() {
|
|
195
|
|
- return [
|
|
196
|
|
- {
|
|
|
190
|
+ return [{
|
|
197
|
191
|
id: 89,
|
|
198
|
192
|
appId: 'wx46a7b4c420e6d38f',
|
|
199
|
193
|
path: 'pages/index/start?SourceID=' + app.globalData.ProgramID,
|
|
|
@@ -222,13 +216,13 @@ function gotoFeedback() {
|
|
222
|
216
|
wx.navigateToMiniProgram({
|
|
223
|
217
|
appId: "wx80059777521b897c",
|
|
224
|
218
|
path: "pages/index/feedback",
|
|
225
|
|
- extraData: {
|
|
226
|
|
- },
|
|
|
219
|
+ extraData: {},
|
|
227
|
220
|
success(res) {
|
|
228
|
221
|
// 打开成功
|
|
229
|
222
|
}
|
|
230
|
223
|
});
|
|
231
|
224
|
}
|
|
|
225
|
+
|
|
232
|
226
|
function changeViewToString(content) {
|
|
233
|
227
|
var str = content;
|
|
234
|
228
|
if (str.constructor == Array) {
|
|
|
@@ -289,22 +283,23 @@ function DecryptUrl(str) {
|
|
289
|
283
|
|
|
290
|
284
|
function changeStringToView(field) {
|
|
291
|
285
|
var result = {};
|
|
292
|
|
- result.Field = [[]];
|
|
|
286
|
+ result.Field = [
|
|
|
287
|
+ []
|
|
|
288
|
+ ];
|
|
293
|
289
|
result.Images = [];
|
|
294
|
290
|
|
|
295
|
291
|
for (var j = 0; j < field.length; j++) {
|
|
296
|
292
|
if (j == 0) {
|
|
297
|
293
|
if (field[j].ContentType == 0 && field[j].Content && field[j].Content.length > 0) {
|
|
298
|
294
|
result.Tags = field[j].Content.toString().split(",");
|
|
299
|
|
- }
|
|
300
|
|
- else {
|
|
|
295
|
+ } else {
|
|
301
|
296
|
result.Tags = [];
|
|
302
|
297
|
}
|
|
303
|
|
- }
|
|
304
|
|
- else {
|
|
|
298
|
+ } else {
|
|
305
|
299
|
if (field[j].ContentType == j && field[j].Content && field[j].Content.length > 0) {
|
|
306
|
300
|
|
|
307
|
|
- var arrResult = [], arrSoundMark = [];
|
|
|
301
|
+ var arrResult = [],
|
|
|
302
|
+ arrSoundMark = [];
|
|
308
|
303
|
var str = field[j].Content.toString();
|
|
309
|
304
|
|
|
310
|
305
|
str = DecryptUrl(str);
|
|
|
@@ -333,8 +328,7 @@ function changeStringToView(field) {
|
|
333
|
328
|
obj.Height = Math.round((w * Number(obj.Height)) / Number(obj.Width));
|
|
334
|
329
|
obj.Width = w;
|
|
335
|
330
|
|
|
336
|
|
- }
|
|
337
|
|
- else {
|
|
|
331
|
+ } else {
|
|
338
|
332
|
obj.Width = "";
|
|
339
|
333
|
obj.Height = "";
|
|
340
|
334
|
}
|
|
|
@@ -345,10 +339,10 @@ function changeStringToView(field) {
|
|
345
|
339
|
}
|
|
346
|
340
|
arrResult.push(obj);
|
|
347
|
341
|
|
|
348
|
|
- }
|
|
349
|
|
- else if ((arr[k].indexOf("[线]") >= 0 && arr[k].indexOf("[/线]") > 0) || (arr[k].indexOf("[光]") >= 0 && arr[k].indexOf("[/光]") > 0)) {
|
|
|
342
|
+ } else if ((arr[k].indexOf("[线]") >= 0 && arr[k].indexOf("[/线]") > 0) || (arr[k].indexOf("[光]") >= 0 && arr[k].indexOf("[/光]") > 0)) {
|
|
350
|
343
|
var obj;
|
|
351
|
|
- var content = [], temp = arr[k];
|
|
|
344
|
+ var content = [],
|
|
|
345
|
+ temp = arr[k];
|
|
352
|
346
|
do {
|
|
353
|
347
|
var num1 = temp.indexOf("[线]");
|
|
354
|
348
|
var num2 = temp.indexOf("[光]");
|
|
|
@@ -360,16 +354,14 @@ function changeStringToView(field) {
|
|
360
|
354
|
key: "normal",
|
|
361
|
355
|
value: temp1,
|
|
362
|
356
|
});
|
|
363
|
|
- }
|
|
364
|
|
- else {
|
|
|
357
|
+ } else {
|
|
365
|
358
|
if (arr[k].indexOf("[线]") > 0) {
|
|
366
|
359
|
content.push({
|
|
367
|
360
|
key: "normal",
|
|
368
|
361
|
value: temp,
|
|
369
|
362
|
});
|
|
370
|
363
|
temp = "";
|
|
371
|
|
- }
|
|
372
|
|
- else {
|
|
|
364
|
+ } else {
|
|
373
|
365
|
if (temp && temp.indexOf("[线]") < 0) {
|
|
374
|
366
|
content.push({
|
|
375
|
367
|
key: "normal",
|
|
|
@@ -379,24 +371,21 @@ function changeStringToView(field) {
|
|
379
|
371
|
}
|
|
380
|
372
|
}
|
|
381
|
373
|
}
|
|
382
|
|
- }
|
|
383
|
|
- else if ((num1 > num2 && num1 >= 0 && num2 >= 0) || (num1 < 0 && num2 >= 0)) {
|
|
|
374
|
+ } else if ((num1 > num2 && num1 >= 0 && num2 >= 0) || (num1 < 0 && num2 >= 0)) {
|
|
384
|
375
|
var temp1 = temp.substring(0, temp.indexOf("[光]"));
|
|
385
|
376
|
if (temp1) {
|
|
386
|
377
|
content.push({
|
|
387
|
378
|
key: "normal",
|
|
388
|
379
|
value: temp1,
|
|
389
|
380
|
});
|
|
390
|
|
- }
|
|
391
|
|
- else {
|
|
|
381
|
+ } else {
|
|
392
|
382
|
if (arr[k].indexOf("[光]") > 0) {
|
|
393
|
383
|
content.push({
|
|
394
|
384
|
key: "normal",
|
|
395
|
385
|
value: temp,
|
|
396
|
386
|
});
|
|
397
|
387
|
temp = "";
|
|
398
|
|
- }
|
|
399
|
|
- else {
|
|
|
388
|
+ } else {
|
|
400
|
389
|
if (temp && temp.indexOf("[光]") < 0) {
|
|
401
|
390
|
content.push({
|
|
402
|
391
|
key: "normal",
|
|
|
@@ -406,16 +395,14 @@ function changeStringToView(field) {
|
|
406
|
395
|
}
|
|
407
|
396
|
}
|
|
408
|
397
|
}
|
|
409
|
|
- }
|
|
410
|
|
- else {
|
|
|
398
|
+ } else {
|
|
411
|
399
|
content.push({
|
|
412
|
400
|
key: "normal",
|
|
413
|
401
|
value: temp,
|
|
414
|
402
|
});
|
|
415
|
403
|
temp = "";
|
|
416
|
404
|
}
|
|
417
|
|
- }
|
|
418
|
|
- else {
|
|
|
405
|
+ } else {
|
|
419
|
406
|
content.push({
|
|
420
|
407
|
key: "normal",
|
|
421
|
408
|
value: temp,
|
|
|
@@ -436,8 +423,7 @@ function changeStringToView(field) {
|
|
436
|
423
|
}
|
|
437
|
424
|
|
|
438
|
425
|
temp = temp.substr(temp.indexOf("[/线]") + 4);
|
|
439
|
|
- }
|
|
440
|
|
- else if ((num1 > num2 && num1 >= 0 && num2 >= 0) || (num1 < 0 && num2 >= 0)) {
|
|
|
426
|
+ } else if ((num1 > num2 && num1 >= 0 && num2 >= 0) || (num1 < 0 && num2 >= 0)) {
|
|
441
|
427
|
temp = temp.substr(temp.indexOf("[光]") + 3);
|
|
442
|
428
|
|
|
443
|
429
|
temp1 = temp.substring(0, temp.indexOf("[/光]"));
|
|
|
@@ -449,11 +435,9 @@ function changeStringToView(field) {
|
|
449
|
435
|
}
|
|
450
|
436
|
|
|
451
|
437
|
temp = temp.substr(temp.indexOf("[/光]") + 4);
|
|
452
|
|
- }
|
|
453
|
|
- else
|
|
|
438
|
+ } else
|
|
454
|
439
|
temp = "";
|
|
455
|
|
- }
|
|
456
|
|
- else
|
|
|
440
|
+ } else
|
|
457
|
441
|
temp = "";
|
|
458
|
442
|
|
|
459
|
443
|
}
|
|
|
@@ -464,21 +448,18 @@ function changeStringToView(field) {
|
|
464
|
448
|
obj.Type = "line";
|
|
465
|
449
|
obj.Content = content;
|
|
466
|
450
|
arrResult.push(obj);
|
|
467
|
|
- }
|
|
468
|
|
- else if (arr[k].indexOf("[读") >= 0 && arr[k].indexOf("[/读]") > 0) {
|
|
|
451
|
+ } else if (arr[k].indexOf("[读") >= 0 && arr[k].indexOf("[/读]") > 0) {
|
|
469
|
452
|
var obj = {};
|
|
470
|
453
|
obj.Type = "sound";
|
|
471
|
454
|
if (arr[k].indexOf("[读]") >= 0) {
|
|
472
|
455
|
obj.Content = arr[k].substring(arr[k].indexOf("[读]") + 3, arr[k].indexOf("[/读]"));
|
|
473
|
|
- }
|
|
474
|
|
- else {
|
|
|
456
|
+ } else {
|
|
475
|
457
|
var tempIndex = arr[k].indexOf("\']") + 2;
|
|
476
|
458
|
obj.Content = arr[k].substring(tempIndex, arr[k].indexOf("[/读]"));
|
|
477
|
459
|
obj.SoundMark = arr[k].substring(arr[k].indexOf("src='") + 5, arr[k].indexOf("']"));;
|
|
478
|
460
|
}
|
|
479
|
461
|
arrResult.push(obj);
|
|
480
|
|
- }
|
|
481
|
|
- else if (arr[k].indexOf("[音") >= 0 && arr[k].indexOf("[/音]") > 0) {
|
|
|
462
|
+ } else if (arr[k].indexOf("[音") >= 0 && arr[k].indexOf("[/音]") > 0) {
|
|
482
|
463
|
var obj = {};
|
|
483
|
464
|
obj.Type = "recorder";
|
|
484
|
465
|
|
|
|
@@ -487,14 +468,12 @@ function changeStringToView(field) {
|
|
487
|
468
|
obj.SoundMark = arr[k].substring(arr[k].indexOf("url='") + 5, arr[k].indexOf("']"));;
|
|
488
|
469
|
|
|
489
|
470
|
arrResult.push(obj);
|
|
490
|
|
- }
|
|
491
|
|
- else if (arr[k] != "") {
|
|
|
471
|
+ } else if (arr[k] != "") {
|
|
492
|
472
|
var obj = {};
|
|
493
|
473
|
obj.Type = "normal";
|
|
494
|
474
|
obj.Content = arr[k];
|
|
495
|
475
|
arrResult.push(obj);
|
|
496
|
|
- }
|
|
497
|
|
- else if (k > 0 && arr[k] == "") {
|
|
|
476
|
+ } else if (k > 0 && arr[k] == "") {
|
|
498
|
477
|
var obj = {};
|
|
499
|
478
|
obj.Type = "br";
|
|
500
|
479
|
obj.Content = "";
|
|
|
@@ -506,16 +485,16 @@ function changeStringToView(field) {
|
|
506
|
485
|
}
|
|
507
|
486
|
|
|
508
|
487
|
//去掉前回车换行
|
|
509
|
|
- while (arrResult[0].Type == "return"
|
|
510
|
|
- || arrResult[0].Type == "br") {
|
|
|
488
|
+ while (arrResult[0].Type == "return" ||
|
|
|
489
|
+ arrResult[0].Type == "br") {
|
|
511
|
490
|
arrResult.shift();
|
|
512
|
491
|
if (arrResult.length == 0)
|
|
513
|
492
|
break;
|
|
514
|
493
|
}
|
|
515
|
494
|
//去掉后回车换行
|
|
516
|
495
|
for (var i = arrResult.length - 1; i >= 0; i--) {
|
|
517
|
|
- if (arrResult[i].Type == "return"
|
|
518
|
|
- || arrResult[i].Type == "br")
|
|
|
496
|
+ if (arrResult[i].Type == "return" ||
|
|
|
497
|
+ arrResult[i].Type == "br")
|
|
519
|
498
|
arrResult.pop();
|
|
520
|
499
|
else {
|
|
521
|
500
|
break;
|
|
|
@@ -523,8 +502,7 @@ function changeStringToView(field) {
|
|
523
|
502
|
}
|
|
524
|
503
|
result.Field.push(arrResult);
|
|
525
|
504
|
|
|
526
|
|
- }
|
|
527
|
|
- else {
|
|
|
505
|
+ } else {
|
|
528
|
506
|
result.Field.push([]);
|
|
529
|
507
|
}
|
|
530
|
508
|
}
|
|
|
@@ -625,7 +603,10 @@ function saveTempImage(serverUrl, tempUrl) {
|
|
625
|
603
|
}
|
|
626
|
604
|
}
|
|
627
|
605
|
if (!b) {
|
|
628
|
|
- list.push({ "ServerUrl": serverUrl, "TempUrl": tempUrl });
|
|
|
606
|
+ list.push({
|
|
|
607
|
+ "ServerUrl": serverUrl,
|
|
|
608
|
+ "TempUrl": tempUrl
|
|
|
609
|
+ });
|
|
629
|
610
|
}
|
|
630
|
611
|
|
|
631
|
612
|
if (list.length > 200) {
|
|
|
@@ -647,8 +628,7 @@ function UploadUserConfig() {
|
|
647
|
628
|
param1.SecondConfigArray = wx.getStorageSync("SecondConfigArray");
|
|
648
|
629
|
param1.ColorIndexArr = wx.getStorageSync("ColorIndexArr");
|
|
649
|
630
|
|
|
650
|
|
- that.postData('UploadUserConfig?Type=update&UserID=' + app.globalData.userInfo.UserID, param1, function (data) {
|
|
651
|
|
- });
|
|
|
631
|
+ that.postData('UploadUserConfig?Type=update&UserID=' + app.globalData.userInfo.UserID, param1, function (data) {});
|
|
652
|
632
|
}
|
|
653
|
633
|
|
|
654
|
634
|
function UpdateMiaoguoCardTodayAll(isShowLoading, callback) {
|
|
|
@@ -694,8 +674,7 @@ function UpdateMiaoguoCardTodayAll(isShowLoading, callback) {
|
|
694
|
674
|
callback();
|
|
695
|
675
|
}
|
|
696
|
676
|
});
|
|
697
|
|
- }
|
|
698
|
|
- else {
|
|
|
677
|
+ } else {
|
|
699
|
678
|
wx.hideLoading();
|
|
700
|
679
|
clearTimeout(dataSendTimeout);
|
|
701
|
680
|
if (callback) {
|
|
|
@@ -714,9 +693,9 @@ function updateSearchList(obj) {
|
|
714
|
693
|
obj.Key = obj.Key.substring(1, obj.Key.length - 1);
|
|
715
|
694
|
}
|
|
716
|
695
|
for (var i = 0; i < arr.length; i++) {
|
|
717
|
|
- if (arr[i].Key == obj.Key
|
|
718
|
|
- && arr[i].Type == obj.Type
|
|
719
|
|
- && arr[i].Author == obj.Author
|
|
|
696
|
+ if (arr[i].Key == obj.Key &&
|
|
|
697
|
+ arr[i].Type == obj.Type &&
|
|
|
698
|
+ arr[i].Author == obj.Author
|
|
720
|
699
|
) {
|
|
721
|
700
|
if (obj.Type == "shici") {
|
|
722
|
701
|
if (arr[i].ShiciUrl == obj.ShiciUrl) {
|
|
|
@@ -724,8 +703,7 @@ function updateSearchList(obj) {
|
|
724
|
703
|
arr.splice(i, 1);
|
|
725
|
704
|
break;
|
|
726
|
705
|
}
|
|
727
|
|
- }
|
|
728
|
|
- else {
|
|
|
706
|
+ } else {
|
|
729
|
707
|
obj.Value = arr[i].Value;
|
|
730
|
708
|
arr.splice(i, 1);
|
|
731
|
709
|
break;
|
|
|
@@ -746,8 +724,8 @@ function updateSearchList(obj) {
|
|
746
|
724
|
|
|
747
|
725
|
function checkIsIPhoneX() {
|
|
748
|
726
|
var isIphoneX = false;
|
|
749
|
|
- if (app.globalData.systemInfo.model.indexOf("iPhone X") >= 0
|
|
750
|
|
- || app.globalData.systemInfo.model.indexOf("iPhone X") >= 0) {
|
|
|
727
|
+ if (app.globalData.systemInfo.model.indexOf("iPhone X") >= 0 ||
|
|
|
728
|
+ app.globalData.systemInfo.model.indexOf("iPhone X") >= 0) {
|
|
751
|
729
|
isIphoneX = true;
|
|
752
|
730
|
}
|
|
753
|
731
|
return isIphoneX;
|
|
|
@@ -762,8 +740,7 @@ function setCollect(id, collect, callback) {
|
|
762
|
740
|
duration: 2000,
|
|
763
|
741
|
image: "../images/universalpic_fav_white_120x110.png",
|
|
764
|
742
|
});
|
|
765
|
|
- }
|
|
766
|
|
- else {
|
|
|
743
|
+ } else {
|
|
767
|
744
|
wx.showToast({
|
|
768
|
745
|
title: '取消收藏',
|
|
769
|
746
|
duration: 2000,
|
|
|
@@ -828,7 +805,7 @@ function getMemoryLevel(index, number, time) {
|
|
828
|
805
|
}
|
|
829
|
806
|
}
|
|
830
|
807
|
//得到要检验的汉字列表
|
|
831
|
|
-function GetHanziUnitWords(unitsID,testType,callback){
|
|
|
808
|
+function GetHanziUnitWords(unitsID, testType, callback) {
|
|
832
|
809
|
getData('GetHanziUnitWords?UnitID=' + unitsID, function (data) {
|
|
833
|
810
|
if (data) {
|
|
834
|
811
|
var TaskList = [];
|
|
|
@@ -836,15 +813,23 @@ function GetHanziUnitWords(unitsID,testType,callback){
|
|
836
|
813
|
for (var k = 0; k < words.length; k++) {
|
|
837
|
814
|
var taskInfo = {
|
|
838
|
815
|
FontSize: 144,
|
|
839
|
|
- TagWidth:136,
|
|
840
|
|
- Content: [
|
|
841
|
|
- { ContentType: 0, Content: [] },
|
|
842
|
|
- { ContentType: 1, Content: [] },
|
|
843
|
|
- { ContentType: 2, Content: [] },
|
|
|
816
|
+ TagWidth: 136,
|
|
|
817
|
+ Content: [{
|
|
|
818
|
+ ContentType: 0,
|
|
|
819
|
+ Content: []
|
|
|
820
|
+ },
|
|
|
821
|
+ {
|
|
|
822
|
+ ContentType: 1,
|
|
|
823
|
+ Content: []
|
|
|
824
|
+ },
|
|
|
825
|
+ {
|
|
|
826
|
+ ContentType: 2,
|
|
|
827
|
+ Content: []
|
|
|
828
|
+ },
|
|
844
|
829
|
]
|
|
845
|
830
|
};
|
|
846
|
|
- taskInfo.Word=words[k].Name;
|
|
847
|
|
-
|
|
|
831
|
+ taskInfo.Word = words[k].Name;
|
|
|
832
|
+
|
|
848
|
833
|
var pinyinNormal = "(" + getPinyinNormal(words[k].Pinyin) + ")";
|
|
849
|
834
|
taskInfo.ReadString = words[k].Name + pinyinNormal + "," + words[k].CombineWords + "的" + words[k].Name + pinyinNormal;
|
|
850
|
835
|
|
|
|
@@ -853,8 +838,8 @@ function GetHanziUnitWords(unitsID,testType,callback){
|
|
853
|
838
|
var question = words[k].CombineWords;
|
|
854
|
839
|
question = common.ReplaceAllString(question, words[k].Name, "(" + words[k].Name + ")");
|
|
855
|
840
|
taskInfo.Content[1].Content = question;
|
|
856
|
|
-
|
|
857
|
|
-
|
|
|
841
|
+
|
|
|
842
|
+
|
|
858
|
843
|
var answer = "[读 src='" + taskInfo.ReadString + "']" + words[k].Pinyin + "[/读]";
|
|
859
|
844
|
taskInfo.Content[2].Content = answer;
|
|
860
|
845
|
|
|
|
@@ -864,13 +849,12 @@ function GetHanziUnitWords(unitsID,testType,callback){
|
|
864
|
849
|
taskInfo.FontSize = 68;
|
|
865
|
850
|
}
|
|
866
|
851
|
}
|
|
867
|
|
- }
|
|
868
|
|
- else if (testType == "write") {
|
|
|
852
|
+ } else if (testType == "write") {
|
|
869
|
853
|
taskInfo.Content[0].Content = ["怎么写"];
|
|
870
|
854
|
|
|
871
|
855
|
var question = words[k].CombineWords;
|
|
872
|
856
|
var question2 = common.ReplaceAllString(question, words[k].Name, words[k].Pinyin);
|
|
873
|
|
-
|
|
|
857
|
+
|
|
874
|
858
|
question = "[读 src='" + taskInfo.ReadString + "']" + question2 + "[/读]"
|
|
875
|
859
|
taskInfo.Content[1].Content = question;
|
|
876
|
860
|
var answer = words[k].Name;
|
|
|
@@ -892,56 +876,132 @@ function GetHanziUnitWords(unitsID,testType,callback){
|
|
892
|
876
|
}
|
|
893
|
877
|
|
|
894
|
878
|
callback(TaskList);
|
|
895
|
|
- }
|
|
896
|
|
- else{
|
|
|
879
|
+ } else {
|
|
897
|
880
|
callback([]);
|
|
898
|
881
|
}
|
|
899
|
882
|
});
|
|
900
|
883
|
}
|
|
901
|
884
|
|
|
902
|
|
-function GetTestReportInfo(reportid,callback){
|
|
903
|
|
- var UserTestReport=wx.getStorageSync('UserTestReport');
|
|
904
|
|
- var HanziAll=wx.getStorageSync('HanziAll');
|
|
905
|
|
- HanziAll = JSON.parse(HanziAll);
|
|
906
|
|
- for(var n=0;n<UserTestReport.length;n++){
|
|
907
|
|
- if (UserTestReport[n].ID==reportid){
|
|
908
|
|
- var name1=UserTestReport[n].Name[0].split(" ");
|
|
909
|
|
- name1=name1[0]+"识字能力"+name1[2].substr(0,1);
|
|
910
|
|
- var name2=UserTestReport[n].Name[1];
|
|
911
|
|
- for(var i=0;i<HanziAll.length;i++){
|
|
912
|
|
- if (name1==HanziAll[i].Name){
|
|
913
|
|
- for(var j=0;j<HanziAll[i].Units.length;j++){
|
|
914
|
|
- if (name2==HanziAll[i].Units[j].Name){
|
|
915
|
|
- var obj=UserTestReport[n];
|
|
916
|
|
- GetHanziUnitWords(HanziAll[i].Units[j].ID,obj.TestType,function(list){
|
|
917
|
|
- if (list){
|
|
918
|
|
- for(var k=0;k<list.length;k++){
|
|
919
|
|
- if (obj.TestRightStr && obj.TestRightStr.indexOf(list[k].Word)>=0)
|
|
920
|
|
- list[k].Result=1;
|
|
921
|
|
- else if (obj.TestWrongStr && obj.TestWrongStr.indexOf(list[k].Word)>=0)
|
|
922
|
|
- list[k].Result=-1;
|
|
923
|
|
- else if (obj.TestSkipStr && obj.TestSkipStr.indexOf(list[k].Word)>=0)
|
|
924
|
|
- list[k].Result=0;
|
|
925
|
|
-
|
|
926
|
|
- if (obj.TestExistStr && obj.TestExistStr.indexOf(list[k].Word)>=0)
|
|
927
|
|
- list[k].Css="Select2";
|
|
928
|
|
-
|
|
929
|
|
- }
|
|
930
|
|
- var result={};
|
|
931
|
|
- result.ID=reportid;
|
|
932
|
|
- result.TestType=obj.TestType;
|
|
933
|
|
- result.Name=obj.Name.join("#");
|
|
934
|
|
- result.IsFinished=obj.IsFinished;
|
|
935
|
|
- result.TestRightStr=obj.TestRightStr;
|
|
936
|
|
- result.TestWrongStr=obj.TestWrongStr;
|
|
937
|
|
- result.TestSkipStr=obj.TestSkipStr;
|
|
938
|
|
- result.TestExistStr=obj.TestExistStr;
|
|
939
|
|
- result.List=list;
|
|
940
|
|
- callback(result);
|
|
941
|
|
- }
|
|
942
|
|
- else
|
|
943
|
|
- callback({});
|
|
944
|
|
- });
|
|
|
885
|
+function GetTestReportInfo(reportid, callback) {
|
|
|
886
|
+ var UserTestReport = wx.getStorageSync('UserTestReport');
|
|
|
887
|
+
|
|
|
888
|
+ for (var n = 0; n < UserTestReport.length; n++) {
|
|
|
889
|
+ if (UserTestReport[n].ID == reportid) {
|
|
|
890
|
+ var name1 = UserTestReport[n].Name[0].split(" ");
|
|
|
891
|
+ var name2 = UserTestReport[n].Name[1];
|
|
|
892
|
+
|
|
|
893
|
+ if (name1[0].indexOf("英语") >= 0) {
|
|
|
894
|
+ //todo
|
|
|
895
|
+ //console.log("英语");
|
|
|
896
|
+ var arrEnglist = wx.getStorageSync("EnglishAll");
|
|
|
897
|
+ if (arrEnglist)
|
|
|
898
|
+ arrEnglist = JSON.parse(arrEnglist);
|
|
|
899
|
+ else
|
|
|
900
|
+ arrEnglist = [];
|
|
|
901
|
+ var wordStr = "";
|
|
|
902
|
+ for (var i = 0; i < arrEnglist.length; i++) {
|
|
|
903
|
+ if (arrEnglist[i].Name == name1[1]) {
|
|
|
904
|
+ for (var j = 0; j < arrEnglist[i].Units.length; j++) {
|
|
|
905
|
+ if (arrEnglist[i].Units[j].Name == name2) {
|
|
|
906
|
+ wordStr = arrEnglist[i].Units[j].Words.join(",");
|
|
|
907
|
+ break;
|
|
|
908
|
+ }
|
|
|
909
|
+ }
|
|
|
910
|
+ }
|
|
|
911
|
+ }
|
|
|
912
|
+ var userTestReportInfo = UserTestReport[n];
|
|
|
913
|
+ var bookid = Number(name1[1].substr(4)) + 12;
|
|
|
914
|
+
|
|
|
915
|
+ var tempRight = "," + userTestReportInfo.TestRightStr + ",";
|
|
|
916
|
+ var tempWrong = "," + userTestReportInfo.TestWrongStr + ",";
|
|
|
917
|
+ var tempSkip = "," + userTestReportInfo.TestSkipStr + ",";
|
|
|
918
|
+ var tempExist = "," + userTestReportInfo.TestExistStr + ",";
|
|
|
919
|
+ getData('GetTestEnglishWords?UserID=' + app.globalData.userInfo.UserID + '&Words=' + wordStr, function (data) {
|
|
|
920
|
+ if (data) {
|
|
|
921
|
+ var result = {};
|
|
|
922
|
+ result.ID = userTestReportInfo.ID;
|
|
|
923
|
+ result.IsFinished = userTestReportInfo.IsFinished;
|
|
|
924
|
+ result.Name = userTestReportInfo.Name.join("#");
|
|
|
925
|
+ result.TestType = userTestReportInfo.TestType;
|
|
|
926
|
+ result.BookID = bookid;
|
|
|
927
|
+
|
|
|
928
|
+ var TaskList = [];
|
|
|
929
|
+ var words = data;
|
|
|
930
|
+ for (var k = 0; k < words.length; k++) {
|
|
|
931
|
+ var taskInfo = words[k];
|
|
|
932
|
+
|
|
|
933
|
+ taskInfo.TagWidth = 364;
|
|
|
934
|
+ taskInfo.ContentNew = changeStringToView(taskInfo.Content);
|
|
|
935
|
+ if (tempRight.indexOf("," + taskInfo.ID + ",") >= 0)
|
|
|
936
|
+ taskInfo.Result = 1;
|
|
|
937
|
+ if (tempWrong.indexOf("," + taskInfo.ID + ",") >= 0)
|
|
|
938
|
+ taskInfo.Result = -1;
|
|
|
939
|
+ if (tempSkip.indexOf("," + taskInfo.ID + ",") >= 0)
|
|
|
940
|
+ taskInfo.Result = 0;
|
|
|
941
|
+
|
|
|
942
|
+ if (tempExist.indexOf("," + taskInfo.ID + ",") >= 0)
|
|
|
943
|
+ taskInfo.Css = "Select2";
|
|
|
944
|
+
|
|
|
945
|
+ TaskList.push(taskInfo);
|
|
|
946
|
+ }
|
|
|
947
|
+ result.TestRightStr = "";
|
|
|
948
|
+ result.TestWrongStr = "";
|
|
|
949
|
+ result.TestSkipStr = "";
|
|
|
950
|
+ result.TestExistStr = "";
|
|
|
951
|
+ if (userTestReportInfo.TestRightStr)
|
|
|
952
|
+ result.TestRightStr = userTestReportInfo.TestRightStr.join(",");
|
|
|
953
|
+ if (userTestReportInfo.TestWrongStr)
|
|
|
954
|
+ result.TestWrongStr = userTestReportInfo.TestWrongStr.join(",");
|
|
|
955
|
+ if (userTestReportInfo.TestSkipStr)
|
|
|
956
|
+ result.TestSkipStr = userTestReportInfo.TestSkipStr.join(",");
|
|
|
957
|
+ if (userTestReportInfo.TestExistStr)
|
|
|
958
|
+ result.TestExistStr = userTestReportInfo.TestExistStr.join(",");
|
|
|
959
|
+
|
|
|
960
|
+ result.List = TaskList;
|
|
|
961
|
+ callback(result);
|
|
|
962
|
+ } else {
|
|
|
963
|
+ callback({});
|
|
|
964
|
+ }
|
|
|
965
|
+ });
|
|
|
966
|
+
|
|
|
967
|
+ } else {
|
|
|
968
|
+ name1 = name1[0] + "识字能力" + name1[2].substr(0, 1);
|
|
|
969
|
+ var HanziAll = wx.getStorageSync('HanziAll');
|
|
|
970
|
+ HanziAll = JSON.parse(HanziAll);
|
|
|
971
|
+ for (var i = 0; i < HanziAll.length; i++) {
|
|
|
972
|
+ if (name1 == HanziAll[i].Name) {
|
|
|
973
|
+ for (var j = 0; j < HanziAll[i].Units.length; j++) {
|
|
|
974
|
+ if (name2 == HanziAll[i].Units[j].Name) {
|
|
|
975
|
+ var obj = UserTestReport[n];
|
|
|
976
|
+ GetHanziUnitWords(HanziAll[i].Units[j].ID, obj.TestType, function (list) {
|
|
|
977
|
+ if (list) {
|
|
|
978
|
+ for (var k = 0; k < list.length; k++) {
|
|
|
979
|
+ if (obj.TestRightStr && obj.TestRightStr.indexOf(list[k].Word) >= 0)
|
|
|
980
|
+ list[k].Result = 1;
|
|
|
981
|
+ else if (obj.TestWrongStr && obj.TestWrongStr.indexOf(list[k].Word) >= 0)
|
|
|
982
|
+ list[k].Result = -1;
|
|
|
983
|
+ else if (obj.TestSkipStr && obj.TestSkipStr.indexOf(list[k].Word) >= 0)
|
|
|
984
|
+ list[k].Result = 0;
|
|
|
985
|
+
|
|
|
986
|
+ if (obj.TestExistStr && obj.TestExistStr.indexOf(list[k].Word) >= 0)
|
|
|
987
|
+ list[k].Css = "Select2";
|
|
|
988
|
+
|
|
|
989
|
+ }
|
|
|
990
|
+ var result = {};
|
|
|
991
|
+ result.ID = reportid;
|
|
|
992
|
+ result.TestType = obj.TestType;
|
|
|
993
|
+ result.Name = obj.Name.join("#");
|
|
|
994
|
+ result.IsFinished = obj.IsFinished;
|
|
|
995
|
+ result.TestRightStr = obj.TestRightStr;
|
|
|
996
|
+ result.TestWrongStr = obj.TestWrongStr;
|
|
|
997
|
+ result.TestSkipStr = obj.TestSkipStr;
|
|
|
998
|
+ result.TestExistStr = obj.TestExistStr;
|
|
|
999
|
+ result.List = list;
|
|
|
1000
|
+ callback(result);
|
|
|
1001
|
+ } else
|
|
|
1002
|
+ callback({});
|
|
|
1003
|
+ });
|
|
|
1004
|
+ }
|
|
945
|
1005
|
}
|
|
946
|
1006
|
}
|
|
947
|
1007
|
}
|
|
|
@@ -1012,8 +1072,7 @@ function getHanzi(callback) {
|
|
1012
|
1072
|
var arrEng = common.Decrypt(data.EngList);
|
|
1013
|
1073
|
wx.setStorageSync("EnglishAll", arrEng);
|
|
1014
|
1074
|
wx.setStorageSync("HanziUpdateTime", data.UpdateTime);
|
|
1015
|
|
- }
|
|
1016
|
|
- else {
|
|
|
1075
|
+ } else {
|
|
1017
|
1076
|
arr = wx.getStorageSync("HanziAll");
|
|
1018
|
1077
|
if (arr)
|
|
1019
|
1078
|
arr = JSON.parse(arr);
|
|
|
@@ -1056,6 +1115,6 @@ module.exports = {
|
|
1056
|
1115
|
buildInitData: buildInitData,
|
|
1057
|
1116
|
getPinyinNormal: getPinyinNormal,
|
|
1058
|
1117
|
getHanzi: getHanzi,
|
|
1059
|
|
- GetHanziUnitWords:GetHanziUnitWords,
|
|
1060
|
|
- GetTestReportInfo:GetTestReportInfo
|
|
|
1118
|
+ GetHanziUnitWords: GetHanziUnitWords,
|
|
|
1119
|
+ GetTestReportInfo: GetTestReportInfo
|
|
1061
|
1120
|
}
|