|
@@ -1,18 +1,104 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view class="page-mine">
|
|
<view class="page-mine">
|
|
|
- <!-- 顶部标题卡片 -->
|
|
|
|
|
- <view class="page-title-card">
|
|
|
|
|
- <text class="page-title-text">量化选股大师</text>
|
|
|
|
|
|
|
+ <!-- User Info Card -->
|
|
|
|
|
+ <view class="user-card">
|
|
|
|
|
+ <view class="avatar-container">
|
|
|
|
|
+ <!-- Default avatar if not logged in or no avatar -->
|
|
|
|
|
+ <image
|
|
|
|
|
+ class="avatar"
|
|
|
|
|
+ :src="isLoggedIn && userInfo.avatarUrl ? userInfo.avatarUrl : '/static/images/tab_mine_active.png'"
|
|
|
|
|
+ mode="aspectFill"
|
|
|
|
|
+ ></image>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="user-info">
|
|
|
|
|
+ <text class="username">{{ isLoggedIn ? (userInfo.nickName || '微信用户') : '游客' }}</text>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="content-area">
|
|
|
|
|
- <text class="title">个人中心</text>
|
|
|
|
|
- <text class="sub">这里后续可以展示用户信息和设置</text>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <!-- Points Card -->
|
|
|
|
|
+ <view class="section-card">
|
|
|
|
|
+ <view class="card-header">
|
|
|
|
|
+ <view class="header-icon-box">
|
|
|
|
|
+ <text class="header-icon-text">🪙</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <text class="header-title">积分值</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="card-content points-content">
|
|
|
|
|
+ <text class="points-value">积分值:{{ isLoggedIn ? points : 0 }}</text>
|
|
|
|
|
+ <view class="points-actions">
|
|
|
|
|
+ <button class="mini-btn" @click="handleRecharge">充值</button>
|
|
|
|
|
+ <button class="mini-btn" @click="handleHistory">积分记录</button>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- Transaction Record Card -->
|
|
|
|
|
+ <view class="section-card">
|
|
|
|
|
+ <view class="card-header">
|
|
|
|
|
+ <view class="header-icon-box">
|
|
|
|
|
+ <text class="header-icon-text">📝</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <text class="header-title">交易记录</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="card-content transaction-content">
|
|
|
|
|
+ <text class="empty-text">暂无交易记录</text>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- Login/Logout Button -->
|
|
|
|
|
+ <view class="action-area">
|
|
|
|
|
+ <button class="main-btn" @click="toggleLogin">
|
|
|
|
|
+ {{ isLoggedIn ? '退出登录' : '登录' }}
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-// Logic for mine page
|
|
|
|
|
|
|
+import { ref } from 'vue'
|
|
|
|
|
+
|
|
|
|
|
+const isLoggedIn = ref(false)
|
|
|
|
|
+const userInfo = ref({
|
|
|
|
|
+ nickName: '',
|
|
|
|
|
+ avatarUrl: ''
|
|
|
|
|
+})
|
|
|
|
|
+const points = ref(900)
|
|
|
|
|
+
|
|
|
|
|
+const toggleLogin = () => {
|
|
|
|
|
+ if (isLoggedIn.value) {
|
|
|
|
|
+ // Logout
|
|
|
|
|
+ isLoggedIn.value = false
|
|
|
|
|
+ userInfo.value = { nickName: '', avatarUrl: '' }
|
|
|
|
|
+ uni.showToast({ title: '已退出登录', icon: 'none' })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // Login Simulation
|
|
|
|
|
+ // In a real app, use uni.getUserProfile or similar
|
|
|
|
|
+ isLoggedIn.value = true
|
|
|
|
|
+ userInfo.value = {
|
|
|
|
|
+ nickName: '测试用户',
|
|
|
|
|
+ // Using a placeholder or one of the existing images as a mock avatar
|
|
|
|
|
+ avatarUrl: '/static/images/tab_mine_active.png'
|
|
|
|
|
+ }
|
|
|
|
|
+ uni.showToast({ title: '登录成功', icon: 'success' })
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const handleRecharge = () => {
|
|
|
|
|
+ if (!isLoggedIn.value) {
|
|
|
|
|
+ uni.showToast({ title: '请先登录', icon: 'none' })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ uni.showToast({ title: '充值功能开发中', icon: 'none' })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const handleHistory = () => {
|
|
|
|
|
+ if (!isLoggedIn.value) {
|
|
|
|
|
+ uni.showToast({ title: '请先登录', icon: 'none' })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ uni.showToast({ title: '记录功能开发中', icon: 'none' })
|
|
|
|
|
+}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
<style>
|
|
@@ -21,34 +107,148 @@
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
background: #f5f6fb;
|
|
background: #f5f6fb;
|
|
|
min-height: 100vh;
|
|
min-height: 100vh;
|
|
|
|
|
+ padding: 30rpx;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-.page-title-card {
|
|
|
|
|
|
|
+/* User Card */
|
|
|
|
|
+.user-card {
|
|
|
background: #ffffff;
|
|
background: #ffffff;
|
|
|
- padding: 30rpx 0;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.08);
|
|
|
|
|
- border-radius: 0;
|
|
|
|
|
|
|
+ border-radius: 20rpx;
|
|
|
|
|
+ padding: 40rpx;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
|
|
|
|
|
+ margin-bottom: 30rpx;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-.content-area {
|
|
|
|
|
- padding: 32rpx;
|
|
|
|
|
|
|
+.avatar-container {
|
|
|
|
|
+ width: 120rpx;
|
|
|
|
|
+ height: 120rpx;
|
|
|
|
|
+ border-radius: 50%;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ background-color: #eee;
|
|
|
|
|
+ flex-shrink: 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-.page-title-text {
|
|
|
|
|
- font-size: 36rpx;
|
|
|
|
|
- font-weight: 800;
|
|
|
|
|
- color: #3F51F7;
|
|
|
|
|
- letter-spacing: 2rpx;
|
|
|
|
|
|
|
+.avatar {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.user-info {
|
|
|
|
|
+ margin-left: 30rpx;
|
|
|
|
|
+ flex: 1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-.title {
|
|
|
|
|
|
|
+.username {
|
|
|
font-size: 36rpx;
|
|
font-size: 36rpx;
|
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
|
- margin-bottom: 20rpx;
|
|
|
|
|
|
|
+ color: #333;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/* Section Cards */
|
|
|
|
|
+.section-card {
|
|
|
|
|
+ background: #ffffff;
|
|
|
|
|
+ border-radius: 20rpx;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
|
|
|
|
|
+ margin-bottom: 30rpx;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.card-header {
|
|
|
|
|
+ background: #3F51F7; /* Main Blue */
|
|
|
|
|
+ padding: 20rpx 30rpx;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.header-icon-box {
|
|
|
|
|
+ width: 40rpx;
|
|
|
|
|
+ height: 40rpx;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ margin-right: 15rpx;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.header-icon-text {
|
|
|
|
|
+ font-size: 32rpx;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.header-title {
|
|
|
|
|
+ color: #ffffff;
|
|
|
|
|
+ font-size: 32rpx;
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.card-content {
|
|
|
|
|
+ padding: 30rpx;
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/* Points Content */
|
|
|
|
|
+.points-content {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.points-value {
|
|
|
|
|
+ font-size: 32rpx;
|
|
|
|
|
+ color: #333;
|
|
|
|
|
+ font-weight: 500;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.points-actions {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ gap: 20rpx;
|
|
|
}
|
|
}
|
|
|
-.sub {
|
|
|
|
|
|
|
+
|
|
|
|
|
+.mini-btn {
|
|
|
|
|
+ background: #3F51F7;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ font-size: 24rpx;
|
|
|
|
|
+ padding: 10rpx 30rpx;
|
|
|
|
|
+ border-radius: 30rpx;
|
|
|
|
|
+ line-height: 2;
|
|
|
|
|
+ margin: 0;
|
|
|
|
|
+ border: none;
|
|
|
|
|
+}
|
|
|
|
|
+.mini-btn::after {
|
|
|
|
|
+ border: none;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/* Transaction Content */
|
|
|
|
|
+.transaction-content {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ padding: 60rpx 30rpx;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.empty-text {
|
|
|
|
|
+ color: #999;
|
|
|
font-size: 28rpx;
|
|
font-size: 28rpx;
|
|
|
- color: #888;
|
|
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/* Bottom Action */
|
|
|
|
|
+.action-area {
|
|
|
|
|
+ margin-top: 40rpx;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.main-btn {
|
|
|
|
|
+ background: #3F51F7;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ font-size: 32rpx;
|
|
|
|
|
+ border-radius: 50rpx;
|
|
|
|
|
+ padding: 10rpx 0;
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ box-shadow: 0 4rpx 10rpx rgba(63, 81, 247, 0.3);
|
|
|
|
|
+ line-height: 2.5;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.main-btn:active {
|
|
|
|
|
+ opacity: 0.9;
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|