Commit 6b4fe03e by 李伟康

commit

1 parent 474a6a01
......@@ -33,9 +33,8 @@
<div class="title text-hide">{{i.couponName}}</div>
<div class="text flex">库存:{{i.residueAmount}}<span class="line" />预估成本:{{centsToyuan(i.anticipatedCost)}}元</div>
<div class="text flex text-tips">
有效期:
<template v-if="i.effectiveType == 1">领后{{i.effectiveDays}}天有效</template>
<template v-if="i.effectiveType == 2">{{i.effectiveStartTime}}-{{i.effectiveEndTime}}</template>
有效期:<template v-if="i.effectiveType == 1">领后{{i.effectiveDays}}天有效</template>
<template v-if="i.effectiveType == 2">{{i.effectiveStartTime}} ~ {{i.effectiveEndTime}}</template>
<template v-if="i.effectiveType == 3">无有效期</template>
<span class="tips text-center">
<template v-if="tabIndex == 0">
......@@ -200,9 +199,9 @@ export default {
})
}
})
let arr = chooseItems.reduce((cur, next) => {
obj[next.couponId] ? '' : obj[next.couponId] = true && cur.push(next)
return cur
let arr = chooseItems.reduce((e, i) => {
obj[i.couponId] ? '' : obj[i.couponId] = true && e.push(i)
return e
}, [])
this.chooseItems = arr
},
......
......@@ -169,7 +169,9 @@ export default {
let { radioObj } = this
giftApi.getGiftDetail(id).then(res => {
this.hideLoading()
res.couponList.length && res.couponList.map(e => total += e.couponAnticipatedCost * e.couponAmount)
res.couponList.length && res.couponList.map(e => {
if (e.status == 2) total += e.couponAnticipatedCost * e.couponAmount
})
this.flag = true
radioObj.map(e => e.active = false)
if (res.receiveWay == 1) res.phone = res.receiveDetails
......@@ -191,7 +193,9 @@ export default {
},
couponConfirm ({ chooseItems }) {
let total = 0
chooseItems.map(i => total += i.couponAnticipatedCost * i.couponAmount)
chooseItems.map(i => {
if (i.status == 2) total += i.couponAnticipatedCost * i.couponAmount
})
this.obj.couponList = JSON.parse(JSON.stringify(chooseItems))
this.total = total
this.checkData()
......@@ -225,7 +229,9 @@ export default {
let total = 0
couponList.splice(index, 1)
this.obj.couponList = couponList
couponList.map(i => total += i.couponAnticipatedCost * i.couponAmount)
couponList.map(i => {
if (i.status == 2) total += i.couponAnticipatedCost * i.couponAmount
})
this.total = total
},
submit () {
......
......@@ -120,7 +120,9 @@ export default {
let total = 0
giftApi.getGiftDetail(id).then(res => {
this.hideLoading()
res.couponList.length && res.couponList.map(e => total += e.couponAnticipatedCost * e.couponAmount)
res.couponList.length && res.couponList.map(e => {
if (e.status == 2) total += e.couponAnticipatedCost * e.couponAmount
})
this.flag = true
this.obj = res
this.total = total
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!