Browse Source

删掉忘记密码第二步信息显示重复

yxb
DESKTOP-2IO5MST\huting 1 year ago
parent
commit
f7de17fc21
3 changed files with 116 additions and 109 deletions
  1. 109
    103
      login/forget-pwd-step2.vue
  2. 1
    0
      subpackage/after-sale/rescind-carId/verification.vue
  3. 6
    6
      utils/network/api.js

+ 109
- 103
login/forget-pwd-step2.vue View File

@@ -1,19 +1,19 @@
<!-- 注册第2步 -->
<template>
<view class="register-main">
<view class="title">请输入验证码</view>
<view class="hint">验证码已发送至:{{ phone }}</view>
<view class="input-code">
<verification-code-input v-model="code"></verification-code-input>
</view>
<view class="hint2">
<view class="green">{{ codeDuration === 0 ? "" : codeDuration }}</view>
<view class="grey" @click="sendRegisterCode">{{
<view class="register-main">
<view class="title">请输入验证码</view>
<view class="hint">验证码已发送至:{{ phone }}</view>
<view class="input-code">
<verification-code-input v-model="code"></verification-code-input>
</view>
<view class="hint2">
<view class="green">{{ codeDuration === 0 ? "" : codeDuration }}</view>
<view class="grey" @click="sendRegisterCode">{{
codeDuration === 0 ? "重新发送验证码" : "秒后可重新发送验证码"
}}</view>
</view>
</view>
<!-- <view class="register-main">
</view>
</view>
<!-- <view class="register-main">
<view class="title">请输入验证码</view>
<view class="hint">验证码已发送至:{{ phone }}</view>
<view class="input-code">
@@ -26,7 +26,7 @@
}}</view>
</view>
</view> -->
<u-form ref="myForm">
<!-- <u-form ref="myForm">
<view class="from">
<u-form-item prop="phone">
<view class="from_item" style="background-color: #f7f7f7">
@@ -47,106 +47,112 @@
</view>
</u-form-item>
</view>
</u-form>
<view class="btn">
<submit-button title="下一步" @submit="nextStep"></submit-button>
</view>
</u-form> -->
<view class="btn">
<submit-button title="下一步" @submit="nextStep"></submit-button>
</view>
</template>

<script setup lang="ts">
import { msg, navTo } from "@/utils/utils";
import { onLoad } from "@dcloudio/uni-app";
import { ref } from "vue";
import { request } from "@/utils/network/request";
import { sendCode } from "@/utils/network/api.js";
import { msg, navTo } from "@/utils/utils";
import { onLoad } from "@dcloudio/uni-app";
import { ref } from "vue";
import { request } from "@/utils/network/request";
import { sendCode } from "@/utils/network/api.js";

//上个界面传递的电话号码
const phone = ref("");
const code = ref(null);
//上个界面传递的电话号码
const phone = ref("");
const code = ref(null);

//倒计时时常
const codeDuration = ref(0);
let interval = null;
//倒计时时常
const codeDuration = ref(0);
let interval = null;

onLoad((options) => {
phone.value = options.phone;
codeInterval();
});
onLoad((options) => {
phone.value = options.phone;
codeInterval();
});

/* 验证码倒计时 */
const codeInterval = () => {
codeDuration.value = 60;
interval = setInterval(() => {
codeDuration.value--;
if (codeDuration.value === 0) {
if (interval) {
clearInterval(interval);
interval = null;
}
}
}, 1000);
};
/* 验证码倒计时 */
const codeInterval = () => {
codeDuration.value = 60;
interval = setInterval(() => {
codeDuration.value--;
if (codeDuration.value === 0) {
if (interval) {
clearInterval(interval);
interval = null;
}
}
}, 1000);
};

/* 发送验证码 */
const sendRegisterCode = () => {
if (codeDuration.value !== 0) {
return;
}
const options = {
type: 2,
data: { mobile: phone.value },
method: "POST",
showLoading: true,
};
request(sendCode, options).then((res) => {
msg("验证码发送成功!");
codeInterval();
});
};
/* 发送验证码 */
const sendRegisterCode = () => {
if (codeDuration.value !== 0) {
return;
}
const options = {
type: 2,
data: { mobile: phone.value },
method: "POST",
showLoading: true,
};
request(sendCode, options).then((res) => {
msg("验证码发送成功!");
codeInterval();
});
};

/* 下一步 */
const nextStep = () => {
if (!code.value) {
msg("请先输入验证码!");
return;
}
navTo(`/login/forget-pwd-step3?phone=${phone.value}&code=${code.value}`);
};
/* 下一步 */
const nextStep = () => {
if (!code.value) {
msg("请先输入验证码!");
return;
}
navTo(`/login/forget-pwd-step3?phone=${phone.value}&code=${code.value}`);
};
</script>

<style lang="scss" scoped>
.register-main {
border-top: 1rpx solid #dcdcdc;
padding: 78rpx 30rpx 50rpx;
.title {
font-size: 32rpx;
color: #333333;
font-weight: 600;
}
.hint {
font-size: 24rpx;
color: #999999;
margin-top: 20rpx;
}
}
.input-code {
margin: 100rpx -10rpx 0px;
}
.hint2 {
margin-top: 40rpx;
display: flex;
.green {
font-size: 28rpx;
color: #00b38b;
}
.grey {
font-size: 24rpx;
color: #999999;
margin-left: 16rpx;
}
}
.register-main {
border-top: 1rpx solid #dcdcdc;
padding: 78rpx 30rpx 50rpx;

.title {
font-size: 32rpx;
color: #333333;
font-weight: 600;
}

.hint {
font-size: 24rpx;
color: #999999;
margin-top: 20rpx;
}
}

.input-code {
margin: 100rpx -10rpx 0px;
}

.hint2 {
margin-top: 40rpx;
display: flex;

.green {
font-size: 28rpx;
color: #00b38b;
}

.grey {
font-size: 24rpx;
color: #999999;
margin-left: 16rpx;
}
}

.btn {
margin: 200rpx 40rpx 0px;
}
</style>
.btn {
margin: 200rpx 40rpx 0px;
}
</style>

+ 1
- 0
subpackage/after-sale/rescind-carId/verification.vue View File

@@ -152,6 +152,7 @@
model1.peopleVehicleImgUrl = data.peopleVehicleImgUrl
model1.commitmentUrl = data.commitmentUrl
model1.proxyUrl = data.proxyUrl

})
</script>


+ 6
- 6
utils/network/api.js View File

@@ -1,23 +1,23 @@
/* 接口中常量 */
// export const URL = "192.168.100.63";
// export const URL = "trial.etcjz.cn";
export const URL = "qtzl.etcjz.cn";
export const URL = "trial.etcjz.cn";
// export const URL = "qtzl.etcjz.cn";
/**
* 配置信息,针对不同的平台进行配置
*/
export const envs = {
//开发环境配置
development: {
baseUrl: "https://qtzl.etcjz.cn",
// baseUrl: "https://trial.etcjz.cn",
// baseUrl: "https://qtzl.etcjz.cn",
baseUrl: "https://trial.etcjz.cn",
// baseUrl: "http://192.168.100.158:8085",
},
//生产环境配置
production: {
// baseUrl: "http://192.168.124.6:8087",
// baseUrl: "http://222.85.144.89:19002",
baseUrl: "https://qtzl.etcjz.cn",
// baseUrl: "https://trial.etcjz.cn",
// baseUrl: "https://qtzl.etcjz.cn",
baseUrl: "https://trial.etcjz.cn",
// baseUrl: "http://192.168.100.158:8085",
},
}

Loading…
Cancel
Save