chengjie 6 years ago
parent
commit
95bc1bebc3
57 changed files with 2065 additions and 660 deletions
  1. 2 2
      app.js
  2. 4 3
      app.json
  3. 1 0
      app.wxss
  4. 250 0
      components/navigation-bar/navigation-bar.js
  5. 4 0
      components/navigation-bar/navigation-bar.json
  6. 30 0
      components/navigation-bar/navigation-bar.wxml
  7. 60 0
      components/navigation-bar/navigation-bar.wxss
  8. 0 0
      pages/images/promotion_leaflet_a01.png
  9. 0 0
      pages/images/universalpic_add_gray_114x114.png
  10. BIN
      pages/images/universalpic_broadcast_default_gray_34x25.png
  11. BIN
      pages/images/universalpic_broadcast_enable_tc01_34x25.png
  12. BIN
      pages/images/universalpic_broadcast_enable_tc02_34x25.png
  13. BIN
      pages/images/universalpic_broadcast_enable_tc03_34x25.png
  14. BIN
      pages/images/universalpic_broadcast_enable_tc04_34x25.png
  15. 0 0
      pages/images/universalpic_face_default_gray_114x114.png
  16. BIN
      pages/images/universalpic_sendtoback_gray_30x26.png
  17. 13 13
      pages/index/index.js
  18. 140 111
      pages/main/add.js
  19. 2 1
      pages/main/add.wxml
  20. 1 1
      pages/main/default.js
  21. 1 1
      pages/main/default.wxml
  22. 255 220
      pages/main/detail.js
  23. 16 11
      pages/main/detail.wxml
  24. 6 0
      pages/main/detail.wxss
  25. 6 6
      pages/main/preview.wxml
  26. 16 1
      pages/main/searchWeb2.wxml
  27. 0 0
      pages/marketing/extenduser.js
  28. 0 0
      pages/marketing/extenduser.json
  29. 0 0
      pages/marketing/extenduser.wxml
  30. 0 0
      pages/marketing/extenduser.wxss
  31. 0 0
      pages/marketing/index.js
  32. 0 0
      pages/marketing/index.json
  33. 0 0
      pages/marketing/index.wxml
  34. 0 0
      pages/marketing/index.wxss
  35. 0 0
      pages/marketing/shareuser.js
  36. 0 0
      pages/marketing/shareuser.json
  37. 0 0
      pages/marketing/shareuser.wxml
  38. 0 0
      pages/marketing/shareuser.wxss
  39. 10 10
      pages/other/binding.js
  40. 2 2
      pages/other/userbook.wxml
  41. 147 76
      pages/test/index.js
  42. 4 1
      pages/test/index.json
  43. 35 22
      pages/test/index.wxml
  44. 19 4
      pages/test/index.wxss
  45. 387 26
      pages/test/item.js
  46. 5 3
      pages/test/item.json
  47. 31 13
      pages/test/item.wxml
  48. 32 7
      pages/test/item.wxss
  49. 114 30
      pages/test/list.js
  50. 3 1
      pages/test/list.json
  51. 39 11
      pages/test/list.wxml
  52. 28 2
      pages/test/list.wxss
  53. 215 0
      pages/test/report.js
  54. 41 55
      pages/test/report.wxml
  55. 82 5
      pages/test/report.wxss
  56. 6 4
      project.config.json
  57. 58 18
      utils/main.js

File diff suppressed because it is too large
+ 2 - 2
app.js


+ 4 - 3
app.json

@@ -32,9 +32,9 @@
32 32
     "pages/plan/sortRule",
33 33
     "pages/plan/setting",
34 34
     
35
-    "marketing/main/extenduser",
36
-    "marketing/main/shareuser",
37
-    "marketing/main/index",
35
+    "pages/marketing/extenduser",
36
+    "pages/marketing/shareuser",
37
+    "pages/marketing/index",
38 38
     
39 39
     "pages/other/lessonlist",
40 40
     "pages/other/userlist",
@@ -56,6 +56,7 @@
56 56
     "navigationBarTitleText": "秒过",
57 57
     "navigationBarTextStyle": "black",
58 58
     "backgroundColor": "#ffffff",
59
+    "resizable": false,
59 60
     "enablePullDownRefresh": false
60 61
   },
61 62
   "requiredBackgroundModes": [

+ 1 - 0
app.wxss

@@ -18,6 +18,7 @@
18 18
   align-items: center;
19 19
   justify-content: center;
20 20
 }
21
+
21 22
 .container {
22 23
   width:100%;
23 24
   color: #1e1e1e;

+ 250 - 0
components/navigation-bar/navigation-bar.js

@@ -0,0 +1,250 @@
1
+/**
2
+ * 自定义头部导航组件,基于官方组件Navigation开发。
3
+ * 
4
+ * <navigation-bar title="会员中心" bindgetBarInfo="getBarInfo"></navigation-bar>
5
+ * 
6
+ * 组件属性列表 
7
+ * bindgetBarInfo {eventhandler}  组件实例载入页面时触发此事件,首参为event对象,event.detail携带当前导航栏信息,如导航栏高度 event.detail.topBarHeight
8
+ * backImage      {string}  back按钮的图标地址
9
+ * homeImage      {string}  home按钮的图标地址
10
+ * bindback	      {eventhandler}	点击back按钮触发此事件响应函数
11
+ * ext-class	    {string}	添加在组件内部结构的class,可用于修改组件内部的样式
12
+ * title	        {string}	导航标题,如果不提供为空
13
+ * background	    {string}	导航背景色,默认#ffffff
14
+ * color	        {string}	导航字体颜色
15
+ * dbclickBackTop {boolean}	是否开启双击返回顶部功能,默认true
16
+ * border         {boolean}	是否显示顶部边框,默认false
17
+ * loading	      {boolean}	是否显示标题左侧的loading,默认false
18
+ * show	          {boolean}	显示隐藏导航,隐藏的时候navigation的高度占位还在,默认true
19
+ * left	          {boolean}	左侧区域是否使用slot内容,默认false
20
+ * center	        {boolean}	中间区域是否使用slot内容,默认false
21
+ *  
22
+ * Slot Name
23
+ * left	          左侧slot,在back按钮位置显示,当left属性为true的时候有效
24
+ * center	        标题slot,在标题位置显示,当center属性为true的时候有效
25
+ * 
26
+*/
27
+
28
+module.exports =
29
+/******/ (function(modules) { // webpackBootstrap
30
+/******/ 	// The module cache
31
+/******/ 	var installedModules = {};
32
+/******/
33
+/******/ 	// The require function
34
+/******/ 	function __webpack_require__(moduleId) {
35
+/******/
36
+/******/ 		// Check if module is in cache
37
+/******/ 		if(installedModules[moduleId]) {
38
+/******/ 			return installedModules[moduleId].exports;
39
+/******/ 		}
40
+/******/ 		// Create a new module (and put it into the cache)
41
+/******/ 		var module = installedModules[moduleId] = {
42
+/******/ 			i: moduleId,
43
+/******/ 			l: false,
44
+/******/ 			exports: {}
45
+/******/ 		};
46
+/******/
47
+/******/ 		// Execute the module function
48
+/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
49
+/******/
50
+/******/ 		// Flag the module as loaded
51
+/******/ 		module.l = true;
52
+/******/
53
+/******/ 		// Return the exports of the module
54
+/******/ 		return module.exports;
55
+/******/ 	}
56
+/******/
57
+/******/
58
+/******/ 	// expose the modules object (__webpack_modules__)
59
+/******/ 	__webpack_require__.m = modules;
60
+/******/
61
+/******/ 	// expose the module cache
62
+/******/ 	__webpack_require__.c = installedModules;
63
+/******/
64
+/******/ 	// define getter function for harmony exports
65
+/******/ 	__webpack_require__.d = function(exports, name, getter) {
66
+/******/ 		if(!__webpack_require__.o(exports, name)) {
67
+/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
68
+/******/ 		}
69
+/******/ 	};
70
+/******/
71
+/******/ 	// define __esModule on exports
72
+/******/ 	__webpack_require__.r = function(exports) {
73
+/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
74
+/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
75
+/******/ 		}
76
+/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
77
+/******/ 	};
78
+/******/
79
+/******/ 	// create a fake namespace object
80
+/******/ 	// mode & 1: value is a module id, require it
81
+/******/ 	// mode & 2: merge all properties of value into the ns
82
+/******/ 	// mode & 4: return value when already ns object
83
+/******/ 	// mode & 8|1: behave like require
84
+/******/ 	__webpack_require__.t = function(value, mode) {
85
+/******/ 		if(mode & 1) value = __webpack_require__(value);
86
+/******/ 		if(mode & 8) return value;
87
+/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
88
+/******/ 		var ns = Object.create(null);
89
+/******/ 		__webpack_require__.r(ns);
90
+/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
91
+/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
92
+/******/ 		return ns;
93
+/******/ 	};
94
+/******/
95
+/******/ 	// getDefaultExport function for compatibility with non-harmony modules
96
+/******/ 	__webpack_require__.n = function(module) {
97
+/******/ 		var getter = module && module.__esModule ?
98
+/******/ 			function getDefault() { return module['default']; } :
99
+/******/ 			function getModuleExports() { return module; };
100
+/******/ 		__webpack_require__.d(getter, 'a', getter);
101
+/******/ 		return getter;
102
+/******/ 	};
103
+/******/
104
+/******/ 	// Object.prototype.hasOwnProperty.call
105
+/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
106
+/******/
107
+/******/ 	// __webpack_public_path__
108
+/******/ 	__webpack_require__.p = "";
109
+/******/
110
+/******/
111
+/******/ 	// Load entry module and return exports
112
+/******/ 	return __webpack_require__(__webpack_require__.s = 1);
113
+/******/ })
114
+/************************************************************************/
115
+/******/ ([
116
+/* 0 */,
117
+/* 1 */
118
+/***/ (function(module, exports, __webpack_require__) {
119
+
120
+"use strict";
121
+
122
+var app = getApp();
123
+
124
+Component({
125
+  options: {
126
+    multipleSlots: true,
127
+    addGlobalClass: true
128
+  },
129
+  properties: {
130
+    backImage: {
131
+      type: String,
132
+      value: '/static/icon/icon_back.svg'
133
+    },
134
+    homeImage: {
135
+      type: String,
136
+      value: '/static/icon/icon_home.png'
137
+    },
138
+    extClass: {
139
+      type: String,
140
+      value: ''
141
+    },
142
+    title: {
143
+      type: String,
144
+      value: ''
145
+    },
146
+    background: {
147
+      type: String,
148
+      value: '#ffffff'
149
+    },
150
+    color: {
151
+      type: String,
152
+      value: '#000000'
153
+    },
154
+    dbclickBackTop:{
155
+      type:Boolean,
156
+      value:true
157
+    },
158
+    border: {
159
+      type: Boolean,
160
+      value: false
161
+    },
162
+    loading: {
163
+      type: Boolean,
164
+      value: false
165
+    },
166
+    show: {
167
+      type: Boolean,
168
+      value: true,
169
+      observer: '_showChange'
170
+    },  
171
+    left: {
172
+      type: Boolean,
173
+      value: false
174
+    },
175
+    center: {
176
+      type: Boolean,
177
+      value: false
178
+    },    
179
+    
180
+  },
181
+  data: {
182
+    displayStyle: '',
183
+    showBack:false
184
+  },
185
+  attached: function attached() {
186
+    var _this = this;        
187
+    //动态计算导航栏尺寸
188
+    var isSupport = !!wx.getMenuButtonBoundingClientRect;
189
+    var rect = wx.getMenuButtonBoundingClientRect ? wx.getMenuButtonBoundingClientRect() : null;
190
+    wx.getSystemInfo({
191
+        success: function success(res) {
192
+          var ios = !!(res.system.toLowerCase().search('ios') + 1);
193
+          var statusBarHeight=res.statusBarHeight;
194
+          var topBarHeight=ios ? (44 + statusBarHeight) : (48 + statusBarHeight);
195
+
196
+          _this.setData({
197
+              ios: ios,
198
+              topBarHeight:topBarHeight,
199
+              statusBarHeight:statusBarHeight,
200
+              innerWidth: isSupport ? 'width:' + rect.left + 'px' : '',
201
+              innerPaddingRight: isSupport ? 'padding-right:' + (res.windowWidth - rect.left) + 'px' : '',
202
+              leftWidth: isSupport ? 'width:' + (res.windowWidth - rect.left) + 'px' : ''
203
+          }); 
204
+
205
+          _this.triggerEvent('getBarInfo', {topBarHeight,statusBarHeight});               
206
+        }
207
+    });
208
+
209
+    //back箭头处理的显示
210
+    var pages=getCurrentPages()      
211
+    if(pages.length>1){
212
+      this.setData({showBack:true})
213
+    }
214
+  },
215
+  methods: {
216
+    _showChange: function _showChange(show) {           
217
+      var displayStyle = 'opacity: ' + (show ? '1' : '0') + ';-webkit-transition:opacity 0.5s;transition:opacity 0.5s;';           
218
+      this.setData({
219
+          displayStyle: displayStyle
220
+      });
221
+    },
222
+    //点击back事件处理
223
+    goBack: function () {
224
+      wx.navigateBack();
225
+      this.triggerEvent('back');
226
+    },
227
+    //返回首页
228
+    goHome:function(){
229
+      wx.reLaunch({
230
+        url: '/pages/index/index'
231
+      })
232
+    },
233
+    //双击返回顶部
234
+    doubleClick(e) {
235
+      if (!this.data.dbclickBackTop){return}
236
+      if (this.timeStamp && (e.timeStamp - this.timeStamp < 300)) {
237
+        this.timeStamp = 0
238
+        wx.pageScrollTo({
239
+          scrollTop: 0,
240
+          duration: 300
241
+        })
242
+      } else {
243
+        this.timeStamp = e.timeStamp
244
+      }
245
+    }
246
+  }
247
+});
248
+
249
+/***/ })
250
+/******/ ]);

+ 4 - 0
components/navigation-bar/navigation-bar.json

@@ -0,0 +1,4 @@
1
+{
2
+  "component": true,
3
+  "usingComponents": {}
4
+}

+ 30 - 0
components/navigation-bar/navigation-bar.wxml

@@ -0,0 +1,30 @@
1
+<view class="weui-navigation-bar {{extClass}}" bindtouchstart="doubleClick">
2
+  <view class="weui-navigation-bar__placeholder {{ios ? 'ios' : 'android'}}" style="padding-top: {{statusBarHeight}}px;visibility: hidden;"></view>
3
+  <view class="weui-navigation-bar__inner {{ios ? 'ios' : 'android'}} {{border?'navigation-bar-border':''}}" style="padding-top: {{statusBarHeight}}px; color: {{color}};background:{{background}};{{displayStyle}};{{innerPaddingRight}};{{innerWidth}};">
4
+
5
+    <view class='weui-navigation-bar__left' style="{{leftWidth}}">
6
+      <block wx:if="{{left}}">
7
+        <slot name="left"></slot>
8
+      </block>
9
+      <block wx:else>
10
+        <view class="btn-back nice-focus" bindtap="goBack" wx:if="{{showBack}}">
11
+          <image src="{{backImage}}"></image>
12
+        </view>      
13
+        <view class="btn-home nice-focus" bindtap="goHome">
14
+          <image src="{{homeImage}}"></image>
15
+        </view>
16
+      </block>     
17
+    </view>
18
+
19
+    <view class='weui-navigation-bar__center'>
20
+      <view wx:if="{{loading}}" class="weui-navigation-bar__loading"></view>
21
+
22
+      <block wx:if="{{center}}">
23
+        <slot name="center"></slot>        
24
+      </block>
25
+      <block wx:else>
26
+        <text>{{title}}</text>
27
+      </block>
28
+    </view>   
29
+  </view>
30
+</view>

File diff suppressed because it is too large
+ 60 - 0
components/navigation-bar/navigation-bar.wxss


marketing/images/promotion_leaflet_a01.png → pages/images/promotion_leaflet_a01.png


marketing/images/universalpic_add_gray_114x114.png → pages/images/universalpic_add_gray_114x114.png


BIN
pages/images/universalpic_broadcast_default_gray_34x25.png


BIN
pages/images/universalpic_broadcast_enable_tc01_34x25.png


BIN
pages/images/universalpic_broadcast_enable_tc02_34x25.png


BIN
pages/images/universalpic_broadcast_enable_tc03_34x25.png


BIN
pages/images/universalpic_broadcast_enable_tc04_34x25.png


marketing/images/universalpic_face_default_gray_114x114.png → pages/images/universalpic_face_default_gray_114x114.png


BIN
pages/images/universalpic_sendtoback_gray_30x26.png


+ 13 - 13
pages/index/index.js

