chengjie 6 years ago
parent
commit
92104622c0

+ 3 - 1
app.js

@@ -11,12 +11,13 @@ App({
11
     this.globalData.systemInfo = wx.getSystemInfoSync();
11
     this.globalData.systemInfo = wx.getSystemInfoSync();
12
   },
12
   },
13
   globalData: {
13
   globalData: {
14
-    Version: "1.2.0",
14
+    Version: "1.2.1",
15
     IsProduction: true,
15
     IsProduction: true,
16
     ProgramID: 106,
16
     ProgramID: 106,
17
     AppID: "wx313a8f2c0741efe1",
17
     AppID: "wx313a8f2c0741efe1",
18
     ProgramName: "语文识字",
18
     ProgramName: "语文识字",
19
     ShareTitle:"赢在阅读起跑线",
19
     ShareTitle:"赢在阅读起跑线",
20
+    SharePath: "pages/index/index",
20
     ShareImage: "../../pages/images/07001.png",
21
     ShareImage: "../../pages/images/07001.png",
21
     userInfo: null,
22
     userInfo: null,
22
     fileUrl: "https://www.kylx365.com/",
23
     fileUrl: "https://www.kylx365.com/",
@@ -39,5 +40,6 @@ App({
39
     NewUserNumberMax:6,//邀请新用户最大值
40
     NewUserNumberMax:6,//邀请新用户最大值
40
     IsSaveCustom:false,//是否保存了定制
41
     IsSaveCustom:false,//是否保存了定制
41
     goto:"",//用于服务直达的跳转
42
     goto:"",//用于服务直达的跳转
43
+    IsRefresh: false,
42
   }
44
   }
43
 })
45
 })

+ 39 - 16
package4/main/activate.js

@@ -2,7 +2,7 @@ import common from '../../utils/util';
2
 import server from '../../utils/main';
2
 import server from '../../utils/main';
3
 
3
 
4
 const app = getApp();
4
 const app = getApp();
5
-var productList=[];
5
+var productList = [];
6
 
6
 
