var app = getApp() Page({ /** * 页面的初始数据 */ data: { openId: "", orgList: [], orgId: "", orgName: "" }, onLoad: function (options) { wx.showNavigationBarLoading() var that = this; var url = app.globalData.cloudBase + "/Wx/Rtu/Org/List"; wx.request({ url: url, method: 'GET', // data: { // openid: this.data.openid // }, header: { "Content-Type": "json" }, success: function (res) { wx.hideNavigationBarLoading(); if (res.data.code === "0") { that.setData({ orgList: res.data.data }); } }, fail: function (error) { wx.hideNavigationBarLoading(); } }) }, radioChange: function (e) { const value = e.detail.value; const values = value.split(":"); const id = values[0]; const name = values[1]; var pages = getCurrentPages(); var prevPage = pages[pages.length - 2]; //上一个页面 的数据data prevPage.setData({ orgId: id, orgName: name }) this.setData({ orgId: id, orgName: name }); } })