index.vue 998 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <navigator :url="'/pages/customer_list/chat?productId='+ids" hover-class="none" class="acea-row row-center-wrapper cartf iconfont icon-kefu3" :style="{ top: top + 'px'}" @touchmove.stop.prevent="setTouchMove"></navigator>
  3. </template>
  4. <script>
  5. let app = getApp();
  6. export default {
  7. name: "kefuIcon",
  8. props: {
  9. ids: {
  10. type: Number,
  11. default: 0,
  12. }
  13. },
  14. data: function() {
  15. return {
  16. top: "480"
  17. };
  18. },
  19. mounted() {
  20. // #ifdef H5
  21. this.top = parseFloat(window.innerHeight) -200
  22. // #endif
  23. },
  24. methods: {
  25. setTouchMove(e) {
  26. let that = this;
  27. if (e.touches[0].clientY < 480 && e.touches[0].clientY > 66) {
  28. that.top = e.touches[0].clientY
  29. }
  30. }
  31. },
  32. created() {
  33. }
  34. };
  35. </script>
  36. <style lang="scss">
  37. .cartf{
  38. width: 96rpx;
  39. height: 96rpx;
  40. background: #FFFFFF;
  41. box-shadow: 0 3rpx 16rpx rgba(0, 0, 0, 0.08);
  42. border-radius: 50%;
  43. font-size: 47rpx;
  44. color: #666;
  45. position: fixed;
  46. right: 15rpx;
  47. z-index: 9;
  48. }
  49. </style>