const app = getApp() Page({ /** * 页面的初始数据 */ data: { frameStyle: { useTop: true, name: '账号绑定', leftArrow: false, useBar: false }, id: '', type: '' }, // 返回 back: function () { wx.navigateBack({ delta: 1 }) }, toBind: function () { const that = this; let id = that.data.id; let type = that.data.type; wx.showModal({ title: '提示', content: '你确定要使用此微信绑定账号吗?', async success(res) { if (res.confirm) { // 学校 let arr; if (type == '1') { arr = await app.$get(`/school/${id}`) }; if (arr.errcode == '0') { let params = {} } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) } } } }) }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { const that = this; that.setData({ id: options.id || '62ff209808c3ce998df15dd3', type: options.type || '1' }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { const that = this; }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { } })