feat: add status
This commit is contained in:
@@ -34,10 +34,12 @@ const first = ref(0);
|
|||||||
const rows = ref(10);
|
const rows = ref(10);
|
||||||
|
|
||||||
const orderStatusMap = {
|
const orderStatusMap = {
|
||||||
0: { label: '待支付', severity: 'warning' },
|
'pending': { label: '待支付', severity: 'warning' },
|
||||||
1: { label: '已支付', severity: 'success' },
|
'paid': { label: '已支付', severity: 'success' },
|
||||||
2: { label: '已退款', severity: 'info' },
|
'refunding': { label: '退款中', severity: 'help' },
|
||||||
3: { label: '已取消', severity: 'danger' }
|
'refunded': { label: '已退款', severity: 'info' },
|
||||||
|
'cancelled': { label: '已取消', severity: 'danger' },
|
||||||
|
'completed': { label: '已完成', severity: 'success' }
|
||||||
};
|
};
|
||||||
|
|
||||||
const formatPrice = (price) => {
|
const formatPrice = (price) => {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export function useWxSDK() {
|
|||||||
"chooseImage",
|
"chooseImage",
|
||||||
"uploadImage",
|
"uploadImage",
|
||||||
"previewImage",
|
"previewImage",
|
||||||
"updateAppMessageShareData",
|
"updateTimelineShareData",
|
||||||
"updateAppMessageShareData",
|
"updateAppMessageShareData",
|
||||||
"chooseWXPay",
|
"chooseWXPay",
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,12 +1,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { userApi } from '@/api/userApi';
|
import { userApi } from "@/api/userApi";
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from "vue";
|
||||||
import {
|
import { BsBox2Fill, BsGearFill, BsPersonFill, BsPinMapFill } from "vue-icons-plus/bs";
|
||||||
BsBox2Fill,
|
|
||||||
BsGearFill,
|
|
||||||
BsPersonFill,
|
|
||||||
BsPinMapFill
|
|
||||||
} from 'vue-icons-plus/bs';
|
|
||||||
|
|
||||||
const userInfo = ref({});
|
const userInfo = ref({});
|
||||||
|
|
||||||
@@ -14,37 +9,32 @@ onMounted(async () => {
|
|||||||
try {
|
try {
|
||||||
const { data } = await userApi.profile();
|
const { data } = await userApi.profile();
|
||||||
userInfo.value = data;
|
userInfo.value = data;
|
||||||
console.log('User profile:', userInfo.value);
|
console.log("User profile:", userInfo.value);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to fetch user profile:', error);
|
console.error("Failed to fetch user profile:", error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const menuGroups = [
|
const menuGroups = [
|
||||||
{
|
{
|
||||||
title: '账号与信息',
|
title: "账号与信息",
|
||||||
items: [
|
items: [{ label: "个人资料", icon: BsPersonFill, link: "/profile/edit" }],
|
||||||
{ label: '个人资料', icon: BsPersonFill, link: '/profile/edit' },
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '订单与服务',
|
title: "订单与服务",
|
||||||
items: [
|
items: [
|
||||||
{ label: '我的订单', icon: BsBox2Fill, link: '/orders' },
|
{ label: "我的订单", icon: BsBox2Fill, link: "/orders" },
|
||||||
{ label: '我的地址', icon: BsPinMapFill, link: '/address' },
|
{ label: "我的地址", icon: BsPinMapFill, link: "/address" },
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '设置',
|
title: "设置",
|
||||||
items: [
|
items: [{ label: "系统设置", icon: BsGearFill, link: "/settings" }],
|
||||||
{ label: '系统设置', icon: BsGearFill, link: '/settings' },
|
},
|
||||||
]
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
||||||
<div class="bg-white p-4 shadow-lg border-b border-gray-300">
|
<div class="bg-white p-4 shadow-lg border-b border-gray-300">
|
||||||
<div class="flex items-center gap-4 p-4 border-gray-100">
|
<div class="flex items-center gap-4 p-4 border-gray-100">
|
||||||
<div class="w-16 h-16 border rounded-full border-gray-200 bg-gray-200 overflow-hidden">
|
<div class="w-16 h-16 border rounded-full border-gray-200 bg-gray-200 overflow-hidden">
|
||||||
@@ -71,5 +61,4 @@ const menuGroups = [
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user