chengjie 7 anni fa
parent
commit
1cc995f4aa
3 ha cambiato i file con 33 aggiunte e 18 eliminazioni
  1. 1 1
      app.js
  2. 24 14
      pages/index/index.js
  3. 8 3
      pages/main/default.js

+ 1 - 1
app.js

@@ -15,7 +15,7 @@ App({
15
   },
15
   },
16
   globalData: {
16
   globalData: {
17
     version: "1.1.0",
17
     version: "1.1.0",
18
-    IsProduction: false,
18
+    IsProduction: true,
19
     ProgramID: 105,
19
     ProgramID: 105,
20
     AppID: "wx1fef080f74481cbd",
20
     AppID: "wx1fef080f74481cbd",
21
     ProgramName: "数学计算题",
21
     ProgramName: "数学计算题",

+ 24 - 14
pages/index/index.js

@@ -157,22 +157,32 @@ Page({
157
 
157
 
158
           //app.globalData.userInfo.AvatarUrl = param.avatarUrl;
158
           //app.globalData.userInfo.AvatarUrl = param.avatarUrl;
159
           that.getQuestionType(function () {
159
           that.getQuestionType(function () {
160
-            setTimeout(function () {
161
-              common.getStorageValue(that, "IsStart", false, function () {
162
-                if (that.data.IsStart) {
163
 
160
 
164
-                  wx.redirectTo({
165
-                    url: '../main/default'
166
-                  })
167
-
168
-                }
169
-                else {
170
-                  wx.redirectTo({
171
-                    url: '../main/help'
172
-                  })
173
-                }
161
+            if (that.data.ProductID) {
162
+              var url = "../../package4/main/activateOK?ProductID=" + that.data.ProductID
163
+                + "&ProductUserID=" + that.data.ProductUserID
164
+                + "&CurrentUserID=" + app.globalData.userInfo.UserID
165
+                + "&CurrentProductID=" + app.globalData.ProgramID;
166
+              wx.redirectTo({
167
+                url: url
174
               });
168
               });
175
-            }, 2000);
169
+            }
170
+            else {
171
+              setTimeout(function () {
172
+                common.getStorageValue(that, "IsStart", false, function () {
173
+                  if (that.data.IsStart) {
174
+                    wx.redirectTo({
175
+                      url: '../main/default'
176
+                    })
177
+                  }
178
+                  else {
179
+                    wx.redirectTo({
180
+                      url: '../main/help'
181
+                    })
182
+                  }
183
+                });
184
+              }, 2000);
185
+            }
176
             that.getPriceList();
186
             that.getPriceList();
177
           });
187
           });
178
         }
188
         }

+ 8 - 3
pages/main/default.js

@@ -24,18 +24,22 @@ Page({
24
       NickName: app.globalData.userInfo.NickName,
24
       NickName: app.globalData.userInfo.NickName,
25
       AvatarUrl: app.globalData.userInfo.AvatarUrl,
25
       AvatarUrl: app.globalData.userInfo.AvatarUrl,
26
     });
26
     });
27
-    
28
     wx.login({
27
     wx.login({
29
       success: function (res0) {
28
       success: function (res0) {
30
         code = res0.code;
29
         code = res0.code;
31
       }
30
       }
32
     });
31
     });
33
-    
32
+
34
   },
33
   },
35
   onUnload: function () {
34
   onUnload: function () {
36
-    
35
+
37
   },
36
   },
38
   onShow: function () {
37
   onShow: function () {
38
+    if (wx.getStorageSync("HasActivate") == 1) {
39
+      wx.navigateTo({
40
+        url: '../../package4/main/activate',
41
+      });
42
+    }
39
     var list = wx.getStorageSync("AnswerList");
43
     var list = wx.getStorageSync("AnswerList");
40
     var answerLength = 0;
44
     var answerLength = 0;
41
     if (list && list.length > 0) {
45
     if (list && list.length > 0) {
@@ -71,6 +75,7 @@ Page({
71
         }
75
         }
72
       }
76
       }
73
     });
77
     });
78
+
74
   },
79
   },
75
   downloadUserAvatar: function () {
80
   downloadUserAvatar: function () {
76
     var avatar = wx.getStorageSync("Avatar");
81
     var avatar = wx.getStorageSync("Avatar");