Commit 37c0bd4ea38ded4a684828f3ec210eb1e50c05bf
1 parent
174fe04d
分类广告
Showing
3 changed files
with
26 additions
and
5 deletions
pages/goods/categoryList/categoryList.js
| ... | ... | @@ -75,8 +75,8 @@ Page({ |
| 75 | 75 | load: 0, |
| 76 | 76 | xmlist: null, |
| 77 | 77 | |
| 78 | - is_retail_price:0 //是否显示零售价 | |
| 79 | - | |
| 78 | + is_retail_price:0, //是否显示零售价 | |
| 79 | + banner: null, //分类广告 | |
| 80 | 80 | |
| 81 | 81 | }, |
| 82 | 82 | |
| ... | ... | @@ -842,6 +842,14 @@ Page({ |
| 842 | 842 | } |
| 843 | 843 | this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, cat_id: cid, stylePage: 1, lastMsg: false, }); |
| 844 | 844 | } |
| 845 | + //==1的时候,样式2的时候分类广告切换 | |
| 846 | + if (this.data.is_used_share==1) { | |
| 847 | + let banner=null; | |
| 848 | + | |
| 849 | + this.setData({ | |
| 850 | + banner | |
| 851 | + }) | |
| 852 | + } | |
| 845 | 853 | |
| 846 | 854 | }, |
| 847 | 855 | |
| ... | ... | @@ -1202,7 +1210,12 @@ Page({ |
| 1202 | 1210 | resetData: function () { |
| 1203 | 1211 | a.resetConfig(), this.data.requestData = null, this.data.currentPage = 1; |
| 1204 | 1212 | }, |
| 1205 | - | |
| 1213 | + go_ad: function (e) { | |
| 1214 | + var url = e.currentTarget.dataset.url; | |
| 1215 | + if (!url || url == '') return; | |
| 1216 | + if (url[0] != '/') url = '/' + url; | |
| 1217 | + getApp().goto(url); | |
| 1218 | + }, | |
| 1206 | 1219 | //---回复最初的设置--- |
| 1207 | 1220 | restoreData: function () { |
| 1208 | 1221 | this.setData({ | ... | ... |
pages/goods/categoryList/categoryList.wxml
| ... | ... | @@ -296,7 +296,15 @@ |
| 296 | 296 | <!-- 品类--> |
| 297 | 297 | <block wx:if="{{is_show_pl&&select_classify_on!=221&&select_classify_on!=220&&select_classify_on!=223}}"> |
| 298 | 298 | <!-- <block wx:if="{{select_classify_on!=221&&select_classify_on!=220&&select_classify_on!=223&&is_level_three!=1}}"> --> |
| 299 | - <view style="width: 515rpx;height: 180rpx;background-color: rebeccapurple;margin: 0 auto;">广告</view> | |
| 299 | + <view wx:if="{{one_level_classify && one_level_classify[select_classify_on] && one_level_classify[select_classify_on].items && one_level_classify[select_classify_on].items.ad_list && one_level_classify[select_classify_on].items.ad_list.length>0}}" style="width: 515rpx;height: 200rpx;margin: 0 auto;"> | |
| 300 | + <swiper circular="true" indicator-dots indicator-active-color="#fff" autoplay="true" class="swiper_box" duration="1000" interval="3000" vertical="" bindchange="bannerSwiperChange" style="height:200rpx;min-height: 200rpx;"> | |
| 301 | + <swiper-item wx:for="{{one_level_classify[select_classify_on].items.ad_list}}" wx:key="banner" class="swiperItem"> | |
| 302 | + <view class="slide-image-frame"> | |
| 303 | + <image bindtap='go_ad' data-url="{{item.ad_weapplink}}" style="width: 100%;height:200rpx;" class="slide-image" src="{{ iurl + item.ad_code}}" data-index="{{index}}" lazy-load="true" ></image> | |
| 304 | + </view> | |
| 305 | + </swiper-item> | |
| 306 | + </swiper> | |
| 307 | + </view> | |
| 300 | 308 | <view class="my-container"> |
| 301 | 309 | <view class="classify_name fs28 flex-space-between ai-center" data-pid="0" data-cid="{{cat_id}}" bindtap='select_more'> |
| 302 | 310 | <view class="classify_title ellipsis-1">{{classify_name}}</view> | ... | ... |
pages/goods/categoryList/categoryList.wxss