From 59a4a40eb4dba5942f91ac4ff9ce3fa31d34c275 Mon Sep 17 00:00:00 2001 From: Maoqiang Zheng Date: Fri, 22 Feb 2019 17:12:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E4=BC=98=E6=83=A0?= =?UTF-8?q?=E5=8D=B7=E5=92=8C=E5=92=A8=E8=AF=A2=E6=8E=A5=E5=8F=A3=EF=BC=8C?= =?UTF-8?q?=E5=92=8C=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../filteredShopComponent.js | 25 ++++++++++++------- .../filteredShopComponent.scss | 6 +++++ .../voucherPosterComponent.js | 6 +++-- .../voucherPosterComponent.scss | 5 +++- 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/component/filteredShopComponent/filteredShopComponent.js b/src/component/filteredShopComponent/filteredShopComponent.js index cda10c5..dcbf4e3 100644 --- a/src/component/filteredShopComponent/filteredShopComponent.js +++ b/src/component/filteredShopComponent/filteredShopComponent.js @@ -35,7 +35,8 @@ class recommondShop extends Component { voucherResponseMsg: 'i am voucherResponseMsg', userName: Taro.getStorageSync('user_identity').username || '', userPhone: Taro.getStorageSync('user_identity').userphone || '', - canConsult: false + isCanConsult: true, + isCanVoucher: true } } @@ -76,7 +77,7 @@ class recommondShop extends Component { .then(res => { this.setState({ voucherResponseMsg: res.data.tips, - canConsult: res.data.canConsult, + isCanVoucher: res.data.canConsult, }) console.log('优惠卷请求', res) }) @@ -113,7 +114,7 @@ class recommondShop extends Component { } }) .then(res => { - this.setState({ consultTip: res.data.tips }) + this.setState({ consultTip: res.data.tips,isCanConsult:res.data.canConsult }) console.log('咨询请求', res) }) } @@ -122,7 +123,8 @@ class recommondShop extends Component { phone = this.state.userPhone, shops = [this.props.shop.shop_id], source_type = "2", - source_level = 1, + source_level = this.props.categoryLevel, + source_class = this.props.classId === '-1' ? '' : this.props.classId, coupons_flag = 0 }) { Taro.request({ url: URL.BuyConsult, @@ -135,6 +137,7 @@ class recommondShop extends Component { shops: shops, source_type: source_type, source_level: source_level, + source_class: source_class, coupons_flag: coupons_flag, }) }, @@ -187,8 +190,9 @@ class recommondShop extends Component { } else { this.setState({ isOpenConsult: false }) - this.buyConsult({ user: this.state.userName, phone: this.state.userPhone }) + this.buyConsult({}) } + } handleInputCsultName(e) { @@ -215,7 +219,6 @@ class recommondShop extends Component { //console.log(this.props, nextProps) } componentDidMount() { - console.log('this.props', this.props) } componentWillUnmount() { } @@ -279,10 +282,13 @@ class recommondShop extends Component { /> - + + + + -// {this.props.canConsult?:} + // {this.props.canConsult?:} return ( @@ -291,12 +297,13 @@ class recommondShop extends Component { name={this.state.userName} phone={this.state.userPhone} shopId={this.props.shop.shop_id} - canConsult={this.state.canConsult} + isCanVoucher={this.state.isCanVoucher} isVoucherPoster={this.state.isOpenVoucher} onPassDataToChild={this.getDataFromChild.bind(this)} voucherLeft={this.props.shop.left_nums} voucherResponseMsg={this.state.voucherResponseMsg} categoryLevel={this.props.categoryLevel} + classId={this.props.classId === '-1' ? '' : this.props.classId} > diff --git a/src/component/filteredShopComponent/filteredShopComponent.scss b/src/component/filteredShopComponent/filteredShopComponent.scss index 8612f4a..049d1f2 100644 --- a/src/component/filteredShopComponent/filteredShopComponent.scss +++ b/src/component/filteredShopComponent/filteredShopComponent.scss @@ -5,6 +5,12 @@ $linearBlue:linear-gradient(to right, #337ab7, #337ab7); border-radius: 3px; box-shadow: 0 5px 5px #ddd; margin-bottom: 10px; + .confirm_button{ + color:#FF7142!important + } + .blur{ + opacity: 0.5 + } .voucher-modal{ background-color: black; diff --git a/src/component/filteredShopComponent/voucherPosterComponent/voucherPosterComponent.js b/src/component/filteredShopComponent/voucherPosterComponent/voucherPosterComponent.js index a9a287d..c6a9803 100644 --- a/src/component/filteredShopComponent/voucherPosterComponent/voucherPosterComponent.js +++ b/src/component/filteredShopComponent/voucherPosterComponent/voucherPosterComponent.js @@ -30,6 +30,7 @@ class VoucherPoster extends Component { shops = [this.props.shopId], source_type = '4', source_level = this.props.categoryLevel, + source_class = this.props.classId, coupons_flag = '1' }) { Taro.request({ url: URL.BuyConsult, @@ -43,6 +44,7 @@ class VoucherPoster extends Component { source_type: source_type, source_level: source_level, coupons_flag: coupons_flag, + source_class: source_class }) }, header: { @@ -55,7 +57,7 @@ class VoucherPoster extends Component { console.log('购买咨询请求成功', res) if (res.data.err_code === 0) { Taro.showToast({ - title: '领取成功', + title: '咨询成功', icon: 'success', duration: 1500 }) @@ -150,7 +152,7 @@ class VoucherPoster extends Component { - + diff --git a/src/component/filteredShopComponent/voucherPosterComponent/voucherPosterComponent.scss b/src/component/filteredShopComponent/voucherPosterComponent/voucherPosterComponent.scss index 8f24fcf..470c9ee 100644 --- a/src/component/filteredShopComponent/voucherPosterComponent/voucherPosterComponent.scss +++ b/src/component/filteredShopComponent/voucherPosterComponent/voucherPosterComponent.scss @@ -41,6 +41,7 @@ $linearOrange:linear-gradient(to right, #FF7142, #FF7142); min-height:100%; + .close-icon{ margin-left:88%; margin-top:2%; @@ -100,7 +101,9 @@ $linearOrange:linear-gradient(to right, #FF7142, #FF7142); font-size: 28px; background:$linearOrange; padding: 12rpx; - + } + .blur{ + opacity: 0.5; } } .declare{