Browse Source

修复注册中异常返回

master
453530270@qq.com 2 years ago
parent
commit
95fc0ed2b7
  1. 8
      api/reg/index.js
  2. 9
      pages/reg/components/WhPopup.vue
  3. 86
      pages/reg/reg.vue

8
api/reg/index.js

@ -3,7 +3,8 @@ import request from '@/utils/request'
// api地址 // api地址
const api = { const api = {
smsurl:'slb/userself/v1/account/username/unique-validate/', smsurl:'slb/userself/v1/account/username/unique-validate/',
verifycode:'slb/userself/v1/verify-code' verifycode:'slb/userself/v1/verify-code',
regurl:'slb/userself/v1/register',
} }
// 校验手机号是否唯一 // 校验手机号是否唯一
@ -15,3 +16,8 @@ export function sendSms(params) {
export function sendVerifyCode(params){ export function sendVerifyCode(params){
return request.get(api.verifycode,params) return request.get(api.verifycode,params)
} }
// 执行注册程序
export function doreg(data,option){
return request.post(api.regurl,data,option)
}

9
pages/reg/components/WhPopup.vue

@ -5,7 +5,7 @@
<view class="mask"></view> <view class="mask"></view>
<view class="layer"> <view class="layer">
<view class="specification-wrapper"> <view class="specification-wrapper">
<scroll-view class="specification-wrapper-content" scroll-y="true" > <scroll-view class="specification-wrapper-content" scroll-y="true" @scroll="shscroll()" ref="swc">
<!-- 隐私政策 --> <!-- 隐私政策 -->
<privacy v-if="mkey=='private'"></privacy> <privacy v-if="mkey=='private'"></privacy>
<!-- 协议 --> <!-- 协议 -->
@ -105,6 +105,13 @@
that.$emit("update:modelValue", false); that.$emit("update:modelValue", false);
} }
}, },
//
shscroll(){
let swc = this.$refs.swc.clientHeight
console.log(swc,"swc")
},
} }
} }
</script> </script>

86
pages/reg/reg.vue

@ -38,7 +38,7 @@
</view> </view>
<!-- 登录按钮 --> <!-- 登录按钮 -->
<view class="login-button" @click="handleLogin"> <view class="login-button" @click="debounce(handleReg,500)">
<text>注册</text> <text>注册</text>
</view> </view>
</form> </form>
@ -102,20 +102,6 @@
}, },
methods: { methods: {
//
// onInputStepper({ value }){
// //
// if (this.mobile == value) return
// //
// if (!this.debounceHandle) {
// this.oldValue = item.goods_num
// item.debounceHandle = debounce(this.validteMobile(), 500)
// }
// //
// item.mobile = value
// item.debounceHandle(item, item.oldValue, value)
// },
// //
readpri(e){ readpri(e){
this.isTick=!this.isTick this.isTick=!this.isTick
@ -228,40 +214,58 @@
}, },
// //
handleLogin() { handleReg() {
const app = this const app = this
if (!app.isLoading && app.formValidation()) { if (!app.isLoading && app.formValidation()) {
app.submitLogin() app.submitRegist()
} }
}, },
// //
submitLogin() { submitRegist() {
const app = this const app = this
app.isLoading = true app.isLoading = true
//
const rdata = {
cellPhone: app.mobile,
verifyCode: app.verifyCode,
//password: $.md5($("#newpwd3").val()).toUpperCase(),
password:app.$md5(app.vpass).toUpperCase(),
passMd5ed: true
}
//
regApi.doreg(rdata,{isLoading:true})
.then(res=>{
if(res.resultCode === "00000000"){
app.$toast(result.message)
//
setTimeout(() => app.onNavigateBack(1), 2000)
}
});
store.dispatch('Login', {
loginName: app.mobile, // store.dispatch('Login', {
loginType: "0", // loginName: app.mobile,
password: this.$md5(app.vpass).toUpperCase(), // // loginType: "0",
userType: app.userType // password: this.$md5(app.vpass).toUpperCase(), //
}) // userType: app.userType
.then(result => { // })
// // .then(result => {
app.$toast(result.message) // //
// : // app.$toast(result.message)
uni.$emit('syncRefresh', true) // // :
// // uni.$emit('syncRefresh', true)
setTimeout(() => app.onNavigateBack(1), 2000) // //
}) // setTimeout(() => app.onNavigateBack(1), 2000)
.catch(err => { // })
console.log("err",err) // .catch(err => {
// // console.log("err",err)
if (err.result.data.isBack) { // //
setTimeout(() => app.onNavigateBack(1), 2000) // if (err.result.data.isBack) {
} // setTimeout(() => app.onNavigateBack(1), 2000)
}) // }
.finally(() => app.isLoading = false) // })
// .finally(() => app.isLoading = false)
}, },
/** /**

Loading…
Cancel
Save