feat: connect comprehensive profile and stored value payment
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
<view v-if="session.member?.phone" class="hero-sub-row">
|
||||
<text class="hero-phone">{{ session.member.phone }}</text>
|
||||
</view>
|
||||
<text class="hero-balance">余额 ¥{{ balanceText }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="hero-right">
|
||||
@@ -71,25 +72,40 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, onMounted } from 'vue'
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { useComprehensiveSessionStore } from '@/modules/comprehensive/stores/session'
|
||||
import { memberApi } from '@/modules/comprehensive/api/member'
|
||||
import { formatAmount } from '@/modules/comprehensive/utils/money'
|
||||
import VenueTabBar from '@/components/VenueTabBar.vue'
|
||||
import AgreementLinks from '@/components/AgreementLinks.vue'
|
||||
import UnauthLoginPanel from '@/components/UnauthLoginPanel.vue'
|
||||
|
||||
const session = useComprehensiveSessionStore()
|
||||
const avatarInitial = computed(() => (session.member?.nickname || '用户').slice(0, 1))
|
||||
const balance = ref('0.00')
|
||||
const balanceText = computed(() => formatAmount(balance.value))
|
||||
|
||||
const menuItems = [
|
||||
{ title: '包场预约', url: '/pages/comprehensive/private/index', theme: 'private-theme', icon: 'private' },
|
||||
{ title: '篮球门票', url: '/pages/comprehensive/tickets/index', theme: 'ticket-theme', icon: 'ticket' },
|
||||
{ title: '商城', url: '/pages/comprehensive/mall/index', theme: 'order-theme', icon: 'order' },
|
||||
{ title: '充值', url: '/pages/comprehensive/mall/index', theme: 'order-theme', icon: 'order' },
|
||||
{ title: '我的次卡', url: '/pages/comprehensive/membership/cards', theme: 'profile-theme', icon: 'profile' },
|
||||
{ title: '我的订单', url: '/pages/comprehensive/profile/orders', theme: 'order-theme', icon: 'order' },
|
||||
{ title: '余额流水', url: '/pages/comprehensive/profile/balance', theme: 'order-theme', icon: 'order' },
|
||||
{ title: '消费记录', url: '/pages/comprehensive/profile/orders', theme: 'order-theme', icon: 'order' },
|
||||
{ title: '个人信息', url: '/pages/comprehensive/profile/detail', theme: 'profile-theme', icon: 'profile' },
|
||||
{ title: '切换场馆', url: '/pages/venue-select/index?mode=switch', theme: 'profile-theme', icon: 'profile' }
|
||||
]
|
||||
|
||||
onMounted(async () => {
|
||||
await session.init()
|
||||
try {
|
||||
const data = await memberApi.getBalance()
|
||||
balance.value = data.balance
|
||||
} catch {
|
||||
balance.value = '0.00'
|
||||
}
|
||||
})
|
||||
|
||||
const login = async () => {
|
||||
@@ -159,6 +175,7 @@ const go = (url) => {
|
||||
|
||||
.hero-name,
|
||||
.hero-phone,
|
||||
.hero-balance,
|
||||
.menu-title {
|
||||
display: block;
|
||||
}
|
||||
@@ -176,6 +193,13 @@ const go = (url) => {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.hero-balance {
|
||||
margin-top: 4rpx;
|
||||
color: $color-primary;
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.hero-arrow,
|
||||
.menu-arrow {
|
||||
width: 18rpx;
|
||||
|
||||
Reference in New Issue
Block a user