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.

63 lines
1.3 KiB

1 week ago
  1. <template>
  2. <view class="float-button">
  3. <!-- <button type="default" open-type="contact" class="kf-btn">
  4. <img src="../../static/images/details/kefu.svg" style="width: 26px;height: 36px;" alt="kefu"
  5. srcset="">
  6. </button> -->
  7. <button @click="openCustomerService" class="kf-btn">
  8. <img src="../../static/images/details/kefu.svg" style="width: 26px;height: 36px;" alt="kefu" srcset="">
  9. </button>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. data() {
  15. return {
  16. };
  17. },
  18. methods: {
  19. openCustomerService() {
  20. uni.openCustomerServiceChat({
  21. //企业微信的企业id
  22. corpId: 'wwccd9a21f09fed62d',
  23. extInfo: {
  24. //客服链接
  25. url: 'https://work.weixin.qq.com/kfid/kfc09f128696578f66d'
  26. },
  27. success: (e) => {
  28. console.log('e', e)
  29. },
  30. fail: (err) => {
  31. console.log('err', err)
  32. }
  33. })
  34. }
  35. }
  36. }
  37. </script>
  38. <style lang="scss">
  39. .float-button {
  40. position: fixed;
  41. bottom: 150px;
  42. /* 距离底部的距离 */
  43. right: 10px;
  44. /* 距离右侧的距离 */
  45. width: 50px;
  46. /* 按钮的宽度 */
  47. height: 50px;
  48. /* 按钮的高度 */
  49. /* 其他样式 */
  50. .kf-btn {
  51. background-color: rgba(255, 255, 255, 1);
  52. height: 52px;
  53. width: 52px;
  54. border-radius: 50%;
  55. display: flex;
  56. align-items: center;
  57. }
  58. }
  59. </style>