modalDialog.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  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. <block v-if="jurisdictionList.isAudioVideo == 2">
  34. <text>您暂无权限查看此视频</text>
  35. <text>若想查看可以联系对口销售</text>
  36. </block>
  37. <block v-else>
  38. <text>您暂无权限参加此活动</text>
  39. <text>若想参加可以联系对口销售</text>
  40. </block>
  41. <view
  42. >{{ jurisdictionList.SellerName }} : <text @click="mobileDial" class="seller-mobile"> {{ jurisdictionList.SellerMobile }}</text></view
  43. >
  44. <text>申请开通对应的试用权限</text>
  45. </view>
  46. </u-modal>
  47. </view>
  48. </template>
  49. <script>
  50. import { User, activity, FreeButton } from "@/config/api.js";
  51. export default {
  52. data() {
  53. return {
  54. goFollowShow: false,
  55. show: false,
  56. cancelShow: false,
  57. applyIsShow: false,
  58. showRelation: 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 || this.showRelation;
  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 || this.showRelation
  171. ? "知道了"
  172. : this.editIsShowDlg
  173. ? "无需修改"
  174. : "";
  175. return text;
  176. },
  177. content() {
  178. let str = this.showRelation
  179. ? "申请已提交,请等待销售人员与您联系"
  180. : this.mailboxBindingDlg
  181. ? "您当前绑定的联系方式为邮箱,请先设置您的外呼号码"
  182. : this.applyIsShow || this.goFollowShow || this.show
  183. ? this.jurisdictionList.PopupMsg
  184. : this.showRelation
  185. ? "申请已提交,请等待销售人员与您联系"
  186. : "";
  187. return str;
  188. },
  189. },
  190. methods: {
  191. /**
  192. *
  193. *
  194. *
  195. * 确定
  196. *
  197. *
  198. */
  199. confirmModal() {
  200. this.show
  201. ? this.contentBtn()
  202. : this.goFollowShow
  203. ? this.goFollowShowBtn()
  204. : this.cancelShow
  205. ? this.cancelShowBtn()
  206. : this.applyIsShow
  207. ? this.applyIsShowBtn()
  208. : this.mailboxBindingDlg
  209. ? this.gmailboxBindingDlgBtn()
  210. : this.editIsShowDlg
  211. ? this.GoOutboundMobileBtn()
  212. : "";
  213. this.initData();
  214. },
  215. /**
  216. *
  217. *
  218. *
  219. * 取消
  220. *
  221. *
  222. */
  223. cancelModal() {
  224. this.editIsShowDlg ? this.GoOutboundMobileIsGo : this.initData();
  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. User.applyTry({
  249. TryType: this.jurisdictionList.isAudioVideo == 1 ? "MicroAudio" : this.jurisdictionList.isAudioVideo == 2 ? "MicroVideo" : "Activity",
  250. DetailId: this.jurisdictionList.ActivityId,
  251. }).then((res) => {
  252. this.showhasPermission = false;
  253. this.$parent.isShowhasPermission = false;
  254. });
  255. },
  256. mobileDial() {
  257. uni.makePhoneCall({
  258. phoneNumber: this.jurisdictionList.SellerMobile, //仅为示例
  259. });
  260. this.showhasPermission = false;
  261. this.$parent.isShowhasPermission = false;
  262. },
  263. showhasPermissionCancel() {
  264. this.showhasPermission = false;
  265. this.$parent.isShowhasPermission = false;
  266. },
  267. GoOutboundMobileBtn() {
  268. this.$parent.editIsShow = false;
  269. this.editIsShowDlg = false;
  270. if (this.goOnNextStep) {
  271. this.goFollowShow = true;
  272. } else {
  273. this.show = true;
  274. }
  275. },
  276. GoOutboundMobileIsGo() {
  277. this.$parent.editIsShow = false;
  278. this.editIsShowDlg = false;
  279. this.$emit("cancelShowBtn", this.idTypeCancel, this.signupType, this.idTypeCancel.isNum);
  280. uni.navigateTo({
  281. url:
  282. "/activityPages/editOutbound/editOutbound?title=修改外呼号码&identification=修改&goOnNextStep=" +
  283. this.goOnNextStep +
  284. "&id=" +
  285. this.idTypeCancel.cutId +
  286. "&cellphone=" +
  287. this.countryCode +
  288. "-" +
  289. this.mobileEdit,
  290. });
  291. },
  292. //获取权限弹窗是否展示免费月卡接口
  293. async userIsShowAlert() {
  294. const res = await FreeButton.userIsShowAlert();
  295. if (res.Ret === 200) {
  296. this.isShowAlert = res.Data.IsShow;
  297. }
  298. },
  299. /**
  300. *
  301. *
  302. *
  303. *
  304. *
  305. *confirm 模块
  306. *
  307. *
  308. *
  309. *
  310. *
  311. *
  312. */
  313. //正常的
  314. contentBtn() {
  315. this.$emit("cancelShowBtn", this.idTypeCancel, this.signupType, this.idTypeCancel.isNum);
  316. },
  317. //去关注
  318. goFollowShowBtn() {
  319. this.$emit("cancelShowBtn", this.idTypeCancel, this.signupType, this.idTypeCancel.isNum);
  320. uni.navigateTo({
  321. url: "/activityPages/accountsOfficial/accountsOfficial",
  322. });
  323. },
  324. cancelShowBtn() {
  325. activity
  326. .signupCancel({
  327. ActivityId: this.idTypeCancel.id,
  328. SignupType: this.idTypeCancel.type,
  329. })
  330. .then((res) => {
  331. if (res.Ret == 200) {
  332. this.idTypeCancel.cutId = res.Data.ActivityId;
  333. if (this.signupType == 1) {
  334. uni.showToast({
  335. title: "预约外呼已取消",
  336. duration: 2000,
  337. });
  338. } else {
  339. uni.showToast({
  340. title: "已取消报名",
  341. duration: 2000,
  342. });
  343. }
  344. this.$emit("cancelShowBtn", this.idTypeCancel, this.signupType, this.idTypeCancel.isNum);
  345. }
  346. this.$parent.isCancelShow = false;
  347. this.cancelShow = false;
  348. });
  349. },
  350. //立即申请
  351. applyIsShowBtn() {
  352. if (this.hasPermission == 3) {
  353. uni.navigateTo({
  354. url: "/pageMy/applyTrial/applyTrial?tryType=Activity&detailId=" + this.jurisdictionList.ActivityId,
  355. });
  356. } else if (this.hasPermission == 4) {
  357. this.showRelation = true;
  358. } else if (this.hasPermission == 5) {
  359. this.showhasPermissionBtn();
  360. }
  361. },
  362. //去设置
  363. gmailboxBindingDlgBtn() {
  364. uni.navigateTo({
  365. url: "/activityPages/editOutbound/editOutbound?title=设置外呼号码&identification=邮箱&goOnNextStep=" + this.goOnNextStep + "&id=" + this.idTypeCancel.cutId,
  366. });
  367. },
  368. },
  369. mounted() {
  370. this.userIsShowAlert();
  371. },
  372. };
  373. </script>
  374. <style lang="scss">
  375. .slot-content {
  376. width: 100%;
  377. padding: 50rpx;
  378. text-align: center;
  379. font-size: 32rpx;
  380. color: #0f1826;
  381. line-height: 48rpx;
  382. }
  383. .seller-mobile {
  384. display: inline-block;
  385. color: #2979ff;
  386. }
  387. .u-model__footer__button.data-v-3626fcec {
  388. border-right: 1rpx solid #333;
  389. }
  390. </style>