onLoad: function () {
var that = this;
//新闻资讯
wx.request({
url: 'http://www.yzm.com/index.php/api/news/index',
method: 'POST',
data: {
cat_id: 1,
},
header: {
'content-type': 'application/x-www-form-urlencoded' // 默认值
},
success(res) {
that.setData({
news: res.data.data
});
}
})
}
微信小程序前端发送参数到后端
最新推荐文章于 2023-07-07 16:44:33 发布