From a1bde7bdd85d7cc8632ab169e42570b631571d6f Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期二, 30 九月 2025 11:43:11 +0800 Subject: [PATCH] 商品行为分析 --- pages/tabbar/user/my.vue | 48 +++++++++++++++++++++++++++++++++--------------- 1 files changed, 33 insertions(+), 15 deletions(-) diff --git a/pages/tabbar/user/my.vue b/pages/tabbar/user/my.vue index d3b8b31..7e56634 100644 --- a/pages/tabbar/user/my.vue +++ b/pages/tabbar/user/my.vue @@ -174,6 +174,7 @@ }; }, onLoad(option) { + this.actionParam.pageParams = JSON.stringify(option) console.log('-----------鍒嗕韩鍑虹殑鏁版嵁---------->', option) let shareStoreId = null; let shareTime = null; @@ -205,17 +206,6 @@ } catch (e) { console.error('瀛樺偍澶辫触锛�', e); } - }else{ - shareStoreId = uni.getStorageSync('shareStoreId'); - shareStoreId = uni.getStorageSync('shareTime'); - console.log('浠庣紦瀛樿鍙栧弬鏁�:', { shareStoreId, shareTime }); - // this.bindMemberAndStore(shareStoreId, shareTime) - if (shareStoreId && shareTime) { - console.log('妫�娴嬪埌鏈夋晥鍙傛暟锛岃皟鐢ㄥ悗绔帴鍙�'); - this.bindMemberAndStore(shareStoreId, shareTime); - } else { - console.log('鏃犳湁鏁堝弬鏁帮紝鎵ц姝e父閫昏緫'); - } } this.initCOS() }, @@ -232,10 +222,10 @@ param.pageStatus = "LEAVE" userAction(param) }, - onLoad(options) { - this.actionParam.pageParams = JSON.stringify(options) - this.initCOS() - }, + // onLoad(options) { + // + // this.initCOS() + // }, onShow() { getSessionId().then(res=>{ this.pageSessionNo = res.data.data @@ -246,6 +236,7 @@ userAction(param) } }) + this.userInfo = this.$options.filters.isLogin() || {}; if (this.$options.filters.isLogin("auth")) { this.getUserOrderNum(); @@ -254,6 +245,16 @@ this.couponNum = 0; this.footNum = 0; } + + let shareStoreId = uni.getStorageSync('shareStoreId'); + let shareTime = uni.getStorageSync('shareTime'); + console.log('浠庣紦瀛樿鍙栧弬鏁�:', { shareStoreId, shareTime }); + if (shareStoreId && shareTime) { + console.log('妫�娴嬪埌鏈夋晥鍙傛暟锛岃皟鐢ㄥ悗绔帴鍙�'); + this.bindMemberAndStore(shareStoreId, shareTime); + } else { + console.log('鏃犳湁鏁堝弬鏁帮紝鎵ц姝e父閫昏緫'); + } }, onPullDownRefresh() { this.getUserOrderNum(); @@ -270,6 +271,23 @@ mounted() { }, methods: { + // 瑙f瀽URL鍙傛暟 + parseUrlParams(url) { + const params = {}; + // 澶勭悊鍙兘瀛樺湪鐨刪ash锛堝鏋滄湁鐨勮瘽锛� + const cleanUrl = url.split('#')[0]; + const queryStr = cleanUrl.split('?')[1] || ''; + + queryStr.split('&').forEach(pair => { + const [key, value] = pair.split('='); + if (key) { + // 濡傛灉鍊煎瓨鍦紝鍒欒В鐮侊紝鍚﹀垯璁句负绌哄瓧绗︿覆 + params[key] = value ? decodeURIComponent(value) : ''; + } + }); + + return params; + }, async bindMemberAndStore(shareStoreId, shareTime){ let form ={ shareStoreId: shareStoreId, -- Gitblit v1.8.0