zhaoxiaohai 3 år sedan
förälder
incheckning
1a1e863ad9

+ 13 - 4
components/My_BannerSwiper/index.js

@@ -23,11 +23,20 @@ Component({
         /* 轮播跳转 */
         clickToPage(e) {
             const {
-                url
+                index
             } = e.target.dataset;
-            if (url) wx.navigateTo({
-                url: url,
-            })
+            const bannerData = this.data.swiperBannerList[index];
+            if (bannerData.flinktype == 'URL') {
+                //url类型内部跳转
+                wx.navigateTo({
+                    url: bannerData.fhyperlink,
+                })
+            } else if (bannerData.flinktype == 'DATA' && bannerData.fdatatable == "tactivity") {
+                //活动类型跳转展会
+                wx.navigateTo({
+                    url: '/pages/tradeShow/index?id=' + bannerData.fdataid,
+                })
+            }
         }
     }
 })

+ 1 - 1
components/My_BannerSwiper/index.wxml

@@ -3,7 +3,7 @@
     <view class="swiperBanner">
         <swiper autoplay indicator-dots circular="true" indicator-active-color="#fff" indicator-color="rgba(255,255,255,.5)">
             <swiper-item wx:for="{{swiperBannerList}}" wx:key="index">
-                <image src="{{item.attinfos[0].fobsurl}}" data-url="{{item.fhyperlink}}" catchtap="clickToPage" mode="aspectFill"></image>
+                <image src="{{item.attinfos[0].fobsurl}}" data-index="{{index}}" catchtap="clickToPage" mode="aspectFill"></image>
             </swiper-item>
         </swiper>
     </view>

+ 2 - 2
pages/tradeShow/index.js

@@ -21,12 +21,12 @@ Page({
             "classname": "publicmethod.live.live",
             "method": "agentList",
             "content": {
-                "tactivityidid": 1
+                "tactivityidid": options.id
             }
         }).then(res => {
             console.log(res)
         });
-        
+
         /* 获取轮播图 */
         const bannerList = getApp().globalData.bannerDataList.filter(value => value.flocation == 'activity_head');
         this.setData({