HomeLease/pages/profile/profile.vue
2025-08-13 16:03:05 +08:00

454 lines
9.5 KiB
Vue

<template>
<view class="profile-page">
<!-- 页面标题 -->
<view class="page-title">
<text class="title-text">个人中心</text>
</view>
<!-- 头部用户信息 -->
<view class="user-header">
<view class="user-info">
<view class="avatar">
<text class="avatar-text"></text>
</view>
<view class="user-details">
<text class="user-name">昵称</text>
<text class="user-id">123****8912</text>
</view>
<view class="settings-icon">
<image :src="commonEnum.SET" class="settings-img" mode="aspectFit"></image>
</view>
</view>
<view class="share-btn">
<image :src="commonEnum.GIFT" class="share-img" mode="aspectFit"></image>
<text class="share-text">分享推广</text>
</view>
</view>
<!-- 财务摘要 -->
<view class="financial-summary">
<image :src="commonEnum.COIN_BACKGROUND" class="coin-background" mode="aspectFill"></image>
<view class="main-amount">
<text class="amount-number">18079.29</text>
<text class="amount-label">可提现()</text>
</view>
<view class="action-buttons">
<view class="action-btn">
<text class="btn-text">收支明细 ></text>
</view>
<view class="action-btn">
<text class="btn-text">立即提现 ></text>
</view>
</view>
<view class="financial-stats">
<view class="stat-item">
<text class="stat-number">399.59</text>
<text class="stat-label">待入账()</text>
</view>
<view class="stat-item">
<text class="stat-number">9.59</text>
<text class="stat-label">提现中()</text>
</view>
<view class="stat-item">
<text class="stat-number">999.59</text>
<text class="stat-label">已提现()</text>
</view>
</view>
</view>
<!-- 我的用户 -->
<view class="my-users-section">
<view class="section-header">
<text class="section-title">我的用户</text>
<view class="view-details">
<text class="details-text">查看详情 ></text>
</view>
</view>
<view class="user-stats">
<view class="stat-item">
<text class="stat-number">30</text>
<text class="stat-label">名下用户()</text>
</view>
<view class="stat-item">
<text class="stat-number">30</text>
<text class="stat-label">租赁数量()</text>
</view>
<view class="stat-item">
<text class="stat-number">3000</text>
<text class="stat-label">租赁金额()</text>
</view>
</view>
</view>
<!-- 其他功能 -->
<view class="other-functions">
<view class="section-header">
<text class="section-title">其他功能</text>
</view>
<view class="function-grid">
<view class="function-item" @click="goToAgentApply">
<view class="function-icon">
<image :src="commonEnum.REQUEST_AGENT" class="function-img" mode="aspectFit"></image>
</view>
<text class="function-text">申请代理</text>
</view>
<view class="function-item" @click="goToAgentBenefits">
<view class="function-icon">
<image :src="commonEnum.AGENCY_INTERESTS" class="function-img" mode="aspectFit"></image>
</view>
<text class="function-text">代理权益</text>
</view>
<view class="function-item" @click="goToCustomerService">
<view class="function-icon">
<image
:src="commonEnum.ONLINE_CUSTOMER_SERVICE"
class="function-img"
mode="aspectFit"
></image>
</view>
<text class="function-text">在线客服</text>
</view>
</view>
</view>
</view>
</template>
<script>
import { commonEnum } from '@/enum/commonEnum.js'
export default {
name: 'ProfilePage',
data() {
return {
commonEnum,
userInfo: {
name: '昵称',
id: '123****8912',
},
financialData: {
withdrawable: '18079.29',
pending: '399.59',
withdrawing: '9.59',
withdrawn: '999.59',
},
userStats: {
users: 30,
leases: 30,
amount: 3000,
},
}
},
methods: {
goToAgentApply() {
uni.showToast({
title: '申请代理',
icon: 'none',
})
},
goToAgentBenefits() {
uni.showToast({
title: '代理权益',
icon: 'none',
})
},
goToCustomerService() {
uni.showToast({
title: '在线客服',
icon: 'none',
})
},
},
}
</script>
<style lang="scss" scoped>
.profile-page {
min-height: 100vh;
background: #f5f5f5;
padding-bottom: 120rpx;
}
// 页面标题
.page-title {
text-align: center;
padding: 40rpx 0 20rpx 0;
.title-text {
font-size: 36rpx;
font-weight: bold;
color: #333;
}
}
// 用户头部
.user-header {
background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
padding: 40rpx;
margin: 20rpx;
border-radius: 20rpx;
position: relative;
.user-info {
display: flex;
align-items: center;
margin-bottom: 30rpx;
.avatar {
width: 100rpx;
height: 100rpx;
background: rgba(255, 255, 255, 0.3);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-right: 30rpx;
.avatar-text {
font-size: 40rpx;
font-weight: bold;
color: #fff;
}
}
.user-details {
flex: 1;
.user-name {
display: block;
font-size: 32rpx;
font-weight: bold;
color: #fff;
margin-bottom: 10rpx;
}
.user-id {
font-size: 28rpx;
color: rgba(255, 255, 255, 0.8);
}
}
.settings-icon {
width: 60rpx;
height: 60rpx;
background: rgba(255, 255, 255, 0.2);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
.settings-img {
width: 40rpx;
height: 40rpx;
}
}
}
.share-btn {
position: absolute;
top: 40rpx;
right: 40rpx;
background: rgba(255, 255, 255, 0.2);
padding: 20rpx 30rpx;
border-radius: 30rpx;
display: flex;
align-items: center;
.share-img {
width: 32rpx;
height: 32rpx;
margin-right: 10rpx;
}
.share-text {
font-size: 24rpx;
color: #fff;
}
}
}
// 财务摘要
.financial-summary {
background: #f15a04;
margin: 20rpx;
border-radius: 20rpx;
padding: 40rpx;
color: #fff;
position: relative;
overflow: hidden;
.coin-background {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0.1;
z-index: 1;
}
.main-amount {
text-align: center;
margin-bottom: 40rpx;
position: relative;
z-index: 2;
.amount-number {
display: block;
font-size: 60rpx;
font-weight: bold;
margin-bottom: 10rpx;
}
.amount-label {
font-size: 28rpx;
opacity: 0.9;
}
}
.action-buttons {
position: absolute;
top: 40rpx;
right: 40rpx;
display: flex;
flex-direction: column;
gap: 20rpx;
z-index: 2;
.action-btn {
background: rgba(255, 255, 255, 0.2);
padding: 15rpx 25rpx;
border-radius: 20rpx;
.btn-text {
font-size: 24rpx;
color: #fff;
}
}
}
.financial-stats {
display: flex;
justify-content: space-around;
position: relative;
z-index: 2;
.stat-item {
text-align: center;
.stat-number {
display: block;
font-size: 32rpx;
font-weight: bold;
margin-bottom: 5rpx;
}
.stat-label {
font-size: 24rpx;
opacity: 0.8;
}
}
}
}
// 我的用户
.my-users-section {
background: #fff;
margin: 20rpx;
border-radius: 20rpx;
padding: 40rpx;
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30rpx;
.section-title {
font-size: 32rpx;
font-weight: bold;
color: #333;
}
.view-details {
.details-text {
font-size: 28rpx;
color: #f15a04;
}
}
}
.user-stats {
display: flex;
justify-content: space-around;
.stat-item {
text-align: center;
.stat-number {
display: block;
font-size: 36rpx;
font-weight: bold;
color: #f15a04;
margin-bottom: 10rpx;
}
.stat-label {
font-size: 24rpx;
color: #666;
}
}
}
}
// 其他功能
.other-functions {
background: #fff;
margin: 20rpx;
border-radius: 20rpx;
padding: 40rpx;
.section-header {
margin-bottom: 30rpx;
.section-title {
font-size: 32rpx;
font-weight: bold;
color: #333;
}
}
.function-grid {
display: flex;
justify-content: space-around;
.function-item {
text-align: center;
flex: 1;
.function-icon {
width: 80rpx;
height: 80rpx;
background: #f5f5f5;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 20rpx;
.function-img {
width: 50rpx;
height: 50rpx;
}
}
.function-text {
font-size: 24rpx;
color: #333;
}
}
}
}
</style>