|
@@ -25,6 +25,7 @@ import {
|
|
|
postMessage,
|
|
|
removeListenerMessage
|
|
|
} from '@/helpers/native-message'
|
|
|
+import UseCoupons, { couponEnum } from '@/views/order-detail/use-coupons'
|
|
|
export default defineComponent({
|
|
|
name: 'cartConfirm',
|
|
|
setup() {
|
|
@@ -77,7 +78,8 @@ export default defineComponent({
|
|
|
const authPopup = ref(false)
|
|
|
const orderInfo = reactive({
|
|
|
orderNo: '',
|
|
|
- actualPrice: 0
|
|
|
+ actualPrice: 0,
|
|
|
+ couponId: ''
|
|
|
})
|
|
|
//修复实名认证头部问题
|
|
|
watch(authPopup, (value, oldValue) => {
|
|
@@ -125,7 +127,9 @@ export default defineComponent({
|
|
|
const body = {
|
|
|
cartIds: ids,
|
|
|
memberReceiveAddressId: address.value?.id,
|
|
|
- platformType: state.platformType
|
|
|
+ platformType: state.platformType,
|
|
|
+ orderAmount: (cartConfirm.calcAmount.payAmount - cartConfirm.calcAmount.promotionAmount).toFixed(2),
|
|
|
+ couponId: orderInfo.couponId
|
|
|
}
|
|
|
try {
|
|
|
let { code, data } = await request.post(
|
|
@@ -185,25 +189,42 @@ export default defineComponent({
|
|
|
))}
|
|
|
</div>
|
|
|
<CellGroup border={false}>
|
|
|
- <Cell
|
|
|
- border={false}
|
|
|
- title="总额"
|
|
|
- value={
|
|
|
- '¥ ' + moneyFormat(cartConfirm.calcAmount.totalAmount)
|
|
|
- }
|
|
|
- ></Cell>
|
|
|
{/* <Cell
|
|
|
border={false}
|
|
|
title="运费"
|
|
|
value={moneyFormat(cartConfirm.calcAmount.freightAmount)}
|
|
|
></Cell>
|
|
|
- <Cell
|
|
|
- border={false}
|
|
|
- title="优惠"
|
|
|
- value={'-¥ ' + moneyFormat(cartConfirm.calcAmount.promotionAmount)}
|
|
|
- ></Cell> */}
|
|
|
+
|
|
|
{/* <Cell border={false} title="优惠卷" value="暂无可用优惠卷"></Cell>
|
|
|
<Cell border={false} title="乐乐币抵扣" value={"-¥" + cartConfirm.calcAmount.promotionAmount}></Cell> */}
|
|
|
+ <UseCoupons
|
|
|
+ orderType={couponEnum.GOODS}
|
|
|
+ orderAmount={cartConfirm.calcAmount.totalAmount}
|
|
|
+ onCouponSelect={(coupon) => {
|
|
|
+ const discountPrice = coupon.map(n => n.discountPrice).reduce((total,n) => {
|
|
|
+ return total + n
|
|
|
+ },0)
|
|
|
+ const couponId = coupon.map(n => n.couponIssueId).join(',')
|
|
|
+ cartConfirm.calcAmount.promotionAmount = discountPrice
|
|
|
+ orderInfo.couponId = couponId
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ {/* <Cell
|
|
|
+ border={false}
|
|
|
+ title="优惠"
|
|
|
+ value={
|
|
|
+ '-¥ ' +
|
|
|
+ moneyFormat(cartConfirm.calcAmount.promotionAmount)
|
|
|
+ }
|
|
|
+ ></Cell> */}
|
|
|
+
|
|
|
+ <Cell
|
|
|
+ border={false}
|
|
|
+ title="总额"
|
|
|
+ value={
|
|
|
+ '¥ ' + moneyFormat(cartConfirm.calcAmount.totalAmount)
|
|
|
+ }
|
|
|
+ ></Cell>
|
|
|
</CellGroup>
|
|
|
</div>
|
|
|
|
|
@@ -218,7 +239,7 @@ export default defineComponent({
|
|
|
<div class={styles.confirmBottom}>
|
|
|
合计{' '}
|
|
|
<span class={styles['price-des']}>
|
|
|
- ¥{moneyFormat(cartConfirm.calcAmount.payAmount)}
|
|
|
+ ¥{moneyFormat(cartConfirm.calcAmount.payAmount - cartConfirm.calcAmount.promotionAmount)}
|
|
|
</span>
|
|
|
</div>
|
|
|
</SubmitBar>
|