chengjie před 6 roky
rodič
revize
dbc894a8f3

Diff nebyl zobrazen, protože je příliš veliký
+ 2 - 2
app.js


+ 0 - 3
pages/main/add.wxss

@@ -187,9 +187,6 @@
187 187
   height:20rpx;
188 188
 }
189 189
 
190
-.panelItem .textLine {
191
-  text-decoration: underline;
192
-}
193 190
 .panelItem .textHighlighter {
194 191
   color:#fff;
195 192
   background-color: #1E1E1E;

+ 3 - 1
pages/main/searchCard.js

@@ -17,7 +17,9 @@ Page({
17 17
       IsShow: app.globalData.userInfo.IsShow,
18 18
     });
19 19
 
20
-    if (new Date().getFullYear()>=2020){
20
+    var year=new Date(app.globalData.userInfo.CreateTime).getFullYear();
21
+    //console.log(year);
22
+    if (new Date().getFullYear()>=2020 && year<2020){
21 23
       that.setData({
22 24
         IsYearReport: true,
23 25
       });

+ 64 - 44
pages/test/index.js

@@ -11,6 +11,11 @@ Page({
11 11
 
12 12
   },
13 13
   onLoad: function (options) {
14
+    if (options.UserID){
15
+      app.globalData.userInfo={};
16
+      app.globalData.userInfo.UserID=options.UserID;
17
+    }
18
+
14 19
     var that = this;
15 20
     that.setData({
16 21
       Containnerheight: main.getWindowHeight(),
@@ -158,40 +163,40 @@ Page({
158 163
             },
159 164
           ]
160 165
         },
161
-        // {
162
-        //   Name: "英语常用词",
163
-        //   Name2: "英语常用词",
164
-        //   Select: "",
165
-        //   List: [
166
-        //     {
167
-        //       ID: 13,
168
-        //       Type: "Word",
169
-        //       Name: "常用词1",
170
-        //       Name2: "词汇1~220",
171
-        //       Finish: 0,
172
-        //       Total: 22,
173
-        //       Image: "../images/examine_subject_b001.png"
174
-        //     },
175
-        //     {
176
-        //       ID: 14,
177
-        //       Type: "Word",
178
-        //       Name: "常用词2",
179
-        //       Name2: "词汇221~500",
180
-        //       Finish: 0,
181
-        //       Total: 28,
182
-        //       Image: "../images/examine_subject_b002.png"
183
-        //     },
184
-        //     {
185
-        //       ID: 15,
186
-        //       Type: "Word",
187
-        //       Name: "常用词3",
188
-        //       Name2: "词汇500~1000",
189
-        //       Finish: 0,
190
-        //       Total: 25,
191
-        //       Image: "../images/examine_subject_b003.png"
192
-        //     },
193
-        //   ]
194
-        // },
166
+        {
167
+          Name: "英语常用词",
168
+          Name2: "英语常用词",
169
+          Select: "",
170
+          List: [
171
+            {
172
+              ID: 13,
173
+              Type: "Word",
174
+              Name: "常用词1",
175
+              Name2: "词汇1~220",
176
+              Finish: 0,
177
+              Total: 22,
178
+              Image: "../images/examine_subject_b001.png"
179
+            },
180
+            {
181
+              ID: 14,
182
+              Type: "Word",
183
+              Name: "常用词2",
184
+              Name2: "词汇221~500",
185
+              Finish: 0,
186
+              Total: 28,
187
+              Image: "../images/examine_subject_b002.png"
188
+            },
189
+            {
190
+              ID: 15,
191
+              Type: "Word",
192
+              Name: "常用词3",
193
+              Name2: "词汇500~1000",
194
+              Finish: 0,
195
+              Total: 50,
196
+              Image: "../images/examine_subject_b003.png"
197
+            },
198
+          ]
199
+        },
195 200
       ],
196 201
     })
197 202
     var userid = app.globalData.userInfo.UserID;
@@ -210,6 +215,31 @@ Page({
210 215
             }
211 216
           }
212 217
           dataTemp.push(data[i]);
218
+
219
+          if (data[i].TestRightStr && data[i].TestRightStr.indexOf("_")>=0){
220
+            data[i].TestRightStr=data[i].TestRightStr.split(",");
221
+          }
222
+          if (!data[i].TestRightStr)
223
+            data[i].TestRightStr="";
224
+
225
+          if (data[i].TestWrongStr && data[i].TestWrongStr.indexOf("_")>=0){
226
+            data[i].TestWrongStr=data[i].TestWrongStr.split(",");
227
+          }
228
+          if (!data[i].TestWrongStr)
229
+            data[i].TestWrongStr="";
230
+
231
+          if (data[i].TestSkipStr && data[i].TestSkipStr.indexOf("_")>=0){
232
+            data[i].TestSkipStr=data[i].TestSkipStr.split(",");
233
+          }
234
+          if (!data[i].TestSkipStr)
235
+            data[i].TestSkipStr="";
236
+
237
+          if (data[i].TestExistStr && data[i].TestExistStr.indexOf("_")>=0){
238
+            data[i].TestExistStr=data[i].TestExistStr.split(",");
239
+          }
240
+          if (!data[i].TestExistStr)
241
+            data[i].TestExistStr="";
242
+                
213 243
         }
214 244
 
215 245
         for (var i = 0; i < dataTemp.length; i++) {
@@ -267,16 +297,6 @@ Page({
267 297
   gotoTestReportInfo: function (e) {
268 298
     var id = e.currentTarget.dataset.id;
269 299
     var userid = app.globalData.userInfo.UserID;
270
-    //todo
271
-    // main.getData('GetTestReportInfo?UserID=' + userid+'&ID='+id, function (data) {
272
-    //   if (data) {
273
-    //     wx.setStorageSync("TestTask", data);
274
-    //     wx.navigateTo({
275
-    //       url: "./report?type=edit",
276
-    //     });
277
-    //   }
278
-    // });
279
-
280 300
     main.GetTestReportInfo(id,function(data){
281 301
         wx.setStorageSync("TestTask", data);
282 302
         wx.navigateTo({

+ 3 - 1
pages/test/index.wxml

@@ -3,7 +3,7 @@
3 3
     <view class="panelTop1">{{GradeArr[TestSelectGrade].Name2}}</view>
4 4
     <view class="panelTop2 FlexRow">
5 5
       <image class="universalpic_menu_blue_26x26" src="../images/universalpic_menu_blue_26x26.png"></image>
6
-      <view>首选年级</view>
6
+      <view>更改科目</view>
7 7
     </view>
8 8
   </view>
9 9
   <view class="panelLine"></view>
@@ -79,9 +79,11 @@
79 79
         <view class='numberContainerFooter112 FlexRow'>
80 80
           <view class='numberContainerFooter1121{{item.Select}}' wx:for="{{GradeArr}}" wx:key="index" catchtap='onSelectGrade' data-value='{{index}}'>{{item.Name2}}</view>
81 81
         </view>
82
+        <view style="width:100%;height:40rpx;"></view>
82 83
       </view>
83 84
     </view>
84 85
   </view>
86
+  
85 87
   <view class='lineFooter'></view>
86 88
   <view class="numberContaineFooter FlexRow" catchtap='closeSelectGrade'>
87 89
     <view>关闭</view>

+ 0 - 1
pages/test/index.wxss

@@ -265,7 +265,6 @@
265 265
 }
266 266
 .numberContainerFooter101{
267 267
   width:100%;
268
-  height: 376rpx;
269 268
   justify-content: flex-start;
270 269
   align-items: flex-start;
271 270
 }

+ 11 - 4
pages/test/item.js

@@ -37,6 +37,7 @@ Page({
37 37
   onLoad: function (options) {
38 38
     var that = this;
39 39
     that.setData({
40
+      BookID:options.bookid,
40 41
       IsShowAnswer: [0, 0],
41 42
       Color: main.getDetailColor(app.globalData.ColorIndex),
42 43
       Containnerheight: main.getWindowHeight(),
@@ -51,6 +52,7 @@ Page({
51 52
       that.initEng(options);
52 53
     }
53 54
     that.getColor();
55
+    
54 56
 
55 57
     isFinished = 0;
56 58
 
@@ -92,9 +94,11 @@ Page({
92 94
       TestType: TestTask2.TestType,
93 95
       TestName1: name[0],
94 96
       TestName2: name[1],
97
+      BookID:TestTask2.BookID,
95 98
     });
96 99
 
97
-    TestTask2.List = common.randomArray(TestTask2.List);
100
+    if (that.data.BookID<=12)
101
+      TestTask2.List = common.randomArray(TestTask2.List);
98 102
 
99 103
     var list = [];
100 104
     var i = 0;
@@ -162,12 +166,12 @@ Page({
162 166
         for (var k = 0; k < words.length; k++) {
163 167
           var taskInfo = words[k];
164 168
 
165
-          taskInfo.TagWidth=216;
169
+          taskInfo.TagWidth=364;
166 170
           taskInfo.ContentNew = main.changeStringToView(taskInfo.Content);
167 171
           TaskList.push(taskInfo);
168 172
         }
169 173
 
170
-        TaskList = common.randomArray(TaskList);
174
+        //TaskList = common.randomArray(TaskList);
171 175
 
172 176
         that.setData({
173 177
           TaskInfo: TaskList[0],
@@ -279,10 +283,12 @@ Page({
279 283
     if (str == "recorder") {
280 284
       url = e.currentTarget.dataset.soundmark;
281 285
     }
282
-    else if (str.indexOf("英 [") >= 0 || str.indexOf("美 [") >= 0) {
286
+    else if (str.indexOf("英 [") >= 0 || str.indexOf("美 [") >= 0 || str.indexOf("baidu.com")>0 || str.indexOf("iciba.com")>0) {
283 287
       str = str.replace("英 [", "[");
284 288
       str = str.replace("美 [", "[");
285 289
       url = e.currentTarget.dataset.soundmark;
290
+      if (!url)
291
+        url=str;
286 292
     }
287 293
     else if (e.currentTarget.dataset.soundmark && e.currentTarget.dataset.soundmark != "undefined") {
288 294
       var soundmark = e.currentTarget.dataset.soundmark;
@@ -397,6 +403,7 @@ Page({
397 403
       TestTask.IsFinished = isFinished;
398 404
       TestTask.Name = this.data.TestName1 + "#" + this.data.TestName2;
399 405
       TestTask.List = TaskList;
406
+      TestTask.BookID=this.data.BookID;
400 407
       wx.setStorageSync("TestTask", TestTask);
401 408
       wx.redirectTo({
402 409
         url: './report?type=new',

+ 37 - 35
pages/test/list.js

@@ -9,19 +9,19 @@ Page({
9 9
     IsSelect: false,
10 10
     ImagePath: app.globalData.uploadImageUrl,
11 11
   },
12
-  onLoad: function(options) {
12
+  onLoad: function (options) {
13 13
     var that = this;
14 14
     that.setData({
15
-      BookID:options.id,
15
+      BookID: options.id,
16 16
       Containnerheight: main.getWindowHeight(),
17 17
       Name1: options.name1,
18 18
     });
19 19
     isClick = true;
20
-    main.getHanzi(function(arr) {
20
+    main.getHanzi(function (arr) {
21 21
       if (!arr) {
22 22
         wx.removeStorageSync("HanziUpdateTime");
23 23
         wx.removeStorageSync("HanziAll");
24
-        main.getHanzi(function(arr) {
24
+        main.getHanzi(function (arr) {
25 25
           that.init(options);
26 26
         });
27 27
       } else {
@@ -29,7 +29,7 @@ Page({
29 29
       }
30 30
     });
31 31
   },
32
-  init: function(options) {
32
+  init: function (options) {
33 33
     var that = this;
34 34
     var name = options.name1;
35 35
     if (name.indexOf(" ") > 0)
@@ -38,9 +38,9 @@ Page({
38 38
       title: name
39 39
     });
40 40
     var arr = [];
41
-    if (that.data.BookID==13 || that.data.BookID==14 || that.data.BookID==15)
41
+    if (that.data.BookID == 13 || that.data.BookID == 14 || that.data.BookID == 15)
42 42
       arr = wx.getStorageSync("EnglishAll");
43
-    else if (that.data.BookID<=12)
43
+    else if (that.data.BookID <= 12)
44 44
       arr = wx.getStorageSync("HanziAll");
45 45
     var testReportList = wx.getStorageSync("UserTestReport");
46 46
     arr = JSON.parse(arr);
@@ -69,12 +69,22 @@ Page({
69 69
             if (testReportList[k].Name[0] == options.name1 &&
70 70
               testReportList[k].Name[1] == list[j].Name) {
71 71
 
72
+              var testRightCount = 0;
73
+              if (testReportList[k].TestRightStr)
74
+                testRightCount = testReportList[k].TestRightStr.length;
75
+              var testWrongCount = 0;
76
+              if (testReportList[k].testWrongStr)
77
+                testWrongCount = testReportList[k].testWrongStr.length;
78
+              var testSkipCount = 0;
79
+              if (testReportList[k].TestSkipStr)
80
+                testSkipCount = testReportList[k].TestSkipStr.length;
81
+
72 82
 
73 83
               if (testReportList[k].TestType == "read") {
74 84
                 if (testReportList[k].IsFinished == 1)
75 85
                   list[j].TestTypeRead = 1;
76 86
 
77
-                if ((testReportList[k].TestRight + testReportList[k].TestWrong + testReportList[k].TestSkip) < testReportList[k].TestTotal) {
87
+                if ((testRightCount + testWrongCount + testSkipCount) < testReportList[k].TestTotal) {
78 88
                   list[j].TestTypeReadFinished = false;
79 89
                 }
80 90
 
@@ -84,7 +94,7 @@ Page({
84 94
                 if (testReportList[k].IsFinished == 1)
85 95
                   list[j].TestTypeWrite = 1;
86 96
 
87
-                if ((testReportList[k].TestRight + testReportList[k].TestWrong + testReportList[k].TestSkip) < testReportList[k].TestTotal) {
97
+                if ((testRightCount + testWrongCount + testSkipCount) < testReportList[k].TestTotal) {
88 98
                   list[j].TestTypeWriteFinished = false;
89 99
                 }
90 100
 
@@ -100,7 +110,7 @@ Page({
100 110
       }
101 111
     }
102 112
   },
103
-  onShowFrame: function(e) {
113
+  onShowFrame: function (e) {
104 114
     var selectItem;
105 115
     var id = e.currentTarget.dataset.id;
106 116
     for (var i = 0; i < this.data.List.length; i++) {
@@ -113,57 +123,49 @@ Page({
113 123
       SelectItem: selectItem,
114 124
     });
115 125
   },
116
-  onClose: function() {
126
+  onClose: function () {
117 127
     this.setData({
118 128
       IsSelect: false,
119 129
     });
120 130
   },
121
-  goto: function(e) {
131
+  goto: function (e) {
122 132
     var url = e.currentTarget.dataset.url;
123 133
     wx.navigateTo({
124 134
       url: url,
125 135
     });
126 136
     this.onClose();
127 137
   },
128
-  gotoTestReportInfo: function(e) {
129
-    var that=this;
138
+  gotoTestReportInfo: function (e) {
139
+    var that = this;
130 140
     if (isClick) {
131
-      isClick=false;
132
-      setTimeout(function(){
133
-        isClick=true;
134
-      },2000);
141
+      isClick = false;
142
+      setTimeout(function () {
143
+        isClick = true;
144
+      }, 2000);
135 145
 
136 146
       var id = e.currentTarget.dataset.id;
137 147
       var userid = app.globalData.userInfo.UserID;
138 148
 
139 149
       if (id) {
140 150
         var reporttype = e.currentTarget.dataset.type;
141
-        // main.getData('GetTestReportInfo?UserID=' + userid + '&ID=' + id, function(data) {
142
-        //   if (data) {
143
-        //     wx.setStorageSync("TestTask2", data);
144
-        //     that.onClose();
145
-        //     wx.navigateTo({
146
-        //       url: "./item?type=" + reporttype,
147
-        //     });
148
-        //   }
149
-        // });
150
-        main.GetTestReportInfo(id,function(data){
151
-          wx.setStorageSync("TestTask2", data);
152
-            that.onClose();
153
-            wx.navigateTo({
154
-              url: "./item?type=" + reporttype,
155
-            });
151
+        main.GetTestReportInfo(id, function (data) {
152
+          data.BookID=that.data.BookID;
153
+          wx.setStorageSync("TestTask2", data); 
154
+          that.onClose();
155
+          wx.navigateTo({
156
+            url: "./item?type=" + reporttype+"&bookid="+that.data.BookID,
157
+          });
156 158
         });
157 159
       } else {
158 160
         that.onClose();
159
-        var url = e.currentTarget.dataset.url;
161
+        var url = e.currentTarget.dataset.url+"&bookid="+that.data.BookID;
160 162
         wx.navigateTo({
161 163
           url: url,
162 164
         });
163 165
       }
164 166
     }
165 167
   },
166
-  onShareAppMessage: function() {
168
+  onShareAppMessage: function () {
167 169
     return {
168 170
       title: app.globalData.ShareTitle,
169 171
       path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,

+ 44 - 29
pages/test/list.wxml

@@ -40,33 +40,25 @@
40 40
 	<view class="SelectContainer1 FlexColumn">
41 41
 		<image src="../images/examine_subjecticon_01.png" class="examine_subjecticon_01" />
42 42
 		<view class="SelectContainer1Text1">{{SelectItem.Name}}</view>
43
-		<view class="SelectContainer1Text2">检验哪个方面</view>
43
+		<view class="SelectContainer1Text2">选择检验方式</view>
44 44
 
45 45
 		<block wx:if="{{BookID<=12}}">
46 46
 			<view class="btnPanel0 FlexRow" bindtap="goto" data-url="./wordlist?type=CHN&unitsid={{UnitsID}}&id={{SelectItem.ID}}">
47 47
 				<image src="../images/universalpic_word_blue_30x30.png" class="universalpic_word_blue_30x30" />
48 48
 				<view class="SelectContainer1Text4">查看字表</view>
49 49
 			</view>
50
-		</block>
51
-		<block wx:if="{{BookID>12}}">
52
-			<view class="btnPanel0 FlexRow" bindtap="goto" data-url="./wordlist?type=ENG&unitsid={{UnitsID}}&id={{SelectItem.ID}}">
53
-				<image src="../images/universalpic_words_blue_30x30.png" class="universalpic_word_blue_30x30" />
54
-				<view class="SelectContainer1Text4">查看词表</view>
55
-			</view>
56
-		</block>
57
-		<view class="btnPanel FlexRow">
58
-			
59
-			<view wx:if="{{SelectItem.TestTypeReadFinished}}" class="btn FlexRow" bindtap="gotoTestReportInfo" data-id="{{SelectItem.ReadReportID}}" data-url="./item?testtype=read&bookid={{BookID}}&unitsid={{SelectItem.ID}}&name1={{Name1}}&name2={{SelectItem.Name}}">
60
-				<image src="../images/examine_willread_gray_30x30.png" class="examine_willread_gray_30x30" />
61
-				<view class="SelectContainer1Text3">会念</view>
62
-			</view>
50
+			<view class="btnPanel FlexRow">
51
+				<view wx:if="{{SelectItem.TestTypeReadFinished}}" class="btn FlexRow" bindtap="gotoTestReportInfo" data-id="{{SelectItem.ReadReportID}}" data-url="./item?testtype=read&bookid={{BookID}}&unitsid={{SelectItem.ID}}&name1={{Name1}}&name2={{SelectItem.Name}}">
52
+					<image src="../images/examine_willread_gray_30x30.png" class="examine_willread_gray_30x30" />
53
+					<view class="SelectContainer1Text3">会念</view>
54
+				</view>
55
+
56
+				<view wx:if="{{!SelectItem.TestTypeReadFinished}}" class="btn FlexRow" bindtap="gotoTestReportInfo" data-id="{{SelectItem.ReadReportID}}" data-type="continue">
57
+					<image src="../images/examine_willread_green_30x30.png" class="examine_willread_gray_30x30" />
58
+					<view class="SelectContainer1Text3">会念 继续检验</view>
59
+				</view>
63 60
 
64
-			<view wx:if="{{!SelectItem.TestTypeReadFinished}}" class="btn FlexRow" bindtap="gotoTestReportInfo" data-id="{{SelectItem.ReadReportID}}" data-type="continue">
65
-				<image src="../images/examine_willread_green_30x30.png" class="examine_willread_gray_30x30" />
66
-				<view class="SelectContainer1Text3">会念 继续检验</view>
67
-			</view>
68 61
 
69
-			<block wx:if="{{BookID<=12}}">
70 62
 				<view wx:if="{{SelectItem.TestTypeWriteFinished}}" class="btn FlexRow" bindtap="gotoTestReportInfo" data-id="{{SelectItem.WriteReportID}}" data-url="./item?testtype=write&bookid={{BookID}}&unitsid={{SelectItem.ID}}&name1={{Name1}}&name2={{SelectItem.Name}}">
71 63
 					<image src="../images/examine_willwrite_gray_27x27.png" class="examine_willwrite_gray_27x27" />
72 64
 					<view class="SelectContainer1Text3">会写</view>
@@ -76,23 +68,46 @@
76 68
 					<image src="../images/examine_willwrite_green_27x27.png" class="examine_willwrite_gray_27x27" />
77 69
 					<view class="SelectContainer1Text3">会写 继续检验</view>
78 70
 				</view>
79
-			</block>
71
+			</view>
80 72
 
73
+			<view class="btnPanel2 FlexRow">
74
+				<view wx:if="{{SelectItem.TestTypeReadFinished}}" class="btnPanel21"></view>
75
+				<view wx:if="{{!SelectItem.TestTypeReadFinished}}" class="btnPanel21" bindtap="gotoTestReportInfo" data-id="{{SelectItem.ReadReportID}}" data-type="restart">
76
+					重新开始
77
+				</view>
81 78
 
82
-		</view>
79
+				<view wx:if="{{SelectItem.TestTypeWriteFinished}}" class="btnPanel21"></view>
80
+				<view wx:if="{{!SelectItem.TestTypeWriteFinished}}" class="btnPanel21" bindtap="gotoTestReportInfo" data-id="{{SelectItem.WriteReportID}}" data-type="restart">
81
+					重新开始
82
+				</view>
83
+			</view>
84
+		</block>
83 85
 
84
-		<view class="btnPanel2 FlexRow">
85
-			<view wx:if="{{SelectItem.TestTypeReadFinished}}" class="btnPanel21"></view>
86
-			<view wx:if="{{!SelectItem.TestTypeReadFinished}}" class="btnPanel21" bindtap="gotoTestReportInfo" data-id="{{SelectItem.ReadReportID}}" data-type="restart">
87
-				重新开始
86
+		<block wx:if="{{BookID>12}}">
87
+			<view class="btnPanel0 FlexRow" bindtap="goto" data-url="./wordlist?type=ENG&unitsid={{UnitsID}}&id={{SelectItem.ID}}">
88
+				<image src="../images/universalpic_words_blue_30x30.png" class="universalpic_word_blue_30x30" />
89
+				<view class="SelectContainer1Text4">查看词表</view>
90
+			</view>
91
+			<view class="btnPanel1">说出单词在句子中的含义</view>
92
+			<view class="btnPanel0 btnPanel FlexRow">
93
+				<view wx:if="{{SelectItem.TestTypeReadFinished}}" class="btn FlexRow" bindtap="gotoTestReportInfo" data-id="{{SelectItem.ReadReportID}}" data-url="./item?testtype=read&bookid={{BookID}}&unitsid={{SelectItem.ID}}&name1={{Name1}}&name2={{SelectItem.Name}}">
94
+					<view class="SelectContainer1Text3">开始检验</view>
95
+				</view>
96
+				<view wx:if="{{!SelectItem.TestTypeReadFinished}}" class="btn FlexRow" bindtap="gotoTestReportInfo" data-id="{{SelectItem.ReadReportID}}" data-type="continue">
97
+					<view class="SelectContainer1Text3">继续检验</view>
98
+				</view>
88 99
 			</view>
89 100
 
90
-			<view wx:if="{{SelectItem.TestTypeWriteFinished}}" class="btnPanel21"></view>
91
-			<view wx:if="{{!SelectItem.TestTypeWriteFinished}}" class="btnPanel21" bindtap="gotoTestReportInfo" data-id="{{SelectItem.WriteReportID}}" data-type="restart">
92
-				重新开始
101
+			<view class="btnPanel2 FlexRow">
102
+				<view wx:if="{{SelectItem.TestTypeReadFinished}}" class="btnPanel21"></view>
103
+				<view wx:if="{{!SelectItem.TestTypeReadFinished}}" class="btnPanel21" bindtap="gotoTestReportInfo" data-id="{{SelectItem.ReadReportID}}" data-type="restart">
104
+					重新开始
105
+				</view>
93 106
 			</view>
94
-		</view>
107
+		</block>
108
+
95 109
 
110
+		<view style="width:100%;height:50rpx;"></view>
96 111
 		<view class="close FlexRow" bindtap="onClose">
97 112
 			<image src="../images/universalpic_close_black_24x24.png" class="universalpic_close_black_24x24" />
98 113
 		</view>

+ 7 - 1
pages/test/list.wxss

@@ -88,7 +88,7 @@
88 88
 
89 89
 .SelectContainer .SelectContainer1{
90 90
   width:710rpx;
91
-  height:613rpx;
91
+  /* height:613rpx; */
92 92
   border-radius: 10rpx;
93 93
   background-color: #F8F8F8;
94 94
   position: relative;
@@ -127,6 +127,12 @@
127 127
   margin-top: 20rpx;
128 128
 }
129 129
 
130
+.btnPanel1{
131
+  margin-top: 60rpx;
132
+  font-size: 28rpx;
133
+  font-weight: 500;
134
+}
135
+
130 136
 
131 137
 .btn{
132 138
   width:315rpx;

+ 93 - 52
pages/test/report.js

@@ -14,7 +14,7 @@ Page({
14 14
   onLoad: function (options) {
15 15
     var that = this;
16 16
     that.setData({
17
-      ReportType:options.type,
17
+      ReportType: options.type,
18 18
       Containnerheight: main.getWindowHeight(),
19 19
     });
20 20
 
@@ -22,26 +22,29 @@ Page({
22 22
   },
23 23
   init: function () {
24 24
     var that = this;
25
+    TestReportID = 0;
25 26
     var TestTask = wx.getStorageSync("TestTask");
26 27
     var list = TestTask.List;
27 28
     var listRight = [];
28 29
     var listSkip = [];
29 30
     var listWrong = [];
30
-    TestTask.TestRightStr=[];
31
-    TestTask.TestWrongStr=[];
32
-    TestTask.TestSkipStr=[];
31
+    TestTask.TestRightStr = [];
32
+    TestTask.TestWrongStr = [];
33
+    TestTask.TestSkipStr = [];
33 34
 
34 35
     if (list) {
35 36
       for (var i = 0; i < list.length; i++) {
37
+        if (TestTask.BookID > 12) {
38
+          list[i].Field1 = list[i].ContentNew.Field[1][0].Content;
39
+          list[i].Word = list[i].ID;
40
+        }
36 41
         if (list[i].Result == 1) {
37 42
           listRight.push(list[i]);
38 43
           TestTask.TestRightStr.push(list[i].Word);
39
-        }
40
-        else if (list[i].Result == -1) {
44
+        } else if (list[i].Result == -1) {
41 45
           listWrong.push(list[i]);
42 46
           TestTask.TestWrongStr.push(list[i].Word);
43
-        }
44
-        else if (list[i].Result == 0) {
47
+        } else if (list[i].Result == 0) {
45 48
           listSkip.push(list[i]);
46 49
           TestTask.TestSkipStr.push(list[i].Word);
47 50
         }
@@ -49,44 +52,67 @@ Page({
49 52
 
50 53
       var result = [];
51 54
       if (listWrong.length > 0) {
52
-        result.push({ Name: "答错的题目", Expand: 1, List: listWrong });
55
+        result.push({
56
+          Name: "答错的题目",
57
+          Expand: 1,
58
+          List: listWrong
59
+        });
53 60
         if (listSkip.length > 0)
54
-          result.push({ Name: "跳过的题目", Expand: 1, List: listSkip });
61
+          result.push({
62
+            Name: "跳过的题目",
63
+            Expand: 1,
64
+            List: listSkip
65
+          });
55 66
         if (listRight.length > 0)
56
-          result.push({ Name: "答对的题目", Expand: 1, List: listRight });
57
-      }
58
-      else {
67
+          result.push({
68
+            Name: "答对的题目",
69
+            Expand: 1,
70
+            List: listRight
71
+          });
72
+      } else {
59 73
         if (listSkip.length > 0) {
60
-          result.push({ Name: "跳过的题目", Expand: 1, List: listSkip });
74
+          result.push({
75
+            Name: "跳过的题目",
76
+            Expand: 1,
77
+            List: listSkip
78
+          });
61 79
           if (listRight.length > 0)
62
-            result.push({ Name: "答对的题目", Expand: 1, List: listRight });
63
-        }
64
-        else {
80
+            result.push({
81
+              Name: "答对的题目",
82
+              Expand: 1,
83
+              List: listRight
84
+            });
85
+        } else {
65 86
           if (listRight.length > 0)
66
-            result.push({ Name: "答对的题目", Expand: 1, List: listRight });
87
+            result.push({
88
+              Name: "答对的题目",
89
+              Expand: 1,
90
+              List: listRight
91
+            });
67 92
         }
68 93
       }
69 94
 
70 95
       var name = "";
71
-      if (TestTask.Name && TestTask.Name.indexOf("#")>0){
72
-        name=TestTask.Name;
73
-        name=name.substr(name.indexOf("#")+1);
74
-        if (TestTask.TestType=="read")
75
-          name+=" 会念";
96
+      if (TestTask.Name && TestTask.Name.indexOf("#") > 0) {
97
+        name = TestTask.Name;
98
+        name = name.substr(name.indexOf("#") + 1);
99
+        if (TestTask.TestType == "read")
100
+          name += " 会念";
76 101
         else
77
-          name+=" 会写";
102
+          name += " 会写";
78 103
       }
79 104
 
80 105
       that.setData({
81 106
         NumberWrong: listWrong.length,
82 107
         NumberSkip: listSkip.length,
83 108
         NumberRight: listRight.length,
109
+        BookID: Number(TestTask.BookID),
84 110
         Name: name,
85 111
         List: result,
86 112
         NumberTotal: list.length,
87 113
       });
88
-      
89
-      if (that.data.ReportType=="new")
114
+
115
+      if (that.data.ReportType == "new")
90 116
         that.saveInfo(TestTask);
91 117
 
92 118
       wx.setNavigationBarTitle({
@@ -117,14 +143,12 @@ Page({
117 143
           that.setData({
118 144
             List: that.data.List,
119 145
           });
120
-        }
121
-        else if (that.data.List[index].List[i].Css == "Select2") {
146
+        } else if (that.data.List[index].List[i].Css == "Select2") {
122 147
           wx.showToast({
123 148
             title: '已经生成过了',
124 149
             image: "../images/universalpic_ribbon_white_96x120.png",
125 150
           });
126
-        }
127
-        else {
151
+        } else {
128 152
           that.data.List[index].List[i].Css = "Select";
129 153
           that.setData({
130 154
             List: that.data.List,
@@ -133,11 +157,11 @@ Page({
133 157
         break;
134 158
       }
135 159
     }
136
-
137 160
   },
138 161
   buildCard: function () {
139 162
     var that = this;
140
-    var arr = [],TestExistStr=[];
163
+    var arr = [],
164
+      TestExistStr = [];
141 165
     for (var i = 0; i < that.data.List.length; i++) {
142 166
       for (var j = 0; j < that.data.List[i].List.length; j++) {
143 167
         if (that.data.List[i].List[j].Css === "Select") {
@@ -147,14 +171,15 @@ Page({
147 171
           obj.Field2 = item.Content[2].Content;
148 172
           obj.Field3 = "";
149 173
           obj.Tags = item.Content[0].Content;
174
+          if (!common.checkIsArray(obj.Tags))
175
+            obj.Tags = obj.Tags.split(",");
150 176
           obj.IsTodayStudy = 0;
151 177
           obj.ID = 0;
152 178
           obj.LimitTime = common.formatTime(new Date());
153 179
           obj.FontSize = item.FontSize;
154 180
           arr.push(obj);
155 181
           TestExistStr.push(item.Word);
156
-        }
157
-        else if (that.data.List[i].List[j].Css === "Select2") {
182
+        } else if (that.data.List[i].List[j].Css === "Select2") {
158 183
           var item = that.data.List[i].List[j];
159 184
           TestExistStr.push(item.Word);
160 185
         }
@@ -175,16 +200,16 @@ Page({
175 200
         });
176 201
         if (buildCardNumber >= arr.length) {
177 202
           clearInterval(intervalBuild);
178
-          var TestTask={};
179
-          TestTask.TestExistStr=TestExistStr;
203
+          var TestTask = {};
204
+          TestTask.TestExistStr = TestExistStr;
205
+          
180 206
           that.saveInfo(TestTask);
181 207
           that.setData({
182 208
             IsBuild: 2,
183 209
           });
184 210
         }
185 211
       }, 500);
186
-    }
187
-    else {
212
+    } else {
188 213
       wx.showToast({
189 214
         title: '先选题目',
190 215
         image: "../images/universalpic_wrong_white_120x120.png",
@@ -200,9 +225,9 @@ Page({
200 225
   },
201 226
   close: function (e) {
202 227
     wx.removeStorageSync("TestTask");
203
-    var delta=2;
204
-    if (this.data.ReportType=="edit")
205
-      delta=1;
228
+    var delta = 2;
229
+    if (this.data.ReportType == "edit")
230
+      delta = 1;
206 231
     wx.navigateBack({
207 232
       delta: delta,
208 233
     });
@@ -212,20 +237,37 @@ Page({
212 237
     clearInterval(intervalBuild);
213 238
     var userid = app.globalData.userInfo.UserID;
214 239
     var param1 = wx.getStorageSync("TestTask");
215
-    param1.TestTotal = param1.List.length;
240
+    if (param1.List)
241
+      param1.TestTotal = param1.List.length;
242
+
243
+    var symbol="";
244
+    if (that.data.BookID > 12) {
245
+      symbol=","
246
+    }
216 247
     if (TestTask.TestRightStr)
217
-      param1.TestRightStr=TestTask.TestRightStr.join("");
248
+      param1.TestRightStr = TestTask.TestRightStr.join(symbol);
218 249
     if (TestTask.TestWrongStr)
219
-      param1.TestWrongStr=TestTask.TestWrongStr.join("");
250
+      param1.TestWrongStr = TestTask.TestWrongStr.join(symbol);
220 251
     if (TestTask.TestSkipStr)
221
-      param1.TestSkipStr=TestTask.TestSkipStr.join("");
252
+      param1.TestSkipStr = TestTask.TestSkipStr.join(symbol);
222 253
     if (TestTask.TestExistStr)
223
-      param1.TestExistStr=TestTask.TestExistStr.join("");
224
-    //param1.List = JSON.stringify(param1.List);
254
+      param1.TestExistStr = TestTask.TestExistStr.join(symbol);
255
+
256
+    
257
+
258
+    if (TestReportID)
259
+      param1.ID = TestReportID;
260
+
261
+    param1.BookID=that.data.BookID;
262
+    wx.setStorageSync('TestTask', param1);
263
+    
225 264
     delete param1.List;
265
+    delete param1.BookID;
266
+
226 267
     main.postData('InsertTestReport?UserID=' + userid, param1, function (data) {
227
-      if (data)
268
+      if (data){
228 269
         TestReportID = data;
270
+      }
229 271
     });
230 272
   },
231 273
   gotoReport: function (e) {
@@ -234,11 +276,10 @@ Page({
234 276
         title: '已经完成!',
235 277
         image: "../images/universalpic_wrong_white_120x120.png",
236 278
       });
237
-    }
238
-    else {
279
+    } else {
239 280
       var testTask = wx.getStorageSync("TestTask");
240 281
       if (TestReportID)
241
-        testTask.ID = TestReportID;
282
+        testTask.ID=TestReportID;
242 283
       wx.setStorageSync("TestTask2", testTask);
243 284
       var url = "./item?type=edit";
244 285
       wx.redirectTo({
@@ -256,4 +297,4 @@ Page({
256 297
       imageUrl: app.globalData.ShareImage,
257 298
     }
258 299
   },
259
-})
300
+})

+ 9 - 1
pages/test/report.wxml

@@ -15,7 +15,15 @@
15 15
         <image wx:if="{{itemChild.Css=='Select'}}" src="../images/universalpic_checked_white_22x17.png" class="universalpic_checked_white_22x17" />
16 16
         <image wx:if="{{itemChild.Css=='Select2'}}" src="../images/universalpic_bookmark_blue_40x40.png" class="universalpic_bookmark_blue_40x40" />
17 17
         <view wx:if="{{!itemChild.Css}}" class="circle"></view>
18
-        <view class="text4">{{itemChild.Word}}</view>
18
+        
19
+        <text class="text4" wx:if="{{BookID<=12}}">{{itemChild.Word}}</text>
20
+
21
+        <text class="text4 FlexRow" wx:if="{{BookID>12}}">
22
+          <block wx:for="{{itemChild.Field1}}" wx:key="contentIndex" wx:for-item="contentItem">
23
+            <text wx:if="{{contentItem.key=='normal'}}">{{contentItem.value}}</text>
24
+            <text class="textLine" wx:if="{{contentItem.key=='line'}}">{{contentItem.value}}</text>
25
+          </block>
26
+        </text>
19 27
       </view>
20 28
     </block>
21 29
   </view>

+ 10 - 7
pages/test/report.wxss

@@ -63,19 +63,17 @@
63 63
 .btn{
64 64
   min-width: 88rpx;
65 65
   border:1rpx solid #9B9B9B;
66
-  height:100rpx;
67 66
   border-radius: 10rpx;
68 67
   margin: 30rpx 0 0 30rpx;
69
-  padding: 0 30rpx;
68
+  padding: 30rpx;
70 69
   color:#1e1e1e;
71 70
 }
72 71
 
73 72
 .btnSelect{
74 73
   min-width: 88rpx;
75
-  height:100rpx;
76 74
   border-radius: 10rpx;
77 75
   margin: 30rpx 0 0 30rpx;
78
-  padding: 0 30rpx;
76
+  padding: 30rpx;
79 77
 
80 78
   border:1rpx solid #0071EF;
81 79
   background-color: #0071EF;
@@ -85,10 +83,9 @@
85 83
 .btnSelect2{
86 84
   min-width: 88rpx;
87 85
   border:1rpx solid #9B9B9B;
88
-  height:100rpx;
89 86
   border-radius: 10rpx;
90 87
   margin: 30rpx 0 0 30rpx;
91
-  padding: 0 30rpx;
88
+  padding: 30rpx;
92 89
   color:#1e1e1e;
93 90
 }
94 91
 
@@ -111,9 +108,15 @@
111 108
 }
112 109
 
113 110
 .text4{
114
-  margin-left: 20rpx;
115 111
   font-size:28rpx;
116 112
   font-weight: 400;
113
+  max-width: 570rpx;
114
+  margin: 0 0 0 20rpx;
115
+}
116
+
117
+
118
+.panelItem .textLine {
119
+  text-decoration: underline;
117 120
 }
118 121
 
119 122
 .panelFooter{

+ 1 - 1
project.config.json

@@ -110,7 +110,7 @@
110 110
 					"id": 7,
111 111
 					"name": "pages/test/index",
112 112
 					"pathName": "pages/test/index",
113
-					"query": "",
113
+					"query": "UserID=1",
114 114
 					"scene": null
115 115
 				},
116 116
 				{

+ 203 - 144
utils/main.js

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