| | |
| | | }; |
| | | }, |
| | | onLoad(option) { |
| | | this.actionParam.pageParams = JSON.stringify(option) |
| | | console.log('-----------分享出的数据---------->', option) |
| | | let shareStoreId = null; |
| | | let shareTime = null; |
| | |
| | | } 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('无有效参数,执行正常逻辑'); |
| | | } |
| | | } |
| | | this.initCOS() |
| | | }, |
| | |
| | | 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 |
| | |
| | | userAction(param) |
| | | } |
| | | }) |
| | | |
| | | this.userInfo = this.$options.filters.isLogin() || {}; |
| | | if (this.$options.filters.isLogin("auth")) { |
| | | this.getUserOrderNum(); |
| | |
| | | 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('无有效参数,执行正常逻辑'); |
| | | } |
| | | }, |
| | | onPullDownRefresh() { |
| | | this.getUserOrderNum(); |
| | |
| | | |
| | | mounted() { }, |
| | | methods: { |
| | | // 解析URL参数 |
| | | parseUrlParams(url) { |
| | | const params = {}; |
| | | // 处理可能存在的hash(如果有的话) |
| | | 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, |