小程序接口代码:
onLoasd:function(){
var that = this //调用应用实例获取全局数据
wx.request({
url:‘ http://localhost.8080 ‘,//示例 仅供参考;
header:{
‘content-type’:application/json’
},
success:function(res){
console.log(res.data.result.goods_list)
that.setData({
goods_list:res.data.result.goods_list
})
}
})
}
})