manageMixin.js 4.9 KB

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