小程序怎么在前端接受不到后台传回来的数据
小程序怎么在前端接受不到后台传回来的JSON数据
onShow: function () {var that = this;wx.request({url: "http://localhost:8082/demo/listArea",method: "GET",data: {},sucess: function(res){var list = res.data.areaList;if(list == null){var toastText = '获取数据失败' + res.data.errMsg;wx.showToast({title: toastText,icon:'',duration: 2000});} else {that.setData({list:list});}}})},
data: {list:[]},
<block wx:for="{{list}}"><view class="widget"><text class="column">{{item.areaId}}</text><text class="column">{{item.areaName}}</text><text class="column">{{item.priority}}</text><text class="link-column"><navigator class="link" url="../demo/getareaId?areaId={{item.areaId}}">编辑</navigator><text class="link" bindtap="deleteArea" data-areaid="{{item.areaId}}"data-areaname="{{item.areaName}}" data-index="{{index}}">删除</text></text></view></block>
public Map<String, Object> listArea(){ Map<String, Object> modelMap = new HashMap<>(); List<Area> list = areaService.queryArea(); modelMap.put("areaList", list); return modelMap; }