Showing
1 changed file
with
4 additions
and
13 deletions
@@ -58,8 +58,6 @@ export default { | @@ -58,8 +58,6 @@ export default { | ||
58 | this.$refs.popup.show(() => { | 58 | this.$refs.popup.show(() => { |
59 | this.$refs.couponListScroll.refresh(); | 59 | this.$refs.couponListScroll.refresh(); |
60 | }); | 60 | }); |
61 | - | ||
62 | - this.checkLogin(); | ||
63 | }, | 61 | }, |
64 | methods: { | 62 | methods: { |
65 | ...mapActions(['getCoupon']), | 63 | ...mapActions(['getCoupon']), |
@@ -69,21 +67,16 @@ export default { | @@ -69,21 +67,16 @@ export default { | ||
69 | onHide() { | 67 | onHide() { |
70 | this.$emit('hide'); | 68 | this.$emit('hide'); |
71 | }, | 69 | }, |
72 | - async checkLogin() { | ||
73 | - const user = await this.$yoho.auth(); | ||
74 | - | ||
75 | - if (user.uid) { | ||
76 | - this.isLogin = true; | ||
77 | - } | ||
78 | - }, | ||
79 | - clickButton(item) { | 70 | + async clickButton(item) { |
80 | let couponToken = item.couponToken; | 71 | let couponToken = item.couponToken; |
81 | 72 | ||
82 | if (item.receive === 'N') { // 是否可以领取 N:否,Y:是 | 73 | if (item.receive === 'N') { // 是否可以领取 N:否,Y:是 |
83 | return; | 74 | return; |
84 | } | 75 | } |
85 | 76 | ||
86 | - if (this.isLogin) { | 77 | + const user = await this.$yoho.auth(); |
78 | + | ||
79 | + if (user && user.uid) { | ||
87 | this.getCoupon({couponToken: couponToken}).then(result => { | 80 | this.getCoupon({couponToken: couponToken}).then(result => { |
88 | console.log(result); | 81 | console.log(result); |
89 | this.$createDialog({ | 82 | this.$createDialog({ |
@@ -96,8 +89,6 @@ export default { | @@ -96,8 +89,6 @@ export default { | ||
96 | this.$emit('updateCoupon'); | 89 | this.$emit('updateCoupon'); |
97 | } | 90 | } |
98 | }); | 91 | }); |
99 | - } else if (!this.isLogin) { | ||
100 | - this.checkLogin(); | ||
101 | } | 92 | } |
102 | } | 93 | } |
103 | }, | 94 | }, |
-
Please register or login to post a comment