modalDialog.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467
  1. <template>
  2. <view>
  3. <u-modal
  4. v-model="isModalShow"
  5. :content-style="{ fontSize: '32rpx' }"
  6. @confirm="confirmModal"
  7. :confirm-text="confirmText"
  8. :cancel-text="editIsShowDlg ? '前去修改' : '取消'"
  9. :show-cancel-button="show_cancel_button"
  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. show_cancel_button() {
  210. return this.content == "该活动为非公开活动,如有专家访谈需求请联系对口销售" ? false : true;
  211. },
  212. },
  213. methods: {
  214. /**
  215. *
  216. *
  217. *
  218. * 确定
  219. *
  220. *
  221. */
  222. confirmModal() {
  223. this.show
  224. ? this.contentBtn()
  225. : this.goFollowShow
  226. ? this.goFollowShowBtn()
  227. : this.cancelShow
  228. ? this.cancelShowBtn()
  229. : this.applyIsShow
  230. ? this.applyIsShowBtn()
  231. : this.mailboxBindingDlg
  232. ? this.gmailboxBindingDlgBtn()
  233. : this.editIsShowDlg
  234. ? this.GoOutboundMobileBtn()
  235. : "";
  236. this.initData();
  237. },
  238. /**
  239. *
  240. *
  241. *
  242. * 取消
  243. *
  244. *
  245. */
  246. cancelModal() {
  247. if (this.editIsShowDlg) {
  248. this.GoOutboundMobileIsGo();
  249. } else {
  250. this.initData();
  251. this.$emit("cancelShowBtn");
  252. }
  253. },
  254. /**
  255. *
  256. *
  257. *
  258. * 重置
  259. *
  260. *
  261. */
  262. initData() {
  263. this.$parent.isShow = false;
  264. this.show = false;
  265. this.$parent.goFollow = false;
  266. this.goFollowShow = false;
  267. this.applyIsShow = false;
  268. this.$parent.applyForIsShow = false;
  269. this.$parent.mailboxBinding = false;
  270. this.mailboxBindingDlg = false;
  271. this.$parent.signupType = "";
  272. this.$parent.isCancelShow = false;
  273. this.cancelShow = false;
  274. this.editIsShowDlg = false;
  275. },
  276. async showhasPermissionBtn() {
  277. if (this.jurisdictionList.IsResearchSpecial) {
  278. } else {
  279. // isAudioVideo -- 3 产业视频
  280. let type =
  281. this.jurisdictionList.isAudioVideo == 1 ? "MicroAudio" : this.jurisdictionList.isAudioVideo == 2 ? "ActivityVideo" : this.jurisdictionList.isAudioVideo == 3 ? "MicroVideo" : "Activity";
  282. const res = await User.applyTry({
  283. TryType: type,
  284. DetailId: this.jurisdictionList.ActivityId,
  285. });
  286. if (res.Ret === 200) {
  287. uni.showModal({
  288. title: "",
  289. content: "提交申请成功,请耐心等待",
  290. showCancel: false,
  291. confirmColor: "#376cbb",
  292. });
  293. }
  294. }
  295. this.showhasPermission = false;
  296. this.$parent.isShowhasPermission = false;
  297. },
  298. mobileDial() {
  299. uni.makePhoneCall({
  300. phoneNumber: this.jurisdictionList.SellerMobile, // 拨打电话
  301. });
  302. this.showhasPermission = false;
  303. this.$parent.isShowhasPermission = false;
  304. },
  305. GoOutboundMobileBtn() {
  306. this.$parent.editIsShow = false;
  307. this.editIsShowDlg = false;
  308. if (this.goOnNextStep) {
  309. this.goFollowShow = true;
  310. } else {
  311. this.show = true;
  312. }
  313. },
  314. gmailboxBindingDlgBtn() {
  315. this.$parent.mailboxBinding = false;
  316. this.mailboxBindingDlg = false;
  317. this.$parent.signupType = "";
  318. uni.navigateTo({
  319. url: "/activityPages/editOutbound/editOutbound?title=设置外呼号码&identification=邮箱&goOnNextStep=" + this.goOnNextStep + "&id=" + this.idTypeCancel.cutId,
  320. });
  321. },
  322. //获取权限弹窗是否展示免费月卡接口
  323. async userIsShowAlert() {
  324. const res = await FreeButton.userIsShowAlert();
  325. if (res.Ret === 200) {
  326. this.isShowAlert = res.Data.IsShow;
  327. }
  328. },
  329. /**
  330. * 取消
  331. * */
  332. cancelMailboxBindingDlg() {
  333. this.$parent.mailboxBinding = false;
  334. this.mailboxBindingDlg = false;
  335. },
  336. GoOutboundMobileIsGo() {
  337. this.$parent.editIsShow = false;
  338. this.editIsShowDlg = false;
  339. uni.navigateTo({
  340. url:
  341. "/activityPages/editOutbound/editOutbound?title=修改外呼号码&identification=修改&goOnNextStep=" +
  342. this.goOnNextStep +
  343. "&id=" +
  344. this.idTypeCancel.cutId +
  345. "&cellphone=" +
  346. this.countryCode +
  347. "-" +
  348. this.mobileEdit,
  349. });
  350. },
  351. //获取权限弹窗是否展示免费月卡接口
  352. async userIsShowAlert() {
  353. const res = await FreeButton.userIsShowAlert();
  354. if (res.Ret === 200) {
  355. this.isShowAlert = res.Data.IsShow;
  356. }
  357. },
  358. /**
  359. *
  360. *
  361. *
  362. *
  363. *
  364. *confirm 模块
  365. *
  366. *
  367. *
  368. *
  369. *
  370. *
  371. */
  372. //正常的
  373. contentBtn() {
  374. this.$emit("cancelShowBtn", this.idTypeCancel, this.signupType, this.idTypeCancel.isNum);
  375. },
  376. //去关注
  377. goFollowShowBtn() {
  378. this.$emit("cancelShowBtn", this.idTypeCancel, this.signupType, this.idTypeCancel.isNum);
  379. uni.navigateTo({
  380. url: "/activityPages/accountsOfficial/accountsOfficial",
  381. });
  382. },
  383. async cancelShowBtn() {
  384. const res = await activity.signupCancel({
  385. ActivityId: this.idTypeCancel.id,
  386. SignupType: this.idTypeCancel.type,
  387. });
  388. if (res.Ret == 200) {
  389. this.idTypeCancel.cutId = res.Data.ActivityId;
  390. if (this.signupType == 1) {
  391. uni.showToast({
  392. title: "预约外呼已取消",
  393. duration: 2000,
  394. });
  395. } else {
  396. uni.showToast({
  397. title: "已取消报名",
  398. duration: 2000,
  399. });
  400. }
  401. this.$emit("cancelShowBtn", this.idTypeCancel, this.signupType, this.idTypeCancel.isNum);
  402. }
  403. this.$parent.isCancelShow = false;
  404. this.cancelShow = false;
  405. },
  406. //立即申请
  407. applyIsShowBtn() {
  408. if (this.hasPermission == 3) {
  409. uni.navigateTo({
  410. url: "/pageMy/applyTrial/applyTrial?tryType=Activity&detailId=" + this.jurisdictionList.ActivityId,
  411. });
  412. } else if (this.hasPermission == 4) {
  413. uni.showModal({
  414. content: "申请已提交,请等待销售人员与您联系",
  415. confirmText: "知道了",
  416. showCancel: false,
  417. confirmColor: "#376cbb",
  418. });
  419. } else if (this.hasPermission == 5) {
  420. this.showhasPermissionBtn();
  421. }
  422. },
  423. //去设置
  424. gmailboxBindingDlgBtn() {
  425. uni.navigateTo({
  426. url: "/activityPages/editOutbound/editOutbound?title=设置外呼号码&identification=邮箱&goOnNextStep=" + this.goOnNextStep + "&id=" + this.idTypeCancel.cutId,
  427. });
  428. },
  429. // 拨打电话的取消弹框
  430. showhasPermissionCancel() {
  431. this.showhasPermission = false;
  432. this.$parent.isShowhasPermission = false;
  433. },
  434. },
  435. mounted() {
  436. // 免费送月卡
  437. // this.userIsShowAlert();
  438. },
  439. };
  440. </script>
  441. <style lang="scss">
  442. .slot-content {
  443. width: 100%;
  444. padding: 50rpx;
  445. text-align: center;
  446. font-size: 32rpx;
  447. color: #0f1826;
  448. line-height: 48rpx;
  449. }
  450. .seller-mobile {
  451. display: inline-block;
  452. color: #376cbb;
  453. }
  454. .u-model__footer__button.data-v-3626fcec {
  455. border-right: 1rpx solid #333;
  456. }
  457. </style>