import { activity, User } from "@/config/api.js"; let app = getApp(); export default { methods: { //报名 signupAdd(type = 1) { if (this.isNeedAddCountryCode) { this.isAreaCode = true; this.areaCode = { id: Number(this.id), type, }; } else { activity .signupAdd({ ActivityId: Number(this.id), SignupType: type, }) .then((res) => { if (res.Ret == 200) { this.signupType = res.Data.SignupType; this.signupStatus = res.Data.SignupStatus; this.countryCode = res.Data.CountryCode; this.mobileEdit = res.Data.Mobile; this.goOnNextStep = res.Data.GoFollow; this.idTypeCancel = { cutId: res.Data.ActivityId, state: 1, }; if (res.Data.GoBindEmail) { this.mailboxBinding = true; return; } if (res.Data.SignupStatus !== "Success") { this.isShow = true; } else { if (res.Data.GoOutboundMobile) { this.editIsShow = true; } else if (res.Data.GoFollow) { this.goFollow = res.Data.GoFollow; } else if (res.Data.SignupStatus == "Success") { this.isShow = true; } } } }); } this.selectShow = false; }, //取消报名 signupCancel(type) { if (this.detailData.IsSignup == 1) { this.isCancelShow = true; this.idTypeCancel = { id: Number(this.id), type, cutId: "", state: 0, }; } else { this.signupAdd(); } }, //预约/取消 async summaryIsHandel() { if (this.detailData.IsAppointment == 0) { const res = await activity.postAppointmentAdd({ ActivityId: Number(this.id) }); if (res.Ret == 200) { this.signupType = "summaryIsHandel"; this.signupStatus = res.Data.SignupStatus; this.idTypeCancel = { cutId: res.Data.ActivityId, state: 1, }; if (res.Data.GoBindEmail) { this.mailboxBinding = true; return; } if (res.Data.SignupStatus !== "Success") { this.isShow = true; } else { if (res.Data.GoOutboundMobile) { this.editIsShow = true; } else if (res.Data.GoFollow) { this.goFollow = res.Data.GoFollow; } else if (res.Data.SignupStatus == "Success") { this.isShow = true; } } } this.selectShow = false; } else { uni.showModal({ content: "确定要取消预约本场调研的纪要吗?", confirmColor: "#3385FF", cancelColor: "#606266", success: async (res) => { if (res.confirm) { const res = await activity.postAppointmentCancel({ ActivityId: Number(this.id) }); if (res.Ret === 200) { this.getActivityDetail(); } } }, }); } }, //取消会议提醒接口 meetingReminderCancel() { if (this.detailData.IsCancelMeetingReminder == 1) { activity .meetingReminderCancel({ ActivityId: Number(this.id), }) .then((res) => { if (res.Ret == 200) { uni.showModal({ confirmText: "知道了", confirmColor: "#3385FF", content: res.Msg, showCancel: false, success: (res) => { if (res.confirm) { this.getActivityDetail(); } }, }); } }); } else { this.meetingReminderAdd(); } }, //添加会议提醒 meetingReminderAdd() { activity .meetingReminderAdd({ ActivityId: Number(this.id), }) .then((res) => { if (res.Ret == 200) { uni.showModal({ confirmText: "知道了", confirmColor: "#3385FF", content: res.Msg, showCancel: false, success: (res) => { if (res.confirm) { this.getActivityDetail(); } }, }); } }); }, //我要报名 wanttosignup() { if (this.detailData.IsLimitPeople == 1 && this.detailData.ActivityTypeName == "公司调研电话会") { this.selectShow = true; } else { this.signupAdd(3); } }, //提问 askingGo(type = "") { uni.navigateTo({ url: "/activityPages/generationAsk/generationAsk?id=" + this.id + "&type=" + type, }); }, }, };