You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
2.7 KiB

3 months ago
  1. <template>
  2. <view style="touch-action: none;">
  3. <view class="home" style="position:fixed;" :style="{ top: top + 'px'}" id="right-nav" @touchmove.stop.prevent="setTouchMove">
  4. <view class="homeCon bg-color-red" :class="homeActive === true ? 'on' : ''" v-if="homeActive">
  5. <navigator hover-class='none' url='/pages/index/index' open-type='switchTab' class='iconfont icon-shouye-xianxing'></navigator>
  6. <navigator hover-class='none' url='/pages/order_addcart/order_addcart' open-type='switchTab' class='iconfont icon-caigou-xianxing'></navigator>
  7. <navigator hover-class='none' url='/pages/user/index' open-type='switchTab' class='iconfont icon-yonghu1'></navigator>
  8. </view>
  9. <view @click="open" class="pictrueBox">
  10. <view class="pictrue">
  11. <image :src="
  12. homeActive === true
  13. ? `${urlDomain}crmebimage/perset/staticImg/close.gif`
  14. : `${urlDomain}/crmebimage/perset/staticImg/open.gif`
  15. "
  16. class="image" />
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. import {
  24. mapGetters
  25. } from "vuex";
  26. export default {
  27. name: "Home",
  28. props: {},
  29. data: function() {
  30. return {
  31. urlDomain: this.$Cache.get("imgHost"),
  32. top: "500"
  33. };
  34. },
  35. computed: mapGetters(["homeActive"]),
  36. methods: {
  37. setTouchMove(e) {
  38. var that = this;
  39. if (e.touches[0].clientY < 545 && e.touches[0].clientY > 66) {
  40. that.top = e.touches[0].clientY
  41. // that.setData({
  42. // top: e.touches[0].clientY
  43. // })
  44. }
  45. },
  46. open: function() {
  47. this.homeActive ?
  48. this.$store.commit("CLOSE_HOME") :
  49. this.$store.commit("OPEN_HOME");
  50. }
  51. },
  52. created() {
  53. }
  54. };
  55. </script>
  56. <style scoped lang="scss">
  57. .pictrueBox {
  58. width: 130rpx;
  59. height: 120rpx;
  60. }
  61. /*返回主页按钮*/
  62. .home {
  63. position: fixed;
  64. color: white;
  65. text-align: center;
  66. z-index: 9999;
  67. right: 15rpx;
  68. display: flex;
  69. }
  70. .home .homeCon {
  71. border-radius: 50rpx;
  72. opacity: 0;
  73. height: 0;
  74. color: $theme-color;
  75. width: 0;
  76. }
  77. .home .homeCon.on {
  78. opacity: 1;
  79. animation: bounceInRight 0.5s cubic-bezier(0.215, 0.610, 0.355, 1.000);
  80. width: 300rpx;
  81. height: 86rpx;
  82. margin-bottom: 20rpx;
  83. display: flex;
  84. justify-content: center;
  85. align-items: center;
  86. /* background: #f44939 !important; */
  87. @include main_bg_color(theme);
  88. }
  89. .home .homeCon .iconfont {
  90. font-size: 48rpx;
  91. color: #fff;
  92. display: inline-block;
  93. margin: 0 auto;
  94. }
  95. .home .pictrue {
  96. width: 86rpx;
  97. height: 86rpx;
  98. border-radius: 50%;
  99. margin: 0 auto;
  100. }
  101. .home .pictrue .image {
  102. @include main_bg_color(theme);
  103. width: 100%;
  104. height: 100%;
  105. border-radius: 50%;
  106. transform: rotate(90deg);
  107. ms-transform: rotate(90deg);
  108. moz-transform: rotate(90deg);
  109. webkit-transform: rotate(90deg);
  110. o-transform: rotate(90deg);
  111. }
  112. </style>