Commit c9204346 by 高淑倩

couponSettingId

parent 06f36166
......@@ -70,7 +70,7 @@ Component({
},
selectCoupon(e) {
// 1 抵用券 2 折扣券
const { id, index, type, amount, couponDiscount} = e.currentTarget.dataset
const { id, index, sid, type, amount, couponDiscount} = e.currentTarget.dataset
const { newConponOrderList } = this.data
newConponOrderList.forEach(item => {
......
......@@ -17,6 +17,7 @@
<view
class="coupon-list"
data-id="{{coupon.id}}"
data-sid="{{coupon.couponSettingId}}"
data-index="{{index}}"
data-type="{{coupon.type}}"
data-coupon-discount="{{coupon.couponDiscount}}"
......
......@@ -10,6 +10,7 @@ wxService.page({
*/
data: {
couponId: null,
couponSettingId: null,
checkByPremium: false,
addressInfo: [],
showSelectCoupon: false,
......@@ -88,18 +89,22 @@ wxService.page({
// // this.getAddressList()
// // }
},
// select 传过来
updateCoupon(e) {
// faceAmount 抵用多少钱(分) 1 抵用券 2 折扣券
console.log('detail', e.detail)
const { faceAmount, type, id, couponDiscount } = e.detail
const { faceAmount, type, id, couponDiscount,sid } = e.detail
const { orderPrice } = this.data
console.log('detail2222222', e.detail)
console.log('orderPrice', this.data)
// couponId couponSettingId
let finCouponId = id ? id : sid
let finCouponName = id ? 'couponId' : 'couponSettingId'
if (type == 1) {
this.setData({
couponId: id,
[finCouponName] : finCouponId,
// couponId: id,
haveCoupon: true,
currentCoupon: `${faceAmount / 100} 元`
})
......@@ -108,7 +113,8 @@ wxService.page({
// let spread = Math.round(orderPrice - discounPrice)
this.setData({
couponId: id,
[finCouponName] : finCouponId,
// couponId: id,
haveCoupon: true,
currentCoupon: `${couponDiscount} 元`
})
......@@ -359,6 +365,7 @@ wxService.page({
noSelectPrice: sum
})
}
// id / couponSettingId
this.setData({
currentOrderList: data,
defalutCoupon: data && data.couponDiscountPreviews.length && data.couponDiscountPreviews[0].couponSettingDTO.type == 1 ? data && data.couponDiscountPreviews.length && data.couponDiscountPreviews[0].couponSettingDTO.faceAmount / 100 : data && data.couponDiscountPreviews.length && data.couponDiscountPreviews[0] && data.couponDiscountPreviews[0].couponDiscount,
......
......@@ -32,7 +32,7 @@
</block>
<view class="cell-me">
<cell bind:startmessage='startmessage' isMask="0" styleType="2" blockStyle="button" buttonText="0" bind:completemessage="completemessage" plugid='c9918b9af349c100b285d1b9a4d19ec6' />
<cell bind:startmessage='startmessage' isMask="0" styleType="2" blockStyle="bubble" buttonText="0" bind:completemessage="completemessage" plugid='c9918b9af349c100b285d1b9a4d19ec6' />
</view>
</view>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment