Files
xl-mobile/src/pages/forgotPassword/index.vue

89 lines
2.1 KiB
Vue
Raw Normal View History

2025-03-25 16:35:39 +08:00
<script setup>
2025-03-26 19:10:41 +08:00
import {reactive} from "vue";
import XNav from "../../components/XNav.vue";
import XLink from "../../components/XLink.vue";
import XInput from "../../components/XInput.vue";
2025-05-08 19:54:38 +08:00
import Api from "../../api/index.js";
2025-06-13 11:25:24 +08:00
import {backPage, showToast, verifyForm} from "../../utils/uils.js";
2025-05-08 19:54:38 +08:00
import SendMsg from "../../components/SendMsg.vue";
2025-03-25 16:35:39 +08:00
2025-03-26 19:10:41 +08:00
const form = reactive({
2025-05-08 19:54:38 +08:00
mobile: null,
captcha: null,
2025-03-26 19:10:41 +08:00
password: null,
});
2025-06-13 11:25:24 +08:00
const rules = {
mobile: {
reg: /^1[3-9]\d{9}$/,
title: '手机号',
msg: '手机号错误',
required: true,
},
captcha: {
reg: /^\d{6}$/,
title: '验证码',
msg: '验证码错误',
required: true,
},
password: {
title: '密码',
msg: '密码错误',
required: true,
}
}
2025-05-08 19:54:38 +08:00
const success = async () => {
2025-06-13 11:25:24 +08:00
verifyForm(form, rules);
2025-05-08 19:54:38 +08:00
const {msg} = await Api.system.editPassword(form);
showToast(msg);
backPage();
}
2025-03-25 16:35:39 +08:00
</script>
<template>
<!--忘记密码-->
2025-03-26 19:10:41 +08:00
<XNav></XNav>
<view class="relative !px-[36rpx]">
<view class="!mt-[56rpx]">
<view class="title">修改密码</view>
<view class="title-desc">请完成验证后设置新密码</view>
</view>
<view class="!flex flex-col gap-[56rpx] !mt-[60rpx]">
2025-05-08 19:54:38 +08:00
<x-input v-model:model-value="form.mobile" placeholder="请输入手机号"></x-input>
<send-msg v-model:model-value="form.captcha" :mobile="form.mobile" :type="3"></send-msg>
<x-input v-model:model-value="form.password" placeholder="请输入密码"></x-input>
<tui-button @click="success">确定修改</tui-button>
2025-03-26 19:10:41 +08:00
</view>
</view>
2025-03-25 16:35:39 +08:00
</template>
2025-05-08 19:54:38 +08:00
<style lang="scss">
page {
background-color: #fff;
}
</style>
2025-03-26 19:10:41 +08:00
<style lang="scss" scoped>
.title {
color: rgb(29, 33, 41);
font-size: 26px;
font-weight: 700;
line-height: 28px;
letter-spacing: 0;
text-align: left;
}
2025-03-25 16:35:39 +08:00
2025-03-26 19:10:41 +08:00
.title-desc {
margin-top: 16rpx;
color: rgb(78, 89, 105);
font-size: 28rpx;
font-weight: 400;
line-height: 56rpx;
letter-spacing: 0;
text-align: left;
}
2025-03-25 16:35:39 +08:00
</style>