Commit ff979272 by xuzhenghua

优惠券

parents 93992565 1ef670f9
...@@ -143,6 +143,7 @@ class UseCoupon extends PureComponent { ...@@ -143,6 +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)
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)))
...@@ -154,10 +155,11 @@ class UseCoupon extends PureComponent { ...@@ -154,10 +155,11 @@ class UseCoupon extends PureComponent {
} }
if (select.code === 200) { if (select.code === 200) {
const inuse_coupon = select.data['inuse_coupon'] const inuse_coupon = select.data['inuse_coupon']
this.setState({ let PzCoupon2 = inuse_coupon
valid_coupons: inuse_coupon
? [...inuse_coupon, ...select.data.valid_coupons] ? [...inuse_coupon, ...select.data.valid_coupons]
: select.data.valid_coupons, : select.data.valid_coupons
this.setState({
valid_coupons: PzCoupon.concat(PzCoupon2),
invalid_coupons: select.data.invalid_coupons, invalid_coupons: select.data.invalid_coupons,
selectedCouponId: inuse_coupon.length ? inuse_coupon[0].id : 0 selectedCouponId: inuse_coupon.length ? inuse_coupon[0].id : 0
}) })
...@@ -165,8 +167,6 @@ class UseCoupon extends PureComponent { ...@@ -165,8 +167,6 @@ class UseCoupon extends PureComponent {
} else { } else {
Toast.info(data.msg) Toast.info(data.msg)
} }
}) })
} }
...@@ -352,6 +352,7 @@ function Content({coupons, ...rest}) { ...@@ -352,6 +352,7 @@ function Content({coupons, ...rest}) {
{ {
coupons.map(item => { coupons.map(item => {
return ( return (
item.id &&
<Coupon <Coupon
key={item.id} key={item.id}
{...item} {...item}
......
...@@ -704,15 +704,15 @@ class Detail extends Component { ...@@ -704,15 +704,15 @@ class Detail extends Component {
*/ */
} }
{/*双十一期间不需要显示 不要删除*/} {/*双十一期间不需要显示 不要删除*/}
{ {/*{*/}
isCent && !course_info.is_aist && (course_info.group_status === 3 || course_info.group_status === 4) && {/*isCent && !course_info.is_aist && (course_info.group_status === 3 || course_info.group_status === 4) &&*/}
<Group {/*<Group*/}
courseInfo={course_info} {/*courseInfo={course_info}*/}
history={this.props.history} {/*history={this.props.history}*/}
countdown={countdown} {/*countdown={countdown}*/}
invitedFriends={this.invitedFriends} {/*invitedFriends={this.invitedFriends}*/}
/> {/*/>*/}
} {/*}*/}
{/* {/*
* 砍价 * 砍价
......
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