Commit a674fcbf331784483065c8589a1c03479aa0c82a
1 parent
ceee11d9
重新推送的优化
Showing
5 changed files
with
56 additions
and
16 deletions
components/nodata/nodata.js
| 1 | Component({ | 1 | Component({ | 
| 2 | - externalClasses: ['nodata-container'], | 2 | + externalClasses: ['nodata-container'], | 
| 3 | + //在.js文件中 | ||
| 4 | + properties: { | ||
| 5 | + // 简单的定义方式 | ||
| 6 | + // max:Number | ||
| 7 | + // 完整的定义方式 | ||
| 8 | + title:{ | ||
| 9 | + type:String, | ||
| 10 | + value:10 | ||
| 11 | + } | ||
| 12 | + }, | ||
| 3 | /*** 页面的初始数据***/ | 13 | /*** 页面的初始数据***/ | 
| 4 | data: { | 14 | data: { | 
| 5 | 15 | 
components/nodata/nodata.wxml
| 1 | <view class="nodata-container"> | 1 | <view class="nodata-container"> | 
| 2 | <view class="nodata-icon iconfont icon-nodata"></view> | 2 | <view class="nodata-icon iconfont icon-nodata"></view> | 
| 3 | - <view class="nodata-title">暂无数据</view> | 3 | + <view class="nodata-title">{{ftitle?title:'暂无数据'}}</view> | 
| 4 | </view> | 4 | </view> | 
packageA/pages/chongzhiDetails/chongzhiDetails.js
| @@ -23,7 +23,8 @@ Page({ | @@ -23,7 +23,8 @@ Page({ | ||
| 23 | */ | 23 | */ | 
| 24 | onLoad: function (options) { | 24 | onLoad: function (options) { | 
| 25 | 25 | ||
| 26 | - const self = this; | 26 | + wx.showLoading(); | 
| 27 | + const self = this; | ||
| 27 | if(options.type) | 28 | if(options.type) | 
| 28 | self.setData({type:options.type}); | 29 | self.setData({type:options.type}); | 
| 29 | 30 | ||
| @@ -50,11 +51,11 @@ Page({ | @@ -50,11 +51,11 @@ Page({ | ||
| 50 | 51 | ||
| 51 | 52 | ||
| 52 | getApp().request.promiseGet("/api/weshop/ad/page",{ | 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 | }).then(res=>{ | 55 | }).then(res=>{ | 
| 55 | if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){ | 56 | if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){ | 
| 56 | var a = res.data.data.pageData; | 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,7 +95,9 @@ Page({ | ||
| 94 | self.setData({ | 95 | self.setData({ | 
| 95 | result: result, | 96 | result: result, | 
| 96 | }); | 97 | }); | 
| 97 | - | 98 | + | 
| 99 | + wx.hideLoading(); | ||
| 100 | + | ||
| 98 | }, | 101 | }, | 
| 99 | }); | 102 | }); | 
| 100 | 103 | ||
| @@ -276,4 +279,12 @@ Page({ | @@ -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 | \ No newline at end of file | 291 | \ No newline at end of file | 
packageA/pages/chongzhiDetails/chongzhiDetails.wxml
| @@ -3,16 +3,30 @@ | @@ -3,16 +3,30 @@ | ||
| 3 | <view class="container"> | 3 | <view class="container"> | 
| 4 | <view> | 4 | <view> | 
| 5 | <view class="banner-container" wx:if="{{show_img}}"> | 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 | </view> | 25 | </view> | 
| 26 | + </view> | ||
| 27 | + | ||
| 28 | + <view class="list"> | ||
| 29 | + | ||
| 16 | <view > | 30 | <view > | 
| 17 | <view class="list-item flex" wx:for="{{result.givelist}}"> | 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 +6,11 @@ var is_acting = function(endtime){ | ||
| 6 | var bijiao = getDate(endtime) - getDate(); | 6 | var bijiao = getDate(endtime) - getDate(); | 
| 7 | return bijiao > 0 ? true : false; | 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 | module.exports = { | 13 | module.exports = { | 
| 10 | - is_acting:is_acting | 14 | + is_acting:is_acting, | 
| 15 | + has_char:has_char, | ||
| 11 | } | 16 | } | 
| 12 | \ No newline at end of file | 17 | \ No newline at end of file | 
