// succ.wxml <view>手机IP:{{motto.query}}</view> // succ.js var app = getApp() Page({ data: { motto: '' // IP地址 }, onLoad: function (e) { // 获取参数 var that = this; wx.request({ // 获取ip url: 'http://ip-api.com/json', success: function (e) { that.setData({ motto: e.data }) } }) } })
来源:博客园
作者:aaronthon
链接:https://www.cnblogs.com/aaronthon/p/11673457.html