Explorar o código

异业合作页面跳转

kk.shi %!s(int64=3) %!d(string=hai) anos
pai
achega
bff3dd09e5
Modificáronse 2 ficheiros con 22 adicións e 1 borrados
  1. 21 0
      pages/welfareMall/index/index.js
  2. 1 1
      pages/welfareMall/index/index.wxml

+ 21 - 0
pages/welfareMall/index/index.js

@@ -182,5 +182,26 @@ Page({
       })
     }
 
+  },
+
+  goToAd(e){
+    var appId = e.currentTarget.dataset.appid;
+    var path = e.currentTarget.dataset.path;
+ 
+    if(appId && path){
+      wx.navigateToMiniProgram({
+        appId: appId,
+        path: path,
+        success(res) {
+          // 打开成功
+        }
+      })
+    }
+    if(!appId && path){
+      wx.navigateTo({
+        url: path,
+      })
+    }
+
   }
 })

+ 1 - 1
pages/welfareMall/index/index.wxml

@@ -68,7 +68,7 @@
       <view class="c_l_top_l">沪上联名</view>
     </view>
     <view class="jointly-style">
-      <view class="jointly-list" wx:for="{{adList}}" data-appid="{{item.appId}}" data-path="{{item.path}}" wx:key="unique">
+      <view class="jointly-list" wx:for="{{adList}}" data-appid="{{item.appId}}" data-path="{{item.path}}" wx:key="unique" bindtap="goToAd">
         <image class="jointly-img" src="{{item.figure}}"></image>
         <view class="jointly-text over-ellipsis-two">{{item.title}}</view>
       </view>