chengjie 7 lat temu
rodzic
commit
eb79fe83a2
74 zmienionych plików z 658 dodań i 2572 usunięć
  1. 1 1
      app.js
  2. 3 1
      app.json
  3. 1 8
      app.wxss
  4. BIN
      images/Help_aside_answerroom_detail.png
  5. BIN
      images/Help_aside_makepaper_wrong.png
  6. BIN
      images/formula_btn_hide.png
  7. BIN
      images/homepage_headline_illus.png
  8. BIN
      images/homepage_headline_info.png
  9. BIN
      images/homepage_question_illus_grade01.png
  10. BIN
      images/homepage_question_illus_grade02.png
  11. BIN
      images/homepage_question_illus_grade03.png
  12. BIN
      images/homepage_question_illus_grade04.png
  13. BIN
      images/makepaper_headline_illus_lab.png
  14. BIN
      images/makepaper_headline_illus_wrong.png
  15. BIN
      images/programstart_footer_illue.png
  16. BIN
      images/programsystem_screenshot_pic01.png
  17. BIN
      images/programsystem_screenshot_pic02.png
  18. BIN
      images/programsystem_screenshot_pic03.png
  19. BIN
      images/programsystem_screenshot_pic04.png
  20. BIN
      images/programsystem_screenshot_pic05.png
  21. BIN
      images/shopping_guide_bg.png
  22. BIN
      images/shopping_guide_illus_buy.png
  23. BIN
      images/shopping_guide_illus_share.png
  24. BIN
      images/testpaper_code_default_allinone.png
  25. BIN
      images/universalpic_bg_illus01.png
  26. BIN
      images/universalpic_indicator_gray2.png
  27. BIN
      images/universalpic_share_guide_bg.png
  28. BIN
      images/universalpic_wrong_red.png
  29. BIN
      images/welcomeguide_bg.png
  30. BIN
      images/welcomeguide_dialogue.png
  31. BIN
      images/welcomeguide_info.png
  32. 1 2
      pages/about/payfinished.json
  33. 15 13
      pages/main/answer.js
  34. 1 3
      pages/main/answer.json
  35. 5 3
      pages/main/answer.wxml
  36. 24 4
      pages/main/answer.wxss
  37. 17 64
      pages/main/default.js
  38. 1 4
      pages/main/default.json
  39. 9 15
      pages/main/default.wxml
  40. 4 4
      pages/main/default.wxss
  41. 145 57
      pages/main/detail.js
  42. 1 3
      pages/main/detail.json
  43. 44 28
      pages/main/detail.wxml
  44. 29 0
      pages/main/detail.wxss
  45. 57 0
      pages/main/errorlist.js
  46. 6 0
      pages/main/errorlist.json
  47. 54 0
      pages/main/errorlist.wxml
  48. 94 0
      pages/main/errorlist.wxss
  49. 86 16
      pages/main/item.js
  50. 1 3
      pages/main/item.json
  51. 9 5
      pages/main/item.wxml
  52. 21 5
      pages/main/item.wxss
  53. 2 0
      pages/main/list.js
  54. 1 3
      pages/main/list.json
  55. 0 301
      pages/main/print.js
  56. 0 1
      pages/main/print.json
  57. 0 6
      pages/main/print.wxml
  58. 0 26
      pages/main/print.wxss
  59. 13 2
      project.config.json
  60. BIN
      sounds/click.mp3
  61. BIN
      sounds/startend.mp3
  62. 1 11
      utils/cryptojs.js
  63. 0 37
      utils/lib/CryptoMath.js
  64. 0 1003
      utils/lib/DES.js
  65. 0 38
      utils/lib/HMAC.js
  66. 0 117
      utils/lib/MARC4.js
  67. 0 158
      utils/lib/MD5.js
  68. 0 49
      utils/lib/PBKDF2.js
  69. 0 88
      utils/lib/PBKDF2Async.js
  70. 0 221
      utils/lib/Rabbit.js
  71. 0 86
      utils/lib/SHA1.js
  72. 0 130
      utils/lib/SHA256.js
  73. 12 33
      utils/main.js
  74. 0 23
      utils/util.js

+ 1 - 1
app.js

@@ -14,7 +14,7 @@ App({
14 14
     this.globalData.systemInfo = wx.getSystemInfoSync();
15 15
   },
16 16
   globalData: {
17
-    version: "1.0.4",
17
+    version: "1.0.6",
18 18
     IsProduction: true,
19 19
     ProgramID: 105,
20 20
     AppID: "wx1fef080f74481cbd",

+ 3 - 1
app.json

@@ -6,6 +6,7 @@
6 6
     "pages/main/answer",
7 7
     "pages/main/detail",
8 8
     "pages/main/list",
9
+    "pages/main/errorlist",
9 10
     "pages/about/payfinished",
10 11
     "pages/main/default"
11 12
   ],
@@ -14,6 +15,7 @@
14 15
     "navigationBarBackgroundColor": "#fff",
15 16
     "navigationBarTitleText": "数学计算题",
16 17
     "navigationBarTextStyle": "black",
17
-    "backgroundColor":"#000000"
18
+    "backgroundColor": "#000000",
19
+    "enablePullDownRefresh": false
18 20
   }
19 21
 }

Plik diff jest za duży
+ 1 - 8
app.wxss


BIN
images/Help_aside_answerroom_detail.png


BIN
images/Help_aside_makepaper_wrong.png


BIN
images/formula_btn_hide.png


BIN
images/homepage_headline_illus.png


BIN
images/homepage_headline_info.png


BIN
images/homepage_question_illus_grade01.png


BIN
images/homepage_question_illus_grade02.png


BIN
images/homepage_question_illus_grade03.png


BIN
images/homepage_question_illus_grade04.png


BIN
images/makepaper_headline_illus_lab.png


BIN
images/makepaper_headline_illus_wrong.png


BIN
images/programstart_footer_illue.png


BIN
images/programsystem_screenshot_pic01.png


BIN
images/programsystem_screenshot_pic02.png


BIN
images/programsystem_screenshot_pic03.png


BIN
images/programsystem_screenshot_pic04.png


BIN
images/programsystem_screenshot_pic05.png


BIN
images/shopping_guide_bg.png


BIN
images/shopping_guide_illus_buy.png


BIN
images/shopping_guide_illus_share.png


BIN
images/testpaper_code_default_allinone.png


BIN
images/universalpic_bg_illus01.png


BIN
images/universalpic_indicator_gray2.png


BIN
images/universalpic_share_guide_bg.png


BIN
images/universalpic_wrong_red.png


BIN
images/welcomeguide_bg.png


BIN
images/welcomeguide_dialogue.png


BIN
images/welcomeguide_info.png


+ 1 - 2
pages/about/payfinished.json

@@ -2,6 +2,5 @@
2 2
   "navigationBarBackgroundColor": "#99607C",
3 3
   "navigationBarTextStyle": "white",
4 4
   "navigationBarTitleText": "登录",
5
-  "backgroundColor": "#99607C",
6
-  "enablePullDownRefresh": false
5
+  "backgroundColor": "#99607C"
7 6
 }

+ 15 - 13
pages/main/answer.js

