chengjie 6 年 前
コミット
32675ae344
共有3 個のファイルを変更した87 個の追加78 個の削除を含む
  1. 1 1
      app.js
  2. 80 75
      pages/main/default.js
  3. 6 2
      pages/main/searchWeb2.js

+ 1 - 1
app.js

@@ -26,7 +26,7 @@ App({
26 26
     }
27 27
   },
28 28
   globalData: {
29
-    Version: "1.4.4",
29
+    Version: "1.4.5",
30 30
     IsProduction: true,
31 31
     ShareTitle: "高效学习从秒过开始",
32 32
     SharePath: "pages/index/index",

+ 80 - 75
pages/main/default.js

@@ -39,92 +39,97 @@ Page({
39 39
   },
40 40
   onShow: function () {
41 41
     var that = this;
42
-    wx.getSetting({
43
-      success(res) {
44
-        if (res.authSetting['scope.userInfo'] || app.globalData.userInfo.IsShow == 0) {
45
-
46
-          if (!app.globalData.userInfo.IsMember && app.globalData.userInfo.IsShow == 1){
47
-            if (app.globalData.userInfo.Subscribe == 1) {
48
-              wx.navigateTo({
49
-                url: '../other/userbook',
50
-              });
51
-              app.globalData.GotoUrl = "";
52
-            }
53
-            else{
54
-              wx.redirectTo({
55
-                url: '../other/newuser',
56
-              });
42
+    if (!app.globalData.userInfo.IsMember && app.globalData.userInfo.IsShow == 1) {
43
+      if (app.globalData.userInfo.Subscribe == 0) {
44
+        wx.redirectTo({
45
+          url: '../other/newuser',
46
+        });
47
+      }
48
+    }
49
+    else {
50
+      wx.getSetting({
51
+        success(res) {
52
+          if (res.authSetting['scope.userInfo'] || app.globalData.userInfo.IsShow == 0) {
53
+            if (!app.globalData.userInfo.IsMember && app.globalData.userInfo.IsShow == 1) {
54
+              if (app.globalData.userInfo.Subscribe == 1) {
55
+                wx.navigateTo({
56
+                  url: '../other/userbook',
57
+                });
58
+                app.globalData.GotoUrl = "";
59
+              }
57 60
             }
58
-          }
59
-          else if (app.globalData.userInfo.IsMember && app.globalData.userInfo.IsShow == 1){
60
-            var productServiceTime = common.formatDateCHS(common.formatTime(new Date(app.globalData.userInfo.ProductServiceTime)));
61
-            var today = common.formatDateCHS(common.formatTime(new Date()));
62
-            if (productServiceTime < today) {
63
-              wx.redirectTo({
64
-                url: '../other/userbook',
65
-              });
61
+            else if (app.globalData.userInfo.IsMember && app.globalData.userInfo.IsShow == 1) {
62
+              var productServiceTime = common.formatDateCHS(common.formatTime(new Date(app.globalData.userInfo.ProductServiceTime)));
63
+              var today = common.formatDateCHS(common.formatTime(new Date()));
64
+              if (productServiceTime < today) {
65
+                wx.redirectTo({
66
+                  url: '../other/userbook',
67
+                });
68
+              }
69
+              else if (app.globalData.userInfo.ClassDayNumber < 0) {
70
+                wx.redirectTo({
71
+                  url: '../other/userbook',
72
+                });
73
+              }
74
+              else if (app.globalData.GotoUrl) {
75
+                //console.log(app.globalData.GotoUrl);
76
+                wx.navigateTo({
77
+                  url: app.globalData.GotoUrl,
78
+                });
79
+                app.globalData.GotoUrl = "";
80
+              }
66 81
             }
67
-            else if (app.globalData.userInfo.ClassDayNumber<0){
68
-              wx.redirectTo({
69
-                url: '../other/userbook',
70
-              });
82
+            else if (app.globalData.userInfo.IsShow == 0) {
83
+              main.buildInitData(function () { });
71 84
             }
72
-            else if (app.globalData.GotoUrl) {
73
-              //console.log(app.globalData.GotoUrl);
74
-              wx.navigateTo({
75
-                url: app.globalData.GotoUrl,
85
+
86
+            that.setData({
87
+              IsAccredit: true,
88
+            });
89
+
90
+            common.getStorageValue(that, "UserName", "秒过", function () {
91
+              wx.setNavigationBarTitle({
92
+                title: that.data.UserName
76 93
               });
77
-              app.globalData.GotoUrl="";
78
-            }
79
-          }
80
-          else if (app.globalData.userInfo.IsShow == 0){
81
-            main.buildInitData(function () {});
82
-          }
83
-          
84
-          that.setData({
85
-            IsAccredit: true,
86
-          });
87
-
88
-          common.getStorageValue(that, "UserName", "秒过", function () {
89
-            wx.setNavigationBarTitle({
90
-              title: that.data.UserName
91 94
             });
92
-          });
93
-
94
-          //判断是否出现推广广告
95
-          common.getStorageValue(that, "IsShowMarketing", app.globalData.userInfo.HasIntroducer, function () {
96
-            if (app.globalData.userInfo.HasIntroducer==0 && that.data.IsShowMarketing==3){
97
-              var isShowMarketingTime = wx.getStorageSync("IsShowMarketingTime");
98
-              if (common.formatTime(new Date()) >= isShowMarketingTime) {
99
-                wx.removeStorageSync("IsShowMarketing");
100
-                wx.removeStorageSync("IsShowMarketingTime");
101
-                that.setData({
102
-                  IsShowMarketing:0,
103
-                });
95
+
96
+            //判断是否出现推广广告
97
+            common.getStorageValue(that, "IsShowMarketing", app.globalData.userInfo.HasIntroducer, function () {
98
+              if (app.globalData.userInfo.HasIntroducer == 0 && that.data.IsShowMarketing == 3) {
99
+                var isShowMarketingTime = wx.getStorageSync("IsShowMarketingTime");
100
+                if (common.formatTime(new Date()) >= isShowMarketingTime) {
101
+                  wx.removeStorageSync("IsShowMarketing");
102
+                  wx.removeStorageSync("IsShowMarketingTime");
103
+                  that.setData({
104
+                    IsShowMarketing: 0,
105
+                  });
106
+                }
104 107
               }
105
-            }
106
-          });
108
+            });
107 109
 
108
-          that.init();
110
+            that.init();
109 111
 
110
-          that.getTaskTodayList();
112
+            that.getTaskTodayList();
111 113
 
112
-          that.isNoSavedCard();
113
-        }
114
-        else {
115
-          wx.navigateTo({
116
-            url: '../index/accredit',
117
-          });
118
-        }
114
+            that.isNoSavedCard();
115
+          }
116
+          else {
117
+            wx.navigateTo({
118
+              url: '../index/accredit',
119
+            });
120
+          }
119 121
 
120
-        if (res.authSetting['scope.record'] === true) {
121
-          app.globalData.IsRecorderAccredit = 1;
122
-        }
123
-        else if (res.authSetting['scope.record'] === false) {
124
-          app.globalData.IsRecorderAccredit = -1;
122
+          if (res.authSetting['scope.record'] === true) {
123
+            app.globalData.IsRecorderAccredit = 1;
124
+          }
125
+          else if (res.authSetting['scope.record'] === false) {
126
+            app.globalData.IsRecorderAccredit = -1;
127
+          }
125 128
         }
126
-      }
127
-    });
129
+      });
130
+    }
131
+
132
+    
128 133
     wx.setNavigationBarColor({
129 134
       frontColor: "#ffffff",
130 135
       backgroundColor: "#3157BA",

+ 6 - 2
pages/main/searchWeb2.js

@@ -135,8 +135,12 @@ Page({
135 135
                 str = "[读 src='" + item.SoundMark + "']" + item.Content + "[/读]";
136 136
               }
137 137
               else if (item.Tag == "拼音" || item.Tag == "默写") {
138
-                if (item.SoundMark)
139
-                  str = "[读 src='" + item.SoundMark + "']" + item.Content + "[/读]";
138
+                if (item.SoundMark){
139
+                  if (this.data.Result.CHN.HanZi)
140
+                    str = "[读 src='" + this.data.Result.CHN.HanZi + "']" + item.Content + "[/读]";
141
+                  else
142
+                    str = "[读 src='" + item.SoundMark + "']" + item.Content + "[/读]";
143
+                }
140 144
                 else
141 145
                   str = "[读]" + item.Content + "[/读]";
142 146
               }