bd-service.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <!-- #ifndef MP-TOUTIAO || MP-ALIPAY || H5 -->
  3. <view class="bd-item-content" v-if="mall.setting.show_contact_type != 0">
  4. <view v-if="mall.setting.show_contact_type == 2" class="bd-back dir-top-nowrap main-center cross-center box-grow-0" @click="router('/pages/web/web?url=' + encodeURIComponent(mall.setting.web_service_url))">
  5. <image class="bd-icon" src="/static/image/icon/detail-tell.png"></image>
  6. <text class="bd-text">客服</text>
  7. </view>
  8. <button v-if="mall.setting.show_contact_type == 1"
  9. open-type="contact"
  10. show-message-card
  11. :send-message-title="name"
  12. :send-message-path="url"
  13. class="bd-content bd-back box-grow-0">
  14. <view class="bd-content-view dir-top-nowrap main-center cross-center ">
  15. <image class="bd-icon" src="/static/image/icon/detail-tell.png"></image>
  16. <text class="bd-text">客服</text>
  17. </view>
  18. </button>
  19. <view v-if="mall.setting.show_contact_type == 3" class="bd-item-content dir-top-nowrap main-center cross-center box-grow-0" @click="makePhoneCall()">
  20. <image class="bd-icon" src="/static/image/icon/detail-tell.png"></image>
  21. <text class="bd-text">客服</text>
  22. </view>
  23. </view>
  24. <!-- #endif -->
  25. <!-- #ifdef MP-TOUTIAO || MP-ALIPAY || H5 -->
  26. <view>
  27. <view v-if="mall.setting.show_contact_type == 2" class="bd-item-content dir-top-nowrap main-center cross-center box-grow-0" @click="router('/pages/web/web?url=' + encodeURIComponent(mall.setting.web_service_url))">
  28. <image class="bd-icon" src="/static/image/icon/detail-tell.png"></image>
  29. <text class="bd-text">客服</text>
  30. </view>
  31. <view v-else-if="mall.setting.show_contact_type == 3" class="bd-item-content dir-top-nowrap main-center cross-center box-grow-0" @click="makePhoneCall()">
  32. <image class="bd-icon" src="/static/image/icon/detail-tell.png"></image>
  33. <text class="bd-text">客服</text>
  34. </view>
  35. </view>
  36. <!-- #endif -->
  37. </template>
  38. <script>
  39. import {mapState} from "vuex";
  40. export default {
  41. name: "bd-service",
  42. props: {
  43. name: String,
  44. url: String
  45. },
  46. computed: {
  47. ...mapState({
  48. mall: state => state.mallConfig.mall
  49. }),
  50. },
  51. methods: {
  52. router(url) {
  53. uni.navigateTo({
  54. url: url
  55. })
  56. },
  57. makePhoneCall() {
  58. if (this.mall.setting.contact_tel) {
  59. uni.makePhoneCall({
  60. phoneNumber: this.mall.setting.contact_tel
  61. })
  62. }
  63. }
  64. }
  65. }
  66. </script>
  67. <style scoped>
  68. .bd-item-content {
  69. width: 66upx;
  70. height: 100%;
  71. margin-right: 20upx;
  72. }
  73. .bd-content {
  74. padding: 0;
  75. display: block;
  76. background-color: #ffffff;
  77. border: none;
  78. }
  79. .bd-content-view {
  80. width:100%;
  81. height: 100%;
  82. }
  83. .bd-back {
  84. width: 66upx;
  85. height: 100%;
  86. }
  87. .bd-icon {
  88. width: 30upx;
  89. height: 30upx;
  90. margin-bottom: 8upx;
  91. }
  92. .bd-text {
  93. font-size: 20upx;
  94. color: #888888;
  95. line-height: 1;
  96. }
  97. </style>