chengjie 6 년 전
부모
커밋
1cc995f4aa
3개의 변경된 파일33개의 추가작업 그리고 18개의 파일을 삭제
  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 16
   globalData: {
17 17
     version: "1.1.0",
18
-    IsProduction: false,
18
+    IsProduction: true,
19 19
     ProgramID: 105,
20 20
     AppID: "wx1fef080f74481cbd",
21 21
     ProgramName: "数学计算题",

+ 24 - 14
pages/index/index.js

@@ -157,22 +157,32 @@ Page({
157 157
 
158 158
           //app.globalData.userInfo.AvatarUrl = param.avatarUrl;
159 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 186
             that.getPriceList();
177 187
           });
178 188
         }

+ 8 - 3
pages/main/default.js

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