let config = require("../../config/config.js");
let app = getApp();
const Http = require("../../utils/HttpBasics");
const util = require("../../utils/util");
Page({
  data: {
    data: {},
    couponId: null,
    orderId: "",
    day: "",
    hour: "",
    minute: "",
    nodes: ''
  },
  onLoad(options) {
    let that = this;
    if (options.id){
      Http.get({
        url: config.api.bannerDetail,
        data: {
          id: options.id
        }
      }).then(res => {
        if(res.data.type==2){
          console.log(res.data.html,33333333)
          // console.log(JSON.parse(res.data.html),222222222222)
          that.setData({
            nodes: res.data.html
          })
        }
        that.setData({
          data: res.data
        });
      }).catch(err => {
        wx.showToast({
          title: err.errMsg,
          icon: 'none',
          duration: 2000,
          mask: false
        });
      })
    }
  },
  gotoactdetail:function(){
    let that = this;
    console.log(that.data.data.detail)
    
    wx.navigateTo({
      url: `/pages/actdetail/actdetail?detail=${that.data.data.detail}`,
    })
  }
});