@@ -6,8 +6,7 @@ Page({
6 6
   data: {
7 7
     version: app.globalData.version,
8 8
     IsEdit: false,
9
-    ListHeight: 1320,
10
-    ListHeight2: 1490,
9
+    ListHeight2: 600,
11 10
     SelectedCount: 0,
12 11
   },
13 12
   onLoad: function () {
@@ -32,20 +31,12 @@ Page({
32 31
         arr.push(list[i]);
33 32
       }
34 33
 
35
-      var ListHeight = 1320;
36
-      var ListHeight2 = 1490;
37
-      var ListHeight3 = arr.length * 130 + 20;
38
-      if (arr.length > 10) {
39
-        ListHeight = 1320 + (arr.length - 10) * 130;
40
-        ListHeight2 = 1490 + (arr.length - 10) * 130;
41
-      }
42 34
       that.setData({
43 35
         AnswerList: arr,
44
-        ListHeight: ListHeight,
45
-        ListHeight2: ListHeight2,
46
-        ListHeight3: ListHeight3,
47 36
       });
48
-      //console.log(new Date().getTime());
37
+      
38
+      this.setListHeight();
39
+
49 40
       if (arr.length>10){
50 41
         wx.showToast({
51 42
           title:"请删除不用试卷!",
@@ -91,6 +82,7 @@ Page({
91 82
         list.splice(i, 1);
92 83
       }
93 84
     }
85
+    
94 86
     list.sort(function (a, b) {
95 87
       if (a.CreateTime == b.CreateTime) {
96 88
         return b.AnswerID - b.AnswerID;
@@ -102,8 +94,18 @@ Page({
102 94
       AnswerList: list,
103 95
       SelectedCount: 0,
104 96
     });
97
+    this.setListHeight();
105 98
     wx.setStorageSync("AnswerList", list);
106 99
   },
100
+  setListHeight:function(){
101
+    var ListHeight2 = 600;
102
+    if (this.data.AnswerList.length > 3) {
103
+      ListHeight2 = 570 + (this.data.AnswerList.length - 3) * 130;
104
+    }
105
+    this.setData({
106
+      ListHeight2: ListHeight2,
107
+    });
108
+  },
107 109
   btnEdit: function () {
108 110
     var that = this;
109 111
     that.data.IsEdit = !that.data.IsEdit;

+ 1 - 3
pages/main/answer.json

@@ -2,7 +2,5 @@
2 2
   "navigationBarBackgroundColor": "#326FAE",
3 3
   "navigationBarTextStyle": "white",
4 4
   "navigationBarTitleText": "答案资料室",
5
-  "backgroundColor": "#213a53",
6
-  "backgroundTextStyle": "light",
7
-  "enablePullDownRefresh": false
5
+  "backgroundColor": "#213a53"
8 6
 }

+ 5 - 3
pages/main/answer.wxml

@@ -41,7 +41,6 @@
41 41
     </view>
42 42
 
43 43
     <view class="panel01 panel00 FlexRow" bindtap='selectItem'>
44
-
45 44
       <view class="panel000 FlexColumn" style='min-height:{{ListHeight2}}rpx;'>
46 45
         <image class="answerroom_list_conveyer_part_left" src="../../images/answerroom_list_conveyer_part_left.png" />
47 46
         <image class="answerroom_list_conveyer_part_left" src="../../images/answerroom_list_conveyer_part_left.png" />
@@ -57,7 +56,7 @@
57 56
     <view class="line21 line2"></view>
58 57
 
59 58
     <!-- 列表 -->
60
-    <view class="panel0MainBG panel0Main" style='min-height:{{ListHeight2}}rpx;'>
59
+    <view class="panel0MainBG panel0Main" style='min-height:{{ListHeight2-155}}rpx;'>
61 60
       <view class="line2"></view>
62 61
       <view class="item FlexColumn" wx:for="{{AnswerList}}" wx:key="index" bindtap='selectItem' data-id='{{item.AnswerID}}'>
63 62
         <view class="itemLine00 itemLine0"></view>
@@ -77,7 +76,8 @@
77 76
           <view class="title3 FlexRow">
78 77
             <view class="title30">#</view>
79 78
             <view class="title31">{{item.AnswerID}}</view>
80
-
79
+<image wx:if="{{item.IsNew==1}}" class="universalpic_new_red_size01" src="../../images/universalpic_new_red_size01.png" />
80
+            
81 81
           </view>
82 82
         </view>
83 83
         <view class="itemLine1"></view>
@@ -87,6 +87,8 @@
87 87
         </view>
88 88
       </view>
89 89
     </view>
90
+
91
+    <view class="line3"></view>
90 92
   </view>
91 93
 </view>
92 94
 <image hidden="{{HelpHidden5}}" bindtap='closeHelp' class="Help_aside_answerroom_list" src="../../images/Help_aside_answerroom_list.png" />

+ 24 - 4
pages/main/answer.wxss

@@ -136,7 +136,7 @@
136 136
 
137 137
 .panel0 .panel000 {
138 138
   width: 10rpx;
139
-  height: 1490rpx;
139
+  height: 140rpx;
140 140
   background-color: #929292;
141 141
   z-index: 30;
142 142
   justify-content: space-between;
@@ -144,14 +144,14 @@
144 144
 
145 145
 .panel0 .panel001 {
146 146
   width: 20rpx;
147
-  height: 1490rpx;
147
+  height: 140rpx;
148 148
   background-color: #4d4d4d;
149 149
   z-index: 30;
150 150
 }
151 151
 
152 152
 .panel0 .panel0Main {
153 153
   width: 610rpx;
154
-  height: 1320rpx;
154
+  height: 130rpx;
155 155
 }
156 156
 
157 157
 .panel0 .panel0MainBG {
@@ -244,6 +244,15 @@
244 244
   position: relative;
245 245
 }
246 246
 
247
+
248
+.universalpic_new_red_size01{
249
+  width: 70rpx;
250
+  height: 30rpx;
251
+  position: absolute;
252
+  left:40rpx;
253
+  top:-20rpx;
254
+}
255
+
247 256
 .itemChild .title30 {
248 257
   font-size: 20rpx;
249 258
   font-family: 'Roboto-Bold';
@@ -254,7 +263,7 @@
254 263
 
255 264
 .itemChild .title31 {
256 265
   font-size: 38rpx;
257
-  font-family: 'Roboto-Black';
266
+  font-family: 'Roboto-Bold';
258 267
   margin-top: 7rpx;
259 268
 }
260 269
 
@@ -269,6 +278,7 @@
269 278
   height: 320rpx;
270 279
   position: relative;
271 280
   z-index: 20;
281
+  margin-top: -170rpx;
272 282
 }
273 283
 
274 284
 .universalpic_attention_blue_size01 {
@@ -322,3 +332,13 @@
322 332
   bottom: 0rpx;
323 333
   z-index: 200;
324 334
 }
335
+
336
+
337
+.panel0 .line3 {
338
+  width: 670rpx;
339
+  height: 20rpx;
340
+  background-color:rgba(0, 0, 0, 0.2);
341
+  position: absolute;
342
+  top:0;
343
+  z-index: 210;
344
+}

+ 17 - 64
pages/main/default.js

@@ -38,14 +38,19 @@ Page({
38 38
   onShow:function(){
39 39
     var list = wx.getStorageSync("AnswerList");
40 40
     var answerLength = 0;
41
-    var answerNewDate = "";
42 41
     if (list && list.length > 0) {
43 42
       answerLength = list.length;
44
-      answerNewDate = list[0].CreateTime.substr(0, 11);
45 43
     }
44
+    
45
+    var errorCount = 0;
46
+    var listError = wx.getStorageSync("ErrorList");
47
+    if (listError && listError.length > 0) {
48
+      errorCount = listError.length;
49
+    }
50
+    
46 51
     this.setData({
47 52
       AnswerLength: answerLength,
48
-      AnswerNewDate: answerNewDate,
53
+      ErrorCount: errorCount,
49 54
     });
50 55
 
51 56
     var that = this;
@@ -70,6 +75,8 @@ Page({
70 75
     });
71 76
   },
72 77
   gotoList:function(e){
78
+    server.playSound("/sounds/click.mp3");
79
+
73 80
     var id=e.currentTarget.dataset.id;
74 81
     var categoryArray = [{}, { Num: 1, Name: "一年级", Array: [1, 2] }, { Num: 2, Name: "二年级", Array: [3, 4] }, { Num: 3, Name: "三年级", Array: [5, 6] }, { Num: 4,Name: "四年级及以上", Array: [7] }];
75 82
 
@@ -84,70 +91,16 @@ Page({
84 91
       url: '../main/answer',
85 92
     });
86 93
   },
87
-  getBindGetUserInfo(e) {
88
-    console.log(e.detail);
89
-    var that = this;
90
-    var res = e.detail;
91
-    if (res.errMsg && res.errMsg == "getUserInfo:fail auth deny") {
92
-      app.globalData.userInfo.NickName = "陌生用户";
93
-      app.globalData.userInfo.AvatarUrl = "../../images/universalpic_face_default_black_size01.png";
94
-      app.globalData.userInfo.language = "";
95
-      app.globalData.userInfo.gender = "0";
96
-      app.globalData.userInfo.city = "";
97
-      app.globalData.userInfo.province = "";
98
-      app.globalData.userInfo.country = "";
99
-      // that.hasGetShareInfo(app.globalData.userInfo);
100
-      that.setData({
101
-        IsAccredit: false,
102
-      });
103
-    } 
104
-    else {
105
-      var userID = app.globalData.userInfo.UserID;
106
-      app.globalData.userInfo = res.userInfo;
107
-      app.globalData.userInfo.UserID = userID;
108
-      app.globalData.userInfo.NickName = app.globalData.userInfo.nickName;
109
-      app.globalData.userInfo.AvatarUrl = app.globalData.userInfo.avatarUrl;
110
-
111
-      // that.hasGetShareInfo(app.globalData.userInfo);
112
-      that.setData({
113
-        IsAccredit: true,
114
-        NickName: app.globalData.userInfo.NickName,
115
-        AvatarUrl: app.globalData.userInfo.AvatarUrl
116
-      });
117
-
118
-      app.globalData.userInfo.iv = res.iv;
119
-      app.globalData.userInfo.encryptedData = res.encryptedData;
120
-
121
-      app.globalData.userInfo.Code = code;
122
-      that.login(app.globalData.userInfo);
123
-      
124
-    }
94
+  gotoBindGetUserInfo(e) {
95
+    wx.navigateTo({
96
+      url: '../about/payfinished',
97
+    });
125 98
   },
126
-  login: function(param) {
127
-    var that = this;
128
-    server.getLocalHost(function() {
129
-      server.postData('MathLogin', {
130
-        Code: param.Code,
131
-        NickName: param.nickName,
132
-        Language: param.language,
133
-        Gender: param.gender,
134
-        City: param.city,
135
-        Province: param.province,
136
-        Country: param.country,
137
-        AvatarUrl: param.avatarUrl,
138
-        ProgramVersion: app.globalData.version,
139
-        Introducer: app.globalData.introducer,
140
-        UserSource: app.globalData.userSource,
141
-        SourceID: app.globalData.SourceID,
142
-        LastUserSource: app.globalData.userSource,
143
-        iv: param.iv,
144
-        encryptedData: param.encryptedData,
145
-      }, function(data) {
146
-
147
-      });
99
+  gotoErrorList(e) {
100
+    wx.navigateTo({
101
+      url: '../main/detail?id=-1',
148 102
     });
149 103
   },
150
-
151 104
   switchProgram: function(e) {
152 105
     wx.navigateToMiniProgram({
153 106
       appId: e.currentTarget.dataset.appid,

+ 1 - 4
pages/main/default.json

@@ -1,8 +1,5 @@
1 1
 {
2 2
   "navigationBarBackgroundColor": "#B9DC5D",
3 3
   "navigationBarTextStyle": "black",
4
-  "navigationBarTitleText": "数学计算题",
5
-  "backgroundColor": "#583027",
6
-  "backgroundTextStyle": "light",
7
-  "enablePullDownRefresh": false
4
+  "backgroundColor": "#583027"
8 5
 }

+ 9 - 15
pages/main/default.wxml

@@ -30,8 +30,8 @@
30 30
           <view class="panel0020 FlexRow">
31 31
             <view class="panel00200 FlexColumn">
32 32
               <view class="textTitle3">
33
-                <view class="textTitle4">批改</view>
34
-                <view class="textTitle5">批改</view>
33
+                <view class="textTitle4">练习记录</view>
34
+                <view class="textTitle5">练习记录</view>
35 35
               </view>
36 36
               <view class="line3"></view>
37 37
               <view class="panel002000 FlexRow">
@@ -40,24 +40,18 @@
40 40
               </view>
41 41
               <view class="line4 line3"></view>
42 42
               <view class="panel002000 FlexRow">
43
-                <view class="text1">制题日期</view>
44
-                <view class="text">{{AnswerNewDate}}</view>
43
+                <view class="text1">错题数</view>
44
+                <view class="text">{{ErrorCount}}</view>
45 45
               </view>
46 46
               <view class="line4 line3"></view>
47
-              <view class="panel002000 FlexRow">
48
-                <button wx:if="{{!IsAccredit}}" open-type="getUserInfo" class="btn" bindgetuserinfo="getBindGetUserInfo">
47
+              <view class="panel002000 FlexRow" bindtap='gotoErrorList'>
48
+                <button class="btn">
49 49
                   <view class="btn1">
50
-                    登录
50
+                    错题集
51 51
                   </view>
52 52
                 </button>
53 53
 
54
-                <view class="btn2 btn" bindtap='gotoAnswer' wx:if="{{!IsAccredit}}">
55
-                  <view class="btn3 btn1">
56
-                    对答案
57
-                  </view>
58
-                </view>
59
-
60
-                <view class="btn6 btn2 btn' " wx:if="{{IsAccredit}}" bindtap='gotoAnswer'>
54
+                <view class="btn2 btn" bindtap='gotoAnswer'>
61 55
                   <view class="btn3 btn1">
62 56
                     对答案
63 57
                   </view>
@@ -65,7 +59,7 @@
65 59
               </view>
66 60
             </view>
67 61
             <view class="panel00201 FlexRow">
68
-              <image wx:if="{{!IsAccredit}}" class="universalpic_face_default_black_size01" src="../../images/universalpic_face_default_black_size01.png" />
62
+              <image wx:if="{{!IsAccredit}}" class="universalpic_face_default_black_size01" src="../../images/universalpic_face_default_black_size01.png" bindtap='gotoBindGetUserInfo'/>
69 63
               <image wx:if="{{IsAccredit}}" class="universalpic_face_default_black_size01" src="{{AvatarUrl}}" />
70 64
             </view>
71 65
           </view>

+ 4 - 4
pages/main/default.wxss

@@ -163,7 +163,7 @@
163 163
   margin-top: 70rpx;
164 164
   font-weight: 500;
165 165
   position: relative;
166
-  width: 72rpx;
166
+  width: 144rpx;
167 167
   height:50rpx;
168 168
 }
169 169
 .panel00200 .textTitle4 {
@@ -190,7 +190,7 @@
190 190
 }
191 191
 
192 192
 .panel002000 {
193
-  width: 410rpx;
193
+  width: 430rpx;
194 194
   justify-content: space-between;
195 195
   margin-top: 20rpx;
196 196
 }
@@ -203,7 +203,7 @@
203 203
 .btn {
204 204
   width: 208rpx;
205 205
   height: 90rpx;
206
-  background-color: #035834;
206
+  background-color: #98492F;
207 207
   border-radius: 8rpx;
208 208
   position: relative;
209 209
   padding-left: 0;
@@ -218,7 +218,7 @@
218 218
 .btn1 {
219 219
   width: 100%;
220 220
   height: 70rpx;
221
-  background-color: #03af69;
221
+  background-color: #D0603B;
222 222
   border-radius: 8rpx;
223 223
   line-height: 70rpx;
224 224
   text-align: center;

+ 145 - 57
pages/main/detail.js

@@ -5,8 +5,8 @@ const app = getApp();
5 5
 var times = 1;
6 6
 var pageIndex = 0;
7 7
 var QuestionItem = [];
8
-var tempAnswerList=[];
9
-var arrAnswerID=[];
8
+var tempAnswerList = [];
9
+var arrAnswerID = [];
10 10
 var isAndroid = false;
11 11
 const waitTime = ["", "10秒钟", "15秒钟", "20秒钟", "25秒钟"];
12 12
 
@@ -22,11 +22,14 @@ Page({
22 22
     arrPage: [],
23 23
     ShowLoading: false,
24 24
     IsDistabled: "",
25
-    NameClass:"",
25
+    NameClass: "",
26 26
     AddDisabled: "",
27 27
     SubDisabled: "btnAddSubDisabled",
28
-    HelpHidden7:true,
29
-    ShowAndroidNotice:false,
28
+    HelpHidden7: true,
29
+    HelpHidden3: true,
30
+    HelpHidden8: true,
31
+
32
+    ShowAndroidNotice: false,
30 33
   },
31 34
   onLoad: function (options) {
32 35
     var that = this;
@@ -39,7 +42,7 @@ Page({
39 42
     this.setData({
40 43
       Containnerheight: server.getWindowHeight(),
41 44
       ID: id,
42
-      ShowAndroidNotice:isAndroid,
45
+      ShowAndroidNotice: isAndroid,
43 46
     });
44 47
     var systemInfo = wx.getSystemInfoSync();
45 48
     if (systemInfo.system && systemInfo.system.indexOf("Android") >= 0) {
@@ -47,32 +50,50 @@ Page({
47 50
     }
48 51
     this.getDetail(id);
49 52
 
50
-    
51
-    common.getStorageValue(this, "HelpHidden3", false, function () { 
52
-      that.showHelp();
53
-    });
54 53
 
54
+    if (id > 0) {
55
+      common.getStorageValue(this, "HelpHidden3", false, function () {
56
+        that.showHelp();
57
+      });
58
+    }
59
+    else {
60
+      common.getStorageValue(this, "HelpHidden8", false, function () {
61
+        that.showHelp8();
62
+      });
63
+    }
64
+
65
+  },
66
+  onShow:function(){
67
+    if (this.data.ID==-1)
68
+      this.getDetail(this.data.ID);
55 69
   },
56
-  onUnload:function(){
70
+  onUnload: function () {
57 71
     wx.hideLoading();
58 72
   },
59 73
   getDetail: function (id) {
60
-    var item;
61
-    var data = wx.getStorageSync('QuestionTypeList');
62
-    for (var i = 0; i < data.length; i++) {
63
-      for (var k = 0; k < data[i].List.length; k++) {
64
-        if (id == data[i].List[k].ID) {
65
-          item = data[i].List[k];
66
-          item.Example[0] = item.Example[0].replace("+", " + ").replace("-", " - ").replace("×", " × ").replace("÷", " ÷ ");
67
-          item.Example[1] = item.Example[1].replace("+", " + ").replace("-", " - ").replace("×", " × ").replace("÷", " ÷ ");
68
-          item.IconName = app.globalData.fileUrl+item.IconName;
69
-          if (item.Name.length>12)
70
-            item.NameClass="text2";
71
-          break;
74
+    var item = {};
75
+    if (id > 0) {
76
+      var data = wx.getStorageSync('QuestionTypeList');
77
+      for (var i = 0; i < data.length; i++) {
78
+        for (var k = 0; k < data[i].List.length; k++) {
79
+          if (id == data[i].List[k].ID) {
80
+            item = data[i].List[k];
81
+            item.Example[0] = item.Example[0].replace("+", " + ").replace("-", " - ").replace("×", " × ").replace("÷", " ÷ ");
82
+            item.Example[1] = item.Example[1].replace("+", " + ").replace("-", " - ").replace("×", " × ").replace("÷", " ÷ ");
83
+            item.IconName = app.globalData.fileUrl + item.IconName;
84
+            if (item.Name.length > 12)
85
+              item.NameClass = "text2";
86
+            break;
87
+          }
72 88
         }
73 89
       }
74 90
     }
75
-    
91
+    else {
92
+      item.Name = "我的错题集";
93
+      var list = wx.getStorageSync('ErrorList');
94
+      item.ErrorList = list;
95
+    }
96
+
76 97
     this.setData({
77 98
       QuestionTypeItem: item,
78 99
     });
@@ -82,6 +103,11 @@ Page({
82 103
       this.menuClick({ currentTarget: { dataset: { id: "vertical" } } })
83 104
     }
84 105
   },
106
+  gotoError: function (e) {
107
+    wx.navigateTo({
108
+      url: '../main/errorlist',
109
+    });
110
+  },
85 111
   gotoAnswer: function (e) {
86 112
     wx.navigateTo({
87 113
       url: '../main/answer',
@@ -89,24 +115,31 @@ Page({
89 115
     this.closeHelp2();
90 116
   },
91 117
   getFinish: function () {
118
+    server.playSound("/sounds/click.mp3");
119
+
92 120
     this.setData({
93 121
       ShowLoading: true,
94 122
       BtnText: "全部保存到相册",
95 123
     });
96 124
     wx.hideLoading();
97 125
     arrAnswerID = [];
98
-    tempAnswerList=[];
126
+    tempAnswerList = [];
99 127
     this.getAnswerID();
100
-    this.getList(this.data.ID);
128
+    if (this.data.ID > 0) {
129
+      this.getList(this.data.ID);
130
+    }
131
+    else{
132
+      this.getErrorList();
133
+    }
101 134
 
102 135
     this.closeHelp();
103 136
   },
104 137
   //重新生成试卷
105
-  ResetFinish:function(){
106
-    var that=this;
138
+  ResetFinish: function () {
139
+    var that = this;
107 140
     wx.showLoading({
108
-      title:"正在重置",
109
-      complete:function(){
141
+      title: "正在重置",
142
+      complete: function () {
110 143
         var list = that.data.arrPage;
111 144
         for (var i = 0; i < list.length; i++) {
112 145
           wx.removeSavedFile({
@@ -171,18 +204,53 @@ Page({
171 204
       }
172 205
     });
173 206
 
207
+  },
208
+  getErrorList: function () {
209
+    var that = this;
210
+    QuestionItem = that.data.QuestionTypeItem;
211
+    var pageNum = QuestionItem.ErrorList.length > 60 ? 60 : QuestionItem.ErrorList.length;
212
+    var QuestionTypeCategory = 2;
213
+    pageIndex = 0;
214
+    that.setData({
215
+      IsFinished: true,
216
+      arrPage: [],
217
+      IsDistabled: "",
218
+      WaitTime: waitTime[that.data.PageNumber],
219
+    });
220
+    
221
+    if (isAndroid) {
222
+      console.log("android");
223
+      var ctx = wx.createCanvasContext("Canvas", that);
224
+      ctx.fillRect(0, 0, 1050, 1485);
225
+      ctx.draw(true, function (n) {
226
+        wx.canvasToTempFilePath({
227
+          x: 0,
228
+          y: 0,
229
+          width: 2100,
230
+          height: 2970,
231
+          canvasId: 'Canvas',
232
+          success: function (res2) {
233
+            that.saveImage();
234
+          }
235
+        })
236
+      });
237
+    }
238
+    else {
239
+      that.saveImage();
240
+    }
241
+
174 242
   },
175 243
   getAnswerID: function () {
176 244
     var list = wx.getStorageSync("AnswerList");
177
-    var id=1;
245
+    var id = 1;
178 246
     if (list && list.length > 0) {
179 247
       list.sort(function (a, b) {
180
-          return b.AnswerID - a.AnswerID;
248
+        return b.AnswerID - a.AnswerID;
181 249
       });
182 250
       id = list[0].AnswerID + 1;
183 251
     }
184
-    for (var i = 0; i < this.data.PageNumber;i++)
185
-      arrAnswerID.push(id+i);
252
+    for (var i = 0; i < this.data.PageNumber; i++)
253
+      arrAnswerID.push(id + i);
186 254
   },
187 255
   saveImage: function () {
188 256
     var that = this;
@@ -197,7 +265,7 @@ Page({
197 265
 
198 266
     ctx.fillRect(0, 0, 2100, 2970);
199 267
     ctx.fillStyle = "#000000";
200
-    
268
+
201 269
     var xStart = 60;
202 270
     var yStart = 247;
203 271
 
@@ -210,7 +278,7 @@ Page({
210 278
       height = 250;
211 279
     //括号
212 280
     var index = 0;
213
-    
281
+
214 282
     for (var i = 0; i < 3; i++) {
215 283
       for (var j = 0; j < item.PageCount / 3; j++) {
216 284
         index++;
@@ -273,7 +341,7 @@ Page({
273 341
             var len = getLength(equation[n]);
274 342
             num += len;
275 343
             if (equation[n] == ".") {
276
-              ctx.fillText(equation[n], num + 3, yStart + j * 59-5);
344
+              ctx.fillText(equation[n], num + 3, yStart + j * 59 - 5);
277 345
             } else {
278 346
               var h = -8;
279 347
               if (equation[n] == "_")
@@ -294,7 +362,7 @@ Page({
294 362
 
295 363
           for (var n = 0; n < num1.Vertical.length; n++) {
296 364
             var num = xStart + i * 310 + width;
297
-            var num2=0;
365
+            var num2 = 0;
298 366
             for (var m = num1.Vertical[n].Array.length - 1; m >= 0; m--) {
299 367
               var str = "";
300 368
               if (num1.Vertical[n].Type == "line") {
@@ -302,7 +370,7 @@ Page({
302 370
                   //var lineLength = num1.Vertical[n].Array.length * 30 + 20;
303 371
                   var lineLength = 6 * 30 + 20;
304 372
                   var lineTop = 4;
305
-                  
373
+
306 374
                   //console.log(yStart + j * height + n * 30 + lineTop);
307 375
                   ctx.moveTo(num, yStart + j * height + n * 30 + lineTop);
308 376
                   ctx.lineTo(num - lineLength, yStart + j * height + n * 30 + lineTop);
@@ -320,7 +388,7 @@ Page({
320 388
                   var lineLength = num1.A.toString().length;
321 389
                   var lineWidth = Math.floor(57 * (1 + num1.A.toString().length) / 2);
322 390
 
323
-                  ctx.drawImage("../../images/formula_division_size0" + lineLength + ".png", num - (num1.Vertical[n].Array.length - m) * 30 - 8, yStart + j * height + n * 30-10, lineWidth, 39);
391
+                  ctx.drawImage("../../images/formula_division_size0" + lineLength + ".png", num - (num1.Vertical[n].Array.length - m) * 30 - 8, yStart + j * height + n * 30 - 10, lineWidth, 39);
324 392
                   //break;
325 393
                 }
326 394
                 else if (num1.OperateAB == "÷" && n == 0) {
@@ -334,12 +402,12 @@ Page({
334 402
                     num2 = 30;
335 403
                   }
336 404
                   else if (str == "+" || str == "-" || str == "−" || str == "×" || str == "÷") {
337
-                    var lineLength = 6 * 30 ;
405
+                    var lineLength = 6 * 30;
338 406
                     ctx.fillText(str, num - lineLength, yStart + j * height + n * 30);
339 407
                     num2 = 30;
340 408
                   }
341 409
                   else
342
-                    ctx.fillText(str, num - (num1.Vertical[n].Array.length - m) * 30+num2, yStart + j * height + n * 30);
410
+                    ctx.fillText(str, num - (num1.Vertical[n].Array.length - m) * 30 + num2, yStart + j * height + n * 30);
343 411
                 }
344 412
               }
345 413
             }
@@ -379,13 +447,13 @@ Page({
379 447
         y: 0,
380 448
         width: w * times,
381 449
         height: h * times,
382
-        destWidth: w*times,
383
-        destHeight: h*times,
450
+        destWidth: w * times,
451
+        destHeight: h * times,
384 452
         canvasId: 'Canvas',
385 453
         success: function (res2) {
386 454
           console.log(res2.tempFilePath);
387 455
           that.data.arrPage.push(res2.tempFilePath);
388
-          item.TempImagePath=res2.tempFilePath;
456
+          item.TempImagePath = res2.tempFilePath;
389 457
           tempAnswerList.push(JSON.parse(JSON.stringify(item)));
390 458
 
391 459
           that.setData({
@@ -395,10 +463,10 @@ Page({
395 463
           if (that.data.arrPage.length < that.data.PageNumber) {
396 464
             pageIndex++;
397 465
             that.saveImage();
398
-          } 
466
+          }
399 467
           else {
400 468
             //生成图片完成
401
-            setTimeout(function(){
469
+            setTimeout(function () {
402 470
               that.setData({
403 471
                 ShowLoading: false,
404 472
               });
@@ -415,6 +483,9 @@ Page({
415 483
               var tempList = wx.getStorageSync("AnswerList");
416 484
               if (!tempList)
417 485
                 tempList = [];
486
+              for (var x = 0; x < tempList.length; x++) {
487
+                tempList[x].IsNew = 0;
488
+              }
418 489
               for (var x = 0; x < tempAnswerList.length; x++) {
419 490
                 var tempItem = tempAnswerList[x];
420 491
                 var id = x * tempItem.PageCount;
@@ -425,6 +496,7 @@ Page({
425 496
                   }
426 497
                 }
427 498
                 tempItem.QuestionList = arr;
499
+                tempItem.IsNew = 1;
428 500
                 tempList.unshift(tempItem);
429 501
               }
430 502
               wx.setStorageSync("AnswerList", tempList);
@@ -433,10 +505,10 @@ Page({
433 505
                 that.showHelp2();
434 506
               });
435 507
 
436
-            },3000);
437
-            
508
+            }, 3000);
509
+
510
+
438 511
 
439
-            
440 512
           }
441 513
         }
442 514
       })
@@ -473,7 +545,7 @@ Page({
473 545
         wx.saveImageToPhotosAlbum({
474 546
           filePath: that.data.arrPage[i],
475 547
           success(res3) {
476
-            
548
+
477 549
             console.log("save:" + res3.savedFilePath);
478 550
             count++
479 551
             if (count == that.data.arrPage.length) {
@@ -497,7 +569,7 @@ Page({
497 569
             console.log(err3);
498 570
             wx.openSetting();
499 571
           },
500
-          complete(){
572
+          complete() {
501 573
             wx.hideLoading();
502 574
           }
503 575
         })
@@ -507,12 +579,12 @@ Page({
507 579
   changePageNumber: function (e) {
508 580
     var id = Number(e.currentTarget.dataset.id);
509 581
     this.data.PageNumber += id;
510
-    var addDisabled="",subDisabled="";
511
-    if (this.data.PageNumber <= 1){
582
+    var addDisabled = "", subDisabled = "";
583
+    if (this.data.PageNumber <= 1) {
512 584
       this.data.PageNumber = 1;
513
-      subDisabled ="btnAddSubDisabled";
585
+      subDisabled = "btnAddSubDisabled";
514 586
     }
515
-    else if (this.data.PageNumber >= 4){
587
+    else if (this.data.PageNumber >= 4) {
516 588
       this.data.PageNumber = 4;
517 589
       addDisabled = "btnAddSubDisabled";
518 590
     }
@@ -577,7 +649,6 @@ Page({
577 649
     this.audioCtx = wx.createAudioContext('myAudio');
578 650
     this.audioCtx.pause();
579 651
   },
580
-
581 652
   showHelp2: function () {
582 653
     if (!this.data.HelpHidden7) {
583 654
       this.audioCtx = wx.createAudioContext('myAudio');
@@ -593,6 +664,23 @@ Page({
593 664
     this.audioCtx = wx.createAudioContext('myAudio');
594 665
     this.audioCtx.pause();
595 666
   },
667
+
668
+  showHelp8: function () {
669
+    if (!this.data.HelpHidden8) {
670
+      this.audioCtx = wx.createAudioContext('myAudio');
671
+      var str = "发现错误是提高成绩的第一步。点一下题目数量右侧的图标,当有错题后,能查看和整理错题清单。";
672
+      server.playAudio(this.audioCtx, str);
673
+    }
674
+  },
675
+  closeHelp8: function () {
676
+    this.setData({
677
+      HelpHidden8: true,
678
+    });
679
+    wx.setStorageSync("HelpHidden8", true);
680
+    this.audioCtx = wx.createAudioContext('myAudio');
681
+    this.audioCtx.pause();
682
+  },
683
+
596 684
   onShareAppMessage: function () {
597 685
     return {
598 686
       title: app.globalData.ShareTitle,

+ 1 - 3
pages/main/detail.json

@@ -2,7 +2,5 @@
2 2
   "navigationBarBackgroundColor": "#E5A744",
3 3
   "navigationBarTextStyle": "black",
4 4
   "navigationBarTitleText": "制作车间",
5
-  "backgroundColor": "#4F4745",
6
-  "backgroundTextStyle": "light",
7
-  "enablePullDownRefresh": false
5
+  "backgroundColor": "#4F4745"
8 6
 }

+ 44 - 28
pages/main/detail.wxml

@@ -1,8 +1,9 @@
1 1
 <view class="container FlexColumn" style="min-height:{{Containnerheight}}rpx;">
2 2
   <block wx:if="{{!IsFinished}}">
3
-    <image class="makepaper_headline_illus_lab" src="../../images/makepaper_headline_illus_lab.png" />
4
-    <image class="questioncard_icon desaturate" src="{{QuestionTypeItem.IconName}}" />
5
-    <view class="Example">
3
+    <image class="makepaper_headline_illus_lab" src="../../images/makepaper_headline_illus_lab.png" wx:if="{{ID>0}}" />
4
+    <image class="makepaper_headline_illus_lab" src="../../images/makepaper_headline_illus_wrong.png" wx:if="{{ID==-1}}" />
5
+    <image class="questioncard_icon desaturate" src="{{QuestionTypeItem.IconName}}" wx:if="{{ID>0}}" />
6
+    <view class="Example" wx:if="{{ID>0}}">
6 7
       <view class="Example1">
7 8
         {{QuestionTypeItem.Example[0]}}
8 9
       </view>
@@ -20,11 +21,9 @@
20 21
       </view>
21 22
     </view>
22 23
     <view class="line2"></view>
23
-    <view class="line3">
24
-
25
-    </view>
24
+    <view class="line3"></view>
26 25
     <view class="line4"></view>
27
-    <view class="panel1 FlexColumn">
26
+    <view class="panel1 FlexColumn" wx:if="{{ID>0}}">
28 27
       <view class="text1">算式类型</view>
29 28
 
30 29
       <block wx:if="{{QuestionTypeItem.QuestionNumber3==0}}">
@@ -40,11 +39,8 @@
40 39
         <image class="universalpic_indicator_cell_size01" src="../../images/universalpic_indicator_cell_size01.png" />
41 40
         <view class="panel10 FlexRow" bindtap='openMenu'>
42 41
           <view class="btnSelect">
43
-
44 42
             <block wx:if="{{filter=='horizontal'}}">横式</block>
45 43
             <block wx:if="{{filter=='vertical'}}">竖式</block>
46
-            <!-- <block wx:if="{{filter=='all'}}">横式+竖式</block> -->
47
-
48 44
           </view>
49 45
           <view class="btnAddSub"></view>
50 46
         </view>
@@ -69,6 +65,24 @@
69 65
         </view>
70 66
       </view>
71 67
     </view>
68
+
69
+    <view class="error4 panel1 FlexColumn" wx:if="{{ID==-1}}">
70
+      <view class="error1 text4">题目</view>
71
+
72
+      <image class="error2 universalpic_indicator_cell_size01" src="../../images/universalpic_indicator_cell_size01.png" />
73
+      <view class="panel10 FlexRow" bindtap='gotoError'>
74
+          <view class="error3 btnSelect">
75
+            {{QuestionTypeItem.ErrorList.length}}道
76
+          </view>
77
+          <view class="btnAddSub"></view>
78
+        </view>
79
+      
80
+      <view class="btnStart" bindtap='getFinish'>
81
+        <view class="btnStart1">
82
+          出题
83
+        </view>
84
+      </view>
85
+    </view>
72 86
     <view style='height:230rpx'></view>
73 87
   </block>
74 88
 
@@ -114,28 +128,29 @@
114 128
   </block>
115 129
   <view class="line5"></view>
116 130
 
117
-  <view class="menu FlexColumn" wx:if="{{IsShowMenu}}">
118
-    <view class="text1">算式类型</view>
119
-    <view class="panel FlexRow" bindtap='menuClick' data-id="horizontal">
120
-      <view>横式</view>
121
-      <image wx:if="{{filter=='horizontal'}}" class="universalpic_select_on_black" src="../../images/universalpic_select_on_black.png" />
131
+  <view class="menuPanel" style="min-height:{{Containnerheight}}rpx;" wx:if="{{IsShowMenu}}">
132
+    <view class="menu FlexColumn">
133
+      <view class="text1">算式类型</view>
134
+      <view class="panel FlexRow" bindtap='menuClick' data-id="horizontal">
135
+        <view>横式</view>
136
+        <image wx:if="{{filter=='horizontal'}}" class="universalpic_select_on_black" src="../../images/universalpic_select_on_black.png" />
122 137
 
123
-    </view>
124
-    <view class="line"></view>
125
-    <view class="panel FlexRow" bindtap='menuClick' data-id="vertical">
126
-      <view>竖式</view>
127
-      <image wx:if="{{filter=='vertical'}}" class="universalpic_select_on_black" src="../../images/universalpic_select_on_black.png" />
138
+      </view>
139
+      <view class="line"></view>
140
+      <view class="panel FlexRow" bindtap='menuClick' data-id="vertical">
141
+        <view>竖式</view>
142
+        <image wx:if="{{filter=='vertical'}}" class="universalpic_select_on_black" src="../../images/universalpic_select_on_black.png" />
128 143
 
129
-    </view>
130
-    <view class="line"></view>
131
-    <view class="line2"></view>
132
-    <view class="line"></view>
133
-    <view class="panel FlexRow" bindtap='closeMenu'>
134
-      <view>取消</view>
135
-    </view>
144
+      </view>
145
+      <view class="line"></view>
146
+      <view class="line2"></view>
147
+      <view class="line"></view>
148
+      <view class="panel FlexRow" bindtap='closeMenu'>
149
+        <view>取消</view>
150
+      </view>
136 151
 
152
+    </view>
137 153
   </view>
138
-
139 154
 </view>
140 155
 
141 156
 <view class="loading container FlexColumn" style="min-height:{{Containnerheight}}rpx;" wx:if="{{ShowLoading}}">
@@ -163,5 +178,6 @@
163 178
 </view>
164 179
 <image hidden="{{HelpHidden3}}" bindtap='closeHelp' class="Help_aside_makepaper" src="../../images/Help_aside_makepaper.png" />
165 180
 <image hidden="{{HelpHidden7}}" bindtap='closeHelp2' class="Help_aside_savepaper" src="../../images/Help_aside_savepaper.png" />
181
+<image hidden="{{HelpHidden8}}" bindtap='closeHelp8' class="Help_aside_makepaper_wrong" src="../../images/Help_aside_makepaper_wrong.png" />
166 182
 <audio hidden='true' id="myAudio"></audio>
167 183
 <canvas class='Canvas' canvas-id="Canvas"></canvas>

+ 29 - 0
pages/main/detail.wxss

@@ -149,12 +149,27 @@
149 149
   margin-top: 40rpx;
150 150
   font-weight: 600;
151 151
 }
152
+.panel1 .error1{
153
+  margin-top: 60rpx;
154
+}
152 155
 
153 156
 .universalpic_value_cell_size01{
154 157
   width:400rpx;
155 158
   height:104rpx;
156 159
   margin-top: 30rpx;
157 160
 }
161
+.panel1 .error2{
162
+  margin-top: 30rpx;
163
+}
164
+
165
+.panel1 .error3{
166
+  margin-top: 0rpx;
167
+  text-align: left;
168
+  margin-left: 50rpx;
169
+}
170
+.error4{
171
+  height:474rpx;
172
+}
158 173
 
159 174
 .panel1 .panel10{
160 175
   margin-top: -104rpx;
@@ -377,6 +392,13 @@
377 392
   height: 100rpx;
378 393
 }
379 394
 
395
+.menuPanel{
396
+  position: fixed;
397
+  top: 0;
398
+  width: 100%;
399
+  background-color:rgba(229, 167, 68, 0.9);
400
+  z-index: 30;
401
+}
380 402
 
381 403
 .menu {
382 404
   position: fixed;
@@ -542,3 +564,10 @@
542 564
   z-index: 100;
543 565
 }
544 566
 
567
+.Help_aside_makepaper_wrong{
568
+  width: 100%;
569
+  height: 290rpx;
570
+  position: fixed;
571
+  bottom: 0rpx;
572
+  z-index: 100;
573
+}

+ 57 - 0
pages/main/errorlist.js

@@ -0,0 +1,57 @@
1
+import common from '../../utils/util';
2
+import server from '../../utils/main';
3
+
4
+const app = getApp();
5
+Page({
6
+  data: {
7
+    IsShowMenu:false,
8
+  },
9
+  onLoad: function (options) {
10
+    this.setData({
11
+      Containnerheight: server.getWindowHeight(),
12
+    });
13
+    this.getList();
14
+  },
15
+  getList: function () {
16
+    var that = this;
17
+    var list = wx.getStorageSync("ErrorList");
18
+    that.setData({
19
+      ErrorList:list,
20
+    })
21
+  },
22
+  closeMenu: function () {
23
+    this.setData({
24
+      IsShowMenu: false,
25
+    });
26
+  },
27
+  openMenu: function (e) {
28
+    var id = e.currentTarget.dataset.id;
29
+    var item;
30
+    var list = this.data.ErrorList;
31
+    for (var i = 0; i < list.length; i++) {
32
+      if (id == list[i].ID) {
33
+        item=list[i];
34
+        break;
35
+      }
36
+    }
37
+    this.setData({
38
+      IsShowMenu: true,
39
+      SelectedItem:item,
40
+    });
41
+  },
42
+  deleteItem:function(){
43
+    var list = this.data.ErrorList;
44
+    for (var i = 0; i < list.length; i++) {
45
+      if (this.data.SelectedItem.ID==list[i].ID) {
46
+        list.splice(i, 1);
47
+        break;
48
+      }
49
+    }
50
+    this.setData({
51
+      ErrorList: list,
52
+      IsShowMenu: false,
53
+    });
54
+    wx.setStorageSync("ErrorList", list);
55
+
56
+  },
57
+});

+ 6 - 0
pages/main/errorlist.json

@@ -0,0 +1,6 @@
1
+{
2
+  "navigationBarBackgroundColor": "#fff",
3
+  "navigationBarTextStyle": "black",
4
+  "navigationBarTitleText": "错题",
5
+  "backgroundColor": "#F0F0F0"
6
+}

+ 54 - 0
pages/main/errorlist.wxml

@@ -0,0 +1,54 @@
1
+<view class="container FlexColumn" style="min-height:{{Containnerheight}}rpx;">
2
+  <block wx:if="{{ErrorList.length==0}}">
3
+    <view class="text1">没有错题</view>
4
+    <text class="text2">先到“对答案”中给做错的题目打记号\n(点击题目序号)</text>
5
+  </block>
6
+
7
+  <block wx:if="{{ErrorList.length>0}}">
8
+    <view class="Panel1 FlexRow">
9
+      <view class="title">点题目可删除
10
+      </view>
11
+    </view>
12
+    <view class="Panel2 FlexRow" wx:for="{{ErrorList}}" wx:key="index" bindtap="openMenu" data-id="{{item.ID}}">
13
+      <view class="left">
14
+          <block wx:if="{{item.HiddenColumn=='A'}}">? </block>
15
+          <block wx:if="{{item.HiddenColumn!='A'}}">{{item.A}} </block>
16
+          {{item.OperateAB}}
17
+          <block wx:if="{{item.HiddenColumn=='B'}}">? </block>
18
+          <block wx:if="{{item.HiddenColumn!='B'}}">{{item.B}} </block>
19
+          {{item.OperateBC}} {{item.C}} {{item.OperateCD}} {{item.D}} =
20
+          <block wx:if="{{item.HiddenColumn=='R'}}"> </block>
21
+          <block wx:if="{{item.HiddenColumn!='R'}}">{{item.R}} </block>
22
+      </view>
23
+      <image class="universalpic_indicator_gray" src="../../images/universalpic_indicator_gray2.png" />
24
+    
25
+    </view>
26
+    <view class="footer"></view>
27
+  </block>
28
+
29
+<view class="menuPanel" style="min-height:{{Containnerheight}}rpx;" wx:if="{{IsShowMenu}}">
30
+    <view class="menu FlexColumn">
31
+      <view class="text1 FlexRow">
32
+          <block wx:if="{{SelectedItem.HiddenColumn=='A'}}">? </block>
33
+          <block wx:if="{{SelectedItem.HiddenColumn!='A'}}">{{SelectedItem.A}} </block>
34
+          {{SelectedItem.OperateAB}}
35
+          <block wx:if="{{SelectedItem.HiddenColumn=='B'}}">? </block>
36
+          <block wx:if="{{SelectedItem.HiddenColumn!='B'}}">{{SelectedItem.B}} </block>
37
+          {{SelectedItem.OperateBC}} {{SelectedItem.C}} {{SelectedItem.OperateCD}} {{SelectedItem.D}} =
38
+          <block wx:if="{{SelectedItem.HiddenColumn=='R'}}"> </block>
39
+          <block wx:if="{{SelectedItem.HiddenColumn!='R'}}">{{SelectedItem.R}} </block>
40
+      
41
+      </view>
42
+      <view class="panel FlexRow" bindtap='deleteItem'>
43
+        <view>删除记录</view>
44
+      </view>
45
+      <view class="line"></view>
46
+      <view class="line2"></view>
47
+      <view class="line"></view>
48
+      <view class="panel FlexRow" bindtap='closeMenu'>
49
+        <view>取消</view>
50
+      </view>
51
+
52
+    </view>
53
+  </view>
54
+</view>

+ 94 - 0
pages/main/errorlist.wxss

@@ -0,0 +1,94 @@
1
+.container {
2
+  background-color: #F0F0F0;
3
+  justify-content: flex-start;
4
+  width: 100%; 
5
+  font-weight: 400;
6
+}
7
+
8
+.text1{
9
+  margin-top: 460rpx;
10
+  font-size:48rpx;
11
+  font-weight: 500;
12
+}
13
+
14
+.text2{
15
+  margin-top: 20rpx;
16
+  font-size:24rpx;
17
+  text-align: center;
18
+  
19
+}
20
+
21
+.Panel1{
22
+  width: 100%;
23
+  height:103rpx;
24
+  justify-content: flex-start;
25
+  align-items: flex-start;
26
+}
27
+.Panel1 .title{
28
+  color:#787878;
29
+  font-size:24rpx;
30
+  margin:40rpx 0 0 30rpx; 
31
+}
32
+
33
+.Panel2{
34
+  width: 100%;
35
+  height:101rpx;
36
+  justify-content: space-between;
37
+  margin-bottom: 1rpx;
38
+  background-color: #fff;
39
+}
40
+.Panel2 .left{
41
+  margin-left: 30rpx;
42
+  font-size:28rpx;
43
+}
44
+.universalpic_indicator_gray{
45
+  width: 16rpx;
46
+  height:26rpx;
47
+  margin-right: 30rpx;
48
+}
49
+.footer{
50
+  height:100rpx;
51
+}
52
+
53
+
54
+.menuPanel{
55
+  position: fixed;
56
+  top: 0;
57
+  width: 100%;
58
+  background-color:rgba(0, 0, 0, 0.6);
59
+  z-index: 30;
60
+}
61
+
62
+.menu {
63
+  position: fixed;
64
+  bottom: 0;
65
+  width: 100%;
66
+  background-color: #d2d2d2;
67
+  z-index: 30;
68
+  font-weight: 400;
69
+}
70
+
71
+.menu .text1 {
72
+  font-size: 24rpx;
73
+  margin: 30rpx;
74
+}
75
+
76
+.menu .panel {
77
+  font-size: 36rpx;
78
+  height: 111rpx;
79
+  width: 100%;
80
+  background-color: #fff;
81
+  position: relative;
82
+}
83
+
84
+.menu .line {
85
+  height: 2rpx;
86
+  width: 100%;
87
+  background-color: #e3e3e3;
88
+}
89
+
90
+.menu .line2 {
91
+  height: 20rpx;
92
+  width: 100%;
93
+  background-color: #d2d2d2;
94
+}

+ 86 - 16
pages/main/item.js

@@ -5,6 +5,7 @@ const app = getApp();
5 5
 
6 6
 var currentIndex = 0, tempCurrentIndex = -1;
7 7
 var audioArray = [];
8
+var AnswerID=0;
8 9
 
9 10
 Page({
10 11
   data: {
@@ -16,31 +17,42 @@ Page({
16 17
     selectTab2: "",
17 18
   },
18 19
   onLoad: function (options) {
19
-    var that=this;
20
+    var that = this;
20 21
     this.audioCtxNumber = wx.createAudioContext('numberAudio');
21
-    
22
+
22 23
     this.setData({
23 24
       Containnerheight: server.getWindowHeight(),
24 25
       IsPlaying: 0,
25 26
     });
26 27
     audioArray = [];
27
-    currentIndex=0;
28
+    currentIndex = 0;
28 29
     tempCurrentIndex = -1;
29 30
 
30
-    var id = options.id;
31
-    this.getItem(id);
31
+    AnswerID = options.id;
32
+    this.getItem();
32 33
 
33 34
     wx.setNavigationBarTitle({
34
-      title: "试卷答案 " + id,
35
+      title: "试卷答案 " + AnswerID,
35 36
     });
36 37
 
37
-    common.getStorageValue(this, "HelpHidden6", false, function () { 
38
+    common.getStorageValue(this, "HelpHidden6", false, function () {
38 39
       that.showHelp();
39 40
     });
40 41
 
41 42
   },
42
-  onUnload:function(){
43
+  onUnload: function () {
43 44
     this.closeHelp();
45
+
46
+    var list = wx.getStorageSync("AnswerList");
47
+    if (list && list.length > 0) {
48
+      for (var i = 0; i < list.length; i++) {
49
+        if (AnswerID == list[i].AnswerID) {
50
+          list[i] = this.data.AnswerItem;
51
+          wx.setStorageSync("AnswerList", list);
52
+          break;
53
+        }
54
+      }
55
+    }
44 56
   },
45 57
   scrollTop: function (e) {
46 58
     var id = Number(e.currentTarget.dataset.id);
@@ -72,13 +84,13 @@ Page({
72 84
     });
73 85
 
74 86
   },
75
-  getItem: function (id) {
87
+  getItem: function () {
76 88
     var that = this;
77 89
     var list = wx.getStorageSync("AnswerList");
78 90
     if (list && list.length > 0) {
79 91
       var item;
80 92
       for (var i = 0; i < list.length; i++) {
81
-        if (id == list[i].AnswerID) {
93
+        if (AnswerID == list[i].AnswerID) {
82 94
           item = list[i];
83 95
           break;
84 96
         }
@@ -88,9 +100,8 @@ Page({
88 100
       for (var i = 0; i < list.length; i++) {
89 101
         if (i == 0 && list[i].Vertical) {
90 102
           list[i].IsShowVertical = true;
91
-          break;
92 103
         }
93
-
104
+        //list[i].ErrorClass = "";
94 105
       }
95 106
 
96 107
       var list = item.QuestionList;
@@ -101,8 +112,8 @@ Page({
101 112
             list[i].Vertical[1].Array[k] = "";
102 113
           }
103 114
           for (var k = 0; k < list[i].Vertical[2].Array.length; k++) {
104
-            if (list[i].Vertical[2].Array[k] =="√"){
105
-              list[i].Vertical[2].Array[k]="";
115
+            if (list[i].Vertical[2].Array[k] == "√") {
116
+              list[i].Vertical[2].Array[k] = "";
106 117
               list[i].Vertical[2].Array.push("√");
107 118
               break;
108 119
             }
@@ -131,6 +142,62 @@ Page({
131 142
     });
132 143
 
133 144
   },
145
+  setErrorItem: function (e) {
146
+    var id = e.currentTarget.dataset.id;
147
+    var list = this.data.AnswerItem.QuestionList;
148
+    for (var i = 0; i < list.length; i++) {
149
+      if (id == list[i].ID) {
150
+        if (!list[i].ErrorClass || list[i].ErrorClass == "") {
151
+          list[i].ErrorClass = "ErrorClass";
152
+          wx.showToast({ title: "记号已保存", duration: 1000 });
153
+          this.saveErrorList(list[i],"add");
154
+        }
155
+        else {
156
+          list[i].ErrorClass = "";
157
+          wx.showToast({ title: "记号已消除", duration: 1000 });
158
+          this.saveErrorList(list[i], "delete");
159
+        }
160
+        break;
161
+      }
162
+    }
163
+    this.data.AnswerItem.QuestionList = list;
164
+    this.setData({
165
+      AnswerItem: this.data.AnswerItem,
166
+    });
167
+    
168
+  },
169
+  saveErrorList:function(item,action){
170
+    var list = wx.getStorageSync("ErrorList");
171
+    if (!list)
172
+      list=[];
173
+    var b=false;
174
+    for(var i=0;i<list.length;i++){
175
+      if (item.A == list[i].A && item.B == list[i].B && item.R == list[i].R && item.OperateAB == list[i].OperateAB){
176
+        if (item.C){
177
+          if (item.C == list[i].C && item.OperateBC == list[i].OperateBC){
178
+            if (item.D){
179
+              if (item.D == list[i].D && item.OperateCD == list[i].OperateCD){
180
+                b=true;
181
+              }
182
+            }
183
+            else
184
+              b=true;
185
+          }
186
+        }
187
+        else
188
+          b=true;
189
+      } 
190
+      if (b){
191
+        list.splice(i, 1);
192
+        break;
193
+      }
194
+    }
195
+    if (action=="add"){
196
+      item.ID=new Date().getTime();
197
+      list.unshift(item);
198
+    }
199
+    wx.setStorageSync("ErrorList", list);
200
+  },
134 201
   showImage: function (e) {
135 202
     var that = this;
136 203
     wx.previewImage({
@@ -147,6 +214,7 @@ Page({
147 214
       this.audioCtxNumber.play();
148 215
     }
149 216
     else if (this.data.IsPlaying == 0) {
217
+      server.playSound("/sounds/startend.mp3");
150 218
       var arr = [];
151 219
       var item = this.data.AnswerItem;
152 220
       var list = item.QuestionList;
@@ -188,14 +256,16 @@ Page({
188 256
       this.setData({
189 257
         IsPlaying: true,
190 258
       });
259
+      server.playSound("/sounds/startend.mp3");
191 260
       return;
192 261
     } else {
193
-      server.playAudio(this.audioCtxNumber, audioArray[currentIndex].join(","));
262
+      server.playAudio(this.audioCtxNumber, audioArray[currentIndex].join(","), 1);
194 263
     }
195 264
   },
196 265
   onPlayEnded: function (e) {
197 266
     currentIndex++;
198 267
     this.playAudioAll();
268
+
199 269
   },
200 270
   playPrev: function () {
201 271
     var playstr = "本";
@@ -216,7 +286,7 @@ Page({
216 286
   showHelp: function () {
217 287
     if (!this.data.HelpHidden6) {
218 288
       this.audioCtx = wx.createAudioContext('myAudio');
219
-      var str = "Nice,让我用30秒讲完最后的帮助。答案靠左,题目居右,如果发现题目右侧有图标,说明这是一道竖式题,点击图标可以检查解题步骤,这是独门神器,对找出问题所在非常有效。期待你的好成绩,拜拜!";
289
+      var str = "对答案可以用听的也可以用看的。答案在左边,题目在右边。想给做错的题目打记号,就点击答案左侧的1、2、3……题目序号,这样就可以去首页的错题集里复习它们了。还有一个特殊功能!在有竖式题目的情况下,题目右侧会有这样的图标      ,点它就能提供完整的解题步骤,这个独门神器是倾力为你准备的,对找出错误所在非常有效。";
220 290
       server.playAudio(this.audioCtx, str);
221 291
     }
222 292
   },

+ 1 - 3
pages/main/item.json

@@ -2,7 +2,5 @@
2 2
   "navigationBarBackgroundColor": "#fff",
3 3
   "navigationBarTextStyle": "black",
4 4
   "navigationBarTitleText": "试卷答案",
5
-  "backgroundColor": "#F0F0F0",
6
-  "backgroundTextStyle": "light",
7
-  "enablePullDownRefresh": false
5
+  "backgroundColor": "#F0F0F0"
8 6
 }

+ 9 - 5
pages/main/item.wxml

@@ -57,13 +57,17 @@
57 57
         </view>
58 58
       </view>
59 59
     </block>
60
-    <view class="panelRowBody panel0 FlexRow" bindtap='selectedItem' data-id="{{item.ID}}">
61
-      <view class="panelLeft FlexRow">
62
-        <view class="number">{{index+1}}</view>
60
+    <view class="{{item.ErrorClass}} panelRowBody panel0 FlexRow">
61
+      <view class="FlexRow">
62
+        <view class="numberPanel FlexRow" bindtap="setErrorItem" data-id="{{item.ID}}">
63
+          <view class="number">{{index+1}}</view>
64
+          <image class="universalpic_wrong_red" src="../../images/universalpic_wrong_red.png" wx:if="{{item.ErrorClass=='ErrorClass'}}" />
65
+        
66
+        </view>
63 67
         <view class="answer">{{item.Result}}</view>
64 68
       </view>
65
-      <view class="panelRight FlexRow">
66
-        <view class="equation">
69
+      <view class="panelRight FlexRow" bindtap='selectedItem' data-id="{{item.ID}}">
70
+        <view class="{{item.ErrorClass}} equation">
67 71
           <block wx:if="{{item.HiddenColumn=='A'}}">___ </block>
68 72
           <block wx:if="{{item.HiddenColumn!='A'}}">{{item.A}} </block>
69 73
           {{item.OperateAB}}

+ 21 - 5
pages/main/item.wxss

@@ -116,6 +116,13 @@
116 116
   background-color: #F0F0F0;
117 117
 }
118 118
 
119
+
120
+.panelRowBody .numberPanel{
121
+  height:110rpx;
122
+  width:116rpx;
123
+  position: relative;
124
+}
125
+
119 126
 .panelRowBody .number{
120 127
   text-align: center;
121 128
   width:46rpx;
@@ -126,14 +133,14 @@
126 133
   background-color: #2E2E2E;
127 134
   font-family: 'Roboto-Bold';
128 135
   font-size:22rpx;
136
+  margin: 0 40rpx 0 30rpx;
129 137
 }
130 138
 .panelRowBody .answer{
131 139
   font-size:48rpx;
132
-  margin-left: 40rpx;
133 140
   font-family: 'Roboto-Regular';
134 141
 }
135 142
 
136
-.panelRowBody .equation{
143
+.equation{
137 144
   font-size:26rpx;
138 145
   margin-right: 20rpx;
139 146
   color:#8C8C8C;
@@ -141,8 +148,9 @@
141 148
 }
142 149
 
143 150
 
144
-.panelRowBody{
145
-  background-color: #F0F0F0;
151
+.ErrorClass{
152
+  color:#fff;
153
+  background-color: #E95B51;
146 154
 }
147 155
 
148 156
 .line{
@@ -260,8 +268,16 @@
260 268
 
261 269
 .Help_aside_answerroom_detail{
262 270
   width: 100%;
263
-  height: 377rpx;
271
+  height: 564rpx;
264 272
   position: fixed;
265 273
   bottom: 0rpx;
266 274
   z-index: 200;
267 275
 }
276
+
277
+.universalpic_wrong_red{
278
+  width:36rpx;
279
+  height:36rpx;
280
+  position: absolute;
281
+  left:12rpx;
282
+  top:23rpx;
283
+}

+ 2 - 0
pages/main/list.js

@@ -36,6 +36,8 @@ Page({
36 36
     this.buildList();
37 37
   },
38 38
   gotoDetail: function (e) {
39
+    server.playSound("/sounds/click.mp3");
40
+    
39 41
     SelectID = e.currentTarget.dataset.id;
40 42
     var arr = wx.getStorageSync('SelectIDArray');
41 43
     if (!arr)

+ 1 - 3
pages/main/list.json

@@ -2,7 +2,5 @@
2 2
   "navigationBarBackgroundColor": "#9C5043",
3 3
   "navigationBarTextStyle": "white",
4 4
   "navigationBarTitleText": "题目仓库",
5
-  "backgroundColor": "#514a47",
6
-  "backgroundTextStyle": "light",
7
-  "enablePullDownRefresh": false
5
+  "backgroundColor": "#514a47"
8 6
 }

+ 0 - 301
pages/main/print.js

@@ -1,301 +0,0 @@
1
-import common from '../../utils/util';
2
-import server from '../../utils/main';
3
-
4
-const app = getApp();
5
-var QuestionList = [];
6
-var isAndroid = false;
7
-
8
-Page({
9
-  data: {
10
-    Left: 0,
11
-  },
12
-  onLoad: function (options) {
13
-    var id = options.id;
14
-    id = 130;
15
-    var QuestionTypeCategory=3;
16
-    this.getList(id, QuestionTypeCategory);
17
-
18
-    isAndroid = false;
19
-    if (app.globalData.systemInfo.system && app.globalData.systemInfo.system.indexOf("Android") >= 0)
20
-      isAndroid = true;
21
-
22
-  },
23
-  getList: function (id, QuestionTypeCategory) {
24
-    var that = this;
25
-
26
-    server.getLocalHost(function () {
27
-      server.getData('GetQuestionTypesPrint?QuestionTypeCategory=' + QuestionTypeCategory+'&ID=' + id, function (data) {
28
-        //console.log("UserInfo:" + data);
29
-        if (data) {
30
-          //var data=wx.getStorageSync("TestPrint");
31
-          QuestionList = data;
32
-          var ctx = wx.createCanvasContext("Canvas", that);
33
-          ctx.setFillStyle('white');
34
-          ctx.fillRect(0, 0, 1050, 1485);
35
-          ctx.draw(true, function (n) {
36
-            wx.canvasToTempFilePath({
37
-              x: 0,
38
-              y: 0,
39
-              width: 2100,
40
-              height: 2970,
41
-              destWidth: 2100,
42
-              destHeight: 2970,
43
-              canvasId: 'Canvas',
44
-              success: function (res2) {
45
-                console.log(res2.tempFilePath);
46
-                that.saveImage();
47
-              }
48
-            })
49
-          });
50
-        }
51
-      });
52
-
53
-    });
54
-  },
55
-  saveImage: function () {
56
-    var item = QuestionList;
57
-
58
-    var that = this;
59
-    var ctx = wx.createCanvasContext("Canvas", that);
60
-    ctx.setFillStyle('white');
61
-    //ctx.fillRect(0, 0, 1050, 1485);
62
-    ctx.fillRect(0, 0, 1050, 1485);
63
-    ctx.fillStyle = "#000000";
64
-
65
-    //计算数组最大长度
66
-    var maxLength = 0;
67
-    for (var l = 0; l < item.QuestionList.length; l++) {
68
-      var num1 = item.QuestionList[l];
69
-      if (num1.Vertical) {
70
-        for (var n = 0; n < num1.Vertical.length; n++) {
71
-          if (maxLength < num1.Vertical[n].Array.length)
72
-            maxLength = num1.Vertical[n].Array.length;
73
-        }
74
-      }
75
-    }
76
-
77
-    var xStart = 60;
78
-    var yStart = 247;
79
-
80
-    var height = 150;
81
-    if (item.QuestionTypeCategory == 2)
82
-      height = 59;
83
-    if (item.PageCount == 18)
84
-      height = 210;
85
-    else if (item.PageCount == 15)
86
-      height = 250;
87
-    //括号
88
-    var index = 0;
89
-    ctx.setFontSize(12);
90
-    for (var i = 0; i < 3; i++) {
91
-      for (var j = 0; j < item.PageCount / 3; j++) {
92
-        index++;
93
-        ctx.fillText("(", xStart + i * 310, yStart + j * height);
94
-        ctx.fillText(")", xStart + i * 310 + 22, yStart + j * height);
95
-      }
96
-    }
97
-
98
-    //编号
99
-    index = 0;
100
-    ctx.setTextAlign('center');
101
-    var numberLeft = 12;
102
-    if (isAndroid)
103
-      numberLeft = 14;
104
-    for (var i = 0; i < 3; i++) {
105
-      for (var j = 0; j < item.PageCount / 3; j++) {
106
-        index++;
107
-        ctx.fillText(index, xStart + i * 310 + numberLeft, yStart + j * height);
108
-      }
109
-    }
110
-
111
-    //算式
112
-    index = 0;
113
-    ctx.setFontSize(24);
114
-    for (var i = 0; i < 3; i++) {
115
-      for (var j = 0; j < item.PageCount / 3; j++) {
116
-        index++;
117
-
118
-        //横式
119
-        if (item.QuestionTypeCategory == 2) {
120
-
121
-          var A = item.QuestionList[index - 1].A.toString();
122
-          if (item.QuestionList[index - 1].HiddenColumn == "A")
123
-            A = "____";
124
-          var OperateAB = item.QuestionList[index - 1].OperateAB.toString();
125
-          console.log(OperateAB);
126
-          var B = item.QuestionList[index - 1].B.toString();
127
-          if (item.QuestionList[index - 1].HiddenColumn == "B")
128
-            B = "____";
129
-          var equation = A + " " + OperateAB + " " + B;
130
-          if (item.QuestionList[index - 1].C) {
131
-            var OperateBC = item.QuestionList[index - 1].OperateBC.toString();
132
-            var C = item.QuestionList[index - 1].C.toString();
133
-            equation += " " + OperateBC + " " + C;
134
-            if (item.QuestionList[index - 1].D) {
135
-              var OperateCD = item.QuestionList[index - 1].OperateCD.toString();
136
-              var D = item.QuestionList[index - 1].D.toString();
137
-              equation += " " + OperateCD + " " + D;
138
-            }
139
-          }
140
-          equation += " = ";
141
-          var R = item.QuestionList[index - 1].R.toString();
142
-          if (item.QuestionList[index - 1].HiddenColumn == "R")
143
-            R = "";
144
-          equation += R;
145
-
146
-          var num = xStart + i * 310 + 31;
147
-          
148
-          for (var n = 0; n < equation.length; n++) {
149
-            var len = getLength(equation[n]);
150
-            num += len;
151
-            if (equation[n] == ".") {
152
-              ctx.fillText(equation[n], num + 3, yStart + j * 59);
153
-            } else {
154
-              var h = 0;
155
-              if (equation[n] == "_")
156
-                h = 8;
157
-              ctx.fillText(equation[n], num, yStart + j * 59 + h);
158
-            }
159
-          }
160
-        }
161
-        //竖式
162
-        else if (item.QuestionTypeCategory == 3) {
163
-
164
-          var num1 = item.QuestionList[index - 1];
165
-          var isAnswer = false;
166
-
167
-          var width = 250;
168
-          if (num1.OperateAB == "÷")
169
-            width=240;
170
-
171
-          //console.log(num1);
172
-          for (var n = 0; n < num1.Vertical.length; n++) {
173
-            if (maxLength > num1.Vertical[n].Array.length) {
174
-              if (num1.OperateAB != "÷")
175
-                num1.Vertical[n].Array.splice(1, 0, "");
176
-            }
177
-          }
178
-          console.log(num1);
179
-
180
-
181
-          for (var n = 0; n < num1.Vertical.length; n++) {
182
-            var num = xStart + i * 310 + width;
183
-            for (var m = num1.Vertical[n].Array.length - 1; m >= 0; m--) {
184
-              var str = "";
185
-              if (num1.Vertical[n].Type == "line") {
186
-                if (num1.OperateAB != "÷") {
187
-                  var lineLength = num1.Vertical[n].Array.length * 30 + 20;
188
-                  var lineTop = -15;
189
-                  if (num1.OperateAB == "÷") {
190
-                    lineLength = num1.A.toString().length * 30;
191
-                    lineTop = 0;
192
-                  }
193
-
194
-                  ctx.moveTo(num, yStart + j * height + n * 30 + lineTop);
195
-                  ctx.lineTo(num - lineLength, yStart + j * height + n * 30 + lineTop);
196
-                  ctx.stroke();
197
-
198
-                  if (num1.OperateAB != "÷")
199
-                    isAnswer = true;
200
-                  break;
201
-                }
202
-              }
203
-              else {
204
-                str = num1.Vertical[n].Array[m];
205
-
206
-                if (num1.OperateAB == "÷" && str == "√") {
207
-                  isAnswer = true;
208
-                  var lineLength = num1.A.toString().length;
209
-                  var lineWidth = Math.floor(57 * (1 + num1.A.toString().length) / 2);
210
-
211
-                  ctx.drawImage("../../images/formula_division_size0" + lineLength + ".png", num - (num1.Vertical[n].Array.length - m) * 30 - 8, yStart + j * height + n * 30 - 31, lineWidth, 39);
212
-                  //break;
213
-                }
214
-                else if (num1.OperateAB == "÷" && n == 0) {
215
-                }
216
-                else if (num1.OperateAB == "÷" && n == 1) {
217
-                  ctx.fillText(str, num - (num1.Vertical[n].Array.length - m) * 10, yStart + j * height + n * 30);
218
-                }
219
-                else {
220
-                  ctx.fillText(str, num - (num1.Vertical[n].Array.length - m) * 30, yStart + j * height + n * 30);
221
-                }
222
-              }
223
-            }
224
-            if (isAnswer)
225
-              break;
226
-          }
227
-
228
-        }
229
-      }
230
-    }
231
-
232
-    ctx.setTextAlign('left');
233
-    ctx.setTextBaseline('top');
234
-    ctx.setFontSize(32);
235
-    ctx.fillText(item.Name, 60, 45);
236
-    ctx.fillText("99", 835, 50);
237
-
238
-
239
-    ctx.setFontSize(12);
240
-    ctx.fillText(item.CagegoryName, 60, 90);
241
-    ctx.fillText("共" + item.QuestionList.length + "道题", 60, 125);
242
-    ctx.fillText("第 1 / 1 页", 60, 147);
243
-    ctx.fillText("答案检索号", 768, 60);
244
-
245
-    ctx.setTextAlign('right');
246
-    ctx.fillText("出题时间 " + item.CreateTime, 875, 94);
247
-    ctx.fillText("微信扫一扫 计时看答案", 875, 111);
248
-    ctx.fillText("《数学计算题》选题 打印 扫码 批改", 875, 137);
249
-    ctx.drawImage("../../images/answer.png", 890, 54, 100, 100);
250
-
251
-
252
-    ctx.draw(true, function (n) {
253
-      wx.canvasToTempFilePath({
254
-        x: 0,
255
-        y: 0,
256
-        width: 2100,
257
-        height: 2970,
258
-        destWidth: 2100,
259
-        destHeight: 2970,
260
-        canvasId: 'Canvas',
261
-        success: function (res2) {
262
-          console.log(res2.tempFilePath);
263
-          wx.previewImage({
264
-            current: res2.tempFilePath, // 当前显示图片的http链接
265
-            urls: [res2.tempFilePath] // 需要预览的图片http链接列表
266
-          });
267
-        }
268
-      })
269
-    });
270
-
271
-    function getLength(str) {
272
-      switch (str) {
273
-        case "0":
274
-        case "1":
275
-        case "2":
276
-        case "3":
277
-        case "4":
278
-        case "5":
279
-        case "6":
280
-        case "7":
281
-        case "8":
282
-        case "9":
283
-          return 15;
284
-        case ".":
285
-          return 8;
286
-        default:
287
-          return 12;
288
-      }
289
-    }
290
-  },
291
-  moveLeft: function () {
292
-    this.setData({
293
-      Left: this.data.Left + 375,
294
-    });
295
-  },
296
-  moveRight: function () {
297
-    this.setData({
298
-      Left: this.data.Left - 375,
299
-    });
300
-  }
301
-});

+ 0 - 1
pages/main/print.json

@@ -1 +0,0 @@
1
-{}

+ 0 - 6
pages/main/print.wxml

@@ -1,6 +0,0 @@
1
-<view class="panel">
2
-<canvas class='Canvas' style='left:{{Left}}rpx;' canvas-id="Canvas"></canvas>
3
-<view class="btnLeft" bindtap='moveLeft'>左</view>
4
-<view class="btnRight" bindtap='moveRight'>右</view>
5
-
6
-</view>

+ 0 - 26
pages/main/print.wxss

@@ -1,26 +0,0 @@
1
-.panel{
2
-  width: 2100rpx; 
3
-  height: 2970rpx;
4
-}
5
-.Canvas{
6
-  width: 2100rpx; 
7
-  height: 2970rpx;
8
-  position: absolute;
9
-  left:0rpx;
10
-  top:0rpx;
11
-}
12
-
13
-.btnLeft{
14
-  position: fixed;
15
-  bottom: 30rpx;
16
-  left:30rpx;
17
-  background-color: #ddd;
18
-}
19
-
20
-.btnRight{
21
-  position: fixed;
22
-  bottom: 30rpx;
23
-  right:30rpx;
24
-  background-color: #ddd;
25
-}
26
-

+ 13 - 2
project.config.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
 	"description": "项目配置文件。",
3 3
 	"setting": {
4
-		"urlCheck": false,
4
+		"urlCheck": true,
5 5
 		"es6": true,
6 6
 		"postcss": true,
7 7
 		"minified": true,
@@ -30,7 +30,7 @@
30 30
 			"list": []
31 31
 		},
32 32
 		"miniprogram": {
33
-			"current": 5,
33
+			"current": 7,
34 34
 			"list": [
35 35
 				{
36 36
 					"id": 0,
@@ -67,6 +67,17 @@
67 67
 					"name": "login",
68 68
 					"pathName": "pages/about/payfinished",
69 69
 					"query": ""
70
+				},
71
+				{
72
+					"id": -1,
73
+					"name": "answer",
74
+					"pathName": "pages/main/answer",
75
+					"query": ""
76
+				},
77
+				{
78
+					"id": -1,
79
+					"name": "errorlist",
80
+					"pathName": "pages/main/errorlist"
70 81
 				}
71 82
 			]
72 83
 		}

BIN
sounds/click.mp3


BIN
sounds/startend.mp3


+ 1 - 11
utils/cryptojs.js

@@ -1,17 +1,7 @@
1 1
 var Crypto = exports.Crypto = require('./lib/Crypto').Crypto;
2 2
 
3
-[ 'CryptoMath'
4
-, 'BlockModes'
5
-, 'DES'
3
+[ 'BlockModes'
6 4
 , 'AES'
7
-, 'HMAC'
8
-, 'MARC4'
9
-, 'MD5'
10
-, 'PBKDF2'
11
-, 'PBKDF2Async'
12
-, 'Rabbit'
13
-, 'SHA1'
14
-, 'SHA256'
15 5
 ].forEach( function (path) {
16 6
 	require('./lib/' + path);
17 7
 });

+ 0 - 37
utils/lib/CryptoMath.js

@@ -1,37 +0,0 @@
1
-(function(){
2
-
3
-var C = (typeof window === 'undefined') ? require('./Crypto').Crypto : window.Crypto;
4
-
5
-// Shortcut
6
-var util = C.util;
7
-
8
-// Convert n to unsigned 32-bit integer
9
-util.u32 = function (n) {
10
-	return n >>> 0;
11
-};
12
-
13
-// Unsigned 32-bit addition
14
-util.add = function () {
15
-	var result = this.u32(arguments[0]);
16
-	for (var i = 1; i < arguments.length; i++)
17
-		result = this.u32(result + this.u32(arguments[i]));
18
-	return result;
19
-};
20
-
21
-// Unsigned 32-bit multiplication
22
-util.mult = function (m, n) {
23
-	return this.add((n & 0xFFFF0000) * m,
24
-			(n & 0x0000FFFF) * m);
25
-};
26
-
27
-// Unsigned 32-bit greater than (>) comparison
28
-util.gt = function (m, n) {
29
-	return this.u32(m) > this.u32(n);
30
-};
31
-
32
-// Unsigned 32-bit less than (<) comparison
33
-util.lt = function (m, n) {
34
-	return this.u32(m) < this.u32(n);
35
-};
36
-
37
-})();

Plik diff jest za duży
+ 0 - 1003
utils/lib/DES.js


+ 0 - 38
utils/lib/HMAC.js

@@ -1,38 +0,0 @@
1
-(function(){
2
-
3
-var C = (typeof window === 'undefined') ? require('./Crypto').Crypto : window.Crypto;
4
-
5
-// Shortcuts
6
-var util = C.util,
7
-    charenc = C.charenc,
8
-    UTF8 = charenc.UTF8,
9
-    Binary = charenc.Binary;
10
-
11
-C.HMAC = function (hasher, message, key, options) {
12
-
13
-	// Convert to byte arrays
14
-	if (message.constructor == String) message = UTF8.stringToBytes(message);
15
-	if (key.constructor == String) key = UTF8.stringToBytes(key);
16
-	/* else, assume byte arrays already */
17
-
18
-	// Allow arbitrary length keys
19
-	if (key.length > hasher._blocksize * 4)
20
-		key = hasher(key, { asBytes: true });
21
-
22
-	// XOR keys with pad constants
23
-	var okey = key.slice(0),
24
-	    ikey = key.slice(0);
25
-	for (var i = 0; i < hasher._blocksize * 4; i++) {
26
-		okey[i] ^= 0x5C;
27
-		ikey[i] ^= 0x36;
28
-	}
29
-
30
-	var hmacbytes = hasher(okey.concat(hasher(ikey.concat(message), { asBytes: true })), { asBytes: true });
31
-
32
-	return options && options.asBytes ? hmacbytes :
33
-	       options && options.asString ? Binary.bytesToString(hmacbytes) :
34
-	       util.bytesToHex(hmacbytes);
35
-
36
-};
37
-
38
-})();

+ 0 - 117
utils/lib/MARC4.js

@@ -1,117 +0,0 @@
1
-(function(){
2
-
3
-var C = (typeof window === 'undefined') ? require('./Crypto').Crypto : window.Crypto;
4
-
5
-// Shortcuts
6
-var util = C.util,
7
-    charenc = C.charenc,
8
-    UTF8 = charenc.UTF8,
9
-    Binary = charenc.Binary;
10
-
11
-var MARC4 = C.MARC4 = {
12
-
13
-	/**
14
-	 * Public API
15
-	 */
16
-
17
-	encrypt: function (message, password) {
18
-
19
-		var
20
-
21
-		    // Convert to bytes
22
-		    m = UTF8.stringToBytes(message),
23
-
24
-		    // Generate random IV
25
-		    iv = util.randomBytes(16),
26
-
27
-		    // Generate key
28
-		    k = password.constructor == String ?
29
-		        // Derive key from passphrase
30
-		        C.PBKDF2(password, iv, 32, { asBytes: true }) :
31
-		        // else, assume byte array representing cryptographic key
32
-		        password;
33
-
34
-		// Encrypt
35
-		MARC4._marc4(m, k, 1536);
36
-
37
-		// Return ciphertext
38
-		return util.bytesToBase64(iv.concat(m));
39
-
40
-	},
41
-
42
-	decrypt: function (ciphertext, password) {
43
-
44
-		var
45
-
46
-		    // Convert to bytes
47
-		    c = util.base64ToBytes(ciphertext),
48
-
49
-		    // Separate IV and message
50
-		    iv = c.splice(0, 16),
51
-
52
-		    // Generate key
53
-		    k = password.constructor == String ?
54
-		        // Derive key from passphrase
55
-		        C.PBKDF2(password, iv, 32, { asBytes: true }) :
56
-		        // else, assume byte array representing cryptographic key
57
-		        password;
58
-
59
-		// Decrypt
60
-		MARC4._marc4(c, k, 1536);
61
-
62
-		// Return plaintext
63
-		return UTF8.bytesToString(c);
64
-
65
-	},
66
-
67
-
68
-	/**
69
-	 * Internal methods
70
-	 */
71
-
72
-	// The core
73
-	_marc4: function (m, k, drop) {
74
-
75
-		// State variables
76
-		var i, j, s, temp;
77
-
78
-		// Key setup
79
-		for (i = 0, s = []; i < 256; i++) s[i] = i;
80
-		for (i = 0, j = 0;  i < 256; i++) {
81
-
82
-			j = (j + s[i] + k[i % k.length]) % 256;
83
-
84
-			// Swap
85
-			temp = s[i];
86
-			s[i] = s[j];
87
-			s[j] = temp;
88
-
89
-		}
90
-
91
-		// Clear counters
92
-		i = j = 0;
93
-
94
-		// Encryption
95
-		for (var k = -drop; k < m.length; k++) {
96
-
97
-			i = (i + 1) % 256;
98
-			j = (j + s[i]) % 256;
99
-
100
-			// Swap
101
-			temp = s[i];
102
-			s[i] = s[j];
103
-			s[j] = temp;
104
-
105
-			// Stop here if we're still dropping keystream
106
-			if (k < 0) continue;
107
-
108
-			// Encrypt
109
-			m[k] ^= s[(s[i] + s[j]) % 256];
110
-
111
-		}
112
-
113
-	}
114
-
115
-};
116
-
117
-})();

+ 0 - 158
utils/lib/MD5.js

@@ -1,158 +0,0 @@
1
-(function(){
2
-
3
-var C = (typeof window === 'undefined') ? require('./Crypto').Crypto : window.Crypto;
4
-
5
-// Shortcuts
6
-var util = C.util,
7
-    charenc = C.charenc,
8
-    UTF8 = charenc.UTF8,
9
-    Binary = charenc.Binary;
10
-
11
-// Public API
12
-var MD5 = C.MD5 = function (message, options) {
13
-	var digestbytes = util.wordsToBytes(MD5._md5(message));
14
-	return options && options.asBytes ? digestbytes :
15
-	       options && options.asString ? Binary.bytesToString(digestbytes) :
16
-	       util.bytesToHex(digestbytes);
17
-};
18
-
19
-// The core
20
-MD5._md5 = function (message) {
21
-
22
-	// Convert to byte array
23
-	if (message.constructor == String) message = UTF8.stringToBytes(message);
24
-	/* else, assume byte array already */
25
-
26
-	var m = util.bytesToWords(message),
27
-	    l = message.length * 8,
28
-	    a =  1732584193,
29
-	    b = -271733879,
30
-	    c = -1732584194,
31
-	    d =  271733878;
32
-
33
-	// Swap endian
34
-	for (var i = 0; i < m.length; i++) {
35
-		m[i] = ((m[i] <<  8) | (m[i] >>> 24)) & 0x00FF00FF |
36
-		       ((m[i] << 24) | (m[i] >>>  8)) & 0xFF00FF00;
37
-	}
38
-
39
-	// Padding
40
-	m[l >>> 5] |= 0x80 << (l % 32);
41
-	m[(((l + 64) >>> 9) << 4) + 14] = l;
42
-
43
-	// Method shortcuts
44
-	var FF = MD5._ff,
45
-	    GG = MD5._gg,
46
-	    HH = MD5._hh,
47
-	    II = MD5._ii;
48
-
49
-	for (var i = 0; i < m.length; i += 16) {
50
-
51
-		var aa = a,
52
-		    bb = b,
53
-		    cc = c,
54
-		    dd = d;
55
-
56
-		a = FF(a, b, c, d, m[i+ 0],  7, -680876936);
57
-		d = FF(d, a, b, c, m[i+ 1], 12, -389564586);
58
-		c = FF(c, d, a, b, m[i+ 2], 17,  606105819);
59
-		b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);
60
-		a = FF(a, b, c, d, m[i+ 4],  7, -176418897);
61
-		d = FF(d, a, b, c, m[i+ 5], 12,  1200080426);
62
-		c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);
63
-		b = FF(b, c, d, a, m[i+ 7], 22, -45705983);
64
-		a = FF(a, b, c, d, m[i+ 8],  7,  1770035416);
65
-		d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);
66
-		c = FF(c, d, a, b, m[i+10], 17, -42063);
67
-		b = FF(b, c, d, a, m[i+11], 22, -1990404162);
68
-		a = FF(a, b, c, d, m[i+12],  7,  1804603682);
69
-		d = FF(d, a, b, c, m[i+13], 12, -40341101);
70
-		c = FF(c, d, a, b, m[i+14], 17, -1502002290);
71
-		b = FF(b, c, d, a, m[i+15], 22,  1236535329);
72
-
73
-		a = GG(a, b, c, d, m[i+ 1],  5, -165796510);
74
-		d = GG(d, a, b, c, m[i+ 6],  9, -1069501632);
75
-		c = GG(c, d, a, b, m[i+11], 14,  643717713);
76
-		b = GG(b, c, d, a, m[i+ 0], 20, -373897302);
77
-		a = GG(a, b, c, d, m[i+ 5],  5, -701558691);
78
-		d = GG(d, a, b, c, m[i+10],  9,  38016083);
79
-		c = GG(c, d, a, b, m[i+15], 14, -660478335);
80
-		b = GG(b, c, d, a, m[i+ 4], 20, -405537848);
81
-		a = GG(a, b, c, d, m[i+ 9],  5,  568446438);
82
-		d = GG(d, a, b, c, m[i+14],  9, -1019803690);
83
-		c = GG(c, d, a, b, m[i+ 3], 14, -187363961);
84
-		b = GG(b, c, d, a, m[i+ 8], 20,  1163531501);
85
-		a = GG(a, b, c, d, m[i+13],  5, -1444681467);
86
-		d = GG(d, a, b, c, m[i+ 2],  9, -51403784);
87
-		c = GG(c, d, a, b, m[i+ 7], 14,  1735328473);
88
-		b = GG(b, c, d, a, m[i+12], 20, -1926607734);
89
-
90
-		a = HH(a, b, c, d, m[i+ 5],  4, -378558);
91
-		d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);
92
-		c = HH(c, d, a, b, m[i+11], 16,  1839030562);
93
-		b = HH(b, c, d, a, m[i+14], 23, -35309556);
94
-		a = HH(a, b, c, d, m[i+ 1],  4, -1530992060);
95
-		d = HH(d, a, b, c, m[i+ 4], 11,  1272893353);
96
-		c = HH(c, d, a, b, m[i+ 7], 16, -155497632);
97
-		b = HH(b, c, d, a, m[i+10], 23, -1094730640);
98
-		a = HH(a, b, c, d, m[i+13],  4,  681279174);
99
-		d = HH(d, a, b, c, m[i+ 0], 11, -358537222);
100
-		c = HH(c, d, a, b, m[i+ 3], 16, -722521979);
101
-		b = HH(b, c, d, a, m[i+ 6], 23,  76029189);
102
-		a = HH(a, b, c, d, m[i+ 9],  4, -640364487);
103
-		d = HH(d, a, b, c, m[i+12], 11, -421815835);
104
-		c = HH(c, d, a, b, m[i+15], 16,  530742520);
105
-		b = HH(b, c, d, a, m[i+ 2], 23, -995338651);
106
-
107
-		a = II(a, b, c, d, m[i+ 0],  6, -198630844);
108
-		d = II(d, a, b, c, m[i+ 7], 10,  1126891415);
109
-		c = II(c, d, a, b, m[i+14], 15, -1416354905);
110
-		b = II(b, c, d, a, m[i+ 5], 21, -57434055);
111
-		a = II(a, b, c, d, m[i+12],  6,  1700485571);
112
-		d = II(d, a, b, c, m[i+ 3], 10, -1894986606);
113
-		c = II(c, d, a, b, m[i+10], 15, -1051523);
114
-		b = II(b, c, d, a, m[i+ 1], 21, -2054922799);
115
-		a = II(a, b, c, d, m[i+ 8],  6,  1873313359);
116
-		d = II(d, a, b, c, m[i+15], 10, -30611744);
117
-		c = II(c, d, a, b, m[i+ 6], 15, -1560198380);
118
-		b = II(b, c, d, a, m[i+13], 21,  1309151649);
119
-		a = II(a, b, c, d, m[i+ 4],  6, -145523070);
120
-		d = II(d, a, b, c, m[i+11], 10, -1120210379);
121
-		c = II(c, d, a, b, m[i+ 2], 15,  718787259);
122
-		b = II(b, c, d, a, m[i+ 9], 21, -343485551);
123
-
124
-		a = (a + aa) >>> 0;
125
-		b = (b + bb) >>> 0;
126
-		c = (c + cc) >>> 0;
127
-		d = (d + dd) >>> 0;
128
-
129
-	}
130
-
131
-	return util.endian([a, b, c, d]);
132
-
133
-};
134
-
135
-// Auxiliary functions
136
-MD5._ff  = function (a, b, c, d, x, s, t) {
137
-	var n = a + (b & c | ~b & d) + (x >>> 0) + t;
138
-	return ((n << s) | (n >>> (32 - s))) + b;
139
-};
140
-MD5._gg  = function (a, b, c, d, x, s, t) {
141
-	var n = a + (b & d | c & ~d) + (x >>> 0) + t;
142
-	return ((n << s) | (n >>> (32 - s))) + b;
143
-};
144
-MD5._hh  = function (a, b, c, d, x, s, t) {
145
-	var n = a + (b ^ c ^ d) + (x >>> 0) + t;
146
-	return ((n << s) | (n >>> (32 - s))) + b;
147
-};
148
-MD5._ii  = function (a, b, c, d, x, s, t) {
149
-	var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;
150
-	return ((n << s) | (n >>> (32 - s))) + b;
151
-};
152
-
153
-// Package private blocksize
154
-MD5._blocksize = 16;
155
-
156
-MD5._digestsize = 16;
157
-
158
-})();

+ 0 - 49
utils/lib/PBKDF2.js

@@ -1,49 +0,0 @@
1
-(function(){
2
-
3
-var C = (typeof window === 'undefined') ? require('./Crypto').Crypto : window.Crypto;
4
-
5
-// Shortcuts
6
-var util = C.util,
7
-    charenc = C.charenc,
8
-    UTF8 = charenc.UTF8,
9
-    Binary = charenc.Binary;
10
-
11
-C.PBKDF2 = function (password, salt, keylen, options) {
12
-
13
-	// Convert to byte arrays
14
-	if (password.constructor == String) password = UTF8.stringToBytes(password);
15
-	if (salt.constructor == String) salt = UTF8.stringToBytes(salt);
16
-	/* else, assume byte arrays already */
17
-
18
-	// Defaults
19
-	var hasher = options && options.hasher || C.SHA1,
20
-	    iterations = options && options.iterations || 1;
21
-
22
-	// Pseudo-random function
23
-	function PRF(password, salt) {
24
-		return C.HMAC(hasher, salt, password, { asBytes: true });
25
-	}
26
-
27
-	// Generate key
28
-	var derivedKeyBytes = [],
29
-	    blockindex = 1;
30
-	while (derivedKeyBytes.length < keylen) {
31
-		var block = PRF(password, salt.concat(util.wordsToBytes([blockindex])));
32
-		for (var u = block, i = 1; i < iterations; i++) {
33
-			u = PRF(password, u);
34
-			for (var j = 0; j < block.length; j++) block[j] ^= u[j];
35
-		}
36
-		derivedKeyBytes = derivedKeyBytes.concat(block);
37
-		blockindex++;
38
-	}
39
-
40
-	// Truncate excess bytes
41
-	derivedKeyBytes.length = keylen;
42
-
43
-	return options && options.asBytes ? derivedKeyBytes :
44
-	       options && options.asString ? Binary.bytesToString(derivedKeyBytes) :
45
-	       util.bytesToHex(derivedKeyBytes);
46
-
47
-};
48
-
49
-})();

+ 0 - 88
utils/lib/PBKDF2Async.js

@@ -1,88 +0,0 @@
1
-(function(){
2
-
3
-var C = (typeof window === 'undefined') ? require('./Crypto').Crypto : window.Crypto;
4
-
5
-// Shortcuts
6
-var util = C.util,
7
-    charenc = C.charenc,
8
-    UTF8 = charenc.UTF8,
9
-    Binary = charenc.Binary;
10
-
11
-if (!C.nextTick) {
12
-    // node.js has setTime out but prefer process.nextTick
13
-    if (typeof process != 'undefined' && typeof process.nextTick !== 'undefined') {
14
-        C.nextTick = process.nextTick;
15
-    } else if (typeof setTimeout !== 'undefined') {
16
-        C.nextTick = function (callback) {
17
-            setTimeout(callback, 0);
18
-        };
19
-    }
20
-}
21
-
22
-C.PBKDF2Async = function (password, salt, keylen, callback, options) {
23
-
24
-    // Convert to byte arrays
25
-    if (password.constructor == String) password = UTF8.stringToBytes(password);
26
-    if (salt.constructor == String) salt = UTF8.stringToBytes(salt);
27
-    /* else, assume byte arrays already */
28
-
29
-    // Defaults
30
-    var hasher = options && options.hasher || C.SHA1,
31
-        iterations = options && options.iterations || 1;
32
-
33
-    // Progress callback option
34
-    var progressChangeHandler = options && options.onProgressChange;
35
-    var totalIterations = Math.ceil(keylen / hasher._digestsize) * iterations;
36
-    function fireProgressChange(currentIteration) {
37
-        if (progressChangeHandler) {
38
-            var iterationsSoFar = derivedKeyBytes.length / hasher._digestsize * iterations + currentIteration;
39
-            setTimeout(function () {
40
-                progressChangeHandler(Math.round(iterationsSoFar / totalIterations * 100));
41
-            }, 0);
42
-        }
43
-    }
44
-
45
-    // Pseudo-random function
46
-    function PRF(password, salt) {
47
-        return C.HMAC(hasher, salt, password, { asBytes: true });
48
-    }
49
-
50
-    var nextTick = C.nextTick;
51
-
52
-    // Generate key
53
-    var derivedKeyBytes = [],
54
-        blockindex = 1;
55
-
56
-    var outer, inner;
57
-    nextTick(outer = function () {
58
-        if (derivedKeyBytes.length < keylen) {
59
-            var block = PRF(password, salt.concat(util.wordsToBytes([blockindex])));
60
-            fireProgressChange(1);
61
-
62
-            var u = block, i = 1;
63
-            nextTick(inner = function () {
64
-                if (i < iterations) {
65
-                    u = PRF(password, u);
66
-                    for (var j = 0; j < block.length; j++) block[j] ^= u[j];
67
-                    i++;
68
-                    fireProgressChange(i);
69
-
70
-                    nextTick(inner);
71
-                } else {
72
-                    derivedKeyBytes = derivedKeyBytes.concat(block);
73
-                    blockindex++;
74
-                    nextTick(outer);
75
-                }
76
-            });
77
-        } else {
78
-            // Truncate excess bytes
79
-            derivedKeyBytes.length = keylen;
80
-            callback(
81
-                    options && options.asBytes ? derivedKeyBytes :
82
-                    options && options.asString ? Binary.bytesToString(derivedKeyBytes) :
83
-                    util.bytesToHex(derivedKeyBytes));
84
-        }
85
-    });
86
-};
87
-
88
-})();

+ 0 - 221
utils/lib/Rabbit.js

@@ -1,221 +0,0 @@
1
-(function(){
2
-
3
-var C = (typeof window === 'undefined') ? require('./Crypto').Crypto : window.Crypto;
4
-
5
-// Shortcuts
6
-var util = C.util,
7
-    charenc = C.charenc,
8
-    UTF8 = charenc.UTF8,
9
-    Binary = charenc.Binary;
10
-
11
-// Inner state
12
-var x = [],
13
-    c = [],
14
-    b;
15
-
16
-var Rabbit = C.Rabbit = {
17
-
18
-	/**
19
-	 * Public API
20
-	 */
21
-
22
-	encrypt: function (message, password) {
23
-
24
-		var
25
-
26
-		    // Convert to bytes
27
-		    m = UTF8.stringToBytes(message),
28
-
29
-		    // Generate random IV
30
-		    iv = util.randomBytes(8),
31
-
32
-		    // Generate key
33
-		    k = password.constructor == String ?
34
-		        // Derive key from passphrase
35
-		        C.PBKDF2(password, iv, 32, { asBytes: true }) :
36
-		        // else, assume byte array representing cryptographic key
37
-		        password;
38
-
39
-		// Encrypt
40
-		Rabbit._rabbit(m, k, util.bytesToWords(iv));
41
-
42
-		// Return ciphertext
43
-		return util.bytesToBase64(iv.concat(m));
44
-
45
-	},
46
-
47
-	decrypt: function (ciphertext, password) {
48
-
49
-		var
50
-
51
-		    // Convert to bytes
52
-		    c = util.base64ToBytes(ciphertext),
53
-
54
-		    // Separate IV and message
55
-		    iv = c.splice(0, 8),
56
-
57
-		    // Generate key
58
-		    k = password.constructor == String ?
59
-		        // Derive key from passphrase
60
-		        C.PBKDF2(password, iv, 32, { asBytes: true }) :
61
-		        // else, assume byte array representing cryptographic key
62
-		        password;
63
-
64
-		// Decrypt
65
-		Rabbit._rabbit(c, k, util.bytesToWords(iv));
66
-
67
-		// Return plaintext
68
-		return UTF8.bytesToString(c);
69
-
70
-	},
71
-
72
-
73
-	/**
74
-	 * Internal methods
75
-	 */
76
-
77
-	// Encryption/decryption scheme
78
-	_rabbit: function (m, k, iv) {
79
-
80
-		Rabbit._keysetup(k);
81
-		if (iv) Rabbit._ivsetup(iv);
82
-
83
-		for (var s = [], i = 0; i < m.length; i++) {
84
-
85
-			if (i % 16 == 0) {
86
-
87
-				// Iterate the system
88
-				Rabbit._nextstate();
89
-
90
-				// Generate 16 bytes of pseudo-random data
91
-				s[0] = x[0] ^ (x[5] >>> 16) ^ (x[3] << 16);
92
-				s[1] = x[2] ^ (x[7] >>> 16) ^ (x[5] << 16);
93
-				s[2] = x[4] ^ (x[1] >>> 16) ^ (x[7] << 16);
94
-				s[3] = x[6] ^ (x[3] >>> 16) ^ (x[1] << 16);
95
-
96
-				// Swap endian
97
-				for (var j = 0; j < 4; j++) {
98
-					s[j] = ((s[j] <<  8) | (s[j] >>> 24)) & 0x00FF00FF |
99
-					       ((s[j] << 24) | (s[j] >>>  8)) & 0xFF00FF00;
100
-				}
101
-
102
-				// Convert words to bytes
103
-				for (var b = 120; b >= 0; b -= 8)
104
-					s[b / 8] = (s[b >>> 5] >>> (24 - b % 32)) & 0xFF;
105
-
106
-			}
107
-
108
-			m[i] ^= s[i % 16];
109
-
110
-		}
111
-
112
-	},
113
-
114
-	// Key setup scheme
115
-	_keysetup: function (k) {
116
-
117
-		// Generate initial state values
118
-		x[0] = k[0];
119
-		x[2] = k[1];
120
-		x[4] = k[2];
121
-		x[6] = k[3];
122
-		x[1] = (k[3] << 16) | (k[2] >>> 16);
123
-		x[3] = (k[0] << 16) | (k[3] >>> 16);
124
-		x[5] = (k[1] << 16) | (k[0] >>> 16);
125
-		x[7] = (k[2] << 16) | (k[1] >>> 16);
126
-
127
-		// Generate initial counter values
128
-		c[0] = util.rotl(k[2], 16);
129
-		c[2] = util.rotl(k[3], 16);
130
-		c[4] = util.rotl(k[0], 16);
131
-		c[6] = util.rotl(k[1], 16);
132
-		c[1] = (k[0] & 0xFFFF0000) | (k[1] & 0xFFFF);
133
-		c[3] = (k[1] & 0xFFFF0000) | (k[2] & 0xFFFF);
134
-		c[5] = (k[2] & 0xFFFF0000) | (k[3] & 0xFFFF);
135
-		c[7] = (k[3] & 0xFFFF0000) | (k[0] & 0xFFFF);
136
-
137
-		// Clear carry bit
138
-		b = 0;
139
-
140
-		// Iterate the system four times
141
-		for (var i = 0; i < 4; i++) Rabbit._nextstate();
142
-
143
-		// Modify the counters
144
-		for (var i = 0; i < 8; i++) c[i] ^= x[(i + 4) & 7];
145
-
146
-	},
147
-
148
-	// IV setup scheme
149
-	_ivsetup: function (iv) {
150
-
151
-		// Generate four subvectors
152
-		var i0 = util.endian(iv[0]),
153
-		    i2 = util.endian(iv[1]),
154
-		    i1 = (i0 >>> 16) | (i2 & 0xFFFF0000),
155
-		    i3 = (i2 <<  16) | (i0 & 0x0000FFFF);
156
-
157
-		// Modify counter values
158
-		c[0] ^= i0;
159
-		c[1] ^= i1;
160
-		c[2] ^= i2;
161
-		c[3] ^= i3;
162
-		c[4] ^= i0;
163
-		c[5] ^= i1;
164
-		c[6] ^= i2;
165
-		c[7] ^= i3;
166
-
167
-		// Iterate the system four times
168
-		for (var i = 0; i < 4; i++) Rabbit._nextstate();
169
-
170
-	},
171
-
172
-	// Next-state function
173
-	_nextstate: function () {
174
-
175
-		// Save old counter values
176
-		for (var c_old = [], i = 0; i < 8; i++) c_old[i] = c[i];
177
-
178
-		// Calculate new counter values
179
-		c[0] = (c[0] + 0x4D34D34D + b) >>> 0;
180
-		c[1] = (c[1] + 0xD34D34D3 + ((c[0] >>> 0) < (c_old[0] >>> 0) ? 1 : 0)) >>> 0;
181
-		c[2] = (c[2] + 0x34D34D34 + ((c[1] >>> 0) < (c_old[1] >>> 0) ? 1 : 0)) >>> 0;
182
-		c[3] = (c[3] + 0x4D34D34D + ((c[2] >>> 0) < (c_old[2] >>> 0) ? 1 : 0)) >>> 0;
183
-		c[4] = (c[4] + 0xD34D34D3 + ((c[3] >>> 0) < (c_old[3] >>> 0) ? 1 : 0)) >>> 0;
184
-		c[5] = (c[5] + 0x34D34D34 + ((c[4] >>> 0) < (c_old[4] >>> 0) ? 1 : 0)) >>> 0;
185
-		c[6] = (c[6] + 0x4D34D34D + ((c[5] >>> 0) < (c_old[5] >>> 0) ? 1 : 0)) >>> 0;
186
-		c[7] = (c[7] + 0xD34D34D3 + ((c[6] >>> 0) < (c_old[6] >>> 0) ? 1 : 0)) >>> 0;
187
-		b = (c[7] >>> 0) < (c_old[7] >>> 0) ? 1 : 0;
188
-
189
-		// Calculate the g-values
190
-		for (var g = [], i = 0; i < 8; i++) {
191
-
192
-			var gx = (x[i] + c[i]) >>> 0;
193
-
194
-			// Construct high and low argument for squaring
195
-			var ga = gx & 0xFFFF,
196
-			    gb = gx >>> 16;
197
-
198
-			// Calculate high and low result of squaring
199
-			var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb,
200
-			    gl = (((gx & 0xFFFF0000) * gx) >>> 0) + (((gx & 0x0000FFFF) * gx) >>> 0) >>> 0;
201
-
202
-			// High XOR low
203
-			g[i] = gh ^ gl;
204
-
205
-		}
206
-
207
-		// Calculate new state values
208
-		x[0] = g[0] + ((g[7] << 16) | (g[7] >>> 16)) + ((g[6] << 16) | (g[6] >>> 16));
209
-		x[1] = g[1] + ((g[0] <<  8) | (g[0] >>> 24)) + g[7];
210
-		x[2] = g[2] + ((g[1] << 16) | (g[1] >>> 16)) + ((g[0] << 16) | (g[0] >>> 16));
211
-		x[3] = g[3] + ((g[2] <<  8) | (g[2] >>> 24)) + g[1];
212
-		x[4] = g[4] + ((g[3] << 16) | (g[3] >>> 16)) + ((g[2] << 16) | (g[2] >>> 16));
213
-		x[5] = g[5] + ((g[4] <<  8) | (g[4] >>> 24)) + g[3];
214
-		x[6] = g[6] + ((g[5] << 16) | (g[5] >>> 16)) + ((g[4] << 16) | (g[4] >>> 16));
215
-		x[7] = g[7] + ((g[6] <<  8) | (g[6] >>> 24)) + g[5];
216
-
217
-	}
218
-
219
-};
220
-
221
-})();

+ 0 - 86
utils/lib/SHA1.js

@@ -1,86 +0,0 @@
1
-(function(){
2
-
3
-var C = (typeof window === 'undefined') ? require('./Crypto').Crypto : window.Crypto;
4
-
5
-// Shortcuts
6
-var util = C.util,
7
-    charenc = C.charenc,
8
-    UTF8 = charenc.UTF8,
9
-    Binary = charenc.Binary;
10
-
11
-// Public API
12
-var SHA1 = C.SHA1 = function (message, options) {
13
-	var digestbytes = util.wordsToBytes(SHA1._sha1(message));
14
-	return options && options.asBytes ? digestbytes :
15
-	       options && options.asString ? Binary.bytesToString(digestbytes) :
16
-	       util.bytesToHex(digestbytes);
17
-};
18
-
19
-// The core
20
-SHA1._sha1 = function (message) {
21
-
22
-	// Convert to byte array
23
-	if (message.constructor == String) message = UTF8.stringToBytes(message);
24
-	/* else, assume byte array already */
25
-
26
-	var m  = util.bytesToWords(message),
27
-	    l  = message.length * 8,
28
-	    w  =  [],
29
-	    H0 =  1732584193,
30
-	    H1 = -271733879,
31
-	    H2 = -1732584194,
32
-	    H3 =  271733878,
33
-	    H4 = -1009589776;
34
-
35
-	// Padding
36
-	m[l >> 5] |= 0x80 << (24 - l % 32);
37
-	m[((l + 64 >>> 9) << 4) + 15] = l;
38
-
39
-	for (var i = 0; i < m.length; i += 16) {
40
-
41
-		var a = H0,
42
-		    b = H1,
43
-		    c = H2,
44
-		    d = H3,
45
-		    e = H4;
46
-
47
-		for (var j = 0; j < 80; j++) {
48
-
49
-			if (j < 16) w[j] = m[i + j];
50
-			else {
51
-				var n = w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16];
52
-				w[j] = (n << 1) | (n >>> 31);
53
-			}
54
-
55
-			var t = ((H0 << 5) | (H0 >>> 27)) + H4 + (w[j] >>> 0) + (
56
-			         j < 20 ? (H1 & H2 | ~H1 & H3) + 1518500249 :
57
-			         j < 40 ? (H1 ^ H2 ^ H3) + 1859775393 :
58
-			         j < 60 ? (H1 & H2 | H1 & H3 | H2 & H3) - 1894007588 :
59
-			                  (H1 ^ H2 ^ H3) - 899497514);
60
-
61
-			H4 =  H3;
62
-			H3 =  H2;
63
-			H2 = (H1 << 30) | (H1 >>> 2);
64
-			H1 =  H0;
65
-			H0 =  t;
66
-
67
-		}
68
-
69
-		H0 += a;
70
-		H1 += b;
71
-		H2 += c;
72
-		H3 += d;
73
-		H4 += e;
74
-
75
-	}
76
-
77
-	return [H0, H1, H2, H3, H4];
78
-
79
-};
80
-
81
-// Package private blocksize
82
-SHA1._blocksize = 16;
83
-
84
-SHA1._digestsize = 20;
85
-
86
-})();

+ 0 - 130
utils/lib/SHA256.js

@@ -1,130 +0,0 @@
1
-(function(){
2
-
3
-var C = (typeof window === 'undefined') ? require('./Crypto').Crypto : window.Crypto;
4
-
5
-// Shortcuts
6
-var util = C.util,
7
-    charenc = C.charenc,
8
-    UTF8 = charenc.UTF8,
9
-    Binary = charenc.Binary;
10
-
11
-// Constants
12
-var K = [ 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,
13
-          0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,
14
-          0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,
15
-          0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,
16
-          0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,
17
-          0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,
18
-          0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,
19
-          0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,
20
-          0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,
21
-          0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,
22
-          0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,
23
-          0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,
24
-          0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,
25
-          0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,
26
-          0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,
27
-          0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2 ];
28
-
29
-// Public API
30
-var SHA256 = C.SHA256 = function (message, options) {
31
-	var digestbytes = util.wordsToBytes(SHA256._sha256(message));
32
-	return options && options.asBytes ? digestbytes :
33
-	       options && options.asString ? Binary.bytesToString(digestbytes) :
34
-	       util.bytesToHex(digestbytes);
35
-};
36
-
37
-// The core
38
-SHA256._sha256 = function (message) {
39
-
40
-	// Convert to byte array
41
-	if (message.constructor == String) message = UTF8.stringToBytes(message);
42
-	/* else, assume byte array already */
43
-
44
-	var m = util.bytesToWords(message),
45
-	    l = message.length * 8,
46
-	    H = [ 0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A,
47
-	          0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19 ],
48
-	    w = [],
49
-	    a, b, c, d, e, f, g, h, i, j,
50
-	    t1, t2;
51
-
52
-	// Padding
53
-	m[l >> 5] |= 0x80 << (24 - l % 32);
54
-	m[((l + 64 >> 9) << 4) + 15] = l;
55
-
56
-	for (var i = 0; i < m.length; i += 16) {
57
-
58
-		a = H[0];
59
-		b = H[1];
60
-		c = H[2];
61
-		d = H[3];
62
-		e = H[4];
63
-		f = H[5];
64
-		g = H[6];
65
-		h = H[7];
66
-
67
-		for (var j = 0; j < 64; j++) {
68
-
69
-			if (j < 16) w[j] = m[j + i];
70
-			else {
71
-
72
-				var gamma0x = w[j - 15],
73
-				    gamma1x = w[j - 2],
74
-				    gamma0  = ((gamma0x << 25) | (gamma0x >>>  7)) ^
75
-				              ((gamma0x << 14) | (gamma0x >>> 18)) ^
76
-				               (gamma0x >>> 3),
77
-				    gamma1  = ((gamma1x <<  15) | (gamma1x >>> 17)) ^
78
-				              ((gamma1x <<  13) | (gamma1x >>> 19)) ^
79
-				               (gamma1x >>> 10);
80
-
81
-				w[j] = gamma0 + (w[j - 7] >>> 0) +
82
-				       gamma1 + (w[j - 16] >>> 0);
83
-
84
-			}
85
-
86
-			var ch  = e & f ^ ~e & g,
87
-			    maj = a & b ^ a & c ^ b & c,
88
-			    sigma0 = ((a << 30) | (a >>>  2)) ^
89
-			             ((a << 19) | (a >>> 13)) ^
90
-			             ((a << 10) | (a >>> 22)),
91
-			    sigma1 = ((e << 26) | (e >>>  6)) ^
92
-			             ((e << 21) | (e >>> 11)) ^
93
-			             ((e <<  7) | (e >>> 25));
94
-
95
-
96
-			t1 = (h >>> 0) + sigma1 + ch + (K[j]) + (w[j] >>> 0);
97
-			t2 = sigma0 + maj;
98
-
99
-			h = g;
100
-			g = f;
101
-			f = e;
102
-			e = (d + t1) >>> 0;
103
-			d = c;
104
-			c = b;
105
-			b = a;
106
-			a = (t1 + t2) >>> 0;
107
-
108
-		}
109
-
110
-		H[0] += a;
111
-		H[1] += b;
112
-		H[2] += c;
113
-		H[3] += d;
114
-		H[4] += e;
115
-		H[5] += f;
116
-		H[6] += g;
117
-		H[7] += h;
118
-
119
-	}
120
-
121
-	return H;
122
-
123
-};
124
-
125
-// Package private blocksize
126
-SHA256._blocksize = 16;
127
-
128
-SHA256._digestsize = 32;
129
-
130
-})();

+ 12 - 33
utils/main.js

@@ -144,37 +144,6 @@ function payMoney(payType, money, callback) {
144 144
     }
145 145
   });
146 146
 }
147
-function downloadImage(scoreID) {
148
-  wx.showLoading({
149
-    title: '下载中_然后长按保存',
150
-  });
151
-
152
-  var that = this;
153
-  getData('MakeSchulteShare?ScoreID=' + scoreID, function (data) {
154
-
155
-    setTimeout(function () {
156
-      wx.downloadFile({
157
-        url: "https://schulte-1253256735.file.myqcloud.com/share" + scoreID + ".jpg",
158
-        success: function (res) {
159
-          wx.hideLoading();
160
-          wx.previewImage({
161
-            current: res.tempFilePath, // 当前显示图片的http链接
162
-            urls: [res.tempFilePath] // 需要预览的图片http链接列表
163
-          })
164
-        },
165
-        fail: function () {
166
-          wx.hideLoading();
167
-          getData('MakeSchulteShare?ScoreID=' + scoreID, function (data) { });
168
-          wx.showToast({
169
-            title: '请稍候再试!',
170
-            duration: 2000
171
-          });
172
-        }
173
-      });
174
-    }, 2000);
175
-
176
-  });
177
-}
178 147
 
179 148
 function getTimeFormat(duration) {
180 149
   //console.log("duration:" + duration);
@@ -312,22 +281,31 @@ function gotoFeedback() {
312 281
   });
313 282
 }
314 283
 
315
-function playAudio(ctx, sentence) {
284
+function playAudio(ctx, sentence, player) {
316 285
   var url = app.globalData.audioUrlBaidu;
317 286
   url = url.replace("[token]", app.globalData.BaiduToken);
318 287
   url = url.replace("[word]", sentence);
288
+  if (player)
289
+    url = url.replace("per=4", "per="+player);
319 290
   //console.log(url);
320 291
   ctx.setSrc(url);
321 292
   ctx.play();
322 293
 }
323 294
 
295
+function playSound(file){
296
+  const innerAudioContext = wx.createInnerAudioContext()
297
+  innerAudioContext.autoplay = true
298
+  innerAudioContext.src = file
299
+  innerAudioContext.onPlay(() => {
300
+    console.log('开始播放')
301
+  })
302
+}
324 303
 
325 304
 module.exports = {
326 305
   getData: getData,
327 306
   postData: postData,
328 307
   shareGroup: shareGroup,
329 308
   payMoney: payMoney,
330
-  downloadImage: downloadImage,
331 309
   getLocalHost: getLocalHost,
332 310
   getTimeFormat: getTimeFormat,
333 311
   getWindowHeight: getWindowHeight,
@@ -336,4 +314,5 @@ module.exports = {
336 314
   getProgramList: getProgramList,
337 315
   gotoFeedback: gotoFeedback,
338 316
   playAudio: playAudio,
317
+  playSound: playSound,
339 318
 }

+ 0 - 23
utils/util.js

@@ -185,29 +185,6 @@ function sort(array, sort_order, obj, objType, obj2, objType2) {
185 185
     }
186 186
   }
187 187
 }
188
-////测试sort
189
-// var a = [
190
-//   {
191
-//     time: "2017-2-1",
192
-//     a: 3,
193
-//   }, {
194
-//     time: "2017-4-1",
195
-//     a: 5,
196
-//   }, {
197
-//     time: "2017-1-1",
198
-//     a: 6
199
-//   },{
200
-//     time: "2017-2-1",
201
-//     a: 3
202
-//   },
203
-// ];
204
-// console.log(a);
205
-// // var a = common.sort(a,"ASC", "time","String");
206
-// // console.log(a);
207
-// var a = common.sort(a,"DESC", "time","String");
208
-// console.log(a);
209
-// //var a = common.sort(a,"DESC", "a","Number");
210
-// // console.log(a);
211 188
 
212 189
 function checkError(err) {
213 190
   switch (err) {