modalDialog.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. <template>
  2. <view>
  3. <u-modal
  4. v-model="isModalShow"
  5. :content-style="{ fontSize: '32rpx' }"
  6. @confirm="confirmModal"
  7. :show-cancel-button="true"
  8. :confirm-text="confirmText"
  9. :cancel-text="editIsShowDlg ? '前去修改' : '取消'"
  10. @cancel="cancelModal"
  11. :show-title="false"
  12. :cancel-style="{ borderRight: '1rpx solid #EBEBEB' }"
  13. :confirm-style="{ fontWeight: '700' }"
  14. >
  15. <view class="slot-content">
  16. <rich-text :nodes="content"></rich-text>
  17. </view>
  18. </u-modal>
  19. <!-- 修改手机号 -->
  20. <block v-if="jurisdictionList.IsResearch">
  21. <u-modal
  22. v-model="showhasPermission"
  23. :content-style="{ fontSize: '32rpx' }"
  24. @confirm="showhasPermissionBtn"
  25. :show-cancel-button="!jurisdictionList.IsResearchSpecial"
  26. :confirm-text="!jurisdictionList.IsResearchSpecial ? '提交申请' : '知道了'"
  27. @cancel="showhasPermissionCancel"
  28. :show-title="false"
  29. :cancel-style="{ borderRight: '1rpx solid #EBEBEB' }"
  30. :confirm-style="{ fontWeight: '700' }"
  31. >
  32. <view class="slot-content" v-if="jurisdictionList.IsResearch">
  33. <rich-text :nodes="jurisdictionList.PopupMsg || ''"></rich-text>
  34. </view>
  35. </u-modal>
  36. </block>
  37. <block v-else>
  38. <!-- 拨打电话 -->
  39. <u-modal
  40. v-model="showhasPermission"
  41. :content-style="{ fontSize: '32rpx' }"
  42. @confirm="showhasPermissionBtn"
  43. :show-cancel-button="true"
  44. confirm-text="提交申请"
  45. @cancel="showhasPermissionCancel"
  46. :show-title="false"
  47. :cancel-style="{ borderRight: '1rpx solid #EBEBEB' }"
  48. :confirm-style="{ fontWeight: '700' }"
  49. >
  50. <view class="slot-content">
  51. <!-- 2 - 活动视频 3 - 产业视频 -->
  52. <block v-if="jurisdictionList.isAudioVideo == 2 || jurisdictionList.isAudioVideo == 3">
  53. <text>您暂无权限查看此视频</text>
  54. <text>若想查看可以联系对口销售</text>
  55. </block>
  56. <block v-else>
  57. <text>您暂无权限参加此活动</text>
  58. <text>若想参加可以联系对口销售</text>
  59. </block>
  60. <view
  61. >{{ jurisdictionList.SellerName }} : <text @click="mobileDial" class="seller-mobile"> {{ jurisdictionList.SellerMobile }}</text></view
  62. >
  63. <text>申请开通对应的试用权限</text>
  64. </view>
  65. </u-modal>
  66. </block>
  67. </view>
  68. </template>
  69. <script>
  70. import { User, activity, FreeButton } from "@/config/api.js";
  71. export default {
  72. data() {
  73. return {
  74. goFollowShow: false,
  75. show: false,
  76. cancelShow: false,
  77. applyIsShow: false,
  78. showhasPermission: false,
  79. accounts: "",
  80. jurisdictionText: "",
  81. hasPermissionText: "",
  82. editIsShowAccounts: "",
  83. editIsShowDlg: false,
  84. mailboxBindingDlg: false,
  85. isShowAlert: false, //获取权限弹窗是否展示免费月卡接口
  86. contentType: "",
  87. };
  88. },
  89. props: {
  90. isShow: {
  91. type: Boolean,
  92. default: false,
  93. },
  94. signupType: {
  95. // type: Number,
  96. },
  97. goFollow: {
  98. type: Boolean,
  99. },
  100. isCancelShow: {
  101. type: Boolean,
  102. default: false,
  103. },
  104. idTypeCancel: {
  105. type: Object,
  106. },
  107. jurisdictionList: {
  108. type: Object,
  109. },
  110. applyForIsShow: {
  111. //潜在用户
  112. type: Boolean,
  113. },
  114. isShowhasPermission: {
  115. //联系销售
  116. type: Boolean,
  117. },
  118. hasPermission: {
  119. //权限字段
  120. type: String,
  121. },
  122. editIsShow: {
  123. type: Boolean,
  124. },
  125. countryCode: {
  126. type: String,
  127. },
  128. mobileEdit: {
  129. type: String,
  130. },
  131. goOnNextStep: {
  132. type: Boolean,
  133. default: false,
  134. },
  135. mailboxBinding: {
  136. type: Boolean,
  137. default: false,
  138. },
  139. },
  140. watch: {
  141. mailboxBinding() {
  142. this.mailboxBindingDlg = this.mailboxBinding;
  143. },
  144. editIsShow(newVal) {
  145. this.editIsShowDlg = newVal;
  146. if (newVal) {
  147. this.editIsShowAccounts = `
  148. 默认外呼号码是您当前绑定的手机号:<br />
  149. ${this.countryCode}-${this.mobileEdit}<br/><br/>
  150. 是否需要修改您的外呼号码?
  151. `;
  152. }
  153. },
  154. goFollow() {
  155. this.goFollowShow = this.goFollow;
  156. },
  157. isShow() {
  158. this.show = this.isShow;
  159. },
  160. isCancelShow() {
  161. this.cancelShow = this.isCancelShow;
  162. },
  163. applyForIsShow() {
  164. this.content = this.isShowAlert ? "上传名片并填写简单信息,24小时内我们会为您开通一个月的免费月卡" : this.jurisdictionList.PopupMsg;
  165. this.applyIsShow = this.applyForIsShow;
  166. },
  167. isShowhasPermission() {
  168. this.hasPermissionText = this.jurisdictionList.PopupMsg;
  169. this.showhasPermission = this.isShowhasPermission;
  170. },
  171. },
  172. computed: {
  173. isModalShow: {
  174. get() {
  175. let isShow = this.show || this.cancelShow || this.goFollowShow || this.applyIsShow || this.mailboxBindingDlg || this.editIsShowDlg;
  176. return isShow;
  177. },
  178. set() {},
  179. },
  180. confirmText() {
  181. let text = this.mailboxBindingDlg
  182. ? "设置"
  183. : this.applyIsShow && this.isShowAlert
  184. ? "立即上传"
  185. : this.applyIsShow && !this.isShowAlert
  186. ? "立即申请"
  187. : this.editIsShowDlg
  188. ? "无需修改"
  189. : this.goFollowShow
  190. ? "去关注"
  191. : this.show
  192. ? "知道了"
  193. : "";
  194. return text;
  195. },
  196. content: {
  197. get() {
  198. let str = this.mailboxBindingDlg
  199. ? "您当前绑定的联系方式为邮箱,请先设置您的外呼号码"
  200. : this.editIsShowDlg
  201. ? this.editIsShowAccounts
  202. : this.applyIsShow || this.goFollowShow || this.show
  203. ? this.jurisdictionList.PopupMsg
  204. : "";
  205. return str;
  206. },
  207. set() {},
  208. },
  209. },
  210. methods: {
  211. /**
  212. *
  213. *
  214. *
  215. * 确定
  216. *
  217. *
  218. */
  219. confirmModal() {
  220. this.show
  221. ? this.contentBtn()
  222. : this.goFollowShow
  223. ? this.goFollowShowBtn()
  224. : this.cancelShow
  225. ? this.cancelShowBtn()
  226. : this.applyIsShow
  227. ? this.applyIsShowBtn()
  228. : this.mailboxBindingDlg
  229. ? this.gmailboxBindingDlgBtn()
  230. : this.editIsShowDlg
  231. ? this.GoOutboundMobileBtn()
  232. : "";
  233. this.initData();
  234. },
  235. /**
  236. *
  237. *
  238. *
  239. * 取消
  240. *
  241. *
  242. */
  243. cancelModal() {
  244. if (this.editIsShowDlg) {
  245. this.GoOutboundMobileIsGo();
  246. } else {
  247. this.initData();
  248. this.$emit("cancelShowBtn");
  249. }
  250. },
  251. /**
  252. *
  253. *
  254. *
  255. * 重置
  256. *
  257. *
  258. */
  259. initData() {
  260. this.$parent.isShow = false;
  261. this.show = false;
  262. this.$parent.goFollow = false;
  263. this.goFollowShow = false;
  264. this.applyIsShow = false;
  265. this.$parent.applyForIsShow = false;
  266. this.$parent.mailboxBinding = false;
  267. this.mailboxBindingDlg = false;
  268. this.$parent.signupType = "";
  269. this.$parent.isCancelShow = false;
  270. this.cancelShow = false;
  271. this.editIsShowDlg = false;
  272. },
  273. async showhasPermissionBtn() {
  274. if (this.jurisdictionList.IsResearchSpecial) {
  275. } else {
  276. // isAudioVideo -- 3 产业视频
  277. let type =
  278. this.jurisdictionList.isAudioVideo == 1 ? "MicroAudio" : this.jurisdictionList.isAudioVideo == 2 ? "ActivityVideo" : this.jurisdictionList.isAudioVideo == 3 ? "MicroVideo" : "Activity";
  279. const res = await User.applyTry({
  280. TryType: type,
  281. DetailId: this.jurisdictionList.ActivityId,
  282. });
  283. if (res.Ret === 200) {
  284. uni.showModal({
  285. title: "",
  286. content: "提交申请成功,请耐心等待",
  287. showCancel: false,
  288. confirmColor: "#3385FF",
  289. });
  290. }
  291. }
  292. this.showhasPermission = false;
  293. this.$parent.isShowhasPermission = false;
  294. },
  295. mobileDial() {
  296. uni.makePhoneCall({
  297. phoneNumber: this.jurisdictionList.SellerMobile, // 拨打电话
  298. });
  299. this.showhasPermission = false;
  300. this.$parent.isShowhasPermission = false;
  301. },
  302. GoOutboundMobileBtn() {
  303. this.$parent.editIsShow = false;
  304. this.editIsShowDlg = false;
  305. if (this.goOnNextStep) {
  306. this.goFollowShow = true;
  307. } else {
  308. this.show = true;
  309. }
  310. },
  311. gmailboxBindingDlgBtn() {
  312. this.$parent.mailboxBinding = false;
  313. this.mailboxBindingDlg = false;
  314. this.$parent.signupType = "";
  315. uni.navigateTo({
  316. url: "/activityPages/editOutbound/editOutbound?title=设置外呼号码&identification=邮箱&goOnNextStep=" + this.goOnNextStep + "&id=" + this.idTypeCancel.cutId,
  317. });
  318. },
  319. //获取权限弹窗是否展示免费月卡接口
  320. async userIsShowAlert() {
  321. const res = await FreeButton.userIsShowAlert();
  322. if (res.Ret === 200) {
  323. this.isShowAlert = res.Data.IsShow;
  324. }
  325. },
  326. /**
  327. * 取消
  328. * */
  329. cancelMailboxBindingDlg() {
  330. this.$parent.mailboxBinding = false;
  331. this.mailboxBindingDlg = false;
  332. },
  333. GoOutboundMobileIsGo() {
  334. this.$parent.editIsShow = false;
  335. this.editIsShowDlg = false;
  336. uni.navigateTo({
  337. url:
  338. "/activityPages/editOutbound/editOutbound?title=修改外呼号码&identification=修改&goOnNextStep=" +
  339. this.goOnNextStep +
  340. "&id=" +
  341. this.idTypeCancel.cutId +
  342. "&cellphone=" +
  343. this.countryCode +
  344. "-" +
  345. this.mobileEdit,
  346. });
  347. },
  348. //获取权限弹窗是否展示免费月卡接口
  349. async userIsShowAlert() {
  350. const res = await FreeButton.userIsShowAlert();
  351. if (res.Ret === 200) {
  352. this.isShowAlert = res.Data.IsShow;
  353. }
  354. },
  355. /**
  356. *
  357. *
  358. *
  359. *
  360. *
  361. *confirm 模块
  362. *
  363. *
  364. *
  365. *
  366. *
  367. *
  368. */
  369. //正常的
  370. contentBtn() {
  371. this.$emit("cancelShowBtn", this.idTypeCancel, this.signupType, this.idTypeCancel.isNum);
  372. },
  373. //去关注
  374. goFollowShowBtn() {
  375. this.$emit("cancelShowBtn", this.idTypeCancel, this.signupType, this.idTypeCancel.isNum);
  376. uni.navigateTo({
  377. url: "/activityPages/accountsOfficial/accountsOfficial",
  378. });
  379. },
  380. async cancelShowBtn() {
  381. const res = await activity.signupCancel({
  382. ActivityId: this.idTypeCancel.id,
  383. SignupType: this.idTypeCancel.type,
  384. });
  385. if (res.Ret == 200) {
  386. this.idTypeCancel.cutId = res.Data.ActivityId;
  387. if (this.signupType == 1) {
  388. uni.showToast({
  389. title: "预约外呼已取消",
  390. duration: 2000,
  391. });
  392. } else {
  393. uni.showToast({
  394. title: "已取消报名",
  395. duration: 2000,
  396. });
  397. }
  398. this.$emit("cancelShowBtn", this.idTypeCancel, this.signupType, this.idTypeCancel.isNum);
  399. }
  400. this.$parent.isCancelShow = false;
  401. this.cancelShow = false;
  402. },
  403. //立即申请
  404. applyIsShowBtn() {
  405. if (this.hasPermission == 3) {
  406. uni.navigateTo({
  407. url: "/pageMy/applyTrial/applyTrial?tryType=Activity&detailId=" + this.jurisdictionList.ActivityId,
  408. });
  409. } else if (this.hasPermission == 4) {
  410. uni.showModal({
  411. content: "申请已提交,请等待销售人员与您联系",
  412. confirmText: "知道了",
  413. showCancel: false,
  414. confirmColor: "#3385FF",
  415. });
  416. } else if (this.hasPermission == 5) {
  417. this.showhasPermissionBtn();
  418. }
  419. },
  420. //去设置
  421. gmailboxBindingDlgBtn() {
  422. uni.navigateTo({
  423. url: "/activityPages/editOutbound/editOutbound?title=设置外呼号码&identification=邮箱&goOnNextStep=" + this.goOnNextStep + "&id=" + this.idTypeCancel.cutId,
  424. });
  425. },
  426. // 拨打电话的取消弹框
  427. showhasPermissionCancel() {
  428. this.showhasPermission = false;
  429. this.$parent.isShowhasPermission = false;
  430. },
  431. },
  432. mounted() {
  433. // 免费送月卡
  434. // this.userIsShowAlert();
  435. },
  436. };
  437. </script>
  438. <style lang="scss">
  439. .slot-content {
  440. width: 100%;
  441. padding: 50rpx;
  442. text-align: center;
  443. font-size: 32rpx;
  444. color: #0f1826;
  445. line-height: 48rpx;
  446. }
  447. .seller-mobile {
  448. display: inline-block;
  449. color: #2979ff;
  450. }
  451. .u-model__footer__button.data-v-3626fcec {
  452. border-right: 1rpx solid #333;
  453. }
  454. </style>