var WxParse = require("../../wxParse/wxParse.js");
var app = getApp()
Page({
  data: {
    type:'',
    url:'',
    detail:''
  },
  onLoad: function (options) {
    console.log(options)
    var that = this;
    this.setData({
      type:options.type,
      url:options.url,
      detail: options.detail
    })
    console.log(options.url)
    wx.setNavigationBarTitle({
      title: options.name
    })
    if(options.type=='text'){
      app.request("/ad?id="+options.url, '', "GET").then(res => {
        console.log(res)
        WxParse.wxParse("content", "html", res.data.detail, that)
      }).catch(err => {
        console.log(err)
      })
    }
  },
  onReady: function () {

  },
  onShow: function () {

  },
  onHide: function () {

  },
  onUnload: function () {

  },
  onPullDownRefresh: function () {

  },
  onReachBottom: function () {

  },
  onShareAppMessage: function () {
    
  }
})