From 61e1e2939fb3e1175872263a187182055ab93dcd Mon Sep 17 00:00:00 2001 From: modendeveloper Date: Sun, 23 Feb 2025 23:22:33 +0800 Subject: [PATCH] =?UTF-8?q?Fix:3268=20=E3=80=90=E7=A4=BC=E5=93=81=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E3=80=91=E8=BF=9B=E5=85=A5=E9=80=81=E7=A4=BC=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E5=95=86=E5=93=81=E4=BB=B7=E6=A0=BC=E4=BC=9A?= =?UTF-8?q?=E5=8F=98=E6=88=900?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/gift.js | 8 ++++++++ pkg_user/views/gift/gift.vue | 28 +++++++++++++++++++++++++--- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/api/gift.js b/api/gift.js index 2c14841..a2dcbc5 100644 --- a/api/gift.js +++ b/api/gift.js @@ -39,4 +39,12 @@ export function getGiftCardReceive(data) { */ export function getGiftCardSendNotice(data) { return request.get("/giftCard/giftNotice", data); +} + +/** + * 计算订单金额 + * @param {*} data + */ +export function getGiftCardSendOrderAmount(key, data) { + return request.post("giftCard/computed/" + key, data); } \ No newline at end of file diff --git a/pkg_user/views/gift/gift.vue b/pkg_user/views/gift/gift.vue index 06aac5f..c3f28d6 100644 --- a/pkg_user/views/gift/gift.vue +++ b/pkg_user/views/gift/gift.vue @@ -43,9 +43,10 @@ - {{ goodsInfo.productInfo.otPrice }} + {{ payPrice }} + + x{{ goodsInfo['cartNum'] }} @@ -113,7 +116,7 @@ import passkeyborad from '@/components/yzc-paykeyboard/yzc-paykeyboard' -import { getGiftCardSendOrderConfirm, getGiftCardSendOrder } from '@/api/gift' +import { getGiftCardSendOrderConfirm, getGiftCardSendOrder, getGiftCardSendOrderAmount } from '@/api/gift' import {mapGetters} from "vuex"; import giftTips from './components/giftTips.vue' import CoverPicker from './components/CoverPicker.vue' @@ -165,6 +168,7 @@ export default { payType: '', isPayOk: false, giftKey: '', + payPrice: 0 } }, onLoad(opts) { @@ -181,6 +185,20 @@ export default { } }, methods: { + numberChange(e) { + this.computedPrice(e.value) + }, + computedPrice(num) { + const params = { + cartId: this.cartId, + couponId: this.couponId, + cartNum : num, + } + getGiftCardSendOrderAmount(this.orderKey, params).then(res => { + this.payPrice = res.data.result.payPrice + this.$forceUpdate() + }) + }, pwdPopFinish(payPwd) { this.payPassword = payPwd; this.confirmGift(true); @@ -207,6 +225,10 @@ export default { this.giftNotice = res.data.giftCardGiftNotice this.orderKey = res.data.orderKey this.goodsInfo = res.data.cartInfo[0] + this.templateId = res.data.specialGiftCardTemplate.id + this.selectedCover = res.data.specialGiftCardTemplate.cover + this.giftImage = res.data.specialGiftCardTemplate.image + this.computedPrice(this.goodsInfo.cartNum) }) }, /**