Commit a674fcbf331784483065c8589a1c03479aa0c82a
1 parent
ceee11d9
重新推送的优化
Showing
5 changed files
with
56 additions
and
16 deletions
components/nodata/nodata.js
components/nodata/nodata.wxml
packageA/pages/chongzhiDetails/chongzhiDetails.js
... | ... | @@ -23,7 +23,8 @@ Page({ |
23 | 23 | */ |
24 | 24 | onLoad: function (options) { |
25 | 25 | |
26 | - const self = this; | |
26 | + wx.showLoading(); | |
27 | + const self = this; | |
27 | 28 | if(options.type) |
28 | 29 | self.setData({type:options.type}); |
29 | 30 | |
... | ... | @@ -50,11 +51,11 @@ Page({ |
50 | 51 | |
51 | 52 | |
52 | 53 | getApp().request.promiseGet("/api/weshop/ad/page",{ |
53 | - data:{store_id:os.stoid,enabled:1,pid:601} | |
54 | + data:{store_id:os.stoid,enabled:1,pid:1210} | |
54 | 55 | }).then(res=>{ |
55 | 56 | if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){ |
56 | 57 | var a = res.data.data.pageData; |
57 | - self.setData({show_img:a[0].ad_code,ad_color:a[0].bgcolor}); | |
58 | + self.setData({show_img:a[0].ad_code,ad_color:a[0].bgcolor,ad:a[0] }); | |
58 | 59 | } |
59 | 60 | }) |
60 | 61 | |
... | ... | @@ -94,7 +95,9 @@ Page({ |
94 | 95 | self.setData({ |
95 | 96 | result: result, |
96 | 97 | }); |
97 | - | |
98 | + | |
99 | + wx.hideLoading(); | |
100 | + | |
98 | 101 | }, |
99 | 102 | }); |
100 | 103 | |
... | ... | @@ -276,4 +279,12 @@ Page({ |
276 | 279 | } |
277 | 280 | }) |
278 | 281 | }, |
282 | + | |
283 | + | |
284 | + go_url:function (e){ | |
285 | + var url=e.currentTarget.dataset.url; | |
286 | + if(url){ | |
287 | + getApp().goto(url); | |
288 | + } | |
289 | + } | |
279 | 290 | }) |
280 | 291 | \ No newline at end of file | ... | ... |
packageA/pages/chongzhiDetails/chongzhiDetails.wxml
... | ... | @@ -3,16 +3,30 @@ |
3 | 3 | <view class="container"> |
4 | 4 | <view> |
5 | 5 | <view class="banner-container" wx:if="{{show_img}}"> |
6 | - <image class="img-block" src="{{url+show_img}}" mode="widthFix" | |
7 | - lazy-load="true" binderror="bind_err" data-errorimg="show_img" ></image></view> | |
8 | - | |
9 | - <view class="list"> | |
10 | - <view class="title-container"> | |
11 | - <view class="title"> | |
12 | - <view>女王专享</view> | |
13 | - <view>你的美丽我来缔造</view> | |
14 | - </view> | |
6 | + | |
7 | + <navigator url="{{item.ad_weapplink}}" class="s1_gk_a1" wx:if="{{g_filter.has_char(ad.ad_weapplink,'plugin')>=0}}"> | |
8 | + <image class="img-block" src="{{url+show_img}}" mode="widthFix" | |
9 | + lazy-load="true" binderror="bind_err" data-errorimg="show_img" ></image> | |
10 | + </navigator> | |
11 | + | |
12 | + <block wx:else> | |
13 | + <image class="img-block" src="{{url+show_img}}" mode="widthFix" bindtap="go_url" | |
14 | + data-url="{{ad.ad_weapplink}}" | |
15 | + lazy-load="true" binderror="bind_err" data-errorimg="show_img" ></image> | |
16 | + </block> | |
17 | + | |
18 | + | |
19 | + </view> | |
20 | + | |
21 | + <view class="title-container" wx:else> | |
22 | + <view class="title"> | |
23 | + <view>女王专享</view> | |
24 | + <view>你的美丽我来缔造</view> | |
15 | 25 | </view> |
26 | + </view> | |
27 | + | |
28 | + <view class="list"> | |
29 | + | |
16 | 30 | <view > |
17 | 31 | <view class="list-item flex" wx:for="{{result.givelist}}"> |
18 | 32 | <!-- 左图片 --> | ... | ... |
packageA/pages/chongzhiDetails/g_filter.wxs
... | ... | @@ -6,6 +6,11 @@ var is_acting = function(endtime){ |
6 | 6 | var bijiao = getDate(endtime) - getDate(); |
7 | 7 | return bijiao > 0 ? true : false; |
8 | 8 | } |
9 | +var has_char=function(url,key){ | |
10 | + if(!url) return -1; | |
11 | + return url.indexOf(key); | |
12 | +} | |
9 | 13 | module.exports = { |
10 | - is_acting:is_acting | |
14 | + is_acting:is_acting, | |
15 | + has_char:has_char, | |
11 | 16 | } |
12 | 17 | \ No newline at end of file | ... | ... |