forked from nsjcy/frontEnd/nsjcy

1
liuwh
2020-05-26 aba05ff402b2b6a7ed9e3eedee43addc1b7eee44
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// 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,
    })
  }
 
})