FreeUserAdvancedMask.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <section class="free-user-advanced-mask mask-container bg-white">
  3. <MaskCard
  4. :desc="maskConf.desc"
  5. :exampleImage="maskConf.exampleImage"
  6. :footerButtonText="maskConf.buttonText"
  7. @footerBtnClick="onFooterBtnClick"
  8. >
  9. <template #header>
  10. <div class="header flex flex-justify-center flex-align-center">
  11. <div class="title">{{ maskConf.title }}</div>
  12. </div>
  13. </template>
  14. </MaskCard>
  15. </section>
  16. </template>
  17. <script>
  18. import { Icon } from 'vant'
  19. import { LINKS } from '@/data'
  20. import { openAppOrWxPage } from '@/utils/'
  21. import MaskCard from '@/views/article/ui/MaskCard.vue'
  22. export default {
  23. name: 'FreeUserAdvancedMask',
  24. components: {
  25. MaskCard,
  26. [Icon.name]: Icon
  27. },
  28. props: {
  29. type: {
  30. type: String,
  31. default: 'nijian',
  32. validator(value) {
  33. return ['nijian', 'caigouyixiang'].includes(value)
  34. }
  35. },
  36. beforeLeavePage: Function
  37. },
  38. data() {
  39. return {
  40. map: {
  41. nijian: {
  42. title: '超前项目抢先知,中标更容易',
  43. desc: '提前3-12个月获取审批中的新项目,超前项目抢先介入,商机提前掌控。',
  44. buttonText: '点击体验',
  45. source: 'article_proposed_project',
  46. exampleImage: 'mask/example/nj-detail-example.png'
  47. },
  48. caigouyixiang: {
  49. title: '项目提前介入,中标更轻松',
  50. desc: '提前1-3个月获取项目信息,<br />及早介入准备更充分',
  51. buttonText: '点击体验',
  52. source: 'article_purchase_intention',
  53. exampleImage: 'mask/example/cg-detail-example.png'
  54. }
  55. }
  56. }
  57. },
  58. computed: {
  59. maskConf() {
  60. return this.map[this.type] || this.map.nijian
  61. }
  62. },
  63. methods: {
  64. onFooterBtnClick() {
  65. this.leaveInfo()
  66. },
  67. async leaveInfo() {
  68. if (this.beforeLeavePage) {
  69. await this.beforeLeavePage()
  70. }
  71. openAppOrWxPage(LINKS.留资, {
  72. query: {
  73. source: this.maskConf.source
  74. }
  75. })
  76. },
  77. async concatKf() {
  78. if (this.beforeLeavePage) {
  79. await this.beforeLeavePage()
  80. }
  81. openAppOrWxPage(LINKS.客服)
  82. }
  83. }
  84. }
  85. </script>
  86. <style lang="scss" scoped>
  87. .header {
  88. width: 100%;
  89. font-size: 16px;
  90. }
  91. ::v-deep {
  92. .mask-content-desc-text {
  93. text-align: center;
  94. }
  95. .mask-content-example-image {
  96. img {
  97. transform: scale(1.12);
  98. }
  99. }
  100. }
  101. </style>