From cc774ae204bcf6d2e1653806c53b028a8eb70d0b Mon Sep 17 00:00:00 2001 From: chenghuan Date: Wed, 26 Nov 2025 14:55:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=8F=8A=E8=AE=A2=E5=8D=95=E4=BC=98=E6=83=A0=E4=BB=B7=E6=A0=BC?= =?UTF-8?q?=EF=BC=9B=E6=94=AF=E4=BB=98=E8=AF=B4=E6=98=8E=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/modules/order.ts | 5 +- components/order/Confirm.vue | 332 ++++++++++++----------------- components/order/GoodsPrice.vue | 72 +++++++ components/order/GoodsSelector.vue | 90 +------- components/order/PayWay.vue | 28 +-- components/order/ProductInfo.vue | 2 +- locale/en.json | 20 +- locale/zh-Hans.json | 18 +- pages/book/index.vue | 2 +- pages/order/goodsConfirm.vue | 68 +----- pages/user/index.vue | 2 +- pages/user/order/index.vue | 2 +- pages/user/recharge/index.vue | 2 +- types/order.d.ts | 8 + 14 files changed, 271 insertions(+), 380 deletions(-) create mode 100644 components/order/GoodsPrice.vue diff --git a/api/modules/order.ts b/api/modules/order.ts index 2b66a02..b933e21 100644 --- a/api/modules/order.ts +++ b/api/modules/order.ts @@ -8,7 +8,8 @@ import type { IOrderGoods, ICoupon, ICourseOrderCreateParams, - IOrderInitData + IOrderInitData, + IGoodsDiscountParams } from '@/types/order' import type { IUserInfo } from '@/types/user' @@ -108,7 +109,7 @@ export const orderApi = { * 获取地区优惠金额 * @param productList 商品列表 */ - async getDistrictAmount(productList: Array<{ productId: number; quantity: number }>) { + async getDistrictAmount(productList: IGoodsDiscountParams[]) { const res = await mainClient.request>({ url: 'book/buyOrder/getDistrictAmount', method: 'POST', diff --git a/components/order/Confirm.vue b/components/order/Confirm.vue index 68fb531..cfb1f0a 100644 --- a/components/order/Confirm.vue +++ b/components/order/Confirm.vue @@ -26,53 +26,47 @@ {{ $t('order.totalPrice') }} - {{ totalPrice.toFixed(2) }} 天医币 + {{ totalAmount.toFixed(2) }} {{ t('global.coin') }} - - {{ $t('order.activityDiscount') }} - -¥{{ activityDiscountAmount.toFixed(2) }} + + {{ $t('order.promotionDiscounted') }} + -{{ promotionDiscounted.toFixed(2) }} {{ t('global.coin') }} - + VIP {{ $t('order.vipDiscount') }} - -¥{{ vipPrice.toFixed(2) }} - - - - - {{ $t('order.districtDiscount') }} - -¥{{ districtAmount.toFixed(2) }} + -{{ vipDiscounted.toFixed(2) }} {{ t('global.coin') }} - + {{ $t('order.points') }} - ({{ $t('order.allPoints') }}:{{ userInfo.jf }}) + ({{ $t('order.allPoints') }}:{{ userInfo?.jf || 0 }}) - -{{ jfNumber.toFixed(2) }} + -{{ pointsDiscounted.toFixed(2) }} - + - {{ $t('order.maxPoints', { max: jfNumberMax }) }} + {{ $t('order.maxPoints', { max: pointsUsableMax }) }} {{ $t('order.total') }}: - {{ actualPayment.toFixed(2) }} 天医币 + {{ finalAmount }} {{ t('global.coin') }} {{ $t('order.submit') }} @@ -120,7 +114,7 @@ - {{ $t('global.ok') }} + {{ $t('global.ok') }} @@ -128,93 +122,66 @@ + + \ No newline at end of file diff --git a/components/order/GoodsSelector.vue b/components/order/GoodsSelector.vue index 1e82068..c5ace12 100644 --- a/components/order/GoodsSelector.vue +++ b/components/order/GoodsSelector.vue @@ -2,18 +2,14 @@ {{ goods[selectedIndex].productName }} - - {{ selectedGoodsPrice.lowestPrice }} 天医币 - {{ selectedGoodsPrice.priceLabel }} - {{ goods[selectedIndex].price }} 天医币 - + + @@ -32,11 +28,8 @@ {{ item.productName }} - - {{ calculatePrice(item).lowestPrice }} 天医币 - {{ calculatePrice(item).priceLabel }} - {{ item.price }} 天医币 - + + @@ -52,12 +45,10 @@