修改扫码申请报错
This commit is contained in:
parent
65d3240260
commit
4713116996
|
@ -1,6 +1,6 @@
|
|||
import { getTenementDetail } from "../../service/tenement";
|
||||
import { userApply } from "../../service/user";
|
||||
import { alertInfo, alertSuccess } from "../../utils/index";
|
||||
import { alertInfo, alertSuccess, loadingFunc, wxLogin } from "../../utils/index";
|
||||
import request from '../../utils/request'
|
||||
const { OK } = request;
|
||||
// pages/apply/index.js
|
||||
|
@ -22,10 +22,10 @@ Page({
|
|||
console.log('options', options)
|
||||
const querys = decodeURIComponent(options.scene)
|
||||
console.log('querys', querys)
|
||||
const search = new URLSearchParams(querys)
|
||||
// const search = new URLSearchParams(querys)
|
||||
// const { id } = querys;
|
||||
// const id = querys.slice(querys.indexOf("=") + 1)
|
||||
const id = seach.get('id')
|
||||
const id = querys.slice(querys.indexOf("=") + 1)
|
||||
// const id = seach.get('id')
|
||||
console.log('更换')
|
||||
console.log('id', id)
|
||||
// this.setData({ id, name })
|
||||
|
@ -52,8 +52,11 @@ Page({
|
|||
},
|
||||
async handleLogin(phoneCode) {
|
||||
const { id, nickName } = this.data;
|
||||
console.log('准备开始')
|
||||
loadingFunc(async () => {
|
||||
console.log('开始')
|
||||
const wxLoginCode = await wxLogin()
|
||||
console.log('wxLoginCode', wxLoginCode)
|
||||
const result = await userApply({ code: wxLoginCode, phoneCode, id, name: nickName })
|
||||
const { code, message, data } = result;
|
||||
if (code !== OK) {
|
||||
|
@ -75,6 +78,7 @@ Page({
|
|||
},
|
||||
getPhoneNumber(e) {
|
||||
const { nickName } = this.data;
|
||||
console.log('nickName', e, nickName)
|
||||
if (!nickName) {
|
||||
alertInfo("请填写你的名字")
|
||||
return;
|
||||
|
@ -89,6 +93,7 @@ Page({
|
|||
alertInfo("服务达到上限")
|
||||
return;
|
||||
default:
|
||||
console.log("进入登录流程")
|
||||
this.handleLogin(phoneCode)
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user