Commit 9ef464e5 authored by zhangsan's avatar zhangsan

1

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