index.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <view class="rf-kefu" v-if="appServiceType !== '0'">
  3. <view class="wrapper" @tap="show">
  4. <text class="iconfont iconshouhoukefu"></text>
  5. </view>
  6. <view
  7. class="popup spec show"
  8. v-if="kefuClass"
  9. @touchmove.stop.prevent="stopPrevent"
  10. @tap="hide"
  11. >
  12. <!-- 遮罩层 -->
  13. <view class="mask" @tap="hide"></view>
  14. <view class="share-bg">
  15. <image :src="appServiceQr"></image>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. /* eslint-disable */
  22. export default {
  23. name: 'Home',
  24. props: {
  25. bottom: {
  26. type: Number,
  27. default: 150
  28. }
  29. },
  30. data () {
  31. return {
  32. kefuClass: false,
  33. appServiceQr: this.$mSettingConfig.appServiceQr,
  34. appServiceType: this.$mSettingConfig.appServiceType
  35. };
  36. },
  37. methods: {
  38. stopPrevent() {},
  39. hide() {
  40. this.kefuClass = false;
  41. },
  42. show() {
  43. if (this.appServiceType === '1') {
  44. this.kefuClass = true;
  45. } else if (this.appServiceType === '2') {
  46. if (!this.$mStore.getters.hasLogin) {
  47. this.$mHelper.backToLogin();
  48. return;
  49. }
  50. this.$mRouter.push({ route: '/pages/product/service/index' });
  51. }
  52. }
  53. }
  54. };
  55. </script>
  56. <style scoped lang="scss">
  57. .rf-kefu {
  58. width: 100%;
  59. .wrapper {
  60. height: 72upx;
  61. width: 72upx;
  62. background-color: #000;
  63. opacity: 0.5;
  64. border-radius: 50%;
  65. position: fixed;
  66. display: flex;
  67. justify-content: center;
  68. align-items: center;
  69. right: 40upx;
  70. bottom: 130upx;
  71. /* #ifdef H5 */
  72. bottom: 140upx;
  73. margin-bottom: env(safe-area-inset-bottom);
  74. /* #endif */
  75. z-index: 98;
  76. }
  77. .iconfont {
  78. font-size: 48upx;
  79. opacity: 1;
  80. color: $color-white;
  81. z-index: 92;
  82. }
  83. .share-bg {
  84. height: 100vh;
  85. display: flex;
  86. justify-content: center;
  87. align-items: center;
  88. z-index: 98;
  89. image {
  90. margin-top: -10vw;
  91. width: 60vw;
  92. height: 60vw;
  93. border-radius: 12upx;
  94. z-index: 98;
  95. }
  96. }
  97. }
  98. </style>