Commit c9204346 by 高淑倩

couponSettingId

parent 06f36166
...@@ -70,7 +70,7 @@ Component({ ...@@ -70,7 +70,7 @@ Component({
}, },
selectCoupon(e) { selectCoupon(e) {
// 1 抵用券 2 折扣券 // 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 const { newConponOrderList } = this.data
newConponOrderList.forEach(item => { newConponOrderList.forEach(item => {
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
<view <view
class="coupon-list" class="coupon-list"
data-id="{{coupon.id}}" data-id="{{coupon.id}}"
data-sid="{{coupon.couponSettingId}}"
data-index="{{index}}" data-index="{{index}}"
data-type="{{coupon.type}}" data-type="{{coupon.type}}"
data-coupon-discount="{{coupon.couponDiscount}}" data-coupon-discount="{{coupon.couponDiscount}}"
......
...@@ -10,6 +10,7 @@ wxService.page({ ...@@ -10,6 +10,7 @@ wxService.page({
*/ */
data: { data: {
couponId: null, couponId: null,
couponSettingId: null,
checkByPremium: false, checkByPremium: false,
addressInfo: [], addressInfo: [],
showSelectCoupon: false, showSelectCoupon: false,
...@@ -88,18 +89,22 @@ wxService.page({ ...@@ -88,18 +89,22 @@ wxService.page({
// // this.getAddressList() // // this.getAddressList()
// // } // // }
}, },
// select 传过来
updateCoupon(e) { updateCoupon(e) {
// faceAmount 抵用多少钱(分) 1 抵用券 2 折扣券 // faceAmount 抵用多少钱(分) 1 抵用券 2 折扣券
console.log('detail', e.detail) console.log('detail', e.detail)
const { faceAmount, type, id, couponDiscount } = e.detail const { faceAmount, type, id, couponDiscount,sid } = e.detail
const { orderPrice } = this.data const { orderPrice } = this.data
console.log('detail2222222', e.detail) console.log('detail2222222', e.detail)
console.log('orderPrice', this.data) console.log('orderPrice', this.data)
// couponId couponSettingId
let finCouponId = id ? id : sid
let finCouponName = id ? 'couponId' : 'couponSettingId'
if (type == 1) { if (type == 1) {
this.setData({ this.setData({
couponId: id, [finCouponName] : finCouponId,
// couponId: id,
haveCoupon: true, haveCoupon: true,
currentCoupon: `${faceAmount / 100} 元` currentCoupon: `${faceAmount / 100} 元`
}) })
...@@ -108,7 +113,8 @@ wxService.page({ ...@@ -108,7 +113,8 @@ wxService.page({
// let spread = Math.round(orderPrice - discounPrice) // let spread = Math.round(orderPrice - discounPrice)
this.setData({ this.setData({
couponId: id, [finCouponName] : finCouponId,
// couponId: id,
haveCoupon: true, haveCoupon: true,
currentCoupon: `${couponDiscount} 元` currentCoupon: `${couponDiscount} 元`
}) })
...@@ -359,6 +365,7 @@ wxService.page({ ...@@ -359,6 +365,7 @@ wxService.page({
noSelectPrice: sum noSelectPrice: sum
}) })
} }
// id / couponSettingId
this.setData({ this.setData({
currentOrderList: data, 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, 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 @@ ...@@ -32,7 +32,7 @@
</block> </block>
<view class="cell-me"> <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>
</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