diff --git a/api/reg/index.js b/api/reg/index.js index 7ac06e4..acea36e 100644 --- a/api/reg/index.js +++ b/api/reg/index.js @@ -3,7 +3,8 @@ import request from '@/utils/request' // api地址 const api = { 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){ return request.get(api.verifycode,params) } + +// 执行注册程序 +export function doreg(data,option){ + return request.post(api.regurl,data,option) +} \ No newline at end of file diff --git a/pages/reg/components/WhPopup.vue b/pages/reg/components/WhPopup.vue index 940c620..6d1685c 100644 --- a/pages/reg/components/WhPopup.vue +++ b/pages/reg/components/WhPopup.vue @@ -5,7 +5,7 @@ - + @@ -105,6 +105,13 @@ that.$emit("update:modelValue", false); } }, + + // 展示滚动事件 + shscroll(){ + let swc = this.$refs.swc.clientHeight + + console.log(swc,"swc") + }, } } diff --git a/pages/reg/reg.vue b/pages/reg/reg.vue index 1ed4d47..00833dd 100644 --- a/pages/reg/reg.vue +++ b/pages/reg/reg.vue @@ -38,7 +38,7 @@ - + @@ -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) }, /**