From 1d1e327a1cbf8bd822078a9f71894f25ddcee437 Mon Sep 17 00:00:00 2001 From: queenwuli <942534046@qq.com> Date: Mon, 11 Jan 2021 10:32:49 +0800 Subject: [PATCH] gx --- hive-app/pages/login/newPassword.vue | 52 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 47 insertions(+), 5 deletions(-) diff --git a/hive-app/pages/login/newPassword.vue b/hive-app/pages/login/newPassword.vue index 887df2a..2e3a80a 100644 --- a/hive-app/pages/login/newPassword.vue +++ b/hive-app/pages/login/newPassword.vue @@ -2,16 +2,58 @@ <!-- 新密码 --> <view> <view class="input-box"> - <input placeholder="请输入新密码" placeholder-class="placeholder" class="input-group-row"/> - <input placeholder="请确认密码" placeholder-class="placeholder" class="input-group-row"/> + <input type="password" v-model="newPassword" placeholder="请输入新密码" placeholder-class="placeholder" class="input-group-row"/> + <input type="password" v-model="password" placeholder="请确认密码" placeholder-class="placeholder" class="input-group-row"/> </view> - <navigator url="./" hover-class="none" class="sticky-footer"> - <button class="blue-btn">提交</button> - </navigator> + <button class="blue-btn sticky-footer" @click="submit">提交</button> </view> </template> <script> + export default{ + data(){ + return{ + newPassword:'', + password:'', + sendCode:'', + telphone:'' + } + }, + onLoad(options) { + this.sendCode = options.code; + this.telphone = options.phone; + }, + methods:{ + valid(){ + if(!this.newPassword.trim()){ + this.$toast.info('请输入新密码'); + return false; + } + if(this.password.trim()!==this.newPassword.trim()){ + this.$toast.info('两次密码不一致'); + return false; + } + }, + submit(){ + if(this.valid() === false){ + return; + } + this.$httpUtils.request('/api/common/resetLoginPwd',{ + code: this.sendCode, + newPwd: this.newPassword, + telphone: this.telphone + },'POST').then((res)=>{ + console.log(res) + if(res.status==200){ + this.$toast.info(res.info); + uni.navigateBack(); + } + }).catch((err) => { + this.$toast.info(res.info); + }) + } + } + } </script> <style> -- Gitblit v1.9.1