fix: vip info

This commit is contained in:
zzc
2026-01-30 17:24:10 +08:00
parent 18c6167bee
commit 360947e0fc

View File

@@ -34,9 +34,13 @@
<view class="user-info"> <view class="user-info">
<view class="name-row"> <view class="name-row">
<text class="username">{{ userInfo.nickName || "微信用户" }}</text> <text class="username">{{ userInfo.nickName || "微信用户" }}</text>
<view class="vip-tag">VIP 祥瑞会员</view> <view class="vip-tag" v-if="userInfo.isVip">VIP 祥瑞会员</view>
<view class="vip-tag gray" v-else>普通用户</view>
</view> </view>
<text class="expiry-date">2026-02-15 到期</text> <text class="expiry-date" v-if="userInfo.isVip">
{{ userInfo.vipExpireAt }} 到期
</text>
<text class="expiry-date" v-else>开通会员解锁专属权益</text>
</view> </view>
</view> </view>
@@ -114,6 +118,7 @@
<script setup> <script setup>
import { ref, onMounted } from "vue"; import { ref, onMounted } from "vue";
import { storeToRefs } from "pinia";
import { import {
getBavBarHeight, getBavBarHeight,
@@ -125,7 +130,7 @@ import { createOrder, getVipPlan } from "@/api/pay.js";
const navBarHeight = getBavBarHeight(); const navBarHeight = getBavBarHeight();
const statusBarHeight = getStatus(); const statusBarHeight = getStatus();
const userStore = useUserStore(); const userStore = useUserStore();
const userInfo = userStore.userInfo; const { userInfo } = storeToRefs(userStore);
const selectedPlanIndex = ref(1); const selectedPlanIndex = ref(1);
@@ -339,6 +344,11 @@ const handlePurchase = async () => {
padding: 2rpx 10rpx; padding: 2rpx 10rpx;
border-radius: 20rpx; border-radius: 20rpx;
font-weight: 500; font-weight: 500;
&.gray {
background: rgba(0, 0, 0, 0.05);
color: #666;
}
} }
.expiry-date { .expiry-date {