@@ -5,7 +5,7 @@ const app = getApp();
5 5
 const arrSentence = [
6 6
   "荀子曰:\n君子博学而日参省乎己,\n则知明而行无过矣",
7 7
   "为什么订正过的题目还会错?\n天天秒过,反复巩固,不再出错",
8
-  "子曰:\n学而时习之,不亦乎。",
8
+  "子曰:\n学而时习之,不亦乎。",
9 9
   "秒过之前,错字连篇\n秒过之后,错字罕见",
10 10
   "子曰:\n学而不思则罔\n思而不学则殆",
11 11
   "记忆是思考的残留物\n唯有不断思考才能记住",
@@ -21,6 +21,7 @@ const arrSentence = [
21 21
 ];
22 22
 
23 23
 var timeout1 = 0;
24
+var timeoutRedirect=0;
24 25
 
25 26
 Page({
26 27
   data: {},
@@ -89,7 +90,7 @@ Page({
89 90
       else if (options.type == "marketing") {
90 91
         this.setData({
91 92
           gotoType: "other",
92
-          gotoUrl: '../../marketing/main/index',
93
+          gotoUrl: '../marketing/index',
93 94
         });
94 95
       }
95 96
       else if (options.type == "homework") {
@@ -251,9 +252,7 @@ Page({
251 252
           wx.removeStorageSync("UserName");
252 253
 
253 254
           //测试
254
-          //var url = '../../package4/main/giftcard?GiftID=89542&UserID=1';
255 255
           //var url = '../other/homework';
256
-          // var url = '../../marketing/main/index';
257 256
           // wx.redirectTo({
258 257
           //   url: url,
259 258
           // });
@@ -279,7 +278,7 @@ Page({
279 278
             }
280 279
             else{
281 280
               var url = '../main/default';
282
-              setTimeout(function () {
281
+              timeoutRedirect=setTimeout(function () {
283 282
                 console.log("Time5:" + new Date().getTime());
284 283
                 clearTimeout(timeout1);
285 284
 
@@ -292,6 +291,7 @@ Page({
292 291
 
293 292
           }
294 293
           that.getBaiduToken();
294
+          
295 295
         }
296 296
       });
297 297
 
@@ -323,17 +323,17 @@ Page({
323 323
     });
324 324
 
325 325
     updateManager.onUpdateReady(function () {
326
+      clearTimeout(timeoutRedirect);
326 327
       wx.showModal({
327 328
         title: '更新提示',
328
-        content: '新版本已经准备好,是否重启应用?',
329
+        content: '新版本已经准备好,重启应用',
330
+        showCancel:false,
329 331
         success: function (res) {
330
-          if (res.confirm) {
331
-            wx.removeStorageSync("UserID");
332
-            wx.removeStorageSync("UserName");
333
-            wx.removeStorageSync("SearchWord3");
334
-            // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
335
-            updateManager.applyUpdate();
336
-          }
332
+          wx.removeStorageSync("UserID");
333
+          wx.removeStorageSync("UserName");
334
+          wx.removeStorageSync("SearchWord3");
335
+          // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
336
+          updateManager.applyUpdate();
337 337
         }
338 338
       });
339 339
 

+ 140 - 111
pages/main/add.js

@@ -3,21 +3,21 @@ import main from '../../utils/main';
3 3
 
4 4
 const app = getApp();
5 5
 const PracticeTimeArr = [{
6
-    Name: "还原",
7
-    CSS: "numberContainerFooter1121Select"
8
-  },
9
-  {
10
-    Name: "今天必练",
11
-  },
12
-  {
13
-    Name: "推迟一周",
14
-  },
15
-  {
16
-    Name: "推迟一个月",
17
-  },
18
-  {
19
-    Name: "推迟三个月",
20
-  }
6
+  Name: "还原",
7
+  CSS: "numberContainerFooter1121Select"
8
+},
9
+{
10
+  Name: "今天必练",
11
+},
12
+{
13
+  Name: "推迟一周",
14
+},
15
+{
16
+  Name: "推迟一个月",
17
+},
18
+{
19
+  Name: "推迟三个月",
20
+}
21 21
 ];
22 22
 var arrTag = [];
23 23
 
@@ -34,7 +34,7 @@ var recorderManager;
34 34
 var tempRecorderFile = "";
35 35
 var innerAudioContext;
36 36
 var isViolate = false; //是否是违禁词
37
-var isFirstAdd=true;//是第一个填加
37
+var isFirstAdd = true;//是第一个填加
38 38
 
39 39
 Page({
40 40
   data: {
@@ -48,7 +48,7 @@ Page({
48 48
     PracticeTimeArr: PracticeTimeArr,
49 49
     IsIPhoneX: app.globalData.IsIPhoneX,
50 50
   },
51
-  onReady: function() {
51
+  onReady: function () {
52 52
     recorderManager = wx.getRecorderManager();
53 53
     recorderManager.onStart(() => {
54 54
       console.log('recorder start')
@@ -66,7 +66,7 @@ Page({
66 66
       // }
67 67
     });
68 68
   },
69
-  onLoad: function(options) {
69
+  onLoad: function (options) {
70 70
     var that = this;
71 71
 
72 72
     var fieldNumber = 0;
@@ -97,7 +97,7 @@ Page({
97 97
     isViolate = false;
98 98
     isFirstAdd = true;
99 99
   },
100
-  onShow: function() {
100
+  onShow: function () {
101 101
     var that = this;
102 102
     if (that.data.UpdateType == "add") {
103 103
       that.initAddCard();
@@ -144,9 +144,9 @@ Page({
144 144
       }
145 145
     }
146 146
 
147
-    common.getStorageValue(that, "SymbolMain", app.globalData.SymbolMain, function() {});
147
+    common.getStorageValue(that, "SymbolMain", app.globalData.SymbolMain, function () { });
148 148
   },
149
-  onHide: function() {
149
+  onHide: function () {
150 150
     //用于恢复未保存的新题卡
151 151
     //console.log("onHide");
152 152
     var that = this;
@@ -154,8 +154,8 @@ Page({
154 154
       that.updateField();
155 155
     }
156 156
     if (!(that.data && that.data.Field && that.data.Field[1].length == 0 &&
157
-        that.data.Field[2].length == 0 &&
158
-        that.data.Field[3].length == 0)) {
157
+      that.data.Field[2].length == 0 &&
158
+      that.data.Field[3].length == 0)) {
159 159
       if (!isViolate && (that.data.UpdateType == "add" || that.data.UpdateType == "add2")) {
160 160
         var card = {};
161 161
         card.MiaoguoCardID = that.data.MiaoguoCardID;
@@ -178,7 +178,7 @@ Page({
178 178
     }
179 179
 
180 180
   },
181
-  onUnload: function() {
181
+  onUnload: function () {
182 182
     this.onHide();
183 183
 
184 184
     var card = wx.getStorageSync("TempCardInfo");
@@ -201,14 +201,14 @@ Page({
201 201
       this.closeRecorder();
202 202
 
203 203
   },
204
-  onClose: function() {
204
+  onClose: function () {
205 205
     wx.navigateBack({
206 206
       delta: 1,
207 207
     });
208 208
 
209 209
     clearInterval(intervalRecorder);
210 210
   },
211
-  gotoAddItem: function(e) {
211
+  gotoAddItem: function (e) {
212 212
     var that = this;
213 213
     var fieldid = e.currentTarget.dataset.fieldid;
214 214
     var content;
@@ -230,13 +230,13 @@ Page({
230 230
       title: '编辑 段落' + fieldid,
231 231
     });
232 232
   },
233
-  onSearch: function(e) {
233
+  onSearch: function (e) {
234 234
     app.globalData.TempFieldNumber = 0;
235 235
     wx.navigateTo({
236 236
       url: './searchWeb',
237 237
     })
238 238
   },
239
-  onPreview: function(e) {
239
+  onPreview: function (e) {
240 240
     var that = this;
241 241
     if (that.data.Field[1] == "") {
242 242
       wx.showToast({
@@ -249,7 +249,7 @@ Page({
249 249
       });
250 250
     }
251 251
   },
252
-  saveCard: function() {
252
+  saveCard: function () {
253 253
     var that = this;
254 254
     if (that.data.Field[1] == "") {
255 255
       wx.showToast({
@@ -259,12 +259,12 @@ Page({
259 259
     } else {
260 260
       if (isSave) {
261 261
         isSave = false;
262
-        setTimeout(function() {
262
+        setTimeout(function () {
263 263
           isSave = true;
264 264
         }, 5000);
265 265
 
266 266
         if (that.checkImageCount(that.data.Field)) {
267
-          that.uploadImageAll(that.data.Field, function(success, field) {
267
+          that.uploadImageAll(that.data.Field, function (success, field) {
268 268
             if (success) {
269 269
               that.data.Field = field;
270 270
               var userid = app.globalData.userInfo.UserID;
@@ -293,11 +293,11 @@ Page({
293 293
                 title: '保存数据请稍候',
294 294
                 mask: true,
295 295
               });
296
-              timeoutUploadImage = setTimeout(function() {
296
+              timeoutUploadImage = setTimeout(function () {
297 297
                 wx.hideLoading();
298 298
               }, 15000);
299 299
 
300
-              main.postData('AddMiaoguoCard?Type=' + that.data.UpdateType + '&UserID=' + userid, param1, function(data) {
300
+              main.postData('AddMiaoguoCard?Type=' + that.data.UpdateType + '&UserID=' + userid, param1, function (data) {
301 301
                 wx.removeStorageSync("TempCardNoSaved");
302 302
 
303 303
                 if (that.data.UpdateType == "edit" || that.data.UpdateType == "edit2" || that.data.UpdateType == "edit3") {
@@ -334,7 +334,7 @@ Page({
334 334
       }
335 335
     }
336 336
   },
337
-  formatField: function(field) {
337
+  formatField: function (field) {
338 338
     var result = {};
339 339
 
340 340
     for (var i = 1; i <= 3; i++) {
@@ -378,7 +378,7 @@ Page({
378 378
     }
379 379
     return result;
380 380
   },
381
-  checkImageCount: function(arr) {
381
+  checkImageCount: function (arr) {
382 382
     var count = 0;
383 383
     for (var i = 0; i < arr.length; i++) {
384 384
       for (var j = 0; j < arr[i].length; j++) {
@@ -396,7 +396,7 @@ Page({
396 396
     } else
397 397
       return true;
398 398
   },
399
-  uploadImageAll: function(arr, callback) {
399
+  uploadImageAll: function (arr, callback) {
400 400
     var that = this;
401 401
     var b = false;
402 402
     var arrSource = [],
@@ -415,7 +415,7 @@ Page({
415 415
             arrResult.push(result);
416 416
           } else {
417 417
             var source = arr[i][j].Content;
418
-            that.uploadFileToServer(source, function(data) {
418
+            that.uploadFileToServer(source, function (data) {
419 419
               if (data) {
420 420
                 data = JSON.parse(data);
421 421
                 var result = data.result;
@@ -434,12 +434,12 @@ Page({
434 434
         title: '上传图片请稍候',
435 435
         mask: true,
436 436
       });
437
-      timeoutUploadImage = setTimeout(function() {
437
+      timeoutUploadImage = setTimeout(function () {
438 438
         wx.hideLoading();
439 439
       }, 30000);
440 440
     }
441 441
 
442
-    interval = setInterval(function() {
442
+    interval = setInterval(function () {
443 443
       //console.log(arrResult.length);
444 444
       if (arrResult.length >= arrSource.length) {
445 445
         wx.hideLoading();
@@ -481,7 +481,7 @@ Page({
481 481
       }
482 482
     }, 500);
483 483
   },
484
-  uploadFileToServer: function(file, callback) {
484
+  uploadFileToServer: function (file, callback) {
485 485
     var url = common.Encrypt("MiaoguoUploadFile2");
486 486
     wx.uploadFile({
487 487
       url: app.globalData.serverUrl + url,
@@ -490,7 +490,7 @@ Page({
490 490
       success(res) {
491 491
         callback(res.data);
492 492
       },
493
-      fail: function(err) {
493
+      fail: function (err) {
494 494
         wx.hideLoading();
495 495
         wx.showModal({
496 496
           title: '上传文件失败',
@@ -500,7 +500,7 @@ Page({
500 500
       }
501 501
     });
502 502
   },
503
-  saveLocalCardList: function(param1) {
503
+  saveLocalCardList: function (param1) {
504 504
     var that = this;
505 505
     var list = app.globalData.CardList;
506 506
     for (var i = 0; i < list.length; i++) {
@@ -517,14 +517,14 @@ Page({
517 517
         if (param1.IsTodayStudy == 1) {
518 518
           list[i].LimitTime = common.formatTime(new Date());
519 519
 
520
-          main.getTaskTodayList(function() {});
520
+          main.getTaskTodayList(function () { });
521 521
         }
522 522
         app.globalData.CardList = list;
523 523
         break;
524 524
       }
525 525
     }
526 526
   },
527
-  initAddCard: function() {
527
+  initAddCard: function () {
528 528
     var card = {};
529 529
     card.MiaoguoCardID = 0;
530 530
     card.Content = [];
@@ -547,7 +547,7 @@ Page({
547 547
       UpdateType: "add2",
548 548
     });
549 549
   },
550
-  onBindError: function(e) {
550
+  onBindError: function (e) {
551 551
     for (var i = 1; i < this.data.Field.length; i++) {
552 552
       for (var j = 0; j < this.data.Field[i].length; j++) {
553 553
         if (this.data.Field[i][j].Type == "image") {
@@ -559,7 +559,7 @@ Page({
559 559
       Field: this.data.Field,
560 560
     });
561 561
   },
562
-  deleteItem: function(e) {
562
+  deleteItem: function (e) {
563 563
     var that = this;
564 564
     var index = e.currentTarget.dataset.id;
565 565
 
@@ -586,7 +586,7 @@ Page({
586 586
     });
587 587
 
588 588
   },
589
-  onGotoList: function() {
589
+  onGotoList: function () {
590 590
     var that = this;
591 591
     if (isFirstAdd == true || !that.data.Field) {
592 592
       wx.showModal({
@@ -604,10 +604,13 @@ Page({
604 604
         success(res) {
605 605
           if (res.confirm) {
606 606
             goto();
607
+            setTimeout(function () {
608
+              wx.removeStorageSync("TempCardNoSaved");
609
+            }, 1000);
607 610
           }
608 611
         }
609 612
       });
610
-    } 
613
+    }
611 614
     else {
612 615
       goto();
613 616
     }
@@ -616,11 +619,11 @@ Page({
616 619
       wx.showLoading({
617 620
         title: '请稍候',
618 621
       });
619
-      setTimeout(function() {
622
+      setTimeout(function () {
620 623
         wx.hideLoading();
621 624
       }, 5000);
622 625
       var url = 'GetMiaoguoCardList?UserID=' + app.globalData.userInfo.UserID;
623
-      main.getData(url, function(data) {
626
+      main.getData(url, function (data) {
624 627
         wx.hideLoading();
625 628
         if (data) {
626 629
           app.globalData.CardList = data.List;
@@ -634,7 +637,7 @@ Page({
634 637
       });
635 638
     }
636 639
   },
637
-  getLimitTimeStr: function() {
640
+  getLimitTimeStr: function () {
638 641
     var that = this;
639 642
     if (!that.data.LimitTime)
640 643
       that.data.LimitTime = common.formatTime(new Date());
@@ -659,7 +662,7 @@ Page({
659 662
   //段落编辑**************************
660 663
 
661 664
   //字段输入
662
-  bindinputField: function(e) {
665
+  bindinputField: function (e) {
663 666
     //console.log("bindinputField:" + e.detail.value + " isEdit:" + isEdit);
664 667
 
665 668
     var that = this;
@@ -673,7 +676,7 @@ Page({
673 676
 
674 677
   },
675 678
   //加符号
676
-  addSymbol: function(e) {
679
+  addSymbol: function (e) {
677 680
     //console.log("addSymbol");
678 681
     isEdit = true;
679 682
     var that = this;
@@ -703,28 +706,28 @@ Page({
703 706
       this.setData({
704 707
         HighlighterSign: "[光]",
705 708
       });
706
-    } 
709
+    }
707 710
 
708
-    if (btnName=="( )")
709
-      btnName ="(     )";
711
+    if (btnName == "( )")
712
+      btnName = "(     )";
710 713
     else if (btnName == "_")
711 714
       btnName = "_____";
712 715
     //console.log("addSymbol_btnName:" + btnName);
713 716
 
714 717
     if (!this.data.Focus) {
715
-      var obj = { detail: {cursor:tempCursor}};
718
+      var obj = { detail: { cursor: tempCursor } };
716 719
       this.onBindblur(obj);
717 720
     }
718 721
     //console.log("addSymbol:" + this.data.FieldContent);
719 722
 
720
-    setTimeout(function() {
723
+    setTimeout(function () {
721 724
       that.setData({
722 725
         Focus: true,
723 726
       });
724 727
     }, 300);
725 728
   },
726 729
   //焦点聚焦
727
-  onBindFocus: function() {
730
+  onBindFocus: function () {
728 731
     //console.log("onBindFocus");
729 732
     btnName = "";
730 733
     this.setData({
@@ -732,11 +735,11 @@ Page({
732 735
     });
733 736
   },
734 737
   //失焦
735
-  onBindblur: function(e) {
738
+  onBindblur: function (e) {
736 739
     var that = this;
737 740
     //console.log("onBindblur:" + isEdit + " Filed:" + this.data.FieldContent);
738 741
     if (app.globalData.IsAndroid && !isEdit) {
739
-      setTimeout(function() {
742
+      setTimeout(function () {
740 743
         isEdit = true;
741 744
         //console.log("onBindblur2:" + isEdit);
742 745
       }, 500);
@@ -744,7 +747,7 @@ Page({
744 747
     }
745 748
     isEdit = false;
746 749
     if (app.globalData.IsAndroid && !isEdit) {
747
-      setTimeout(function() {
750
+      setTimeout(function () {
748 751
         isEdit = true;
749 752
         //console.log("onBindblur2:" + isEdit);
750 753
       }, 500);
@@ -753,7 +756,7 @@ Page({
753 756
 
754 757
     this.updateField();
755 758
     tempCursor = e.detail.cursor;
756
-    
759
+
757 760
     //console.log("tempCursor:" + tempCursor);
758 761
     if (tempCursor == undefined)
759 762
       tempCursor = this.data["FieldContent"].length;
@@ -767,7 +770,7 @@ Page({
767 770
     //console.log("btnName:" + btnName);
768 771
     //console.log("str2:" + str2);
769 772
     var cur = 0;
770
-    if (btnName){
773
+    if (btnName) {
771 774
       cur = 1;
772 775
       if (btnName == "[读]" || btnName == "[线]" || btnName == "[光]") {
773 776
         cur = 3;
@@ -779,7 +782,7 @@ Page({
779 782
         cur = 5;
780 783
       }
781 784
     }
782
-    
785
+
783 786
     this.data.FieldContent = str1 + btnName + str2;
784 787
     this.setData({
785 788
       FieldContent: this.data.FieldContent,
@@ -790,23 +793,23 @@ Page({
790 793
     btnName = "";
791 794
 
792 795
   },
793
-  bindscrollHandler: function() {
796
+  bindscrollHandler: function () {
794 797
     //console.log("bindscrollHandler");
795 798
     btnName = "";
796 799
   },
797
-  onSearchField: function(e) {
800
+  onSearchField: function (e) {
798 801
     app.globalData.TempFieldNumber = this.data.FieldNumber;
799 802
     wx.navigateTo({
800 803
       url: './searchWeb',
801 804
     });
802 805
     this.updateField();
803 806
 
804
-    setTimeout(function() {
807
+    setTimeout(function () {
805 808
       isEdit = true;
806 809
       //console.log("onSearchEnd");
807 810
     }, 1000);
808 811
   },
809
-  clear: function() {
812
+  clear: function () {
810 813
     var that = this;
811 814
     //console.log("clear");
812 815
     this.setData({
@@ -819,7 +822,7 @@ Page({
819 822
     this.updateField();
820 823
 
821 824
   },
822
-  closeAddItem: function(e) {
825
+  closeAddItem: function (e) {
823 826
     var that = this;
824 827
     var isSave = e.currentTarget.dataset.idsave;
825 828
     if (isSave == "true") {
@@ -827,22 +830,22 @@ Page({
827 830
       if (that.data.FieldContent) {
828 831
         var content = that.data.FieldContent;
829 832
 
830
-        main.postData("MsgSecCheck2", 
831
-          { Content: content,},
832
-          function(data) {
833
-          if (data && data.errcode == 0) {
834
-            next(that);
835
-          } else {
836
-            if (data.errmsg) {
837
-              wx.showToast({
838
-                title: data.errmsg,
839
-                duration: 2000,
840
-                image: "../images/universalpic_wrong_white_120x120.png",
841
-              });
842
-              isViolate = true;
833
+        main.postData("MsgSecCheck2",
834
+          { Content: content, },
835
+          function (data) {
836
+            if (data && data.errcode == 0) {
837
+              next(that);
838
+            } else {
839
+              if (data.errmsg) {
840
+                wx.showToast({
841
+                  title: data.errmsg,
842
+                  duration: 2000,
843
+                  image: "../images/universalpic_wrong_white_120x120.png",
844
+                });
845
+                isViolate = true;
846
+              }
843 847
             }
844
-          }
845
-        });
848
+          });
846 849
       } else {
847 850
         next(that);
848 851
       }
@@ -873,7 +876,7 @@ Page({
873 876
     }
874 877
   },
875 878
 
876
-  updateField: function() {
879
+  updateField: function () {
877 880
     var str = this.data.FieldContent;
878 881
     var list = app.globalData.CardList;
879 882
     var card = {};
@@ -892,7 +895,7 @@ Page({
892 895
     });
893 896
   },
894 897
   //选择图片上传
895
-  uploadImageField: function() {
898
+  uploadImageField: function () {
896 899
     //console.log("uploadImageStart");
897 900
     var that = this;
898 901
 
@@ -913,7 +916,7 @@ Page({
913 916
                   title: '请秒候',
914 917
                   mask: true,
915 918
                 });
916
-                setTimeout(function() {
919
+                setTimeout(function () {
917 920
                   wx.hideLoading();
918 921
                   selectImage(that);
919 922
                 }, 2000);
@@ -987,7 +990,7 @@ Page({
987 990
                   cancelText: "不再提示",
988 991
                   confirmColor: "#0071EF",
989 992
                   success(res) {
990
-                    if (res.confirm) {} else {
993
+                    if (res.confirm) { } else {
991 994
                       wx.setStorageSync("NoRemindImage", true);
992 995
                     }
993 996
                   },
@@ -997,13 +1000,13 @@ Page({
997 1000
             }
998 1001
           });
999 1002
         },
1000
-        fail: function() {
1003
+        fail: function () {
1001 1004
 
1002 1005
         }
1003 1006
       });
1004 1007
     }
1005 1008
   },
1006
-  onPracticeTime: function(e) {
1009
+  onPracticeTime: function (e) {
1007 1010
     var that = this;
1008 1011
     var value = e.currentTarget.dataset.value;
1009 1012
 
@@ -1022,8 +1025,8 @@ Page({
1022 1025
     if (value != "还原")
1023 1026
       PracticeTimeStr2 = common.formatDateCHS(common.formatTime(that.getLimitTimeStr(value)));
1024 1027
     else
1025
-    if (that.data.UpdateType === "add" || that.data.UpdateType === "add2")
1026
-      PracticeTimeStr2 = "智能安排";
1028
+      if (that.data.UpdateType === "add" || that.data.UpdateType === "add2")
1029
+        PracticeTimeStr2 = "智能安排";
1027 1030
 
1028 1031
     that.setData({
1029 1032
       PracticeTimeStr2: PracticeTimeStr2,
@@ -1031,19 +1034,19 @@ Page({
1031 1034
 
1032 1035
 
1033 1036
   },
1034
-  showPracticeTime: function() {
1037
+  showPracticeTime: function () {
1035 1038
     this.setData({
1036 1039
       IsPracticeTime: true,
1037 1040
     });
1038 1041
   },
1039
-  closePracticeTime: function() {
1042
+  closePracticeTime: function () {
1040 1043
     this.setData({
1041 1044
       IsPracticeTime: false,
1042 1045
     });
1043 1046
   },
1044 1047
 
1045 1048
   //录音授权
1046
-  recorderAccredit: function() {
1049
+  recorderAccredit: function () {
1047 1050
     var that = this;
1048 1051
     if (app.globalData.IsRecorderAccredit == 1)
1049 1052
       that.showRecorder();
@@ -1066,7 +1069,7 @@ Page({
1066 1069
       });
1067 1070
     }
1068 1071
   },
1069
-  showRecorder: function() {
1072
+  showRecorder: function () {
1070 1073
     var that = this;
1071 1074
     if (that.checkRecorderCount()) {
1072 1075
       that.recorderInit();
@@ -1104,7 +1107,7 @@ Page({
1104 1107
       });
1105 1108
     }
1106 1109
   },
1107
-  closeRecorder: function() {
1110
+  closeRecorder: function () {
1108 1111
     var that = this;
1109 1112
     this.recorderInit();
1110 1113
 
@@ -1139,7 +1142,7 @@ Page({
1139 1142
     }
1140 1143
   },
1141 1144
   //录音初始化
1142
-  recorderInit: function() {
1145
+  recorderInit: function () {
1143 1146
     if (innerAudioContext)
1144 1147
       innerAudioContext.stop();
1145 1148
     if (recorderManager)
@@ -1147,7 +1150,7 @@ Page({
1147 1150
 
1148 1151
     clearInterval(intervalRecorder);
1149 1152
   },
1150
-  checkRecorderCount: function(arr) {
1153
+  checkRecorderCount: function (arr) {
1151 1154
     var that = this;
1152 1155
     var count = 0;
1153 1156
     if (that.data.FieldContent.indexOf("[音 url=") >= 0 ||
@@ -1162,7 +1165,7 @@ Page({
1162 1165
     } else
1163 1166
       return true;
1164 1167
   },
1165
-  btnRecorderStart: function() {
1168
+  btnRecorderStart: function () {
1166 1169
     var that = this;
1167 1170
     if (app.globalData.IsRecorderAccredit == 1) {
1168 1171
       that.setData({
@@ -1173,7 +1176,7 @@ Page({
1173 1176
       recorderManager.start();
1174 1177
     }
1175 1178
   },
1176
-  btnRecorderEnd: function() {
1179
+  btnRecorderEnd: function () {
1177 1180
     var that = this;
1178 1181
     if (app.globalData.IsRecorderAccredit == 1) {
1179 1182
       if (that.data.RecorderTime == "00:00") {
@@ -1194,11 +1197,11 @@ Page({
1194 1197
       that.recorderAccredit();
1195 1198
     }
1196 1199
   },
1197
-  showRecorderTime: function() {
1200
+  showRecorderTime: function () {
1198 1201
     var that = this;
1199 1202
     var second = 0;
1200 1203
     clearInterval(intervalRecorder);
1201
-    intervalRecorder = setInterval(function() {
1204
+    intervalRecorder = setInterval(function () {
1202 1205
       second++;
1203 1206
       var secondStr = second.toString();
1204 1207
       if (second < 10)
@@ -1224,7 +1227,7 @@ Page({
1224 1227
 
1225 1228
     }, 1000);
1226 1229
   },
1227
-  btnRecorderPlay: function() {
1230
+  btnRecorderPlay: function () {
1228 1231
     var that = this;
1229 1232
     if (tempRecorderFile && this.data.RecorderPlayName == "播放") {
1230 1233
       innerAudioContext.src = tempRecorderFile;
@@ -1241,16 +1244,16 @@ Page({
1241 1244
       });
1242 1245
     }
1243 1246
   },
1244
-  btnRecorderSave: function() {
1247
+  btnRecorderSave: function () {
1245 1248
     var that = this;
1246 1249
     this.recorderInit();
1247 1250
     wx.showLoading({
1248 1251
       title: '上传中请稍候',
1249 1252
     });
1250
-    setTimeout(function() {
1253
+    setTimeout(function () {
1251 1254
       wx.hideLoading();
1252 1255
     }, 60000);
1253
-    that.uploadFileToServer(tempRecorderFile, function(data) {
1256
+    that.uploadFileToServer(tempRecorderFile, function (data) {
1254 1257
       if (data) {
1255 1258
         data = JSON.parse(data);
1256 1259
         //console.log(data);
@@ -1275,7 +1278,7 @@ Page({
1275 1278
             cancelText: "不再提示",
1276 1279
             confirmColor: "#0071EF",
1277 1280
             success(res) {
1278
-              if (res.confirm) {} else {
1281
+              if (res.confirm) { } else {
1279 1282
                 wx.setStorageSync("NoRemindRecorder", true);
1280 1283
               }
1281 1284
             },
@@ -1284,12 +1287,38 @@ Page({
1284 1287
       }
1285 1288
     });
1286 1289
   },
1287
-  gotoSymbol: function(e) {
1290
+  gotoSymbol: function (e) {
1288 1291
     wx.navigateTo({
1289 1292
       url: '../main/symbolsetting',
1290 1293
     });
1291 1294
   },
1292
-  onShareAppMessage: function() {
1295
+  gotoTest: function () {
1296
+    var that=this;
1297
+    if (that.data.Field[1].length > 0 || that.data.Field[2].length > 0 || that.data.Field[2].length > 0) {
1298
+      wx.showModal({
1299
+        title: '尚未保存',
1300
+        content: '即将打开“知识检验”功能,但当前题卡尚未保存,按继续将放弃保存。',
1301
+        confirmText: '继续',
1302
+        success(res) {
1303
+          if (res.confirm) {
1304
+            
1305
+            wx.redirectTo({
1306
+              url: '../test/index',
1307
+            });
1308
+            setTimeout(function(){
1309
+              wx.removeStorageSync("TempCardNoSaved");
1310
+            },1000);
1311
+          }
1312
+        }
1313
+      });
1314
+    }
1315
+    else {
1316
+      wx.redirectTo({
1317
+        url: '../test/index',
1318
+      });
1319
+    }
1320
+  },
1321
+  onShareAppMessage: function () {
1293 1322
     return {
1294 1323
       title: app.globalData.ShareTitle,
1295 1324
       path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,

+ 2 - 1
pages/main/add.wxml

@@ -3,7 +3,8 @@
3 3
     <view class="panelTopLeft FlexRow" catchtap="onSearch">
4 4
       <view class="add">+</view> 资料
5 5
     </view>
6
-    <view class='panelTopRight FlexRow'>
6
+    <view class='panelTopLeft FlexRow' catchtap="gotoTest" wx:if="{{UpdateType=='add' || UpdateType=='add2'}}">
7
+      <view class="add">+</view> 检验
7 8
     </view>
8 9
   </view>
9 10
   <view style='height:120rpx'></view>

+ 1 - 1
pages/main/default.js

@@ -175,7 +175,7 @@ Page({
175 175
       url: url,
176 176
     });
177 177
 
178
-    if (url =="../../marketing/main/index"){
178
+    if (url =="../marketing/index"){
179 179
       this.setData({
180 180
         IsShowMarketing: 2,
181 181
       });

+ 1 - 1
pages/main/default.wxml

@@ -16,7 +16,7 @@
16 16
   <view class='panelBottom FlexColumn'>
17 17
 
18 18
     <image class="study_index_banner_close" src='../images/study_index_banner_close.png' bindtap="closeMarketing" wx:if="{{IsShowMarketing===2}}"/>
19
-    <image class="study_index_banner" src='../images/study_index_banner.png' bindtap="goto" data-url="../../marketing/main/index" wx:if="{{IsShowMarketing===0 || IsShowMarketing===2}}" />
19
+    <image class="study_index_banner" src='../images/study_index_banner.png' bindtap="goto" data-url="../marketing/index" wx:if="{{IsShowMarketing===0 || IsShowMarketing===2}}" />
20 20
     
21 21
     <image class="study_index_footer" src='../images/study_index_footer.png' />
22 22
 

+ 255 - 220
pages/main/detail.js

@@ -3,45 +3,55 @@ import main from '../../utils/main';
3 3
 
4 4
 const app = getApp();
5 5
 
6
-const arrFontSize = [
7
-  { Name: "紧凑", Value: 36 },
8
-  { Name: "标准", Value: 48 },
9
-  { Name: "宽松", Value: 68 },
10
-  { Name: "超大", Value: 108 }
6
+const arrFontSize = [{
7
+  Name: "紧凑",
8
+  Value: 36
9
+},
10
+{
11
+  Name: "标准",
12
+  Value: 48
13
+},
14
+{
15
+  Name: "宽松",
16
+  Value: 68
17
+},
18
+{
19
+  Name: "超大",
20
+  Value: 108
21
+}
11 22
 ];
12 23
 
13
-const arrDelayedTime = [
14
-  {
15
-    DayNumber: 7,
16
-    Name: "推迟一周",
17
-  }, {
18
-    DayNumber: 30,
19
-    Name: "推迟一个月",
20
-  }, {
21
-    DayNumber: 90,
22
-    Name: "推迟三个月",
23
-  },
24
-]
24
+const arrDelayedTime = [{
25
+  DayNumber: 7,
26
+  Name: "推迟一周",
27
+}, {
28
+  DayNumber: 30,
29
+  Name: "推迟一个月",
30
+}, {
31
+  DayNumber: 90,
32
+  Name: "推迟三个月",
33
+},]
25 34
 
26 35
 var innerAudioContext1;
27 36
 
28 37
 var listTaskFinished = []; //完成的任务
29 38
 var timeStart; //计算时长
30
-var timeHistory=0;//已经过去的时间
39
+var timeHistory = 0; //已经过去的时间
31 40
 var TaskList = [];
32 41
 var arrImage = [],
33 42
   arrImage2 = [];
34 43
 var intervalSound = 0,
35 44
   intervalRefresh = 0;
36 45
 var isCollecting = false;
37
-var isExit=true;
46
+var isExit = true;
38 47
 
39 48
 var isPlaying = false;
40 49
 
41 50
 var timeoutPlayAudio;
42 51
 var tempPlayUrl = "";
43 52
 var tempPlayUrlLocal = "";
44
-var timeoutEveryCard=0;
53
+var timeoutEveryCard = 0;
54
+var timeoutHide = 0;
45 55
 
46 56
 Page({
47 57
   data: {
@@ -54,7 +64,9 @@ Page({
54 64
     FontSizeArray: arrFontSize,
55 65
     ArrDelayedTime: arrDelayedTime,
56 66
     TaskInfo: {},
57
-    Color: { ID: 1 },
67
+    Color: {
68
+      ID: 1
69
+    },
58 70
   },
59 71
   onReady: function () {
60 72
     var that = this;
@@ -64,7 +76,7 @@ Page({
64 76
     });
65 77
     innerAudioContext1.onError((res) => {
66 78
       console.log("innerAudioContext1.errMsg:" + res.errMsg);
67
-      console.log("innerAudioContext1.errCode:" +res.errCode);
79
+      console.log("innerAudioContext1.errCode:" + res.errCode);
68 80
       that.audioCtx.setSrc(tempPlayUrl);
69 81
       that.audioCtx.play();
70 82
     });
@@ -88,8 +100,8 @@ Page({
88 100
       Color: main.getDetailColor(app.globalData.ColorIndex),
89 101
     });
90 102
 
91
-    this.audioCtx = wx.createAudioContext('myAudio'); 
92
-    
103
+    this.audioCtx = wx.createAudioContext('myAudio');
104
+
93 105
 
94 106
     this.getList();
95 107
 
@@ -140,20 +152,28 @@ Page({
140 152
     that.setData({
141 153
       IsMore: false,
142 154
     });
155
+    clearTimeout(timeoutHide);
156
+    //console.log("显示");
143 157
   },
144 158
   onUnload: function () {
145 159
     clearInterval(intervalSound);
146 160
     clearTimeout(timeoutEveryCard);
161
+    clearTimeout(timeoutHide);
147 162
     listTaskFinished = [];
148 163
 
149 164
     isPlaying = false;
150
-    if (innerAudioContext1){
165
+    if (innerAudioContext1) {
151 166
       innerAudioContext1.stop();
152 167
     }
153 168
   },
154
-  onHide:function(e){
155
-    if (isExit)
156
-      this.onClose();
169
+  onHide: function (e) {
170
+    //console.log("隐藏");
171
+    var that = this;
172
+    if (isExit) {
173
+      timeoutHide = setTimeout(function () {
174
+        that.onClose();
175
+      }, 60000);
176
+    }
157 177
     isExit = true;
158 178
   },
159 179
   onPullDownRefresh: function () {
@@ -371,8 +391,7 @@ Page({
371 391
             return 1;
372 392
           else
373 393
             return 0;
374
-        }
375
-        else
394
+        } else
376 395
           return 0;
377 396
       }
378 397
     }
@@ -403,8 +422,8 @@ Page({
403 422
     if (listTaskFinished.length > 0) {
404 423
       var card = listTaskFinished.pop();
405 424
       wx.setStorageSync("ListTaskFinished", listTaskFinished);
406
-      
407
-      timeHistory=0;
425
+
426
+      timeHistory = 0;
408 427
       that.timeCompute();
409 428
 
410 429
       card.Card.Number0 = card.Number0Old;
@@ -454,202 +473,221 @@ Page({
454 473
   //进入下一张题卡
455 474
   gotoNext: function (e) {
456 475
     var that = this;
476
+    //btnnumber可以有 5:秒过 4正常 3困难 2挪到最后 1搁置 0不过 -1今天要练
457 477
     var btnnumber = e.currentTarget.dataset.btnnumber;
458
-    var time = e.currentTarget.dataset.time;
459
-
460
-    //处理当前卡片进入历史数组
461
-    var finishCard = {};
462
-    finishCard.Card = TaskList[0];
463
-
464
-    finishCard.NumberNew = this.data.NumberNew;
465
-    finishCard.NumberReview = this.data.NumberReview;
466
-    finishCard.NumberHistory = this.data.NumberHistory;
467
-
468
-    finishCard.Number0Old = TaskList[0].Number0;
469
-    finishCard.Number0StrOld = TaskList[0].Number0Str;
470
-    finishCard.Number1Old = TaskList[0].Number1;
471
-    finishCard.Number1StrOld = TaskList[0].Number1Str;
472
-    finishCard.Number2Old = TaskList[0].Number2;
473
-    finishCard.Number2StrOld = TaskList[0].Number2Str;
474
-    finishCard.Number3Old = TaskList[0].Number3;
475
-    finishCard.Number3StrOld = TaskList[0].Number3Str;
476
-
477
-    //若不是搁置
478
-    if (btnnumber != "1") {
479
-      //若是分钟,则进入复习列表
480
-      if (time.lastIndexOf("m") == time.length - 1) {
481
-        var minute = Number(time.substr(0, time.indexOf("m")));
482
-        TaskList[0].LimitTime = common.formatTime(common.addDate("n", minute, new Date()));
483
-        //若是新增,则10m 1d 4d
484
-        if (TaskList[0].IsNew) {
485
-          TaskList[0].Number0 = "10m";
486
-          TaskList[0].Number0Str = main.getMemoryLevel(app.globalData.MemoryLevel, 0, TaskList[0].Number0);
487
-
488
-          delete TaskList[0].Number1;
489
-          delete TaskList[0].Number1Str;
490
-
491
-          TaskList[0].Number2 = "1d";
492
-          TaskList[0].Number2Str = main.getMemoryLevel(app.globalData.MemoryLevel, 2, TaskList[0].Number2);
493
-
494
-          // TaskList[0].Number3 = "4d";
495
-          // TaskList[0].Number3Str = main.getMemoryLevel(app.globalData.MemoryLevel, 3, TaskList[0].Number3);
496
-          
497
-          delete TaskList[0].Number3;
498
-          delete TaskList[0].Number3Str;
499
-
500
-          TaskList[0].FirstTime = null;
501
-          TaskList[0].LastTime = null;
502
-        }
503
-        //若是历史的,则10m 1d
504
-        else if (TaskList[0].IsHistory) {
505
-          TaskList[0].Number0 = "10m";
506
-          TaskList[0].Number0Str = main.getMemoryLevel(app.globalData.MemoryLevel, 0, TaskList[0].Number0);
478
+    //若是“挪到最后”
479
+    if (btnnumber == 2) {
480
+      var card = TaskList.splice(0, 1);
481
+      card[0].IsFinally=true;
482
+      TaskList.push(card[0]);
483
+      that.setData({
484
+        IsShowAnswer: [0, 0],
485
+        TaskInfo: TaskList[0],
486
+        CanUndo: 1,
487
+        Recommend: 0,
488
+        IsMore: false,
489
+      });
490
+    }
491
+    else{
492
+      var time = e.currentTarget.dataset.time;
493
+      //处理当前卡片进入历史数组
494
+      var finishCard = {};
495
+      finishCard.Card = TaskList[0];
496
+
497
+      finishCard.NumberNew = this.data.NumberNew;
498
+      finishCard.NumberReview = this.data.NumberReview;
499
+      finishCard.NumberHistory = this.data.NumberHistory;
500
+
501
+      finishCard.Number0Old = TaskList[0].Number0;
502
+      finishCard.Number0StrOld = TaskList[0].Number0Str;
503
+      finishCard.Number1Old = TaskList[0].Number1;
504
+      finishCard.Number1StrOld = TaskList[0].Number1Str;
505
+      finishCard.Number2Old = TaskList[0].Number2;
506
+      finishCard.Number2StrOld = TaskList[0].Number2Str;
507
+      finishCard.Number3Old = TaskList[0].Number3;
508
+      finishCard.Number3StrOld = TaskList[0].Number3Str;
509
+
510
+      //若不是搁置
511
+      //算出下一次的时间
512
+      if (btnnumber != "1") {
513
+
514
+        //若是分钟,则进入复习列表
515
+        if (time.lastIndexOf("m") == time.length - 1) {
516
+          var minute = Number(time.substr(0, time.indexOf("m")));
517
+          TaskList[0].LimitTime = common.formatTime(common.addDate("n", minute, new Date()));
518
+          //若是新增,则10m 1d 4d
519
+          if (TaskList[0].IsNew) {
520
+            TaskList[0].Number0 = "10m";
521
+            TaskList[0].Number0Str = main.getMemoryLevel(app.globalData.MemoryLevel, 0, TaskList[0].Number0);
522
+
523
+            delete TaskList[0].Number1;
524
+            delete TaskList[0].Number1Str;
525
+
526
+            TaskList[0].Number2 = "1d";
527
+            TaskList[0].Number2Str = main.getMemoryLevel(app.globalData.MemoryLevel, 2, TaskList[0].Number2);
528
+
529
+            delete TaskList[0].Number3;
530
+            delete TaskList[0].Number3Str;
531
+
532
+            TaskList[0].FirstTime = null;
533
+            TaskList[0].LastTime = null;
534
+          }
535
+          //若是历史的,则10m 1d
536
+          else if (TaskList[0].IsHistory) {
537
+            TaskList[0].Number0 = "10m";
538
+            TaskList[0].Number0Str = main.getMemoryLevel(app.globalData.MemoryLevel, 0, TaskList[0].Number0);
507 539
 
508
-          delete TaskList[0].Number1;
509
-          delete TaskList[0].Number1Str;
540
+            delete TaskList[0].Number1;
541
+            delete TaskList[0].Number1Str;
510 542
 
511
-          TaskList[0].Number2 = "1d";
512
-          TaskList[0].Number2Str = main.getMemoryLevel(app.globalData.MemoryLevel, 2, TaskList[0].Number2);
543
+            TaskList[0].Number2 = "1d";
544
+            TaskList[0].Number2Str = main.getMemoryLevel(app.globalData.MemoryLevel, 2, TaskList[0].Number2);
513 545
 
514
-          delete TaskList[0].Number3;
515
-          delete TaskList[0].Number3Str;
546
+            delete TaskList[0].Number3;
547
+            delete TaskList[0].Number3Str;
548
+          }
549
+
550
+          finishCard.IsReviewOld = TaskList[0].IsReview;
551
+
552
+          TaskList[0].IsReview = true;
553
+          TaskList.push(TaskList[0]);
554
+        }
555
+        //若是天月年
556
+        else {
557
+          var dayNum = Number(time.substr(0, time.indexOf("d")));
558
+          var date = common.addDate("d", dayNum, new Date());
559
+          TaskList[0].LimitTime = common.formatTime(date);
516 560
         }
517 561
 
518
-        finishCard.IsReviewOld = TaskList[0].IsReview;
562
+      }
519 563
 
520
-        TaskList[0].IsReview = true;
521
-        TaskList.push(TaskList[0]);
564
+      //修改学习任务个数
565
+      var learningType = 0;
566
+      if (TaskList[0].IsReview) {
567
+        learningType = 2;
522 568
       }
523
-      //若是天月年
524
-      else {
525
-        var dayNum = Number(time.substr(0, time.indexOf("d")));
526
-        var date = common.addDate("d", dayNum, new Date());
527
-        TaskList[0].LimitTime = common.formatTime(date);
569
+      if (TaskList[0].IsNew) {
570
+        learningType = 0;
571
+      } else if (TaskList[0].IsHistory) {
572
+        learningType = 1;
528 573
       }
529 574
 
530
-    }
531
-
532
-    //修改学习任务个数
533
-    var learningType = 0;
534
-    if (TaskList[0].IsReview) {
535
-      learningType = 2;
536
-    }
537
-    if (TaskList[0].IsNew) {
538
-      learningType = 0;
539
-    } else if (TaskList[0].IsHistory) {
540
-      learningType = 1;
541
-    }
542
-
543
-    if (btnnumber == "1") {
544
-      learningType = 3;
545
-    }
575
+      if (btnnumber == "1") {
576
+        learningType = 3;
577
+      }
546 578
 
547
-    finishCard.IntervalTime = time;
548
-    finishCard.BtnNumber = btnnumber;
549
-    finishCard.LearningType = learningType;
579
+      finishCard.IntervalTime = time;
580
+      finishCard.BtnNumber = btnnumber;
581
+      finishCard.LearningType = learningType;
550 582
 
551
-    var duration = common.diffDate("s", timeStart, new Date());
552
-    if (finishCard.btnnumber == 1)
553
-      duration = 0;
554
-    finishCard.Duration = timeHistory + duration;
583
+      var duration = common.diffDate("s", timeStart, new Date());
584
+      if (finishCard.btnnumber == 1)
585
+        duration = 0;
586
+      finishCard.Duration = timeHistory + duration;
555 587
 
556
-    console.log("CardTime:"+finishCard.Duration);
588
+      console.log("CardTime:" + finishCard.Duration);
557 589
 
558
-    timeHistory = 0;
559
-    that.timeCompute();
590
+      timeHistory = 0;
591
+      that.timeCompute();
560 592
 
561
-    //添加完成列表,去掉任务列表数据
562
-    listTaskFinished.push(finishCard);
563
-    wx.setStorageSync("ListTaskFinished", listTaskFinished);
564
-    TaskList.shift();
593
+      //添加完成列表,去掉任务列表数据
594
+      listTaskFinished.push(finishCard);
595
+      wx.setStorageSync("ListTaskFinished", listTaskFinished);
596
+      TaskList.shift();
565 597
 
566
-    that.data.NumberNew = 0;
567
-    that.data.NumberHistory = 0;
568
-    that.data.NumberReview = 0;
569
-    var arrTemp = [];
570
-    for (var i = 0; i < TaskList.length; i++) {
571
-      if (TaskList[i].IsReview) {
572
-        if (TaskList[i].LimitTime < common.formatTime(new Date())) {
598
+      that.data.NumberNew = 0;
599
+      that.data.NumberHistory = 0;
600
+      that.data.NumberReview = 0;
601
+      for (var i = 0; i < TaskList.length; i++) {
602
+        if (TaskList[i].IsReview) {
603
+          if (TaskList[i].LimitTime < common.formatTime(new Date())) {
604
+            var card = TaskList.splice(i, 1);
605
+            TaskList.unshift(card[0]);
606
+          }
607
+          that.data.NumberReview++;
608
+        } else if (TaskList[i].IsNew) {
609
+          that.data.NumberNew++;
610
+        } else if (TaskList[i].IsHistory) {
611
+          that.data.NumberHistory++;
612
+        }
613
+        if (TaskList[i].IsFinally){
573 614
           var card = TaskList.splice(i, 1);
574
-          TaskList.unshift(card[0]);
615
+          TaskList.push(card[0]);
575 616
         }
576
-        that.data.NumberReview++;
577
-      } else if (TaskList[i].IsNew) {
578
-        that.data.NumberNew++;
579
-      } else if (TaskList[i].IsHistory) {
580
-        that.data.NumberHistory++;
581 617
       }
582
-    }
583 618
 
584
-    //console.log(JSON.stringify(TaskList[0]));
585 619
 
586
-    if (that.data.NumberNew == 0 &&
587
-      that.data.NumberReview == 0 &&
588
-      that.data.NumberHistory == 0) {
589
-      that.setData({
590
-        IsShowAnswer: [0, 0],
591
-        NumberNew: 0,
592
-        NumberReview: 0,
593
-        NumberHistory: 0,
594
-        CanUndo: 1,
595
-        Recommend: 0,
596
-        IsMore: false,
597
-      });
598
-      clearTimeout(timeoutEveryCard);
599
-      
600
-      that.setSoundFile(1);
601
-      main.UpdateMiaoguoCardTodayAll(true, function () {
602
-        listTaskFinished = [];
603
-        that.getTaskTime();
604
-      });
620
+      //console.log(JSON.stringify(TaskList[0]));
621
+      //如果所有任务完成
622
+      if (that.data.NumberNew == 0 &&
623
+        that.data.NumberReview == 0 &&
624
+        that.data.NumberHistory == 0) {
625
+        that.setData({
626
+          IsShowAnswer: [0, 0],
627
+          NumberNew: 0,
628
+          NumberReview: 0,
629
+          NumberHistory: 0,
630
+          CanUndo: 1,
631
+          Recommend: 0,
632
+          IsMore: false,
633
+        });
634
+        clearTimeout(timeoutEveryCard);
605 635
 
606
-    } else {
607
-      arrImage = TaskList[0].ContentNew.Images;
608
-      arrImage2 = TaskList[0].ContentNew.Images2;
636
+        that.setSoundFile(1);
637
+        main.UpdateMiaoguoCardTodayAll(true, function () {
638
+          listTaskFinished = [];
639
+          that.getTaskTime();
640
+        });
609 641
 
610
-      //任务没有完成,下一张卡片
611
-      that.setData({
612
-        IsShowAnswer: [0, 0],
613
-        TaskInfo: TaskList[0],
614
-        NumberNew: that.data.NumberNew,
615
-        NumberReview: that.data.NumberReview,
616
-        NumberHistory: that.data.NumberHistory,
617
-        CanUndo: 1,
618
-        Recommend: 0,
619
-        IsMore: false,
620
-      });
642
+      }
643
+      //没有完成任务
644
+      else {
645
+        arrImage = TaskList[0].ContentNew.Images;
646
+        arrImage2 = TaskList[0].ContentNew.Images2;
621 647
 
622
-      if (btnnumber == "1") {
623
-        that.setSoundFile(3);
624
-        if (time == "1d") {
625
-          wx.showToast({
626
-            title: '搁置一天',
627
-            mask: true,
628
-            image: "../images/universalpic_shelve_white_120x120.png",
629
-          });
630
-        }
631
-        else {
632
-          wx.showToast({
633
-            title: '已推迟',
634
-            mask: true,
635
-            image: "../images/universalpic_bell_white_120x120.png",
636
-          });
637
-        }
638
-      } else
639
-        that.setSoundFile(0);
648
+        //任务没有完成,下一张卡片
649
+        that.setData({
650
+          IsShowAnswer: [0, 0],
651
+          TaskInfo: TaskList[0],
652
+          NumberNew: that.data.NumberNew,
653
+          NumberReview: that.data.NumberReview,
654
+          NumberHistory: that.data.NumberHistory,
655
+          CanUndo: 1,
656
+          Recommend: 0,
657
+          IsMore: false,
658
+        });
659
+
660
+        if (btnnumber == "1") {
661
+          that.setSoundFile(3);
662
+          if (time == "1d") {
663
+            wx.showToast({
664
+              title: '搁置一天',
665
+              mask: true,
666
+              image: "../images/universalpic_shelve_white_120x120.png",
667
+            });
668
+          } else {
669
+            wx.showToast({
670
+              title: '已推迟',
671
+              mask: true,
672
+              image: "../images/universalpic_bell_white_120x120.png",
673
+            });
674
+          }
675
+        } else
676
+          that.setSoundFile(0);
677
+      }
640 678
     }
641 679
   },
642
-  timeCompute:function(){
643
-    var that=this;
680
+  timeCompute: function () {
681
+    var that = this;
644 682
     timeStart = new Date();
645 683
     clearTimeout(timeoutEveryCard);
646
-    timeoutEveryCard=setTimeout(function(){
684
+    timeoutEveryCard = setTimeout(function () {
647 685
       //计算暂停时已经用掉的时长
648 686
       timeHistory += common.diffDate("s", timeStart, new Date());
649
-      console.log("timeHistory:"+timeHistory);
687
+      console.log("timeHistory:" + timeHistory);
650 688
       wx.showModal({
651 689
         title: '提醒',
652
-        content: '您已等待了' + app.globalData.CardWaitTimeMax+'分钟',
690
+        content: '您已等待了' + app.globalData.CardWaitTimeMax + '分钟',
653 691
         showCancel: false,
654 692
         confirmText: "知道了",
655 693
         success(res) {
@@ -658,7 +696,7 @@ Page({
658 696
           }
659 697
         },
660 698
       })
661
-    }, app.globalData.CardWaitTimeMax*60*1000);
699
+    }, app.globalData.CardWaitTimeMax * 60 * 1000);
662 700
   },
663 701
   gotoCollect: function () {
664 702
     var that = this;
@@ -670,8 +708,7 @@ Page({
670 708
       var that = this;
671 709
       if (!TaskList[0].IsCollect) {
672 710
         TaskList[0].IsCollect = 1;
673
-      }
674
-      else {
711
+      } else {
675 712
         TaskList[0].IsCollect = 0;
676 713
       }
677 714
       that.setData({
@@ -688,24 +725,20 @@ Page({
688 725
     var url;
689 726
     if (str == "recorder") {
690 727
       url = e.currentTarget.dataset.soundmark;
691
-    }
692
-    else if (str.indexOf("英 [") >= 0 || str.indexOf("美 [") >= 0) {
728
+    } else if (str.indexOf("英 [") >= 0 || str.indexOf("美 [") >= 0) {
693 729
       str = str.replace("英 [", "[");
694 730
       str = str.replace("美 [", "[");
695 731
       url = e.currentTarget.dataset.soundmark;
696
-    }
697
-    else if (e.currentTarget.dataset.soundmark && e.currentTarget.dataset.soundmark != "undefined") {
732
+    } else if (e.currentTarget.dataset.soundmark && e.currentTarget.dataset.soundmark != "undefined") {
698 733
       var soundmark = e.currentTarget.dataset.soundmark;
699 734
       if (soundmark && soundmark.indexOf("http") < 0) {
700 735
         url = app.globalData.audioUrlBaidu;
701 736
         url = url.replace("[token]", app.globalData.BaiduToken);
702 737
         url = url.replace("[word]", soundmark);
703
-      }
704
-      else {
738
+      } else {
705 739
         url = soundmark;
706 740
       }
707
-    }
708
-    else {
741
+    } else {
709 742
       url = app.globalData.audioUrlBaidu;
710 743
       url = url.replace("[token]", app.globalData.BaiduToken);
711 744
       url = url.replace("[word]", str);
@@ -724,7 +757,7 @@ Page({
724 757
       timeoutPlayAudio = setTimeout(function () {
725 758
         isPlaying = false;
726 759
       }, 60000);
727
-      
760
+
728 761
       wx.showLoading({
729 762
         title: '音频下载中',
730 763
         mask: true,
@@ -738,7 +771,7 @@ Page({
738 771
         success(res) {
739 772
           wx.hideLoading();
740 773
           if (res.statusCode === 200) {
741
-            tempPlayUrlLocal=res.tempFilePath;
774
+            tempPlayUrlLocal = res.tempFilePath;
742 775
             that.audioCtx.setSrc(res.tempFilePath);
743 776
             that.audioCtx.play();
744 777
             tempPlayUrl = url;
@@ -748,8 +781,7 @@ Page({
748 781
           wx.hideLoading();
749 782
         }
750 783
       });
751
-    }
752
-    else {
784
+    } else {
753 785
       this.audioCtx.pause();
754 786
       if (innerAudioContext1)
755 787
         innerAudioContext1.stop();
@@ -759,7 +791,7 @@ Page({
759 791
   audioBindEnded: function () {
760 792
     isPlaying = false;
761 793
   },
762
-  audioBindError:function(err){
794
+  audioBindError: function (err) {
763 795
     console.log(err);
764 796
     innerAudioContext1.src = tempPlayUrlLocal;
765 797
     innerAudioContext1.play();
@@ -776,14 +808,14 @@ Page({
776 808
         }
777 809
 
778 810
         var speed1 = 0;
779
-        if (data.Duration>0)
811
+        if (data.Duration > 0)
780 812
           speed1 = Math.round(100 * data.Count / (data.Duration / 60)) / 100;
781 813
 
782
-        var speed2 = 0+"秒";
814
+        var speed2 = 0 + "秒";
783 815
         if (data.Count > 0)
784 816
           speed2 = common.getMinuteSecond(Math.round(data.Duration / data.Count), true);
785 817
 
786
-        
818
+
787 819
         app.globalData.TaskToday.DayNumber = data.DayNumber;
788 820
         that.setData({
789 821
           TodayTime: duration,
@@ -867,7 +899,7 @@ Page({
867 899
   onMore: function () {
868 900
     for (var i = 0; i < this.data.FontSizeArray.length; i++) {
869 901
       if (this.data.FontSizeArray[i].Value == this.data.TaskInfo.FontSize)
870
-        this.data.FontSizeArray[i].CSS = "color:#1E1E1E;background-color:" + this.data.Color.LineColor+";border:3rpx solid " + this.data.Color.LineColor + ";";
902
+        this.data.FontSizeArray[i].CSS = "color:#1E1E1E;background-color:" + this.data.Color.LineColor + ";border:3rpx solid " + this.data.Color.LineColor + ";";
871 903
       else
872 904
         this.data.FontSizeArray[i].CSS = "";
873 905
     }
@@ -901,6 +933,7 @@ Page({
901 933
     var avatarUrl = app.globalData.userInfo.AvatarUrl;
902 934
     avatarUrl = avatarUrl.substring(0, avatarUrl.lastIndexOf("/") + 1);
903 935
     avatarUrl = avatarUrl + "0";
936
+    //console.log(avatarUrl);
904 937
 
905 938
     wx.downloadFile({
906 939
       url: avatarUrl, // 仅为示例,并非真实的资源
@@ -946,8 +979,9 @@ Page({
946 979
           canvas.fillText("迄今已接力", 390, 267);
947 980
           canvas.setFontSize(32);
948 981
           canvas.fillText(app.globalData.TaskToday.DayNumber + "次", 390, 295);
949
-
982
+          //console.log("生成前");
950 983
           canvas.draw(1, function (n) {
984
+            //console.log("生成后1");
951 985
             wx.canvasToTempFilePath({
952 986
               x: 0,
953 987
               y: 0,
@@ -958,16 +992,17 @@ Page({
958 992
               canvasId: 'shareCanvas',
959 993
               success: function (res2) {
960 994
                 wx.hideLoading();
961
-
995
+                //console.log("生成后2");
962 996
                 wx.previewImage({
963 997
                   current: res2.tempFilePath, // 当前显示图片的http链接
964 998
                   urls: [res2.tempFilePath] // 需要预览的图片http链接列表
965 999
                 });
966 1000
 
967
-                main.getData("ShareMiaoguoTask?UserID="+app.globalData.userInfo.UserID, function (data) {});
1001
+                main.getData("ShareMiaoguoTask?UserID=" + app.globalData.userInfo.UserID, function (data) { });
968 1002
               },
969
-              fail: function () {
1003
+              fail: function (e) {
970 1004
                 wx.hideLoading();
1005
+                //console.log("生成错误:"+e);
971 1006
               }
972 1007
             })
973 1008
           });

+ 16 - 11
pages/main/detail.wxml

@@ -6,18 +6,18 @@
6 6
 
7 7
     <!-- 工具栏 -->
8 8
     <view class='panelTop FlexRow' style='background-color:{{Color.BackColor}};'>
9
-      <view class='panelCancel FlexRow' catchtouchstart='gotoCollect'>
9
+      <view class='panelCancel FlexRow' catchtap='gotoCollect'>
10 10
         <view class='panelCancel0 FlexRow'>
11 11
           <image hidden='{{TaskInfo.IsCollect}}' src="../images/universalpic_fav_default_gray_26x24.png" class='universalpic_fav_default_gray_26x24' />
12 12
           <image hidden='{{!TaskInfo.IsCollect}}' src="../images/universalpic_fav_enable_tc0{{Color.ID}}_26x24.png" class='universalpic_fav_default_gray_26x24' />
13 13
         </view>
14 14
       </view>
15
-      <view class='panelCancel FlexRow' catchtouchstart='onMore'>
15
+      <view class='panelCancel FlexRow' catchtap='onMore'>
16 16
         <view class='panelCancel0 FlexRow'>
17 17
           <image src="../images/universalpic_more_gray_32x8.png" class='universalpic_more_gray_32x8' />
18 18
         </view>
19 19
       </view>
20
-      <view class='panelNumber FlexRow' catchtouchstart='showNumberContainner'>
20
+      <view class='panelNumber FlexRow' catchtap='showNumberContainner'>
21 21
         <view class="FlexColumn">
22 22
           <view class='panelNumber1'>{{NumberNew}}</view>
23 23
           <view hidden="{{!TaskInfo.IsNew || TaskInfo.IsReview}}" class='panelNumber2Line' style='background-color:{{Color.LineColor}};'></view>
@@ -34,7 +34,7 @@
34 34
           <view class='panelNumber2 panelNumber1'>{{NumberNew+NumberReview+NumberHistory}}</view>
35 35
         </view>
36 36
       </view>
37
-      <view class='panelCancel FlexRow' catchtouchstart='gotoNext' data-time="1d" data-btnnumber="1">
37
+      <view class='panelCancel FlexRow' catchtap='gotoNext' data-time="1d" data-btnnumber="1">
38 38
         <view class='panelCancel0 FlexRow'>
39 39
           <image src="../images/universalpic_shelve_gray_26x26.png" class='universalpic_shelve_white_26x26' />
40 40
         </view>
@@ -44,7 +44,7 @@
44 44
           <image src="../images/universalpic_undo_gray_26x20.png" class='universalpic_undo_white_30p_26x20' />
45 45
         </view>
46 46
       </view>
47
-      <view class='panelCancel FlexRow' catchtouchstart='gotoPrev' wx:if="{{CanUndo==1}}">
47
+      <view class='panelCancel FlexRow' catchtap='gotoPrev' wx:if="{{CanUndo==1}}">
48 48
         <view class='panelCancel0 FlexRow'>
49 49
           <image src="../images/universalpic_undo_gray_26x20.png" class='universalpic_undo_white_30p_26x20' />
50 50
         </view>
@@ -62,10 +62,10 @@
62 62
     <image class="footerShade" src="../images/study_learning_bgimage_tc0{{Color.ID}}.png" />
63 63
     <view class='footer FlexColumn'>
64 64
       <image class="footerImage" src="../images/study_learning_maskimage_tc0{{Color.ID}}.png" />
65
-      <view class="panelFooter FlexColumn" wx:if="{{!IsShowAnswer[0] && !IsShowAnswer[1] && ClickType!=1}}" catchtouchstart="onShowAnswer">
65
+      <view class="panelFooter FlexColumn" wx:if="{{!IsShowAnswer[0] && !IsShowAnswer[1] && ClickType!=1}}" catchtap="onShowAnswer">
66 66
         看答案
67 67
       </view>
68
-      <view class="panelFooter FlexColumn" wx:if="{{IsShowAnswer[0] && !IsShowAnswer[1] && ClickType!=1}}" catchtouchstart="onShowAnswer">
68
+      <view class="panelFooter FlexColumn" wx:if="{{IsShowAnswer[0] && !IsShowAnswer[1] && ClickType!=1}}" catchtap="onShowAnswer">
69 69
         下一段
70 70
       </view>
71 71
       <view class="panelFooter0 panelFooter FlexColumn" wx:if="{{IsShowAnswer[1]}}">
@@ -177,10 +177,10 @@
177 177
   <view wx:if="{{IsMore}}" class="numberContainer FlexColumn" style='height:{{Containnerheight}}rpx;background-color:{{Color.BackColor}};'>
178 178
     <view class="numberContainerFooter1 FlexColumn">
179 179
       <view class='lineFooter'></view>
180
-      <view class='numberContainerFooter102 FlexRow' catchtap="gotoEdit">
181
-        <image src="../images/universalpic_edit_gray_25x25.png" class='universalpic_edit_gray_25x25' />
182
-        <view class='numberContainerFooter111'>编辑题卡</view>
183
-      </view>
180
+      <view class='numberContainerFooter102 FlexRow' catchtap='gotoNext' data-btnnumber="2">
181
+        <image src="../images/universalpic_sendtoback_gray_30x26.png" class='universalpic_sendtoback_gray_30x26' />
182
+        <view class='numberContainerFooter111'>挪到最后</view>
183
+      </view>      
184 184
       <view class='lineFooter'></view>
185 185
       <view class='numberContainerFooter103 FlexRow' catchtap="gotoEdit">
186 186
         <image src="../images/universalpic_bell_gray_30x30.png" class='universalpic_bell_gray_30x30' />
@@ -195,6 +195,11 @@
195 195
         </view>
196 196
       </block>
197 197
       <view class='lineFooter'></view>
198
+      <view class='numberContainerFooter102 FlexRow' catchtap="gotoEdit">
199
+        <image src="../images/universalpic_edit_gray_25x25.png" class='universalpic_edit_gray_25x25' />
200
+        <view class='numberContainerFooter111'>编辑题卡</view>
201
+      </view>
202
+      <view class='lineFooter'></view>
198 203
       <view class='numberContainerFooter101 FlexRow'>
199 204
         <image src="../images/universalpic_typesize_gray_30x18.png" class='universalpic_typesize_gray_30x18' />
200 205
         <view class='numberContainerFooter11 FlexColumn'>

+ 6 - 0
pages/main/detail.wxss

@@ -632,6 +632,12 @@
632 632
   align-items: flex-start;
633 633
 }
634 634
 
635
+.universalpic_sendtoback_gray_30x26{
636
+  width: 30rpx; 
637
+  height: 26rpx;
638
+  margin: 0 30rpx 0 30rpx;
639
+}
640
+
635 641
 .universalpic_edit_gray_25x25{
636 642
   width: 25rpx; 
637 643
   height: 25rpx;

+ 6 - 6
pages/main/preview.wxml

@@ -30,7 +30,7 @@
30 30
   <!-- 幻灯片播放 -->
31 31
   <block wx:if="{{ShowType=='play'}}">
32 32
     <view class="panelTop FlexRow"  style='background-color:{{Color.BackColor}};border-bottom:0;'>
33
-      <view class='left' catchtouchstart='gotoCollect'>
33
+      <view class='left' catchtap='gotoCollect'>
34 34
       <view class='panelCancel0 FlexRow'>
35 35
           <image hidden='{{IsCollect}}' src="../images/universalpic_fav_default_gray_26x24.png" class='universalpic_fav_default_gray_26x24' />
36 36
           <image hidden='{{!IsCollect}}' src="../images/universalpic_fav_enable_tc0{{Color.ID}}_26x24.png" class='universalpic_fav_default_gray_26x24' />
@@ -54,7 +54,7 @@
54 54
   <view style='height:150rpx'></view>
55 55
 
56 56
   <view class='footer FlexColumn' style='background-color:{{Color.BackColor}}'>
57
-    <view class="panelFooter FlexRow" wx:if="{{ShowType=='preview'}}" catchtouchstart="close">
57
+    <view class="panelFooter FlexRow" wx:if="{{ShowType=='preview'}}" catchtap="close">
58 58
       退出预览
59 59
     </view>
60 60
 
@@ -63,10 +63,10 @@
63 63
       <view class='btn1 FlexRow' catchtap="previewNext" data-id="{{PrevID}}" wx:if="{{PrevID>0}}">
64 64
         <image class="universalpic_next_gray_30x30" src='../images/universalpic_prev_gray_30x30.png' />
65 65
       </view>
66
-      <view class='btn22 FlexRow' wx:if="{{IsShowAnswer[0]==1}}" catchtouchstart='onHideAnswer'>
66
+      <view class='btn22 FlexRow' wx:if="{{IsShowAnswer[0]==1}}" catchtap='onHideAnswer'>
67 67
         隐藏答案
68 68
       </view>
69
-      <view class='btn22 FlexRow' wx:if="{{IsShowAnswer[0]==0}}" catchtouchstart='onShowAnswer'>
69
+      <view class='btn22 FlexRow' wx:if="{{IsShowAnswer[0]==0}}" catchtap='onShowAnswer'>
70 70
         显示答案
71 71
       </view>
72 72
       <button class="btn21" open-type='share'>分享给大家</button>
@@ -92,10 +92,10 @@
92 92
       <view class='btn1 FlexRow' catchtap="playNext" data-div="-1" wx:if="{{PrevID>0}}">
93 93
         <image class="universalpic_next_gray_30x30" src='../images/universalpic_prev_gray_30x30.png' />
94 94
       </view>
95
-      <view class='btn3 FlexRow' catchtouchstart='onPlayAgain'>
95
+      <view class='btn3 FlexRow' catchtap='onPlayAgain'>
96 96
         稍后回放
97 97
       </view>
98
-      <view class='btn4 FlexRow' catchtouchstart='onShowAnswer'>
98
+      <view class='btn4 FlexRow' catchtap='onShowAnswer'>
99 99
         看答案
100 100
       </view>
101 101
       <view class='btn1 FlexRow' catchtap="playNext" data-div="1" wx:if="{{NextID>0}}">

+ 16 - 1
pages/main/searchWeb2.wxml

@@ -131,7 +131,8 @@
131 131
       <view class="panelTitle1">中文释义</view>
132 132
     </view>
133 133
     <view class="panelItem FlexRow">
134
-      <view class="{{CSS['CHN_PinYin_explain_'+index].Css1}} panelItemFrame FlexRow" wx:for="{{Result.CHN.PinYin}}" wx:key="pinyin" bindtap='getInputData' data-type="normal" data-content="[读]{{item.pinyin}}[/读]\n{{item.explain}}" data-css="CHN_PinYin_explain_{{index}}" data-tag="释义">
134
+      <view class="{{CSS['CHN_PinYin_explain_'+index].Css1}} panelItemFrame FlexRow" wx:for="{{Result.CHN.PinYin}}" wx:key="pinyin" bindtap='getInputData' data-type="normal" data-content="[读]{{item.pinyin}}[/读]\n{{item.explain}}" data-css="CHN_PinYin_explain_{{index}}"
135
+        data-tag="释义">
135 136
         <view class="{{CSS['CHN_PinYin_explain_'+index].Css2}} panelSelect0">{{CSS['CHN_PinYin_explain_'+index].Number}}</view>
136 137
         <text class="text1"><block wx:if="{{Result.CHN.PinYin.length>1}}">
137 138
         [{{item.pinyin}}]\n 
@@ -141,6 +142,20 @@
141 142
     <view class='lineFooter'></view>
142 143
   </block>
143 144
 
145
+  <!-- 部首 -->
146
+  <block wx:if="{{Result.CHN.BuShou && Result.CHN.BuShou.length>0}}">
147
+    <view class="panelTitle FlexRow">
148
+      <view class="panelTitle1">部首</view>
149
+    </view>
150
+    <view class="panelItem FlexRow">
151
+      <view class="{{CSS.CHN_BuShou.Css1}} panelItemFrame FlexRow" bindtap='getInputData' data-type="normal" data-content="{{Result.CHN.BuShou}}" data-css="CHN_BuShou" data-tag="部首">
152
+        <view class="{{CSS.CHN_BuShou.Css2}} panelSelect0">{{CSS.CHN_BuShou.Number}}</view>
153
+        <view class="text1">{{Result.CHN.BuShou}}</view>
154
+      </view>
155
+    </view>
156
+    <view class='lineFooter'></view>
157
+  </block>
158
+
144 159
   <!-- 作者与朝代 -->
145 160
   <block wx:if="{{Result.CHN.Author && Result.CHN.Author.length>0}}">
146 161
     <view class="panelTitle FlexRow">

marketing/main/extenduser.js → pages/marketing/extenduser.js


marketing/main/extenduser.json → pages/marketing/extenduser.json


marketing/main/extenduser.wxml → pages/marketing/extenduser.wxml


marketing/main/extenduser.wxss → pages/marketing/extenduser.wxss


marketing/main/index.js → pages/marketing/index.js


marketing/main/index.json → pages/marketing/index.json


marketing/main/index.wxml → pages/marketing/index.wxml


marketing/main/index.wxss → pages/marketing/index.wxss


marketing/main/shareuser.js → pages/marketing/shareuser.js


marketing/main/shareuser.json → pages/marketing/shareuser.json


marketing/main/shareuser.wxml → pages/marketing/shareuser.wxml


marketing/main/shareuser.wxss → pages/marketing/shareuser.wxss


+ 10 - 10
pages/other/binding.js

@@ -10,27 +10,27 @@ Page({
10 10
     var that = this;
11 11
     if (options && options.type && options.type == "bebound") {
12 12
       
13
-      if (app.globalData.userSource=="1007"){
14
-        that.setData({
15
-          ShowPanel: "bebound",
16
-          ParentUserID: options.ParentUserID,
17
-          NickName: options.NickName,
18
-        });
19
-        that.download(options.AvatarUrl);
20
-      }
21
-      else{
13
+      if (app.globalData.userSource == "1044" || app.globalData.userSource == "1008"){
22 14
         wx.showModal({
23 15
           title: '抱歉',
24 16
           content: '绑定功能只能用于朋友单聊',
25 17
           showCancel: false,
26 18
           confirmText: "知道了",
27
-          success:function(){
19
+          success: function () {
28 20
             wx.reLaunch({
29 21
               url: '../index/index',
30 22
             })
31 23
           }
32 24
         });
33 25
       }
26
+      else{
27
+        that.setData({
28
+          ShowPanel: "bebound",
29
+          ParentUserID: options.ParentUserID,
30
+          NickName: options.NickName,
31
+        });
32
+        that.download(options.AvatarUrl);
33
+      }
34 34
     }
35 35
     else {
36 36
       main.getData("GetUserBindingList?UserID=" + app.globalData.userInfo.UserID, function (data) {

+ 2 - 2
pages/other/userbook.wxml

@@ -45,7 +45,7 @@
45 45
         <view>作业清单</view>
46 46
       </view>    
47 47
 
48
-      <view class="panel21 FlexColumn" bindtap="goto" data-url="../../marketing/main/index" wx:if="{{IsPay==1 && !IsLoseEfficacy}}">
48
+      <view class="panel21 FlexColumn" bindtap="goto" data-url="../marketing/index" wx:if="{{IsPay==1 && !IsLoseEfficacy}}">
49 49
         <image class="usermanual_index_handshake" src='../images/usermanual_index_handshake.png' />
50 50
         <view>推广计划</view>
51 51
       </view>
@@ -98,7 +98,7 @@
98 98
 
99 99
     <block wx:if="{{IsShow==1 && PanelShow===2 && ClassDayNumber>0 && IsPay==1 && !IsLoseEfficacy}}">
100 100
       <view class="panelItem FlexColumn">
101
-        <image class="salesactivity_a05_usermanual_banner" src='../images/salesactivity_a05_usermanual_banner.png' bindtap="goto" data-url="../../marketing/main/index" />
101
+        <image class="salesactivity_a05_usermanual_banner" src='../images/salesactivity_a05_usermanual_banner.png' bindtap="goto" data-url="../marketing/index" />
102 102
         <view class="marketingDetail" bindtap="goto" data-url="../../pages/other/webview?PageID=7"></view>
103 103
       </view>
104 104
     </block>

+ 147 - 76
pages/test/index.js

@@ -7,66 +7,8 @@ Page({
7 7
   data: {
8 8
     List: [],
9 9
     IsSelectGrade: false,
10
-    SelectGrade:0,
11
-    GradeArr: [
12
-      {
13
-        Name: "一年级",
14
-        Select:"Select",
15
-        List: [
16
-          {
17
-            ID: 1,
18
-            Type: "Shizi",
19
-            Name: "语文识字",
20
-            Name2: "上学期",
21
-            Image: "../images/examine_subject_a001.png"
22
-          }, {
23
-            ID: 2,
24
-            Type: "Shizi",
25
-            Name: "语文识字",
26
-            Name2: "下学期",
27
-            Image: "../images/examine_subject_a002.png"
28
-          },
29
-        ]
30
-      },
31
-      {
32
-        Name: "二年级",
33
-        Select: "",
34
-        List: [
35
-          {
36
-            ID: 3,
37
-            Type: "Shizi",
38
-            Name: "语文识字",
39
-            Name2: "上学期",
40
-            Image: "../images/examine_subject_a003.png"
41
-          }, {
42
-            ID: 4,
43
-            Type: "Shizi",
44
-            Name: "语文识字",
45
-            Name2: "下学期",
46
-            Image: "../images/examine_subject_a004.png"
47
-          },
48
-        ]
49
-      },
50
-      {
51
-        Name: "三年级",
52
-        Select: "",
53
-        List: [
54
-          {
55
-            ID: 5,
56
-            Type: "Shizi",
57
-            Name: "语文识字",
58
-            Name2: "上学期",
59
-            Image: "../images/examine_subject_a005.png"
60
-          }, {
61
-            ID: 6,
62
-            Type: "Shizi",
63
-            Name: "语文识字",
64
-            Name2: "下学期",
65
-            Image: "../images/examine_subject_a006.png"
66
-          },
67
-        ]
68
-      }
69
-    ],
10
+    TestSelectGrade:0,
11
+    
70 12
   },
71 13
   onLoad: function (options) {
72 14
     var that = this;
@@ -74,12 +16,17 @@ Page({
74 16
       Containnerheight: main.getWindowHeight(),
75 17
     });
76 18
 
77
-    that.getHanzi(function (arr) {
78
-      if (arr) {
79
-
19
+    main.getHanzi(function (arr) {
20
+      if (!arr) {
21
+        wx.removeStorageSync("HanziUpdateTime");
22
+        wx.removeStorageSync("HanziAll");
23
+        main.getHanzi(function(arr){});
80 24
       }
81 25
     });
82 26
   },
27
+  onShow:function(){
28
+    this.getTestReportList();
29
+  },
83 30
   showSelectGrade: function () {
84 31
     var that = this;
85 32
     that.setData({
@@ -98,22 +45,130 @@ Page({
98 45
       url: url,
99 46
     });
100 47
   },
101
-  getHanzi: function (callback) {
48
+  getTestReportList: function () {
102 49
     var that = this;
103
-    var time = wx.getStorageSync("HanziUpdateTime");
104
-    main.getData('GetHanziAll?UpdateTime=' + time, function (data) {
50
+    that.setData({
51
+      GradeArr: [
52
+        {
53
+          Name: "一年级",
54
+          Select: "Select",
55
+          List: [
56
+            {
57
+              ID: 1,
58
+              Type: "Shizi",
59
+              Name: "语文识字",
60
+              Name2: "上学期",
61
+              Finish: 0,
62
+              Total: 12,
63
+              Image: "../images/examine_subject_a001.png"
64
+            }, {
65
+              ID: 2,
66
+              Type: "Shizi",
67
+              Name: "语文识字",
68
+              Name2: "下学期",
69
+              Finish: 0,
70
+              Total: 14,
71
+              Image: "../images/examine_subject_a002.png"
72
+            },
73
+          ]
74
+        },
75
+        {
76
+          Name: "二年级",
77
+          Select: "",
78
+          List: [
79
+            {
80
+              ID: 3,
81
+              Type: "Shizi",
82
+              Name: "语文识字",
83
+              Name2: "上学期",
84
+              Finish: 0,
85
+              Total: 16,
86
+              Image: "../images/examine_subject_a003.png"
87
+            }, {
88
+              ID: 4,
89
+              Type: "Shizi",
90
+              Name: "语文识字",
91
+              Name2: "下学期",
92
+              Finish: 0,
93
+              Total: 16,
94
+              Image: "../images/examine_subject_a004.png"
95
+            },
96
+          ]
97
+        },
98
+        {
99
+          Name: "三年级",
100
+          Select: "",
101
+          List: [
102
+            {
103
+              ID: 5,
104
+              Type: "Shizi",
105
+              Name: "语文识字",
106
+              Name2: "上学期",
107
+              Finish: 0,
108
+              Total: 16,
109
+              Image: "../images/examine_subject_a005.png"
110
+            }, {
111
+              ID: 6,
112
+              Type: "Shizi",
113
+              Name: "语文识字",
114
+              Name2: "下学期",
115
+              Finish: 0,
116
+              Total: 16,
117
+              Image: "../images/examine_subject_a006.png"
118
+            },
119
+          ]
120
+        }
121
+      ],
122
+    })
123
+    var userid = app.globalData.userInfo.UserID;
124
+    main.getData('GetTestReportList?UserID=' + userid, function (data) {
105 125
       if (data) {
106
-        var arr = [];
107
-        if (data.List) {
108
-          arr = common.Decrypt(data.List);
109
-          wx.setStorageSync("HanziAll", arr);
110
-          wx.setStorageSync("HanziUpdateTime", data.UpdateTime);
126
+        var dataTemp=[];
127
+        for (var i = 0; i < data.length; i++) {
128
+          for(var j=0;j<dataTemp.length;j++){
129
+            if (dataTemp[j].Name[0] == data[i].Name[0]
130
+              && dataTemp[j].Name[1] == data[i].Name[1]
131
+              && dataTemp[j].TestType == data[i].TestType 
132
+              && data[i].IsFinished==1
133
+              ){
134
+              dataTemp.splice(j,1);
135
+              break;
136
+            }
137
+          }
138
+          dataTemp.push(data[i]);
139
+        }
140
+
141
+        for (var i = 0; i < dataTemp.length;i++){
142
+          var name = dataTemp[i].Name[0].split(" ");
143
+          for(var j=0;j<that.data.GradeArr.length;j++){
144
+            var item = that.data.GradeArr[j];
145
+            if (name[0]==item.Name){
146
+              for(var k=0;k<item.List.length;k++){
147
+                if (name[1] == item.List[k].Name && name[2] == item.List[k].Name2){
148
+                  if (dataTemp[i].IsFinished==1)
149
+                    item.List[k].Finish++;
150
+                }
151
+              }
152
+            }
153
+          }
111 154
         }
112
-        else {
113
-          arr = wx.getStorageSync("HanziAll");
114
-          arr=JSON.parse(arr);
155
+
156
+        for (var j = 0; j < that.data.GradeArr.length; j++) {
157
+          var item = that.data.GradeArr[j];
158
+          for (var k = 0; k < item.List.length; k++) {
159
+            item.List[k].Finished = Math.round(100 * item.List[k].Finish / item.List[k].Total);
160
+          }
115 161
         }
116
-        callback(arr);
162
+
163
+        that.setData({
164
+          TestReport: data,
165
+          GradeArr:that.data.GradeArr,
166
+        });
167
+        wx.setStorageSync("UserTestReport", data);
168
+
169
+        common.getStorageValue(that, "TestSelectGrade", 0, function () {
170
+          that.onSelectGrade({ currentTarget: { dataset: { value: that.data.TestSelectGrade } } });
171
+        });
117 172
       }
118 173
     });
119 174
   },
@@ -123,10 +178,26 @@ Page({
123 178
       this.data.GradeArr[i].Select = "";
124 179
     this.data.GradeArr[index].Select="Select";
125 180
     this.setData({
126
-      SelectGrade:index,
181
+      TestSelectGrade:index,
127 182
       GradeArr: this.data.GradeArr,
128 183
     });
129 184
     this.closeSelectGrade();
185
+    wx.setStorageSync("TestSelectGrade", index);
186
+  },
187
+  gotoTestReportInfo: function (e) {
188
+    var id = e.currentTarget.dataset.id;
189
+    var userid = app.globalData.userInfo.UserID;
190
+    main.getData('GetTestReportInfo?UserID=' + userid+'&ID='+id, function (data) {
191
+      if (data) {
192
+        wx.setStorageSync("TestTask", data);
193
+        wx.navigateTo({
194
+          url: "./report?type=edit",
195
+        });
196
+      }
197
+    });
198
+  },
199
+  onUnload:function(){
200
+    wx.removeStorageSync("UserTestReport");
130 201
   },
131 202
   onShareAppMessage: function () {
132 203
     return {

+ 4 - 1
pages/test/index.json

@@ -1,3 +1,6 @@
1 1
 {
2
-  "navigationBarTitleText": "知识检验"
2
+  "navigationBarTitleText": "知识检验",
3
+  "backgroundColor": "#ffffff",
4
+  "backgroundColorTop": "#f0f0f0",
5
+  "backgroundColorBottom": "#ffffff"
3 6
 }

+ 35 - 22
pages/test/index.wxml

@@ -1,57 +1,70 @@
1 1
 <view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
2 2
   <view class="panelTop FlexRow" bindtap="showSelectGrade">
3
-    <view class="panelTop1">{{GradeArr[SelectGrade].Name}}</view>
3
+    <view class="panelTop1">{{GradeArr[TestSelectGrade].Name}}</view>
4 4
     <view class="panelTop2 FlexRow">
5 5
       <image class="universalpic_menu_blue_26x26" src="../images/universalpic_menu_blue_26x26.png"></image>
6 6
       <view>首选年级</view>
7 7
     </view>
8 8
   </view>
9
-  <view style="height:106rpx;"></view>
10
-  <scroll-view scroll-x="true" class="panelCard FlexRow">
11
-    <view class="Card" wx:for="{{GradeArr[SelectGrade].List}}" wx:key="index" bindtap="goto" data-url="./list?id={{item.ID}}">
9
+  <view class="panelLine"></view>
10
+  <scroll-view scroll-x class="panelCard FlexRow">
11
+    <view class="Card" wx:for="{{GradeArr[TestSelectGrade].List}}" wx:key="index" bindtap="goto" data-url="./list?id={{item.ID}}&name1={{GradeArr[TestSelectGrade].Name}} {{item.Name}} {{item.Name2}}">
12 12
       <image class="examine_subject_a001" src="{{item.Image}}"></image>
13 13
       <view class="Card1">{{item.Name}}</view>
14 14
       <view class="Card2">{{item.Name2}}</view>
15
-      <view class="Card3">检验</view>
15
+      <view class="Card3">检验</view>
16 16
       <view class="Card4 FlexRow">
17
-        <view class="Progress FlexRow"><view class="Progress1"></view></view>
18
-        <view class="Number">12%</view>
17
+        <view class="Progress FlexRow">
18
+          <view class="Progress1" style="width:{{item.Finished}}%;"></view>
19
+        </view>
20
+        <view class="Number">{{item.Finished}}%</view>
19 21
       </view>
20 22
     </view>
21 23
     <view class="Card0"></view>
22 24
   </scroll-view>
23 25
   <view class="panelList FlexColumn">
24 26
     <view class="panelListTitle FlexRow">
25
-      <view>检验报告</view>
27
+      <view>报告汇总</view>
26 28
     </view>
27
-    <block wx:if="{{List.length==0}}">
29
+    <block wx:if="{{TestReport.length==0}}">
28 30
       <image class="examine_clipboard_80x80" src="../images/examine_clipboard_80x80.png"></image>
29
-      <text class="panelListContent">您还没有做过知识检验,选择科目开始检验吧,\n检验后的报告将显示在这里。</text>
31
+      <text class="panelListContent">您还没有做过知识检验,选择科目开始检验吧,\n检验后的报告将显示在这里。\n</text>
32
+
30 33
     </block>
31 34
 
32
-    <block wx:if="{{List.length>0}}" wx:for="{{[1,2,3,2,3,2,3,2,3]}}">
33
-      <view class="lineWidthAll FlexRow" wx:if="{{index>0}}">
34
-        <view class="lineWidth720"></view>
35
-      </view>
36
-      <view class="Item FlexRow">
35
+    <block wx:if="{{TestReport.length>0}}" wx:for="{{TestReport}}" wx:key="index">
36
+
37
+      <view class="Item FlexRow" bindtap="gotoTestReportInfo" data-id="{{item.ID}}">
37 38
         <view class="Item1 FlexColumn">
38
-          <view class="ItemTitle">汉语拼音 9-13</view>
39
-          <view class="ItemTitle2">语文识字 上学期</view>
40
-        </view>        
39
+          <view class="ItemTitle FlexRow">
40
+            <view>{{item.Name[1]}}</view>
41
+            <view class="ItemTitle11" wx:if="{{item.TestType=='read'}}">会念</view>
42
+            <view class="ItemTitle11" wx:if="{{item.TestType=='write'}}">会写</view>
43
+          </view>
44
+          <view class="ItemTitle2">{{item.Name[0]}}</view>
45
+        </view>
41 46
         <view class="Item2 FlexColumn">
42
-          <view class="ItemDate">12月12日</view>
47
+          <view class="ItemDate">{{item.CreateTime}}</view>
43 48
           <view class="ItemNumber FlexRow">
44
-            <image class="examine_willread_gray_22x22" src="../images/examine_willread_gray_22x22.png"></image>
49
+            <image wx:if="{{item.TestType=='read' && item.IsFinished==1}}" class="examine_willread_gray_22x22" src="../images/examine_willread_green_22x22.png"></image>
50
+            <image wx:if="{{item.TestType=='read' && item.IsFinished==0}}" class="examine_willread_gray_22x22" src="../images/examine_willread_gray_22x22.png"></image>
51
+            <image wx:if="{{item.TestType=='write' && item.IsFinished==1}}" class="examine_willwrite_gray_22x22" src="../images/examine_willwrite_green_22x22.png"></image>
52
+            <image wx:if="{{item.TestType=='write' && item.IsFinished==0}}" class="examine_willwrite_gray_22x22" src="../images/examine_willwrite_gray_22x22.png"></image>
45 53
             <image class="universalpic_checked_gray_14x12" src="../images/universalpic_checked_gray_14x12.png"></image>
46
-            <view class="Number2">10</view>
54
+            <view class="Number2">{{item.TestRight}}</view>
47 55
             <image class="universalpic_wrong_gray_12x12" src="../images/universalpic_wrong_gray_12x12.png"></image>
48
-            <view class="Number3">5</view>
56
+            <view class="Number3">{{item.TestWrong}}</view>
49 57
           </view>
50 58
         </view>
51 59
       </view>
60
+
61
+      <view class="lineWidthAll FlexRow">
62
+        <view class="lineWidth720"></view>
63
+      </view>
52 64
     </block>
53 65
 
54 66
   </view>
67
+
55 68
 </view>
56 69
 
57 70
 <!-- 更多功能 -->

+ 19 - 4
pages/test/index.wxss

@@ -9,6 +9,7 @@
9 9
   position: fixed;
10 10
   z-index: 10;
11 11
   top:0;
12
+  border-bottom:1rpx solid #d2d2d2; 
12 13
 }
13 14
 
14 15
 .panelTop1{
@@ -28,6 +29,12 @@
28 29
   margin-right: 10rpx;
29 30
 }
30 31
 
32
+.panelLine{
33
+  width:100%;
34
+  height:106rpx;
35
+  background-color: #f0f0f0;
36
+}
37
+
31 38
 .panelCard{
32 39
   width:100%;
33 40
   height:443rpx;
@@ -94,7 +101,6 @@
94 101
   justify-content: flex-start;
95 102
 }
96 103
 .Progress1{
97
-  width:100rpx;
98 104
   height:10rpx;
99 105
   border-radius: 5rpx;
100 106
   background-color: #34BD88;
@@ -113,7 +119,6 @@
113 119
 .panelListTitle{
114 120
   font-size:32rpx;
115 121
   margin: 0 0 0 30rpx;
116
-  width:100%;
117 122
   height:115rpx;
118 123
   justify-content: flex-start;
119 124
 }
@@ -125,17 +130,18 @@
125 130
 }
126 131
 
127 132
 .panelListContent{
128
-  width:100%;
129
-  margin: 30rpx 0 0 30rpx;
133
+  margin: 30rpx 0 30rpx 30rpx;
130 134
   font-size:24rpx;
131 135
   font-weight: 400;
132 136
 }
133 137
 
138
+
134 139
 .Item{
135 140
   width:100%;
136 141
   height:136rpx;
137 142
   justify-content: space-between;
138 143
 }
144
+
139 145
 .Item1{
140 146
   margin: 0 0 0 30rpx;
141 147
   align-items: flex-start;
@@ -145,6 +151,10 @@
145 151
   font-size:30rpx;
146 152
   font-weight: 400;
147 153
 }
154
+.ItemTitle11{
155
+  margin-left: 20rpx;
156
+}
157
+
148 158
 .ItemTitle2{
149 159
   font-size:24rpx;
150 160
   font-weight: 400;
@@ -190,6 +200,11 @@
190 200
   font-size:24rpx;
191 201
 }
192 202
 
203
+.footer{
204
+  width:100%;
205
+  height:100rpx;
206
+  background-color: #F0F0F0;
207
+}
193 208
 
194 209
 .numberContainer {
195 210
   width: 100%;

+ 387 - 26
pages/test/item.js

@@ -2,49 +2,243 @@ import common from '../../utils/util';
2 2
 import main from '../../utils/main';
3 3
 
4 4
 const app = getApp();
5
+var TaskList = [];
6
+
7
+var isPlaying = false;
8
+
9
+var innerAudioContext1;
10
+var timeoutPlayAudio;
11
+var tempPlayUrl = "";
12
+var tempPlayUrlLocal = "";
13
+var timeoutEveryCard = 0;
14
+var isFinished=0;
5 15
 
6 16
 Page({
7 17
   data: {
8 18
     IsSelect: true,
19
+    Color: { ID: 1 },
20
+  },
21
+  onReady: function () {
22
+    var that = this;
23
+    innerAudioContext1 = wx.createInnerAudioContext();
24
+    innerAudioContext1.onPlay(() => {
25
+      console.log('开始播放')
26
+    });
27
+    innerAudioContext1.onError((res) => {
28
+      console.log("innerAudioContext1.errMsg:" + res.errMsg);
29
+      console.log("innerAudioContext1.errCode:" + res.errCode);
30
+      that.audioCtx.setSrc(tempPlayUrl);
31
+      that.audioCtx.play();
32
+    });
33
+
34
+    this.audioCtx = wx.createAudioContext('myAudio');
9 35
 
10 36
   },
11 37
   onLoad: function (options) {
12 38
     var that = this;
13 39
     that.setData({
14
-      Containnerheight: main.getWindowHeight(),
15 40
       IsShowAnswer: [0, 0],
16
-      Color: main.getDetailColor(1),
41
+      Color: main.getDetailColor(app.globalData.ColorIndex),
42
+      Containnerheight: main.getWindowHeight(),
43
+    });
44
+
45
+    if (options.type)
46
+      that.init2(options);
47
+    else
48
+      that.init(options);
49
+
50
+    that.getColor();
51
+
52
+    isFinished = 0;
53
+
54
+    if (app.globalData.BaiduToken === "")
55
+      main.getBaiduToken();
56
+  },
57
+  
58
+  init: function (options) {
59
+    var that = this;
60
+    that.setData({
61
+      TaskInfo: {},
62
+      TestType: options.testtype,
63
+      TestName1: options.name1,
64
+      TestName2: options.name2,
17 65
     });
66
+    main.getData('GetHanziUnitWords?UnitID=' + options.unitsid, function (data) {
67
+      if (data) {
68
+        TaskList = [];
69
+        var words = data;
70
+        for (var k = 0; k < words.length; k++) {
71
+          var taskInfo = {
72
+            FontSize: 144,
73
+            Content: [
74
+              { ContentType: 0, Content: [] },
75
+              { ContentType: 1, Content: [] },
76
+              { ContentType: 2, Content: [] },
77
+            ]
78
+          };
79
+          taskInfo.Word=words[k].Name;
80
+          
81
+          var pinyinNormal = "(" + main.getPinyinNormal(words[k].Pinyin) + ")";
82
+          taskInfo.ReadString = words[k].Name + pinyinNormal + "," + words[k].CombineWords + "的" + words[k].Name + pinyinNormal;
18 83
 
19
-    var words = [];
20
-    var unitsName = "";
21
-    var arr = wx.getStorageSync("HanziAll");
22
-    arr = JSON.parse(arr);
23
-    var unitsid = Number(options.unitsid);
24
-    var id = Number(options.id);
25
-    for (var i = 0; i < arr.length; i++) {
26
-      if (arr[i].ID == unitsid) {
27
-        var list = arr[i].Units;
28
-        for (var j = 0; j < list.length; j++) {
29
-          if (list[j].ID == id) {
30
-            unitsName = list[j].Name;
31
-            words = list[j].Words;
84
+          if (that.data.TestType == "read") {
85
+            taskInfo.Content[0].Content = ["怎么念"];
86
+            var question = words[k].CombineWords;
87
+            question = common.ReplaceAllString(question, words[k].Name, "(" + words[k].Name + ")");
88
+            taskInfo.Content[1].Content = question;
89
+            
90
+            
91
+            var answer = "[读 src='" + taskInfo.ReadString + "']" + words[k].Pinyin + "[/读]";
92
+            taskInfo.Content[2].Content = answer;
93
+
94
+            if (words[k].CombineWords.length > 6) {
95
+              taskInfo.FontSize = 108;
96
+              if (words[k].CombineWords.length > 10) {
97
+                taskInfo.FontSize = 68;
98
+              }
99
+            }
32 100
           }
33
-        }
101
+          else if (that.data.TestType == "write") {
102
+            taskInfo.Content[0].Content = ["怎么写"];
34 103
 
35
-        var tags=["怎么写"];
36
-        if (options.category=="read")
37
-          tags = ["怎么念"];
104
+            var question = words[k].CombineWords;
105
+            var question2 = common.ReplaceAllString(question, words[k].Name, words[k].Pinyin);
106
+            
107
+            question = "[读 src='" + taskInfo.ReadString + "']" + question2 + "[/读]"
108
+            taskInfo.Content[1].Content = question;
109
+            var answer = words[k].Name;
110
+            answer += "[图 w='650' h='650']" + words[k].BiShunUrl + "[/图]";
111
+            taskInfo.Content[2].Content = answer;
38 112
 
113
+            if (question2.length > 6) {
114
+              taskInfo.FontSize = 108;
115
+              if (question2.length > 10) {
116
+                taskInfo.FontSize = 68;
117
+                if (question2.length > 14) {
118
+                  taskInfo.FontSize = 48;
119
+                }
120
+              }
121
+            }
122
+          }
123
+          taskInfo.ContentNew = main.changeStringToView(taskInfo.Content);
124
+          TaskList.push(taskInfo);
125
+        }
126
+
127
+        TaskList = common.randomArray(TaskList);
39 128
 
40 129
         that.setData({
41
-          UnitsName: unitsName,
42
-          Words: words,
43
-          Tags:tags,
130
+          TaskInfo: TaskList[0],
131
+          TaskLength: TaskList.length,
132
+          CurrentIndex: 0,
133
+        });
134
+
135
+        common.getStorageValue(that, "TestAutioPlay", 1, function () { 
136
+          if (that.data.TestAutioPlay == 1 && that.data.TestType == "write") {
137
+            that.playSound({ currentTarget: { dataset: { content: TaskList[that.data.CurrentIndex].ReadString } } })
138
+          }
44 139
         });
45
-        break;
140
+      }
141
+    });
142
+
143
+    
144
+  },
145
+  init2: function (options) {
146
+    var that = this;
147
+    var TestTask2=wx.getStorageSync("TestTask2");
148
+    var name = TestTask2.Name.split("#");
149
+    that.setData({
150
+      TaskInfo: {},
151
+      ID:TestTask2.ID,
152
+      TestType: TestTask2.TestType,
153
+      TestName1: name[0],
154
+      TestName2: name[1],
155
+    });
156
+
157
+    TestTask2.List = common.randomArray(TestTask2.List);
158
+
159
+    var list = [];
160
+    var i = 0;
161
+    for (var i = 0; i < TestTask2.List.length;i++){
162
+      if (TestTask2.List[i].Result){
163
+        list.push(TestTask2.List[i]);
164
+      }
165
+    }
166
+    var currentIndex=list.length;
167
+    for (var i = 0; i < TestTask2.List.length; i++) {
168
+      if (!TestTask2.List[i].Result) {
169
+        list.push(TestTask2.List[i]);
170
+      }
171
+    }
172
+    TaskList = list;
173
+
174
+    if (currentIndex >= TaskList.length || options.type=="restart"){
175
+      currentIndex=0;
176
+      for (var i = 0; i < TaskList.length; i++) {
177
+        delete TaskList[i].Result;
178
+      }
179
+    }
180
+
181
+    that.setData({
182
+      TaskLength: TaskList.length,
183
+      CurrentIndex: currentIndex,
184
+      TaskInfo: TaskList[currentIndex],
185
+    });
186
+
187
+    common.getStorageValue(that, "TestAutioPlay", 1, function () {
188
+      if (that.data.TestAutioPlay == 1 && that.data.TestType == "write") {
189
+        that.playSound({ currentTarget: { dataset: { content: TaskList[that.data.CurrentIndex].ReadString } } })
190
+      }
191
+    });
192
+
193
+  },
194
+  //进入下一张题卡
195
+  gotoNext: function (e) {
196
+    var that = this;
197
+    that.setData({
198
+      IsShowAnswer: [0, 0],
199
+    });
200
+
201
+    var btnnumber = e.currentTarget.dataset.btnnumber;
202
+    
203
+    if (btnnumber>="0"){
204
+      that.setSoundFile(0);
205
+      if (btnnumber==="4")
206
+        TaskList[that.data.CurrentIndex].Result = 1;
207
+      else if (btnnumber === "0")
208
+        TaskList[that.data.CurrentIndex].Result = -1;
209
+      else if (btnnumber === "1")
210
+        TaskList[that.data.CurrentIndex].Result = 0;
211
+      that.data.CurrentIndex++;
212
+    }
213
+    else{
214
+      that.setSoundFile(2);
215
+      TaskList[that.data.CurrentIndex].Result=null;
216
+      that.data.CurrentIndex--;
217
+    }
218
+    //结束
219
+    if (that.data.CurrentIndex>=TaskList.length){
220
+      isFinished = 1;
221
+      that.onFinished();
222
+    }
223
+    else if (that.data.CurrentIndex <0) {
224
+      wx.showToast({
225
+        title: '到开始了',
226
+      });
227
+      that.setSoundFile(-1);
228
+    }
229
+    else{
230
+      
231
+      that.setData({
232
+        TaskInfo: TaskList[that.data.CurrentIndex],
233
+        CurrentIndex: that.data.CurrentIndex,
234
+      });
235
+      if (that.data.TestAutioPlay == 1 && that.data.TestType == "write") {
236
+        that.playSound({ currentTarget: { dataset: { content: TaskList[that.data.CurrentIndex].ReadString } } })
46 237
       }
47 238
     }
239
+
240
+    //console.log(that.data.TestType);
241
+    //console.log(JSON.stringify(that.data.TaskInfo));
48 242
   },
49 243
   onPullDownRefresh: function () {
50 244
     var that = this;
@@ -54,10 +248,177 @@ Page({
54 248
     wx.stopPullDownRefresh();
55 249
   },
56 250
   onShowAnswer: function (e) {
57
-    var that=this;
58
-    that.setData({
59
-      IsShowAnswer: [1,1],
251
+    var that = this;
252
+    var clicktype = e.currentTarget.dataset.type;
253
+    if (!(clicktype && clicktype == "all" && app.globalData.ClickType == 0)) {
254
+      that.setData({
255
+        IsShowAnswer: [1, 1],
256
+      });
257
+
258
+      if (that.data.TestAutioPlay == 1 && that.data.TestType == "read") {
259
+        that.playSound({ currentTarget: { dataset: { content: TaskList[that.data.CurrentIndex].ReadString } } })
260
+      }
261
+    }
262
+  },
263
+  getColor: function () {
264
+    var that = this;
265
+    if (wx.setBackgroundColor) {
266
+      wx.setBackgroundColor({
267
+        backgroundColor: that.data.Color.BackColor,
268
+        backgroundColorTop: that.data.Color.BackColor,
269
+        backgroundColorBottom: that.data.Color.BackColor,
270
+      })
271
+    }
272
+    if (wx.setNavigationBarColor) {
273
+      wx.setNavigationBarColor({
274
+        frontColor: "#ffffff",
275
+        backgroundColor: that.data.Color.BackColor,
276
+      })
277
+    }
278
+  },
279
+  playSound: function (e) {
280
+    clearTimeout(timeoutPlayAudio);
281
+
282
+    var that = this;
283
+    var str = e.currentTarget.dataset.content;
284
+    var url;
285
+    if (str == "recorder") {
286
+      url = e.currentTarget.dataset.soundmark;
287
+    }
288
+    else if (str.indexOf("英 [") >= 0 || str.indexOf("美 [") >= 0) {
289
+      str = str.replace("英 [", "[");
290
+      str = str.replace("美 [", "[");
291
+      url = e.currentTarget.dataset.soundmark;
292
+    }
293
+    else if (e.currentTarget.dataset.soundmark && e.currentTarget.dataset.soundmark != "undefined") {
294
+      var soundmark = e.currentTarget.dataset.soundmark;
295
+      if (soundmark && soundmark.indexOf("http") < 0) {
296
+        url = app.globalData.audioUrlBaidu;
297
+        url = url.replace("[token]", app.globalData.BaiduToken);
298
+        url = url.replace("[word]", soundmark);
299
+      }
300
+      else {
301
+        url = soundmark;
302
+      }
303
+    }
304
+    else {
305
+      url = app.globalData.audioUrlBaidu;
306
+      url = url.replace("[token]", app.globalData.BaiduToken);
307
+      url = url.replace("[word]", str);
308
+    }
309
+
310
+
311
+    if (url.indexOf("http") > 0)
312
+      url = url.substr(url.indexOf("http"));
313
+    if (url.indexOf("'") > 0)
314
+      url = common.ReplaceAllString(url, "'", "");
315
+    url = url.replace("http://", "https://");
316
+
317
+    url = encodeURI(url);
318
+    if (!isPlaying || tempPlayUrl == "" || url != tempPlayUrl) {
319
+      isPlaying = true;
320
+      timeoutPlayAudio = setTimeout(function () {
321
+        isPlaying = false;
322
+      }, 60000);
323
+
324
+      wx.showLoading({
325
+        title: '音频下载中',
326
+        mask: true,
327
+      });
328
+      setTimeout(function () {
329
+        wx.hideLoading();
330
+      }, 30000);
331
+
332
+      wx.downloadFile({
333
+        url: url,
334
+        success(res) {
335
+          wx.hideLoading();
336
+          if (res.statusCode === 200) {
337
+            tempPlayUrlLocal = res.tempFilePath;
338
+            that.audioCtx.setSrc(res.tempFilePath);
339
+            that.audioCtx.play();
340
+            tempPlayUrl = url;
341
+          }
342
+        },
343
+        fail(err) {
344
+          wx.hideLoading();
345
+        }
346
+      });
347
+    }
348
+    else {
349
+      this.audioCtx.pause();
350
+      if (innerAudioContext1)
351
+        innerAudioContext1.stop();
352
+      isPlaying = false;
353
+    }
354
+  },
355
+  audioBindEnded: function () {
356
+    isPlaying = false;
357
+  },
358
+  audioBindError: function (err) {
359
+    console.log(err);
360
+    innerAudioContext1.src = tempPlayUrlLocal;
361
+    innerAudioContext1.play();
362
+
363
+    main.getBaiduToken();
364
+  },
365
+  setSoundFile: function (isFinish) { //isFinish=3搁置 =2撤退 =1结束 =0正常 =-1开始
366
+    var that = this;
367
+    var url = "/pages/sounds/";
368
+    if (isFinish == 1) {
369
+      url += "end.mp3";
370
+    } else if (isFinish == 2) {
371
+      url += "short3.mp3";
372
+    } else if (isFinish == 3) {
373
+      url += "short1.mp3";
374
+    } else {
375
+      url += "short2.mp3";
376
+    }
377
+    if (isFinish >= 0) {
378
+      innerAudioContext1.src = url;
379
+      innerAudioContext1.play();
380
+    }
381
+
382
+    wx.pageScrollTo({
383
+      scrollTop: 0,
384
+    });
385
+  },
386
+  onAutoPlay:function(e){
387
+    var id=e.currentTarget.dataset.id;
388
+    this.setData({
389
+      TestAutioPlay:id,
60 390
     });
391
+    wx.setStorageSync("TestAutioPlay",id);
392
+  },
393
+  //获取导航栏高度
394
+  getBarInfo(e) {
395
+    this.setData({ topBarHeight: e.detail.topBarHeight })
396
+  },
397
+  onFinished:function(){
398
+    if (TaskList.length > 0 && this.data.CurrentIndex > 0) {
399
+      var TestTask = {};
400
+      if (this.data.ID)
401
+        TestTask.ID=this.data.ID;
402
+      TestTask.TestType = this.data.TestType;
403
+      TestTask.IsFinished = isFinished;
404
+      TestTask.Name = this.data.TestName1 + "#" + this.data.TestName2;
405
+      TestTask.List = TaskList;
406
+      wx.setStorageSync("TestTask", TestTask);
407
+      wx.redirectTo({
408
+        url: './report?type=new',
409
+      });
410
+    }
411
+    else{
412
+      wx.navigateBack({
413
+        delta: 1,
414
+      });
415
+    }
416
+  },
417
+  onUnload:function(){
418
+    wx.removeStorageSync("TestTask2");
419
+    if (innerAudioContext1) {
420
+      innerAudioContext1.stop();
421
+    }
61 422
   },
62 423
   onShareAppMessage: function () {
63 424
     return {

+ 5 - 3
pages/test/item.json

@@ -1,7 +1,9 @@
1 1
 {
2 2
   "navigationBarTitleText": "检验中",
3
-  "navigationBarBackgroundColor": "#1F3C88",
4 3
   "navigationBarTextStyle": "white",
5
-  "backgroundColor": "#1F3C88",
6
-  "enablePullDownRefresh": true
4
+  "enablePullDownRefresh": true,
5
+  "usingComponents": {
6
+    "navigation-bar": "/components/navigation-bar/navigation-bar"
7
+  },
8
+  "navigationStyle": "custom"
7 9
 }

+ 31 - 13
pages/test/item.wxml

@@ -1,45 +1,61 @@
1 1
 <import src="../template/cardShow.wxml" />
2
-<view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
3
-  <view class="panelTop FlexRow">
2
+<navigation-bar title="检验中" bindgetBarInfo="getBarInfo" show="true" left="true" background="{{Color.BackColor}}" color="#fff">
3
+    <view slot="left" bindtap="onFinished">
4
+      <view class="square">提前退出</view>
5
+    </view>
6
+</navigation-bar>
7
+
8
+<view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;background-color:{{Color.BackColor}};' bindtap='onShowAnswer' data-type="all">
9
+  <view class="panelTop FlexColumn" style="background-color:{{Color.BackColor}}; top:{{topBarHeight*2-30}}rpx;">
10
+    <view class="panelTop2 FlexRow">
4 11
     <view class="left FlexRow">
5 12
       <view class="Number2 Number1 FlexColumn">
6
-        <view>1</view>
13
+        <view>{{CurrentIndex+1}}</view>
7 14
         <view class="line2 line1"></view>
8 15
       </view>
9 16
       <view class="Number1 FlexColumn">
10
-        <view>88</view>
17
+        <view>{{TaskLength}}</view>
11 18
         <view class="line1"></view>
12 19
       </view>
13 20
     </view>
14 21
     <view class="right FlexRow">
15
-      <view class="btnTop FlexRow">
22
+      <view class="btnTop FlexRow" catchtap='onAutoPlay' data-id="1" wx:if="{{TestAutioPlay==0}}">
23
+        <image src="../images/universalpic_broadcast_default_gray_34x25.png" class="universalpic_broadcast_default_gray_34x25" />
24
+      </view>
25
+      <view class="btnTop FlexRow" catchtap='onAutoPlay' data-id="0"  wx:if="{{TestAutioPlay==1}}">
26
+        <image src="../images/universalpic_broadcast_enable_tc0{{Color.ID}}_34x25.png" class="universalpic_broadcast_default_gray_34x25" />
27
+      </view>
28
+      
29
+      <view class="panelTopText">自动播报</view>
30
+      <view class="btnTop FlexRow" catchtap='gotoNext' data-btnnumber="1">
16 31
         <image src="../images/universalpic_shelve_gray_26x26.png" class="universalpic_shelve_gray_26x26" />
17 32
       </view>
18
-      <view class="btnTop FlexRow">
33
+      <view class="btnTop FlexRow" catchtap='gotoNext' data-btnnumber="-1" >
19 34
         <image src="../images/universalpic_undo_gray_26x20.png" class="universalpic_undo_gray_26x20" />
20 35
       </view>
21 36
     </view>
37
+    </view>
22 38
   </view>
23
-  <view style='width:100%;height:110rpx;'></view>
24
-  <template is="CardShow" data="{{Color:Color,Field:Field,Tags:Tags,IsShowAnswer:IsShowAnswer,TagWidth:TagWidth,FontSize:FontSize,LimitTimeStr:LimitTimeStr,ShowType:ShowType}}" />
25
-  <view style='width:100%;height:100rpx;'></view>
39
+  <view style='width:100%;height:120rpx;'></view>
40
+  <template is="CardShow" data="{{Color:Color,Field:TaskInfo.ContentNew.Field,Tags:TaskInfo.ContentNew.Tags,IsShowAnswer:IsShowAnswer,TagWidth:136,FontSize:TaskInfo.FontSize}}" />
41
+  <view style='width:100%;height:180rpx;'></view>
26 42
 
27 43
   <!-- 下方按钮 -->
28 44
   <image class="footerShade" src="../images/study_learning_bgimage_tc0{{Color.ID}}.png" />
29 45
   <view class='footer FlexColumn'>
30 46
     <image class="footerImage" src="../images/study_learning_maskimage_tc0{{Color.ID}}.png" />
31
-    <view class="panelFooter FlexColumn" hover-class='AnswerHover' wx:if="{{!IsShowAnswer[0] && !IsShowAnswer[1] && ClickType!=1}}" catchtouchstart="onShowAnswer">
47
+    <view class="panelFooter FlexColumn" hover-class='AnswerHover' wx:if="{{!IsShowAnswer[0] && !IsShowAnswer[1] && ClickType!=1}}" catchtap="onShowAnswer">
32 48
       看答案
33 49
     </view>
34 50
     <view class="panelFooter0 panelFooter FlexColumn" wx:if="{{IsShowAnswer[1]}}">
35 51
       <view class='panelBottomAnswer panelBottom FlexRow'>
36
-        <view class="AnswerLeft Answer FlexColumn" hover-class='AnswerHover' catchtap='gotoNext' data-time="{{TaskInfo.Number0}}" data-btnnumber="0">
52
+        <view class="AnswerLeft Answer FlexColumn" hover-class='AnswerHover' catchtap='gotoNext' data-btnnumber="0">
37 53
           <view class="btnTime">
38 54
             答错
39 55
           </view>
40 56
           <view class="Answer0 btnColor"></view>
41 57
         </view>
42
-        <view class="Answer FlexColumn" hover-class='AnswerHover' catchtap='gotoNext' data-time="{{TaskInfo.Number2}}" data-btnnumber="4">
58
+        <view class="Answer FlexColumn" hover-class='AnswerHover' catchtap='gotoNext' data-btnnumber="4">
43 59
           <view class="btnTime">
44 60
             答对
45 61
           </view>
@@ -48,4 +64,6 @@
48 64
       </view>
49 65
     </view>
50 66
   </view>
51
-</view>
67
+</view>
68
+
69
+<audio hidden='true' src="{{AudioSrc}}" id="myAudio" bindended="audioBindEnded" binderror="audioBindError"></audio>

+ 32 - 7
pages/test/item.wxss

@@ -1,15 +1,32 @@
1
-.container {
2
-  background-color: #1F3C88;
1
+page{
2
+  background-color: #D2D2D2;
3
+}
4
+
5
+.square{
6
+  background-color: #181A21;
7
+  width:136rpx;
8
+  line-height:53rpx;
9
+  text-align: center;
10
+  color: #fff;
11
+  border-radius:10rpx;
12
+  font-size:24rpx;
13
+  font-weight: 500;
3 14
 }
4 15
 
5 16
 .panelTop{
6 17
   width:100%;
7
-  height:110rpx;
18
+  height:140rpx;
19
+  justify-content: flex-end;
20
+  position: fixed;
21
+  top:100rpx;
22
+  z-index: 100;
23
+}
24
+
25
+.panelTop2{
26
+  width:100%;
27
+  height:120rpx;
8 28
   justify-content: space-between;
9 29
   color:#fff;
10
-  position: fixed;
11
-  top:0;
12
-  z-index: 10;
13 30
 }
14 31
 
15 32
 .left{
@@ -47,7 +64,15 @@
47 64
   background-color: rgba(0,0,0,0.1);
48 65
   margin-left: 30rpx;
49 66
 }
50
-
67
+.universalpic_broadcast_default_gray_34x25{
68
+  width:34rpx;
69
+  height:25rpx;
70
+}
71
+.panelTopText{
72
+  font-size: 20rpx;
73
+  color:#D2D2D2;
74
+  margin-left: 14rpx;
75
+}
51 76
 .universalpic_shelve_gray_26x26{
52 77
   width:26rpx;
53 78
   height:26rpx;

+ 114 - 30
pages/test/list.js

@@ -2,76 +2,160 @@ import common from '../../utils/util';
2 2
 import main from '../../utils/main';
3 3
 
4 4
 const app = getApp();
5
+var isClick = true;
5 6
 
6 7
 Page({
7 8
   data: {
8
-    IsSelect:false,
9
+    IsSelect: false,
10
+    ImagePath: app.globalData.uploadImageUrl,
9 11
   },
10
-  onLoad: function (options) {
12
+  onLoad: function(options) {
11 13
     var that = this;
12 14
     that.setData({
13 15
       Containnerheight: main.getWindowHeight(),
16
+      Name1: options.name1,
17
+    });
18
+    isClick = true;
19
+    main.getHanzi(function(arr) {
20
+      if (!arr) {
21
+        wx.removeStorageSync("HanziUpdateTime");
22
+        wx.removeStorageSync("HanziAll");
23
+        main.getHanzi(function(arr) {
24
+          that.init(options);
25
+        });
26
+      } else {
27
+        that.init(options);
28
+      }
29
+    });
30
+  },
31
+  init: function(options) {
32
+    var that = this;
33
+    var name = options.name1;
34
+    if (name.indexOf(" ") > 0)
35
+      name = name.substr(name.indexOf(" ") + 1);
36
+    wx.setNavigationBarTitle({
37
+      title: name
14 38
     });
15 39
     var arr = wx.getStorageSync("HanziAll");
40
+    var testReportList = wx.getStorageSync("UserTestReport");
16 41
     arr = JSON.parse(arr);
17
-    var id=Number(options.id);
18
-    for(var i=0;i<arr.length;i++){
19
-      if (arr[i].ID==id){
42
+    var id = Number(options.id);
43
+    for (var i = 0; i < arr.length; i++) {
44
+      if (arr[i].ID == id) {
20 45
         var list = arr[i].Units;
21
-        for (var j = 0; j < list.length;j++){
22
-          var str="";
23
-          for(var k=0;k<list[j].Words.length;k++){
24
-            if (k < 27 && k < list[j].Words.length-1)
25
-              str += list[j].Words[k].Name+"、";
26
-            else if (k == list[j].Words.length-1)
46
+        for (var j = 0; j < list.length; j++) {
47
+          var str = "";
48
+          for (var k = 0; k < list[j].Words.length; k++) {
49
+            if (k < 27 && k < list[j].Words.length - 1)
50
+              str += list[j].Words[k].Name + "、";
51
+            else if (k == list[j].Words.length - 1)
27 52
               str += list[j].Words[k].Name;
28
-            else{
29
-              str += list[j].Words[k].Name +"…";
53
+            else {
54
+              str += list[j].Words[k].Name + "…";
30 55
               break;
31 56
             }
32 57
           }
33 58
 
34
-          list[j].WordList=str;
59
+          list[j].WordList = str;
60
+          list[j].TestTypeReadFinished = true;
61
+          list[j].TestTypeWriteFinished = true;
62
+
63
+          for (var k = 0; k < testReportList.length; k++) {
64
+            if (testReportList[k].Name[0] == options.name1 &&
65
+              testReportList[k].Name[1] == list[j].Name) {
66
+
67
+
68
+              if (testReportList[k].TestType == "read") {
69
+                if (testReportList[k].IsFinished == 1)
70
+                  list[j].TestTypeRead = 1;
71
+
72
+                if ((testReportList[k].TestRight + testReportList[k].TestWrong + testReportList[k].TestSkip) < testReportList[k].TestTotal) {
73
+                  list[j].TestTypeReadFinished = false;
74
+                }
75
+
76
+                list[j].ReadReportID = testReportList[k].ID;
77
+              }
78
+              if (testReportList[k].TestType == "write") {
79
+                if (testReportList[k].IsFinished == 1)
80
+                  list[j].TestTypeWrite = 1;
81
+
82
+                if ((testReportList[k].TestRight + testReportList[k].TestWrong + testReportList[k].TestSkip) < testReportList[k].TestTotal) {
83
+                  list[j].TestTypeWriteFinished = false;
84
+                }
85
+
86
+                list[j].WriteReportID = testReportList[k].ID;
87
+              }
88
+            }
89
+          }
35 90
         }
36 91
         that.setData({
37
-          List:list,
38
-          UnitsID:id,
92
+          List: list,
93
+          UnitsID: id,
39 94
         });
40 95
       }
41 96
     }
42
-
43 97
   },
44
-  onShowFrame: function (e) {
45
-    var selectID,selectName;
46
-    var id=e.currentTarget.dataset.id;
47
-    for(var i=0;i<this.data.List.length;i++){
48
-      if (id==this.data.List[i].ID){
49
-        selectID=id;
50
-        selectName = this.data.List[i].Name;
98
+  onShowFrame: function(e) {
99
+    var selectItem;
100
+    var id = e.currentTarget.dataset.id;
101
+    for (var i = 0; i < this.data.List.length; i++) {
102
+      if (id == this.data.List[i].ID) {
103
+        selectItem = this.data.List[i];
51 104
       }
52 105
     }
53 106
     this.setData({
54 107
       IsSelect: true,
55
-      SelectID:selectID,
56
-      SelectName:selectName,
108
+      SelectItem: selectItem,
57 109
     });
58 110
   },
59
-  onClose: function () {
111
+  onClose: function() {
60 112
     this.setData({
61 113
       IsSelect: false,
62 114
     });
63 115
   },
64
-  goto: function (e) {
116
+  goto: function(e) {
65 117
     var url = e.currentTarget.dataset.url;
66 118
     wx.navigateTo({
67 119
       url: url,
68 120
     });
121
+    this.onClose();
122
+  },
123
+  gotoTestReportInfo: function(e) {
124
+    var that=this;
125
+    if (isClick) {
126
+      isClick=false;
127
+      setTimeout(function(){
128
+        isClick=true;
129
+      },2000);
130
+
131
+      var id = e.currentTarget.dataset.id;
132
+      var userid = app.globalData.userInfo.UserID;
133
+
134
+      if (id) {
135
+        var reporttype = e.currentTarget.dataset.type;
136
+        main.getData('GetTestReportInfo?UserID=' + userid + '&ID=' + id, function(data) {
137
+          if (data) {
138
+            wx.setStorageSync("TestTask2", data);
139
+            that.onClose();
140
+            wx.navigateTo({
141
+              url: "./item?type=" + reporttype,
142
+            });
143
+          }
144
+        });
145
+      } else {
146
+        that.onClose();
147
+        var url = e.currentTarget.dataset.url;
148
+        wx.navigateTo({
149
+          url: url,
150
+        });
151
+      }
152
+    }
69 153
   },
70
-  onShareAppMessage: function () {
154
+  onShareAppMessage: function() {
71 155
     return {
72 156
       title: app.globalData.ShareTitle,
73 157
       path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
74 158
       imageUrl: app.globalData.ShareImage,
75 159
     }
76 160
   },
77
-})
161
+})

+ 3 - 1
pages/test/list.json

@@ -1,3 +1,5 @@
1 1
 {
2
-  "navigationBarTitleText": "语文识字 上学期"
2
+  "navigationBarTitleText": "语文识字",
3
+  "backgroundColorTop": "#f0f0f0",
4
+  "backgroundColorBottom": "#f0f0f0"
3 5
 }

+ 39 - 11
pages/test/list.wxml

@@ -5,7 +5,7 @@
5 5
       <view class="PanelItem1 FlexRow">
6 6
         <view class="left FlexRow">
7 7
           <view class="Word FlexRow">
8
-            {{item.Words[0].Name}}
8
+            <image class="img" src="{{ImagePath}}web/test/{{item.Words[0].Name}}.png" />
9 9
           </view>
10 10
           <view class="Title FlexRow">
11 11
             {{item.Name}}
@@ -13,8 +13,10 @@
13 13
         </view>
14 14
         <view class="right FlexColumn">
15 15
           <view class="right1 FlexRow">
16
-            <image class="examine_willread_gray_22x22" src="../images/examine_willread_gray_22x22.png"></image>
17
-            <image class="examine_willwrite_green_22x22" src="../images/examine_willwrite_green_22x22.png"></image>
16
+            <image wx:if="{{item.TestTypeRead==1}}" class="examine_willread_gray_22x22" src="../images/examine_willread_green_22x22.png"></image>
17
+            <image wx:if="{{!item.TestTypeRead}}" class="examine_willread_gray_22x22" src="../images/examine_willread_gray_22x22.png"></image>
18
+            <image wx:if="{{item.TestTypeWrite==1}}" class="examine_willwrite_gray_22x22" src="../images/examine_willwrite_green_22x22.png"></image>
19
+            <image wx:if="{{!item.TestTypeWrite}}" class="examine_willwrite_gray_22x22" src="../images/examine_willwrite_gray_22x22.png"></image>
18 20
           </view>
19 21
           <view class="right2">{{item.Words.length}}个字</view>
20 22
         </view>
@@ -22,7 +24,7 @@
22 24
       <view class="lineWidthAll FlexRow">
23 25
         <view class="lineWidth720"></view>
24 26
       </view>
25
-      <text class="PanelItem2 FlexRow">
27
+      <text class="PanelItem2">
26 28
         {{item.WordList}}
27 29
       </text>
28 30
     </view>
@@ -35,23 +37,49 @@
35 37
 <view wx:if="{{IsSelect}}" class="SelectContainer FlexColumn" style='height:{{Containnerheight}}rpx;'>
36 38
   <view class="SelectContainer1 FlexColumn">
37 39
     <image src="../images/examine_subjecticon_01.png" class="examine_subjecticon_01" />
38
-    <view class="SelectContainer1Text1">{{SelectName}}</view>
40
+    <view class="SelectContainer1Text1">{{SelectItem.Name}}</view>
39 41
     <view class="SelectContainer1Text2">检验哪个方面</view>
42
+
43
+    <view class="btnPanel0 FlexRow" bindtap="goto" data-url="./wordlist?unitsid={{UnitsID}}&id={{SelectItem.ID}}">
44
+      <image src="../images/universalpic_word_blue_30x30.png" class="universalpic_word_blue_30x30" />
45
+      <view class="SelectContainer1Text4">查看字表</view>
46
+    </view>
47
+
40 48
     <view class="btnPanel FlexRow">
41
-      <view class="btn FlexRow" bindtap="goto" data-url="./item?category=read&unitsid={{UnitsID}}&id={{SelectID}}">
49
+      <view wx:if="{{SelectItem.TestTypeReadFinished}}" class="btn FlexRow" bindtap="gotoTestReportInfo" data-id="{{SelectItem.ReadReportID}}" data-url="./item?testtype=read&unitsid={{SelectItem.ID}}&name1={{Name1}}&name2={{SelectItem.Name}}">
42 50
         <image src="../images/examine_willread_gray_30x30.png" class="examine_willread_gray_30x30" />
43 51
         <view class="SelectContainer1Text3">会念</view>
44 52
       </view>
45
-      <view class="btn FlexRow" bindtap="goto" data-url="./item?category=write&unitsid={{UnitsID}}&id={{SelectID}}">
53
+      
54
+      <view wx:if="{{!SelectItem.TestTypeReadFinished}}" class="btn FlexRow" bindtap="gotoTestReportInfo" data-id="{{SelectItem.ReadReportID}}" data-type="continue">
55
+        <image src="../images/examine_willread_green_30x30.png" class="examine_willread_gray_30x30" />
56
+        <view class="SelectContainer1Text3">会念 继续检验</view>
57
+      </view>
58
+      
59
+      <view wx:if="{{SelectItem.TestTypeWriteFinished}}" class="btn FlexRow" bindtap="gotoTestReportInfo" data-id="{{SelectItem.WriteReportID}}" data-url="./item?testtype=write&unitsid={{SelectItem.ID}}&name1={{Name1}}&name2={{SelectItem.Name}}">
46 60
         <image src="../images/examine_willwrite_gray_27x27.png" class="examine_willwrite_gray_27x27" />
47 61
         <view class="SelectContainer1Text3">会写</view>
48 62
       </view>
49
-    </view>
50
-    <view class="btnPanel FlexRow" bindtap="goto" data-url="./wordlist?unitsid={{UnitsID}}&id={{SelectID}}">
51
-      <image src="../images/universalpic_word_blue_30x30.png" class="universalpic_word_blue_30x30" />
52
-      <view class="SelectContainer1Text4">查看字表</view>
63
+
64
+      <view wx:if="{{!SelectItem.TestTypeWriteFinished}}" class="btn FlexRow" bindtap="gotoTestReportInfo" data-id="{{SelectItem.WriteReportID}}" data-type="continue">
65
+        <image src="../images/examine_willwrite_green_27x27.png" class="examine_willwrite_gray_27x27" />
66
+        <view class="SelectContainer1Text3">会写 继续检验</view>
67
+      </view>
68
+      
53 69
     </view>
54 70
 
71
+    <view class="btnPanel2 FlexRow">
72
+      <view wx:if="{{SelectItem.TestTypeReadFinished}}" class="btnPanel21"></view>
73
+      <view wx:if="{{!SelectItem.TestTypeReadFinished}}" class="btnPanel21" bindtap="gotoTestReportInfo" data-id="{{SelectItem.ReadReportID}}"  data-type="restart" >
74
+        重新开始
75
+      </view>
76
+
77
+      <view wx:if="{{SelectItem.TestTypeWriteFinished}}" class="btnPanel21"></view>
78
+      <view wx:if="{{!SelectItem.TestTypeWriteFinished}}" class="btnPanel21" bindtap="gotoTestReportInfo" data-id="{{SelectItem.WriteReportID}}"  data-type="restart">
79
+        重新开始
80
+      </view>
81
+    </view>
82
+    
55 83
     <view class="close FlexRow" bindtap="onClose">
56 84
       <image src="../images/universalpic_close_black_24x24.png" class="universalpic_close_black_24x24" />
57 85
     </view>

+ 28 - 2
pages/test/list.wxss

@@ -49,14 +49,17 @@
49 49
 .right1{
50 50
   margin-bottom: 15rpx;
51 51
 }
52
-
52
+.img{
53
+  width:70rpx;
54
+  height:70rpx;
55
+}
53 56
 .examine_willread_gray_22x22{
54 57
   width:22rpx;
55 58
   height:22rpx;
56 59
   margin-right: 20rpx;
57 60
 }
58 61
 
59
-.examine_willwrite_green_22x22{
62
+.examine_willwrite_gray_22x22{
60 63
   width:22rpx;
61 64
   height:22rpx;
62 65
 }
@@ -88,16 +91,19 @@
88 91
   border-radius: 10rpx;
89 92
   background-color: #F8F8F8;
90 93
   position: relative;
94
+  justify-content: flex-start;
91 95
 }
92 96
 
93 97
 .examine_subjecticon_01{
94 98
   width:80rpx;
95 99
   height:80rpx;
100
+  margin-top: 80rpx;
96 101
 }
97 102
 
98 103
 .SelectContainer1Text1{
99 104
   font-size:36rpx;
100 105
   margin-top: 20rpx;
106
+  font-weight: 500;
101 107
 }
102 108
 
103 109
 .SelectContainer1Text2{
@@ -109,12 +115,18 @@
109 115
   font-size:36rpx;
110 116
   margin-left: 10rpx;
111 117
   color:#787878;
118
+  font-weight: 500;
112 119
 }
113 120
 
114 121
 .btnPanel{
115 122
   margin-top: 60rpx;
116 123
 }
117 124
 
125
+.btnPanel0{
126
+  margin-top: 20rpx;
127
+}
128
+
129
+
118 130
 .btn{
119 131
   width:315rpx;
120 132
   height:110rpx;
@@ -143,6 +155,20 @@
143 155
   font-size:24rpx;
144 156
   margin-left: 10rpx;
145 157
   color:#0071EF;
158
+  font-weight: 500;
159
+}
160
+
161
+
162
+.btnPanel2{
163
+  margin-top: 30rpx;
164
+}
165
+.btnPanel21{
166
+  width:315rpx;
167
+  margin: 0 10rpx;
168
+  text-align: center;
169
+  color:#0071EF;
170
+  font-size:28rpx;
171
+  font-weight: 500;
146 172
 }
147 173
 
148 174
 .close{

+ 215 - 0
pages/test/report.js

@@ -2,16 +2,231 @@ import common from '../../utils/util';
2 2
 import main from '../../utils/main';
3 3
 
4 4
 const app = getApp();
5
+var intervalBuild = 0;
6
+var TestReportID = 0;
5 7
 
6 8
 Page({
7 9
   data: {
8 10
     IsSelect: true,
11
+    IsBuild: 0,
12
+    IsIPhoneX: app.globalData.IsIPhoneX,
9 13
   },
10 14
   onLoad: function (options) {
11 15
     var that = this;
12 16
     that.setData({
17
+      ReportType:options.type,
13 18
       Containnerheight: main.getWindowHeight(),
14 19
     });
20
+
21
+    that.init();
22
+  },
23
+  init: function () {
24
+    var that = this;
25
+    var TestTask = wx.getStorageSync("TestTask");
26
+    var list = TestTask.List;
27
+    var listRight = [];
28
+    var listSkip = [];
29
+    var listWrong = [];
30
+    if (list) {
31
+      for (var i = 0; i < list.length; i++) {
32
+        if (list[i].Result == 1) {
33
+          listRight.push(list[i]);
34
+        }
35
+        else if (list[i].Result == -1) {
36
+          listWrong.push(list[i]);
37
+        }
38
+        else if (list[i].Result == 0) {
39
+          listSkip.push(list[i]);
40
+        }
41
+      }
42
+
43
+      var result = [];
44
+      if (listWrong.length > 0) {
45
+        result.push({ Name: "答错的题目", Expand: 1, List: listWrong });
46
+        if (listSkip.length > 0)
47
+          result.push({ Name: "跳过的题目", Expand: 1, List: listSkip });
48
+        if (listRight.length > 0)
49
+          result.push({ Name: "答对的题目", Expand: 1, List: listRight });
50
+      }
51
+      else {
52
+        if (listSkip.length > 0) {
53
+          result.push({ Name: "跳过的题目", Expand: 1, List: listSkip });
54
+          if (listRight.length > 0)
55
+            result.push({ Name: "答对的题目", Expand: 1, List: listRight });
56
+        }
57
+        else {
58
+          if (listRight.length > 0)
59
+            result.push({ Name: "答对的题目", Expand: 1, List: listRight });
60
+        }
61
+      }
62
+
63
+      var name = "";
64
+      if (TestTask.Name && TestTask.Name.indexOf("#")>0){
65
+        name=TestTask.Name;
66
+        name=name.substr(name.indexOf("#")+1);
67
+        if (TestTask.TestType=="read")
68
+          name+=" 会念";
69
+        else
70
+          name+=" 会写";
71
+      }
72
+
73
+      that.setData({
74
+        NumberWrong: listWrong.length,
75
+        NumberSkip: listSkip.length,
76
+        NumberRight: listRight.length,
77
+        Name: name,
78
+        List: result,
79
+        NumberTotal: list.length,
80
+      });
81
+
82
+      if (that.data.ReportType=="new")
83
+        that.saveInfo();
84
+
85
+      wx.setNavigationBarTitle({
86
+        title: "报告"
87
+      });
88
+    }
89
+
90
+  },
91
+  expandPanel: function (e) {
92
+    var that = this;
93
+    var index = e.currentTarget.dataset.index;
94
+    if (that.data.List[index].Expand == "1")
95
+      that.data.List[index].Expand = "0";
96
+    else
97
+      that.data.List[index].Expand = "1";
98
+    that.setData({
99
+      List: that.data.List,
100
+    });
101
+  },
102
+  onSelectItem: function (e) {
103
+    var that = this;
104
+    var index = e.currentTarget.dataset.index;
105
+    var word = e.currentTarget.dataset.word;
106
+    for (var i = 0; i < that.data.List[index].List.length; i++) {
107
+      if (that.data.List[index].List[i].Word == word) {
108
+        if (that.data.List[index].List[i].Css == "Select") {
109
+          that.data.List[index].List[i].Css = "";
110
+          that.setData({
111
+            List: that.data.List,
112
+          });
113
+        }
114
+        else if (that.data.List[index].List[i].Css == "Select2") {
115
+          wx.showToast({
116
+            title: '已经生成过了',
117
+            image: "../images/universalpic_ribbon_white_96x120.png",
118
+          });
119
+        }
120
+        else {
121
+          that.data.List[index].List[i].Css = "Select";
122
+          that.setData({
123
+            List: that.data.List,
124
+          });
125
+        }
126
+        break;
127
+      }
128
+    }
129
+
130
+  },
131
+  buildCard: function () {
132
+    var that = this;
133
+    var arr = [];
134
+    for (var i = 0; i < that.data.List.length; i++) {
135
+      for (var j = 0; j < that.data.List[i].List.length; j++) {
136
+        if (that.data.List[i].List[j].Css === "Select") {
137
+          var item = that.data.List[i].List[j];
138
+          var obj = {};
139
+          obj.Field1 = item.Content[1].Content;
140
+          obj.Field2 = item.Content[2].Content;
141
+          obj.Field3 = "";
142
+          obj.Tags = item.Content[0].Content;
143
+          obj.IsTodayStudy = 0;
144
+          obj.ID = 0;
145
+          obj.LimitTime = common.formatTime(new Date());
146
+          obj.FontSize = item.FontSize;
147
+          arr.push(obj);
148
+        }
149
+      }
150
+    }
151
+    //console.log(arr);
152
+
153
+    if (arr.length > 0) {
154
+      that.setData({
155
+        IsBuild: 1,
156
+      });
157
+      var buildCardNumber = 0;
158
+      intervalBuild = setInterval(function () {
159
+        that.addCard(arr[buildCardNumber]);
160
+        buildCardNumber++;
161
+        that.setData({
162
+          BuildCardNumber: Math.round(100 * buildCardNumber / arr.length) + "%",
163
+        });
164
+        if (buildCardNumber >= arr.length) {
165
+          clearInterval(intervalBuild);
166
+          that.setData({
167
+            IsBuild: 2,
168
+          });
169
+        }
170
+      }, 500);
171
+    }
172
+    else {
173
+      wx.showToast({
174
+        title: '先选题目',
175
+        image: "../images/universalpic_wrong_white_120x120.png",
176
+      });
177
+    }
178
+
179
+  },
180
+  addCard: function (card) {
181
+    var userid = app.globalData.userInfo.UserID;
182
+    main.postData('AddMiaoguoCard?Type=add&UserID=' + userid, card, function (data) {
183
+
184
+    });
185
+  },
186
+  close: function (e) {
187
+    wx.removeStorageSync("TestTask");
188
+    var delta=2;
189
+    if (this.data.ReportType=="edit")
190
+      delta=1;
191
+    wx.navigateBack({
192
+      delta: delta,
193
+    });
194
+  },
195
+  saveInfo: function () {
196
+    var that = this;
197
+    clearInterval(intervalBuild);
198
+    var userid = app.globalData.userInfo.UserID;
199
+    var param1 = wx.getStorageSync("TestTask");
200
+    param1.TestRight = this.data.NumberRight;
201
+    param1.TestWrong = this.data.NumberWrong;
202
+    param1.TestSkip = this.data.NumberSkip;
203
+    param1.TestTotal = param1.List.length;
204
+    param1.List = JSON.stringify(param1.List);
205
+    main.postData('InsertTestReport?UserID=' + userid, param1, function (data) {
206
+      if (data)
207
+        TestReportID = data;
208
+    });
209
+  },
210
+  gotoReport: function (e) {
211
+    if ((this.data.NumberRight + this.data.NumberWrong + this.data.NumberSkip) >= this.data.NumberTotal) {
212
+      wx.showToast({
213
+        title: '已经完成!',
214
+        image: "../images/universalpic_wrong_white_120x120.png",
215
+      });
216
+    }
217
+    else {
218
+      var testTask = wx.getStorageSync("TestTask");
219
+      if (TestReportID)
220
+        testTask.ID = TestReportID;
221
+      wx.setStorageSync("TestTask2", testTask);
222
+      var url = "./item?type=edit";
223
+      wx.redirectTo({
224
+        url: url,
225
+      });
226
+    }
227
+  },
228
+  onUnload: function () {
229
+    wx.removeStorageSync("TestTask");
15 230
   },
16 231
   onShareAppMessage: function () {
17 232
     return {

+ 41 - 55
pages/test/report.wxml

@@ -1,65 +1,51 @@
1 1
 <view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
2 2
   <view class="panelTop FlexColumn">
3
-    <view class="text1">答错3个 跳过1个</view>
3
+    <view class="text0">{{Name}}</view>
4
+    <view class="text1">答对{{NumberRight}}个 答错{{NumberWrong}}个 跳过{{NumberSkip}}个</view>
4 5
     <view class="text2">选择题目可一键生成题卡</view>
5 6
   </view>
6
-  <view class="panelItem FlexRow">
7
-    <view class="panelItem1 FlexRow">
8
-      <view class="text3">答错的题目</view>
9
-      <image src="../images/universalpic_indicator_right_gray.png" class="universalpic_indicator_right_gray" />
10
-    </view>
11
-    <view class="btn2 btn FlexRow">
12
-      <image src="../images/universalpic_checked_white_22x17.png" class="universalpic_checked_white_22x17" />
13
-      <view class="text4">秒过</view>
14
-    </view>
15
-    <view class="btn FlexRow">
16
-      <view class="circle"></view>
17
-      <view class="text4">五彩缤纷</view>
18
-    </view>
19
-    <view class="btn FlexRow">
20
-      <view class="circle"></view>
21
-      <view class="text4">五彩缤纷</view>
22
-    </view>
23
-    <view class="btn FlexRow">
24
-      <view class="circle"></view>
25
-      <view class="text4">五彩缤纷</view>
26
-    </view>
27
-    <view class="btn FlexRow">
28
-      <view class="circle"></view>
29
-      <view class="text4">五彩缤纷</view>
30
-    </view>
31
-    <view class="btn FlexRow">
32
-      <view class="circle"></view>
33
-      <view class="text4">五彩缤纷</view>
34
-    </view>
35
-    <view class="btn FlexRow">
36
-      <view class="circle"></view>
37
-      <view class="text4">五彩缤纷</view>
38
-    </view>
39
-    <view class="btn FlexRow">
40
-      <view class="circle"></view>
41
-      <view class="text4">五彩缤纷</view>
42
-    </view>
43
-    <view class="btn FlexRow">
44
-      <view class="circle"></view>
45
-      <view class="text4">五彩缤纷</view>
46
-    </view>
47
-    
7
+  <view class="panelItem FlexRow" wx:for="{{List}}" wx:key="index">
8
+    <view class="panelItem1 FlexRow" bindtap="expandPanel" data-index="{{index}}">
9
+      <view class="text3">{{item.Name}}</view>
10
+      <image src="../images/universalpic_indicator_right_gray.png" class="universalpic_indicator_right_gray" wx:if="{{item.Expand=='1'}}" />
11
+      <image src="../images/universalpic_indicator_right_gray.png" class="universalpic_indicator_right_gray2" wx:if="{{item.Expand=='0'}}" />
12
+    </view>
13
+    <block wx:if="{{item.Expand==1}}">
14
+      <view class="btn{{itemChild.Css}} FlexRow" wx:for="{{item.List}}" wx:key="indexChild" wx:for-item="itemChild" wx:for-index="intexChild" bindtap="onSelectItem" data-index="{{index}}" data-word="{{itemChild.Word}}">
15
+        <image wx:if="{{itemChild.Css=='Select'}}" src="../images/universalpic_checked_white_22x17.png" class="universalpic_checked_white_22x17" />
16
+        <image wx:if="{{itemChild.Css=='Select2'}}" src="../images/universalpic_bookmark_blue_40x40.png" class="universalpic_bookmark_blue_40x40" />
17
+        <view wx:if="{{!itemChild.Css}}" class="circle"></view>
18
+        <view class="text4">{{itemChild.Word}}</view>
19
+      </view>
20
+    </block>
48 21
   </view>
22
+  <view style="height:150rpx;"></view>
23
+  <view class="panelFooter FlexColumn">
24
+    <view class="panelFooter0 FlexRow">
25
+      <view class="btn4 btn3 btn FlexRow" bindtap="close">
26
+        关闭
27
+      </view>
28
+      <view class="btn4 btn3 btn FlexRow" bindtap="gotoReport">
29
+        继续检验
30
+      </view>
31
+      <view class="btn3 btn FlexRow" bindtap="buildCard">
32
+        生成题卡
33
+      </view>
49 34
 
50
-  <view class="panelItem FlexRow">
51
-    <view class="panelItem1 FlexRow">
52
-      <view class="text3">跳过的题目</view>
53
-      <image src="../images/universalpic_indicator_right_gray.png" class="universalpic_indicator_right_gray2" />
54 35
     </view>
55
-  </view>
56 36
 
57
-  <view class="panelFooter FlexRow">
58
-    <view class="btn3 btn FlexRow">
59
-      生成题卡
60
-    </view>
61
-    <view class="btn4 btn3 btn FlexRow">
62
-      关闭
63
-    </view>
37
+    <view class="iphone10plus" wx:if="{{IsIPhoneX}}"></view>
64 38
   </view>
39
+
40
+</view>
41
+
42
+<!-- 生成页面 -->
43
+<view wx:if="{{IsBuild>0}}" class="buildContainer FlexColumn" style='height:{{Containnerheight}}rpx;'>
44
+  <image src="../images/examine_clipboard_200x200.png" class="examine_clipboard_200x200" />
45
+
46
+  <view wx:if="{{IsBuild==1}}" class="buildText1">生成中……{{BuildCardNumber}}</view>
47
+  <block wx:if="{{IsBuild==2}}">
48
+    <view class="buildText1">生成完毕</view>
49
+    <view class="buildBtn" bindtap="close">关闭</view>
50
+  </block>
65 51
 </view>

+ 82 - 5
pages/test/report.wxss

@@ -2,10 +2,17 @@
2 2
   width:100%;
3 3
   align-items: flex-start;
4 4
 }
5
-.text1{
5
+.text0{
6 6
   margin-top: 50rpx;
7 7
   margin-left: 30rpx;
8 8
   font-size:32rpx;
9
+  font-weight: 400;
10
+}
11
+.text1{
12
+  margin-top: 10rpx;
13
+  margin-left: 30rpx;
14
+  font-size:32rpx;
15
+  font-weight: 500;
9 16
 }
10 17
 .text2{
11 18
   margin-bottom: 30rpx;
@@ -22,6 +29,7 @@
22 29
   flex-wrap: wrap;
23 30
   margin-bottom: 50rpx;
24 31
   padding-bottom: 40rpx;
32
+  border-bottom: 1rpx solid #d2d2d2;
25 33
 }
26 34
 
27 35
 .panelItem1{
@@ -53,6 +61,7 @@
53 61
 }
54 62
 
55 63
 .btn{
64
+  min-width: 88rpx;
56 65
   border:1rpx solid #9B9B9B;
57 66
   height:100rpx;
58 67
   border-radius: 10rpx;
@@ -61,12 +70,28 @@
61 70
   color:#1e1e1e;
62 71
 }
63 72
 
64
-.btn2{
73
+.btnSelect{
74
+  min-width: 88rpx;
75
+  height:100rpx;
76
+  border-radius: 10rpx;
77
+  margin: 30rpx 0 0 30rpx;
78
+  padding: 0 30rpx;
79
+
65 80
   border:1rpx solid #0071EF;
66 81
   background-color: #0071EF;
67 82
   color:#fff;
68 83
 }
69 84
 
85
+.btnSelect2{
86
+  min-width: 88rpx;
87
+  border:1rpx solid #9B9B9B;
88
+  height:100rpx;
89
+  border-radius: 10rpx;
90
+  margin: 30rpx 0 0 30rpx;
91
+  padding: 0 30rpx;
92
+  color:#1e1e1e;
93
+}
94
+
70 95
 .circle{
71 96
   width:34rpx;
72 97
   height:34rpx;
@@ -80,6 +105,11 @@
80 105
   height:17rpx;
81 106
 }
82 107
 
108
+.universalpic_bookmark_blue_40x40{
109
+  width:40rpx;
110
+  height:40rpx;
111
+}
112
+
83 113
 .text4{
84 114
   margin-left: 20rpx;
85 115
   font-size:28rpx;
@@ -88,23 +118,70 @@
88 118
 
89 119
 .panelFooter{
90 120
   width:100%;
91
-  height:120rpx;
92 121
   background-color: #fff;
93 122
   position: fixed;
94 123
   z-index: 10;
95 124
   bottom:0;
125
+  border-top: 1rpx solid #d2d2d2;
126
+}
127
+
128
+.panelFooter0{
129
+  width:100%;
130
+  height:120rpx;
131
+  background-color: #fff;
132
+}
133
+
134
+.iphone10plus{
135
+  width:100%;
136
+  height:30rpx;
137
+  background-color: #fff;
96 138
 }
97 139
 
140
+
98 141
 .btn3{
99
-  width:270rpx;
142
+  width:223rpx;
100 143
   height:80rpx;
101 144
   color:#0071EF;
102 145
   font-size:32rpx;
103 146
   text-align: center;
104 147
   line-height: 80rpx;
105
-  margin: 0 15rpx;
148
+  margin: 0 10rpx;
149
+  padding: 0;
106 150
 }
107 151
 
108 152
 .btn4{
109 153
   color:#1e1e1e;
154
+  font-weight: 400;
155
+}
156
+
157
+.buildContainer{
158
+  position: fixed;
159
+  width:100%;
160
+  top:0;
161
+  z-index: 10;
162
+  background-color: #fff;
163
+  justify-content: flex-start;
164
+  color:#1e1e1e;
165
+}
166
+
167
+.examine_clipboard_200x200{
168
+  width:200rpx;
169
+  height:200rpx;
170
+  margin-top: 150rpx;
171
+}
172
+
173
+.buildText1{
174
+  font-size: 54rpx;
175
+  margin-top: 170rpx;
176
+  font-weight: 500;
110 177
 }
178
+.buildBtn{
179
+  width:600rpx;
180
+  border:1rpx solid #9B9B9B;
181
+  text-align: center;
182
+  line-height: 90rpx;
183
+  font-size:36rpx;
184
+  margin-top: 40rpx;
185
+  font-weight: 500;
186
+  border-radius: 14rpx;
187
+}

+ 6 - 4
project.config.json

@@ -6,10 +6,13 @@
6 6
 	"setting": {
7 7
 		"urlCheck": false,
8 8
 		"es6": true,
9
+		"enhance": true,
9 10
 		"postcss": true,
11
+		"preloadBackgroundData": false,
10 12
 		"minified": true,
11 13
 		"newFeature": true,
12 14
 		"autoAudits": false,
15
+		"scopeDataCheck": true,
13 16
 		"uglifyFileName": false,
14 17
 		"checkInvalidKey": true,
15 18
 		"checkSiteMap": true,
@@ -18,8 +21,7 @@
18 21
 			"ignore": [],
19 22
 			"disablePlugins": [],
20 23
 			"outputPath": ""
21
-		},
22
-		"enhance": true
24
+		}
23 25
 	},
24 26
 	"compileType": "miniprogram",
25 27
 	"libVersion": "2.7.3",
@@ -108,12 +110,12 @@
108 110
 					"id": 7,
109 111
 					"name": "pages/test/index",
110 112
 					"pathName": "pages/test/index",
111
-					"query": "id=1",
113
+					"query": "",
112 114
 					"scene": null
113 115
 				},
114 116
 				{
115 117
 					"id": 8,
116
-					"name": "/pages/index/index",
118
+					"name": "绑定",
117 119
 					"pathName": "pages/index/index",
118 120
 					"query": "type=bebound&ParentUserID=2&NickName=一二",
119 121
 					"scene": 1007

+ 58 - 18
utils/main.js

@@ -1,6 +1,7 @@
1 1
 import common from '../utils/util';
2
+
2 3
 var app = getApp();
3
-var dataSendTimeout=0;
4
+var dataSendTimeout = 0;
4 5
 
5 6
 function getData(url, callback) {
6 7
   if (!app.globalData.IsProduction)
@@ -405,7 +406,7 @@ function changeStringToView(field) {
405 406
                     }
406 407
                   }
407 408
                 }
408
-                else{
409
+                else {
409 410
                   content.push({
410 411
                     key: "normal",
411 412
                     value: temp,
@@ -413,7 +414,7 @@ function changeStringToView(field) {
413 414
                   temp = "";
414 415
                 }
415 416
               }
416
-              else{
417
+              else {
417 418
                 content.push({
418 419
                   key: "normal",
419 420
                   value: temp,
@@ -421,8 +422,8 @@ function changeStringToView(field) {
421 422
                 temp = "";
422 423
               }
423 424
 
424
-              if (temp.length > 0 && ( num1>=0 || num2>=0 )){
425
-                if ((num1 < num2 && num1 >= 0 && num2 >= 0) || (num1>=0 && num2 < 0) ) {
425
+              if (temp.length > 0 && (num1 >= 0 || num2 >= 0)) {
426
+                if ((num1 < num2 && num1 >= 0 && num2 >= 0) || (num1 >= 0 && num2 < 0)) {
426 427
                   temp = temp.substr(temp.indexOf("[线]") + 3);
427 428
 
428 429
                   temp1 = temp.substring(0, temp.indexOf("[/线]"));
@@ -435,7 +436,7 @@ function changeStringToView(field) {
435 436
 
436 437
                   temp = temp.substr(temp.indexOf("[/线]") + 4);
437 438
                 }
438
-                else if ((num1 > num2 && num1 >= 0 && num2 >= 0) || (num1 < 0 && num2>=0)) {
439
+                else if ((num1 > num2 && num1 >= 0 && num2 >= 0) || (num1 < 0 && num2 >= 0)) {
439 440
                   temp = temp.substr(temp.indexOf("[光]") + 3);
440 441
 
441 442
                   temp1 = temp.substring(0, temp.indexOf("[/光]"));
@@ -449,11 +450,11 @@ function changeStringToView(field) {
449 450
                   temp = temp.substr(temp.indexOf("[/光]") + 4);
450 451
                 }
451 452
                 else
452
-                  temp="";
453
+                  temp = "";
453 454
               }
454 455
               else
455
-                temp="";
456
-              
456
+                temp = "";
457
+
457 458
             }
458 459
             while (temp.length > 0);
459 460
 
@@ -479,11 +480,11 @@ function changeStringToView(field) {
479 480
           else if (arr[k].indexOf("[音") >= 0 && arr[k].indexOf("[/音]") > 0) {
480 481
             var obj = {};
481 482
             obj.Type = "recorder";
482
-            
483
+
483 484
             var tempIndex = arr[k].indexOf("\']") + 2;
484 485
             //obj.Content = arr[k].substring(tempIndex, arr[k].indexOf("[/音]"));
485 486
             obj.SoundMark = arr[k].substring(arr[k].indexOf("url='") + 5, arr[k].indexOf("']"));;
486
-            
487
+
487 488
             arrResult.push(obj);
488 489
           }
489 490
           else if (arr[k] != "") {
@@ -507,7 +508,7 @@ function changeStringToView(field) {
507 508
         while (arrResult[0].Type == "return"
508 509
           || arrResult[0].Type == "br") {
509 510
           arrResult.shift();
510
-          if (arrResult.length==0)
511
+          if (arrResult.length == 0)
511 512
             break;
512 513
         }
513 514
         //去掉后回车换行
@@ -541,7 +542,7 @@ function getTaskTodayList(callback) {
541 542
       });
542 543
       setTimeout(function () {
543 544
         wx.hideLoading();
544
-      }, 5000);
545
+      }, 60000);
545 546
     }
546 547
   }, 2000);
547 548
 
@@ -657,7 +658,7 @@ function UpdateMiaoguoCardTodayAll(isShowLoading, callback) {
657 658
       mask: true,
658 659
     });
659 660
     clearTimeout(dataSendTimeout);
660
-    dataSendTimeout=setTimeout(function () {
661
+    dataSendTimeout = setTimeout(function () {
661 662
       wx.hideLoading();
662 663
       wx.reLaunch({
663 664
         url: '../index/index',
@@ -774,9 +775,8 @@ function setCollect(id, collect, callback) {
774 775
   });
775 776
 }
776 777
 
777
-function buildInitData (callback) {
778
+function buildInitData(callback) {
778 779
   var that = this;
779
-  //app.globalData.userInfo.UserID=4;
780 780
   wx.showLoading({
781 781
     title: '数据初始化',
782 782
   });
@@ -923,6 +923,44 @@ function getPinyin(pinyin) {
923 923
   return result.join(",");
924 924
 }
925 925
 
926
+function getPinyinNormal(pinyin) {
927
+  var result = "";
928
+  var arr = getPinyinArray();
929
+  for (var i = 0; i < arr.length; i++) {
930
+    if (arr[i][1] == pinyin) {
931
+      result = arr[i][0];
932
+      break;
933
+    }
934
+  }
935
+  return result;
936
+}
937
+
938
+function getHanzi(callback) {
939
+  var that = this;
940
+  wx.showLoading({
941
+    title: '请稍候',
942
+    mask: true,
943
+  });
944
+  var time = wx.getStorageSync("HanziUpdateTime");
945
+  getData('GetHanziAll?UpdateTime=' + time, function (data) {
946
+    wx.hideLoading();
947
+    if (data) {
948
+      var arr = [];
949
+      if (data.List) {
950
+        arr = common.Decrypt(data.List);
951
+        wx.setStorageSync("HanziAll", arr);
952
+        wx.setStorageSync("HanziUpdateTime", data.UpdateTime);
953
+      }
954
+      else {
955
+        arr = wx.getStorageSync("HanziAll");
956
+        if (arr)
957
+          arr = JSON.parse(arr);
958
+      }
959
+      callback(arr);
960
+    }
961
+  });
962
+}
963
+
926 964
 function getPinyinArray() {
927 965
   var arrPinyin = [
928 966
     ['a1', 'ā', ['阿']],
@@ -1534,10 +1572,10 @@ function getPinyinArray() {
1534 1572
     ['lao3', 'lǎo', ['老']],
1535 1573
     ['lao4', 'lào', ['涝']],
1536 1574
     ['lao5', 'lao', ['']],
1537
-    ['le', 'le', ['了']],
1575
+    //['le', 'le', ['了']],
1538 1576
     ['le1', 'lē', ['肋']],
1539 1577
     ['le4', 'lè', ['乐']],
1540
-    ['le5', 'le', ['']],
1578
+    ['le5', 'le', ['']],
1541 1579
     ['lei1', 'lēi', ['勒']],
1542 1580
     ['lei2', 'léi', ['雷']],
1543 1581
     ['lei3', 'lěi', ['磊']],
@@ -2437,4 +2475,6 @@ module.exports = {
2437 2475
   getServerImage: getServerImage,
2438 2476
   getBaiduToken: getBaiduToken,
2439 2477
   buildInitData: buildInitData,
2478
+  getPinyinNormal: getPinyinNormal,
2479
+  getHanzi: getHanzi
2440 2480
 }