index.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <view v-if="isShow">
  3. <!-- 微信小程序端、H5端、APP端 -->
  4. <!-- #ifdef MP-WEIXIN || H5 || APP-PLUS -->
  5. <button
  6. class="btn-normal"
  7. :open-type="setting.provider == 'mpwxkf' ? 'contact' : ''"
  8. :show-message-card="showCard"
  9. :send-message-path="cardPath"
  10. :send-message-title="cardTitle"
  11. :send-message-img="cardImage"
  12. @click="handleContact()"
  13. >
  14. <slot></slot>
  15. </button>
  16. <!-- #endif -->
  17. </view>
  18. </template>
  19. <script>
  20. import SettingKeyEnum from '@/common/enum/setting/Key'
  21. import SettingModel from '@/common/model/Setting'
  22. export default {
  23. props: {
  24. // 是否显示消息卡片
  25. showCard: {
  26. Type: Boolean,
  27. default: false
  28. },
  29. // 消息卡片标题
  30. cardTitle: {
  31. Type: String,
  32. default: ''
  33. },
  34. // 消息卡片图片
  35. cardImage: {
  36. Type: String,
  37. default: ''
  38. },
  39. // 消息卡片点击跳转的路径
  40. cardPath: {
  41. Type: String,
  42. default: ''
  43. }
  44. },
  45. data() {
  46. return {
  47. isShow: false,
  48. setting: {}
  49. }
  50. },
  51. async created() {
  52. // 是否显示在线客服按钮
  53. // this.isShow = await SettingModel.isShowCustomerBtn()
  54. // 商城客服设置
  55. // this.setting = await SettingModel.item(SettingKeyEnum.CUSTOMER.value, true)
  56. },
  57. methods: {}
  58. }
  59. </script>
  60. <style lang="scss" scoped></style>