forked from nsjcy/frontEnd/nsjcy

Mr Ke
2020-05-27 58ae2ba21efcd85df331cf996a94038a77302b51
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
// pages/zhdtInfo/zhdtInfo.js
var app = getApp();
Page({
 
  /**
   * 页面的初始数据
   */
  data: {
    id: '',
    swiperList: [],
    data:{},
  },
 
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log(options.id)
    var that = this;
    wx.request({
      url: app.globalData.url + '/api/article/publicMsgDetails?msgId=' + options.id,
      success: function (res) {
        wx.hideLoading();
        console.log(res)
        if (res.data.code == 0) {
          that.setData({
            data: {
              ...res.data.data,
              createTime: app.formatDate(res.data.data.createTime),
            }
          })
        } else {
          wx.showModal({
            title: '提示',
            content: "请求失败!"
          })
        }
      }
    })
  },
})