Commit f9e0e278f25b26eecf5fd916feddb79f35155b33
1 parent
10cb691d
优惠券过期的优化
Showing
2 changed files
with
27 additions
and
14 deletions
packageA/pages/quan_pro/quan_pro.js
@@ -49,7 +49,8 @@ Page({ | @@ -49,7 +49,8 @@ Page({ | ||
49 | getApp().request.promiseGet("/api/weshop/prom/coupon/pageCouponList", { | 49 | getApp().request.promiseGet("/api/weshop/prom/coupon/pageCouponList", { |
50 | data:{store_id:os.stoid,type:1,id:th.data.id,user_id:user_id} | 50 | data:{store_id:os.stoid,type:1,id:th.data.id,user_id:user_id} |
51 | }).then(res => { | 51 | }).then(res => { |
52 | - if(res.data.code==0){ | 52 | + th.setData({is_get:1}); |
53 | + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length){ | ||
53 | th.setData({q_data:res.data.data.pageData[0]}); | 54 | th.setData({q_data:res.data.data.pageData[0]}); |
54 | } | 55 | } |
55 | }); | 56 | }); |
packageA/pages/quan_pro/quan_pro.wxml
@@ -8,12 +8,15 @@ | @@ -8,12 +8,15 @@ | ||
8 | <image style="width: 100%; height: 450rpx" src="{{iurl}}/miniapp/images/coupon_img/q_detail_bg.png"></image> | 8 | <image style="width: 100%; height: 450rpx" src="{{iurl}}/miniapp/images/coupon_img/q_detail_bg.png"></image> |
9 | <view class="q_content"> | 9 | <view class="q_content"> |
10 | <view class="upper flex jc_sb co-w"> | 10 | <view class="upper flex jc_sb co-w"> |
11 | - <view class="left fs30" style="width: 440rpx;"> | 11 | + <view class="left fs30" style="width: 460rpx;"> |
12 | <view> | 12 | <view> |
13 | <image style="width: 70rpx; height: 70rpx; vertical-align: middle; margin-right: 20rpx" src="{{iurl}}/miniapp/images/coupon_img/coupon_logo.png"></image> | 13 | <image style="width: 70rpx; height: 70rpx; vertical-align: middle; margin-right: 20rpx" src="{{iurl}}/miniapp/images/coupon_img/coupon_logo.png"></image> |
14 | - {{q_data.name}} | 14 | + <text wx:if="{{q_data}}">{{q_data.name}}</text> |
15 | + <text wx:elif="{{is_get}}" class="fs28">不存在此微券或数量已领取完</text> | ||
15 | </view> | 16 | </view> |
16 | - <view class="flex ai-center" style="margin-top: 24rpx; margin-right: 20rpx; width: 440rpx"> | 17 | + |
18 | + <block wx:if="{{q_data}}"> | ||
19 | + <view class="flex ai-center" style="margin-top: 24rpx; margin-right: 20rpx; width: 440rpx"> | ||
17 | <view class="t_circle"></view> | 20 | <view class="t_circle"></view> |
18 | <view> | 21 | <view> |
19 | <text wx:if="{{q_data.useobjecttype==0}}">全场通用</text> | 22 | <text wx:if="{{q_data.useobjecttype==0}}">全场通用</text> |
@@ -22,29 +25,38 @@ | @@ -22,29 +25,38 @@ | ||
22 | 25 | ||
23 | </view> | 26 | </view> |
24 | <view class="ellipsis-3" style="margin-top: 20rpx;">{{q_data.coupon_remark}}</view> | 27 | <view class="ellipsis-3" style="margin-top: 20rpx;">{{q_data.coupon_remark}}</view> |
28 | + </block> | ||
25 | </view> | 29 | </view> |
26 | - <view class="right" style="margin-right: 80rpx;"> | 30 | + <view wx:if="{{q_data}}" class="right" style="margin-right: 80rpx;"> |
27 | <view class="f40 t-c" style="margin-top: 100rpx"><text class="fs26">¥</text>{{filters.toFix(q_data.money,2)}}</view> | 31 | <view class="f40 t-c" style="margin-top: 100rpx"><text class="fs26">¥</text>{{filters.toFix(q_data.money,2)}}</view> |
28 | <view class="fs28">满{{filters.toFix(q_data.condition,2)}}可用</view> | 32 | <view class="fs28">满{{filters.toFix(q_data.condition,2)}}可用</view> |
29 | </view> | 33 | </view> |
30 | </view> | 34 | </view> |
31 | - <view wx:if="{{q_data.endtype==0}}" class="lower fs30">有效期 | ||
32 | - <text wx:if="{{q_data.starttype==1}}"> {{filters.format_time(getcurday+3600*24*q_data.startdays)}}</text> | ||
33 | - <text wx:if="{{q_data.use_start_time>0 && q_data.starttype==0}}"> {{filters.format_time(q_data.use_start_time)}}</text>至 | ||
34 | - <text wx:if="{{q_data.use_end_time>0}}"> {{filters.format_time(q_data.use_end_time)}}</text><text wx:else>不限</text> | 35 | + |
36 | + <block wx:if="{{ q_data}}"> | ||
37 | + <view wx:if="{{ q_data.endtype==0}}" class="lower fs30">有效期 | ||
38 | + <text wx:if="{{q_data.starttype==1}}"> {{filters.format_time(getcurday+3600*24*q_data.startdays)}}</text> | ||
39 | + <text wx:if="{{q_data.use_start_time>0 && q_data.starttype==0}}"> {{filters.format_time(q_data.use_start_time)}}</text>至 | ||
40 | + <text wx:if="{{q_data.use_end_time>0}}"> {{filters.format_time(q_data.use_end_time)}}</text><text wx:else>不限</text> | ||
41 | + </view> | ||
42 | + <view wx:else class="lower fs30">有效期 | ||
43 | + <text wx:if="{{ q_data.starttype==1}}"> {{filters.format_time(getcurday+3600*24*q_data.startdays)}}</text> | ||
44 | + <text wx:else>{{filters.format_time(getcurday)}}</text>至 | ||
45 | + <text wx:if="{{q_data.days>0}}"> {{filters.format_time(getcurday+3600*24*q_data.days)}}</text><text wx:else>不限</text></view> | ||
46 | + </block> | ||
47 | + | ||
48 | + <view wx:elif="{{is_get}}" class="fs28" style="text-align: center;color: #999;position: absolute;bottom: 20rpx;"> | ||
49 | + 不存在此微券或数量已领取完 | ||
35 | </view> | 50 | </view> |
36 | - <view wx:else class="lower fs30">有效期 | ||
37 | - <text wx:if="{{ q_data.starttype==1}}"> {{filters.format_time(getcurday+3600*24*q_data.startdays)}}</text> | ||
38 | - <text wx:else>{{filters.format_time(getcurday)}}</text>至 | ||
39 | - <text wx:if="{{q_data.days>0}}"> {{filters.format_time(getcurday+3600*24*q_data.days)}}</text><text wx:else>不限</text></view> | ||
40 | 51 | ||
41 | </view> | 52 | </view> |
42 | </view> | 53 | </view> |
43 | 54 | ||
44 | - <view class="flex jc-center" style="margin-top: 40rpx"> | 55 | + <view wx:if="{{q_data}}" class="flex jc-center" style="margin-top: 40rpx"> |
45 | <view wx:if="{{q_data.everyone_num>0 && q_data.lqnum>=q_data.everyone_num}}" class="btn flex jc-center ai-center gray" bindtap="get_quan">已领取</view> | 56 | <view wx:if="{{q_data.everyone_num>0 && q_data.lqnum>=q_data.everyone_num}}" class="btn flex jc-center ai-center gray" bindtap="get_quan">已领取</view> |
46 | <view wx:else class="btn flex jc-center ai-center" bindtap="get_quan">立即领取</view> | 57 | <view wx:else class="btn flex jc-center ai-center" bindtap="get_quan">立即领取</view> |
47 | </view> | 58 | </view> |
59 | + | ||
48 | <view class="flex jc-center fs36" style="margin-top: 40rpx"> | 60 | <view class="flex jc-center fs36" style="margin-top: 40rpx"> |
49 | <image style="margin-right: 20rpx" class="love" src="{{iurl}}/miniapp/images/coupon_img/love.png"></image>猜你喜欢 | 61 | <image style="margin-right: 20rpx" class="love" src="{{iurl}}/miniapp/images/coupon_img/love.png"></image>猜你喜欢 |
50 | </view> | 62 | </view> |