diff --git a/api/modules/book.ts b/api/modules/book.ts index 04bc42a..8d29166 100644 --- a/api/modules/book.ts +++ b/api/modules/book.ts @@ -11,6 +11,7 @@ import type { IComment, IReadProgress } from '@/types/book' +import type { IGoods } from '@/types/order' const client = createRequestClient({ baseURL: SERVICE_MAP.MAIN }) @@ -212,5 +213,17 @@ export const bookApi = { method: 'POST', data: { chapterId } }) - } + }, + + /** + * 获取购买商品信息 + * @param bookId 书籍ID + */ + getBookGoods(bookId: number) { + return client.request>({ + url: 'bookAbroad/home/getProductListForBook', + method: 'POST', + data: { bookId } + }) + }, } diff --git a/components/order/Confirm.vue b/components/order/Confirm.vue index e5148db..68fb531 100644 --- a/components/order/Confirm.vue +++ b/components/order/Confirm.vue @@ -137,7 +137,8 @@ import PayWay from '@/components/order/PayWay.vue' // 使用页面传参 interface Props { goodsList: IOrderGoods[], - userInfo: object + userInfo: object, + allowPointPay: boolean, } const props = withDefaults(defineProps(), { goodsList: () => [], @@ -320,7 +321,8 @@ const getAvailableCoupons = async () => { * 计算最终价格 */ const calculateFinalPrice = () => { - const couponAmount = selectedCoupon.value?.couponEntity.couponAmount || 0 + // const couponAmount = selectedCoupon.value?.couponEntity.couponAmount || 0 + const couponAmount = 0 // 计算最大可用积分 const orderAmountAfterDiscount = totalPrice.value - districtAmount.value - vipPrice.value diff --git a/components/order/GoodsSelector.vue b/components/order/GoodsSelector.vue index 92c0c72..1e82068 100644 --- a/components/order/GoodsSelector.vue +++ b/components/order/GoodsSelector.vue @@ -8,8 +8,12 @@ - {{ goods[selectedIndex].productName }} - {{ selectedGoodsPrice }} 天医币 + {{ goods[selectedIndex].productName }} + + {{ selectedGoodsPrice.lowestPrice }} 天医币 + {{ selectedGoodsPrice.priceLabel }} + {{ goods[selectedIndex].price }} 天医币 + @@ -27,24 +31,11 @@ {{ item.productName }} - - - - {{ parseFloat(item.vipPrice).toFixed(2) }} 天医币 - VIP优惠价 - {{ parseFloat(item.price).toFixed(2) }} 天医币 - - - - - {{ parseFloat(item.activityPrice).toFixed(2) }} 天医币 - 活动价 - {{ parseFloat(item.price).toFixed(2) }} 天医币 - - - - - {{ parseFloat(item.price).toFixed(2) }} 天医币 + + + {{ calculatePrice(item).lowestPrice }} 天医币 + {{ calculatePrice(item).priceLabel }} + {{ item.price }} 天医币 @@ -61,9 +52,12 @@