manageMixin.js 4.8 KB

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