From 99e4714129260dc2f6fe88e23febf0e9d765714f Mon Sep 17 00:00:00 2001 From: xuwenbo <717567226@qq.com> Date: Sun, 13 Sep 2020 10:07:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=88=86=E4=BA=AB=E4=B8=8D=E8=83=BD=E7=94=9F?= =?UTF-8?q?=E6=88=90=E5=88=86=E9=94=80=E5=85=B3=E7=B3=BB->=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E8=BF=98=E6=98=AF=E6=9C=89=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/index.js | 2 +- pages/activity/GroupDetails/index.vue | 4 +- pages/activity/SeckillDetails/index.vue | 2 +- pages/shop/GoodsCon/index.vue | 2 +- utils/index.js | 103 +++++++++++++++++++++++- 5 files changed, 105 insertions(+), 8 deletions(-) diff --git a/config/index.js b/config/index.js index ee4afa4..c3ff1df 100644 --- a/config/index.js +++ b/config/index.js @@ -1,5 +1,5 @@ // export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api'; // export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api'; -export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api'; +export const VUE_APP_API_URL = 'http://192.168.31.223:8008/api'; export const VUE_APP_RESOURCES_URL = 'https://wx.yixiang.co/static'; diff --git a/pages/activity/GroupDetails/index.vue b/pages/activity/GroupDetails/index.vue index bf5e06d..dd6402f 100644 --- a/pages/activity/GroupDetails/index.vue +++ b/pages/activity/GroupDetails/index.vue @@ -135,7 +135,7 @@ - + 收藏 @@ -254,7 +254,7 @@ return { title: this.storeInfo.title, imageUrl: this.storeInfo.image, - path: "pages/activity/GroupDetails/index?id="+this.storeInfo.id+"&spread=" + uni.getStorageSync("uid"), + path: "pages/activity/GroupDetails/index?id="+this.storeInfo.id+"&spread=" + uni.getStorageSync("uid")+"&pageType=good&codeType=routine", success(res) { uni.showToast({ title: '分享成功' diff --git a/pages/activity/SeckillDetails/index.vue b/pages/activity/SeckillDetails/index.vue index 63482d7..a7c2f04 100644 --- a/pages/activity/SeckillDetails/index.vue +++ b/pages/activity/SeckillDetails/index.vue @@ -171,7 +171,7 @@ return { title: this.storeInfo.title, imageUrl: this.storeInfo.image, - path: "pages/activity/GoodsSeckill/index?id=" + this.storeInfo.id + "&spread=" + uni.getStorageSync("uid"), + path: "pages/activity/GoodsSeckill/index?id=" + this.storeInfo.id + "&spread=" + uni.getStorageSync("uid")+"&pageType=good&codeType=routine", success(res) { uni.showToast({ title: '分享成功' diff --git a/pages/shop/GoodsCon/index.vue b/pages/shop/GoodsCon/index.vue index 33e22aa..4852dad 100644 --- a/pages/shop/GoodsCon/index.vue +++ b/pages/shop/GoodsCon/index.vue @@ -326,7 +326,7 @@ return { title: this.storeInfo.storeName, imageUrl: this.storeInfo.image, - path: "pages/shop/GoodsCon/index?id=" + this.storeInfo.id + "&spread=" + uni.getStorageSync("uid"), + path: "pages/shop/GoodsCon/index?id=" + this.storeInfo.id + "&spread=" + uni.getStorageSync("uid")+"&pageType=good&codeType=routine", success(res) { uni.showToast({ title: '分享成功' diff --git a/utils/index.js b/utils/index.js index 36d810b..eaf884b 100644 --- a/utils/index.js +++ b/utils/index.js @@ -818,9 +818,105 @@ export const handleLoginFailure = () => { console.log(store.getters) console.log('————————') store.commit("updateAuthorizationPage", true); - let path = '/' + getCurrentPageUrlWithArgs() + console.log("getCurrentPageUrl",getCurrentPageUrl()); + //判断小程序转发分享商品详情进来的 + if (getCurrentPageUrl() == 'pages/shop/GoodsCon/index' && handleUrlParam(path) && !handleQrCode()) { + debugger; + console.log('————————') + console.log('判断小程序转发分享商品详情进来的') + console.log(' handleUrlParam()', handleUrlParam(path)) + + let url = handleUrlParam(path); + console.log(url) + if (url) { + path = parseUrl({ + path: `/${getCurrentPageUrl()}`, + query: { + id: url.id, + } + }) + cookie.set("spread", url.spread || 0); + } else { + handleNoParameters() + console.log('————————') + console.log('是扫描的商品详情进来的,但是没有获取到参数') + console.log('————————') + } + } + // 是分享转发拼团进来的 + if (getCurrentPageUrl() == 'pages/activity/GroupDetails/index' && handleUrlParam(path) && !handleQrCode()) { + console.log('————————') + console.log('是分享转发拼团进来的') + console.log('————————') + + let url = handleUrlParam(path); + console.log(url) + if (url) { + path = parseUrl({ + path: `/${getCurrentPageUrl()}`, + query: { + id: url.id, + } + }) + cookie.set("spread", url.spread || 0); + } else { + console.log('————————') + console.log('是拼团进来的,但是没有获取到参数') + console.log('————————') + handleNoParameters() + } + } + + // 是分享转发秒杀进来的 + if (getCurrentPageUrl() == 'pages/activity/SeckillDetails/index' && handleUrlParam(path) && !handleQrCode()) { + console.log('————————') + console.log('是分享转发秒杀进来的') + console.log('————————') + + let url = handleUrlParam(path); + console.log(url) + if (url) { + path = parseUrl({ + path: `/${getCurrentPageUrl()}`, + query: { + id: url.id, + } + }) + cookie.set("spread", url.spread || 0); + } else { + console.log('————————') + console.log('是秒杀进来的,但是没有获取到参数') + console.log('————————') + handleNoParameters() + } + } + + // 判断是不是转发分享的砍价海报进来的 + if (getCurrentPageUrl() == 'pages/activity/DargainDetails/index' && handleUrlParam(path) && !handleQrCode()) { + console.log('————————') + console.log('判断是不是转发分享的砍价海报进来的') + console.log('————————') + let url = handleUrlParam(path); + if (url) { + path = parseUrl({ + path: `/${getCurrentPageUrl()}`, + query: { + id: url.bargainId, + partake: url.uid + } + }) + cookie.set("spread", url.spread || 0); + } else { + handleNoParameters() + console.log('————————') + console.log('是扫描的砍价海报进来的,但是没有获取到参数') + console.log('————————') + + + } + } // 判断是不是拼团进来的 if (getCurrentPageUrl() == 'pages/activity/GroupRule/index' && handleQrCode()) { console.log('————————') @@ -836,7 +932,7 @@ export const handleLoginFailure = () => { id: url.pinkId, } }) - // cookie.set("spread", url.spread || 0); + cookie.set("spread", url.spread || 0); } else { console.log('————————') console.log('是拼团进来的,但是没有获取到参数') @@ -859,7 +955,7 @@ export const handleLoginFailure = () => { partake: url.uid } }) - // cookie.set("spread", url.spread || 0); + cookie.set("spread", url.spread || 0); } else { handleNoParameters() console.log('————————') @@ -871,6 +967,7 @@ export const handleLoginFailure = () => { } if (getCurrentPageUrl() == 'pages/shop/GoodsCon/index' && handleQrCode()) { + debugger; console.log('————————') console.log('是扫描的商品详情') console.log('————————')