manageMixin.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. import { activity, User } from "@/config/api.js";
  2. let app = getApp();
  3. export default {
  4. methods: {
  5. //报名/取消报名
  6. signupIsAddOfCancel(type, valName = "") {
  7. if (this.detailData.IsSignup == 1) {
  8. const str = this.detailData.ActivityTime.replace(/-/g, "/");
  9. const date = new Date(str);
  10. const times = date.getTime();
  11. const num = new Date().getTime();
  12. if (times - num <= 3600000) {
  13. uni.showModal({
  14. confirmText: "知道了",
  15. showCancel: false,
  16. confirmColor: "#3385FF",
  17. content: type == 1 ? "活动开始前1小时内无法取消预约外呼,请联系对口销售处理" : "活动开始前1小时内无法取消报名,请联系对口销售处理",
  18. });
  19. return;
  20. }
  21. uni.showModal({
  22. content: type == 1 ? "您要取消此次活动预约外呼吗?" : "您要取消此次活动的报名吗?",
  23. confirmColor: "#3385FF",
  24. cancelColor: "#606266",
  25. success: async (res) => {
  26. if (res.confirm) {
  27. const res = await activity.signupCancel({ ActivityId: this.detailData.ActivityId, SignupType: type });
  28. if (res.Ret === 200) {
  29. type == 1
  30. ? uni.showToast({
  31. title: "预约外呼已取消",
  32. duration: 2000,
  33. })
  34. : uni.showToast({
  35. title: "已取消报名",
  36. duration: 2000,
  37. });
  38. this.getActivityDetail();
  39. }
  40. }
  41. },
  42. });
  43. } else {
  44. let timer = null;
  45. if (this.flag) return;
  46. clearTimeout(timer);
  47. this.flag = true;
  48. this.selectShow = false;
  49. activity
  50. .signupAdd({
  51. ActivityId: this.detailData.ActivityId,
  52. SignupType: type,
  53. })
  54. .then((res) => {
  55. if (res.Ret == 200) {
  56. this.hasPermission = res.Data.HasPermission;
  57. this.jurisdictionList = res.Data;
  58. this.signupType = valName == "CClass" ? "CClass" : res.Data.SignupType;
  59. this.countryCode = res.Data.CountryCode;
  60. this.mobileEdit = res.Data.Mobile;
  61. this.goOnNextStep = res.Data.GoFollow;
  62. this.idTypeCancel = {
  63. cutId: res.Data.ActivityId,
  64. state: 1,
  65. };
  66. if (res.Data.GoBindEmail) {
  67. this.mailboxBinding = true;
  68. return;
  69. }
  70. if (res.Data.SignupStatus !== "Success") {
  71. this.isShow = true;
  72. } else {
  73. if (res.Data.GoOutboundMobile) this.editIsShow = true;
  74. else if (res.Data.GoFollow) this.goFollow = res.Data.GoFollow;
  75. else if (res.Data.SignupStatus == "Success") this.isShow = true;
  76. }
  77. }
  78. });
  79. timer = setTimeout(() => {
  80. this.flag = false;
  81. }, 500);
  82. }
  83. },
  84. // 预约/取消
  85. async summaryIsHandel() {
  86. if (this.detailData.IsAppointment == 0) {
  87. const res = await activity.postAppointmentAdd({ ActivityId: Number(this.id) });
  88. if (res.Ret == 200) {
  89. this.hasPermission = res.Data.HasPermission;
  90. this.jurisdictionList = res.Data;
  91. this.signupType = "summaryIsHandel";
  92. this.goOnNextStep = res.Data.GoFollow;
  93. if (res.Data.SignupStatus !== "Success") {
  94. this.isShow = true;
  95. } else {
  96. if (res.Data.GoFollow) this.goFollow = res.Data.GoFollow;
  97. else if (res.Data.SignupStatus == "Success") this.isShow = true;
  98. }
  99. this.selectShow = false;
  100. }
  101. } else {
  102. uni.showModal({
  103. content: "确定要取消预约本场调研的纪要吗?",
  104. confirmColor: "#3385FF",
  105. cancelColor: "#606266",
  106. success: async (res) => {
  107. if (res.confirm) {
  108. const res = await activity.postAppointmentCancel({ ActivityId: Number(this.id) });
  109. if (res.Ret === 200) {
  110. this.getActivityDetail();
  111. }
  112. }
  113. },
  114. });
  115. }
  116. },
  117. // 取消会议提醒接口
  118. meetingReminderCancel() {
  119. if (this.detailData.IsCancelMeetingReminder == 1) {
  120. activity
  121. .meetingReminderCancel({
  122. ActivityId: Number(this.id),
  123. })
  124. .then((res) => {
  125. if (res.Ret == 200) {
  126. uni.showModal({
  127. confirmText: "知道了",
  128. confirmColor: "#3385FF",
  129. content: res.Msg,
  130. showCancel: false,
  131. success: (res) => {
  132. if (res.confirm) {
  133. this.getActivityDetail();
  134. }
  135. },
  136. });
  137. }
  138. });
  139. } else {
  140. this.meetingReminderAdd();
  141. }
  142. },
  143. // 添加会议提醒
  144. meetingReminderAdd() {
  145. activity
  146. .meetingReminderAdd({
  147. ActivityId: Number(this.id),
  148. })
  149. .then((res) => {
  150. if (res.Ret == 200) {
  151. uni.showModal({
  152. confirmText: "知道了",
  153. confirmColor: "#3385FF",
  154. content: res.Msg,
  155. showCancel: false,
  156. success: (res) => {
  157. if (res.confirm) {
  158. this.getActivityDetail();
  159. }
  160. },
  161. });
  162. }
  163. });
  164. },
  165. // 我要报名
  166. wanttosignup() {
  167. if (this.detailData.IsLimitPeople == 1 && this.detailData.ActivityTypeName == "公司调研电话会") {
  168. this.selectShow = true;
  169. } else {
  170. this.signupIsAddOfCancel(3);
  171. }
  172. },
  173. // 提问
  174. askingGo(type = "") {
  175. uni.navigateTo({
  176. url: "/activityPages/generationAsk/generationAsk?id=" + this.id + "&type=" + type,
  177. });
  178. },
  179. },
  180. };