|
@@ -26,7 +26,7 @@
|
|
|
</view>
|
|
|
</picker>
|
|
|
</template>
|
|
|
- <button slot="button" class="tel-btn" open-type="getPhoneNumber">获取手机号</button>
|
|
|
+ <button slot="button" class="tel-btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">获取手机号</button>
|
|
|
</van-field>
|
|
|
<van-field
|
|
|
:value="verifyCode"
|
|
@@ -77,7 +77,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { apiGetSMSCode, apiGetEmailCode } from '@/api/common'
|
|
|
+import { apiGetSMSCode, apiGetEmailCode,apiGetWechatPhone } from '@/api/common'
|
|
|
import { apiUserLogin } from '@/api/user'
|
|
|
import { telVerify, emailVerify } from '@/utils/common'
|
|
|
export default {
|
|
@@ -123,6 +123,25 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
|
|
|
+ // 获取微信绑定的手机号登录
|
|
|
+ async getPhoneNumber({detail}){
|
|
|
+ const res=await apiGetWechatPhone({
|
|
|
+ encryptedData:detail.encryptedData,
|
|
|
+ iv:detail.iv,
|
|
|
+ isBind:true,
|
|
|
+ })
|
|
|
+ if(res.code===200){
|
|
|
+ uni.switchTab({
|
|
|
+ url: '/pages/activity/activity'
|
|
|
+ })
|
|
|
+ this.$store.dispatch('getUserInfo')
|
|
|
+ this.$store.dispatch('getTabBar')
|
|
|
+ }else if(res.code===400){
|
|
|
+ this.$store.commit('setToken', '')
|
|
|
+ this.$store.dispatch('getUserInfo')
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
handleChange(){
|
|
|
if(this.active==='手机号'){
|
|
|
this.active='邮箱'
|