我的账户

This commit is contained in:
haomingming 2026-03-06 14:40:09 +08:00
parent 7fb1200528
commit 89848ba321
9 changed files with 442 additions and 94 deletions

View File

@ -901,6 +901,16 @@
} }
} }
}, },
{
"path": "myAccount/billDetail",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "详情",
"app": {
"bounce": "none"
}
}
},
{ {
"path": "myAccount/withdrawal", "path": "myAccount/withdrawal",
"style": { "style": {
@ -1686,7 +1696,7 @@
"list": [ "list": [
{ {
"name": "", "name": "",
"path": "pages_app/patientMsg/patientMsg", "path": "/pages_app/myAccount/myAccount",
"query": "" "query": ""
} }
] ]

View File

@ -19,26 +19,36 @@
</view> </view>
<!-- 银行卡列表 --> <!-- 银行卡列表 -->
<view class="card-list"> <view class="card-list">
<view class="card-item" v-for="(card, index) in bankCards" :key="card.uuid"> <uni-swipe-action>
<view class="card-logo"> <uni-swipe-action-item
<image v-for="(card, index) in bankCards"
v-if="getBankLogoImg(card.open_bank)" :key="card.uuid"
class="bank-logo-img" @change="onSwipeChange($event, card)"
:src="getBankLogoImg(card.open_bank)" >
mode="aspectFit" <template v-slot:right>
></image> <view class="swipe-right">
<view v-else class="logo-bg"> <view class="card-delete-btn" @click.stop="handleDeleteBankCard(card)">删除</view>
<text class="logo-text">{{ getBankLogo(card.open_bank) }}</text> </view>
</template>
<view class="card-item" :class="{ 'is-swiping': openedSwipeUuid === card.uuid }">
<view class="card-logo">
<image
v-if="getBankLogoImg(card.open_bank)"
class="bank-logo-img"
:src="getBankLogoImg(card.open_bank)"
mode="aspectFit"
></image>
<view v-else class="logo-bg">
<text class="logo-text">{{ getBankLogo(card.open_bank) }}</text>
</view>
</view>
<view class="card-info">
<view class="card-number">尾号{{ card.card_number }}储蓄卡</view>
<view class="bank-name">{{ card.open_bank }}</view>
</view>
</view> </view>
</view> </uni-swipe-action-item>
<view class="card-info"> </uni-swipe-action>
<view class="card-number">尾号{{ card.card_number }}储蓄卡</view>
<view class="bank-name">{{ card.open_bank }}</view>
</view>
<view class="card-delete" @click.stop="handleDeleteBankCard(card)">
删除
</view>
</view>
</view> </view>
<empty v-if="bankCards.length === 0" imgWidth="50%" empty-img="/static/empty_bank.png" empty-desc="使用常用卡,支付更快捷"></empty> <empty v-if="bankCards.length === 0" imgWidth="50%" empty-img="/static/empty_bank.png" empty-desc="使用常用卡,支付更快捷"></empty>
@ -53,12 +63,17 @@ import navTo from '@/utils/navTo';
import api from '@/api/api'; import api from '@/api/api';
import empty from "@/components/empty/empty.vue" import empty from "@/components/empty/empty.vue"
const bankCards = ref([]); const bankCards = ref([]);
const openedSwipeUuid = ref('');
import { onLoad,onBackPress } from '@dcloudio/uni-app'; import { onLoad,onBackPress } from '@dcloudio/uni-app';
const from = ref(''); const from = ref('');
const returnTo = ref('');
onLoad((options) => { onLoad((options) => {
if(options.from){ if(options.from){
from.value = options.from; from.value = options.from;
} }
if (options.returnTo) {
returnTo.value = decodeURIComponent(options.returnTo);
}
}); });
onBackPress(() => { onBackPress(() => {
if(!from.value){ if(!from.value){
@ -85,8 +100,11 @@ const goBack = () => {
}; };
const addBankCard = () => { const addBankCard = () => {
const target = returnTo.value
? `/pages_app/idcardAuth/idcardAuth?returnTo=${encodeURIComponent(returnTo.value)}`
: '/pages_app/idcardAuth/idcardAuth';
navTo({ navTo({
url: '/pages_app/idcardAuth/idcardAuth' url: target
}); });
}; };
@ -146,6 +164,13 @@ const handleDeleteBankCard = (card) => {
}); });
}; };
const onSwipeChange = (e, card) => {
const state = typeof e === 'string'
? e
: e?.position || e?.show || e?.detail?.position || e?.detail?.show || 'none';
openedSwipeUuid.value = state === 'right' ? card.uuid : '';
};
// logo // logo
const getBankLogo = (bankName) => { const getBankLogo = (bankName) => {
const bankLogos = { const bankLogos = {
@ -181,7 +206,6 @@ onMounted(() => {
:deep(.uni-nav-bar-right-text) { :deep(.uni-nav-bar-right-text) {
font-size: 32rpx; font-size: 32rpx;
font-weight: 600;
} }
} }
@ -190,15 +214,41 @@ onMounted(() => {
margin-top: calc(var(--status-bar-height) + 44px); margin-top: calc(var(--status-bar-height) + 44px);
padding: 30rpx; padding: 30rpx;
.swipe-right {
height: 100%;
display: flex;
align-items: stretch;
padding-right: 0;
box-sizing: border-box;
}
.card-delete-btn {
min-width: 112rpx;
height: 100%;
padding: 0 24rpx;
border-radius: 0 16rpx 16rpx 0;
background: #E60012;
color: #ffffff;
font-size: 24rpx;
font-weight: 600;
display: flex;
align-items: center;
justify-content: center;
}
.card-item { .card-item {
background: #ffffff; background: #ffffff;
border-radius: 16rpx; border-radius: 16rpx;
padding: 30rpx; padding: 30rpx;
margin-bottom: 20rpx;
display: flex; display: flex;
align-items: center; align-items: center;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1); box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
&.is-swiping {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.card-logo { .card-logo {
margin-right: 30rpx; margin-right: 30rpx;
@ -242,12 +292,6 @@ onMounted(() => {
} }
} }
.card-delete {
font-size: 30rpx;
font-weight: 600;
color: #E60012;
padding: 8rpx 0 8rpx 20rpx;
}
} }
} }

View File

@ -88,9 +88,11 @@
<text class="form-label">银行卡号</text> <text class="form-label">银行卡号</text>
<view class="input-container"> <view class="input-container">
<input <input
class="form-input" class="form-input card-number-input"
:class="{ 'is-filled': !!formData.cardNumber }"
placeholder="仅限借记卡" placeholder="仅限借记卡"
v-model="formData.cardNumber" :value="cardNumberDisplay"
@input="onCardNumberInput"
placeholder-style="color: #cccccc" placeholder-style="color: #cccccc"
/> />
@ -103,7 +105,7 @@
<text class="form-label">手机号</text> <text class="form-label">手机号</text>
<view class="input-container"> <view class="input-container">
<input <input
class="form-input" class="form-input card-number-input"
placeholder="银行预留手机号" placeholder="银行预留手机号"
v-model="formData.mobile" v-model="formData.mobile"
placeholder-style="color: #cccccc" placeholder-style="color: #cccccc"
@ -171,6 +173,7 @@ import stepActiveImg from "@/static/add_card_yes.png"
import navTo from '@/utils/navTo'; import navTo from '@/utils/navTo';
import api from '@/api/api'; import api from '@/api/api';
import unidialog from '@/components/dialog/dialog.vue'; import unidialog from '@/components/dialog/dialog.vue';
import { onLoad } from '@dcloudio/uni-app';
const cardContent = ref('暂支持以下银行:农业银行、建设银行、光大银行、平安银行、兴业银行、中信银行、邮政储蓄银行、民生银行、中国银行、工商银行、交通银行、浦发银行、广发银行、华夏银行、招商银行、北京银行、上海银行。'); const cardContent = ref('暂支持以下银行:农业银行、建设银行、光大银行、平安银行、兴业银行、中信银行、邮政储蓄银行、民生银行、中国银行、工商银行、交通银行、浦发银行、广发银行、华夏银行、招商银行、北京银行、上海银行。');
const cardTitle = ref('银行卡说明'); const cardTitle = ref('银行卡说明');
const cardVisible = ref(false); const cardVisible = ref(false);
@ -199,6 +202,13 @@ const smsCode = ref('');
const sendingCode = ref(false); const sendingCode = ref(false);
const countdown = ref(0); const countdown = ref(0);
let countdownTimer = null; let countdownTimer = null;
const returnTo = ref('');
onLoad((options) => {
if (options.returnTo) {
returnTo.value = decodeURIComponent(options.returnTo);
}
});
const maskedMobile = computed(() => { const maskedMobile = computed(() => {
const m = formData.value.mobile || ''; const m = formData.value.mobile || '';
@ -207,6 +217,18 @@ const maskedMobile = computed(() => {
} }
return m || '***********'; return m || '***********';
}); });
const formatCardNumber = (value) => {
const digits = String(value || '').replace(/\D/g, '').slice(0, 19);
return digits.replace(/(\d{4})(?=\d)/g, '$1 ');
};
const cardNumberDisplay = computed(() => formatCardNumber(formData.value.cardNumber));
const onCardNumberInput = (e) => {
const value = e?.detail?.value || '';
formData.value.cardNumber = String(value).replace(/\D/g, '').slice(0, 19);
};
const goBack = () => { const goBack = () => {
uni.navigateBack(); uni.navigateBack();
}; };
@ -344,9 +366,15 @@ const onConfirmSms = async () => {
}); });
if (res.code === 200) { if (res.code === 200) {
uni.showToast({ title: '银行卡添加成功', icon: 'none' }); uni.showToast({ title: '银行卡添加成功', icon: 'none' });
navTo({ if (returnTo.value) {
url: '/pages_app/idcardAuth/bankCardList' uni.redirectTo({
}); url: returnTo.value
});
} else {
navTo({
url: '/pages_app/idcardAuth/bankCardList'
});
}
} else { } else {
uni.showToast({ title: res.msg || '银行卡添加失败', icon: 'none' }); uni.showToast({ title: res.msg || '银行卡添加失败', icon: 'none' });
} }
@ -484,42 +512,55 @@ const onCancelSms = () => {
.form-item { .form-item {
margin-bottom: 30rpx;
display: flex; display: flex;
align-items: center; align-items: center;
position: relative;
border-bottom: 2rpx solid #eee; border-bottom: 2rpx solid #eee;
padding: 0 30rpx 20rpx; height: 92rpx;
padding: 0 30rpx;
box-sizing: border-box;
&:last-child { &:last-child {
margin-bottom: 0; margin-bottom: 0;
padding-bottom: 0;
} }
.form-label { .form-label {
display: block; display: flex;
align-items: center;
justify-content: flex-end;
height: 80rpx;
font-size: 28rpx; font-size: 28rpx;
color: #000000; color: #000000;
width: 120rpx; width: 120rpx;
font-weight: 500; font-weight: 500;
text-align: right;
text-align-last: auto;
letter-spacing: 0;
white-space: nowrap;
margin-right: 10rpx;
} }
.form-input { .form-input {
flex: 1; flex: 1;
height: 80rpx; height: 80rpx;
min-height: 80rpx;
line-height: 80rpx;
padding: 0 20rpx; padding: 0 20rpx;
font-size: 28rpx; font-size: 28rpx;
background: #ffffff; background: #ffffff;
border: none; border: none;
outline: none; outline: none;
box-sizing: border-box;
&:focus { &:focus {
border-color: #8B2316; border-color: #8B2316;
} }
} }
.info-icon { .info-icon {
flex:1;
position: absolute; position: absolute;
right: 20rpx; right: 30rpx;
top: 50%;
transform: translateY(-50%);
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
border-radius: 50%; border-radius: 50%;
@ -539,20 +580,26 @@ const onCancelSms = () => {
display: flex; display: flex;
align-items: center; align-items: center;
position: relative; position: relative;
width: 80%; height: 80rpx;
flex: 1;
padding-right: 56rpx;
box-sizing: border-box;
.form-input { .form-input {
flex: 9; flex: 1;
height: 80rpx; height: 100%;
padding: 0 20rpx; min-height: 100%;
line-height: 80rpx;
padding: 0;
font-size: 28rpx; font-size: 28rpx;
background: #ffffff; background: #ffffff;
border: none; border: none;
border-radius: 0; border-radius: 0;
outline: none; outline: none;
box-sizing: border-box;
&:focus { &.card-number-input.is-filled {
/* 去除边框后无需变更边框颜色 */ font-weight: 600;
} }
} }
@ -674,6 +721,10 @@ const onCancelSms = () => {
background: #eeeeee; background: #eeeeee;
color: #8B2316; color: #8B2316;
font-size: 26rpx; font-size: 26rpx;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
} }
.sms-actions { .sms-actions {

View File

@ -0,0 +1,135 @@
<template>
<view class="bill-detail-page">
<view class="navbox">
<view class="status_bar"></view>
<uni-nav-bar
left-icon="left"
title="详情"
@clickLeft="goBack"
color="#8B2316"
:border="false"
backgroundColor="#eeeeee"
></uni-nav-bar>
</view>
<view class="detail-content">
<view class="detail-row">
<text class="label">交易号</text>
<text class="value">{{ detail.tradeNo || '-' }}</text>
</view>
<view class="detail-row">
<text class="label">类型</text>
<text class="value">{{ detail.typeName || '-' }}</text>
</view>
<view class="detail-row">
<text class="label">金额</text>
<text class="value amount" :class="amountClass">{{ detail.accountStr || '-' }}</text>
</view>
<view class="detail-row">
<text class="label">患者</text>
<text class="value">{{ detail.userName || '-' }}</text>
</view>
<view class="detail-row">
<text class="label">时间</text>
<text class="value">{{ formatDateTime(detail.createTime) }}</text>
</view>
<view class="detail-row">
<text class="label">备注</text>
<text class="value">{{ detail.remark || '' }}</text>
</view>
</view>
</view>
</template>
<script setup>
import { ref, computed, onMounted } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
const detail = ref({})
const from = ref('')
onLoad((options) => {
if (options.from) {
from.value = decodeURIComponent(options.from)
}
})
const amountClass = computed(() => {
const amount = Number(detail.value?.accountStr || 0)
return amount < 0 ? 'negative' : 'positive'
})
const formatDateTime = (value) => {
if (!value) return '-'
const text = String(value).trim()
const date = new Date(text)
if (Number.isNaN(date.getTime())) return text
const y = date.getFullYear()
const m = String(date.getMonth() + 1).padStart(2, '0')
const d = String(date.getDate()).padStart(2, '0')
const hh = String(date.getHours()).padStart(2, '0')
const mm = String(date.getMinutes()).padStart(2, '0')
const ss = String(date.getSeconds()).padStart(2, '0')
return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
}
const goBack = () => {
if (from.value === 'billDetails') {
uni.navigateBack()
return
}
uni.redirectTo({
url: '/pages_app/myAccount/billDetails?from=myAccount'
})
}
onMounted(() => {
const cache = uni.getStorageSync('billDetailItem')
detail.value = cache || {}
})
</script>
<style lang="scss" scoped>
.bill-detail-page {
min-height: 100vh;
background: #f3f3f3;
}
.detail-content {
margin-top: calc(var(--status-bar-height) + 44px);
background: #ffffff;
padding: 0 24rpx;
}
.detail-row {
min-height: 88rpx;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1rpx solid #efefef;
}
.label {
font-size: 38rpx;
color: #2c2c2c;
}
.value {
flex: 1;
text-align: right;
font-size: 38rpx;
color: #666666;
margin-left: 20rpx;
word-break: break-all;
}
.amount {
&.positive {
color: #8B2316;
}
&.negative {
color: #3f3f3f;
}
}
</style>

View File

@ -35,7 +35,7 @@
@scrolltolower="onLoadMore" @scrolltolower="onLoadMore"
:lower-threshold="100" :lower-threshold="100"
> >
<view class="transaction-item" v-for="(item, index) in orderList" :key="item.id"> <view class="transaction-item" v-for="(item, index) in orderList" :key="item.id" @click="goToDetail(item)">
<view class="cell business-type">{{ item.typeName }}</view> <view class="cell business-type">{{ item.typeName }}</view>
<view class="cell user">{{ item.userName }}</view> <view class="cell user">{{ item.userName }}</view>
<view class="cell date-amount"> <view class="cell date-amount">
@ -65,6 +65,7 @@
<script setup> <script setup>
import { ref, onMounted } from 'vue' import { ref, onMounted } from 'vue'
import api from '@/api/api.js' import api from '@/api/api.js'
import { onLoad } from '@dcloudio/uni-app'
// //
const orderList = ref([]) const orderList = ref([])
@ -74,6 +75,13 @@ const page = ref(1)
const total = ref(0) const total = ref(0)
const isFirstPage = ref(true) const isFirstPage = ref(true)
const isLastPage = ref(false) const isLastPage = ref(false)
const from = ref('')
onLoad((options) => {
if (options.from) {
from.value = decodeURIComponent(options.from)
}
})
const stopRefresh = () => { const stopRefresh = () => {
refreshing.value = false refreshing.value = false
@ -106,13 +114,15 @@ const getOrderList = async (isRefresh = false) => {
const safeList = Array.isArray(list) ? list : [] const safeList = Array.isArray(list) ? list : []
const processedList = safeList.map(item => ({ const processedList = safeList.map(item => ({
id: item.trade_no, id: item.trade_no,
tradeNo: item.trade_no,
typeName: item.type_name, typeName: item.type_name,
userName: item.user_name, userName: item.user_name,
createTime: item.create_time, createTime: item.create_time,
accountStr: item.accountstr, accountStr: item.accountstr,
payChannel: item.pay_channel, payChannel: item.pay_channel,
orderType: item.order_type, orderType: item.order_type,
status: item.status status: item.status,
remark: item.remark || item.message || ''
})) }))
orderList.value.push(...processedList) orderList.value.push(...processedList)
@ -164,9 +174,23 @@ const formatDate = (dateStr) => {
// //
const goBack = () => { const goBack = () => {
if (from.value === 'myAccount') {
uni.redirectTo({
url: '/pages_app/myAccount/myAccount?from=billDetails'
})
return
}
uni.navigateBack() uni.navigateBack()
} }
const goToDetail = (item) => {
uni.setStorageSync('billDetailItem', item || {})
const fromPage = encodeURIComponent('billDetails')
uni.navigateTo({
url: `/pages_app/myAccount/billDetail?from=${fromPage}`
})
}
onMounted(() => { onMounted(() => {
getOrderList() getOrderList()
}) })

View File

@ -42,7 +42,7 @@
<view class="action-items"> <view class="action-items">
<view class="action-item" @click="handleWithdrawal"> <view class="action-item" @click="handleWithdrawal">
<view class="action-icon withdrawal-icon"> <view class="action-icon withdrawal-icon">
<text class="icon-text">💰</text> <image class="icon-img" :src="withdrawalsIcon" mode="aspectFit"></image>
</view> </view>
<view class="action-content"> <view class="action-content">
<text class="action-title">提现</text> <text class="action-title">提现</text>
@ -53,7 +53,7 @@
<view class="action-item" @click="handleBillDetails"> <view class="action-item" @click="handleBillDetails">
<view class="action-icon bill-icon"> <view class="action-icon bill-icon">
<text class="icon-text">📋</text> <image class="icon-img" :src="accountIcon" mode="aspectFit"></image>
</view> </view>
<view class="action-content"> <view class="action-content">
<text class="action-title">账单明细</text> <text class="action-title">账单明细</text>
@ -71,6 +71,8 @@
import { ref, onMounted } from 'vue' import { ref, onMounted } from 'vue'
import api from '@/api/api.js' import api from '@/api/api.js'
import docUrl from '@/utils/docUrl' import docUrl from '@/utils/docUrl'
import withdrawalsIcon from '@/static/withdrawals.png'
import accountIcon from '@/static/account_icon.png'
import { onLoad,onBackPress } from '@dcloudio/uni-app'; import { onLoad,onBackPress } from '@dcloudio/uni-app';
const from = ref(''); const from = ref('');
onLoad((options) => { onLoad((options) => {
@ -129,8 +131,9 @@ const handleWithdrawal = () => {
cancelText: '取消', cancelText: '取消',
success: (res) => { success: (res) => {
if(res.confirm){ if(res.confirm){
const returnTo = encodeURIComponent('/pages_app/myAccount/myAccount')
uni.navigateTo({ uni.navigateTo({
url: '/pages_app/idcardAuth/bankCardList' url: `/pages_app/idcardAuth/idcardAuth?returnTo=${returnTo}`
}) })
} }
} }
@ -141,8 +144,9 @@ const handleWithdrawal = () => {
} }
const handleBillDetails = () => { const handleBillDetails = () => {
const from = encodeURIComponent('myAccount')
uni.navigateTo({ uni.navigateTo({
url: '/pages_app/myAccount/billDetails' url: `/pages_app/myAccount/billDetails?from=${from}`
}) })
} }
@ -172,13 +176,13 @@ const getMyAccount = async () => {
background: linear-gradient(135deg, #8B2316, #A0522D); background: linear-gradient(135deg, #8B2316, #A0522D);
// margin: 30rpx; // margin: 30rpx;
// border-radius: 20rpx; // border-radius: 20rpx;
padding: 60rpx 40rpx; padding: 30rpx 40rpx 10rpx;
text-align: center; text-align: center;
box-shadow: 0 8rpx 24rpx rgba(139, 35, 22, 0.3); box-shadow: 0 8rpx 24rpx rgba(139, 35, 22, 0.3);
position: relative; position: relative;
.profile-section { .profile-section {
margin-bottom: 40rpx; margin-bottom: 10rpx;
.profile-avatar { .profile-avatar {
width: 120rpx; width: 120rpx;
@ -193,18 +197,18 @@ const getMyAccount = async () => {
display: block; display: block;
color: rgba(255, 255, 255, 0.9); color: rgba(255, 255, 255, 0.9);
font-size: 28rpx; font-size: 28rpx;
margin-bottom: 20rpx; margin-bottom: 10rpx;
font-weight: 500; font-weight: 500;
} }
.balance-amount { .balance-amount {
display: block; display: block;
color: #ffffff; color: #ffffff;
font-size: 72rpx; font-size: 50rpx;
font-weight: bold; font-weight: bold;
text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.2); text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.2);
letter-spacing: 2rpx; letter-spacing: 2rpx;
margin-bottom: 40rpx; margin-bottom: 0rpx;
} }
// //
@ -242,7 +246,7 @@ const getMyAccount = async () => {
// //
.action-items { .action-items {
background-color: #ffffff; background-color: #ffffff;
margin-top: 30rpx; margin-top: 0rpx;
// border-radius: 20rpx; // border-radius: 20rpx;
overflow: hidden; overflow: hidden;
// box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.08); // box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.08);
@ -250,7 +254,7 @@ const getMyAccount = async () => {
.action-item { .action-item {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 40rpx 30rpx; padding: 20rpx 30rpx;
border-bottom: 1rpx solid #f0f0f0; border-bottom: 1rpx solid #f0f0f0;
transition: background-color 0.2s ease; transition: background-color 0.2s ease;
@ -275,6 +279,11 @@ const getMyAccount = async () => {
.icon-text { .icon-text {
font-size: 32rpx; font-size: 32rpx;
} }
.icon-img {
width: 34rpx;
height: 34rpx;
}
} }
.withdrawal-icon { .withdrawal-icon {

View File

@ -26,20 +26,27 @@
<text class="section-title">结算银行卡</text> <text class="section-title">结算银行卡</text>
<text class="withdrawal-rules" @click="showWithdrawalRules">提现规则</text> <text class="withdrawal-rules" @click="showWithdrawalRules">提现规则</text>
</view> </view>
<view class="divider"></view>
<view class="bank-card-info" @click="selectBankCard" v-if="selectedBankCard"> <view class="bank-card-info" @click="selectBankCard" v-if="selectedBankCard">
<view class="bank-logo"> <view class="bank-logo">
<text class="bank-icon">{{ selectedBankCard.bankName ? selectedBankCard.bankName.charAt(0) : '工' }}</text> <image
v-if="getBankLogoImg(getBankName(selectedBankCard))"
class="bank-logo-img"
:src="getBankLogoImg(getBankName(selectedBankCard))"
mode="aspectFit"
></image>
<view v-else class="logo-bg">
<text class="bank-icon">{{ getBankLogo(getBankName(selectedBankCard)) }}</text>
</view>
</view> </view>
<view class="bank-details"> <view class="bank-details">
<text class="bank-name">{{ selectedBankCard.bankName || '工商银行' }}</text> <text class="bank-name">{{ getBankName(selectedBankCard) || '工商银行' }}</text>
<text class="bank-card-number">尾号为{{ selectedBankCard.cardNumber ? selectedBankCard.cardNumber.slice(-4) : '8937' }}储蓄卡</text> <text class="bank-card-number">尾号为{{ getCardTail(selectedBankCard) }}储蓄卡</text>
</view> </view>
<text class="arrow-icon"></text> <uni-icons type="right" size="25" color="#999"></uni-icons>
</view> </view>
<view class="no-bank-card" v-else> <view class="no-bank-card" v-else>
<text class="no-card-text">请先添加银行卡</text> <text class="no-card-text">请先添加银行卡</text>
<text class="arrow-icon"></text> <uni-icons type="right" size="25" color="#999"></uni-icons>
</view> </view>
<view class="divider"></view> <view class="divider"></view>
</view> </view>
@ -164,6 +171,63 @@ const goBack = () => {
uni.navigateBack() uni.navigateBack()
} }
const bankLogoMap = {
'工商银行': '/static/icon_bankcard_gongshang.png',
'中国银行': '/static/icon_bankcard_zhongguo.png',
'建设银行': '/static/icon_bankcard_jianseyinhang.png',
'农业银行': '/static/icon_bankcard_nongyeyinhang.png',
'交通银行': '/static/icon_bankcard_jiatong.png',
'招商银行': '/static/icon_bankcard_zhaoshangyinhang.png',
'民生银行': '/static/icon_bankcard_minshneg.png',
'兴业银行': '/static/icon_bankcard_xingye.png',
'浦发银行': '/static/icon_bankcard_shanghaipudongfazhanyinhang.png',
'光大银行': '/static/icon_bankcard_guangda.png',
'华夏银行': '/static/icon_bankcard_huaxiayinhnag.png',
'中信银行': '/static/icon_bankcard_zhongxinshiye.png',
'平安银行': '/static/icon_bankcard_pingan.png',
'广发银行': '/static/icon_bankcard_guangfa.png',
'邮储银行': '/static/icon_bankcard_youzheng.png',
'上海银行': '/static/icon_bankcard_shanghai.png',
'北京银行': '/static/icon_bankcard_beijingyinhang.png'
}
const getBankName = (card) => {
if (!card) return ''
return card.bankName || card.open_bank || ''
}
const getCardTail = (card) => {
if (!card) return '8937'
const raw = card.cardNumber || card.card_number || ''
return raw ? String(raw).slice(-4) : '8937'
}
const getBankLogoImg = (bankName) => {
return bankLogoMap[bankName] || ''
}
const getBankLogo = (bankName) => {
const bankLogos = {
'工商银行': '工',
'中国银行': '中',
'建设银行': '建',
'农业银行': '农',
'交通银行': '交',
'招商银行': '招',
'民生银行': '民',
'兴业银行': '兴',
'浦发银行': '浦',
'光大银行': '光',
'华夏银行': '华',
'中信银行': '信',
'平安银行': '平',
'广发银行': '广',
'邮储银行': '邮'
}
if (!bankName) return '工'
return bankLogos[bankName] || bankName.charAt(0)
}
// //
const getMyAccount = async () => { const getMyAccount = async () => {
try { try {
@ -219,8 +283,9 @@ const getBankCardList = async () => {
confirmText: '去添加', confirmText: '去添加',
success: (modalRes) => { success: (modalRes) => {
if (modalRes.confirm) { if (modalRes.confirm) {
const returnTo = encodeURIComponent('/pages_app/myAccount/withdrawal?from=bankCardList')
uni.navigateTo({ uni.navigateTo({
url: '/pages_app/idcardAuth/bankCardList' url: `/pages_app/idcardAuth/bankCardList?from=withdrawal&returnTo=${returnTo}`
}) })
} }
} }
@ -243,7 +308,7 @@ const selectBankCard = () => {
// //
uni.showActionSheet({ uni.showActionSheet({
itemList: bankCardList.value.map(card => `${card.bankName} 尾号${card.cardNumber.slice(-4)}`), itemList: bankCardList.value.map(card => `${getBankName(card)} 尾号${getCardTail(card)}`),
success: (res) => { success: (res) => {
selectedBankCard.value = bankCardList.value[res.tapIndex] selectedBankCard.value = bankCardList.value[res.tapIndex]
} }
@ -257,8 +322,8 @@ const showWithdrawalRules = () => {
const feeAmount = (withdrawalBalanceFee.value / 100).toFixed(2) const feeAmount = (withdrawalBalanceFee.value / 100).toFixed(2)
uni.showModal({ uni.showModal({
title: '提现规则', title: '温馨提示',
content: `1. 提现金额不得少于${minAmount}\n2. 单次提现限额为${maxAmount}\n3. 提现手续费为${feeAmount}\n4. 工作日24小时内到账`, content: `提交成功后会有工作人员与您联系`,
showCancel: false, showCancel: false,
confirmText: '我知道了' confirmText: '我知道了'
}) })
@ -283,15 +348,7 @@ const confirmWithdrawal = () => {
return return
} }
//
const maxAmount = withdrawalBalanceMaxOnce.value / 100
if (parseFloat(withdrawalAmount.value) > maxAmount) {
uni.showToast({
title: `单次提现限额为${maxAmount.toFixed(2)}`,
icon: 'none'
})
return
}
// //
showSmsDialog.value = true showSmsDialog.value = true
@ -410,7 +467,9 @@ const onCancelSms = () => {
// //
.main-content { .main-content {
padding-top: calc(var(--status-bar-height) + 44px);
padding-bottom: 180rpx;
box-sizing: border-box;
} }
// //
@ -453,8 +512,8 @@ const onCancelSms = () => {
} }
.divider { .divider {
height: 1rpx; height: 2rpx;
background-color: #f0f0f0; background-color: #bab7b7;
margin: 0; margin: 0;
} }
@ -467,17 +526,29 @@ const onCancelSms = () => {
.bank-logo { .bank-logo {
width: 60rpx; width: 60rpx;
height: 60rpx; height: 60rpx;
background-color: #8B2316;
border-radius: 8rpx;
display: flex;
align-items: center;
justify-content: center;
margin-right: 24rpx; margin-right: 24rpx;
.bank-icon { .bank-logo-img {
font-size: 32rpx; width: 60rpx;
color: #ffffff; height: 60rpx;
font-weight: bold; border-radius: 50%;
}
.logo-bg {
width: 60rpx;
height: 60rpx;
background: #E60012;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
border: 2rpx solid #E60012;
.bank-icon {
font-size: 28rpx;
color: #ffffff;
font-weight: bold;
}
} }
} }
@ -499,7 +570,7 @@ const onCancelSms = () => {
} }
.arrow-icon { .arrow-icon {
font-size: 32rpx; font-size: 62rpx;
color: #cccccc; color: #cccccc;
font-weight: bold; font-weight: bold;
} }
@ -674,6 +745,10 @@ const onCancelSms = () => {
color: #8B2316; color: #8B2316;
font-size: 26rpx; font-size: 26rpx;
border: none; border: none;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
&:disabled { &:disabled {
background: #f5f5f5; background: #f5f5f5;

BIN
static/account_icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
static/withdrawals.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB