123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188 |
- import { activity, User } from "@/config/api.js";
- let app = getApp();
- export default {
- methods: {
-
- signupIsAddOfCancel(type, valName = "") {
- if (this.detailData.IsSignup == 1) {
- const str = this.detailData.ActivityTime.replace(/-/g, "/");
- const date = new Date(str);
- const times = date.getTime();
- const num = new Date().getTime();
- if (times - num <= 3600000) {
- uni.showModal({
- confirmText: "知道了",
- showCancel: false,
- confirmColor: "#3385FF",
- content: type == 1 ? "活动开始前1小时内无法取消预约外呼,请联系对口销售处理" : "活动开始前1小时内无法取消报名,请联系对口销售处理",
- });
- return;
- }
- uni.showModal({
- content: type == 1 ? "您要取消此次活动预约外呼吗?" : "您要取消此次活动的报名吗?",
- confirmColor: "#3385FF",
- cancelColor: "#606266",
- success: async (res) => {
- if (res.confirm) {
- const res = await activity.signupCancel({ ActivityId: this.detailData.ActivityId, SignupType: type });
- if (res.Ret === 200) {
- type == 1
- ? uni.showToast({
- title: "预约外呼已取消",
- duration: 2000,
- })
- : uni.showToast({
- title: "已取消报名",
- duration: 2000,
- });
- this.getActivityDetail();
- }
- }
- },
- });
- } else {
- let timer = null;
- if (this.flag) return;
- clearTimeout(timer);
- this.flag = true;
- this.selectShow = false;
- activity
- .signupAdd({
- ActivityId: this.detailData.ActivityId,
- SignupType: type,
- })
- .then((res) => {
- if (res.Ret == 200) {
- this.hasPermission = res.Data.HasPermission;
- this.jurisdictionList = res.Data;
- this.signupType = valName == "CClass" ? "CClass" : res.Data.SignupType;
- 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;
- }
- }
- }
- });
- timer = setTimeout(() => {
- this.flag = false;
- }, 500);
- }
- },
-
- async summaryIsHandel() {
- if (this.detailData.IsAppointment == 0) {
- const res = await activity.postAppointmentAdd({ ActivityId: Number(this.id) });
- if (res.Ret == 200) {
- this.hasPermission = res.Data.HasPermission;
- this.jurisdictionList = res.Data;
- this.signupType = "summaryIsHandel";
- this.goOnNextStep = res.Data.GoFollow;
- if (res.Data.SignupStatus !== "Success") {
- this.isShow = 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.signupIsAddOfCancel(3);
- }
- },
-
- askingGo(type = "") {
- uni.navigateTo({
- url: "/activityPages/generationAsk/generationAsk?id=" + this.id + "&type=" + type,
- });
- },
- },
- };
|