diff --git a/xuan-deduct-uniapp/src/pages/mine/mine.vue b/xuan-deduct-uniapp/src/pages/mine/mine.vue
index d8ded45..c51ba58 100644
--- a/xuan-deduct-uniapp/src/pages/mine/mine.vue
+++ b/xuan-deduct-uniapp/src/pages/mine/mine.vue
@@ -4,11 +4,18 @@
👤
- 玄机用户
- 金币:{{ coins }}
+
+
+ 玄机用户
+
+ {{ vipText }}
+
+
+ 金币:{{ coins }}
+
-
+
👑
@@ -51,7 +58,7 @@ export default {
data() {
return {
coins: 10,
- isVip: false,
+ vipLevel: 0,
menus: [
{ name: '开通会员', icon: '👑', path: '/pages/mine/vip' },
{ name: '金币任务', icon: '🪙', path: '/pages/mine/coins' },
@@ -62,8 +69,18 @@ export default {
]
}
},
+ computed: {
+ vipText() {
+ const texts = ['普通用户', '月度会员', '年度会员', '永久会员']
+ return texts[this.vipLevel] || '普通用户'
+ },
+ vipClass() {
+ const classes = ['normal', 'monthly', 'yearly', 'permanent']
+ return classes[this.vipLevel] || 'normal'
+ }
+ },
onShow() {
- this.loadCoins()
+ this.loadUserData()
},
onShareAppMessage() {
return {
@@ -73,11 +90,15 @@ export default {
}
},
methods: {
- loadCoins() {
+ loadUserData() {
const coins = uni.getStorageSync('userCoins')
if (coins) {
this.coins = parseInt(coins)
}
+ const vipLevel = uni.getStorageSync('vipLevel')
+ if (vipLevel) {
+ this.vipLevel = parseInt(vipLevel)
+ }
},
openVip() {
uni.navigateTo({ url: '/pages/mine/vip' })
@@ -135,12 +156,52 @@ page {
font-size: 60rpx;
}
+.user-info {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+
+.user-name-row {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin-bottom: 8rpx;
+}
+
.username {
font-size: 36rpx;
font-weight: 700;
color: #ffffff;
- display: block;
- margin-bottom: 8rpx;
+}
+
+.vip-tag {
+ margin-left: 16rpx;
+ padding: 6rpx 16rpx;
+ border-radius: 20rpx;
+ font-size: 22rpx;
+}
+
+.vip-tag.normal {
+ background: rgba(255, 255, 255, 0.2);
+}
+
+.vip-tag.monthly {
+ background: linear-gradient(135deg, #FCD34D 0%, #F59E0B 100%);
+}
+
+.vip-tag.yearly {
+ background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
+}
+
+.vip-tag.permanent {
+ background: linear-gradient(135deg, #EC4899 0%, #DB2777 100%);
+}
+
+.vip-tag-text {
+ font-size: 22rpx;
+ font-weight: 500;
+ color: #ffffff;
}
.user-coins {
diff --git a/xuan-deduct-uniapp/src/pages/mine/vip.vue b/xuan-deduct-uniapp/src/pages/mine/vip.vue
index ec4fc71..f3d571a 100644
--- a/xuan-deduct-uniapp/src/pages/mine/vip.vue
+++ b/xuan-deduct-uniapp/src/pages/mine/vip.vue
@@ -80,9 +80,24 @@ export default {
},
methods: {
subscribe() {
- uni.showToast({
- title: '功能开发中',
- icon: 'none'
+ const planNames = ['', '月度会员', '年度会员', '永久会员']
+ const planName = planNames[this.selectedPlan]
+
+ uni.showModal({
+ title: '确认开通',
+ content: `确定要开通${planName}吗?`,
+ success: (res) => {
+ if (res.confirm) {
+ uni.setStorageSync('vipLevel', this.selectedPlan)
+ uni.showToast({
+ title: '开通成功',
+ icon: 'success'
+ })
+ setTimeout(() => {
+ uni.navigateBack()
+ }, 1500)
+ }
+ }
})
},
openAgreement() {