|
@@ -37,7 +37,7 @@
|
|
|
<script>
|
|
<script>
|
|
|
import TuiListCell from "@/components/plugin/list-cell"
|
|
import TuiListCell from "@/components/plugin/list-cell"
|
|
|
const form = require("@/utils/formValidation.js")
|
|
const form = require("@/utils/formValidation.js")
|
|
|
-import { getWxInfo, getWxPhone } from "@/api/mini"
|
|
|
|
|
|
|
+import { getWxInfo, getMiniMobile } from "@/api/mini"
|
|
|
import { create } from "@/api/user"
|
|
import { create } from "@/api/user"
|
|
|
import store from '@/store'
|
|
import store from '@/store'
|
|
|
import { TOKEN_STORAGE_KEY } from "@/constant/storageKeys";
|
|
import { TOKEN_STORAGE_KEY } from "@/constant/storageKeys";
|
|
@@ -93,25 +93,13 @@ export default {
|
|
|
},
|
|
},
|
|
|
getWxMobile(e) {
|
|
getWxMobile(e) {
|
|
|
let that = this
|
|
let that = this
|
|
|
- if (e.detail.errMsg === "getPhoneNumber:ok") {
|
|
|
|
|
- let currentMiniOpenId = uni.getStorageSync('miniOpenId')
|
|
|
|
|
- getWxPhone({ iv: e.detail.iv, encryptedData: e.detail.encryptedData, miniOpenId: currentMiniOpenId }).then(subRes => {
|
|
|
|
|
- if (subRes.data && subRes.data.hasNoOpenId && subRes.data.hasNoOpenId == 1) {
|
|
|
|
|
- uni.showModal({
|
|
|
|
|
- title: '提示',
|
|
|
|
|
- content: '网络异常,请重试一次',
|
|
|
|
|
- success: function (res) {
|
|
|
|
|
- if (res.confirm) {
|
|
|
|
|
- console.log('用户点击确定')
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- return false
|
|
|
|
|
- }
|
|
|
|
|
- this.form.mobile = subRes.data.mobile
|
|
|
|
|
- that.confirmFn()
|
|
|
|
|
- })
|
|
|
|
|
- } else {
|
|
|
|
|
|
|
+ if (e.detail.errMsg === "getPhoneNumber:ok") {
|
|
|
|
|
+ let code = e.detail.code
|
|
|
|
|
+ getMiniMobile({ code: code }).then(subRes => {
|
|
|
|
|
+ this.form.mobile = subRes.data.mobile
|
|
|
|
|
+ that.confirmFn()
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
this.$msg("获取手机失败");
|
|
this.$msg("获取手机失败");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|