Browse Source

小程序详情页面分享不能生成分销关系->首页还是有问题。

master
xuwenbo 5 years ago
parent
commit
99e4714129
  1. 2
      config/index.js
  2. 2
      pages/activity/GroupDetails/index.vue
  3. 2
      pages/activity/SeckillDetails/index.vue
  4. 2
      pages/shop/GoodsCon/index.vue
  5. 103
      utils/index.js

2
config/index.js

@ -1,5 +1,5 @@
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api'; // 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://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'; export const VUE_APP_RESOURCES_URL = 'https://wx.yixiang.co/static';

2
pages/activity/GroupDetails/index.vue

@ -254,7 +254,7 @@
return { return {
title: this.storeInfo.title, title: this.storeInfo.title,
imageUrl: this.storeInfo.image, 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) { success(res) {
uni.showToast({ uni.showToast({
title: '分享成功' title: '分享成功'

2
pages/activity/SeckillDetails/index.vue

@ -171,7 +171,7 @@
return { return {
title: this.storeInfo.title, title: this.storeInfo.title,
imageUrl: this.storeInfo.image, 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) { success(res) {
uni.showToast({ uni.showToast({
title: '分享成功' title: '分享成功'

2
pages/shop/GoodsCon/index.vue

@ -326,7 +326,7 @@
return { return {
title: this.storeInfo.storeName, title: this.storeInfo.storeName,
imageUrl: this.storeInfo.image, 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) { success(res) {
uni.showToast({ uni.showToast({
title: '分享成功' title: '分享成功'

103
utils/index.js

@ -818,9 +818,105 @@ export const handleLoginFailure = () => {
console.log(store.getters) console.log(store.getters)
console.log('————————') console.log('————————')
store.commit("updateAuthorizationPage", true); store.commit("updateAuthorizationPage", true);
let path = '/' + getCurrentPageUrlWithArgs() 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()) { if (getCurrentPageUrl() == 'pages/activity/GroupRule/index' && handleQrCode()) {
console.log('————————') console.log('————————')
@ -836,7 +932,7 @@ export const handleLoginFailure = () => {
id: url.pinkId, id: url.pinkId,
} }
}) })
// cookie.set("spread", url.spread || 0); cookie.set("spread", url.spread || 0);
} else { } else {
console.log('————————') console.log('————————')
console.log('是拼团进来的,但是没有获取到参数') console.log('是拼团进来的,但是没有获取到参数')
@ -859,7 +955,7 @@ export const handleLoginFailure = () => {
partake: url.uid partake: url.uid
} }
}) })
// cookie.set("spread", url.spread || 0); cookie.set("spread", url.spread || 0);
} else { } else {
handleNoParameters() handleNoParameters()
console.log('————————') console.log('————————')
@ -871,6 +967,7 @@ export const handleLoginFailure = () => {
} }
if (getCurrentPageUrl() == 'pages/shop/GoodsCon/index' && handleQrCode()) { if (getCurrentPageUrl() == 'pages/shop/GoodsCon/index' && handleQrCode()) {
debugger;
console.log('————————') console.log('————————')
console.log('是扫描的商品详情') console.log('是扫描的商品详情')
console.log('————————') console.log('————————')

Loading…
Cancel
Save