提交 02723e68 编写于 作者: guofeng.chen's avatar guofeng.chen

修改授权s

上级 5d48c4ad
...@@ -119,20 +119,12 @@ export default { ...@@ -119,20 +119,12 @@ export default {
if (token && !info.id) { if (token && !info.id) {
this.$store.dispatch('getUserInfo'); this.$store.dispatch('getUserInfo');
} }
// 微信内先去授权
if (isWechat && !this.wxInfo.openid) {
wxOauth();
return;
}
// 数量加减 // 数量加减
this.curtGoodsNum = this.goodsNum; this.curtGoodsNum = this.goodsNum;
this.countTotalPrice = debounce(this.getTotalPrice, 500); this.countTotalPrice = debounce(this.getTotalPrice, 500);
// 记录参数,授权登录返回时重新赋值,在main.js // 记录参数,授权登录返回时重新赋值,在main.js
sessionStorage.setItem('goodsDetailParams', JSON.stringify(this.$route.query)) sessionStorage.setItem('goodsDetailParams', JSON.stringify(this.$route.query))
}, },
beforeDestroy() {
this.countTotalPrice = null;
},
methods: { methods: {
// tab切换 // tab切换
tabToggle(index) { tabToggle(index) {
...@@ -263,6 +255,12 @@ export default { ...@@ -263,6 +255,12 @@ export default {
this.goLogin(); this.goLogin();
return; return;
} }
// 微信内先去授权
if (isWechat && !this.wxInfo.openid) {
this.$toast('微信授权中');
wxOauth();
return;
}
const { id, couponDTO, isSale } = this.goods; const { id, couponDTO, isSale } = this.goods;
const { preferentialPrice, costPrice } = this.totalPrice; const { preferentialPrice, costPrice } = this.totalPrice;
// if (!id || isSale !== 1) { // if (!id || isSale !== 1) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册