猫妈狗爸伴宠师小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
792 B

2 weeks ago
  1. <template>
  2. <button plain class="customer-service-btn" open-type="contact">
  3. <image src="@/static/images/ydd/chat.png" mode="widthFix"></image>
  4. </button>
  5. </template>
  6. <script setup>
  7. // 客服按钮组件 - 可以接收props来自定义位置等属性
  8. const props = defineProps({
  9. // 距离右边的距离
  10. right: {
  11. type: String,
  12. default: '20rpx'
  13. },
  14. // 距离底部的距离
  15. bottom: {
  16. type: String,
  17. default: '400rpx'
  18. },
  19. // 按钮宽度
  20. width: {
  21. type: String,
  22. default: '97rpx'
  23. }
  24. })
  25. </script>
  26. <style lang="scss" scoped>
  27. .customer-service-btn {
  28. position: fixed;
  29. right: v-bind(right);
  30. bottom: v-bind(bottom);
  31. z-index: 9999;
  32. border: none;
  33. padding: 0;
  34. width: v-bind(width);
  35. height: auto;
  36. background: transparent;
  37. image {
  38. width: 100%;
  39. height: auto;
  40. }
  41. }
  42. </style>