提交 4aef010c 编写于 作者: guangjun.yang's avatar guangjun.yang

授权等

登陆等
上级 0d8f8ebb
......@@ -77,6 +77,7 @@ import { Swipe, SwipeItem } from 'vant';
import Loading from "@/components/common/common-loading";
import { wxConfig, chooseWXPay } from '@/utils/wxShare';
import { getAPPID, getWebPageUrl, isWeiXin, wxOauth, debounce } from '@/utils';
import { mapGetters } from "vuex";
const isWechat = isWeiXin();
wxConfig(location.href);
......@@ -102,9 +103,10 @@ export default {
}
},
computed: {
logged() {
return this.$store.getters.logged;
},
...mapGetters(["logged"]),
// logged() {
// return this.$store.getters.logged;
// },
wxInfo() {
return this.$store.state.user.wxInfo;
},
......@@ -126,15 +128,17 @@ export default {
if (token && !info.id) {
this.$store.dispatch('getUserInfo');
}
// 微信内先去授权
if (isWechat && !this.wxInfo.openid) {
if (location.search.indexOf('code') >= 0 || this.wxCode) {
// 避免code中转页再次授权
return;
}
wxOauth();
return;
}
// // 微信内先去授权
// if (isWechat && !this.wxInfo.openid) {
// if (location.search.indexOf('code') >= 0 || this.wxCode) {
// // 避免code中转页再次授权
// return;
// }
// wxOauth();
// return;
// }
// 数量加减
this.curtGoodsNum = this.goodsNum;
this.countTotalPrice = debounce(this.getTotalPrice, 500);
......@@ -275,6 +279,14 @@ export default {
this.goLogin();
return;
}
// 微信内先去授权
if (isWechat && !this.wxInfo.openid) {
this.$toast('微信授权中');
wxOauth();
return;
}
// 避免多次支付
if (this.showLoading) {
return;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册