index.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <!-- #ifdef APP-PLUS || H5 -->
  3. <text class="acea-row row-center-wrapper cartf iconfont icon-kefu3" :style="{ top: top + 'px'}" @click="goCustomer"
  4. @touchmove.stop.prevent="setTouchMove"></text>
  5. <!-- #endif -->
  6. <!-- #ifdef MP -->
  7. <view v-if="routineContact == 0" class="acea-row row-center-wrapper cartf iconfont icon-kefu3"
  8. :style="{ top: top + 'px'}" @touchmove.stop.prevent="setTouchMove" @click="goCustomer"></view>
  9. <button class="acea-row row-center-wrapper cartf iconfont icon-kefu3" open-type='contact'
  10. :style="{ top: top + 'px'}" @touchmove.stop.prevent="setTouchMove"
  11. v-else-if="routineContact==1 && !goodsCon"></button>
  12. <button class="acea-row row-center-wrapper cartf iconfont icon-kefu3" open-type='contact'
  13. :send-message-title="storeInfo.store_name" :send-message-img="storeInfo.image"
  14. :send-message-path="`/pages/goods_details/index?id=${storeInfo.id}`" show-message-card
  15. :style="{ top: top + 'px'}" @touchmove.stop.prevent="setTouchMove"
  16. v-else-if="routineContact==1 && goodsCon"></button>
  17. <!-- #endif -->
  18. </template>
  19. <script>
  20. import {
  21. getCustomer
  22. } from '@/utils/index.js'
  23. let app = getApp();
  24. export default {
  25. name: "kefuIcon",
  26. props: {
  27. ids: {
  28. type: Number,
  29. default: 0
  30. },
  31. routineContact: {
  32. type: Number,
  33. default: 0
  34. },
  35. storeInfo: {
  36. type: Object,
  37. default: () => {}
  38. },
  39. goodsCon: {
  40. type: Number,
  41. default: 0
  42. }
  43. },
  44. data: function() {
  45. return {
  46. top: "480"
  47. };
  48. },
  49. mounted() {
  50. // #ifdef H5
  51. this.top = parseFloat(window.innerHeight) - 200
  52. // #endif
  53. },
  54. methods: {
  55. goCustomer() {
  56. getCustomer(`/pages/extension/customer_list/chat?productId=${this.ids}`)
  57. },
  58. setTouchMove(e) {
  59. let that = this;
  60. if (e.touches[0].clientY < 480 && e.touches[0].clientY > 66) {
  61. that.top = e.touches[0].clientY
  62. }
  63. }
  64. },
  65. created() {}
  66. };
  67. </script>
  68. <style lang="scss">
  69. .cartf {
  70. width: 96rpx;
  71. height: 96rpx;
  72. background: rgba(255, 255, 255, 0.8);
  73. box-shadow: 0 3rpx 16rpx rgba(0, 0, 0, 0.08);
  74. backdrop-filter: blur(10px);
  75. border-radius: 50%;
  76. font-size: 47rpx;
  77. color: #666;
  78. position: fixed;
  79. right: 15rpx;
  80. z-index: 9;
  81. }
  82. </style>