|
|
|
@ -38,7 +38,7 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 登录按钮 --> |
|
|
|
<view class="login-button" @click="handleLogin"> |
|
|
|
<view class="login-button" @click="debounce(handleReg,500)"> |
|
|
|
<text>注册</text> |
|
|
|
</view> |
|
|
|
</form> |
|
|
|
@ -102,20 +102,6 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
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){ |
|
|
|
this.isTick=!this.isTick |
|
|
|
@ -228,40 +214,58 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
// 点击登录 |
|
|
|
handleLogin() { |
|
|
|
handleReg() { |
|
|
|
const app = this |
|
|
|
if (!app.isLoading && app.formValidation()) { |
|
|
|
app.submitLogin() |
|
|
|
app.submitRegist() |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 确认登录 |
|
|
|
submitLogin() { |
|
|
|
// 注册操作 |
|
|
|
submitRegist() { |
|
|
|
const app = this |
|
|
|
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, |
|
|
|
loginType: "0", |
|
|
|
password: this.$md5(app.vpass).toUpperCase(), // 转成大写 |
|
|
|
userType: app.userType |
|
|
|
}) |
|
|
|
.then(result => { |
|
|
|
// 显示登录成功 |
|
|
|
app.$toast(result.message) |
|
|
|
// 相应全局事件订阅: 刷新上级页面数据 |
|
|
|
uni.$emit('syncRefresh', true) |
|
|
|
// 跳转回原页面 |
|
|
|
setTimeout(() => app.onNavigateBack(1), 2000) |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
console.log("err",err) |
|
|
|
// 跳转回原页面 |
|
|
|
if (err.result.data.isBack) { |
|
|
|
setTimeout(() => app.onNavigateBack(1), 2000) |
|
|
|
} |
|
|
|
}) |
|
|
|
.finally(() => app.isLoading = false) |
|
|
|
|
|
|
|
// store.dispatch('Login', { |
|
|
|
// loginName: app.mobile, |
|
|
|
// loginType: "0", |
|
|
|
// password: this.$md5(app.vpass).toUpperCase(), // 转成大写 |
|
|
|
// userType: app.userType |
|
|
|
// }) |
|
|
|
// .then(result => { |
|
|
|
// // 显示登录成功 |
|
|
|
// app.$toast(result.message) |
|
|
|
// // 相应全局事件订阅: 刷新上级页面数据 |
|
|
|
// uni.$emit('syncRefresh', true) |
|
|
|
// // 跳转回原页面 |
|
|
|
// setTimeout(() => app.onNavigateBack(1), 2000) |
|
|
|
// }) |
|
|
|
// .catch(err => { |
|
|
|
// console.log("err",err) |
|
|
|
// // 跳转回原页面 |
|
|
|
// if (err.result.data.isBack) { |
|
|
|
// setTimeout(() => app.onNavigateBack(1), 2000) |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// .finally(() => app.isLoading = false) |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
|