Commit ccd24944 by zhanghaozhe

订单页面进入优惠券兑换生成多张

parent 806a4a97
...@@ -79,7 +79,7 @@ class UseCoupon extends PureComponent { ...@@ -79,7 +79,7 @@ class UseCoupon extends PureComponent {
} }
} }
if (state.from === '/order') { if (state.from === '/order') {
const coupon = data.data /*const coupon = data.data
if (coupon['ctype'] == 2 if (coupon['ctype'] == 2
&& coupon['limit_course'] != this.state.courseId) { && coupon['limit_course'] != this.state.courseId) {
...@@ -93,7 +93,7 @@ class UseCoupon extends PureComponent { ...@@ -93,7 +93,7 @@ class UseCoupon extends PureComponent {
valid_coupons: [...this.state.valid_coupons, coupon], valid_coupons: [...this.state.valid_coupons, coupon],
redeemCode: '' redeemCode: ''
}) })
} }*/
Toast.info('兑换成功') Toast.info('兑换成功')
this.getAllCoupons() this.getAllCoupons()
} }
...@@ -143,7 +143,7 @@ class UseCoupon extends PureComponent { ...@@ -143,7 +143,7 @@ class UseCoupon extends PureComponent {
const [expansionCoupons, selectCoupons] = coupons const [expansionCoupons, selectCoupons] = coupons
const {data: select} = selectCoupons const {data: select} = selectCoupons
const {data: expansion} = expansionCoupons const {data: expansion} = expansionCoupons
let PzCoupon = this.state.valid_coupons.concat(expansion.data) let PzCoupon = Array.isArray(expansion.data) ? expansion.data : []
if (expansion.code == 200) { if (expansion.code == 200) {
Array.isArray(expansion.data) Array.isArray(expansion.data)
&& (expansion.data = expansion.data.map(item => (item.ctype = 4, item))) && (expansion.data = expansion.data.map(item => (item.ctype = 4, item)))
......
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