微信小程序页面跳转过程的参数传递

时间:2020-05-02 22:30:55   收藏:0   阅读:102
wx.navigateTo({ url: "../api/getOrderList?orderStatus=" + 0 })
wx.navigateTo({ url: "../api/getOrderList?orderStatus=" + 0 + "&psize=" + 10 +"&pno="1 });
let params = { orderStatus:0, psize:10, pno:1 }; 
wx.navigateTo({ url: "../api/getOrderList?params=" + JSON.stringify(params) });

接收页:

onLoad: function(options){
    let params = JSON.parse(options.params);
}
let params = {
    orderStatus: 0,
    psize: 10,
    pno: 1,
    picUrl: "https://xxx.com/sources/images/goods/653435.png?x-oss-process=image/resize,m_fill,w_500,h_500/quality,q_90"
};
wx.navigateTo({ url: "../api/getOrderList?params=" + encodeURIComponent(JSON.stringify(params)) });

接收页:

onLoad:function(options)
    let params = JSON.parse(decodeURIComponent(options.params));
    this.setData({ parms });
}
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!