manageMixin.js 5.0 KB

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