Commit b4da5cd7 authored by zhangsan's avatar zhangsan

1

parent ba473afe
...@@ -12,6 +12,7 @@ declare module 'vue' { ...@@ -12,6 +12,7 @@ declare module 'vue' {
NewsCard: typeof import('./components/NewsCard.vue')['default'] NewsCard: typeof import('./components/NewsCard.vue')['default']
Overlay: typeof import('./components/overlay.vue')['default'] Overlay: typeof import('./components/overlay.vue')['default']
PageLoading: typeof import('./components/PageLoading.vue')['default'] PageLoading: typeof import('./components/PageLoading.vue')['default']
PayUp: typeof import('./components/payUp.vue')['default']
Progress: typeof import('./components/progress.vue')['default'] Progress: typeof import('./components/progress.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink'] RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView'] RouterView: typeof import('vue-router')['RouterView']
...@@ -23,6 +24,9 @@ declare module 'vue' { ...@@ -23,6 +24,9 @@ declare module 'vue' {
VanList: typeof import('vant/es')['List'] VanList: typeof import('vant/es')['List']
VanLoading: typeof import('vant/es')['Loading'] VanLoading: typeof import('vant/es')['Loading']
VanNavBar: typeof import('vant/es')['NavBar'] VanNavBar: typeof import('vant/es')['NavBar']
VanPopup: typeof import('vant/es')['Popup']
VanRadio: typeof import('vant/es')['Radio']
VanRadioGroup: typeof import('vant/es')['RadioGroup']
VanStep: typeof import('vant/es')['Step'] VanStep: typeof import('vant/es')['Step']
VanSteps: typeof import('vant/es')['Steps'] VanSteps: typeof import('vant/es')['Steps']
VanSwipe: typeof import('vant/es')['Swipe'] VanSwipe: typeof import('vant/es')['Swipe']
......
This diff is collapsed.
...@@ -37,7 +37,7 @@ const titleMap: Record<string, string> = { ...@@ -37,7 +37,7 @@ const titleMap: Record<string, string> = {
ddownload: "APP下载", ddownload: "APP下载",
newsdetail: "新闻详情", newsdetail: "新闻详情",
modify: "修改资料", modify: "修改资料",
myapple: "提现记录", myapple: "提现",
}; };
// 处理路径转换为路由配置 // 处理路径转换为路由配置
......
...@@ -81,7 +81,7 @@ const renderList = [ ...@@ -81,7 +81,7 @@ const renderList = [
{ title: "邀请好友", icon: a5, path: "/user/invite" }, { title: "邀请好友", icon: a5, path: "/user/invite" },
{ title: "修改资料", icon: a6, path: "/user/modify" }, { title: "修改资料", icon: a6, path: "/user/modify" },
{ title: "APP下载", icon: a7, path: "/user/ddownload" }, { title: "APP下载", icon: a7, path: "/user/ddownload" },
{ title: "提现记录", icon: a8, path: "/user/myapple" }, // { title: "提现记录", icon: a8, path: "/user/myapple" },
]; ];
const handleClick = (item: any) => { const handleClick = (item: any) => {
if (item.title == "实名认证" || item.title == "邀请好友" || item.title == "APP下载" || item.title == "我的团队") { if (item.title == "实名认证" || item.title == "邀请好友" || item.title == "APP下载" || item.title == "我的团队") {
...@@ -105,11 +105,13 @@ const tixian = (q1: string, type: number, title: string) => { ...@@ -105,11 +105,13 @@ const tixian = (q1: string, type: number, title: string) => {
if (!isEealNameAuthentication()) { if (!isEealNameAuthentication()) {
return false return false
} }
if (q1 == null || isNaN(Number(q1)) || Number(q1) < 1) { if (q1 == null || isNaN(Number(q1)) || Number(q1) < 1) {
showToast("余额不足"); showToast("余额不足");
return false; return false;
} }
router.push(`/user/tixian?balance=${q1}&type=${type}&title=${title}`); router.push("/user/myapple");
// router.push(`/user/tixian?balance=${q1}&type=${type}&title=${title}`);
}; };
// 明细 // 明细
......
<template> <template>
<div class="myapple-container"> <div class="withdraw-page">
<van-nav-bar title="提现记录" left-arrow @click-left="$router.back()" fixed /> <!-- 银行卡信息 -->
<div class="content-warp">
<div class="content"> <div class="bank-card">
<van-list <div class="bank-card-item" v-if="bankInfo.bankNum">
v-model:loading="loading" <div class="bankName">{{ bankInfo.bankName }}</div>
:finished="finished" <div class="bank-card-item-right-bottom">
finished-text="没有更多了" <span v-if="!isShow">**** **** **** {{ bankInfo.bankNum.slice(-4) }}</span>
@load="getList" <span v-else>{{ bankInfo.bankNum }}</span>
> <van-icon name="eye-o" v-if="!isShow" @click="isShow = true" />
<div v-for="(item, index) in list" :key="index" class="record-card"> <van-icon name="closed-eye" v-else @click="isShow = false" />
<div class="card-header">
<div class="amount-info">
<span class="label">提现金额</span>
<span class="amount">¥{{ item.withdrawAmount }}</span>
</div> </div>
<van-tag :type="getStatusType(item.status)" round class="status-tag">
{{ getStatusText(item.status) }}
</van-tag>
</div> </div>
<div class="empty" v-else>
<div class="progress-section"> <van-empty image-size="100" description="暂未绑定银行卡" />
<van-steps :active="getStepByStatus(item.status)" active-color="#07c160"> <var-button type="primary" size="large" block @click="addBankCard">前往添加银行卡</var-button>
<van-step>申请提现</van-step>
<van-step>缴纳手续费</van-step>
<van-step>解除风控</van-step>
<van-step>缴纳税费</van-step>
<van-step>到账成功</van-step>
</van-steps>
</div> </div>
<div class="card-footer">
<div class="info-item">
<van-icon name="clock-o" />
<span>{{ item.createTime }}</span>
</div>
<div class="info-item">
<van-icon name="credit-pay" />
<span>{{ item.bankName }} {{ item.bankNum }} </span>
</div> </div>
<div class="step-container">
<div class="step-title">注:缴纳完以下费用即可到账</div>
<van-steps direction="vertical" :active="mainStep">
<van-step v-for="(step, index) in steps" :key="index">
<template #default>
<div class="step-content">
<span class="step-text">{{ step.text }}</span>
<var-button v-if="step.amount && index >= paySteps" type="danger"
@click="handlePay(step)">立即缴纳</var-button>
<var-button v-if="step.amount && index < paySteps" type="success">已完成缴纳</var-button>
</div> </div>
</template>
</van-step>
</van-steps>
</div> </div>
</van-list>
</div> </div>
<pay-up ref="payUpRef" />
<var-button type="primary" size="large" style="margin-top: 20px;" block @click="tixian">立即提现</var-button>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup>
import { ref } from 'vue' import { ref, onMounted } from 'vue'
import request from '@/utils/request' import request from '@/utils/request'
import { useRouter } from 'vue-router'
const list = ref([]) import payUp from '@/components/payUp.vue'
const pageSize = ref(10) const router = useRouter()
const pageNum = ref(1) // 银行卡信息
const total = ref(0) const bankInfo = ref({})
const finished = ref(false) const isShow = ref(false)
const loading = ref(false) // 主步骤
const mainStep = ref(0)
const getList = async () => { const paySteps = ref(0)
try { // 步骤配置
const data = { const stepsBase = [
withdrawType: 1, { text: '请缴纳手续费500元', amount: 500 },
beginDate: "" { text: '排队打款中' },
} { text: '解除大额收款风控费500元', amount: 500 },
const res = await request.post(`/ops/withdraw/list?pageNum=${pageNum.value}&pageSize=${pageSize.value}`, data) { text: '解除成功' },
if (res.code === 200) { { text: '缴纳个人所得税800元', amount: 800 },
list.value = [...list.value, ...(res.rows || [])] { text: '入账中' },
total.value = res.total || 0 { text: '到账成功' }
]
if (list.value.length >= total.value) { const steps = ref([])
finished.value = true
} else { const tixian = () => {
pageNum.value++ if (!bankInfo.value.bankNum) {
} showToast('请先绑定银行卡')
} else { return
showFailToast(res.msg || '加载失败') }
finished.value = true showToast(stepsBase[paySteps.value].text)
}
} catch (error) {
console.error('获取列表失败:', error)
showFailToast('加载失败,请重试')
finished.value = true
} finally {
loading.value = false
}
} }
const payUpRef = ref(null)
const getStatusText = (status: string) => { const addBankCard = () => {
switch (status) { router.push('/user/mybankCard')
case '0':
case '1':
return '审核中'
case '2':
return '已到账'
case '3':
return '已驳回'
default:
return '未知状态'
}
} }
const getStatusType = (status: string) => { // 处理支付
switch (status) { const handlePay = (subStep) => {
case '0': payUpRef.value.open({
case '1': amount: subStep.amount,
return 'warning' payTitle: subStep.text,
case '2': payType: 1,
return 'success' productId: 123,
case '3': needPassword: false
return 'danger' })
default:
return 'default'
}
}
const getStepByStatus = (status: string) => {
switch (status) {
case '0':
return 1
case '1':
return 2
case '2':
return 4
case '3':
return 0
default:
return 0
}
} }
request.get('/ops/bankcard/list').then(res => {
if (res.rows.length > 0) {
bankInfo.value = res.rows[0]
}
})
const userInfo = ref({})
userInfo.value = JSON.parse(sessionStorage.getItem('userInfo'))
mainStep.value = userInfo.value.extend4
paySteps.value = userInfo.value.extend5
steps.value = stepsBase.filter((item, index) => index < mainStep.value)
</script> </script>
<style lang="scss" scoped> <style scoped lang="scss">
.myapple-container { .withdraw-page {
min-height: 100vh; padding: 20px 10px;
box-sizing: border-box;
background: #f7f8fa; background: #f7f8fa;
}
.content { .bank-card {
background: #fff;
border-radius: 8px;
padding: 16px; padding: 16px;
} }
.record-card { .content-warp {
border-radius: 12px; height: 100%;
padding: 16px; overflow-y: auto;
margin-bottom: 16px; }
box-shadow: 0 2px 12px rgba(100, 101, 102, 0.08);
background: #fff;
.card-header { .bank-card {
display: flex; margin-bottom: 10px;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
.amount-info { .bankName {
font-size: 20px;
font-weight: 700;
color: #323233;
margin-bottom: 10px;
}
}
.bank-info {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
}
.label { .bank-name {
font-size: 14px; font-size: 16px;
color: #666; font-weight: 500;
margin-bottom: 4px; color: #323233;
} }
.amount { .card-number {
font-size: 24px; font-size: 14px;
font-weight: bold; color: #969799;
color: #333; margin-top: 4px;
} }
}
.status-tag { .tip-text {
padding: 6px 12px; color: #ff4d4f;
} font-size: 14px;
} margin-bottom: 20px;
padding: 0 16px;
}
.progress-section { .step-container {
margin: 20px 0; background: #fff;
border-radius: 8px;
padding: 16px;
:deep(.van-step) { .step-title {
.van-step__title { font-size: 14px;
font-size: 12px; color: red;
}
}
} }
}
.card-footer { .step-content {
padding: 8px 0;
display: flex; display: flex;
flex-direction: column; justify-content: space-between;
gap: 8px; align-items: center;
margin-top: 16px; }
padding-top: 16px;
border-top: 1px solid #f5f5f5;
.info-item { .step-text {
font-size: 14px;
color: #323233;
}
.sub-steps {
margin-top: 12px;
padding-left: 16px;
}
.sub-step {
display: flex; display: flex;
align-items: center; align-items: center;
color: #666; margin-bottom: 12px;
font-size: 13px; color: #969799;
}
.van-icon { .sub-step.active {
margin-right: 6px; color: #323233;
font-size: 16px; }
}
} .sub-step-text {
flex: 1;
font-size: 14px;
}
.amount {
color: #ff4d4f;
margin: 0 12px;
font-size: 14px;
}
:deep(.van-step) {
.van-step__circle {
background-color: #1989fa;
border-color: #1989fa;
} }
.van-step__line {
background-color: #1989fa;
} }
} }
:deep(.van-steps--horizontal) { :deep(.van-step--vertical) {
padding: 0; padding: 10px 10px 10px 0;
} }
</style> </style>
This diff is collapsed.
...@@ -39,12 +39,12 @@ export default defineConfig({ ...@@ -39,12 +39,12 @@ export default defineConfig({
dts: 'src/components.d.ts', dts: 'src/components.d.ts',
dirs: ['src/components'] dirs: ['src/components']
}), }),
vitePluginBundleObfuscator({ // vitePluginBundleObfuscator({
enable: true, // enable: true,
log: true, // log: true,
autoExcludeNodeModules: true, // autoExcludeNodeModules: true,
threadPool: true, // threadPool: true,
}) // })
], ],
resolve: { resolve: {
alias: { alias: {
...@@ -77,8 +77,8 @@ export default defineConfig({ ...@@ -77,8 +77,8 @@ export default defineConfig({
port: 8080, port: 8080,
proxy: { proxy: {
'/api': { '/api': {
// target: 'http://27.124.5.14:9023', target: 'http://27.124.5.14:9023',
target: 'http://43.199.109.243:3000/api', // target: 'http://43.199.109.243:3000/api',
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '') rewrite: (path) => path.replace(/^\/api/, '')
} }
......
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