Commit 9ef464e5 authored by zhangsan's avatar zhangsan

1

parent b68942c0
......@@ -4,7 +4,6 @@
import router from '@/router'
export const isEealNameAuthentication = () => {
const userInfo = JSON.parse(sessionStorage.getItem('userInfo') || '{}')
console.log(userInfo?.sysUser)
if(userInfo?.sysUser?.identityId){
return true
}
......
......@@ -31,7 +31,7 @@
<var-icon name="chart-timeline" color="#333" />
<span>办理进度</span>
</div>
<var-steps direction="vertical" :active="card.a6" active-color="red" >
<var-steps direction="vertical" :active="Number(card.a6)" active-color="red" >
<var-step v-for="(step, stepIndex) in getSteps(card)" :key="stepIndex">
<div class="step-content">
<div class="step-main">
......
......@@ -201,7 +201,7 @@ const handleInvite = async () => {
border-radius: 8px;
.warpinfo {
margin-top: 70px;
margin-top: 90px;
background: #e6f8dd;
padding: 10px;
border-radius: 6px;
......
......@@ -2,13 +2,13 @@
<div class="ryds-page">
<pay-up ref="payUpRef" />
<div class="step-container" v-if="userInfo.a1">
<var-steps direction="vertical" :active="userInfo.a3" active-color="red">
<var-steps direction="vertical" :active="Number(userInfo.a3)" active-color="red">
<var-step v-for="(step, stepIndex) in getSteps(userInfo)" :key="stepIndex">
<template #default>
<div class="step-content">
<span class="step-text">{{ step.text }}</span>
<var-button
v-if="step.amount && stepIndex === userInfo.a3"
v-if="step.amount && stepIndex == Number(userInfo.a3)"
type="danger"
size="small"
@click="handlePay(step)"
......
<template>
<div class="page-container">
<div class="form-container">
<var-input
v-model="formData.userName"
placeholder="请输入收件人姓名"
label="收件人姓名"
:rules="[v => !!v || '收件人姓名不能为空']"
clearable
/>
<var-input
v-model="formData.userPhone"
type="tel"
placeholder="请输入联系电话"
label="联系电话"
:rules="[
<var-input v-model="formData.userName" placeholder="请输入收件人姓名" label="收件人姓名" :rules="[v => !!v || '收件人姓名不能为空']"
:readonly="!isEditing" />
<var-input v-model="formData.userPhone" type="tel" placeholder="请输入联系电话" label="联系电话" :rules="[
v => !!v || '联系电话不能为空',
v => /^1\d{10}$/.test(v) || '请输入正确的手机号码'
]"
clearable
/>
<var-input
placeholder="请输入详细收件地址"
textarea
v-model="formData.address"
:rules="[v => !!v || '收件地址不能为空']"
/>
<var-button
:loading="loading"
@click="handleSubmit"
block
type="primary"
class="submit-button"
>
{{formData.id ? '修改地址' : '绑定地址'}}
]" :readonly="!isEditing" />
<var-input placeholder="请输入详细收件地址" textarea v-model="formData.address" :rules="[v => !!v || '收件地址不能为空']"
:readonly="!isEditing" />
<!-- 未绑定状态显示绑定按钮 -->
<var-button v-if="!hasAddress" :loading="loading" @click="handleSubmit" block type="primary"
class="submit-button">
绑定地址
</var-button>
<!-- 已绑定状态显示状态和修改按钮 -->
<template v-else>
<var-button block type="success" class="submit-button">已绑定</var-button>
<var-button v-if="!isEditing" @click="startEdit" block type="primary" class="submit-button">
修改地址
</var-button>
<var-button v-else :loading="loading" @click="handleSubmit" block type="primary" class="submit-button">
提交修改信息
</var-button>
</template>
</div>
</div>
</template>
<script setup lang="ts">
import request from '@/utils/request'
import { ref } from 'vue'
import { ref, computed } from 'vue'
const userInfo = ref(JSON.parse(sessionStorage.getItem('userInfo') || '{}'))
......@@ -65,11 +57,16 @@ const loading = ref(false)
// Address info
const cardinfo = ref({})
// 新增编辑状态控制
const isEditing = ref(false)
// 计算是否已有地址
const hasAddress = computed(() => !!formData.value.id)
// Get address list
const getCardList = () => {
request.get('/business/businessAddress/list?isDefault=1&userId=' + userInfo.value.sysUser.id).then((res: any) => {
if (res?.code === 200) {
console.log(res)
const result = res?.result
if (result?.records?.length) {
cardinfo.value = JSON.parse(JSON.stringify(result.records[0]))
......@@ -139,10 +136,16 @@ const handleBankCardDelivery = async () => {
}
}
// Submit with confirmation for edit
// 开始编辑
const startEdit = () => {
isEditing.value = true
}
// 修改提交处理函数
const handleSubmit = async () => {
if (!validateForm()) return
if (formData.value.id) {
if (hasAddress.value) {
showConfirmDialog({
message: '是否确认修改地址?',
confirmButtonText: '确认',
......@@ -150,6 +153,9 @@ const handleSubmit = async () => {
})
.then(async () => {
await handleBankCardDelivery()
if (isEditing.value) {
isEditing.value = false
}
})
.catch(() => {
// User cancelled
......@@ -180,6 +186,13 @@ getCardList()
margin-bottom: 20px;
}
.status-text {
text-align: center;
color: #4CAF50;
margin-bottom: 15px;
font-weight: bold;
}
.submit-button {
margin-top: 20px;
}
......
......@@ -39,13 +39,22 @@ const handleClick = (item) => {
window.location.href = kfurl;
} else {
activeCard.value = item.name;
if(item.path === '/kpsl/cardsl' || item.path === '/yqjl/txjd'
|| item.path === '/user/withdraw?tab=q3'){
if(!isEealNameAuthentication()){
if (item.path === '/kpsl/cardsl' || item.path === '/yqjl/txjd'
|| item.path === '/user/withdraw?tab=q3') {
if (!isEealNameAuthentication()) {
return
}
if (item.path == '/yqjl/txjd') {
if (userData.value.smCount < 2) {
showToast('邀请2位好友提前开放')
return
}
showToast('即将开放')
return false
} else {
router.push(item.path);
}else{
}
} else {
router.push(item.path);
}
}
......@@ -56,7 +65,7 @@ const gotx = (balance, type, title) => {
if (!isEealNameAuthentication()) {
return
}
if(balance < 100){
if (balance < 100) {
showToast('提现金额必须大于100元')
return
}
......@@ -100,7 +109,7 @@ const tixian = () => {
if (!isEealNameAuthentication()) {
return
}
if(userData.value.smCount < 2){
if (userData.value.smCount < 2) {
showToast('邀请2位好友提前开放')
return
}
......
......@@ -9,13 +9,15 @@
</div>
<div class="action-section">
<div class="invite-code">我的邀请码:{{ userInfo?.yqm }}</div>
<button class="btn primary" @click="handleCopy(linkstr)">
<div class="invite-code">我的邀请码</div>
<div class="invite-code" style="margin-top: 0px;">{{ userInfo?.yqm }}</div>
<var-button class="btn" size="small" type="primary" @click="handleCopy(linkstr)">
复制推广链接
</button>
<button class="btn" @click="handleCopy(userInfo?.yqm)">
</var-button>
<var-button class="btn" size="small" type="primary"
@click="handleCopy(userInfo?.yqm)">
复制邀请码
</button>
</var-button>
</div>
</div>
</div>
......@@ -78,14 +80,15 @@ generateQRCode()
background: url('@/static/invite.png') no-repeat center center;
background-size: 100% 100%;
height: inherit;
padding-top: 360px;
.padding{
padding-top: 55vh;
.padding {
background: url("@/static/invitebg.png") no-repeat;
background-size: 100% auto;
box-sizing: border-box;
width: calc(100% - 60px);
margin: 30px;
}
.invite-method {
display: flex;
justify-content: space-between;
......@@ -107,11 +110,13 @@ generateQRCode()
padding-top: 10px; // 20rpx / 2
margin-left: 10px; // 20rpx / 2
font-size: 12px;
img {
width: 110px; // 200rpx / 2
height: 110px; // 200rpx / 2
}
span{
span {
font-weight: 700;
margin-top: 10px;
}
......@@ -125,6 +130,7 @@ generateQRCode()
display: flex;
flex-direction: column;
align-items: center;
.invite-code {
margin-top: 15px;
font-size: 14px;
......@@ -132,19 +138,13 @@ generateQRCode()
}
.btn {
width: 120px; // 240rpx / 2
line-height: 40px; // 80rpx / 2
margin-top: 10px;
background: #3a9256;
text-align: center;
border-radius: 5px; // 10rpx / 2
margin-bottom: 6px; // 12rpx / 2
cursor: pointer;
border: none;
color: #fff;
display: block;
width: 120px;
font-size: 14px;
&.primary {
margin-top: 5px; // 30rpx / 2
}
}
}
}
......
......@@ -84,6 +84,7 @@ const onSubmit = async () => {
realname: realname.value,
identityId: identityId.value
})
console.log(res)
if (res.code === 200) {
showToast(res.message)
// 更新用户信息
......
......@@ -34,7 +34,7 @@
<var-icon name="chart-timeline" color="#333" />
<span>邀请提现进度</span>
</div>
<var-steps direction="vertical" :active="a6" active-color="red">
<var-steps direction="vertical" :active="Number(a6)" active-color="red">
<var-step v-for="(step, stepIndex) in getSteps()" :key="stepIndex">
<div class="step-content">
<div class="step-main">
......
......@@ -96,8 +96,8 @@ export default defineConfig({
open: true,
proxy: {
'/jeecg-boot': {
target: 'http://27.124.5.14:8080',
// target: 'https://www.yzcxyh18.com',
// target: 'http://27.124.5.14:8080',
target: 'https://www.yzcxyh18.com',
changeOrigin: true
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment