"use strict";
const common_vendor = require("../../../common/vendor.js");
const request_api = require("../../../request/api.js");
const common_assets = require("../../../common/assets.js");
const _sfc_main = {
  data() {
    return {
      navH: common_vendor.inject("navHeight"),
      eventId: "",
      //事件id
      categoryList: ["相关标的", "相关概念", "历史事件", "时间传导链分析", "关联数据"],
      selectCategory: 0,
      headingList: ["名称代码", "分时图", "开盘价", "最新价", "涨跌幅"]
    };
  },
  onLoad(e) {
    if (e.id) {
      this.eventId = e.id;
      this.getEventDetailsData();
    }
  },
  methods: {
    /**
     * 点击切换分类
     */
    clickCategoryItem(index) {
      if (this.selectCategory != index) {
        this.selectCategory = index;
      }
    },
    /**
     * 点击查看股票详情
     */
    clickStockItem() {
      common_vendor.index.navigateTo({
        url: "/pages/index/stockDetails/stockDetails"
      });
    },
    /**
     * 点击查看相关概念
     */
    clickConceptItem() {
      common_vendor.index.navigateTo({
        url: "/pages/index/conceptDetails/conceptDetails"
      });
    },
    /**
     * 点击评论
     */
    clickComment() {
      this.$refs["popup"].open();
    },
    closeCommentPopup() {
      this.$refs["popup"].close();
    },
    /**
     * 获取事件详情数据
     */
    getEventDetailsData() {
      let eventId = this.eventId;
      request_api.eventDetails(eventId).then((res) => {
      }).catch((error) => {
      });
    }
  }
};
if (!Array) {
  const _easycom_navBar2 = common_vendor.resolveComponent("navBar");
  const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
  (_easycom_navBar2 + _easycom_uni_popup2)();
}
const _easycom_navBar = () => "../../../components/navBar/navBar.js";
const _easycom_uni_popup = () => "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
if (!Math) {
  (_easycom_navBar + _easycom_uni_popup)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  return common_vendor.e({
    a: common_vendor.p({
      leftText: "事件详情"
    }),
    b: common_assets._imports_0,
    c: common_vendor.f($data.categoryList, (item, index, i0) => {
      return common_vendor.e({
        a: common_vendor.t(item),
        b: $data.selectCategory == index
      }, $data.selectCategory == index ? {} : {}, {
        c: common_vendor.n("item relative " + ($data.selectCategory == index ? "select" : "")),
        d: index,
        e: common_vendor.o(($event) => $options.clickCategoryItem(index), index)
      });
    }),
    d: $data.selectCategory == 0
  }, $data.selectCategory == 0 ? {
    e: common_vendor.f($data.headingList, (item, index, i0) => {
      return {
        a: common_vendor.t(item),
        b: index
      };
    })
  } : {}, {
    f: $data.selectCategory == 0
  }, $data.selectCategory == 0 ? {} : {}, {
    g: $data.selectCategory == 1
  }, $data.selectCategory == 1 ? {
    h: common_vendor.o(($event) => $options.clickConceptItem())
  } : {}, {
    i: common_vendor.s("top:" + $data.navH + "px;"),
    j: common_assets._imports_1$1,
    k: common_assets._imports_2$1,
    l: common_vendor.o(($event) => $options.clickComment()),
    m: common_assets._imports_3$1,
    n: common_assets._imports_4$2,
    o: common_vendor.o(($event) => $options.closeCommentPopup()),
    p: common_assets._imports_5$2,
    q: common_assets._imports_6,
    r: common_assets._imports_5$2,
    s: common_vendor.sr("popup", "6e1a61f1-1"),
    t: common_vendor.p({
      type: "bottom"
    })
  });
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages/index/eventDetails/eventDetails.js.map
