shop-web/src/pages/me/index.vue

83 lines
2.4 KiB
Vue
Raw Normal View History

2025-03-05 09:22:29 +08:00
<script setup lang="ts">
2025-03-31 09:42:26 +08:00
import { useRouter } from 'vue-router'
2025-04-02 09:33:47 +08:00
import { useWxStore } from '@/pinia/stores/wx'
import { computed } from 'vue'
2025-03-05 09:22:29 +08:00
const router = useRouter()
2025-04-02 09:33:47 +08:00
const wxStore = useWxStore()
const balance = computed(() => wxStore.balance)
2025-03-05 09:22:29 +08:00
</script>
<template>
<div un-py-16px>
2025-03-31 09:42:26 +08:00
<!-- 用户信息区域 -->
<van-cell-group class="user-card">
<van-cell :border="false">
2025-03-05 09:22:29 +08:00
<template #title>
2025-03-31 09:42:26 +08:00
<div class="flex items-center p-4">
<van-image
round
width="80"
height="80"
src="/img/1.jpg"
class="mr-4"
/>
<div>
<div class="text-lg font-bold mb-2">{{ '' }}</div>
<van-tag type="primary" class="mr-2">{{ 20 }}</van-tag>
<van-tag type="success">{{ '男' }}</van-tag>
2025-03-05 09:22:29 +08:00
</div>
</div>
</template>
</van-cell>
</van-cell-group>
2025-03-31 09:42:26 +08:00
<!-- 功能按钮区域 -->
<van-grid :column-num="4" :gutter="12" class="func-buttons un-mt-20px">
<van-grid-item
v-for="(item, index) in [
2025-04-02 09:33:47 +08:00
{ icon: 'idcard', text: '身份证', color: 'transparent' },
{ icon: 'phone-o', text: '手机号', color: 'transparent' },
{ icon: 'wechat', text: '微信', color: 'transparent' },
{ icon: 'card', text: '银行卡', color: 'transparent' }
2025-03-31 09:42:26 +08:00
]"
:key="index"
>
<van-icon
:name="item.icon"
size="28px"
:style="{ background: item.color }"
class="un-p-8px un-rounded-full un-text-white"
/>
<div class="un-mt-8px un-text-12px un-color-hex-666">{{ item.text }}</div>
</van-grid-item>
</van-grid>
<!-- 余额区域 -->
<van-cell
title="账户余额"
2025-04-02 09:33:47 +08:00
:value="`¥${balance}`"
2025-03-31 09:42:26 +08:00
class="un-mt-16px! un-rounded-8px!"
title-class="un-text-14px! un-color-hex-333!"
value-class="un-text-16px! un-fw-600! un-color-primary!"
>
<template #icon>
<van-icon
name="gold-coin"
size="20px"
class="un-mr-8px un-color-#ffb300!"
/>
</template>
</van-cell>
<!-- 个人中心按钮 -->
<van-cell-group>
<van-cell title="订单列表" is-link @click="router.push('/order-list')" />
2025-03-05 09:22:29 +08:00
</van-cell-group>
</div>
</template>
2025-03-31 09:42:26 +08:00
<style scoped>
/* 移除了已迁移到组件的样式 */
</style>