"use strict";
const common_vendor = require("../../common/vendor.js");
const gen_Apis = require("../../gen/Apis.js");
const ME_activities_show_model = require("./model.js");
require("../../common/libraries/request.js");
const common_store_useWeAppAuthStore = require("../../common/store/useWeAppAuthStore.js");
require("../../common/store/useWorkStore.js");
const common_libraries_apiLoading = require("../../common/libraries/apiLoading.js");
require("../../common/libraries/userUserLogin.js");
const common_libraries_naviHelper = require("../../common/libraries/naviHelper.js");
common_store_useWeAppAuthStore.useWeAppAuthStore();
const method = {
  getShow(id) {
    common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Activity.ActivityEnrolls.Show, {
      id
    }).then((res) => {
      var _a, _b;
      ME_activities_show_model.useModel.showData.value = { ...(_a = res.data) == null ? void 0 : _a.activity, activity_id: (_b = res == null ? void 0 : res.data) == null ? void 0 : _b.id };
      console.log(res);
    });
  },
  handleCancelSignUp() {
    var _a, _b, _c;
    common_vendor.index.showModal({
      title: "提示",
      content: `您将取消 [${(_c = (_b = (_a = ME_activities_show_model.useModel) == null ? void 0 : _a.showData) == null ? void 0 : _b.value) == null ? void 0 : _c.title}]，取消后释放名额?`,
      success(res) {
        var _a2, _b2, _c2;
        if (res.confirm) {
          common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Activity.ActivityEnrolls.Cancelled, {
            id: (_c2 = (_b2 = (_a2 = ME_activities_show_model.useModel) == null ? void 0 : _a2.formData) == null ? void 0 : _b2.value) == null ? void 0 : _c2.activity_id
          }).then((res2) => {
            common_libraries_naviHelper.showToastBack("取消报名成功", 1, true);
            console.log(res2);
          });
          console.log("用户点击确定");
        } else if (res.cancel) {
          console.log("用户点击取消");
        }
      }
    });
  }
};
exports.method = method;
