diff --git a/api/model/recyclingDestination.js b/api/model/recyclingDestination.js index 5e139a0..0fe8ba1 100644 --- a/api/model/recyclingDestination.js +++ b/api/model/recyclingDestination.js @@ -32,6 +32,12 @@ const api = { method: 'POST', auth : true, }, + // 查询当前用户直推间推了多少人 + getPromotionCount: { + url: '/recycle-admin/applet/promotion/getPromotionCount', + method: 'GET', + auth : true, + }, } export default api \ No newline at end of file diff --git a/main.js b/main.js index fb1ea58..72e5195 100644 --- a/main.js +++ b/main.js @@ -34,7 +34,7 @@ export function createApp() { const logoImage = uni.getStorageSync('logoImage') || '' return { title: '欢迎体验'+(logoName), - path: '/pages/component/home?shareId=' + (userInfo.shareId || ''), + path: '/pages/index/index?shareId=' + (userInfo.id || ''), imageUrl: logoImage } }, @@ -43,7 +43,7 @@ export function createApp() { const userInfo = uni.getStorageSync('userInfo') || {}; return { title: '欢迎体验'+(logoName), - query: 'shareId=' + (userInfo.shareId || ''), + query: 'shareId=' + (userInfo.id || ''), imageUrl: logoImage } } diff --git a/pages/component/home.vue b/pages/component/home.vue index 4bd4ea8..aa60f97 100644 --- a/pages/component/home.vue +++ b/pages/component/home.vue @@ -607,9 +607,9 @@ onLoad(query) { // 保存query参数 this.queryParams = query - if (query.shareId) { - uni.setStorageSync('shareId', query.shareId) - } + if (query.shareId) { + uni.setStorageSync('shareId', query.shareId) + } // 检查App数据是否已经准备好 if (!getApp().globalData.isAppDataReady) { diff --git a/pages/index/index.vue b/pages/index/index.vue index 1c2cf8b..63cf20d 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -76,7 +76,10 @@ return item ? item.keyContent : '' } }, - onLoad() { + onLoad(query) { + if (query.shareId) { + uni.setStorageSync('shareId', query.shareId) + } this.getConfigData() }, methods: { @@ -183,6 +186,7 @@ uni.hideLoading(); // console.log(res) uni.setStorageSync('token', res.result.token); + uni.setStorageSync('userInfo', res.result.userInfo) uni.setStorageSync('openid', res.result.userInfo && res.result.userInfo .appletOpenid); getApp().globalData.login_status = true; @@ -193,7 +197,6 @@ url: '/pages/wxUserInfo' }); } else { - uni.setStorageSync('userInfo', userInfo) uni.reLaunch({ url: '/pages/component/home' });