Commit 9ea2ac50 authored by zhangsan's avatar zhangsan

1

parent 1fe157a2
...@@ -20,7 +20,6 @@ declare module 'vue' { ...@@ -20,7 +20,6 @@ declare module 'vue' {
VanCell: typeof import('vant/es')['Cell'] VanCell: typeof import('vant/es')['Cell']
VanCellGroup: typeof import('vant/es')['CellGroup'] VanCellGroup: typeof import('vant/es')['CellGroup']
VanEmpty: typeof import('vant/es')['Empty'] VanEmpty: typeof import('vant/es')['Empty']
VanField: typeof import('vant/es')['Field']
VanIcon: typeof import('vant/es')['Icon'] VanIcon: typeof import('vant/es')['Icon']
VanList: typeof import('vant/es')['List'] VanList: typeof import('vant/es')['List']
VanLoading: typeof import('vant/es')['Loading'] VanLoading: typeof import('vant/es')['Loading']
...@@ -40,9 +39,11 @@ declare module 'vue' { ...@@ -40,9 +39,11 @@ declare module 'vue' {
VarForm: typeof import('@varlet/ui')['Form'] VarForm: typeof import('@varlet/ui')['Form']
VarIcon: typeof import('@varlet/ui')['Icon'] VarIcon: typeof import('@varlet/ui')['Icon']
VarInput: typeof import('@varlet/ui')['Input'] VarInput: typeof import('@varlet/ui')['Input']
VarOption: typeof import('@varlet/ui')['Option']
VarPopup: typeof import('@varlet/ui')['Popup'] VarPopup: typeof import('@varlet/ui')['Popup']
VarRadio: typeof import('@varlet/ui')['Radio'] VarRadio: typeof import('@varlet/ui')['Radio']
VarRadioGroup: typeof import('@varlet/ui')['RadioGroup'] VarRadioGroup: typeof import('@varlet/ui')['RadioGroup']
VarSelect: typeof import('@varlet/ui')['Select']
VarSpace: typeof import('@varlet/ui')['Space'] VarSpace: typeof import('@varlet/ui')['Space']
VarStep: typeof import('@varlet/ui')['Step'] VarStep: typeof import('@varlet/ui')['Step']
VarSteps: typeof import('@varlet/ui')['Steps'] VarSteps: typeof import('@varlet/ui')['Steps']
......
...@@ -169,22 +169,18 @@ const handleSubmit = async () => { ...@@ -169,22 +169,18 @@ const handleSubmit = async () => {
// 提交支付请求 // 提交支付请求
const submitPay = async () => { const submitPay = async () => {
showToast('暂未开启支付...')
return false
try { try {
isSubmitting.value = true isSubmitting.value = true
const payData = { const payData = {
remark: selectedMethod.value, payType: selectedMethod.value,
balance: payParams.value.amount, amount: payParams.value.amount,
type: payParams.value.payType, productCode: payParams.value.payType,
productId: payParams.value.productId
} }
const res = await request.post('/ops/daybook', payData) const res = await request.post('/business/businessPayOrder/add', payData)
if (res.code === 200) { if (res.code === 200) {
const payUrl = res.msg const payUrl = res.result
// 根据环境跳转支付链接 // 根据环境跳转支付链接
if (navigator.userAgent.includes('APP')) { if (navigator.userAgent.includes('APP')) {
window.plus?.runtime.openURL(encodeURI(payUrl)) window.plus?.runtime.openURL(encodeURI(payUrl))
......
...@@ -7,7 +7,6 @@ import { useUserInfo } from "@/composables/useUserInfo"; ...@@ -7,7 +7,6 @@ import { useUserInfo } from "@/composables/useUserInfo";
const routes = generateRoutes(); const routes = generateRoutes();
const router = createRouter({ const router = createRouter({
history: createWebHistory(), history: createWebHistory(),
routes, routes,
...@@ -29,8 +28,9 @@ router.beforeEach(async (to, from, next) => { ...@@ -29,8 +28,9 @@ router.beforeEach(async (to, from, next) => {
const storedVersion = sessionStorage.getItem("app_version"); const storedVersion = sessionStorage.getItem("app_version");
if (version !== storedVersion) { if (version !== storedVersion) {
sessionStorage.setItem("app_version", version); sessionStorage.setItem("app_version", version);
window.location.href = to.fullPath; if (to.path !== "/login") {
return; window.location.reload();
}
} }
} }
} catch (error) { } catch (error) {
...@@ -53,10 +53,10 @@ router.beforeEach(async (to, from, next) => { ...@@ -53,10 +53,10 @@ router.beforeEach(async (to, from, next) => {
} }
next(); next();
// 获取用户信息 // 获取用户信息
if (token) { if (token) {
await getUserInfo(); await getUserInfo();
} }
}); });
router.afterEach(() => { router.afterEach(() => {
...@@ -64,4 +64,3 @@ router.afterEach(() => { ...@@ -64,4 +64,3 @@ router.afterEach(() => {
}); });
export default router; export default router;
...@@ -40,6 +40,7 @@ const titleMap: Record<string, string> = { ...@@ -40,6 +40,7 @@ const titleMap: Record<string, string> = {
group: "官网群聊", group: "官网群聊",
signIn: "每日签到", signIn: "每日签到",
txjd: "邀请奖励提现进度", txjd: "邀请奖励提现进度",
yongjin: "团队佣金",
}; };
......
...@@ -69,7 +69,6 @@ import { onPageShow, onPageHide } from '@/composables' ...@@ -69,7 +69,6 @@ import { onPageShow, onPageHide } from '@/composables'
import request from '@/utils/request' import request from '@/utils/request'
import GuideModal from '@/components/GuideModal.vue' import GuideModal from '@/components/GuideModal.vue'
const appUpUrl = ref(sessionStorage.getItem('appUpUrl')) const appUpUrl = ref(sessionStorage.getItem('appUpUrl'))
console.log(appUpUrl.value)
const router = useRouter() const router = useRouter()
const showGuide = ref(false) const showGuide = ref(false)
const content = ref([]) const content = ref([])
......
<template> <template>
<div class="cards-page"> <div class="cards-page">
<van-tabs v-model:active="active" @click-tab="onClickTab">
<van-tab title="本人申请"></van-tab>
<van-tab title="替他人申请"></van-tab>
</van-tabs>
<div class="content-wrap" v-if="cardList.length"> <div class="content-wrap" v-if="cardList.length">
<var-collapse v-model="activeCard" accordion :offset="false"> <var-collapse v-model="activeCard" accordion :offset="false">
<var-collapse-item title="经济发展专项卡" :name="card.id" v-for="(card, index) in cardList" :key="card.id"> <var-collapse-item title="经济发展专项卡" :name="card.id" v-for="(card, index) in cardList" :key="card.id">
...@@ -31,7 +35,7 @@ ...@@ -31,7 +35,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="Number(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">
...@@ -40,9 +44,11 @@ ...@@ -40,9 +44,11 @@
<div class="step-action" v-if="step.amount"> <div class="step-action" v-if="step.amount">
<var-button v-if="stepIndex >= card.a7" size="small" class="pay-btn" <var-button v-if="stepIndex >= card.a7" size="small" class="pay-btn"
@click="handlePay(step, card)"> @click="handlePay(step, card)">
立即缴纳 {{ step.amount == 1 ? '成为荣誉董事' : '立即缴纳' }}
</var-button>
<var-button v-else size="small" class="pay-btn">
<span v-if="stepIndex == 1 && card.a7 >= 2">已成为荣誉董事</span>
</var-button> </var-button>
<span v-else class="status-completed">已完成</span>
</div> </div>
</div> </div>
</var-step> </var-step>
...@@ -69,6 +75,8 @@ ...@@ -69,6 +75,8 @@
import { ref, onMounted } from 'vue' import { ref, onMounted } from 'vue'
import request from '@/utils/request' import request from '@/utils/request'
import payUp from '@/components/payUp.vue' import payUp from '@/components/payUp.vue'
import { useRouter } from 'vue-router'
const router = useRouter()
const activeCard = ref<string>('') const activeCard = ref<string>('')
interface CardStep { interface CardStep {
text: string text: string
...@@ -92,12 +100,17 @@ const getSteps = (card: Card) => { ...@@ -92,12 +100,17 @@ const getSteps = (card: Card) => {
return steps return steps
} }
const cardList = ref<Card[]>([]) const cardList = ref<Card[]>([])
const cardListAll = ref<Card[]>([])
const payUpRef = ref<any>(null) const payUpRef = ref<any>(null)
const active = ref(0)
const onClickTab = (tab: any) => {
tab.name == 1 ? cardList.value = cardListAll.value.filter((item: any) => item.a1 == 2) : cardList.value = cardListAll.value.filter((item: any) => item.a1 != 2)
}
// 步骤配置 // 步骤配置
const stepsBase: CardStep[] = [ const stepsBase: CardStep[] = [
{ text: '您的申报已提交审核,请耐心等待结果!' }, { text: '您的申报已提交审核,请耐心等待结果!' },
{ text: '恭喜您的申报已通过,请立即点击制卡并且保密运输发货!', amount: 300, tips: "保密运输费用" }, { text: '您的审核已通过,成为荣誉董事可开始免费制卡', tips: '成为荣誉董事', amount: 1 },
{ text: '恭喜您成为荣誉董事,您的专项卡正在免费制作中!' },
{ text: '线上免费激活' }, { text: '线上免费激活' },
{ text: '激活成功' }, { text: '激活成功' },
{ text: '正在入款' }, { text: '正在入款' },
...@@ -114,28 +127,33 @@ const stepsBase: CardStep[] = [ ...@@ -114,28 +127,33 @@ const stepsBase: CardStep[] = [
{ text: '操作不当,资料丢失', amount: 300, tips: "操作不当费用" }, { text: '操作不当,资料丢失', amount: 300, tips: "操作不当费用" },
] ]
const handlePay = (step: CardStep, card: Card) => { const handlePay = (step: CardStep, card: Card) => {
if (!payUpRef.value) return if (step.amount == 1) {
payUpRef.value.open({ router.push('/ryds')
amount: step.amount, } else {
payTitle: step.tips, if (!payUpRef.value) return
payType: 1, payUpRef.value.open({
productId: card.id, amount: step.amount,
needPassword: false payTitle: step.tips,
}) payType: 1,
productId: card.id,
needPassword: false
})
}
} }
const fetchCardList = async () => { const fetchCardList = async () => {
try { try {
const res = await request.get('/business/businessYw1/listByU') const res = await request.get('/business/businessYw1/listByU')
if (res?.result?.records) { if (res?.result?.records) {
cardList.value = res.result.records.map((card: any) => ({ cardListAll.value = res.result.records.map((card: any) => ({
...card, ...card,
isShow: false, isShow: false,
mainStep: parseInt(card.a3) || 0, mainStep: parseInt(card.a3) || 0,
paySteps: parseInt(card.a4) || 0, paySteps: parseInt(card.a4) || 0,
})) }))
cardList.value = cardList.value.filter((item: any) => item.a1 != 2)
activeCard.value = cardList.value[0]?.id activeCard.value = cardList.value[0]?.id
cardList.value = cardListAll.value.filter((item: any) => item.a1 != 2)
} }
} catch (error) { } catch (error) {
console.error('获取卡片列表失败:', error) console.error('获取卡片列表失败:', error)
...@@ -161,9 +179,11 @@ onMounted(() => { ...@@ -161,9 +179,11 @@ onMounted(() => {
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
::v-deep .var-step__vertical-content { ::v-deep .var-step__vertical-content {
flex: 1; flex: 1;
} }
.card-main { .card-main {
background: white; background: white;
border-radius: 12px; border-radius: 12px;
...@@ -256,7 +276,7 @@ onMounted(() => { ...@@ -256,7 +276,7 @@ onMounted(() => {
} }
.progress-section { .progress-section {
padding: 20px; padding: 10px;
.progress-title { .progress-title {
display: flex; display: flex;
......
...@@ -251,7 +251,7 @@ const handleCheckProgress = () => { ...@@ -251,7 +251,7 @@ const handleCheckProgress = () => {
.progress-link { .progress-link {
text-align: center; text-align: center;
color: #007B5F; color: red;
font-size: 14px; font-size: 14px;
padding: 15px 0; padding: 15px 0;
font-weight: 700; font-weight: 700;
......
...@@ -24,14 +24,14 @@ ...@@ -24,14 +24,14 @@
3、按照国家项目规定成为荣誉董事!退休之后即可享受社会保障及公积金福利!另外还配套100平米面积的精装小区高品质一栋国产红旗汽车! 3、按照国家项目规定成为荣誉董事!退休之后即可享受社会保障及公积金福利!另外还配套100平米面积的精装小区高品质一栋国产红旗汽车!
</div> </div>
</div> </div>
<div class="apply-form"> <!-- <div class="apply-form">
<van-field :readonly="isSubmit" v-model="formData.name" label="姓名" placeholder="请输入您的姓名" /> <van-field :readonly="isSubmit" v-model="formData.name" label="姓名" placeholder="请输入您的姓名" />
<van-field :readonly="isSubmit" v-model="formData.age" label="年龄" type="number" placeholder="请输入您的年龄" /> <van-field :readonly="isSubmit" v-model="formData.age" label="年龄" type="number" placeholder="请输入您的年龄" />
</div> </div> -->
</div> </div>
<div class="submit-btn"> <div class="submit-btn">
<van-button type="primary" block :loading="loading" @click="handleSubmit"> <van-button type="primary" block :loading="loading" @click="handleSubmit">
{{ isSubmit ? '即将开放' : '成为荣誉董事' }} {{ isSubmit ? '已成为荣誉董事' : '成为荣誉董事' }}
</van-button> </van-button>
</div> </div>
</div> </div>
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
</div> </div>
</div> </div>
</div> </div>
<pay-up ref="payUpRef" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
...@@ -74,41 +75,53 @@ import { ref, reactive } from 'vue' ...@@ -74,41 +75,53 @@ import { ref, reactive } from 'vue'
import request from '@/utils/request' import request from '@/utils/request'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { isEealNameAuthentication } from '@/utils/userInfoCheck' import { isEealNameAuthentication } from '@/utils/userInfoCheck'
import payUp from '@/components/payUp.vue'
const router = useRouter() const router = useRouter()
const loading = ref(false) const loading = ref(false)
const formData = reactive({ const formData = reactive({
name: '', name: '',
age: '' age: ''
}) })
const payUpRef = ref<any>(null)
const isSubmit = ref(false) const isSubmit = ref(false)
const userInfo = ref(JSON.parse(sessionStorage.getItem('userInfo') || '{}')) const userInfo = ref(JSON.parse(sessionStorage.getItem('userInfo') || '{}'))
const handleSubmit = async () => { const handleSubmit = async () => {
if (isSubmit.value) { if(userInfo.value.sysUser.a8){
showToast('等待开放') showToast('已成为荣誉董事')
return
}
if (!formData.name) {
showToast('请输入姓名')
return
}
if (!formData.age) {
showToast('请输入年龄')
return return
} }
if (!userInfo.value.sysUser.identityId) { // if (isSubmit.value) {
if (!isEealNameAuthentication()) { // showToast('等待开放')
return // return
} // }
return // if (!formData.name) {
} // showToast('请输入姓名')
if (userInfo.value.smCount < 5) { // return
showToast('需要邀请5名好友才能成为荣誉董事') // }
return // if (!formData.age) {
}else{ // showToast('请输入年龄')
showToast('即将开放') // return
return false // }
// if (!userInfo.value.sysUser.identityId) {
// if (!isEealNameAuthentication()) {
// return
// }
// return
// }
// if (userInfo.value.smCount < 5) {
// showToast('需要邀请5名好友才能成为荣誉董事')
// return
// }
if (!isSubmit.value) {
payUpRef.value.open({
amount: 200,
payTitle: '成为荣誉董事',
payType: 1,
productId: '',
needPassword: false
})
} }
return false
try { try {
loading.value = true loading.value = true
let data = { a1: formData.name, a2: formData.age } let data = { a1: formData.name, a2: formData.age }
...@@ -130,7 +143,6 @@ const getDs = async () => { ...@@ -130,7 +143,6 @@ const getDs = async () => {
if (res.code == 200 && res.result?.a1) { if (res.code == 200 && res.result?.a1) {
formData.name = res.result.a1 formData.name = res.result.a1
formData.age = res.result.a2 formData.age = res.result.a2
isSubmit.value = true
} }
} }
getDs() getDs()
...@@ -138,6 +150,8 @@ const getUserInfo = async () => { ...@@ -138,6 +150,8 @@ const getUserInfo = async () => {
const res = await request.get('/business/businessWallet/getInfo') const res = await request.get('/business/businessWallet/getInfo')
if (res.code == 200) { if (res.code == 200) {
userInfo.value = res.result userInfo.value = res.result
isSubmit.value = userInfo.value.sysUser.a8
console.log(userInfo.value);
} }
} }
const handleInvite = async () => { const handleInvite = async () => {
...@@ -150,6 +164,7 @@ const handleInvite = async () => { ...@@ -150,6 +164,7 @@ const handleInvite = async () => {
getUserInfo() getUserInfo()
} }
} }
getUserInfo()
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<var-button v-if="!isEditing" @click="startEdit" block type="primary" class="submit-button"> <var-button v-if="!isEditing" @click="startEdit" block type="primary" class="submit-button">
修改地址 修改地址
</var-button> </var-button>
<var-button v-else :loading="loading" @click="handleSubmit" block type="primary" class="submit-button"> <var-button v-else :loading="loading" @click="handleSubmit" block type="danger" class="submit-button">
提交修改信息 提交修改信息
</var-button> </var-button>
</template> </template>
...@@ -74,6 +74,8 @@ const getCardList = () => { ...@@ -74,6 +74,8 @@ const getCardList = () => {
...formData.value, ...formData.value,
...JSON.parse(JSON.stringify(result.records[0])) ...JSON.parse(JSON.stringify(result.records[0]))
} }
}else{
isEditing.value = true
} }
} }
}) })
......
...@@ -23,7 +23,7 @@ const MENU_ITEMS = [ ...@@ -23,7 +23,7 @@ const MENU_ITEMS = [
{ name: "专项卡进度", icon: pnga9, path: "/kpsl/cardsl" }, { name: "专项卡进度", icon: pnga9, path: "/kpsl/cardsl" },
{ name: "邀请奖励", icon: pnga10, path: "/yqjl/txjd", tips: '提现进度' }, { name: "邀请奖励", icon: pnga10, path: "/yqjl/txjd", tips: '提现进度' },
{ name: "其他资金", icon: pnga11, path: "/user/withdraw?tab=q3", tips: '提现进度' }, { name: "其他资金", icon: pnga11, path: "/user/withdraw?tab=q3", tips: '提现进度' },
{ name: "官方群聊", icon: pnga12, path: "/user/group" }, { name: "团队佣金", icon: pnga12, path: "/user/yongjin" },
{ name: "在线客服", icon: pnga13, path: kfurl }, { name: "在线客服", icon: pnga13, path: kfurl },
{ name: "我的团队", icon: pnga14, path: "/user/myteam" }, { name: "我的团队", icon: pnga14, path: "/user/myteam" },
...@@ -33,6 +33,7 @@ const userData = ref({}); ...@@ -33,6 +33,7 @@ const userData = ref({});
const loading = ref(true); const loading = ref(true);
const activeCard = ref(null); const activeCard = ref(null);
const sysUser = ref({}); const sysUser = ref({});
// 处理点击事件 // 处理点击事件
const handleClick = (item) => { const handleClick = (item) => {
if (item.name === "在线客服") { if (item.name === "在线客服") {
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<!-- 团队层级切换 --> <!-- 团队层级切换 -->
<div class="level-tabs"> <div class="level-tabs">
<van-tabs v-model:active="currentLevel" animated swipeable> <van-tabs v-model:active="currentLevel" animated swipeable>
<van-tab v-for="tab in levelTabs" :key="tab.level" :title="tab.title"> <van-tab v-for="tab in levelTabs" :key="tab.level" :title="tab.title" :name="tab.level">
<div class="level-stats"> <div class="level-stats">
<div class="stat-box"> <div class="stat-box">
<var-icon name="account-group" :size="24" /> <var-icon name="account-group" :size="24" />
...@@ -57,20 +57,19 @@ ...@@ -57,20 +57,19 @@
<span>状态</span> <span>状态</span>
</div> </div>
<div class="list-body custom-scroll"> <div class="list-body custom-scroll">
<template v-if="tab.members.length"> <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" :immediate-check="false"
<div v-for="member in tab.members" :key="member.id" class="member-item"> @load="getTeamInfo">
<span class="account">{{ maskUsername(member.username) }}</span> <template v-if="members.length">
<span class="name">{{ member.realname || '--' }}</span> <div v-for="member in members" :key="member.id" class="member-item">
<span class="date">{{ formatDate(member.createTime) }}</span> <span class="account">{{ maskUsername(member.username) }}</span>
<span :class="['status', member.identityId ? 'verified' : 'unverified']"> <span class="name">{{ member.realname || '--' }}</span>
{{ member.identityId ? '已实名' : '未实名' }} <span class="date">{{ formatDate(member.createTime) }}</span>
</span> <span :class="['status', member.identityId ? 'verified' : 'unverified']">
</div> {{ member.identityId ? '已实名' : '未实名' }}
</template> </span>
<div v-else class="empty-state"> </div>
<var-icon name="account-group-outline" :size="48" /> </template>
<p>暂无团队成员</p> </van-list>
</div>
</div> </div>
</div> </div>
</van-tab> </van-tab>
...@@ -85,6 +84,12 @@ import { ref, computed } from 'vue' ...@@ -85,6 +84,12 @@ import { ref, computed } from 'vue'
import request from '@/utils/request' import request from '@/utils/request'
import type { AxiosResponse } from 'axios' import type { AxiosResponse } from 'axios'
import handleCopy from '@/utils/handleCopy' import handleCopy from '@/utils/handleCopy'
const loading = ref(false)
const finished = ref(false)
const pageSize = ref(10)
const pageNum = ref(1)
const total = ref(0)
const members = ref([])
const linkstr = ref('') const linkstr = ref('')
const userInfo = ref<any>(JSON.parse(sessionStorage.getItem('userInfo') || '{}')) const userInfo = ref<any>(JSON.parse(sessionStorage.getItem('userInfo') || '{}'))
linkstr.value = `https://${location.host}/register?yqm=${userInfo?.value?.sysUser?.yqm}` linkstr.value = `https://${location.host}/register?yqm=${userInfo?.value?.sysUser?.yqm}`
...@@ -110,7 +115,14 @@ interface TeamInfo { ...@@ -110,7 +115,14 @@ interface TeamInfo {
sjsmrs: number // 三级实名人数 sjsmrs: number // 三级实名人数
} }
const currentLevel = ref(0) const currentLevel = ref(1)
watch(currentLevel, () => {
pageNum.value = 1
finished.value = false
loading.value = false
total.value = 0
members.value = []
})
const teamInfo = ref<TeamInfo>({ const teamInfo = ref<TeamInfo>({
zzchy: 0, zzchy: 0,
zsmrs: 0, zsmrs: 0,
...@@ -175,15 +187,26 @@ const getTeamInfo = async () => { ...@@ -175,15 +187,26 @@ const getTeamInfo = async () => {
code: number code: number
message: string message: string
result: TeamInfo result: TeamInfo
}>>('/business/businessWallet/getMyTeam') }>>(`/business/businessWallet/getMyTeam?pageNo=${pageNum.value}&pageSize=${pageSize.value}&type=${currentLevel.value}`)
if (res.code === 200) { if (res.code === 200) {
teamInfo.value = res.result teamInfo.value = res.result
members.value = [...members.value, ...(res.result.page.records || [])]
total.value = res.result.page.total || 0
if (members.value.length >= total.value) {
finished.value = true
} else {
pageNum.value++
}
} else { } else {
showFailToast(res.message || '加载失败') showFailToast(res.message || '加载失败')
finished.value = true
} }
} catch (error: any) { } catch (error: any) {
console.error('获取团队信息失败:', error) console.error('获取团队信息失败:', error)
showFailToast(error?.message || '加载失败,请重试') showFailToast(error?.message || '加载失败,请重试')
finished.value = true
} finally {
loading.value = false
} }
} }
...@@ -200,10 +223,12 @@ getTeamInfo() ...@@ -200,10 +223,12 @@ getTeamInfo()
flex-direction: column; flex-direction: column;
overflow: hidden; // 防止页面滚动 overflow: hidden; // 防止页面滚动
} }
.invite-code{
.invite-code {
font-size: 16px; font-size: 16px;
font-weight: 700; font-weight: 700;
} }
.btn { .btn {
width: 100px; // 240rpx / 2 width: 100px; // 240rpx / 2
line-height: 30px; // 80rpx / 2 line-height: 30px; // 80rpx / 2
...@@ -217,9 +242,11 @@ getTeamInfo() ...@@ -217,9 +242,11 @@ getTeamInfo()
font-size: 14px; font-size: 14px;
margin-top: 10px; margin-top: 10px;
} }
.btn:first-of-type{
.btn:first-of-type {
margin-right: 10px; margin-right: 10px;
} }
.content-wrapper { .content-wrapper {
flex: 1; flex: 1;
padding: 16px; padding: 16px;
...@@ -336,6 +363,7 @@ getTeamInfo() ...@@ -336,6 +363,7 @@ getTeamInfo()
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 260px; height: 260px;
.list-header { .list-header {
position: sticky; position: sticky;
top: 0; top: 0;
......
...@@ -2,6 +2,15 @@ ...@@ -2,6 +2,15 @@
<div class="shiming-container"> <div class="shiming-container">
<div class="form-container"> <div class="form-container">
<var-form ref="formRef" @submit="onSubmit"> <var-form ref="formRef" @submit="onSubmit">
<var-select
v-model="idType"
placeholder="请选择证件类型"
:rules="[(v) => !!v || '请选择证件类型']"
>
<var-option label="中国大陆居民身份证" value="1" />
<var-option label="港澳居民来往内地通行证" value="2" />
<var-option label="台湾居民来往大陆通行证" value="3" />
</var-select>
<var-input v-model="realname" placeholder="请输入真实姓名" :rules="[ <var-input v-model="realname" placeholder="请输入真实姓名" :rules="[
(value) => { (value) => {
if (!value) return '请输入真实姓名'; if (!value) return '请输入真实姓名';
...@@ -13,10 +22,12 @@ ...@@ -13,10 +22,12 @@
<var-icon name="account-circle" /> <var-icon name="account-circle" />
</template> </template>
</var-input> </var-input>
<var-input v-model="identityId" placeholder="请输入身份证号" :rules="[ <var-input v-model="identityId" :placeholder="getIdPlaceholder()" :rules="[
(value: string) => { (value: string) => {
if (!value) return '请输入身份证号'; if (!value) return '请输入证件号码';
if (!validateIdCard(value)) return '请输入正确的身份证号'; if (!validateCard(value)) {
return '请输入正确的证件号码';
}
return true; return true;
} }
]"> ]">
...@@ -53,6 +64,7 @@ const formRef = ref() ...@@ -53,6 +64,7 @@ const formRef = ref()
const realname = ref('') const realname = ref('')
const identityId = ref('') const identityId = ref('')
const loading = ref(false) const loading = ref(false)
const idType = ref('1')
const { checkAuthStatus, updateUserInfo } = useUserInfo() const { checkAuthStatus, updateUserInfo } = useUserInfo()
const userInfo = ref(JSON.parse(sessionStorage.getItem('userInfo') || '{}')) const userInfo = ref(JSON.parse(sessionStorage.getItem('userInfo') || '{}'))
...@@ -82,7 +94,8 @@ const onSubmit = async () => { ...@@ -82,7 +94,8 @@ const onSubmit = async () => {
loading.value = true loading.value = true
const res = await request.post('/business/businessWallet/certified', { const res = await request.post('/business/businessWallet/certified', {
realname: realname.value, realname: realname.value,
identityId: identityId.value identityId: identityId.value,
idType: idType.value
}) })
console.log(res) console.log(res)
if (res.code === 200) { if (res.code === 200) {
...@@ -107,7 +120,56 @@ const onSubmit = async () => { ...@@ -107,7 +120,56 @@ const onSubmit = async () => {
} }
} }
const validateIdCard = (idCard: string): boolean => { // 获取不同证件类型的提示文字
const getIdPlaceholder = () => {
switch (idType.value) {
case '1':
return '请输入身份证号码'
case '2':
return '请输入港澳居民来往内地通行证号码'
case '3':
return '请输入台湾居民来往大陆通行证号码'
default:
return '请输入证件号码'
}
}
// 统一的证件验证函数
const validateCard = (value: string): boolean => {
switch (idType.value) {
case '1':
return validateIdCard(value)
case '2':
return validateHKMacauCard(value)
case '3':
return validateTWCard(value)
default:
return false
}
}
// 修改港澳通行证验证逻辑
const validateHKMacauCard = (cardNo: string): boolean => {
// 新版: H/M + 8位数字 + 2/3位数字或字母
const newPattern = /^[HM]\d{8}[\dA-Z]{2,3}$/
// 旧版: H/M + 10位数字
const oldPattern = /^[HM]\d{10}$/
// 出境通行证: H + 8位数字
const exitPattern = /^[HM]\d{8}$/
return newPattern.test(cardNo) || oldPattern.test(cardNo) || exitPattern.test(cardNo)
}
// 修改台湾通行证验证逻辑
const validateTWCard = (cardNo: string): boolean => {
// 新版: 8位数字
const newPattern = /^\d{8}$/
// 旧版: 8位数字 + 字母
const oldPattern = /^\d{8}[A-Z]$/
return newPattern.test(cardNo) || oldPattern.test(cardNo)
}
//算法完整验证
const validateIdCard1 = (idCard: string): boolean => {
// 基本格式校验 // 基本格式校验
const reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; const reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
if (!reg.test(idCard)) { if (!reg.test(idCard)) {
...@@ -159,6 +221,50 @@ const validateIdCard = (idCard: string): boolean => { ...@@ -159,6 +221,50 @@ const validateIdCard = (idCard: string): boolean => {
return true; return true;
} }
//算法简化验证
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);
// 补充校验位(仅保留对X的验证)
// 不再加权和计算,只进行X的验证
}
// 提取生日部分
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;
}
// 校验18位身份证最后一位是否为X(不进行加权和计算)
if (idCard.length === 18) {
const lastChar = idCard[17].toUpperCase(); // 获取第18位,并转为大写
// 检查最后一位是否为数字或X
if (/^\d$/.test(lastChar) || lastChar === 'X') {
return true;
}
return false; // 如果最后一位既不是数字也不是X,返回false
}
return true;
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -218,6 +324,13 @@ const validateIdCard = (idCard: string): boolean => { ...@@ -218,6 +324,13 @@ const validateIdCard = (idCard: string): boolean => {
line-height: 1.5; line-height: 1.5;
} }
} }
:deep(.var-select) {
margin-bottom: 20px;
background: #fff;
border-radius: 8px;
padding: 4px 12px;
}
} }
} }
</style> </style>
\ No newline at end of file
<template>
<div class="page-container">
<div class="content-wrapper">
<div class="level-tabs">
<van-tabs v-model:active="currentLevel" animated swipeable>
<van-tab v-for="tab in levelTabs" :key="tab" :title="tab" :name="tab">
<div class="overview-card">
<div class="stat-item">
<span class="label">{{ currentLevel }}总佣金</span>
<span class="value">{{ sum || 0.00 }}</span>
<span class="unit"></span>
</div>
</div>
<!-- <div class="level-stats">
<div class="stat-box">
<var-icon name="account-group" :size="24" />
<div class="stat-content">
<span class="label">{{ tab.totalLabel }}</span>
<span class="number">{{ tab.total }}</span>
</div>
</div>
<div class="stat-box">
<var-icon name="account-check" :size="24" />
<div class="stat-content">
<span class="label">{{ tab.verifiedLabel }}</span>
<span class="number">{{ tab.verified }}</span>
</div>
</div>
</div> -->
<!-- 团队成员列表 -->
<div class="member-list">
<div class="list-header">
<span>下级账户</span>
<span>姓名</span>
<span>佣金</span>
</div>
<div class="list-body custom-scroll">
<template v-if="teamInfo?.length">
<van-list v-model:loading="loading" :finished="finished" :immediate-check="false" :offset="10"
@load="getTeamInfo">
<div v-for="member in teamInfo" :key="member.id" class="member-item">
<span class="account">{{ maskUsername(getUser(member.changeNote)[2]) }}</span>
<span class="name">{{ getUser(member.changeNote)[1] || '--' }}</span>
<span class="date">{{ member.changeAmount }}</span>
</div>
</van-list>
</template>
<div v-else class="empty-state">
<var-icon name="account-group-outline" :size="48" />
<p>暂无团队成员</p>
</div>
</div>
</div>
</van-tab>
</van-tabs>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue'
import request from '@/utils/request'
const linkstr = ref('')
const userInfo = ref<any>(JSON.parse(sessionStorage.getItem('userInfo') || '{}'))
linkstr.value = `https://${location.host}/register?yqm=${userInfo?.value?.sysUser?.yqm}`
const levelTabs = ref(['一级', '二级', '三级'])
const sum = ref(0.00)
const currentLevel = ref('一级')
const teamInfo = ref([])
// 格式化用户名(隐私保护)
const maskUsername = (username: string): string => {
if (!username) return '--'
return `${username.slice(0, 3)}****${username.slice(-4)}`
}
const loading = ref(false)
const finished = ref(false)
const pageSize = ref(20)
const pageNum = ref(1)
const total = ref(0)
watch(currentLevel, () => {
resetList()
})
const resetList = () => {
teamInfo.value = []
pageNum.value = 1
finished.value = false
loading.value = false
total.value = 0
getTeamInfo()
}
const getUser = (changeNote: string) => {
if (!changeNote) return ['--', '--', '--', '--']
return changeNote.split('_')
}
// 获取团队信息
const getTeamInfo = async () => {
try {
loading.value = true
const res = await request.post(`/business/businessWalletDetail/yjlist?pageNum=${pageNum.value}&pageSize=${pageSize.value}`,
{ changeNote: currentLevel.value })
if (res.code === 200) {
const result = res.result
sum.value = result.sum
teamInfo.value = [...teamInfo.value, ...(result.pageList.records || [])]
total.value = result.pageList.total || 0
console.log(res.result)
if (teamInfo.value.length >= total.value) {
finished.value = true
} else {
pageNum.value++
}
} else {
showFailToast(res.data.message || '加载失败')
finished.value = true
}
} catch (error: any) {
console.error('获取团队信息失败:', error)
showFailToast(error?.message || '加载失败,请重试')
finished.value = true
} finally {
loading.value = false
}
}
getTeamInfo()
</script>
<style lang="scss" scoped>
.page-container {
height: inherit;
background: url('@/static/cbg1.png') no-repeat center center;
background-size: 100% 100%;
box-sizing: border-box;
display: flex;
flex-direction: column;
overflow: hidden; // 防止页面滚动
}
.invite-code {
font-size: 16px;
font-weight: 700;
}
.btn {
width: 100px; // 240rpx / 2
line-height: 30px; // 80rpx / 2
background: #3a9256;
text-align: center;
border-radius: 5px; // 10rpx / 2
margin-bottom: 6px; // 12rpx / 2
cursor: pointer;
border: none;
color: #fff;
font-size: 14px;
margin-top: 10px;
}
.btn:first-of-type {
margin-right: 10px;
}
.content-wrapper {
flex: 1;
padding: 16px;
overflow: hidden; // 防止整体内容滚动
}
.overview-card {
border-radius: 16px;
padding: 10px 20px;
display: flex;
align-items: center;
justify-content: space-between;
color: #000;
margin-bottom: 10px;
box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
.stat-item {
flex: 1;
text-align: center;
.label {
display: block;
font-size: 14px;
opacity: 0.9;
margin-bottom: 8px;
}
.value {
font-size: 28px;
font-weight: 600;
margin-right: 4px;
}
.unit {
font-size: 14px;
opacity: 0.9;
}
}
.divider {
width: 1px;
height: 40px;
background: rgba(255, 255, 255, 0.2);
margin: 0 20px;
}
}
.level-tabs {
background: white;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
height: 100%; // 减去顶部卡片的高度
display: flex;
flex-direction: column;
:deep(.van-tabs) {
height: 100%;
display: flex;
flex-direction: column;
}
:deep(.van-tabs__content) {
flex: 1;
overflow: hidden;
}
:deep(.van-tab__pane) {
height: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
}
}
.level-stats {
padding: 10px 20px;
display: flex;
gap: 16px;
.stat-box {
flex: 1;
background: #dbf5ce;
border-radius: 12px;
padding: 8px;
display: flex;
align-items: center;
gap: 12px;
.var-icon {
color: #4a90e2;
}
.stat-content {
display: flex;
flex-direction: column;
.label {
font-size: 13px;
color: #64748b;
margin-bottom: 4px;
}
.number {
font-size: 18px;
font-weight: 600;
color: #1e293b;
}
}
}
}
.member-list {
display: flex;
flex-direction: column;
height: 445px;
.list-header {
position: sticky;
top: 0;
z-index: 1;
display: grid;
grid-template-columns: 2fr 1fr 1.5fr;
padding: 12px 16px;
background: #f8fafc;
font-size: 14px;
color: #64748b;
font-weight: 500;
border-bottom: 1px solid #e2e8f0;
span {
flex: 1;
text-align: center;
}
}
.list-body {
height: 100%;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
&.custom-scroll {
&::-webkit-scrollbar {
width: 4px;
}
&::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 2px;
}
&::-webkit-scrollbar-thumb {
background: #ccc;
border-radius: 2px;
&:hover {
background: #999;
}
}
}
.member-item {
display: grid;
grid-template-columns: 2fr 1fr 1.5fr;
padding: 4px 8px;
border-bottom: 1px solid #e2e8f0;
font-size: 14px;
align-items: center;
background: white;
span {
text-align: center;
}
&:last-child {
border-bottom: none;
}
.account {
color: #1e293b;
font-family: monospace;
}
.name {
color: #475569;
}
.date {
color: #64748b;
}
}
}
.empty-state {
padding: 40px 0;
text-align: center;
color: #94a3b8;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.var-icon {
margin-bottom: 12px;
}
p {
margin: 0;
font-size: 14px;
}
}
}
</style>
\ No newline at end of file
...@@ -53,9 +53,7 @@ const getList = async () => { ...@@ -53,9 +53,7 @@ const getList = async () => {
} else { } else {
pageNum.value++ pageNum.value++
} }
if (list.value.length >= total.value) {
finished.value = true
}
} else { } else {
showFailToast(res.msg || '加载失败') showFailToast(res.msg || '加载失败')
finished.value = true finished.value = true
......
...@@ -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