feat: 上线前修改

This commit is contained in:
anonymous
2025-01-08 08:30:28 +08:00
parent 71862ec3d5
commit 853f679d0b
50 changed files with 427 additions and 402 deletions
+57 -83
View File
@@ -9,91 +9,51 @@
<template>
<view class="withdrawal-type-edit-page pb-100 min-h-screen">
<template v-if="!realnameInfo">
<view class="p-15 m-15 shadow-[0_0_10px_rgba(10,68,245,0.1)] rounded-10">
<view class="flex items-center py-15 text-14">
<image src="@/static/images/page-sub/realname/realname-type.png" class="w-20 h-20" />
<view class="ml-8">件类型</view>
<view class="flex-1 text-right text-14">身份证</view>
</view>
<view class="flex items-center py-15 text-14">
<image src="@/static/images/page-sub/realname/realname-name.png" class="w-20 h-20" />
<view class="ml-8">真实姓名</view>
<input
class="flex-1 text-right text-14"
placeholder-class=" text-#889BC6 text-right"
type="text"
placeholder="请输入真实姓名"
v-model="form.realname"
/>
</view>
<view class="flex items-center py-15 text-14">
<image src="@/static/images/page-sub/realname/realname-number.png" class="w-20 h-20" />
<view class="ml-8">身份证号</view>
<input
class="flex-1 text-right text-14"
placeholder-class=" text-#889BC6 text-right"
type="text"
placeholder="请输入身份证号"
v-model="form.cardnum"
/>
</view>
<view class="p-15 m-15 shadow-[0_0_10px_rgba(10,68,245,0.1)] rounded-10">
<view class="flex items-center py-15 text-14">
<image src="@/static/images/page-sub/realname/realname-type.png" class="w-20 h-20" />
<view class="ml-8">证件类型</view>
<view class="flex-1 text-right text-14">身份</view>
</view>
<view class="fixed bottom-0 left-0 right-0 pb-safe">
<button class="btn-gradient text-white rounded-full m-15 text-16" @click="onSubmit">
提交
</button>
<view class="flex items-center py-15 text-14">
<image src="@/static/images/page-sub/realname/realname-name.png" class="w-20 h-20" />
<view class="ml-8">真实姓名</view>
<input
class="flex-1 text-right text-14"
placeholder-class=" text-#889BC6 text-right"
type="text"
placeholder="请输入真实姓名"
v-model="form.realname"
/>
</view>
</template>
<view v-else class="flex flex-col items-center">
<template v-if="Number(realnameInfo.status) === 1">
<image
src="@/static/images/page-sub/realname/realname-checking.png"
class="w-150 mx-auto h-150 block"
mode="aspectFit"
<view class="flex items-center py-15 text-14">
<image src="@/static/images/page-sub/realname/realname-number.png" class="w-20 h-20" />
<view class="ml-8">身份证号</view>
<input
class="flex-1 text-right text-14"
placeholder-class=" text-#889BC6 text-right"
type="text"
placeholder="请输入身份证号"
v-model="form.cardnum"
/>
<view class="text-center mt-15 text-14 text-#999">您的实名认证正在审核中请耐心等待</view>
<button class="btn-gradient px-30 text-white rounded-full m-15 text-16" @click="onBack">
返回
</button>
</template>
<template v-else-if="Number(realnameInfo.status) === 2">
<image
src="@/static/images/page-sub/realname/realname-success.png"
class="w-150 h-150 block"
mode="aspectFit"
/>
<view class="text-center mt-15 text-14 text-#999">恭喜您实名认证成功</view>
<button class="btn-gradient px-30 text-white rounded-full m-15 text-16" @click="onBack">
返回
</button>
</template>
<template v-else>
<image
src="@/static/images/page-sub/realname/realname-checking.png"
class="w-150 h-150 block"
mode="aspectFit"
/>
<view class="text-center mt-15 text-14 text-#999">您的实名认证审核未通过请重新提交</view>
<button
@click="() => (realnameInfo = null)"
class="btn-gradient px-30 text-white rounded-full m-15 text-16"
>
重新提交
</button>
</template>
</view>
</view>
<view class="fixed bottom-0 left-0 right-0 pb-safe">
<button class="btn-gradient text-white rounded-full m-15 text-16" @click="onSubmit">
{{ realnameInfo ? '修改' : '提交' }}
</button>
</view>
</view>
</template>
<script setup lang="ts">
import { getRealNameAuthAPI, realNameAuthAPI } from '@/service'
import { editRealNameAuthAPI, getRealNameAuthAPI, realNameAuthAPI } from '@/service'
import { useUserStore } from '@/store'
import { showModal } from '@/utils'
import { ref } from 'vue'
const form = ref({
id: '',
realname: '',
cardnum: '',
})
@@ -102,24 +62,38 @@ const onBack = () => {
uni.navigateBack()
}
const realnameInfo = ref(null)
const loadRealnameInfo = async () => {
realnameInfo.value = await getRealNameAuthAPI().then((res) => {
return res.data
})
if (realnameInfo.value) {
form.value.realname = realnameInfo.value.realname
form.value.cardnum = realnameInfo.value.cardnum
form.value.id = realnameInfo.value.id
}
}
const onSubmit = async () => {
if (!form.value.realname || !form.value.cardnum) {
await showModal('请填写完整信息')
return
}
await realNameAuthAPI(form.value)
await showModal('提交成功,请耐心等待审核!')
realnameInfo.value = await getRealNameAuthAPI().then((res) => {
return res.data
})
if (!/^\d{17}[\d|x]$/.test(form.value.cardnum)) {
await showModal('身份证号格式错误')
return
}
if (form.value.id) {
await editRealNameAuthAPI(form.value)
await showModal('修改成功')
} else {
await realNameAuthAPI(form.value)
await showModal('实名认证成功')
}
loadRealnameInfo()
}
const realnameInfo = ref(null)
onLoad(async () => {
realnameInfo.value = await getRealNameAuthAPI().then((res) => {
return res.data
})
})
onLoad(loadRealnameInfo)
</script>
<style lang="scss" scoped>
.withdrawal-type-edit-page {
+55 -51
View File
@@ -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,
})
+2 -2
View File
@@ -36,9 +36,9 @@
/>
</view>
</view>
<!-- <view class="ml-auto mr-0 w-fit text-gradient text-14 p-15" @click="handleEditPassword">
<view class="ml-auto mr-0 w-fit text-gradient text-14 p-15" @click="handleEditPassword">
忘记密码
</view> -->
</view>
<view
class="mt-30 text-center py-12 rounded-full mx-15 text-15 text-white btn-gradient"
@click="handleLogin"
+5 -4
View File
@@ -111,7 +111,7 @@ import NavBar from '@/components/NavBar.vue'
import { loginRoute } from '@/interceptors/route'
import { downloadAppAPI } from '@/service'
import { useUserStore } from '@/store/user'
import { getImageUrl } from '@/utils'
import { getImageUrl, showModal } from '@/utils'
const userStore = useUserStore()
@@ -128,9 +128,10 @@ const handleWithdrawalDetail = () => {
}
const handleWithdrawal = () => {
uni.navigateTo({
url: '/pages-sub/withdrawal/index',
})
showModal('1月26号开放提现')
// uni.navigateTo({
// url: '/pages-sub/withdrawal/index',
// })
}
const handleTeam = () => {
+2 -1
View File
@@ -104,7 +104,8 @@ onLoad(async (options) => {
<image class="w-24 h-24" src="@/static/images/login/phone.png" mode="aspectFit" />
<input
v-model="form.username"
type="text"
type="number"
maxlength="11"
placeholder-class="text-#889BC6"
class="text-right flex-1 text-14"
placeholder="请输入手机号"
+25
View File
@@ -153,3 +153,28 @@ export const getWithdrawalRecordAPI = (data) =>
export const downloadAppAPI = () => {
location.href = 'https://tiktok-test.gbnorg.com/7885922.apk'
}
// 修改密码第一步
export const editPasswordFirstAPI = (data) =>
http({
url: '/api/user/forgetpassone',
method: 'POST',
data,
hideErrorToast: true,
})
// 修改密码第二步
export const editPasswordSecondAPI = (data) =>
http({
url: '/api/user/forgetpasstwo',
method: 'POST',
data,
})
// 修改实名认证信息
export const editRealNameAuthAPI = (data) =>
http({
url: '/api/user/updateuserauth',
method: 'POST',
data,
})
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 780 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 985 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB