let app = getApp()
var WxParse = require('../../../wxParse/wxParse.js')
Page({

  /**
   * 页面的初始数据
   */
  data: {
    listdetail: {},
    IMG_NAME: app.IMG_NAME
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (e) {
    let that = this
    console.log(e)
    app.AjaxRequest('get', {
      'content-type': 'application/json',
      'Authorization': 'Bearer ' + app.Getopenid()
    }, '/manage/detail', {
      id: e.id
    }, function (res) {
      if (res.code == 0) {
        var article = res.data.serviceContent
        that.setData({
          listdetail: res.data
        })
        if (article) {
          WxParse.wxParse('article', 'html', article, that)
        }
      } else {
        wx.hideLoading()
      }
    })
  },
  apply() {
    wx.navigateTo({
      url: '../serviceApply/serviceApply?id=' + this.data.listdetail.id,
    })
  }
})