modalDialog.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  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() {
  126. this.editIsShowDlg = this.editIsShow;
  127. if (this.editIsShow) {
  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;
  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.goFollowShow
  169. ? "去关注"
  170. : this.show
  171. ? "知道了"
  172. : this.editIsShowDlg
  173. ? "无需修改"
  174. : "";
  175. return text;
  176. },
  177. content: {
  178. get() {
  179. let str = this.mailboxBindingDlg ? "您当前绑定的联系方式为邮箱,请先设置您的外呼号码" : this.applyIsShow || this.goFollowShow || this.show ? this.jurisdictionList.PopupMsg : "";
  180. return str;
  181. },
  182. set() {},
  183. },
  184. },
  185. methods: {
  186. /**
  187. *
  188. *
  189. *
  190. * 确定
  191. *
  192. *
  193. */
  194. confirmModal() {
  195. this.show
  196. ? this.contentBtn()
  197. : this.goFollowShow
  198. ? this.goFollowShowBtn()
  199. : this.cancelShow
  200. ? this.cancelShowBtn()
  201. : this.applyIsShow
  202. ? this.applyIsShowBtn()
  203. : this.mailboxBindingDlg
  204. ? this.gmailboxBindingDlgBtn()
  205. : this.editIsShowDlg
  206. ? this.GoOutboundMobileBtn()
  207. : "";
  208. this.initData();
  209. },
  210. /**
  211. *
  212. *
  213. *
  214. * 取消
  215. *
  216. *
  217. */
  218. cancelModal() {
  219. if (this.editIsShowDlg) {
  220. this.GoOutboundMobileIsGo;
  221. } else {
  222. this.initData();
  223. this.$emit("cancelShowBtn");
  224. }
  225. },
  226. /**
  227. *
  228. *
  229. *
  230. * 重置
  231. *
  232. *
  233. */
  234. initData() {
  235. this.$parent.isShow = false;
  236. this.show = false;
  237. this.$parent.goFollow = false;
  238. this.goFollowShow = false;
  239. this.applyIsShow = false;
  240. this.$parent.applyForIsShow = false;
  241. this.$parent.mailboxBinding = false;
  242. this.mailboxBindingDlg = false;
  243. this.$parent.signupType = "";
  244. this.$parent.isCancelShow = false;
  245. this.cancelShow = false;
  246. },
  247. showhasPermissionBtn() {
  248. // isAudioVideo -- 3 产业视频
  249. User.applyTry({
  250. TryType: this.jurisdictionList.isAudioVideo == 1 ? "MicroAudio" : this.jurisdictionList.isAudioVideo == 2 || this.jurisdictionList.isAudioVideo == 3 ? "MicroVideo" : "Activity",
  251. DetailId: this.jurisdictionList.ActivityId,
  252. }).then((res) => {
  253. this.showhasPermission = false;
  254. this.$parent.isShowhasPermission = false;
  255. });
  256. },
  257. mobileDial() {
  258. uni.makePhoneCall({
  259. phoneNumber: this.jurisdictionList.SellerMobile, // 拨打电话
  260. });
  261. this.showhasPermission = false;
  262. this.$parent.isShowhasPermission = false;
  263. },
  264. GoOutboundMobileBtn() {
  265. this.$parent.editIsShow = false;
  266. this.editIsShowDlg = false;
  267. if (this.goOnNextStep) {
  268. this.goFollowShow = true;
  269. } else {
  270. this.show = true;
  271. }
  272. },
  273. gmailboxBindingDlgBtn() {
  274. this.$parent.mailboxBinding = false;
  275. this.mailboxBindingDlg = false;
  276. this.$parent.signupType = "";
  277. uni.navigateTo({
  278. url: "/activityPages/editOutbound/editOutbound?title=设置外呼号码&identification=邮箱&goOnNextStep=" + this.goOnNextStep + "&id=" + this.idTypeCancel.cutId,
  279. });
  280. },
  281. //获取权限弹窗是否展示免费月卡接口
  282. async userIsShowAlert() {
  283. const res = await FreeButton.userIsShowAlert();
  284. if (res.Ret === 200) {
  285. this.isShowAlert = res.Data.IsShow;
  286. }
  287. },
  288. /**
  289. * 取消
  290. * */
  291. cancelMailboxBindingDlg() {
  292. this.$parent.mailboxBinding = false;
  293. this.mailboxBindingDlg = false;
  294. },
  295. GoOutboundMobileIsGo() {
  296. this.$parent.editIsShow = false;
  297. this.editIsShowDlg = false;
  298. uni.navigateTo({
  299. url:
  300. "/activityPages/editOutbound/editOutbound?title=修改外呼号码&identification=修改&goOnNextStep=" +
  301. this.goOnNextStep +
  302. "&id=" +
  303. this.idTypeCancel.cutId +
  304. "&cellphone=" +
  305. this.countryCode +
  306. "-" +
  307. this.mobileEdit,
  308. });
  309. },
  310. //获取权限弹窗是否展示免费月卡接口
  311. async userIsShowAlert() {
  312. const res = await FreeButton.userIsShowAlert();
  313. if (res.Ret === 200) {
  314. this.isShowAlert = res.Data.IsShow;
  315. }
  316. },
  317. /**
  318. *
  319. *
  320. *
  321. *
  322. *
  323. *confirm 模块
  324. *
  325. *
  326. *
  327. *
  328. *
  329. *
  330. */
  331. //正常的
  332. contentBtn() {
  333. this.$emit("cancelShowBtn", this.idTypeCancel, this.signupType, this.idTypeCancel.isNum);
  334. },
  335. //去关注
  336. goFollowShowBtn() {
  337. this.$emit("cancelShowBtn", this.idTypeCancel, this.signupType, this.idTypeCancel.isNum);
  338. uni.navigateTo({
  339. url: "/activityPages/accountsOfficial/accountsOfficial",
  340. });
  341. },
  342. async cancelShowBtn() {
  343. const res = await activity.signupCancel({
  344. ActivityId: this.idTypeCancel.id,
  345. SignupType: this.idTypeCancel.type,
  346. });
  347. if (res.Ret == 200) {
  348. this.idTypeCancel.cutId = res.Data.ActivityId;
  349. if (this.signupType == 1) {
  350. uni.showToast({
  351. title: "预约外呼已取消",
  352. duration: 2000,
  353. });
  354. } else {
  355. uni.showToast({
  356. title: "已取消报名",
  357. duration: 2000,
  358. });
  359. }
  360. this.$emit("cancelShowBtn", this.idTypeCancel, this.signupType, this.idTypeCancel.isNum);
  361. }
  362. this.$parent.isCancelShow = false;
  363. this.cancelShow = false;
  364. },
  365. //立即申请
  366. applyIsShowBtn() {
  367. if (this.hasPermission == 3) {
  368. uni.navigateTo({
  369. url: "/pageMy/applyTrial/applyTrial?tryType=Activity&detailId=" + this.jurisdictionList.ActivityId,
  370. });
  371. } else if (this.hasPermission == 4) {
  372. uni.showModal({
  373. content: "申请已提交,请等待销售人员与您联系",
  374. confirmText: "知道了",
  375. showCancel: false,
  376. confirmColor: "#3385FF",
  377. });
  378. } else if (this.hasPermission == 5) {
  379. this.showhasPermissionBtn();
  380. }
  381. },
  382. //去设置
  383. gmailboxBindingDlgBtn() {
  384. uni.navigateTo({
  385. url: "/activityPages/editOutbound/editOutbound?title=设置外呼号码&identification=邮箱&goOnNextStep=" + this.goOnNextStep + "&id=" + this.idTypeCancel.cutId,
  386. });
  387. },
  388. // 拨打电话的取消弹框
  389. showhasPermissionCancel() {
  390. this.showhasPermission = false;
  391. this.$parent.isShowhasPermission = false;
  392. },
  393. },
  394. mounted() {
  395. // 免费送月卡
  396. // this.userIsShowAlert();
  397. },
  398. };
  399. </script>
  400. <style lang="scss">
  401. .slot-content {
  402. width: 100%;
  403. padding: 50rpx;
  404. text-align: center;
  405. font-size: 32rpx;
  406. color: #0f1826;
  407. line-height: 48rpx;
  408. }
  409. .seller-mobile {
  410. display: inline-block;
  411. color: #2979ff;
  412. }
  413. .u-model__footer__button.data-v-3626fcec {
  414. border-right: 1rpx solid #333;
  415. }
  416. </style>