|
@@ -35,7 +35,7 @@ import { moneyFormat } from '@/helpers/utils'
|
|
import OrderPinao from './order-pinao'
|
|
import OrderPinao from './order-pinao'
|
|
import { getMusicDetail } from '@/student/trade/tradeOrder'
|
|
import { getMusicDetail } from '@/student/trade/tradeOrder'
|
|
import OrderActive from './order-active'
|
|
import OrderActive from './order-active'
|
|
-import UseCoupon from './use-coupons'
|
|
|
|
|
|
+import UseCoupon, { couponToOrderTypeEnum } from './use-coupons'
|
|
import OrderAlbum from './order-album'
|
|
import OrderAlbum from './order-album'
|
|
import { useRect } from '@vant/use'
|
|
import { useRect } from '@vant/use'
|
|
import QrcodePayment from './qrcode-payment'
|
|
import QrcodePayment from './qrcode-payment'
|
|
@@ -454,10 +454,29 @@ export default defineComponent({
|
|
},
|
|
},
|
|
onCouponSelect(item: any) {
|
|
onCouponSelect(item: any) {
|
|
let discountCount = 0
|
|
let discountCount = 0
|
|
|
|
+ let universalCount = 0
|
|
|
|
+ const tempPrice: any = {}
|
|
|
|
+ this.orderGoodsType.forEach((type: any) => {
|
|
|
|
+ tempPrice[type.orderType] = type.price
|
|
|
|
+ })
|
|
;(item || []).forEach((item: any) => {
|
|
;(item || []).forEach((item: any) => {
|
|
discountCount += Number(item.discountPrice)
|
|
discountCount += Number(item.discountPrice)
|
|
|
|
+ if(item.couponCategory === 'UNIVERSAL') {
|
|
|
|
+ universalCount += Number(item.discountPrice)
|
|
|
|
+ } else {
|
|
|
|
+ const tempCoupon = couponToOrderTypeEnum[item.couponCategory]
|
|
|
|
+ const price = tempPrice[tempCoupon] - Number(item.discountPrice)
|
|
|
|
+ tempPrice[tempCoupon] = price >= 0 ? price : 0
|
|
|
|
+ }
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+ // 获取金额
|
|
|
|
+ let tempAllAmount = 0
|
|
|
|
+ for(let i in tempPrice) {
|
|
|
|
+ tempAllAmount += tempPrice[i]
|
|
|
|
+ }
|
|
|
|
+ console.log(tempAllAmount, 'tempAllAmount')
|
|
|
|
+
|
|
const lastAmount = Number(
|
|
const lastAmount = Number(
|
|
numberToTwoUp(
|
|
numberToTwoUp(
|
|
Number(this.orderAmount) -
|
|
Number(this.orderAmount) -
|