chengjie 6 gadi atpakaļ
vecāks
revīzija
a06c9a4565

+ 1 - 1
app.js

@@ -33,7 +33,7 @@ App({
33 33
   },
34 34
   globalData: {
35 35
     Version: "1.4.13",
36
-    IsProduction: true,
36
+    IsProduction: false,
37 37
     ShareTitle: "高效学习从秒过开始",
38 38
     SharePath: "pages/index/index",
39 39
     ShareImage: '../images/program_screenshot_main.png',

+ 5 - 2
pages/main/detail.js

@@ -34,6 +34,7 @@ var arrImage = [],
34 34
 var intervalSound = 0,
35 35
   intervalRefresh = 0;
36 36
 var isCollecting = false;
37
+var isExit=true;
37 38
 
38 39
 var isPlaying = false;
39 40
 
@@ -151,8 +152,9 @@ Page({
151 152
     }
152 153
   },
153 154
   onHide:function(e){
154
-    console.log("Hide:"+e);
155
-    this.onClose();
155
+    if (isExit)
156
+      this.onClose();
157
+    isExit = true;
156 158
   },
157 159
   onPullDownRefresh: function () {
158 160
     this.onShowAnswer({
@@ -384,6 +386,7 @@ Page({
384 386
     wx.navigateTo({
385 387
       url: './add?type=edit&id=' + TaskList[0].MiaoguoCardID,
386 388
     });
389
+    isExit = false;
387 390
   },
388 391
   onFontSize: function (e) {
389 392
     var value = e.currentTarget.dataset.value;

+ 105 - 4
pages/test/index.js

@@ -5,15 +5,80 @@ const app = getApp();
5 5
 
6 6
 Page({
7 7
   data: {
8
-    List:[1],
9
-    IsSelectGrade:false,
10
-    GradeArr: [{ Name: "一年级" }, { Name: "二年级" }, { Name: "三年级"}],
8
+    List: [],
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
+    ],
11 70
   },
12 71
   onLoad: function (options) {
13 72
     var that = this;
14 73
     that.setData({
15 74
       Containnerheight: main.getWindowHeight(),
16 75
     });
76
+
77
+    that.getHanzi(function (arr) {
78
+      if (arr) {
79
+
80
+      }
81
+    });
17 82
   },
18 83
   showSelectGrade: function () {
19 84
     var that = this;
@@ -21,12 +86,48 @@ Page({
21 86
       IsSelectGrade: true,
22 87
     });
23 88
   },
24
-  closeSelectGrade:function(){
89
+  closeSelectGrade: function () {
25 90
     var that = this;
26 91
     that.setData({
27 92
       IsSelectGrade: false,
28 93
     });
29 94
   },
95
+  goto: function (e) {
96
+    var url = e.currentTarget.dataset.url;
97
+    wx.navigateTo({
98
+      url: url,
99
+    });
100
+  },
101
+  getHanzi: function (callback) {
102
+    var that = this;
103
+    var time = wx.getStorageSync("HanziUpdateTime");
104
+    main.getData('GetHanziAll?UpdateTime=' + time, function (data) {
105
+      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);
111
+        }
112
+        else {
113
+          arr = wx.getStorageSync("HanziAll");
114
+          arr=JSON.parse(arr);
115
+        }
116
+        callback(arr);
117
+      }
118
+    });
119
+  },
120
+  onSelectGrade:function(e){
121
+    var index=e.currentTarget.dataset.value;
122
+    for (var i = 0; i < this.data.GradeArr.length;i++)
123
+      this.data.GradeArr[i].Select = "";
124
+    this.data.GradeArr[index].Select="Select";
125
+    this.setData({
126
+      SelectGrade:index,
127
+      GradeArr: this.data.GradeArr,
128
+    });
129
+    this.closeSelectGrade();
130
+  },
30 131
   onShareAppMessage: function () {
31 132
     return {
32 133
       title: app.globalData.ShareTitle,

+ 6 - 10
pages/test/index.wxml

@@ -1,6 +1,6 @@
1 1
 <view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
2 2
   <view class="panelTop FlexRow" bindtap="showSelectGrade">
3
-    <view class="panelTop1">一年级</view>
3
+    <view class="panelTop1">{{GradeArr[SelectGrade].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>
@@ -8,20 +8,16 @@
8 8
   </view>
9 9
   <view style="height:106rpx;"></view>
10 10
   <scroll-view scroll-x="true" class="panelCard FlexRow">
11
-    <view class="Card">
12
-      <image class="examine_subject_a001" src="../images/examine_subject_a001.png"></image>
13
-      <view class="Card1">语文识字</view>
14
-      <view class="Card2">上学期</view>
11
+    <view class="Card" wx:for="{{GradeArr[SelectGrade].List}}" wx:key="index" bindtap="goto" data-url="./list?id={{item.ID}}">
12
+      <image class="examine_subject_a001" src="{{item.Image}}"></image>
13
+      <view class="Card1">{{item.Name}}</view>
14
+      <view class="Card2">{{item.Name2}}</view>
15 15
       <view class="Card3">已检验</view>
16 16
       <view class="Card4 FlexRow">
17 17
         <view class="Progress FlexRow"><view class="Progress1"></view></view>
18 18
         <view class="Number">12%</view>
19 19
       </view>
20 20
     </view>
21
-    <view class="Card FlexColumn">
22
-    </view>
23
-    <view class="Card FlexColumn">
24
-    </view>
25 21
     <view class="Card0"></view>
26 22
   </scroll-view>
27 23
   <view class="panelList FlexColumn">
@@ -68,7 +64,7 @@
68 64
         <view class='numberContainerFooter111'>选择年级</view>
69 65
         <view class='numberContainerFooter113'>目前仅小学阶段如下年级开放试用</view>
70 66
         <view class='numberContainerFooter112 FlexRow'>
71
-          <view class='numberContainerFooter1121' wx:for="{{GradeArr}}" wx:key="index" catchtap='onPracticeTime' data-value='{{item.Name}}'>{{item.Name}}</view>
67
+          <view class='numberContainerFooter1121{{item.Select}}' wx:for="{{GradeArr}}" wx:key="index" catchtap='onSelectGrade' data-value='{{index}}'>{{item.Name}}</view>
72 68
         </view>
73 69
       </view>
74 70
     </view>

+ 6 - 0
pages/test/index.wxss

@@ -308,4 +308,10 @@
308 308
   border:3rpx solid #0071EF;
309 309
   color:#fff;
310 310
   background-color: #0071EF;
311
+  line-height:73rpx;
312
+  border-radius: 10rpx;
313
+  text-align: center;
314
+  margin: 30rpx 30rpx 0 0;
315
+  font-size:24rpx;
316
+  padding: 0 30rpx;
311 317
 }

+ 29 - 2
pages/test/list.js

@@ -5,15 +5,42 @@ const app = getApp();
5 5
 
6 6
 Page({
7 7
   data: {
8
-    IsSelect:true,
8
+    IsSelect:false,
9 9
   },
10 10
   onLoad: function (options) {
11 11
     var that = this;
12 12
     that.setData({
13 13
       Containnerheight: main.getWindowHeight(),
14 14
     });
15
+    var arr = wx.getStorageSync("HanziAll");
16
+    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){
20
+        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)
27
+              str += list[j].Words[k].Name;
28
+            else{
29
+              str += list[j].Words[k].Name +"…";
30
+              break;
31
+            }
32
+          }
33
+
34
+          list[j].WordList=str;
35
+        }
36
+        that.setData({
37
+          List:list,
38
+        });
39
+      }
40
+    }
41
+
15 42
   },
16
-  onShow: function () {
43
+  onShowFrame: function () {
17 44
     this.setData({
18 45
       IsSelect: true,
19 46
     });

+ 6 - 6
pages/test/list.wxml

@@ -1,14 +1,14 @@
1 1
 <view class="container FlexColumn" style='min-height:{{Containnerheight}}rpx;'>
2 2
   <view class="text1">请对照课本选择字组</view>
3
-  <block wx:for="{{[1,2,3,4]}}" wx:key="index">
4
-    <view class="PanelItem FlexColumn" bindtap="onShow" data-id="{{index}}">
3
+  <block wx:for="{{List}}" wx:key="index">
4
+    <view class="PanelItem FlexColumn" bindtap="onShowFrame" data-id="{{item.ID}}">
5 5
       <view class="PanelItem1 FlexRow">
6 6
         <view class="left FlexRow">
7 7
           <view class="Word FlexRow">
8
-            
8
+            {{item.Words[0].Name}}
9 9
           </view>
10 10
           <view class="Title FlexRow">
11
-            识字 1-5
11
+            {{item.Name}}
12 12
           </view>
13 13
         </view>
14 14
         <view class="right FlexColumn">
@@ -16,14 +16,14 @@
16 16
             <image class="examine_willread_gray_22x22" src="../images/examine_willread_gray_22x22.png"></image>
17 17
             <image class="examine_willwrite_green_22x22" src="../images/examine_willwrite_green_22x22.png"></image>
18 18
           </view>
19
-          <view class="right2">38个字</view>
19
+          <view class="right2">{{item.Words.length}}个字</view>
20 20
         </view>
21 21
       </view>
22 22
       <view class="lineWidthAll FlexRow">
23 23
         <view class="lineWidth720"></view>
24 24
       </view>
25 25
       <text class="PanelItem2 FlexRow">
26
-      统、根、据、这、一、结、果、计、算、题、卡、今、后、的、练、习、时、间、每、次、打、分、务、求、准、确、这、会…
26
+        {{item.WordList}}
27 27
       </text>
28 28
     </view>
29 29
   </block>

+ 5 - 4
pages/test/report.wxml

@@ -8,6 +8,10 @@
8 8
       <view class="text3">答错的题目</view>
9 9
       <image src="../images/universalpic_indicator_right_gray.png" class="universalpic_indicator_right_gray" />
10 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>
11 15
     <view class="btn FlexRow">
12 16
       <view class="circle"></view>
13 17
       <view class="text4">五彩缤纷</view>
@@ -40,10 +44,7 @@
40 44
       <view class="circle"></view>
41 45
       <view class="text4">五彩缤纷</view>
42 46
     </view>
43
-    <view class="btn2 btn FlexRow">
44
-      <image src="../images/universalpic_checked_white_22x17.png" class="universalpic_checked_white_22x17" />
45
-      <view class="text4">秒过</view>
46
-    </view>
47
+    
47 48
   </view>
48 49
 
49 50
   <view class="panelItem FlexRow">

+ 2 - 2
project.config.json

@@ -106,8 +106,8 @@
106 106
 				},
107 107
 				{
108 108
 					"id": 7,
109
-					"name": "pages/test/report",
110
-					"pathName": "pages/test/report",
109
+					"name": "pages/test/index",
110
+					"pathName": "pages/test/index",
111 111
 					"query": "",
112 112
 					"scene": null
113 113
 				},