Ver código fonte

修复我的页面阅读记录跳转问题

hank 1 ano atrás
pai
commit
7f984679e7
4 arquivos alterados com 22 adições e 17 exclusões
  1. 7 2
      config/config.js
  2. 1 1
      destroy/config.json
  3. 13 13
      pages/mine/mine.js
  4. 1 1
      project.config.json

+ 7 - 2
config/config.js

@@ -59,7 +59,12 @@ const appInfoObj = {
         appid: 'wxdabfa5e02785fe9b',
         ghid: 'gh_cb3eb04d904c',
         appName: '稻阅视觉',
-        ads: {},
+        ads: {
+            insertAdId: 'adunit-2be3e81517d06870',
+            rewardAdId: 'adunit-f227f9580844948a',
+            bookmarkAdId: 'adunit-76e2c4d9e0dd6cfa',
+            templateAdId: 'adunit-2150b3c315deb165'
+        },
     },
     wx37dab28af5492d98: {
         appid: 'wx37dab28af5492d98',
@@ -276,7 +281,7 @@ const appInfoObj = {
 };
 
 // @config 确定使用的小程序appid
-const appid = 'wx8a8aae7f462df482';
+const appid = 'wxdabfa5e02785fe9b';
 export const apple = {
     ...appInfoObj[appid],
     appKey: '49TBR8Z1rA7PyqD30FV0v48AU',

+ 1 - 1
destroy/config.json

@@ -1,6 +1,6 @@
 {
   "version": "2.4.2",
-  "desc": "2.4.2优化一些问题",
+  "desc": "2.4.2 优化一些问题",
   "appIds": [
     {
       "name": "视读空间",

+ 13 - 13
pages/mine/mine.js

@@ -17,10 +17,6 @@ Page({
 
     onLoad: function (options) {
         this.autoLogin();
-        this.setData({
-            userCode: app.globalData.userCode
-        });
-        console.log('', app.globalData);
     },
 
     onShow() {
@@ -41,7 +37,8 @@ Page({
             const token = wx.getStorageSync('accessToken');
             if (token) {
                 this.setData({
-                    isLoggedIn: true
+                    isLoggedIn: true,
+                    userCode: app.globalData.userCode
                 });
                 // 已经登录
                 console.log('已经登录')
@@ -50,12 +47,15 @@ Page({
                 return;
             }
             // 未登录,执行登录
-            const res = await app.login();
-            this.setData({
-                isLoggedIn: true
+            const res = await app.login().then(res => {
+                console.log('用户ID:', app.globalData.userCode)
+                this.setData({
+                    isLoggedIn: true,
+                    userCode: app.globalData.userCode
+                });
+                console.log('重新登录', res)
+                this.interstitalLoad();
             });
-            console.log('重新登录', res)
-            this.interstitalLoad();
         } catch (error) {
             console.error('登录失败:', error);
         }
@@ -93,8 +93,8 @@ Page({
 
     goToReadingHistory() {
         SendEvent('mine_reading_history', {"uuid": app.globalData.uuid});
-        wx.navigateTo({
-            url: '/pages/readingHistory/readingHistory'
-        })
+        wx.switchTab({
+            url: '/pages/bookshelf/bookshelf'
+        });
     }
 })

+ 1 - 1
project.config.json

@@ -27,6 +27,6 @@
     "tabIndent": "auto",
     "tabSize": 2
   },
-  "appid": "wx3800bb2ed4a326c5",
+  "appid": "wxdabfa5e02785fe9b",
   "testRoot": "minitest/"
 }