content-card.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <div class="content-card" :class="setClass">
  3. <span v-if="showCloseIcon" class="j-icon icon-pc-close" @click="closeIconClick" />
  4. <ContractCard v-if="type === '1'" :phone="phone" :user-phone="userPhone" :wxer="wxer" @contactMeEvent="contactMeEvent" />
  5. <ContractCardQrcode v-else :wxer="wxer" :show-text="showText" class="qrcode-module" />
  6. <LeaveCommon :class="{ 'samll-footer': type === '2' }" />
  7. </div>
  8. </template>
  9. <script>
  10. import { useContactMeLogic } from '../../../utils/hooks'
  11. import ContractCard from './contract-card.vue'
  12. import ContractCardQrcode from './contract-card-qrcode.vue'
  13. import LeaveCommon from './footer'
  14. export default {
  15. name: 'ContentCard',
  16. components: {
  17. ContractCard,
  18. ContractCardQrcode,
  19. LeaveCommon,
  20. },
  21. props: {
  22. config: {
  23. type: Object,
  24. default: () => ({})
  25. },
  26. type: {
  27. type: String,
  28. default: '2'
  29. },
  30. showText: {
  31. type: Boolean,
  32. default: true
  33. },
  34. showCloseIcon: {
  35. type: Boolean,
  36. default: true
  37. },
  38. wxer: {
  39. type: String,
  40. default: ''
  41. },
  42. setClass: {
  43. type: String,
  44. default: ''
  45. },
  46. phone: {
  47. type: String,
  48. default: ''
  49. },
  50. userPhone: {
  51. type: String,
  52. default: ''
  53. }
  54. // source: {
  55. // type: String,
  56. // default: ''
  57. // },
  58. // sourceDesc: {
  59. // type: String,
  60. // default: ''
  61. // },
  62. // popupTitle: {
  63. // type: String,
  64. // default: '联系专属客服,申请免费体验'
  65. // }
  66. },
  67. watch: {
  68. showText: {
  69. handler(val) {
  70. console.info(val, 'showText')
  71. },
  72. immediate: true
  73. }
  74. },
  75. mounted() {
  76. useContactMeLogic({ props: this.$props })
  77. },
  78. methods: {
  79. contactMeEvent(phone) {
  80. this.$emit('contactMeEvent', phone)
  81. },
  82. closeIconClick() {
  83. this.$emit('close')
  84. }
  85. }
  86. }
  87. </script>
  88. <style scoped lang="scss">
  89. .content-card {
  90. position: relative;
  91. background: #fff;
  92. border-radius: 8px;
  93. .icon-pc-close {
  94. position: absolute;
  95. top: 16px;
  96. right: 16px;
  97. cursor: pointer;
  98. }
  99. .qrcode-module {
  100. ::v-deep {
  101. .qr-code-container {
  102. &::after {
  103. display: none;
  104. }
  105. &::before {
  106. display: none;
  107. }
  108. }
  109. }
  110. }
  111. .samll-footer {
  112. height: 216px;
  113. }
  114. &.leave-aside-card {
  115. ::v-deep {
  116. .contract-card-qrcode {
  117. height: 172px;
  118. padding: 12px 0 0;
  119. .contract-card-content {
  120. margin-top: 8px;
  121. }
  122. }
  123. .qr-code-container {
  124. padding: 0;
  125. .qr-code {
  126. padding-left: 0;
  127. img {
  128. width: 104px;
  129. height: 104px;
  130. }
  131. }
  132. }
  133. .leave-common-footer {
  134. height: 134px;
  135. .leave-common-title {
  136. margin-top: 10px;
  137. }
  138. .leave-common-footer-list {
  139. padding: 0 20px;
  140. width: 100%;
  141. margin-top: 8px;
  142. }
  143. .j-icon {
  144. width: 20px;
  145. height: 20px;
  146. }
  147. .icon-customer {
  148. width: 20px;
  149. height: 20px;
  150. }
  151. .leave-common-footer-item {
  152. margin-bottom: 10px;
  153. }
  154. .leave-common-footer-item-title {
  155. font-size: 12px;
  156. line-height: 18px;
  157. }
  158. }
  159. }
  160. }
  161. }
  162. </style>