manageMixin.js 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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, PageRouter: this.$store.state.pageRouterActivity });
  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. PageRouter: this.$store.state.pageRouterActivity,
  54. })
  55. .then((res) => {
  56. if (res.Ret == 200) {
  57. this.hasPermission = res.Data.HasPermission;
  58. this.jurisdictionList = res.Data;
  59. this.signupType = valName == "CClass" ? "CClass" : res.Data.SignupType;
  60. this.countryCode = res.Data.CountryCode;
  61. this.mobileEdit = res.Data.Mobile;
  62. this.goOnNextStep = res.Data.GoFollow;
  63. this.idTypeCancel = {
  64. cutId: res.Data.ActivityId,
  65. state: 1,
  66. };
  67. if (res.Data.SignupStatus !== "Success") {
  68. this.isShow = true;
  69. } else {
  70. this.detailData.IsSignup = 1;
  71. this.detailData.SignupNum += 1;
  72. this.detailData.SignupType = type;
  73. this.synchronization();
  74. if (res.Data.GoBindEmail) this.mailboxBinding = true;
  75. if (res.Data.GoOutboundMobile) this.editIsShow = true;
  76. else if (res.Data.GoFollow) this.goFollow = res.Data.GoFollow;
  77. else if (res.Data.SignupStatus == "Success") this.isShow = true;
  78. }
  79. }
  80. });
  81. timer = setTimeout(() => {
  82. this.flag = false;
  83. }, 500);
  84. }
  85. },
  86. // 预约/取消
  87. async summaryIsHandel() {
  88. if (this.detailData.IsAppointment == 0) {
  89. const res = await activity.postAppointmentAdd({ ActivityId: Number(this.id), PageRouter: this.$store.state.pageRouterActivity });
  90. if (res.Ret == 200) {
  91. this.hasPermission = res.Data.HasPermission;
  92. this.jurisdictionList = res.Data;
  93. this.signupType = "summaryIsHandel";
  94. this.goOnNextStep = res.Data.GoFollow;
  95. if (res.Data.SignupStatus !== "Success") {
  96. this.isShow = true;
  97. } else {
  98. if (res.Data.GoFollow) this.goFollow = res.Data.GoFollow;
  99. else if (res.Data.SignupStatus == "Success") this.isShow = true;
  100. }
  101. this.selectShow = false;
  102. this.detailData.IsAppointment = 1;
  103. this.synchronization();
  104. }
  105. } else {
  106. uni.showModal({
  107. content: "确定要取消预约本场调研的纪要吗?",
  108. confirmColor: "#3385FF",
  109. cancelColor: "#606266",
  110. success: async (res) => {
  111. if (res.confirm) {
  112. const res = await activity.postAppointmentCancel({ ActivityId: Number(this.id), PageRouter: this.$store.state.pageRouterActivity });
  113. if (res.Ret === 200) {
  114. this.getActivityDetail();
  115. }
  116. }
  117. },
  118. });
  119. }
  120. },
  121. // 取消会议提醒接口
  122. meetingReminderCancel() {
  123. if (this.detailData.IsCancelMeetingReminder == 1) {
  124. activity
  125. .meetingReminderCancel({
  126. ActivityId: Number(this.id),
  127. PageRouter: this.$store.state.pageRouterActivity,
  128. })
  129. .then((res) => {
  130. if (res.Ret == 200) {
  131. uni.showModal({
  132. confirmText: "知道了",
  133. confirmColor: "#3385FF",
  134. content: res.Msg,
  135. showCancel: false,
  136. success: (res) => {
  137. if (res.confirm) {
  138. this.getActivityDetail();
  139. }
  140. },
  141. });
  142. }
  143. });
  144. } else {
  145. this.meetingReminderAdd();
  146. }
  147. },
  148. // 添加会议提醒
  149. meetingReminderAdd() {
  150. activity
  151. .meetingReminderAdd({
  152. ActivityId: Number(this.id),
  153. PageRouter: this.$store.state.pageRouterActivity,
  154. })
  155. .then((res) => {
  156. if (res.Ret == 200) {
  157. uni.showModal({
  158. confirmText: "知道了",
  159. confirmColor: "#3385FF",
  160. content: res.Msg,
  161. showCancel: false,
  162. success: (res) => {
  163. if (res.confirm) {
  164. this.getActivityDetail();
  165. }
  166. },
  167. });
  168. }
  169. });
  170. },
  171. // 我要报名
  172. wanttosignup() {
  173. if (this.detailData.IsLimitPeople && [1, 2, 3].includes(this.detailData.ActivityTypeId)) {
  174. this.selectShow = true;
  175. } else {
  176. this.signupIsAddOfCancel(3);
  177. }
  178. },
  179. // 提问
  180. askingGo(type = "") {
  181. uni.navigateTo({
  182. url: "/activityPages/generationAsk/generationAsk?id=" + this.id + "&type=" + type,
  183. });
  184. },
  185. },
  186. };