feat: 上线前修改
This commit is contained in:
@@ -15,67 +15,38 @@
|
||||
<view class="flex items-center py-15">
|
||||
<image class="w-24 h-24" src="@/static/images/login/phone.png" mode="aspectFit" />
|
||||
<input
|
||||
v-model="form.account"
|
||||
@blur="handleBlur"
|
||||
type="text"
|
||||
placeholder-class="text-#889BC6"
|
||||
class="text-right flex-1 text-14"
|
||||
placeholder="请输入用户名"
|
||||
placeholder="请输入手机号"
|
||||
/>
|
||||
</view>
|
||||
<view class="flex items-center py-15">
|
||||
<image class="w-24 h-24" src="@/static/images/login/message.png" mode="aspectFit" />
|
||||
<image class="w-24 h-24" src="@/static/images/login/password.png" mode="aspectFit" />
|
||||
<input
|
||||
placeholder-class="text-#889BC6"
|
||||
type="password"
|
||||
v-model="form.newpassword"
|
||||
class="text-right flex-1 text-14"
|
||||
placeholder="请输入新密码"
|
||||
/>
|
||||
</view>
|
||||
<view class="flex items-center py-15" v-if="form.nosuth">
|
||||
<image class="w-24 h-24" src="@/static/images/login/invite.png" mode="aspectFit" />
|
||||
<input
|
||||
v-model="form.cardnum"
|
||||
placeholder-class="text-#889BC6"
|
||||
type="text"
|
||||
placeholder-class="text-#889BC6"
|
||||
class="text-right flex-1 text-14"
|
||||
placeholder="请输入短信验证码"
|
||||
/>
|
||||
<view
|
||||
class="py-6 rounded-full ml-15 px-15 text-12 text-white btn-gradient text-14 text-#889BC6"
|
||||
@click="handleGetCode"
|
||||
>
|
||||
获取验证码
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex items-center py-15">
|
||||
<image class="w-24 h-24" src="@/static/images/login/password.png" mode="aspectFit" />
|
||||
<input
|
||||
placeholder-class="text-#889BC6"
|
||||
type="password"
|
||||
class="text-right flex-1 text-14"
|
||||
placeholder="请输入登录密码"
|
||||
/>
|
||||
</view>
|
||||
<view class="flex items-center py-15">
|
||||
<image class="w-24 h-24" src="@/static/images/login/password.png" mode="aspectFit" />
|
||||
<input
|
||||
placeholder-class="text-#889BC6"
|
||||
type="password"
|
||||
class="text-right flex-1 text-14"
|
||||
placeholder="请再次输入登录密码"
|
||||
/>
|
||||
</view>
|
||||
<view class="flex items-center py-15">
|
||||
<image class="w-24 h-24" src="@/static/images/login/password.png" mode="aspectFit" />
|
||||
<input
|
||||
placeholder-class="text-#889BC6"
|
||||
type="password"
|
||||
class="text-right flex-1 text-14"
|
||||
placeholder="请输入支付密码"
|
||||
/>
|
||||
</view>
|
||||
<view class="flex items-center py-15">
|
||||
<image class="w-24 h-24" src="@/static/images/login/password.png" mode="aspectFit" />
|
||||
<input
|
||||
placeholder-class="text-#889BC6"
|
||||
type="password"
|
||||
class="text-right flex-1 text-14"
|
||||
placeholder="请再次输入支付密码"
|
||||
placeholder="请输入身份证号"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="mt-50 text-center py-12 rounded-full mx-15 text-15 text-white btn-gradient"
|
||||
@click="handleRegister"
|
||||
@click="handleSubmit"
|
||||
>
|
||||
确认
|
||||
</view>
|
||||
@@ -86,19 +57,52 @@
|
||||
<script lang="ts" setup>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import { isLogged } from '@/interceptors/route'
|
||||
import { editPasswordFirstAPI, editPasswordSecondAPI } from '@/service'
|
||||
import { useUserStore } from '@/store/user'
|
||||
import { showModal } from '@/utils'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const form = ref({
|
||||
account: '',
|
||||
newpassword: '',
|
||||
cardnum: '',
|
||||
nosuth: 0,
|
||||
})
|
||||
|
||||
let redirect = '/'
|
||||
onLoad((options) => {
|
||||
redirect = options.redirect ?? '/'
|
||||
})
|
||||
|
||||
const handleRegister = () => {
|
||||
userStore.setUserInfo({
|
||||
token: '123456',
|
||||
})
|
||||
async function handleBlur() {
|
||||
const account = form.value.account
|
||||
if (account) {
|
||||
const { data } = await editPasswordFirstAPI({
|
||||
account,
|
||||
})
|
||||
form.value.nosuth = data?.nosuth ?? 0
|
||||
}
|
||||
}
|
||||
const handleSubmit = async () => {
|
||||
if (!form.value.account || !form.value.newpassword) {
|
||||
uni.showToast({
|
||||
title: '请填写完整信息',
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (form.value.nosuth) {
|
||||
if (!form.value.cardnum) {
|
||||
uni.showToast({
|
||||
title: '请填写身份证号',
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
await editPasswordSecondAPI(form.value)
|
||||
await showModal('修改成功')
|
||||
uni.reLaunch({
|
||||
url: redirect,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user