Commit ff979272 by xuzhenghua

优惠券

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