matchSignDetail.js 11.8 KB
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_match = require("../../common/match.js");
require("../../common/request.js");
require("../../config.js");
require("../../common/login.js");
require("../../common/api.js");
if (!Array) {
  const _easycom_uni_tag2 = common_vendor.resolveComponent("uni-tag");
  const _easycom_uni_list_item2 = common_vendor.resolveComponent("uni-list-item");
  const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
  const _easycom_uni_list2 = common_vendor.resolveComponent("uni-list");
  (_easycom_uni_tag2 + _easycom_uni_list_item2 + _easycom_uni_icons2 + _easycom_uni_list2)();
}
const _easycom_uni_tag = () => "../../uni_modules/uni-tag/components/uni-tag/uni-tag.js";
const _easycom_uni_list_item = () => "../../uni_modules/uni-list/components/uni-list-item/uni-list-item.js";
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
const _easycom_uni_list = () => "../../uni_modules/uni-list/components/uni-list/uni-list.js";
if (!Math) {
  (_easycom_uni_tag + _easycom_uni_list_item + _easycom_uni_icons + _easycom_uni_list)();
}
const _sfc_main = {
  __name: "matchSignDetail",
  setup(__props) {
    const data = common_vendor.reactive({
      list: {},
      signId: "",
      memberList: [],
      isSign: false,
      showForm: false,
      auditStatus: "",
      payStatus: "",
      base: {}
    });
    const {
      list,
      signId,
      memberList,
      isSign,
      showForm,
      payStatus,
      auditStatus,
      base
    } = common_vendor.toRefs(data);
    let groupId;
    common_vendor.onLoad((option) => {
      console.log("signdetail", option);
      signId.value = option.id;
      groupId = option.groupId;
      auditStatus.value = option.auditStatus;
      payStatus.value = option.payStatus;
      getData();
    });
    function getData() {
      common_match.getMySignListFromBaoXiang({
        cptId: signId.value,
        groupId
      }).then((res) => {
        var _a;
        list.value = res.data;
        for (const p of list.value) {
          if ((_a = p.extraPeronInfo) == null ? void 0 : _a.personInfo) {
            p.extraformData = JSON.parse(p.extraPeronInfo.personInfo) || [];
          }
        }
        base.value = list.value[0];
      });
    }
    function goConti() {
      if (base.value.signInfo[0].cptSignType == "0") {
        common_vendor.index.navigateTo({
          url: `/pages_match/match/choose_project?matchId=${signId.value}`
        });
      } else if (base.value.signInfo[0].cptSignType == "1") {
        common_vendor.index.navigateTo({
          url: `/pages_match/match/choose_sportman?matchId=${signId.value}&groupId=${groupId}&signType=${base.value.signInfo[0].cptSignType}`
        });
      } else {
        common_vendor.index.navigateTo({
          url: `/pages_match/match/add_rank?matchId=${signId.value}&groupId=${groupId}&signType=${base.value.signInfo[0].cptSignType}`
        });
      }
    }
    function download() {
      common_match.downloadpz(signId.value, groupId).then((res) => {
        goWebView(res.data);
      });
    }
    function goWebView(url) {
      url = url.replace("http://", "https://");
      common_vendor.index.showLoading({
        title: "下载中"
      });
      common_vendor.index.downloadFile({
        url,
        success: function(res) {
          common_vendor.index.hideLoading();
          var filePath = res.tempFilePath;
          common_vendor.index.showLoading({
            title: "正在打开"
          });
          common_vendor.index.openDocument({
            filePath,
            showMenu: true,
            success: function(res2) {
              common_vendor.index.hideLoading();
            },
            fail: function(err) {
              common_vendor.index.hideLoading();
              common_vendor.index.showToast({
                title: err,
                icon: "none",
                duration: 2e3
              });
            }
          });
        },
        fail: function(error) {
          common_vendor.index.hideLoading();
          common_vendor.index.showToast({
            title: `下载失败`,
            icon: "none",
            duration: 2e3
          });
        }
      });
    }
    return (_ctx, _cache) => {
      var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
      return common_vendor.e({
        a: ((_a = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _a.stage) == "0"
      }, ((_b = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _b.stage) == "0" ? {} : {}, {
        b: ((_c = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _c.stage) == "1"
      }, ((_d = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _d.stage) == "1" ? {} : ((_e = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _e.stage) == "5" ? {} : ((_f = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _f.stage) == "2" ? {} : ((_g = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _g.stage) == "3" ? {} : ((_h = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _h.stage) == "6" || ((_i = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _i.stage) == "4" ? {
        g: common_vendor.t((_j = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _j.stageStr)
      } : {}, {
        c: ((_k = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _k.stage) == "5",
        d: ((_l = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _l.stage) == "2",
        e: ((_m = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _m.stage) == "3",
        f: ((_n = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _n.stage) == "6" || ((_o = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _o.stage) == "4",
        h: common_vendor.t((_p = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _p.cptName),
        i: ((_q = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _q.cptSignType) == "0"
      }, ((_r = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _r.cptSignType) == "0" ? {
        j: common_vendor.p({
          inverted: true,
          text: "个人报项",
          type: "success"
        })
      } : {}, {
        k: ((_s = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _s.cptSignType) == "1"
      }, ((_t = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _t.cptSignType) == "1" ? {
        l: common_vendor.p({
          inverted: true,
          text: "参赛队报项",
          type: "primary"
        })
      } : {}, {
        m: ((_u = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _u.cptSignType) == "2"
      }, ((_v = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _v.cptSignType) == "2" ? {
        n: common_vendor.p({
          inverted: true,
          text: "参赛队-队伍报项",
          type: "warning"
        })
      } : {}, {
        o: common_vendor.t((_x = (_w = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _w.cptBeginTime) == null ? void 0 : _x.substring(0, 10)),
        p: common_vendor.t((_z = (_y = common_vendor.unref(base).signInfo[0]) == null ? void 0 : _y.cptEndTime) == null ? void 0 : _z.substring(0, 10)),
        q: common_vendor.f(common_vendor.unref(list), (t, index, i0) => {
          var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2;
          return common_vendor.e({
            a: common_vendor.t((_a2 = t.personInfo) == null ? void 0 : _a2.realName),
            b: ((_b2 = t.personInfo) == null ? void 0 : _b2.sex) == 0
          }, ((_c2 = t.personInfo) == null ? void 0 : _c2.sex) == 0 ? {} : {}, {
            c: ((_d2 = t.personInfo) == null ? void 0 : _d2.sex) == 1
          }, ((_e2 = t.personInfo) == null ? void 0 : _e2.sex) == 1 ? {} : {}, {
            d: "6484a4d9-4-" + i0 + "," + ("6484a4d9-3-" + i0),
            e: "6484a4d9-5-" + i0 + "," + ("6484a4d9-3-" + i0),
            f: common_vendor.p({
              border: false,
              title: t.personInfo.idcTypeStr,
              rightText: t.personInfo.idcCode
            }),
            g: (_f2 = t.signInfo[0]) == null ? void 0 : _f2.coachNames
          }, ((_g2 = t.signInfo[0]) == null ? void 0 : _g2.coachNames) ? {
            h: "6484a4d9-6-" + i0 + "," + ("6484a4d9-3-" + i0),
            i: common_vendor.p({
              border: false,
              title: "教练",
              rightText: (_h2 = t.signInfo[0]) == null ? void 0 : _h2.coachNames
            })
          } : {}, {
            j: (_i2 = t.signInfo[0]) == null ? void 0 : _i2.leaderNames
          }, ((_j2 = t.signInfo[0]) == null ? void 0 : _j2.leaderNames) ? {
            k: "6484a4d9-7-" + i0 + "," + ("6484a4d9-3-" + i0),
            l: common_vendor.p({
              border: false,
              title: "领队",
              rightText: (_k2 = t.signInfo[0]) == null ? void 0 : _k2.leaderNames
            })
          } : {}, {
            m: t.extraformData
          }, t.extraformData ? {
            n: common_vendor.f(t.extraformData, (ee, index2, i1) => {
              var _a3, _b3;
              return common_vendor.e({
                a: ee.type == "0" || ee.type == "1" || ee.type == "4"
              }, ee.type == "0" || ee.type == "1" || ee.type == "4" ? {
                b: common_vendor.t(ee.value)
              } : {}, {
                c: ee.type == "3" && ee.value != null
              }, ee.type == "3" && ee.value != null ? {
                d: (_a3 = ee.value) == null ? void 0 : _a3.url
              } : {}, {
                e: ee.type == "2"
              }, ee.type == "2" ? {
                f: "6484a4d9-9-" + i0 + "-" + i1 + "," + ("6484a4d9-8-" + i0 + "-" + i1),
                g: common_vendor.p({
                  type: "download",
                  size: "16"
                }),
                h: common_vendor.t((_b3 = ee.value) == null ? void 0 : _b3.name),
                i: common_vendor.o(($event) => goWebView(ee.value.url), index2)
              } : {}, {
                j: ee.value,
                k: index2,
                l: "6484a4d9-8-" + i0 + "-" + i1 + "," + ("6484a4d9-3-" + i0),
                m: common_vendor.p({
                  border: false,
                  title: ee.name
                })
              });
            })
          } : {}, {
            o: common_vendor.f(t.signInfo, (s, index2, i1) => {
              return {
                a: common_vendor.t(s.cptProjectName),
                b: common_vendor.t(s.cptGroupName),
                c: common_vendor.t(s.cptLevelName),
                d: common_vendor.t(s.cptSonLevelName),
                e: common_vendor.t(s.zu),
                f: index2,
                g: "6484a4d9-10-" + i0 + "-" + i1 + "," + ("6484a4d9-3-" + i0),
                h: common_vendor.p({
                  border: false,
                  title: "报名项目" + (index2 + 1)
                })
              };
            }),
            p: "6484a4d9-3-" + i0,
            q: index
          });
        }),
        r: common_vendor.p({
          border: false,
          title: "姓名"
        }),
        s: common_vendor.p({
          border: false
        }),
        t: common_vendor.unref(auditStatus) != "0"
      }, common_vendor.unref(auditStatus) != "0" ? {
        v: common_vendor.o(download)
      } : {}, {
        w: common_vendor.unref(auditStatus) == "0" && common_vendor.unref(payStatus) == "0" || common_vendor.unref(auditStatus) == "3" || common_vendor.unref(auditStatus) == "4"
      }, common_vendor.unref(auditStatus) == "0" && common_vendor.unref(payStatus) == "0" || common_vendor.unref(auditStatus) == "3" || common_vendor.unref(auditStatus) == "4" ? {
        x: common_vendor.o(goConti)
      } : {});
    };
  }
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-6484a4d9"], ["__file", "/Users/yangyang/project/j-mini/Venue/pages/usercenter/matchSignDetail.vue"]]);
wx.createPage(MiniProgramPage);