content.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <div class="mobile-content-card">
  3. <div class="hd-container">
  4. <div class="header-tip">
  5. 以下三种方式任选:
  6. </div>
  7. <div class="step-list">
  8. <div class="step-item step-item-1">
  9. <span class="step-number-index">1. </span>
  10. <span class="step-item-content">
  11. <span class="step-left-text">
  12. <span>联系客服:拨打 </span>
  13. <span class="highlight-text" @click="doCallPhone">{{ phone }}</span>
  14. </span>
  15. <span class="step-right-icon" @click="doCallPhone">
  16. <span class="j-icon j-icon-base icon-mobile-phone wh24" />
  17. </span>
  18. </span>
  19. </div>
  20. <div class="step-item step-item-2">
  21. <span class="step-number-index">2. </span>
  22. <span class="step-item-content">
  23. <div class="step-left-text">添加企业微信:</div>
  24. <QrCode :qr="qr" :platform="platform" />
  25. </span>
  26. </div>
  27. <div class="step-item step-item-3">
  28. <span class="step-number-index">3. </span>
  29. <span v-if="useCustomer3" class="step-item-content">
  30. <span class="step-left-text">
  31. <span class="highlight-text underline" @click="askOnlineCustom">咨询在线客服 ></span>
  32. </span>
  33. </span>
  34. <span v-else class="step-item-content">
  35. <span class="step-left-text">客服主动联系您:</span>
  36. <div class="step-right-content">
  37. <InputPhone :init-phone="phone" @contact="contactMe" />
  38. </div>
  39. </span>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </template>
  45. <script>
  46. import { mobileCustomPage } from '../../../utils/utils'
  47. import QrCode from './QrCode.vue'
  48. import InputPhone from './InputPhone.vue'
  49. export default {
  50. name: 'ContentInfo',
  51. components: {
  52. QrCode,
  53. InputPhone
  54. },
  55. props: {
  56. phone: {
  57. type: String,
  58. default: ''
  59. },
  60. qr: {
  61. type: String,
  62. default: ''
  63. },
  64. isCurrentPhone: {
  65. type: Boolean,
  66. default: false,
  67. },
  68. useCustomer3: {
  69. type: Boolean,
  70. default: false,
  71. },
  72. platform: String
  73. },
  74. methods: {
  75. contactMe() {
  76. this.$emit('contact')
  77. },
  78. askOnlineCustom(platform = 'app') {
  79. const url = mobileCustomPage(platform)
  80. location.href = url
  81. },
  82. doCallPhone() {
  83. const phone = this.phone
  84. if (phone) {
  85. this.callPhone(phone)
  86. }
  87. },
  88. callPhone(phone) {
  89. if (!phone)
  90. return console.error('手机号为空')
  91. if (this.platform === 'app') {
  92. try {
  93. JyObj.callPhone(phone)
  94. }
  95. catch (error) {
  96. console.log(error)
  97. }
  98. }
  99. else {
  100. location.href = `tel:${phone}`
  101. }
  102. }
  103. }
  104. }
  105. </script>
  106. <style scoped lang="scss">
  107. .hd-container {
  108. padding: 12px 16px;
  109. .header-tip {
  110. font-size: 14px;
  111. line-height: 20px;
  112. color: #5F5E64;
  113. }
  114. .step-list {
  115. margin-top: 8px;
  116. margin-bottom: 20px;
  117. font-size: 16px;
  118. line-height: 24px;
  119. color: #171826;
  120. }
  121. .step-item {
  122. display: flex;
  123. &:not(:last-of-type) {
  124. margin-bottom: 14px;
  125. }
  126. .underline {
  127. text-decoration: underline;
  128. }
  129. }
  130. .step-item-content {
  131. margin-left: 4px;
  132. flex: 1;
  133. }
  134. .step-item-1 {
  135. align-items: center;
  136. .step-item-content {
  137. display: flex;
  138. align-items: center;
  139. justify-content: space-between;
  140. }
  141. }
  142. .step-item-2 {
  143. .step-left-text {
  144. margin-bottom: 4px;
  145. }
  146. }
  147. }
  148. </style>