7
 Page({
7
 Page({
8
   data: {
8
   data: {
@@ -16,6 +16,9 @@ Page({
16
 
16
 
17
     this.init();
17
     this.init();
18
   },
18
   },
19
+  onUnload:function(){
20
+    productList=[];
21
+  },
19
   init: function (e, isRemind) {
22
   init: function (e, isRemind) {
20
     var that = this;
23
     var that = this;
21
     wx.showLoading({
24
     wx.showLoading({
@@ -31,21 +34,25 @@ Page({
31
               data[j].ImageUrl = programList[i].ImageUrl;
34
               data[j].ImageUrl = programList[i].ImageUrl;
32
               data[j].appId = programList[i].appId;
35
               data[j].appId = programList[i].appId;
33
               data[j].path = programList[i].path;
36
               data[j].path = programList[i].path;
37
+              //不是当前小程序不解锁
38
+              if (app.globalData.ProgramID == data[j].ProductID)
39
+                app.globalData.userInfo.IsMember = 1;
34
             }
40
             }
35
           }
41
           }
36
         }
42
         }
37
 
43
 
38
-        if (productList.length>0){
39
-          for(var i=0;i<productList.length;i++){
40
-            var b=false;
41
-            for(var j=0;j<data.length;j++){
42
-              if (productList[i].ProductID == data[j].ProductID){
43
-                b=true;
44
+        if (productList.length > 0) {
45
+          for (var i = 0; i < productList.length; i++) {
46
+            var b = false;
47
+            for (var j = 0; j < data.length; j++) {
48
+              if (productList[i].ProductID == data[j].ProductID) {
49
+                b = true;
50
+                
44
                 break;
51
                 break;
45
               }
52
               }
46
             }
53
             }
47
-            if (!b){
48
-              productList[i].IsActivate=1;
54
+            if (!b) {
55
+              productList[i].IsActivate = 1;
49
               data.push(productList[i]);
56
               data.push(productList[i]);
50
             }
57
             }
51
           }
58
           }
@@ -55,9 +62,7 @@ Page({
55
           List: data,
62
           List: data,
56
         });
63
         });
57
 
64
 
58
-        productList=data;
59
-
60
-        wx.hideLoading();
65
+        productList = data;
61
 
66
 
62
         if (isRemind) {
67
         if (isRemind) {
63
           wx.showModal({
68
           wx.showModal({
@@ -69,13 +74,31 @@ Page({
69
         }
74
         }
70
 
75
 
71
         wx.setStorageSync("HasActivate", 1);
76
         wx.setStorageSync("HasActivate", 1);
77
+        wx.hideLoading();
72
       }
78
       }
73
       else {
79
       else {
74
-        wx.redirectTo({
75
-          url: "./activateFinish",
76
-        });
77
-        wx.removeStorageSync("HasActivate");
80
+        if (isRemind) {
81
+          var arr = [];
82
+          for (var i = 0; i < productList.length; i++) {
83
+            arr.push(productList[i].ProductID);
84
+          }
85
+          wx.redirectTo({
86
+            url: "./activateFinish?idarr="+arr.join(","),
87
+          });
88
+          productList = [];
89
+          wx.removeStorageSync("HasActivate");
90
+        }
91
+        else{
92
+          for (var i = 0; i < productList.length; i++) {
93
+            productList[i].IsActivate = 1;
94
+          }
95
+          that.setData({
96
+            List: productList,
97
+          });
98
+        }
78
       }
99
       }
100
+      wx.hideLoading();
101
+
79
     });
102
     });
80
   },
103
   },
81
   gotoFeedback: function () {
104
   gotoFeedback: function () {

+ 16 - 1
package4/main/activateFinish.js

@@ -7,10 +7,20 @@ Page({
7
   data: {
7
   data: {
8
   },
8
   },
9
   onLoad: function (options) {
9
   onLoad: function (options) {
10
+    var idarr=options.idarr.split(",");
11
+    var list = server.getProgramList();
12
+    var arr=[];
13
+    for(var i=0;i<list.length;i++){
14
+      for(var j=0;j<idarr.length;j++){
15
+        if (idarr[j]==list[i].ID){
16
+          arr.push(list[i]);
17
+        }
18
+      }
19
+    }
10
 
20
 
11
     this.setData({
21
     this.setData({
12
       Containnerheight: common.getSystemHeight(),
22
       Containnerheight: common.getSystemHeight(),
13
-      ProgramList: server.getProgramList(),
23
+      ProgramList: arr,
14
       ProgramID:app.globalData.ProgramID,
24
       ProgramID:app.globalData.ProgramID,
15
     });
25
     });
16
   },
26
   },
@@ -25,6 +35,11 @@ Page({
25
       }
35
       }
26
     });
36
     });
27
   },
37
   },
38
+  gotoFinish: function () {
39
+    wx.reLaunch({
40
+      url: '../../pages/index/index',
41
+    });
42
+  },
28
   onShareAppMessage: function () {
43
   onShareAppMessage: function () {
29
     return {
44
     return {
30
       title: app.globalData.ShareTitle,
45
       title: app.globalData.ShareTitle,

+ 4 - 2
package4/main/activateFinish.wxml

@@ -23,6 +23,8 @@
23
       <view class='btnRefresh' wx:if="{{ProgramID!=item.ID}}">去使用</view>
23
       <view class='btnRefresh' wx:if="{{ProgramID!=item.ID}}">去使用</view>
24
     </view>
24
     </view>
25
   </view>
25
   </view>
26
-<view class='lineFooter'></view>
27
-
26
+  <view class='lineFooter'></view>
27
+  <view class='footer FlexRow' bindtap="gotoFinish">
28
+    前往首页
29
+  </view>
28
 </view>
30
 </view>

+ 13 - 1
package4/main/activateFinish.wxss

@@ -63,4 +63,16 @@
63
   font-size:24rpx;
63
   font-size:24rpx;
64
   text-align: center;
64
   text-align: center;
65
   line-height: 50rpx;
65
   line-height: 50rpx;
66
-}
66
+}
67
+
68
+.footer{
69
+  width: 100%;
70
+  height: 140rpx;
71
+  position: fixed;
72
+  bottom: 0;
73
+  line-height: 140rpx;
74
+  font-size:48rpx;
75
+  color:#fff;
76
+  text-align: center;
77
+  background-color: #03AF69;
78
+}

+ 6 - 0
package4/main/activateOK.js

@@ -5,6 +5,7 @@ const app = getApp();
5
 
5
 
6
 Page({
6
 Page({
7
   data: {
7
   data: {
8
+    ShowNumber:0,
8
   },
9
   },
9
   onLoad: function (options) {
10
   onLoad: function (options) {
10
 
11
 
@@ -13,6 +14,11 @@ Page({
13
     });
14
     });
14
     this.updateData(options);
15
     this.updateData(options);
15
   },
16
   },
17
+  onShow: function(){
18
+    this.setData({
19
+      ShowNumber:this.data.ShowNumber,
20
+    })
21
+  },
16
   updateData: function (param) {
22
   updateData: function (param) {
17
     var that = this;
23
     var that = this;
18
     server.getData('UpdateWXUsersAll500?ProductID=' + param.ProductID
24
     server.getData('UpdateWXUsersAll500?ProductID=' + param.ProductID

+ 4 - 4
package4/main/buyad.js

@@ -24,17 +24,17 @@ Page({
24
     }
24
     }
25
   },
25
   },
26
   gotoOrder: function () {
26
   gotoOrder: function () {
27
-    wx.navigateTo({
28
-      url: "./order?id="+app.globalData.ProgramID+"&paytype=3",
27
+    wx.redirectTo({
28
+      url: "./order?id=" + app.globalData.ProgramID + "&paytype=3",
29
     });
29
     });
30
   },
30
   },
31
   gotoPackList: function () {
31
   gotoPackList: function () {
32
-    wx.navigateTo({
32
+    wx.redirectTo({
33
       url: "./list?IsGift=0",
33
       url: "./list?IsGift=0",
34
     });
34
     });
35
   },
35
   },
36
   gotoGiftList: function () {
36
   gotoGiftList: function () {
37
-    wx.navigateTo({
37
+    wx.redirectTo({
38
       url: "./list?IsGift=1",
38
       url: "./list?IsGift=1",
39
     });
39
     });
40
   },
40
   },

+ 1 - 1
package4/main/giftinfo.js

@@ -36,7 +36,7 @@ Page({
36
       success(res) {
36
       success(res) {
37
         if (!res.authSetting['scope.userInfo']) {
37
         if (!res.authSetting['scope.userInfo']) {
38
           wx.navigateTo({
38
           wx.navigateTo({
39
-            url: '../../pages/index/userlogin?url=giftinfo'
39
+            url: '../../pages/main/accredit?url=giftinfo'
40
           });
40
           });
41
         }
41
         }
42
         else {
42
         else {

+ 13 - 1
package4/main/limited.js

@@ -6,14 +6,21 @@ const app = getApp();
6
 Page({
6
 Page({
7
   data: {
7
   data: {
8
     FileUrl: app.globalData.imageUrl,
8
     FileUrl: app.globalData.imageUrl,
9
+    IsShowButton:0,
9
   },
10
   },
10
   onLoad: function (options) {
11
   onLoad: function (options) {
11
-
12
+    var IsShowButton = 0;
13
+    if (options.IsShowButton)
14
+      IsShowButton=options.IsShowButton;
12
     this.setData({
15
     this.setData({
13
       Containnerheight: common.getSystemHeight(),
16
       Containnerheight: common.getSystemHeight(),
17
+      IsShowButton: IsShowButton
14
     });
18
     });
15
     this.init();
19
     this.init();
16
   },
20
   },
21
+  onUnload: function () {
22
+    app.globalData.IsRefresh=true;
23
+  },
17
   init: function () {
24
   init: function () {
18
     var that = this;
25
     var that = this;
19
     server.getData('GetWXUsersAllTime?ProductID=' + app.globalData.ProgramID + '&UserID=' + app.globalData.userInfo.UserID, function (data) {
26
     server.getData('GetWXUsersAllTime?ProductID=' + app.globalData.ProgramID + '&UserID=' + app.globalData.userInfo.UserID, function (data) {
@@ -34,6 +41,11 @@ Page({
34
   gotoFeedback: function () {
41
   gotoFeedback: function () {
35
     server.gotoFeedback();
42
     server.gotoFeedback();
36
   },
43
   },
44
+  gotoFinish:function(){
45
+    wx.reLaunch({
46
+      url: '../../pages/index/index',
47
+    });
48
+  },
37
   onShareAppMessage: function () {
49
   onShareAppMessage: function () {
38
     return {
50
     return {
39
       title: app.globalData.ShareTitle,
51
       title: app.globalData.ShareTitle,

+ 3 - 1
package4/main/limited.wxml

@@ -15,7 +15,9 @@
15
     </view>
15
     </view>
16
   </view>
16
   </view>
17
   <view class='lineFooter'></view>
17
   <view class='lineFooter'></view>
18
-
18
+  <view class='footer FlexRow' bindtap="gotoFinish" wx:if="{{IsShowButton==1}}">
19
+    前往首页
20
+  </view>
19
 
21
 
20
   <view class='panelFooter FlexRow' bindtap='gotoFeedback'>
22
   <view class='panelFooter FlexRow' bindtap='gotoFeedback'>
21
     <view>如遇问题,请切换到“唱意教育家长助手”中</view>
23
     <view>如遇问题,请切换到“唱意教育家长助手”中</view>

+ 14 - 1
package4/main/limited.wxss

@@ -72,4 +72,17 @@
72
   color:#B3443B;
72
   color:#B3443B;
73
   text-decoration: underline;
73
   text-decoration: underline;
74
   font-weight: 500;
74
   font-weight: 500;
75
-}
75
+}
76
+
77
+
78
+.footer{
79
+  width: 100%;
80
+  height: 140rpx;
81
+  position: fixed;
82
+  bottom: 0;
83
+  line-height: 140rpx;
84
+  font-size:48rpx;
85
+  color:#fff;
86
+  text-align: center;
87
+  background-color: #03AF69;
88
+}

+ 5 - 6
package4/main/order.js

@@ -50,9 +50,9 @@ Page({
50
         if (this.data.Coupon){
50
         if (this.data.Coupon){
51
           price=price-Number(this.data.Coupon.Price);
51
           price=price-Number(this.data.Coupon.Price);
52
         }
52
         }
53
-        if (price.toString().indexOf(".") < 0) {
54
-          price = price + ".00";
55
-        }
53
+        
54
+        price = common.FormatMoney(price*100);
55
+
56
         detail = list[i].Detail;
56
         detail = list[i].Detail;
57
         if (i==0)
57
         if (i==0)
58
           buytype=110;
58
           buytype=110;
@@ -104,9 +104,8 @@ Page({
104
         if (this.data.Coupon)
104
         if (this.data.Coupon)
105
           price+=Number(this.data.Coupon.Price);
105
           price+=Number(this.data.Coupon.Price);
106
 
106
 
107
-        if (price.toString().indexOf(".")<0){
108
-          price=price+".00";
109
-        }
107
+        price = common.FormatMoney(price * 100);
108
+
110
         this.setData({
109
         this.setData({
111
           IsDiscount: false,
110
           IsDiscount: false,
112
           Coupon: list[i],
111
           Coupon: list[i],

+ 5 - 4
package4/main/payfinish.js

@@ -22,14 +22,15 @@ Page({
22
 
22
 
23
     if (paytype == "4") {
23
     if (paytype == "4") {
24
       wx.setStorageSync("HasActivate", 1);
24
       wx.setStorageSync("HasActivate", 1);
25
-      app.globalData.userInfo.IsMember = 1;
26
-      app.globalData.IsLocked = 0;
27
     }
25
     }
28
     else if (paytype=="3"){
26
     else if (paytype=="3"){
29
       app.globalData.userInfo.IsMember = 1;
27
       app.globalData.userInfo.IsMember = 1;
30
-      app.globalData.IsLocked = 0;
31
     }
28
     }
32
   }, 
29
   }, 
30
+  onUnload: function () {
31
+    if (this.data.Paytype == "4") 
32
+      app.globalData.IsRefresh = true;
33
+  },
33
   gotoDefault: function() {
34
   gotoDefault: function() {
34
     wx.redirectTo({
35
     wx.redirectTo({
35
       url: "../../pages/main/default",
36
       url: "../../pages/main/default",
@@ -38,7 +39,7 @@ Page({
38
   goto: function () {
39
   goto: function () {
39
     if (this.data.Paytype == "3") {
40
     if (this.data.Paytype == "3") {
40
       wx.redirectTo({
41
       wx.redirectTo({
41
-        url: "./limited",
42
+        url: "./limited?IsShowButton=1",
42
       });
43
       });
43
     }
44
     }
44
     if (this.data.Paytype == "4") {
45
     if (this.data.Paytype == "4") {

+ 12 - 1
pages/index/index.js

@@ -42,6 +42,11 @@ Page({
42
           ProductUserID: options.ProductUserID,
42
           ProductUserID: options.ProductUserID,
43
         });
43
         });
44
       }
44
       }
45
+      if (options.GiftID) {
46
+        this.setData({
47
+          GiftID: options.GiftID,
48
+        });
49
+      }
45
     }
50
     }
46
     this.setData({
51
     this.setData({
47
       Height: common.getSystemHeight(),
52
       Height: common.getSystemHeight(),
@@ -170,7 +175,13 @@ Page({
170
 
175
 
171
           app.globalData.IsLocked = data.IsLocked;
176
           app.globalData.IsLocked = data.IsLocked;
172
           
177
           
173
-          if (that.data.ProductID) {
178
+          if (that.data.GiftID) {
179
+            var url = "../../package4/main/giftcard?GiftID=" + that.data.GiftID + "&UserID=" + app.globalData.introducer
180
+            wx.redirectTo({
181
+              url: url
182
+            });
183
+          }
184
+          else if (that.data.ProductID) {
174
             var url = "../../package4/main/activateOK?ProductID=" + that.data.ProductID
185
             var url = "../../package4/main/activateOK?ProductID=" + that.data.ProductID
175
               + "&ProductUserID=" + that.data.ProductUserID
186
               + "&ProductUserID=" + that.data.ProductUserID
176
               + "&CurrentUserID=" + app.globalData.userInfo.UserID
187
               + "&CurrentUserID=" + app.globalData.userInfo.UserID

+ 17 - 41
pages/main/accredit.js

@@ -33,16 +33,6 @@ Page({
33
       }
33
       }
34
     }
34
     }
35
   },
35
   },
36
-  onUnload: function () {
37
-    wx.reLaunch({
38
-      url: '../main/index'
39
-    });
40
-  },
41
-  deblocking: function () {
42
-    wx.reLaunch({
43
-      url: '../index/index'
44
-    });
45
-  },
46
   goto: function (e) {
36
   goto: function (e) {
47
     var that = this;
37
     var that = this;
48
     wx.getSetting({
38
     wx.getSetting({
@@ -78,40 +68,26 @@ Page({
78
         wx.getUserInfo({
68
         wx.getUserInfo({
79
           withCredentials: true,
69
           withCredentials: true,
80
           success: function (res) {
70
           success: function (res) {
81
-            var userID = app.globalData.userInfo.UserID;
82
-            app.globalData.userInfo = res.userInfo;
83
-            app.globalData.userInfo.UserID = userID;
84
-
85
-            app.globalData.userInfo.NickName = app.globalData.userInfo.nickName;
86
-            app.globalData.userInfo.AvatarUrl = app.globalData.userInfo.avatarUrl;
87
-
88
-            // that.hasGetShareInfo(app.globalData.userInfo);
89
-            that.setData({
90
-              IsAccredit: true,
91
-              NickName: app.globalData.userInfo.NickName,
92
-              AvatarUrl: app.globalData.userInfo.AvatarUrl
93
-            });
94
-
95
             app.globalData.userInfo.Code = res0.code;
71
             app.globalData.userInfo.Code = res0.code;
96
             app.globalData.userInfo.iv = res.iv;
72
             app.globalData.userInfo.iv = res.iv;
97
             app.globalData.userInfo.encryptedData = res.encryptedData;
73
             app.globalData.userInfo.encryptedData = res.encryptedData;
98
-            that.login(app.globalData.userInfo);
74
+
75
+            app.globalData.userInfo.NickName = res.userInfo.nickName;
76
+            app.globalData.userInfo.AvatarUrl = res.userInfo.avatarUrl;
77
+
78
+            that.login(app.globalData.userInfo, res.userInfo);
99
           },
79
           },
100
           fail: function (res) {
80
           fail: function (res) {
101
-            wx.reLaunch({
102
-              url: '../index/index'
103
-            });
81
+
104
           }
82
           }
105
         });
83
         });
106
       },
84
       },
107
       fail: function () {
85
       fail: function () {
108
-        wx.reLaunch({
109
-          url: '../index/index'
110
-        });
86
+
111
       }
87
       }
112
     });
88
     });
113
   },
89
   },
114
-  login: function (param) {
90
+  login: function (param, param2) {
115
     var that = this;
91
     var that = this;
116
     var url = "Login";
92
     var url = "Login";
117
     switch (app.globalData.ProgramID) {
93
     switch (app.globalData.ProgramID) {
@@ -133,13 +109,13 @@ Page({
133
     }
109
     }
134
     server.postData(url, {
110
     server.postData(url, {
135
       Code: param.Code,
111
       Code: param.Code,
136
-      NickName: param.nickName,
137
-      Language: param.language,
138
-      Gender: param.gender,
139
-      City: param.city,
140
-      Province: param.province,
141
-      Country: param.country,
142
-      AvatarUrl: param.avatarUrl,
112
+      NickName: param2.nickName,
113
+      AvatarUrl: param2.avatarUrl,
114
+      Language: param2.language,
115
+      Gender: param2.gender,
116
+      City: param2.city,
117
+      Province: param2.province,
118
+      Country: param2.country,
143
       ProgramVersion: app.globalData.Version,
119
       ProgramVersion: app.globalData.Version,
144
       Introducer: app.globalData.introducer,
120
       Introducer: app.globalData.introducer,
145
       UserSource: app.globalData.userSource,
121
       UserSource: app.globalData.userSource,
@@ -148,8 +124,8 @@ Page({
148
       iv: param.iv,
124
       iv: param.iv,
149
       encryptedData: param.encryptedData,
125
       encryptedData: param.encryptedData,
150
     }, function (data) {
126
     }, function (data) {
151
-      wx.reLaunch({
152
-        url: '../main/index'
127
+      wx.navigateBack({
128
+        delta: 1
153
       });
129
       });
154
     });
130
     });
155
   },
131
   },

+ 1 - 1
pages/main/detail.js

@@ -368,7 +368,7 @@ Page({
368
           else {
368
           else {
369
             var CombineWords = this.data.List[this.data.CurrentIndex].CombineWords;
369
             var CombineWords = this.data.List[this.data.CurrentIndex].CombineWords;
370
             if (CombineWords)
370
             if (CombineWords)
371
-              CombineWords = "," + CombineWords.replace(Name, Name + pinyinStr) + "的" + Name;
371
+              CombineWords = "," + CombineWords.replace(Name, Name + pinyinStr) + "的(de5)" + Name;
372
 
372
 
373
             url = url.replace("[word]", Name + pinyinStr + CombineWords + pinyinStr);
373
             url = url.replace("[word]", Name + pinyinStr + CombineWords + pinyinStr);
374
           }
374
           }

+ 7 - 4
pages/main/index.js

@@ -11,7 +11,7 @@ Page({
11
     Version: app.globalData.Version,
11
     Version: app.globalData.Version,
12
     ListProgram: server.getProgramListOld(),
12
     ListProgram: server.getProgramListOld(),
13
     NickName: "陌生用户",
13
     NickName: "陌生用户",
14
-    IsMember: 0,
14
+    IsMember: 1,
15
     NewUserNumber: 2,
15
     NewUserNumber: 2,
16
     AvatarUrl: "",
16
     AvatarUrl: "",
17
     DayNumber: "0",
17
     DayNumber: "0",
@@ -31,9 +31,6 @@ Page({
31
       Height: common.getSystemHeight(),
31
       Height: common.getSystemHeight(),
32
       NickName: app.globalData.userInfo.NickName,
32
       NickName: app.globalData.userInfo.NickName,
33
       AvatarUrl: app.globalData.userInfo.AvatarUrl,
33
       AvatarUrl: app.globalData.userInfo.AvatarUrl,
34
-      IsLocked: app.globalData.IsLocked,
35
-      IsShow: app.globalData.IsShow,
36
-      IsMember: app.globalData.userInfo.IsMember
37
     });
34
     });
38
 
35
 
39
     var that = this;
36
     var that = this;
@@ -55,6 +52,12 @@ Page({
55
     common.getStorageValue(this, "IsRemind", true, function () { });
52
     common.getStorageValue(this, "IsRemind", true, function () { });
56
   },
53
   },
57
   onShow: function () {
54
   onShow: function () {
55
+    this.setData({
56
+      IsLocked: app.globalData.IsLocked,
57
+      IsShow: app.globalData.IsShow,
58
+      IsMember: app.globalData.userInfo.IsMember
59
+    });
60
+
58
     if (wx.getStorageSync("HasActivate") == 1) {
61
     if (wx.getStorageSync("HasActivate") == 1) {
59
       wx.navigateTo({
62
       wx.navigateTo({
60
         url: '../../package4/main/activate',
63
         url: '../../package4/main/activate',

+ 11 - 7
pages/main/list.js

@@ -17,11 +17,19 @@ Page({
17
       BookID: bookID,
17
       BookID: bookID,
18
       IsShow: app.globalData.IsShow,
18
       IsShow: app.globalData.IsShow,
19
     });
19
     });
20
-
21
     common.getStorageValue(this, "IsRemind", true, function () { });
20
     common.getStorageValue(this, "IsRemind", true, function () { });
22
-
23
   },
21
   },
24
   onShow: function () {
22
   onShow: function () {
23
+    if (app.globalData.IsRefresh) {
24
+      wx.showLoading({
25
+        title: '请稍候',
26
+        mask: true,
27
+      });
28
+      setTimeout(function () {
29
+        wx.hideLoading();
30
+      }, 3000);
31
+      app.globalData.IsRefresh = false;
32
+    }
25
     this.init();
33
     this.init();
26
   },
34
   },
27
   init: function () {
35
   init: function () {
@@ -37,11 +45,7 @@ Page({
37
           var item = result.Units[j];
45
           var item = result.Units[j];
38
           if (app.globalData.userInfo.IsMember == 1)
46
           if (app.globalData.userInfo.IsMember == 1)
39
             item.IsLocked = 0;
47
             item.IsLocked = 0;
40
-          // var rnd = common.random(2, 5);
41
-          // item.Example = "";
42
-          // for (var k = 0; k < rnd; k++)
43
-          //   item.Example += item.Words[k].Name;
44
-
48
+          
45
           item.IsFinished = false;
49
           item.IsFinished = false;
46
           for (var k = 0; k < arrFinished.length; k++) {
50
           for (var k = 0; k < arrFinished.length; k++) {
47
             if (item.ID == arrFinished[k].UnitID) {
51
             if (item.ID == arrFinished[k].UnitID) {

+ 1 - 1
project.config.json

@@ -1,7 +1,7 @@
1
 {
1
 {
2
 	"description": "项目配置文件。",
2
 	"description": "项目配置文件。",
3
 	"setting": {
3
 	"setting": {
4
-		"urlCheck": true,
4
+		"urlCheck": false,
5
 		"es6": true,
5
 		"es6": true,
6
 		"postcss": true,
6
 		"postcss": true,
7
 		"minified": true,
7
 		"minified": true,

+ 0 - 2
utils/main.js

@@ -87,8 +87,6 @@ function payMoney(payType, buyType, money, detail, callback) {
87
               'signType': 'MD5',
87
               'signType': 'MD5',
88
               'paySign': data.paySign,
88
               'paySign': data.paySign,
89
               'success': function (res3) {
89
               'success': function (res3) {
90
-                app.globalData.userInfo.IsMember = 1;
91
-                app.globalData.userInfo.IsPay = 1;
92
                 console.log("success:" + res3);
90
                 console.log("success:" + res3);
93
                 callback(data);
91
                 callback(data);
94
               },
92
               },

+ 21 - 1
utils/util.js

@@ -375,6 +375,25 @@ function isChinese(temp) {
375
     return reg.test(temp);     /*进行验证*/
375
     return reg.test(temp);     /*进行验证*/
376
 }
376
 }
377
 
377
 
378
+function FormatMoney(money) {
379
+  var result;
380
+  if (money == 0)
381
+    result = "0.00";
382
+  else {
383
+    result = (Math.round(money) / 100).toString();
384
+    //console.log("1:"+result);
385
+    if (result.indexOf(".") >= 0) {
386
+      if (result.substr(result.indexOf(".")).length < 3)
387
+        result += "0";
388
+    }
389
+    else {
390
+      result += ".00";
391
+    }
392
+  }
393
+
394
+  return result;
395
+}
396
+
378
 module.exports = {
397
 module.exports = {
379
   formatTime: formatTime,
398
   formatTime: formatTime,
380
   formatDateCHS: formatDateCHS,
399
   formatDateCHS: formatDateCHS,
@@ -396,5 +415,6 @@ module.exports = {
396
   getWordArray: getWordArray,
415
   getWordArray: getWordArray,
397
   sortArrayByStringLength: sortArrayByStringLength,
416
   sortArrayByStringLength: sortArrayByStringLength,
398
   ReplaceAllString: ReplaceAllString,
417
   ReplaceAllString: ReplaceAllString,
399
-  IsChinese: isChinese
418
+  IsChinese: isChinese,
419
+  FormatMoney: FormatMoney,
400
 }
420
 }