// pages/createSub/createSub.js const app = getApp(); const $v = app.globalData.createInfo; Page({ /** * 页面的初始数据 */ data: { user: app.globalData.imgUrl + '/image/user.svg', question: {}, confirm: true, data: {} }, // 去单选页面 toRadio(e) { var types = e.currentTarget.dataset.type; wx.navigateTo({ url: '/pages/radio/radio?type=' + types, }) }, /** * 生命周期函数--监听页面加载 */ onLoad: function(options) { var that = this; wx.request({ url: app.globalData.url + '/api/question/examination', success: function(res) { console.log(res.data.data) if (res.data.code == 0) { that.setData({ data: res.data.data }) } else { wx.showModal({ title: '提示', content: "请求失败!" }) } } }) }, businessSchedule: function(event) { wx.navigateTo({ url: '../createSub/createSub?id=' + this.data.data.id, }) } })