| | |
| | | this.show = false |
| | | }, |
| | | getphonenumber(e) { |
| | | var that = this; |
| | | if (e.detail.errMsg === 'getPhoneNumber:ok') { |
| | | this.$u.api.wxPhone({ |
| | | uni.login({ |
| | | provider: 'weixin', |
| | | success: async function (loginRes) { |
| | | let { code } = loginRes; |
| | | let res = await that.$u.api.wxLogin({ code }) |
| | | if (res.code === 200) { |
| | | that.$u.api.wxPhone({ |
| | | code: e.detail.code, |
| | | shopId:this.recshopid, |
| | | recId:this.recuserid, |
| | | openid: this.openid |
| | | shopId:that.recshopid, |
| | | recId:that.recuserid, |
| | | openid: res.data.openid |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$store.commit('setUserInfo', res.data.member) |
| | | this.$store.commit('setToken', res.data.token) |
| | | this.$store.commit('setRecShopId','') |
| | | this.$store.commit('setRecUserId','') |
| | | this.close() |
| | | that.$store.commit('setUserInfo', res.data.member) |
| | | that.$store.commit('setToken', res.data.token) |
| | | that.$store.commit('setRecShopId','') |
| | | that.$store.commit('setRecUserId','') |
| | | that.close() |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |