no message

This commit is contained in:
2025-09-01 00:00:53 +08:00
committed by charles
parent eb2b24ebac
commit bfc2459219
10 changed files with 282 additions and 19 deletions
+174
View File
@@ -0,0 +1,174 @@
<template>
<view class="content">
<TopSafe></TopSafe>
<Header title="忘记密码" />
<view class="contract-view">
<view class="input-view">
<up-input placeholder="请输入手机号" border="surround" v-model="form.mobile" :customStyle="inputCss"></up-input>
</view>
<view class="input-view">
<up-input placeholder="请输入验证码" border="surround" v-model="form.smsCode" :customStyle="inputCss">
<template #suffix style="margin-right: 10rpx;">
<view v-if="countdown" class="code-warp">
<up-count-down :time="60 * 1000" format="ss" @finish="countdown = false"></up-count-down>
<text style="margin-left: 10rpx;">s</text>
</view>
<view v-else @click="getMobileCode" class="code_msg">
获取验证码
</view>
</template>
</up-input>
</view>
<view class="input-view">
<up-input placeholder="请输入登录密码" border="surround" v-model="form.pass" :customStyle="inputCss"
:type="loginPasswordIsShow ? 'text' : 'password'">
<template #suffix style="margin-right: 10rpx;">
<up-image v-if="loginPasswordIsShow" src="/static/login/show.png" width="20" height="20" bgColor="#f1f6ff00"
@click="loginPasswordIsShow = false;"></up-image>
<up-image v-else src="/static/login/hidden.png" width="20" height="20" bgColor="#f1f6ff00"
@click="loginPasswordIsShow = true;"></up-image>
</template>
</up-input>
</view>
<view class="input-view">
<up-input placeholder="请输入登录密码" border="surround" v-model="form.passOne" :customStyle="inputCss"
:type="loginPassword2IsShow ? 'text' : 'password'">
<template #suffix style="margin-right: 10rpx;">
<up-image v-if="loginPassword2IsShow" src="/static/login/show.png" width="20" height="20" bgColor="#f1f6ff00"
@click="loginPassword2IsShow = false;"></up-image>
<up-image v-else src="/static/login/hidden.png" width="20" height="20" bgColor="#f1f6ff00"
@click="loginPassword2IsShow = true;"></up-image>
</template>
</up-input>
</view>
<view class="login_comm_but login_comm_but_yes" style="margin-top:48rpx" @click="registerFun" >
确认修改
</view>
</view>
<up-toast ref="uToastRef"></up-toast>
</view>
</template>
<script>
import { getUserList } from '@/api/common.js';
import { forgotPassword } from '@/api/auth.js';
import Header from '@/components/common/header.vue';
import TopSafe from '@/components/common/top-safe.nvue'
import CryptoJS from 'crypto-js';
export default {
components: { Header, TopSafe },
data() {
return {
form:{
mobile:'',
smsCode:'',
pass:'',
passOne:''
},
loginPasswordIsShow:false,
loginPassword2IsShow:false,
countdown: false,// 清空倒计时
inputCss: {
"height": '80rpx',
"background": "#F3F3F3FF",
"border-radius": "30rpx",
"border": "0rpx",
"padding-left": "16px",
},
};
},
onShow() {
},
onLoad() {
},
methods: {
async getMobileCode() {
const form = this.form;
if (!form.mobile) {
this.$refs.uToastRef.show({
type: 'error',
message: "请输入手机号码",
});
return;
}
this.countdown = true;
const params = {
mobile: form.mobile,
type: 'passwd',
}
const response = await getUserList(params);
if (response && response.bizcode === 100) {
this.$refs.uToastRef.show({
type: 'success',
message: response.msg,
});
} else {
this.countdown = false;
}
},
registerFun(){
if (!this.form.mobile) {
this.$refs.uToastRef.show({
type: 'error',
message: "请输入手机号码",
});
return;
}
if (!this.form.smsCode) {
this.$refs.uToastRef.show({
type: 'error',
message: "请输入验证码",
});
return;
}
if (!this.form.pass || !this.form.passOne) {
this.$refs.uToastRef.show({
type: 'error',
message: "请输入密码",
});
return;
}
if (this.form.pass !== this.form.passOne) {
this.$refs.uToastRef.show({
type: 'error',
message: "两次输入的登录密码不一致",
});
return;
}
let params = {
verificationCode:this.form.smsCode,
newPassword:CryptoJS.MD5(this.form.pass).toString()
}
forgotPassword(params).then(res=>{
console.log('params',res)
})
},
}
}
</script>
<style lang="scss" scoped>
.contract-view {
width: 100%;
height: calc(100% - 88rpx - var(--status-bar-height));
display: flex;
flex-direction: column;
align-items: center;
overflow-y: auto;
padding: 0 32rpx;
box-sizing: border-box;
background-color: #fff;
.input-view{
width:100%;
height:100rpx;
background-color: #f3f3f3;
border-radius: 16rpx;
margin-top:48rpx;
}
}
</style>
+6
View File
@@ -46,6 +46,7 @@
<view class="cut_way_warp">
<view v-if="loginWay === 'password'" @click="loginWay = 'code'">验证码登录</view>
<view v-if="loginWay === 'code'" @click="loginWay = 'password'">密码登录登录</view>
<!-- <view @click="jumpForgot">忘记密码</view> -->
<view @click="jumpRegister">注册</view>
</view>
</view>
@@ -193,6 +194,11 @@ export default {
this.countdown = false;
}
},
jumpForgot(){
uni.navigateTo({
url: "/pages/login_package/login/forgotPass",
})
},
jumpRegister() {
uni.navigateTo({
url: "/pages/login_package/register/register",
+4 -3
View File
@@ -375,10 +375,11 @@ export default {
this.serviceShow = true;
} else if (item.id === 9) {// 实名认证
const currentUserData = this.currentUserData;
console.log('currentUserData',this.currentUserData)
let path = "/pages/mine_package/mine_authentication/mine_authentication"
if (currentUserData && Object.keys(currentUserData).length !== 0 && currentUserData.certStatus && currentUserData.certStatus !== 0) {
path = "/pages/mine_package/mine_authentication_ok/mine_authentication_ok"
}
// if (currentUserData && Object.keys(currentUserData).length !== 0 && currentUserData.certStatus && currentUserData.certStatus !== 0) {
// path = "/pages/mine_package/mine_authentication_ok/mine_authentication_ok"
// }
uni.navigateTo({
url: path,
})
@@ -18,7 +18,7 @@
</view>
</view>
<!-- 证件照 -->
<CommonCard @valueFunc="getValue" />
<CommonCard @valueFunc="getValue" :Fimg="form.certFimg" :Bimg="form.certBimg" />
<view class="add_but" @click="addAuthentication">
提交
</view>
@@ -31,7 +31,7 @@
<script>
import CommonCard from '@/components/common_card.vue';
import Header from '@/components/header.vue';
import { realNameAuthentication } from '@/api/auth.js';
import { realNameAuthentication,getUserInfo } from '@/api/auth.js';
import { CERT_OPTION } from '@/utils/enumUtils.js';
export default {
@@ -96,10 +96,34 @@ export default {
],
certShow: false,
certOption: [],
userInfo:null
}
},
onLoad(){
this.init();
},
methods: {
init(){
this.getUserInfo();
},
async getUserInfo() {
const result = await getUserInfo();
if (result && result.bizcode === 100) {
const data = result.data;
this.userInfo = result.data || {};
this.form = {
name:this.userInfo.name,
certNo:this.userInfo.certNo,
certType:this.userInfo.certType,
certName: this.userInfo.certType == 1?'居民身份证' : '护照',
certFimg:this.userInfo.certFimg,
certBimg:this.userInfo.certBimg,
}
}
},
async addAuthentication() {
const params = {
...this.form
@@ -111,6 +135,7 @@ export default {
});
return;
}
if (!params.certType) {
this.$refs.uToastRef.show({
type: 'error',
@@ -125,6 +150,13 @@ export default {
});
return;
}
if(!/(^\d{15}$)|(^\d{17}(\d|X|x)$)/.test(params.certNo)){
this.$refs.uToastRef.show({
type: 'error',
message: "请输入正确的证件号码",
});
return;
}
if (params.certFimg.length === 0) {
this.$refs.uToastRef.show({
type: 'error',
@@ -140,12 +172,12 @@ export default {
return;
}
console.log("params", params);
const resp = await realNameAuthentication(params);
if (resp && resp.bizcode === 100) {
uni.navigateTo({
url: '/pages/mine_package/mine_authentication_ok/mine_authentication_ok',
})
}
// const resp = await realNameAuthentication(params);
// if (resp && resp.bizcode === 100) {
// uni.navigateTo({
// url: '/pages/mine_package/mine_authentication_ok/mine_authentication_ok',
// })
// }
},
// 提交地址
certConfirm(e) {