一、不需要传参
Toorder: function (e) {
console.log(e)
wx.navigateTo({
url: '/pages/order/order'
})
},
二、点击传参
点击的wxml:
<button bindtap="entercart" data-id="{{id}}">加入购物车</button>
点击的js:
entercart: function (event) {
console.log(event);
var p = event.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/cart/cart?id=' + p
})
}
跳转到的js接收参数:
onLoad: function (options) {
let id = options.id
}