Files
xl-mobile/src/pages/user/index.vue

245 lines
8.4 KiB
Vue
Raw Normal View History

2025-03-25 16:35:39 +08:00
<script setup>
2025-05-12 19:45:27 +08:00
import {defineAsyncComponent, onMounted, ref} from 'vue';
2025-04-14 11:42:21 +08:00
import ICON1 from '../../static/icons/icon_提现记录.png';
import ICON2 from '../../static/icons/icon_变动记录.png';
import ICON3 from '../../static/icons/icon_我的钱包.png';
import ICON4 from '../../static/icons/邀请好友.png';
import ICON5 from '../../static/icons/账号管理.png';
import ICON6 from '../../static/icons/联系客服.png';
import ICON7 from '../../static/icons/消息推送.png';
2025-04-12 18:00:08 +08:00
import Avatar from "../../static/images/Avatar.png";
import user_BG from '../../static/images/user_bg.png';
import XNav from "../../components/XNav.vue";
import CreditScore from "../../components/CreditScore.vue";
2025-04-14 11:42:21 +08:00
import {toPage} from "../../utils/uils.js";
2025-05-12 19:45:27 +08:00
import {useUserStore} from "../../pinia/UserStore/index.js";
2025-04-14 11:42:21 +08:00
2025-05-06 11:36:14 +08:00
// #ifdef APP-PLUS
// #endif
// #ifndef APP-PLUS
2025-04-14 11:42:21 +08:00
const MyTeam = defineAsyncComponent(() => import('./components/MyTeam.vue'));
const Inviter = defineAsyncComponent(() => import('./components/Inviter.vue'));
const AccompanyingMentor = defineAsyncComponent(() => import('./components/AccompanyingMentor.vue'));
2025-05-06 11:36:14 +08:00
// #endif
2025-04-14 11:42:21 +08:00
const tabCur = ref('MyTeam');
const tabs = [
{
key: 'MyTeam',
name: '我的团队',
component: MyTeam,
},
{
key: 'Inviter',
name: '邀请人',
component: Inviter,
},
{
key: 'AccompanyingMentor',
name: '陪跑导师',
component: AccompanyingMentor,
},
]
2025-05-12 19:45:27 +08:00
const UserStore = useUserStore();
onMounted(() => {
UserStore.getUserInfo();
})
2025-03-25 16:35:39 +08:00
</script>
<template>
<!--我的-->
2025-05-12 19:45:27 +08:00
<x-nav :show-back="false"></x-nav>
2025-04-12 18:00:08 +08:00
<view class="!w-full !h-[484rpx] overflow-hidden relative">
<image class="!w-[1200rpx] !h-[480rpx] !absolute left-[-200rpx]" :src="user_BG" mode="aspectFill"></image>
2025-04-14 11:42:21 +08:00
<view class="!w-full relative z-10 p-[20rpx] !flex gap-[34rpx] justify-between">
2025-04-12 18:00:08 +08:00
<image class="!size-[132rpx]" :src="Avatar" mode="aspectFill"></image>
<view class="!flex flex-col items-start justify-between box-border py-[4rpx]">
2025-05-12 19:45:27 +08:00
<view class="user_name">{{ UserStore?.userInfo?.nickname }}</view>
<view class="user_phone">手机号{{ UserStore?.userInfo?.mobile }}</view>
<view class="user_phone">uid{{ UserStore?.userInfo?.uid }}</view>
2025-04-12 18:00:08 +08:00
</view>
2025-04-14 11:42:21 +08:00
<credit-score class="!mr-[110rpx] !ml-auto"></credit-score>
2025-04-12 18:00:08 +08:00
<view
class="bg-[rgba(0,0,0,.8)] text-[#fff] absolute right-0 py-[7rpx] w-[120rpx] rounded-l-full !flex items-center justify-center gap-[4rpx]"
style="font-size: 22rpx">
<tui-icon name="edit" size="16"></tui-icon>
2025-04-14 11:42:21 +08:00
<view class="!mt-[2rpx]" @click="toPage('/pages/userInfo/index')">编辑</view>
</view>
</view>
</view>
<view class="!mx-[20rpx] relative !mt-[-300rpx] z-10 bg-[#fff] rounded-[20rpx]">
<view class="balance-card">
<view class="py-[52rpx] px-[44rpx] !grid grid-cols-2">
<view>
<view class="info-title">总收益</view>
<view class="info-balance">
2025-05-12 19:45:27 +08:00
{{ UserStore?.userInfo?.total_money.toFixed(2) }}
2025-04-14 11:42:21 +08:00
</view>
</view>
<view>
<view class="info-title">可提现</view>
<view class="info-balance">
2025-05-12 19:45:27 +08:00
{{ UserStore?.userInfo?.money.toFixed(2) }}
2025-04-14 11:42:21 +08:00
</view>
</view>
</view>
<view class="gap-line"></view>
<view class="py-[32rpx] px-[42rpx] !flex items-center gap-[20rpx]">
<view class="info-title !mb-0">已提现</view>
2025-05-12 19:45:27 +08:00
<view class="info-balance" style="font-size: 28rpx">{{
UserStore?.userInfo?.withraw_money.toFixed(2)
}}
</view>
2025-04-14 11:42:21 +08:00
</view>
</view>
<view class="px-[34rpx] py-[20rpx] !flex justify-between">
2025-04-21 15:19:28 +08:00
<view class="!flex items-center gap-[12rpx]" @click="toPage('/pages/withdrawalLog/index')">
2025-04-14 11:42:21 +08:00
<image class="!size-[40rpx]" mode="aspectFill" :src="ICON1"></image>
<view class="test-24r">提现记录</view>
</view>
2025-04-21 15:19:28 +08:00
<view class="!flex items-center gap-[12rpx]" @click="toPage('/pages/changeLog/index')">
2025-04-14 11:42:21 +08:00
<image class="!size-[40rpx]" mode="aspectFill" :src="ICON2"></image>
<view class="test-24r">变动记录</view>
</view>
2025-04-14 17:26:40 +08:00
<view class="!flex items-center gap-[12rpx]" @click="toPage('/pages/wallet/index')">
2025-04-14 11:42:21 +08:00
<image class="!size-[40rpx]" mode="aspectFill" :src="ICON3"></image>
<view class="test-24r">我的钱包</view>
</view>
</view>
</view>
<view class="h-[120rpx] rounded-[20rpx] bg-[#fff] !mx-[20rpx] !mt-[20rpx]"></view>
<view class="rounded-[20rpx] bg-[#fff] !mx-[20rpx] !mt-[20rpx] py-[26rpx] px-[32rpx]">
<view class="!flex gap-[64rpx]">
<view v-for="item in tabs" :key="item.key"
:class="['tabs-item', tabCur === item.key ? 'tabs-item-cur' : '']"
@click="tabCur=item.key">{{ item.name }}
</view>
</view>
<Suspense>
<template #default>
<component :is="tabs.find(v=>v.key===tabCur).component"></component>
</template>
<template #fallback>
加载中...
</template>
</Suspense>
</view>
<view class="rounded-[20rpx] bg-[#fff] !mx-[20rpx] !mt-[20rpx] py-[26rpx] px-[32rpx]">
<view class="test-28r !mb-[40rpx]" style="font-weight: 700;">其他内容</view>
<view class="!grid grid-cols-4">
<view class="!flex items-center flex-col justify-center gap-[12rpx]">
<image class="!size-[84rpx]" mode="aspectFill" :src="ICON4"></image>
<view class="test-24r">邀请好友</view>
</view>
2025-05-12 19:45:27 +08:00
<view class="!flex items-center flex-col justify-center gap-[12rpx]"
@click="toPage('/pages/accountManagement/index')">
2025-04-14 11:42:21 +08:00
<image class="!size-[84rpx]" mode="aspectFill" :src="ICON5"></image>
2025-05-12 19:45:27 +08:00
<view class="test-24r">账号管理</view>
2025-04-14 11:42:21 +08:00
</view>
<view class="!flex items-center flex-col justify-center gap-[12rpx]">
<image class="!size-[84rpx]" mode="aspectFill" :src="ICON6"></image>
2025-04-15 14:08:32 +08:00
<view class="test-24r">联系客服</view>
2025-04-14 11:42:21 +08:00
</view>
2025-04-15 14:08:32 +08:00
<view class="!flex items-center flex-col justify-center gap-[12rpx]"
@click="toPage('/pages/messagePush/index')">
2025-04-14 11:42:21 +08:00
<image class="!size-[84rpx]" mode="aspectFill" :src="ICON7"></image>
2025-04-15 14:08:32 +08:00
<view class="test-24r">消息推送</view>
2025-04-12 18:00:08 +08:00
</view>
</view>
</view>
2025-03-25 16:35:39 +08:00
</template>
2025-04-12 18:00:08 +08:00
<style lang="scss" scoped>
2025-04-14 11:42:21 +08:00
.tabs-item {
color: rgb(134, 144, 156);
font-size: 14px;
font-weight: 500;
letter-spacing: 0;
transition: 500ms;
position: relative;
&::before {
content: '';
width: 12rpx;
height: 12rpx;
display: block;
position: absolute;
background-color: var(--primary-color);
border-radius: 50%;
left: 50%;
top: 100%;
transform: translateX(-50%);
opacity: 0;
transition: 500ms;
}
}
.tabs-item-cur {
color: rgb(29, 33, 41);
font-size: 14px;
font-weight: 500;
letter-spacing: 0;
&::before {
opacity: 1;
}
}
.balance-card {
border-radius: 20rpx;
background: linear-gradient(90.00deg, rgb(109, 154, 225) 2.278%, rgb(98, 147, 224) 98.521%);
.gap-line {
height: 2px;
width: 100%;
background-color: rgba(232, 243, 255, 0.14);
}
.info-title {
color: rgb(190, 218, 255);
font-size: 24rpx;
font-weight: 400;
letter-spacing: 0;
margin-bottom: 16rpx;
}
.info-balance {
color: rgb(255, 255, 255);
font-size: 52rpx;
font-weight: 500;
letter-spacing: 0;
}
}
2025-04-12 18:00:08 +08:00
.user_name {
color: rgb(29, 33, 41);
font-size: 32rpx;
font-weight: 500;
line-height: 23px;
letter-spacing: 0;
text-align: center;
}
2025-03-25 16:35:39 +08:00
2025-04-12 18:00:08 +08:00
.user_phone {
color: rgb(134, 144, 156);
font-size: 22rpx;
font-weight: 500;
letter-spacing: 0;
text-align: left;
}
2025-03-25 16:35:39 +08:00
</style>