Commit e355679b authored by zhangsan's avatar zhangsan

1

parent c97a5018
......@@ -19,7 +19,10 @@ html {
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: transparent;
}
*{
margin: 0;
padding: 0;
}
body {
margin: 0;
padding: 0;
......
......@@ -19,8 +19,6 @@ declare module 'vue' {
VanButton: typeof import('vant/es')['Button']
VanCell: typeof import('vant/es')['Cell']
VanCellGroup: typeof import('vant/es')['CellGroup']
VanCollapse: typeof import('vant/es')['Collapse']
VanCollapseItem: typeof import('vant/es')['CollapseItem']
VanEmpty: typeof import('vant/es')['Empty']
VanField: typeof import('vant/es')['Field']
VanIcon: typeof import('vant/es')['Icon']
......@@ -30,24 +28,18 @@ declare module 'vue' {
VanPopup: typeof import('vant/es')['Popup']
VanRadio: typeof import('vant/es')['Radio']
VanRadioGroup: typeof import('vant/es')['RadioGroup']
VanStep: typeof import('vant/es')['Step']
VanSteps: typeof import('vant/es')['Steps']
VanSwipe: typeof import('vant/es')['Swipe']
VanSwipeItem: typeof import('vant/es')['SwipeItem']
VanTab: typeof import('vant/es')['Tab']
VanTabbar: typeof import('vant/es')['Tabbar']
VanTabbarItem: typeof import('vant/es')['TabbarItem']
VanTabs: typeof import('vant/es')['Tabs']
VanTreeSelect: typeof import('vant/es')['TreeSelect']
VarButton: typeof import('@varlet/ui')['Button']
VarCard: typeof import('@varlet/ui')['Card']
VarCell: typeof import('@varlet/ui')['Cell']
VarCellGroup: typeof import('@varlet/ui')['CellGroup']
VarCollapse: typeof import('@varlet/ui')['Collapse']
VarCollapseItem: typeof import('@varlet/ui')['CollapseItem']
VarForm: typeof import('@varlet/ui')['Form']
VarIcon: typeof import('@varlet/ui')['Icon']
VarInput: typeof import('@varlet/ui')['Input']
VarPaper: typeof import('@varlet/ui')['Paper']
VarPopup: typeof import('@varlet/ui')['Popup']
VarRadio: typeof import('@varlet/ui')['Radio']
VarRadioGroup: typeof import('@varlet/ui')['RadioGroup']
......
......@@ -171,8 +171,8 @@ onMounted(() => {
<!-- 头部信息 -->
<div class="header">
<div class="checkin-info">
<h4>已连续签到 <span>{{ checkinDays }}</span></h4>
<p v-if="isIntegral">今日获得+{{ integral }}积分</p>
<h4>累计签到 <span>{{ checkinDays }}</span></h4>
<p>每日签到奖励10000元</p>
</div>
<!-- <div class="actions">
<span v-if="supplementary" class="makeup-btn" @click="$emit('shift')">
......
......@@ -39,6 +39,7 @@ const titleMap: Record<string, string> = {
tixian: "提现",
group: "官方群聊",
signIn: "每日签到",
txjd: "邀请奖励提现进度",
};
......
......@@ -43,15 +43,55 @@ interface IDCardValidationResult {
}
/**
* 验证银行卡号
* @param cardNumber 银行卡号
* 验证银行名称是否合法
* @param bankName 银行名称
* @returns boolean
*/
export const isValidBankCard = (cardNumber: string): boolean => {
// 银行卡号只检查长度和是否为数字
return /^\d{16,19}$/.test(cardNumber)
export const isValidBankName = (bankName: string): boolean => {
if (!bankName) return false;
return bankName.includes('银行');
}
/**
* 银行卡号验证(Luhn 算法)
* @param cardNo 银行卡号
* @returns boolean
*/
export const isValidBankCard = (cardNo: string): boolean => {
// 1. 基本格式检查
if (!cardNo || !/^\d{16,19}$/.test(cardNo)) {
return false;
}
// 2. 银行卡号长度验证(一般为16-19位)
const len = cardNo.length;
if (len < 16 || len > 19) {
return false;
}
// 3. Luhn 算法验证
let sum = 0;
let isEven = false;
// 从右向左遍历
for (let i = len - 1; i >= 0; i--) {
let digit = parseInt(cardNo.charAt(i));
if (isEven) {
digit *= 2;
if (digit > 9) {
digit -= 9;
}
}
sum += digit;
isEven = !isEven;
}
return (sum % 10) === 0;
}
/**
* 验证15位身份证号码
* @param id 15位身份证号码
......
......@@ -5,7 +5,7 @@
<img src="@/static/home/2.png" alt="logo" class="all-img" />
<van-swipe class="banner" :autoplay="3000" indicator-color="white">
<van-swipe-item v-for="item in banner" :key="item.id">
<img :src="`http://118.107.9.143:8080/jeecg-boot/${item.photo}`" />
<img :src="`${appUpUrl}${item.photo}`" />
</van-swipe-item>
</van-swipe>
......@@ -13,9 +13,10 @@
<div class="video-section">
<div class="section-title">储蓄报道</div>
<div class="video-placeholder">
<div class="play-button">
<video src="@/static/video.mp4" controls></video>
<!-- <div class="play-button">
<van-icon name="play-circle-o" size="48" color="#999" />
</div>
</div> -->
</div>
</div>
......@@ -45,7 +46,7 @@ import { useRouter } from 'vue-router'
import { onPageShow, onPageHide } from '@/composables'
import request from '@/utils/request'
import GuideModal from '@/components/GuideModal.vue'
import { showToast } from 'vant'
const appUpUrl = ref(sessionStorage.getItem('appUpUrl'))
const router = useRouter()
const showGuide = ref(false)
......@@ -55,13 +56,14 @@ const newList = ref([])
const fetchData = async () => {
try {
// 并发请求,loading 会显示请求数量
request.get('/business/businessMobileNotice/list').then(res => {
request.get('/business/businessMobileNotice/list?type=2').then(res => {
if (res.code === 200) {
content.value = res.result.records?.filter((item: any) => item.type == 1)
// newList.value = res.result.records?.filter((item: any) => item.type == 2)
newList.value = res.result.records
console.log(newList.value)
if (content.value.length > 0) {
// showGuide.value = true
showGuide.value = true
}
}
})
......@@ -107,7 +109,7 @@ onPageShow(async () => {
height: calc(100vh - 50px);
overflow-y: auto;
box-sizing: border-box;
background: url('@/static/kpsl/5.png') no-repeat center center;
background: url('@/static/cbg1.png') no-repeat center center;
background-size: 100% 100%;
}
......@@ -141,6 +143,11 @@ onPageShow(async () => {
justify-content: center;
position: relative;
video {
width: 100%;
height: 100%;
}
.play-button {
display: flex;
align-items: center;
......@@ -178,6 +185,7 @@ onPageShow(async () => {
background: #fff;
border-radius: 6px;
padding: 10px;
.news-item {
display: flex;
align-items: center;
......
This diff is collapsed.
......@@ -7,20 +7,15 @@
</div>
<div class="title">卡片申领</div>
</div>
<!-- 卡片展示区域 -->
<div class="card-preview">
<div class="card-title">经济发展专</div>
<div class="card-title">经济发展专</div>
<div class="card-image">
<img src="@/static/kpsl/2.png" alt="经济发展专卡">
<img src="@/static/kpsl/2.png" alt="经济发展专卡">
</div>
<!-- 自定义表单 -->
<div class="form-wrapper">
<div class="form-item">
<div class="label">申领模版</div>
<input type="text" value="" readonly class="input" />
</div>
<div class="form-item">
<div class="label">姓名</div>
<input type="text" v-model="formData.a2" placeholder="请输入您的姓名" class="input" />
......@@ -65,7 +60,7 @@ const formData = reactive({
a1: '', // 默认自己申请
a2: '', // 姓名
a3: '', // 年龄
a4: '630万人', // 卡内财产
a4: '630万人', // 卡内财产
a5: '', // 审核状态默认1
})
......@@ -115,11 +110,12 @@ const handleCheckProgress = () => {
</script>
<style lang="scss" scoped>
.card-apply {
height: 100%;
background: #f5f5f5;
padding-bottom: 20px;
background: url('@/static/kpsl/5.png') no-repeat center center;
background: url('@/static/cbg1.png') no-repeat center center;
background-size: 100% 100%;
}
......
......@@ -78,15 +78,13 @@ const onLoginSubmit = async () => {
}
}
}
request.get('/business/businessConfig/queryConfigByCode', {
params: {
code: 'kfurl,appdownload,appVersion'
}
}).then(res => {
request.get('/business/businessConfig/queryConfigByCode?code=kfurl,appdownload,appVersion,appUpUrl').then(res => {
console.log(res)
if (res.code == 200) {
sessionStorage.setItem('kfurl', res.result.kfurl)
sessionStorage.setItem('appdownload', res.result.appdownload)
sessionStorage.setItem('appVersion', res.result.appVersion)
sessionStorage.setItem('appUpUrl', res.result.appUpUrl)
}
})
const downloadApp = () => {
......
......@@ -13,18 +13,15 @@
<div class="warpinfo">
<div class="benefits">
<div class="benefit-item">
1、成为荣誉董事即可享受企业的荣誉称号和相关的宣传报道!
<div class="sub-text">—好的客户人员的服务标准!参与国家项目决策与战略制定促进项目创新和发展!</div>
1、成为荣誉董事即可享受企业的荣誉称号和相关的宣传报道!—好的客户人员的服务标准!参与国家项目决策与战略制定促进项目创新和发展!
</div>
<div class="benefit-item">
2、作为荣誉董事即可享受国家扶持项目的股息分红和股价增值
<div class="sub-text">带来的巨额收益!享受一切业务问题的加急办理!</div>
2、作为荣誉董事即可享受国家扶持项目的股息分红和股价增值带来的巨额收益!享受一切业务问题的加急办理!
</div>
<div class="benefit-item">
3、按照国家项目规定成为荣誉董事!退休之后即可享受社会保
<div class="sub-text">障及公积金福利!另外还配套100平米面积的精装小区高品质一栋国产红旗汽车!</div>
3、按照国家项目规定成为荣誉董事!退休之后即可享受社会保障及公积金福利!另外还配套100平米面积的精装小区高品质一栋国产红旗汽车!
</div>
</div>
<div class="apply-form">
......@@ -34,7 +31,7 @@
</div>
<div class="submit-btn">
<van-button type="primary" block :loading="loading" @click="handleSubmit">
{{ isSubmit ? '前往查看进度' : '成为荣誉董事' }}
{{ isSubmit ? '已成为荣誉董事' : '成为荣誉董事' }}
</van-button>
</div>
</div>
......@@ -44,31 +41,31 @@
<div class="invite-list">
<div class="invite-item">
<span class="invite-count">邀请<span class="invite-count-num">10名</span>好友</span>
<span class="invite-reward">即可获得<span class="invite-reward-num">10万元</span>经济发展专项卡额度</span>
<span class="invite-reward">即可获得邀请奖励<span class="invite-reward-num">10万元</span></span>
<span class="invite-btn1" @click="handleInvite(1)">{{ !userInfo.sysUser.a1 ? '领取' : '已领取' }}</span>
</div>
<div class="invite-item">
<span class="invite-count">邀请<span class="invite-count-num">30名</span>好友</span>
<span class="invite-reward">即可获得<span class="invite-reward-num">38万元</span>经济发展专项卡额度</span>
<span class="invite-reward">即可获得邀请奖励<span class="invite-reward-num">38万元</span></span>
<span class="invite-btn1" @click="handleInvite(2)">{{ !userInfo.sysUser.a2 ? '领取' : '已领取' }}</span>
</div>
<div class="invite-item">
<span class="invite-count">邀请<span class="invite-count-num">80名</span>好友</span>
<span class="invite-reward">即可获得<span class="invite-reward-num">108万元</span>经济发展专项卡额度</span>
<span class="invite-reward">即可获得邀请奖励<span class="invite-reward-num">108万元</span></span>
<span class="invite-btn1" @click="handleInvite(3)">{{ !userInfo.sysUser.a3 ? '领取' : '已领取' }}</span>
</div>
<div class="invite-item">
<span class="invite-count">邀请<span class="invite-count-num">100名</span>好友</span>
<span class="invite-reward">即可获得<span class="invite-reward-num">328万元</span>经济发展专项卡额度</span>
<span class="invite-reward">即可获得邀请奖励<span class="invite-reward-num">328万元</span></span>
<span class="invite-btn1" @click="handleInvite(4)">{{ !userInfo.sysUser.a4 ? '领取' : '已领取' }}</span>
</div>
<div class="invite-item">
<span class="invite-count">邀请<span class="invite-count-num">500名</span>好友</span>
<span class="invite-reward">即可获得<span class="invite-reward-num">1088万元</span> 经济发展专项卡额度</span>
<span class="invite-reward">即可获得邀请奖励<span class="invite-reward-num">1088万元</span> </span>
<span class="invite-btn1" @click="handleInvite(5)">{{ !userInfo.sysUser.a5 ? '领取' : '已领取' }}</span>
</div>
</div>
</div>
<div class="invite-btn">
<van-button type="primary" block @click="handleInvite">
立即邀请
</van-button>
</div>
</div>
</template>
......@@ -85,6 +82,10 @@ const formData = reactive({
const isSubmit = ref(false)
const userInfo = ref(JSON.parse(sessionStorage.getItem('userInfo') || '{}'))
const handleSubmit = async () => {
if (isSubmit.value) {
showToast('您已成为荣誉董事')
return
}
if (!formData.name) {
showToast('请输入姓名')
return
......@@ -126,8 +127,19 @@ const getDs = async () => {
}
}
getDs()
const handleInvite = () => {
router.push('/user/invite')
const getUserInfo = async () => {
const res = await request.get('/business/businessWallet/getInfo')
if (res.code == 200) {
userInfo.value = res.result
}
}
const handleInvite = async () => {
const res = await request.post('/business/businessWallet/lqLjsm?type=uudi')
if (res.code == 200) {
console.log(res)
showToast("领取成功")
getUserInfo()
}
}
</script>
......@@ -136,7 +148,7 @@ const handleInvite = () => {
min-height: 100vh;
background: #f5f5f5;
padding-bottom: 20px;
background: url('@/static/kpsl/5.png') no-repeat center center;
background: url('@/static/cbg1.png') no-repeat center center;
background-size: 100% 100%;
}
......@@ -190,10 +202,9 @@ const handleInvite = () => {
.benefit-item {
margin-bottom: 5px;
font-size: 10px;
font-family: '微软雅黑';
font-size: 12px;
line-height: 1.5;
font-weight: 700;
font-weight: 500;
color: #333;
.sub-text {
......@@ -266,10 +277,19 @@ const handleInvite = () => {
}
.invite-reward {
flex: 1;
color: #333;
}
.invite-btn1 {
width: 40px;
height: 40px;
background: #3b9257;
border-radius: 50%;
color: #fff;
text-align: center;
line-height: 40px;
}
.invite-reward-num {
color: #ff6d0d;
}
......
......@@ -95,7 +95,7 @@ onMounted(() => {
.ryds-page {
height: inherit;
box-sizing: border-box;
background: url('@/static/kpsl/5.png') no-repeat center center;
background: url('@/static/cbg1.png') no-repeat center center;
background-size: 100% 100%;
padding: 20px;
}
......
......@@ -93,7 +93,7 @@
.ryds-page {
height: inherit;
box-sizing: border-box;
background: url('@/static/kpsl/5.png') no-repeat center center;
background: url('@/static/cbg1.png') no-repeat center center;
background-size: 100% 100%;
padding-top: 10px;
box-sizing: border-box;
......
......@@ -167,7 +167,7 @@ getCardList()
.page-container {
padding: 20px;
height: inherit;
background: url('@/static/kpsl/5.png') no-repeat center center;
background: url('@/static/cbg1.png') no-repeat center center;
background-size: 100% 100%;
box-sizing: border-box;
......
......@@ -43,7 +43,7 @@ onMounted(async () => {
width: 100%;
box-sizing: border-box;
padding-top: 5vh;
background: url('@/static/kpsl/5.png') no-repeat center center;
background: url('@/static/cbg1.png') no-repeat center center;
background-size: 100% 100%;
background-position: center;
background-repeat: no-repeat;
......
......@@ -15,13 +15,12 @@ import handleCopy from "@/utils/handleCopy";
const kfurl = sessionStorage.getItem("kfurl" || "https://www.baidu.com");
const router = useRouter();
// 导入图片
const MENU_ITEMS = [
{ name: "实名认证", icon: pnga6, path: "/user/shiming" },
{ name: "银行卡绑定", icon: pnga8, path: "/user/mybankCard" },
{ name: "收货地址", icon: pnga7, path: "/user/address" },
{ name: "专项", icon: pnga9, path: "/kpsl/cardsl", tips: '提现进度' },
{ name: "邀请奖励", icon: pnga10, path: "/user/withdraw?tab=q2", tips: '提现进度' },
{ name: "专项卡进度", icon: pnga9, path: "/kpsl/cardsl" },
{ name: "邀请奖励", icon: pnga10, path: "/yqjl/txjd", tips: '提现进度' },
{ name: "其他资金", icon: pnga11, path: "/user/withdraw?tab=q3", tips: '提现进度' },
{ name: "官方群聊", icon: pnga12, path: "/user/group" },
{ name: "在线客服", icon: pnga13, path: kfurl },
......@@ -120,8 +119,8 @@ onMounted(fetchData);
<div class="amount-box">
<div class="amount">¥{{ userData?.q1 || '0.00' }}</div>
<div class="actions">
<div class="btn" @click="gotx(userData?.q1, 'q1', '提现')">提现</div>
<div class="btn btn1" @click="gomx('q1')">进度</div>
<!-- <div class="btn" @click="gotx(userData?.q1, 'q1', '提现')">提现</div> -->
<div class="btn btn1" @click="router.push('/kpsl/cardsl')">进度</div>
</div>
</div>
</div>
......@@ -132,8 +131,8 @@ onMounted(fetchData);
<div class="label">邀请奖励</div>
<div class="amount">¥{{ userData?.q2|| '0.00' }}</div>
<div class="actions">
<div class="btn" @click="gotx(userData?.q2, 'q2', '提现')">提现</div>
<div class="btn btn1" @click="gomx('q2')">进度</div>
<div class="btn" @click="router.push('/yqjl/txjd')">提现</div>
<!-- <div class="btn btn1" @click="gomx('q2')">进度</div> -->
</div>
</div>
<div class="sub-card">
......@@ -311,8 +310,9 @@ onMounted(fetchData);
.btn1 {
margin-left: 10px;
background: #e5f8dc;
color: #56a06f;
background: #3a9256;
color: #fff;
font-size: 14px;
}
}
}
......@@ -329,8 +329,9 @@ onMounted(fetchData);
border-radius: 8px;
.label {
font-size: 12px;
font-size: 16px;
color: #666;
font-weight: 600;
}
.amount {
......
......@@ -13,7 +13,8 @@
<div class="content">
<div class="qr-section">
<img :src="QRImgUrl" alt="QR Code" />
<span>图片分享给好友一起赚钱</span>
<span>分享二维码</span>
<span>邀请好友一同参与国家政策</span>
</div>
<div class="action-section">
......@@ -27,34 +28,32 @@
</div>
</div>
</div>
<div v-for="item in rewardList" :key="item.index" class="reward-card">
<div class="reward-content">
<div class="info">
<h3>每邀请{{ item.index }}位好友实名注册</h3>
<p>赠送{{ item.number }}</p>
<div class="invite-section">
<div class="invite-list">
<div class="invite-item">
<span class="invite-count">邀请<span class="invite-count-num">10名</span>好友</span>
<span class="invite-reward">即可获得<span class="invite-reward-num">10万元</span>经济发展专项卡额度</span>
</div>
<div :class="['status', { completed: item.index <= smCount }]">
{{ item.index <= smCount ? "已完成" : "未完成" }} </div>
<div class="invite-item">
<span class="invite-count">邀请<span class="invite-count-num">30名</span>好友</span>
<span class="invite-reward">即可获得<span class="invite-reward-num">38万元</span>经济发展专项卡额度</span>
</div>
</div>
<div class="reward-card">
<div class="reward-content">
<div class="info">
<h3>邀请满10以上的</h3>
<p>额外赠送500克金条</p>
</div>
<div class="invite-item">
<span class="invite-count">邀请<span class="invite-count-num">80名</span>好友</span>
<span class="invite-reward">即可获得<span class="invite-reward-num">108万元</span>经济发展专项卡额度</span>
</div>
</div>
<div class="reward-card">
<div class="reward-content">
<div class="info">
<h3>邀请满20以上的</h3>
<p>赠送红旗轿车一台</p>
</div>
<div class="invite-item">
<span class="invite-count">邀请<span class="invite-count-num">100名</span>好友</span>
<span class="invite-reward">即可获得<span class="invite-reward-num">328万元</span>经济发展专项卡额度</span>
</div>
<div class="invite-item">
<span class="invite-count">邀请<span class="invite-count-num">500名</span>好友</span>
<span class="invite-reward">即可获得<span class="invite-reward-num">1088万元</span> 经济发展专项卡额度</span>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
......@@ -76,12 +75,7 @@ userInfo.value = user?.sysUser
const smCount = ref(user?.smCount || 0)
linkstr.value = `https://${location.host}/register?yqm=${userInfo?.value?.yqm}`
// 奖励配置
const rewardList: RewardItem[] = [
{ index: 1, number: 50000, jifen: 5 },
{ index: 5, number: 100000, jifen: 11 },
{ index: 10, number: 200000, jifen: 17 },
{ index: 50, number: 300000, jifen: 24 },
]
// 生成二维码
const generateQRCode = async () => {
......@@ -115,7 +109,7 @@ generateQRCode()
box-sizing: border-box;
height: inherit;
font-size: 12px;
background: url('@/static/kpsl/5.png') no-repeat center center;
background: url('@/static/cbg1.png') no-repeat center center;
background-size: 100% 100%;
.advertise {
......@@ -141,7 +135,7 @@ generateQRCode()
position: relative;
display: flex;
justify-content: space-between;
padding: 40px 0 0; // 80rpx 40rpx 0 / 2
padding: 24px 0 0; // 80rpx 40rpx 0 / 2
width: 100%;
.title {
......@@ -149,7 +143,7 @@ generateQRCode()
font-size: 18px; // 36rpx / 2
font-weight: 700;
color: #fdfdfd;
top: 2px; // 4rpx / 2
top: -14px; // 4rpx / 2
left: 50%;
transform: translateX(-50%);
}
......@@ -167,7 +161,7 @@ generateQRCode()
color: #fff;
padding-top: 10px; // 20rpx / 2
margin-left: 10px; // 20rpx / 2
font-size: 12px;
img {
width: 110px; // 200rpx / 2
height: 110px; // 200rpx / 2
......@@ -182,19 +176,20 @@ generateQRCode()
display: flex;
flex-direction: column;
align-items: center;
padding-top: 40px;
.invite-code {
font-size: 16px;
font-size: 14px;
}
.btn {
width: 120px; // 240rpx / 2
line-height: 40px; // 80rpx / 2
width: 100px; // 240rpx / 2
line-height: 30px; // 80rpx / 2
background: #ff6600;
text-align: center;
border-radius: 5px; // 10rpx / 2
margin-bottom: 6px; // 12rpx / 2
cursor: pointer;
border: none;
&.primary {
margin-top: 5px; // 30rpx / 2
......@@ -241,5 +236,48 @@ generateQRCode()
}
}
}
.invite-section {
margin: 10px 0;
padding: 10px 10px;
background: #fff;
border-radius: 6px;
.invite-list {
font-size: 12px;
font-weight: 700;
.invite-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 6px 0;
&:last-child {
border-bottom: none;
}
.invite-count {
width: 96px;
color: #333;
}
.invite-count-num {
color: #ff6d0d;
}
.invite-reward {
flex: 1;
color: #333;
}
.invite-reward-num {
color: #ff6d0d;
}
}
}
}
}
</style>
\ No newline at end of file
<script setup>
import request from "@/utils/request";
import { isValidBankCard } from '@/utils/userInfoCheck'
import { isValidBankCard, isValidBankName } from '@/utils/userInfoCheck'
const flag = ref(false)
const formData = reactive({
bankName: '',
......@@ -164,10 +164,16 @@ const editCard = (item) => {
bankId.value = item.id
}
function addCard() {
let reg2 = isValidBankCard(formData.bankNum);
if (!reg2) {
showFailToast('请输入正确的银行卡号')
if (!isValidBankCard(formData.bankNum)) {
showFailToast('请输入正确的银行卡号')
return
}
if (!isValidBankName(formData.bankName)) {
showFailToast('请输入完整的开户行名称')
return
}
let url = flag.value == true ? "/business/businessBankCard/edit" : "/business/businessBankCard/add"
let form = {
bankName: formData.bankName,
......@@ -238,10 +244,27 @@ getBankList();
</div>
<var-form ref="form" scroll-to-error="start">
<var-space direction="column" :size="[14, 0]">
<var-input placeholder="持卡人:" :rules="[v => (!!v || '持卡人不能为空')]" v-model="formData.cardUserName" />
<var-input placeholder="银行卡号:" :rules="[v => ((!!v || '银行卡号不能为空') && (isValidBankCard(v) ? true : '请输入正确的银行卡号'))]"
v-model="formData.bankNum" />
<var-input placeholder="发卡银行:" :rules="[v => (!!v || '发卡银行不能为空')]" v-model="formData.bankName" />
<var-input
placeholder="持卡人:"
:rules="[v => (!!v || '持卡人不能为空')]"
v-model="formData.cardUserName"
/>
<var-input
placeholder="银行卡号:"
:rules="[
v => !!v || '银行卡号不能为空',
v => isValidBankCard(v) || '请输入正确的银行卡号'
]"
v-model="formData.bankNum"
/>
<var-input
placeholder="发卡银行:"
:rules="[
v => !!v || '发卡银行不能为空',
v => isValidBankName(v) || '请输入完整的开户行名称'
]"
v-model="formData.bankName"
/>
</var-space>
</var-form>
<var-button style="margin: 20px 0 40px 0;" size="large" block type="primary" @click="addCard">
......@@ -257,7 +280,7 @@ getBankList();
padding: 10px;
box-sizing: border-box;
height: inherit;
background:url('@/static/kpsl/5.png') no-repeat center center;
background:url('@/static/cbg1.png') no-repeat center center;
background-size: 100% 100%;
}
......
......@@ -187,7 +187,7 @@ getTeamInfo()
<style lang="scss" scoped>
.page-container {
height: inherit;
background: url('@/static/kpsl/5.png') no-repeat center center;
background: url('@/static/cbg1.png') no-repeat center center;
background-size: 100% 100%;
box-sizing: border-box;
display: flex;
......@@ -202,13 +202,12 @@ getTeamInfo()
}
.overview-card {
background: linear-gradient(135deg, #4a90e2, #357abd);
border-radius: 16px;
padding: 24px;
display: flex;
align-items: center;
justify-content: space-between;
color: white;
color: #000;
margin-bottom: 20px;
box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
......@@ -278,7 +277,7 @@ getTeamInfo()
.stat-box {
flex: 1;
background: #f8fafc;
background: #dbf5ce;
border-radius: 12px;
padding: 16px;
display: flex;
......
......@@ -13,11 +13,10 @@
<var-icon name="account-circle" />
</template>
</var-input>
<var-input v-model="identityId" placeholder="请输入身份证号" :rules="[
(value) => {
(value: string) => {
if (!value) return '请输入身份证号';
if (!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(value)) return '请输入正确的身份证号';
if (!validateIdCard(value)) return '请输入正确的身份证号';
return true;
}
]">
......@@ -60,6 +59,7 @@ const userInfo = ref(JSON.parse(sessionStorage.getItem('userInfo') || '{}'))
const initFormData = () => {
if (userInfo.value?.sysUser) {
const { realname: name, identityId: id } = userInfo.value.sysUser
console.log(userInfo.value.sysUser)
realname.value = name
identityId.value = id
}
......@@ -67,7 +67,6 @@ const initFormData = () => {
onMounted(() => {
if (checkAuthStatus()) return
console.log()
initFormData()
})
......@@ -105,12 +104,65 @@ const onSubmit = async () => {
}
}
}
const validateIdCard = (idCard: string): boolean => {
// 基本格式校验
const reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
if (!reg.test(idCard)) {
return false;
}
// 15位身份证转18位
if (idCard.length === 15) {
idCard = idCard.slice(0, 6) + '19' + idCard.slice(6);
// 补充校验位
const codes = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'];
const factors = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
let sum = 0;
for (let i = 0; i < 17; i++) {
sum += parseInt(idCard[i]) * factors[i];
}
idCard += codes[sum % 11];
}
// 18位身份证校验
// 提取生日部分
const year = parseInt(idCard.substr(6, 4));
const month = parseInt(idCard.substr(10, 2));
const day = parseInt(idCard.substr(12, 2));
const date = new Date(year, month - 1, day);
// 检查日期是否有效
if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
return false;
}
// 检查年份范围
const currentYear = new Date().getFullYear();
if (year < 1900 || year > currentYear) {
return false;
}
// 校验位验证
if (idCard.length === 18) {
const codes = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'];
const factors = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
let sum = 0;
for (let i = 0; i < 17; i++) {
sum += parseInt(idCard[i]) * factors[i];
}
const checkCode = codes[sum % 11];
return checkCode === idCard[17].toUpperCase();
}
return true;
}
</script>
<style lang="scss" scoped>
.shiming-container {
height: calc(100vh - 50px);
background: url('@/static/kpsl/5.png') no-repeat center center;
background: url('@/static/cbg1.png') no-repeat center center;
background-size: 100% 100%;
box-sizing: border-box;
padding-top: 20px;
......
......@@ -52,7 +52,7 @@ getSignInInfo()
.sign-in-container {
padding: 20px;
height: inherit;
background: url('@/static/kpsl/5.png') no-repeat center center;
background: url('@/static/cbg1.png') no-repeat center center;
background-size: 100% 100%;
box-sizing: border-box;
}
......
......@@ -12,8 +12,8 @@ const loading = ref(false)
const userInfo = ref(JSON.parse(sessionStorage.getItem('userInfo')))
// 钱包类型选项
const walletOptions = ref([
{ text: "专项款", value: 'q1' },
{ text: "邀请奖励", value: 'q2' },
// { text: "专项款", value: 'q1' },
// { text: "邀请奖励", value: 'q2' },
{ text: "可提现佣金/奖励", value: 'q3' },
])
......@@ -25,7 +25,7 @@ const statusMap = {
}
// 获取路由参数中的tab
const active = ref(route.query.tab || 'q1')
const active = ref(route.query.tab || 'q2')
// 重置列表状态
const resetList = () => {
......@@ -84,11 +84,11 @@ const handleClick = (item) => {
<template>
<div class="withdraw-record">
<!-- Tabs -->
<var-tabs v-model:active="active" class="fixed-tabs">
<!-- <var-tabs v-model:active="active" class="fixed-tabs">
<var-tab v-for="item in walletOptions" :key="item.value" :name="item.value" @click="handleClick(item)">
{{ item.text }}
</var-tab>
</var-tabs>
</var-tabs> -->
<!-- List -->
<van-list class="list-container" v-model:loading="loading" :finished="finished" finished-text="没有更多了"
......
<template>
<div class="cards-page">
<div class="card-wrapper">
<div class="card-main">
<!-- 卡片头部 -->
<div class="card-header">
<div class="card-amount">
<span class="amount-label">邀请奖励:</span>
<span class="amount-value">¥{{ userInfo?.q2 || 0 }}</span>
元人民币
</div>
<template v-if="bankCard.length > 0">
<div class="card-amount">
<span class="amount-label">持卡人:</span>
<span class="amount-value1">{{ bankCard[0].cardUserName || '未绑定' }}</span>
</div>
<div class="card-amount">
<span class="amount-label">发卡银行:</span>
<span class="amount-value1">{{ bankCard[0].bankName || '未绑定' }}</span>
</div>
<div class="card-amount">
<span class="amount-label">银行卡号:</span>
<span class="amount-value1">{{ bankCard[0].bankNum || '未绑定' }}</span>
</div>
</template>
<div class="card-amount" style="margin-top: 10px;" v-else>
<var-button size="small" type="primary" @click="router.push('/user/mybankCard')">前往添加银行卡</var-button>
</div>
</div>
<!-- 进度步骤 -->
<div class="progress-section">
<div class="progress-title">
<var-icon name="chart-timeline" color="#333" />
<span>邀请提现进度</span>
</div>
<var-steps direction="vertical" :active="a6">
<var-step v-for="(step, stepIndex) in getSteps()" :key="stepIndex">
<div class="step-content">
<div class="step-main">
<div class="step-text">{{ step.text }}</div>
</div>
<div class="step-action" v-if="step.amount">
<var-button v-if="stepIndex >= a7" size="small" class="pay-btn" @click="handlePay(step)">
立即缴纳
</var-button>
<span v-else class="status-completed">已完成</span>
</div>
</div>
</var-step>
</var-steps>
</div>
</div>
</div>
<pay-up ref="payUpRef" />
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import request from '@/utils/request'
import payUp from '@/components/payUp.vue'
import { useRouter } from 'vue-router'
const router = useRouter()
interface CardStep {
text: string
amount?: number,
tips?: string
}
const userInfo = ref({})
const a6 = ref(0)
const a7 = ref(0)
request.get('/business/businessWallet/getInfo').then(res => {
userInfo.value = res.result
a6.value = userInfo.value.sysUser.a6 || 1
a7.value = userInfo.value.sysUser.a7 || 0
getbankCard()
})
const getSteps = () => {
let steps = stepsBase.filter((_, index) => index <= a6.value)
steps.push({ text: '入款中' })
return steps
}
const payUpRef = ref<any>(null)
// 步骤配置
const stepsBase: CardStep[] = [
{ text: '邀请好友' },
{ text: '正在审核' },
{ text: '审核通过' },
{ text: '个人所得税', amount: 600, tips: '个人所得税' },
{ text: '缴纳成功' },
{ text: '等待到帐' },
{ text: '立即到帐', amount: 300, tips: '立即到帐' },
{ text: '入款中' }
]
const handlePay = (step: Number) => {
if (!payUpRef.value) return
payUpRef.value.open({
amount: step.amount,
payTitle: step.tips,
payType: 1,
productId: '',
needPassword: false
})
}
const bankCard = ref([])
const getbankCard = async () => {
const res = await request.get(`/business/businessBankCard/list?cardType=1&userId=${userInfo.value.sysUser.id}`)
if (res?.result) {
bankCard.value = res.result.records
}
}
</script>
<style scoped lang="scss">
.cards-page {
height: inherit;
overflow: auto;
background: url('@/static/cbg1.png') no-repeat center center;
background-size: 100% 100%;
}
.card-wrapper {
margin: 10px;
max-width: 800px;
}
::v-deep .var-step__vertical-content {
flex: 1;
}
.card-main {
background: white;
border-radius: 12px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
overflow: hidden;
border: 1px solid rgba(0, 0, 0, 0.05);
// 三种卡片主题
.pay-btn {
background: #689f38;
}
}
.card-header {
padding: 20px 20px 10px;
color: #333;
.card-title {
display: flex;
align-items: center;
gap: 8px;
font-size: 18px;
font-weight: 600;
margin-bottom: 12px;
}
.card-amount {
.amount-label {
font-size: 14px;
opacity: 0.7;
margin-right: 8px;
}
.amount-value {
font-size: 24px;
font-weight: 600;
color: red;
}
}
}
.card-info {
padding: 16px 20px;
background: rgba(219, 246, 204, 0.1);
.info-item {
display: flex;
margin-bottom: 8px;
&:last-child {
margin-bottom: 0;
}
.label {
color: #666;
font-size: 14px;
}
.value {
color: red;
font-weight: 500;
}
}
}
.progress-section {
padding: 0 20px 20px;
.progress-title {
display: flex;
align-items: center;
gap: 8px;
font-size: 16px;
font-weight: 600;
color: #333;
margin-bottom: 20px;
}
}
.steps-wrapper {
position: relative;
padding-left: 16px;
&::before {
content: '';
position: absolute;
left: 8px;
top: 0;
bottom: 0;
width: 1px;
background: #e4e7ed;
}
}
.step-item {
position: relative;
padding-bottom: 24px;
&:last-child {
padding-bottom: 0;
}
.step-marker {
position: absolute;
left: -12px;
width: 8px;
height: 8px;
border-radius: 50%;
background: #e4e7ed;
border: 2px solid #fff;
z-index: 1;
}
&.completed {
.step-marker {
background: #8bc34a;
}
}
&.current {
.step-marker {
background: #dbf6cc;
width: 12px;
height: 12px;
left: -14px;
border: 2px solid #8bc34a;
}
}
}
.step-content {
margin-left: 16px;
display: flex;
justify-content: space-between;
align-items: flex-start;
padding: 4px 0;
}
.step-main {
flex: 1;
padding-right: 16px;
.step-text {
font-size: 14px;
color: #333;
margin-bottom: 4px;
line-height: 1.4;
}
.step-fee {
font-size: 13px;
color: #666;
.fee-amount {
color: #8bc34a;
font-weight: 500;
}
}
}
.step-action {
.pay-btn {
border: none;
padding: 6px 16px;
border-radius: 16px;
font-size: 13px;
color: white;
}
.status-completed {
font-size: 13px;
color: #8bc34a;
padding: 6px 12px;
}
}
.empty-state {
display: flex;
justify-content: center;
align-items: center;
min-height: 60vh;
}
</style>
\ No newline at end of file
......@@ -40,12 +40,12 @@ export default defineConfig({
dts: 'src/components.d.ts',
dirs: ['src/components']
}),
vitePluginBundleObfuscator({
enable: true,
log: true,
autoExcludeNodeModules: true,
threadPool: true,
})
// vitePluginBundleObfuscator({
// enable: true,
// log: true,
// autoExcludeNodeModules: true,
// threadPool: true,
// })
],
resolve: {
alias: {
......@@ -97,6 +97,7 @@ export default defineConfig({
proxy: {
'/jeecg-boot': {
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