// 微信获取ip
that = this; wx.request({ url: 'http://ip-api.com/json', success:function(e){ that.setData({ motto:e.data }) } });