index.vue 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <!-- 客服跳转 -->
  3. <!-- #ifdef APP-PLUS || H5 -->
  4. <view class="acea-row row-center-wrapper cartf iconfont icon-kefu3" :style="{ top: top + 'px'}" @touchmove.stop.prevent="setTouchMove" @click="licks"></view>
  5. <!-- #endif -->
  6. <!-- #ifdef MP -->
  7. <view v-if="routineContact == 0">
  8. <view class="acea-row row-center-wrapper cartf iconfont icon-kefu3" :style="{ top: top + 'px'}" @touchmove.stop.prevent="setTouchMove" @click="licks"></view>
  9. </view>
  10. <button class="acea-row row-center-wrapper cartf iconfont icon-kefu3" open-type='contact' :style="{ top: top + 'px'}" @touchmove.stop.prevent="setTouchMove" v-else-if="routineContact==1 && !goodsCon"></button>
  11. <button class="acea-row row-center-wrapper cartf iconfont icon-kefu3" open-type='contact' :send-message-title="storeInfo.store_name" :send-message-img="storeInfo.image" :send-message-path="`/pages/goods_details/index?id=${storeInfo.id}`" show-message-card :style="{ top: top + 'px'}" @touchmove.stop.prevent="setTouchMove" v-else-if="routineContact==1 && goodsCon"></button>
  12. <!-- #endif -->
  13. </template>
  14. <script>
  15. // +----------------------------------------------------------------------
  16. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  17. // +----------------------------------------------------------------------
  18. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  19. // +----------------------------------------------------------------------
  20. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  21. // +----------------------------------------------------------------------
  22. // | Author: CRMEB Team <admin@crmeb.com>
  23. // +----------------------------------------------------------------------
  24. let app = getApp();
  25. import {
  26. mapGetters
  27. } from "vuex";
  28. export default {
  29. name: "kefuIcon",
  30. props: {
  31. ids: {
  32. type: Number,
  33. default: 0
  34. },
  35. routineContact: {
  36. type: Number,
  37. default: 0
  38. },
  39. storeInfo: {
  40. type: Object,
  41. default () {
  42. return {};
  43. }
  44. },
  45. goodsCon: {
  46. type: Number,
  47. default: 0
  48. }
  49. },
  50. computed: mapGetters(['userInfo']),
  51. data: function() {
  52. return {
  53. top: "480"
  54. };
  55. },
  56. mounted() {
  57. // #ifdef H5
  58. this.top = parseFloat(window.innerHeight) -200
  59. // #endif
  60. },
  61. methods: {
  62. setTouchMove(e) {
  63. let that = this;
  64. if (e.touches[0].clientY < 480 && e.touches[0].clientY > 66) {
  65. that.top = e.touches[0].clientY
  66. }
  67. },
  68. licks(){
  69. let userInfo = {}
  70. if(typeof this.userInfo === 'string'){
  71. userInfo = JSON.parse(this.userInfo)
  72. }else{
  73. userInfo = this.userInfo
  74. }
  75. let url = `/pages/extension/customer_list/chat?productId=${this.ids}`
  76. this.$util.getCustomer(userInfo,url)
  77. }
  78. },
  79. created() {
  80. }
  81. };
  82. </script>
  83. <style lang="scss">
  84. .cartf{
  85. width: 96rpx;
  86. height: 96rpx;
  87. background: #FFFFFF;
  88. box-shadow: 0 3rpx 16rpx rgba(0, 0, 0, 0.08);
  89. border-radius: 50%;
  90. font-size: 47rpx;
  91. color: #666;
  92. position: fixed;
  93. right: 15rpx;
  94. z-index: 9;
  95. }
  96. </style>