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