modalDialog.vue 11 KB

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