修复分销和商品详情无法生成关系的问题
This commit is contained in:
10
main.js
10
main.js
@ -38,14 +38,6 @@ Vue.prototype.$validator = function (rule) {
|
|||||||
return new schema(rule);
|
return new schema(rule);
|
||||||
};
|
};
|
||||||
|
|
||||||
// const CACHE_KEY = "clear_0.0.1";
|
|
||||||
|
|
||||||
// if (!cookie.has(CACHE_KEY)) {
|
|
||||||
// cookie.clearAll();
|
|
||||||
// cookie.set(CACHE_KEY, 1);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
App.mpType = 'app'
|
App.mpType = 'app'
|
||||||
Vue.prototype.$store = store
|
Vue.prototype.$store = store
|
||||||
@ -128,7 +120,7 @@ import { isWeixin } from '@/utils'
|
|||||||
const CACHE_KEY = "clear_0.0.1";
|
const CACHE_KEY = "clear_0.0.1";
|
||||||
|
|
||||||
if (!cookie.has(CACHE_KEY)) {
|
if (!cookie.has(CACHE_KEY)) {
|
||||||
cookie.clearAll();
|
cookie.clearAll()
|
||||||
cookie.set(CACHE_KEY, 1);
|
cookie.set(CACHE_KEY, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,36 +48,20 @@
|
|||||||
} else if (spread === 0 || typeof spread !== "number") {
|
} else if (spread === 0 || typeof spread !== "number") {
|
||||||
cookie.set("spread", urlSpread || 0);
|
cookie.set("spread", urlSpread || 0);
|
||||||
}
|
}
|
||||||
if (this.$store.getters.token) {
|
|
||||||
this.toLaunch();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
// if (this.$deviceType == "app" || this.$deviceType == "weixinh5") {
|
||||||
|
|
||||||
// cookie.get("spread");
|
|
||||||
// if (this.$deviceType == "weixin") {
|
|
||||||
// let path = parseQuery().path
|
|
||||||
// console.log(this)
|
|
||||||
// if (path) {
|
|
||||||
// this.$yrouter.push({
|
|
||||||
// path
|
|
||||||
// });
|
|
||||||
// } else {
|
|
||||||
// this.$yrouter.switchTab({
|
// this.$yrouter.switchTab({
|
||||||
// path: "/pages/home/index"
|
// path: "/pages/home/index"
|
||||||
// });
|
// });
|
||||||
|
// return;
|
||||||
// }
|
// }
|
||||||
|
if (this.$store.getters.token) {
|
||||||
// return
|
// 如果token存在,直接进行进页面
|
||||||
// }
|
console.log('登录状态存在,直接进页面')
|
||||||
// this.toLaunch();
|
this.toLaunch();
|
||||||
if (this.$deviceType == "app" || this.$deviceType == "weixinh5") {
|
|
||||||
// this.toLaunch();
|
|
||||||
this.$yrouter.switchTab({
|
|
||||||
path: "/pages/home/index"
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
console.log('进行登录操作')
|
||||||
login().finally(() => {
|
login().finally(() => {
|
||||||
this.$yrouter.switchTab({
|
this.$yrouter.switchTab({
|
||||||
path: "/pages/home/index"
|
path: "/pages/home/index"
|
||||||
@ -89,9 +73,18 @@
|
|||||||
toLaunch() {
|
toLaunch() {
|
||||||
console.log("loading home");
|
console.log("loading home");
|
||||||
this.changeAuthorization(false);
|
this.changeAuthorization(false);
|
||||||
this.$yrouter.switchTab({
|
let redirect = cookie.get('redirect')
|
||||||
path: "/pages/home/index"
|
if (redirect) {
|
||||||
|
redirect = redirect.split('/pages')[1]
|
||||||
|
this.$yrouter.replace({
|
||||||
|
path: '/pages' + redirect,
|
||||||
});
|
});
|
||||||
|
cookie.remove('redirect');
|
||||||
|
} else {
|
||||||
|
this.$yrouter.replace({
|
||||||
|
path: '/pages/home/index',
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="bargain on">
|
<view class="bargain on">
|
||||||
<!-- 在header上加 on 为请求支援 -->
|
<!-- 在header上加 on 为请求支援 -->
|
||||||
<view :class="[bargainPartake != userInfo.uid ? 'wrapper bargain-box on user' : 'wrapper bargain-box user']" v-if="bargainPartake != userInfo.uid">
|
<view :class="[bargainPartake != userInfo.uid ? 'wrapper bargain-box on user' : 'wrapper bargain-box user']"
|
||||||
|
v-if="bargainUserInfo && bargainPartake != userInfo.uid">
|
||||||
<!-- <view class="people">{{ lookCount }}人查看 丨 {{ shareCount }}人分享 丨 {{ userCount }}人参与</view> -->
|
<!-- <view class="people">{{ lookCount }}人查看 丨 {{ shareCount }}人分享 丨 {{ userCount }}人参与</view> -->
|
||||||
<!-- 帮助砍价、帮砍成功:-->
|
<!-- 帮助砍价、帮砍成功:-->
|
||||||
<view class="pictxt acea-row row-center-wrapper ">
|
<view class="pictxt acea-row row-center-wrapper ">
|
||||||
@ -505,11 +506,17 @@
|
|||||||
that.helpListStatus = res.data.length < that.limit;
|
that.helpListStatus = res.data.length < that.limit;
|
||||||
that.helpListLoading = false;
|
that.helpListLoading = false;
|
||||||
that.page++;
|
that.page++;
|
||||||
|
if (res.data) {
|
||||||
that.bargainHelpList.push.apply(that.bargainHelpList, res.data);
|
that.bargainHelpList.push.apply(that.bargainHelpList, res.data);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(res => {
|
.catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
if(!err.msg){
|
||||||
|
return
|
||||||
|
}
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: err.msg || err.response.data.msg || err.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -303,8 +303,15 @@
|
|||||||
computed: mapGetters(["isLogin", "location"]),
|
computed: mapGetters(["isLogin", "location"]),
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
let url = handleQrCode();
|
let url = handleQrCode();
|
||||||
if (url && url.productId) {
|
if (url && url.id) {
|
||||||
this.id = url.productId;
|
this.id = url.id;
|
||||||
|
var spread = cookie.get("spread");
|
||||||
|
let urlSpread = parseInt(url.spread);
|
||||||
|
if (!Number.isNaN(urlSpread) && spread !== urlSpread) {
|
||||||
|
cookie.set("spread", urlSpread || 0);
|
||||||
|
} else if (spread === 0 || typeof spread !== "number") {
|
||||||
|
cookie.set("spread", urlSpread || 0);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.id = this._route.query.id;
|
this.id = this._route.query.id;
|
||||||
}
|
}
|
||||||
@ -326,7 +333,8 @@
|
|||||||
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")+"&pageType=good&codeType=routine",
|
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: '分享成功'
|
||||||
|
@ -39,14 +39,7 @@ const vuexStore = new Vuex.Store({
|
|||||||
console.log('清除数据')
|
console.log('清除数据')
|
||||||
state.token = null;
|
state.token = null;
|
||||||
state.userInfo = null
|
state.userInfo = null
|
||||||
let spread = cookie.get('spread')
|
|
||||||
let redirect = cookie.get('redirect')
|
|
||||||
let outTime = setTimeout(() => {
|
|
||||||
clearTimeout(outTime)
|
|
||||||
cookie.clearAll()
|
cookie.clearAll()
|
||||||
cookie.set('redirect', redirect)
|
|
||||||
cookie.set('spread', spread)
|
|
||||||
}, 100)
|
|
||||||
},
|
},
|
||||||
backgroundColor(state, color) {
|
backgroundColor(state, color) {
|
||||||
state.color = color;
|
state.color = color;
|
||||||
|
@ -218,6 +218,7 @@ export const login = () => {
|
|||||||
reLaunch({
|
reLaunch({
|
||||||
path: '/pages' + redirect,
|
path: '/pages' + redirect,
|
||||||
});
|
});
|
||||||
|
cookie.remove('redirect');
|
||||||
} else {
|
} else {
|
||||||
reLaunch({
|
reLaunch({
|
||||||
path: '/pages/home/index',
|
path: '/pages/home/index',
|
||||||
@ -226,38 +227,16 @@ export const login = () => {
|
|||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
reject('当前运行环境为微信浏览器')
|
reject('当前运行环境为微信浏览器')
|
||||||
location.replace("/pages/home/index");
|
reLaunch({
|
||||||
|
path: '/pages/home/index',
|
||||||
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// wechat().then(() => oAuth());
|
|
||||||
}
|
}
|
||||||
// if (!code) {
|
|
||||||
// toAuth("wxc061dee8806ff712")
|
|
||||||
// } else {
|
|
||||||
// // wechat().then(() => oAuth().then((code) => {
|
|
||||||
// // // const { code } = parseQuery()
|
|
||||||
// // auth(code)
|
|
||||||
// // .then(() => {
|
|
||||||
// // // location.replace(
|
|
||||||
// // // decodeURIComponent(decodeURIComponent(this.$route.params.url))
|
|
||||||
// // // );
|
|
||||||
// // location.href = decodeURIComponent(
|
|
||||||
// // decodeURIComponent(this.$route.params.url)
|
|
||||||
// // );
|
|
||||||
// // })
|
|
||||||
// // .catch(() => {
|
|
||||||
// // reject('当前运行环境为微信浏览器')
|
|
||||||
// // location.replace("/pages/home/index");
|
|
||||||
// // });
|
|
||||||
// // })).catch(error => {
|
|
||||||
// // console.log(error)
|
|
||||||
// // reject('自动登录失败')
|
|
||||||
// // });
|
|
||||||
// }
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (Vue.prototype.$deviceType == 'weixinh5') {
|
if (Vue.prototype.$deviceType == 'weixinh5') {
|
||||||
|
console.log('当前运行环境为H5')
|
||||||
reject('当前运行环境为H5')
|
reject('当前运行环境为H5')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -710,7 +689,8 @@ export const _router = {
|
|||||||
push,
|
push,
|
||||||
replace,
|
replace,
|
||||||
go,
|
go,
|
||||||
back
|
back,
|
||||||
|
reLaunch
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,7 +29,16 @@ function remove(key) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function clearAll() {
|
function clearAll() {
|
||||||
uni.clearStorage()
|
const res = uni.getStorageInfoSync();
|
||||||
|
res.keys.map((item) => {
|
||||||
|
if (item == 'redirect' || item == 'spread') {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
remove(item)
|
||||||
|
})
|
||||||
|
console.log(res)
|
||||||
|
// debugger
|
||||||
|
// uni.clearStorageSync()
|
||||||
}
|
}
|
||||||
|
|
||||||
function _has(key) {
|
function _has(key) {
|
||||||
|
Reference in New Issue
Block a user