
var app = getApp()
var that;
Page({
  data: {
    date: app.globalData.month

  },
  onLoad(e) {
    that = this;
    console.log(e);
    dd.setNavigationBar({ title: "事件详情" });
    if(e.id){
        that.getDetail(e.id);
    }
  },
  showImg(e){
      var index=e.target.dataset.index;
      var item=e.target.dataset.item
      dd.previewImage({
        current: index,
        urls: item
      });
  },
  activeItem(e) {
    var index = e.target.dataset.index;
    this.setData({ activeIndex: index })
  },
  openSearch() {
    app.globalData.showToast("暂不支持筛选");
  },
  getDetail(id) {
    app.$get("api/integral/statistics/integral/info", { event_id: id }).then((res) => {
      var data = res.data.data;
      app.globalData.types.forEach(item => {
        if (item.id == data.pt_id) {
          data.typeName = item.name
        }
      });
      this.setData({ dataDetail: data })
    })
  },
});
