Authored by 张文文

登录问题fix

... ... @@ -58,8 +58,6 @@ export default {
this.$refs.popup.show(() => {
this.$refs.couponListScroll.refresh();
});
this.checkLogin();
},
methods: {
...mapActions(['getCoupon']),
... ... @@ -69,21 +67,16 @@ export default {
onHide() {
this.$emit('hide');
},
async checkLogin() {
const user = await this.$yoho.auth();
if (user.uid) {
this.isLogin = true;
}
},
clickButton(item) {
async clickButton(item) {
let couponToken = item.couponToken;
if (item.receive === 'N') { // 是否可以领取 N:否,Y:是
return;
}
if (this.isLogin) {
const user = await this.$yoho.auth();
if (user && user.uid) {
this.getCoupon({couponToken: couponToken}).then(result => {
console.log(result);
this.$createDialog({
... ... @@ -96,8 +89,6 @@ export default {
this.$emit('updateCoupon');
}
});
} else if (!this.isLogin) {
this.checkLogin();
}
}
},
... ...