Commit bbe452e0 by 谢中龙

优化bug

parent 723301ff
...@@ -51,13 +51,21 @@ wxService.page({ ...@@ -51,13 +51,21 @@ wxService.page({
//获取优惠券详情 //获取优惠券详情
getCouponDetail(){ getCouponDetail(){
wxService.post(`/coupon/coupon/get?cardNo=${this.data.couponId}`).then(res => { wxService.post(`/coupon/coupon/get?cardNo=${this.data.couponId}`).then(res => {
console.log('请求卡券详情接口cardNo----',this.data.couponId)
console.log('获取卡券结果----',res)
if(res){ if(res){
this.data.couponInfo = res.data.data ? res.data.data : {}; this.data.couponInfo = res.data.data ? res.data.data : {};
this.data.couponInfo.takeCouponBgimg = this.data.couponInfo.couponDetail.style.takeCouponBgimg; this.data.couponInfo.takeCouponBgimg = this.data.couponInfo.couponDetail.style.takeCouponBgimg;
this.data.couponInfo.title = this.data.couponInfo.couponSetting.title; this.data.couponInfo.title = this.data.couponInfo.couponSetting.title;
this.data.couponInfo.faceAmountDesc = this.data.couponInfo.couponSetting.faceAmountDesc; this.data.couponInfo.faceAmountDesc = this.data.couponInfo.couponSetting.faceAmountDesc;
this.data.couponInfo.startTime = this.data.couponInfo.couponSetting.startTime.substring(0,10); let startTime = this.data.couponInfo.coupon.startTime ;
this.data.couponInfo.endTime = this.data.couponInfo.couponSetting.endTime.substring(0, 10); let endTime = this.data.couponInfo.coupon.endTime;
if (startTime){
//固定日期
this.data.couponInfo.startTime = startTime.substring(0, 10);
this.data.couponInfo.endTime = endTime.substring(0, 10);
}
let notice = this.data.couponInfo.couponSetting.notice; let notice = this.data.couponInfo.couponSetting.notice;
this.data.couponInfo.notice = notice ? JSON.parse(notice) : []; this.data.couponInfo.notice = notice ? JSON.parse(notice) : [];
if (this.data.couponInfo.notice){ if (this.data.couponInfo.notice){
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</view> </view>
<view class='coupon-item-rg'> <view class='coupon-item-rg'>
<view class='coupon-title'>{{couponInfo.title}}</view> <view class='coupon-title'>{{couponInfo.title}}</view>
<view class='op'> <view class='op' wx:if="{{couponInfo.startTime}}">
有效期:{{couponInfo.startTime}}至{{couponInfo.endTime}} 有效期:{{couponInfo.startTime}}至{{couponInfo.endTime}}
</view> </view>
<view class='op'> <view class='op'>
......
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