From ebcbe63d9b0ae095e6cb6002c6564f6603b30536 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Tue, 22 Aug 2023 11:01:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8=EF=BC=9A?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=87=8D=E6=9E=84=20=E2=91=A3=20=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E6=B5=8B=E8=AF=95=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Login/components/LoginForm.vue | 3 - src/views/mall/trade/order/detail/index.vue | 7 - src/views/mall/trade/order/index.vue | 18 +-- src/views/mall/trade/order/testData.ts | 169 -------------------- 4 files changed, 3 insertions(+), 194 deletions(-) delete mode 100644 src/views/mall/trade/order/testData.ts diff --git a/src/views/Login/components/LoginForm.vue b/src/views/Login/components/LoginForm.vue index 87880328..ffadf8b5 100644 --- a/src/views/Login/components/LoginForm.vue +++ b/src/views/Login/components/LoginForm.vue @@ -148,8 +148,6 @@ import { ElLoading } from 'element-plus' import LoginFormTitle from './LoginFormTitle.vue' import type { RouteLocationNormalizedLoaded } from 'vue-router' -// import { CACHE_KEY, useCache } from '@/hooks/web/useCache' -// const { wsCache } = useCache() import { useIcon } from '@/hooks/web/useIcon' import * as authUtil from '@/utils/auth' @@ -246,7 +244,6 @@ const handleLogin = async (params) => { if (!res) { return } - // wsCache.delete(CACHE_KEY.USER) // 清除上次登录用户信息 ElLoading.service({ lock: true, text: '正在加载系统中...', diff --git a/src/views/mall/trade/order/detail/index.vue b/src/views/mall/trade/order/detail/index.vue index dc5e4bcc..c72dd166 100644 --- a/src/views/mall/trade/order/detail/index.vue +++ b/src/views/mall/trade/order/detail/index.vue @@ -46,9 +46,7 @@ 调整价格 - 备注 - 发货 修改地址 @@ -354,11 +352,6 @@ const getDetail = async () => { const id = params.orderId as unknown as number if (id) { const res = (await TradeOrderApi.getOrder(id)) as TradeOrderApi.OrderVO - // TODO 测试使用 - res.user = { - id: 247, - nickname: '小妮子' - } orderInfo.value = res } } diff --git a/src/views/mall/trade/order/index.vue b/src/views/mall/trade/order/index.vue index 72ef6cac..e350d88b 100644 --- a/src/views/mall/trade/order/index.vue +++ b/src/views/mall/trade/order/index.vue @@ -268,8 +268,6 @@ import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' import { formatToFraction } from '@/utils' import { createImageViewer } from '@/components/ImageViewer' -// const message = useMessage() // 消息弹窗 -// const { t } = useI18n() // 国际化 const { currentRoute, push } = useRouter() // 路由跳转 const loading = ref(true) // 列表的加载中 @@ -362,16 +360,7 @@ const getList = async () => { loading.value = true try { const data = await TradeOrderApi.getOrderPage(queryParams) - const list_ = data.list as OrderVO[] - // TODO 测试使用 - list_.forEach((item) => { - item.user = { - id: 247, - nickname: '小妮子' - } - }) - - list.value = list_ + list.value = data.list total.value = data.total } finally { loading.value = false @@ -399,8 +388,7 @@ watch( ) /** 初始化 **/ -onMounted(() => { - // list.value = testData - getList() +onMounted(async () => { + await getList() }) diff --git a/src/views/mall/trade/order/testData.ts b/src/views/mall/trade/order/testData.ts deleted file mode 100644 index d4c92a15..00000000 --- a/src/views/mall/trade/order/testData.ts +++ /dev/null @@ -1,169 +0,0 @@ -import { OrderVO } from '@/api/mall/trade/order' - -export const testData: OrderVO = [ - { - id: 2, - no: '20230817002', - createTime: new Date('2023-08-17T11:30:00'), - type: 2, - terminal: 10, - userId: 1002, - userIp: '192.168.1.2', - userRemark: 'Urgent delivery required', - status: 20, - productCount: 2, - finishTime: null, - cancelTime: null, - cancelType: null, - remark: '', - payOrderId: 10002, - payed: false, - payTime: new Date('2023-08-17T12:30:00'), - payChannelCode: 'wx_app', - originalPrice: 80, - orderPrice: 80, - discountPrice: 0, - deliveryPrice: 5, - adjustPrice: 0, - payPrice: 85, - deliveryTemplateId: 2002, - logisticsId: null, - logisticsNo: '', - deliveryStatus: 0, - deliveryTime: null, - receiveTime: null, - receiverName: '李四', - receiverMobile: '19855568989', - receiverAreaId: 4002, - receiverPostCode: 54321, - receiverDetailAddress: '翻斗花园', - afterSaleStatus: 0, - refundPrice: 0, - couponId: null, - couponPrice: 0, - pointPrice: 0, - receiverAreaName: '北京市朝阳区', - items: [ - { - id: 103, - userId: 1002, - orderId: 2, - spuId: 5003, - spuName: '毛绒鸭子', - skuId: 6003, - picUrl: - 'http://127.0.0.1:48080/admin-api/infra/file/5/get/20220723041544165856414464011_BIG.jpg', - count: 1, - originalPrice: 40, - originalUnitPrice: 40, - discountPrice: 0, - payPrice: 40, - orderPartPrice: 40, - orderDividePrice: 40, - afterSaleStatus: 0, - properties: [ - { propertyId: 7001, propertyName: '颜色', valueId: 8004, valueName: '黄色' }, - { propertyId: 7002, propertyName: '尺寸', valueId: 8002, valueName: '小鸭子' } - ] - }, - { - id: 104, - userId: 1002, - orderId: 2, - spuId: 5004, - spuName: '毛绒鸭子', - skuId: 6004, - picUrl: - 'http://127.0.0.1:48080/admin-api/infra/file/5/get/20220723041544165856414464011_BIG.jpg', - count: 1, - originalPrice: 40, - originalUnitPrice: 40, - discountPrice: 0, - payPrice: 40, - orderPartPrice: 40, - orderDividePrice: 40, - afterSaleStatus: 0, - properties: [ - { propertyId: 7001, propertyName: '颜色', valueId: 8004, valueName: '黄色' }, - { propertyId: 7002, propertyName: '尺寸', valueId: 8002, valueName: '大鸭子' } - ] - } - ], - user: { - id: 1002, - nickname: '小妮子', - avatar: 'https://example.com/images/avatar.jpg' - } - }, - { - id: 3, - no: '20230817003', - createTime: new Date('2023-08-17T12:00:00'), - type: 1, - terminal: 10, - userId: 1003, - userIp: '192.168.1.3', - userRemark: '', - status: 10, - productCount: 1, - finishTime: new Date('2023-08-18T09:15:00'), - cancelTime: null, - cancelType: null, - remark: '', - payOrderId: 10003, - payed: true, - payTime: new Date('2023-08-17T12:30:00'), - payChannelCode: 'alipay_app', - originalPrice: 25, - orderPrice: 20, - discountPrice: 5, - deliveryPrice: 5, - adjustPrice: 0, - payPrice: 20, - deliveryTemplateId: 2001, - logisticsId: 3002, - logisticsNo: 'DEF987654', - deliveryStatus: 2, - deliveryTime: new Date('2023-08-18T10:30:00'), - receiveTime: new Date('2023-08-19T11:30:00'), - receiverName: '张三', - receiverMobile: '13988886656', - receiverAreaId: 4003, - receiverPostCode: 67890, - receiverDetailAddress: '成华大道', - afterSaleStatus: 0, - refundPrice: 0, - couponId: 2001, - couponPrice: 5, - pointPrice: 0, - receiverAreaName: '四川省成都市', - items: [ - { - id: 105, - userId: 1003, - orderId: 3, - spuId: 5005, - spuName: '华为', - skuId: 6005, - picUrl: 'http://127.0.0.1:48080/admin-api/infra/file/5/get/sj.jpg', - count: 1, - originalPrice: 20, - originalUnitPrice: 20, - discountPrice: 5, - payPrice: 15, - orderPartPrice: 15, - orderDividePrice: 15, - afterSaleStatus: 0, - properties: [ - { propertyId: 7001, propertyName: '颜色', valueId: 8006, valueName: '紫色' }, - { propertyId: 7002, propertyName: '选配', valueId: 8002, valueName: '标配' } - ] - } - ], - user: { - id: 1003, - nickname: '无敌最俊朗', - avatar: 'https://example.com/images/avatar.jpg' - } - } -]