LinkUser.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <div class="mobile-modal" v-if="showLink">
  3. <div class="mobile-modal-box mobile-link-en">
  4. <div class="mobile-modal-header">联系方式<i @click="$emit('closeAction')" class="icon-guanbi iconfont"></i></div>
  5. <div class="mobile-modal-content">
  6. <div v-if="checkTel" class="clearfix"><span class="pull-left">电话:</span><a :href="'tel:' + infoObj.enTel" target="_blank" class="content-line link-url pull-left">{{infoObj.enTel}}</a></div>
  7. <div v-if="checkPhone" class="clearfix"><span class="pull-left">手机:</span><a :href="'tel:' + infoObj.enPhone" target="_blank" class="content-line link-url pull-left">{{infoObj.enPhone}}</a></div>
  8. <div v-if="checkWeixin" class="clearfix"><span class="pull-left">微信:</span><span class="content-line pull-left">{{infoObj.enWeixin}}</span></div>
  9. <div v-if="checkQQ" class="clearfix"><span class="pull-left">Q&nbsp;Q:</span><span class="content-line pull-left">{{infoObj.enQQ}}</span></div>
  10. <div v-if="!empty">暂无联系方式</div>
  11. </div>
  12. </div>
  13. </div>
  14. </template>
  15. <script>
  16. export default {
  17. props: {
  18. showLink: {
  19. type: Boolean,
  20. default: false
  21. },
  22. infoObj: {
  23. type: Object,
  24. default: () => {
  25. return {}
  26. }
  27. }
  28. },
  29. computed: {
  30. checkTel () {
  31. return this.checkInfo(this.infoObj.enTel)
  32. },
  33. checkPhone () {
  34. return this.checkInfo(this.infoObj.enPhone)
  35. },
  36. checkWeixin () {
  37. return this.checkInfo(this.infoObj.enWeixin)
  38. },
  39. checkQQ () {
  40. return this.checkInfo(this.infoObj.enQQ)
  41. },
  42. empty () {
  43. return this.checkTel || this.checkPhone || this.checkWeixin || this.checkQQ
  44. }
  45. },
  46. methods: {
  47. checkInfo: function (str) {
  48. return str && str.trim() !== ''
  49. }
  50. }
  51. }
  52. </script>
  53. <style lang="scss" scoped>
  54. .mobile-modal .mobile-modal-box .mobile-modal-content {
  55. .clearfix {
  56. padding-left: 1rem;
  57. }
  58. }
  59. </style>