qq_断誸_4
2019-04-17 09:37
小程序怎么在前端接受不到后台传回来的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; }
url缺那个全局路由- -
success拼写错误
url地址错误和变量错误
SpringBoot+MyBatis搭建迷你小程序
91499 学习 · 621 问题
相似问题