小程序跳轉H5頁面 :
wxml:
<view bindtap="clickTab"></view>
js:
clickTab: function (e) {
var that = this;
wx.navigateTo({
url: '/pages/webview/webview?url=' + encodeURIComponent(that.data.url),
})
},
需要一箇中間頁面webview
wxml:
<web-view src='{{url}}' bindmessage="bindGetMsg"></web-view>
js:
onLoad: function (options) {
// console.log(options)
var that = this
var url = decodeURIComponent(options.url);
that.setData({
url: url
});
},
H5頁面跳轉小程序:
$(''").click(function () {
wx.miniProgram.navigateTo({url:'/pages/index/exponent'})
})
$('ele').on("click", function(){
var href=$(this).find('a').attr('href').split('-')[1].split('.')[0];
wx.miniProgram.navigateTo({
url: '/pages/goods/goods, //不需要參數的
url: '/pages/goods/goods?goods_id='+href, //需要參數的
});
})
switchTab是跳轉到taBar頁面