diff --git a/pages.json b/pages.json index 63dbb7d..e9c28e6 100644 --- a/pages.json +++ b/pages.json @@ -563,6 +563,12 @@ "navigationStyle": "custom" } }, + { + "path": "productInfo/evaluateDetail", + "style": { + "navigationBarTitleText": "" + } + }, { "path": "pointsRedemption/pointsRedemption", "style": { diff --git a/pages/order_package/order_submit/cpoun-dialog.vue b/pages/order_package/order_submit/cpoun-dialog.vue new file mode 100644 index 0000000..bfa51ae --- /dev/null +++ b/pages/order_package/order_submit/cpoun-dialog.vue @@ -0,0 +1,383 @@ + + + + + \ No newline at end of file diff --git a/pages/order_package/order_submit/order_submit.vue b/pages/order_package/order_submit/order_submit.vue index d87d1d4..4ab8b8e 100644 --- a/pages/order_package/order_submit/order_submit.vue +++ b/pages/order_package/order_submit/order_submit.vue @@ -134,7 +134,9 @@ 数字积分余额 - {{ couponData.balance || 0 }} + {{ + couponData.balance || 0 + }} @@ -169,19 +171,32 @@ 商品总价 - {{ `${buyCouponvalue}数字积分+${orderInfo.amount - (orderInfo.postage || 0) + - (orderInfo.enterpriseAmount - || 0)}元` }} + {{ + `${buyCouponvalue}数字积分+${orderInfo.amount - + (orderInfo.postage || 0) + + (orderInfo.enterpriseAmount || 0) + }元` + }} - ¥{{ orderInfo.amount - orderInfo.postage + - (orderInfo.enterpriseAmount - || 0) }} + ¥{{ + orderInfo.amount - + orderInfo.postage + + (orderInfo.enterpriseAmount || 0) + }} 运费 ¥{{ orderInfo.postage }} - + + 优惠券 + + {{ selectedCoupon ? `-${selectedCoupon.amount}` : + '请选择' }} + + + 数字积分 {{ buyCouponvalue }}数字积分 @@ -270,6 +285,9 @@ + + + @@ -288,7 +306,7 @@ import { getSettleList, settle, settlementOrder, - updateGoodsNum + updateGoodsNum, } from "@/api/cart.js"; import { getSupportPay } from "@/api/order.js"; import { feedback } from "@/api/payment.js"; @@ -303,8 +321,14 @@ import { } from "@/utils/payUtils.js"; import CryptoJS from "crypto-js"; +import CouponDialog from "./cpoun-dialog.vue"; export default { + components: { + Address, + Header, + CouponDialog, + }, computed: { PRODUCT_DELIVERY_TIME() { return PRODUCT_DELIVERY_TIME; @@ -325,12 +349,6 @@ export default { } return num; }, - - }, - - components: { - Address, - Header, }, data() { return { @@ -368,6 +386,8 @@ export default { allOrderInfo: {}, // 所有订单信息 buyCouponvalue: 0, // 实付数字积分积分 buyCouponAmount: 0, // 实付数字积分对应的钱 + couponShow: false, // 优惠券弹框显示 + selectedCoupon: null, // 选中的优惠券 }; }, async onLoad(option) { @@ -376,7 +396,7 @@ export default { if (option.address) { this.defaultAddress = option.address; } - console.log('-------', option.isCoupon) + console.log("-------", option.isCoupon); if (option.isCoupon) { this.isCoupon = option.isCoupon; } @@ -417,12 +437,19 @@ export default { assembleAddress, // 实付数字积分 onBuyCouponvalue(currentQuantity) { - this.buyCouponvalue = Number((this.allOrderInfo.buyDeductionValue * (currentQuantity || 1)).toFixed(2)) || 0; - + this.buyCouponvalue = + Number( + ( + this.allOrderInfo.buyDeductionValue * (currentQuantity || 1) + ).toFixed(2), + ) || 0; }, // 实付数字积分对应的钱 onBuyCouponAmount() { - this.buyCouponAmount = Number((this.sed.goodsNum * this.allOrderInfo.buyDeduction).toFixed(2)) || 0; + this.buyCouponAmount = + Number( + (this.sed.goodsNum * this.allOrderInfo.buyDeduction).toFixed(2), + ) || 0; }, async addressList() { const res = await getAddress(); @@ -502,7 +529,7 @@ export default { } else { parmas["types"] = "1,2,3"; } - console.log('parmas-----', this.isCoupon) + console.log("parmas-----", this.isCoupon); if (this.isCoupon) { parmas["types"] = "1,2,3"; @@ -522,8 +549,8 @@ export default { // const balanceFlag = data.some(item => item.type === "balance" && item.balance < amount); // this.isShowBalance = balanceFlag; // } - this.wayOption = data.filter(item => item.type !== "vcoin"); - this.couponData = data.filter(item => item.type === "vcoin")[0] || {}; + this.wayOption = data.filter((item) => item.type !== "vcoin"); + this.couponData = data.filter((item) => item.type === "vcoin")[0] || {}; console.log("getWayOption", this.wayOption, this.couponData); } }, @@ -544,7 +571,7 @@ export default { let address = null; if (this.defaultAddress) { address = this.addressListOne.find( - (item) => item.id == this.defaultAddress + (item) => item.id == this.defaultAddress, ); } else { if (this.addressListOne.length) { @@ -631,14 +658,28 @@ export default { }, ], }; - console.log('this.defaultAddress', this.defaultAddress, this.addressListOne) - if (this.defaultAddress && this.addressListOne && this.addressListOne.length) { - let arr = this.addressListOne.filter(i => i.id == this.defaultAddress); + console.log( + "this.defaultAddress", + this.defaultAddress, + this.addressListOne, + ); + if ( + this.defaultAddress && + this.addressListOne && + this.addressListOne.length + ) { + let arr = this.addressListOne.filter( + (i) => i.id == this.defaultAddress, + ); if (arr.length) { this.orderInfo.address = arr[0]; } } - if (!this.orderInfo.address && this.addressListOne && this.addressListOne.length) { + if ( + !this.orderInfo.address && + this.addressListOne && + this.addressListOne.length + ) { this.orderInfo.address = this.addressListOne[0]; } this.allOrderInfo = data; @@ -711,7 +752,7 @@ export default { goodsNum: currentQuantity, }; const result = await updateGoodsNum(params); - console.log("-----1") + console.log("-----1"); if (result && result.bizcode === 100) { this.orderInfo.shops[index].addrTimes[addIndex].goods[pIndex].num = currentQuantity; @@ -845,7 +886,7 @@ export default { params["goodsId"] = this.sed.id; params["specsId"] = this.sed.specsId.id; params["goodsNum"] = this.orderInfo.shops[0].addrTimes[0].goods[0].num; - if (this.isCoupon) params.payway2 = 'vcoin'; + if (this.isCoupon) params.payway2 = "vcoin"; resp = await settlementOrder(params); } else { @@ -964,6 +1005,9 @@ export default { url: "/pages/other_package/productInfo/productInfo?id=" + item.goodsId, }); }, + handleCouponSelect(coupon) { + this.selectedCoupon = coupon; + }, /** * 去充值 */ @@ -1284,4 +1328,4 @@ export default { color: $app-bt-bj; } } - + \ No newline at end of file diff --git a/pages/other_package/coupon/coupon.vue b/pages/other_package/coupon/coupon.vue index 9484cef..0900f3e 100644 --- a/pages/other_package/coupon/coupon.vue +++ b/pages/other_package/coupon/coupon.vue @@ -109,11 +109,6 @@ export default { }, computed: { filteredCoupons() { - if (this.currentTab === 1) { - return this.coupons.filter(item => item.status === 'active'); - } else if (this.currentTab === 2) { - return this.coupons.filter(item => item.status === 'expired'); - } return this.coupons; } }, @@ -133,21 +128,22 @@ export default {