diff --git a/.env b/.env index 389397f..db4e7e9 100644 --- a/.env +++ b/.env @@ -7,4 +7,4 @@ VITE_APP_TITLE = 借还柜 VITE_ROUTER_HISTORY = hash ## 是否开启 console 调试工具 -VITE_CONSOLE = false +VITE_CONSOLE = true diff --git a/.env.development b/.env.development index 63acfaa..391194a 100644 --- a/.env.development +++ b/.env.development @@ -5,3 +5,6 @@ VITE_BASE_URL = http://localhost:8090/api ## 开发环境域名和静态资源公共路径(一般 / 或 ./ 都可以) VITE_PUBLIC_PATH = / + +# 后端地址 +VITE_APP_BASE_API = '/dev-api' \ No newline at end of file diff --git a/.env.production b/.env.production index eda4c37..447265b 100644 --- a/.env.production +++ b/.env.production @@ -4,3 +4,6 @@ VITE_BASE_URL = '/shop-api/api' ## 打包构建静态资源公共路径(例如部署到 https://un-pany.github.io/mobvue/ 域名下就需要填写 /mobvue/) VITE_PUBLIC_PATH = /shop/ + +# 后端地址 +VITE_APP_BASE_API = '/shop-back-end' \ No newline at end of file diff --git a/.env.staging b/.env.staging index 039f057..6eb62b3 100644 --- a/.env.staging +++ b/.env.staging @@ -5,3 +5,6 @@ VITE_BASE_URL = '/shop-api/api' ## 打包构建静态资源公共路径(例如部署到 https://un-pany.github.io/ 域名下就需要填写 /) VITE_PUBLIC_PATH = /shop/ + +# 后端地址 +VITE_APP_BASE_API = '/shop-back-end' \ No newline at end of file diff --git a/src/common/apis/approval/type.ts b/src/common/apis/approval/type.ts index 3d771b2..11e1de1 100644 --- a/src/common/apis/approval/type.ts +++ b/src/common/apis/approval/type.ts @@ -1,6 +1,5 @@ export interface SubmitApprovalRequestData { - orderId: number - goodsId: number + orderGoodsId: number returnQuantity: number returnImages: string } diff --git a/src/pages/approval/submit.vue b/src/pages/approval/submit.vue index a83f49a..6c2d2eb 100644 --- a/src/pages/approval/submit.vue +++ b/src/pages/approval/submit.vue @@ -1,132 +1,162 @@ - - router.go(-1)" - /> + + router.go(-1)" /> - - - - - + + + + + - - - - - - - + + + + + + + - - - 提交申请 - - + + + 提交申请 + + + - \ No newline at end of file diff --git a/src/pages/order/index.vue b/src/pages/order/index.vue index 5a43bc5..aace50f 100644 --- a/src/pages/order/index.vue +++ b/src/pages/order/index.vue @@ -30,13 +30,22 @@ const order = computed(() => { return orderStore.orders.find(o => o.orderId === orderId.value) }) +const orderGoodsStatusMap: Record = { + 5: '审核中', + 2: '已退货', + 6: '退货未通过' +} + +const getOrderGoodsStatusText = (status: number) => { + return orderGoodsStatusMap[status] || '' +} + const handleRefund = (item: any) => { - if (order.value?.status !== 4) return router.push({ path: '/approval/submit', query: { - goodsId: item.goodsInfo.goodsId, - orderId: order.value.orderId + orderGoodsId: item.orderGoods.orderGoodsId, + orderId: orderId.value, } }) } @@ -85,15 +94,23 @@ onMounted(() => { 数量: {{ item.orderGoods.quantity }} 小计: ¥{{ (item.orderGoods.price * item.orderGoods.quantity).toFixed(2) }} + 退还 + + + {{ getOrderGoodsStatusText(item.orderGoods.status) }} + @@ -171,12 +188,15 @@ goods-info { color: #fff; background: #ee0a24; border-radius: 15px; - padding: 0 12px; + padding: 8px 20px; + font-size: 14px; + min-width: 80px; } .action-row { display: flex; + flex-direction: column; gap: 8px; - align-items: center; + align-items: flex-end; } \ No newline at end of file diff --git a/types/auto/components.d.ts b/types/auto/components.d.ts index fbb744a..caa3761 100644 --- a/types/auto/components.d.ts +++ b/types/auto/components.d.ts @@ -30,5 +30,6 @@ declare module 'vue' { VanTabbar: typeof import('vant/es')['Tabbar'] VanTabbarItem: typeof import('vant/es')['TabbarItem'] VanTag: typeof import('vant/es')['Tag'] + VanUploader: typeof import('vant/es')['Uploader'] } }
数量: {{ item.orderGoods.quantity }}
小计: ¥{{ (item.orderGoods.price * item.orderGoods.quantity).toFixed(2) }}