"use strict";
const common_vendor = require("../../../../common/vendor.js");
const components_request = require("../../../../components/request.js");
const components_formatDate = require("../../../../components/formatDate.js");
const _sfc_main = {
  data() {
    return {
      title: "Hello",
      item: {},
      coinNumlist: [],
      triggered: false
    };
  },
  onLoad(options) {
    const eventChannel = this.getOpenerEventChannel();
    eventChannel.on("itemDetail", (data) => {
      this.item = data.item;
      this.getCoinNum(this.item);
    });
  },
  methods: {
    // 下拉刷新
    onRefresherRefresh() {
      this.triggered = true;
      this.coinNumlist = [];
      this.getCoinNum(this.item);
    },
    // 获取具体金币数量
    getCoinNum(item) {
      components_request.request({
        url: "pk/fetchDetailPkDataWithId",
        method: "POST",
        data: {
          id: item.id
        },
        userInfo: true
      }).then((res) => {
        if (res.code == 200) {
          this.coinNumlist = res.data;
          this.triggered = false;
        } else {
          common_vendor.index.__f__("log", "at pages/Mine/minecomponents/DetailsPKRecords/DetailsPKRecords.vue:141", "获取金币数量失败");
        }
      });
    },
    formatDate: components_formatDate.formatDate,
    // 返回上一页
    onBack() {
      common_vendor.index.navigateBack({
        delta: 1
      });
    }
  }
};
if (!Array) {
  const _component_uni_card = common_vendor.resolveComponent("uni-card");
  _component_uni_card();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  return common_vendor.e({
    a: common_vendor.o$1((...args) => $options.onBack && $options.onBack(...args)),
    b: $data.item.anchorIconA,
    c: $data.item.winnerAnchorId == $data.item.anchorIdA
  }, $data.item.winnerAnchorId == $data.item.anchorIdA ? {} : {}, {
    d: common_vendor.t($data.item.anchorIdA),
    e: common_vendor.t($options.formatDate($data.item.pkTime)),
    f: $data.item.userACoins !== null
  }, $data.item.userACoins !== null ? {
    g: common_vendor.t($data.item.userACoins)
  } : {}, {
    h: $data.item.anchorIconB,
    i: $data.item.winnerAnchorId == $data.item.anchorIdB
  }, $data.item.winnerAnchorId == $data.item.anchorIdB ? {} : {}, {
    j: common_vendor.t($data.item.anchorIdB),
    k: common_vendor.t($options.formatDate($data.item.pkTime)),
    l: $data.item.userBCoins !== null
  }, $data.item.userBCoins !== null ? {
    m: common_vendor.t($data.item.userBCoins)
  } : {}, {
    n: common_vendor.f($data.coinNumlist, (items, index, i0) => {
      return {
        a: common_vendor.t(items.anchorCoinA),
        b: items.anchorIdA == items.winnerAnchorId ? "#00fbff21" : "#ff000011",
        c: common_vendor.t(items.anchorCoinB),
        d: items.anchorIdB == items.winnerAnchorId ? "#00fbff21" : "#ff000011",
        e: index,
        f: "414631de-0-" + i0
      };
    }),
    o: common_vendor.o$1((...args) => $options.onRefresherRefresh && $options.onRefresherRefresh(...args)),
    p: $data.triggered
  });
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-414631de"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/pages/Mine/minecomponents/DetailsPKRecords/DetailsPKRecords.js.map
