Browse Source

首页banner图跳转web-view页面

ZhangWenQiang 6 năm trước cách đây
mục cha
commit
74e575eaa5
3 tập tin đã thay đổi với 8 bổ sung2 xóa
  1. 5 0
      pages/index/index.js
  2. 1 1
      pages/index/index.wxml
  3. 2 1
      pages/web-view/web-view.json

+ 5 - 0
pages/index/index.js

@@ -221,6 +221,7 @@ Page({
   //轮播图跳转详情页
   toDetail_slide(e) {
     var id = e.currentTarget.dataset.id;
+    var url = e.currentTarget.dataset.url;
     var arr;
     if (id) {
       arr = id.split(",");
@@ -229,6 +230,10 @@ Page({
       wx.navigateTo({
         url: '../detail/index?hpPositionId=' + positionId + "&cate=" + cate,
       })
+    } else if (url) {
+      wx.navigateTo({
+        url: '../web-view/web-view?url=' + url,
+      })
     }
   },
 

+ 1 - 1
pages/index/index.wxml

@@ -20,7 +20,7 @@
   <swiper indicator-dots="true" autoplay="true" interval="5000" duration="500" circular="true" indicator-active-color="#1E62A7" style="height:360rpx">
     <block wx:for="{{imgList}}" wx:key="picUrl">
       <swiper-item>
-        <image src="{{item.picUrl}}" catchtap='toDetail_slide' data-id="{{item.positionDetail}}" class="slide-image" mode='widthFix' bindload='imageLoad' />
+        <image src="{{item.picUrl}}" catchtap='toDetail_slide' data-id="{{item.positionDetail}}" data-url="{{item.picDetail}}" class="slide-image" mode='widthFix' bindload='imageLoad' />
       </swiper-item>
     </block>
   </swiper>

+ 2 - 1
pages/web-view/web-view.json

@@ -1,3 +1,4 @@
 {
-  "usingComponents": {}
+  "usingComponents": {},
+  "navigationBarTitleText": "开心工作"
 }