index.vue 3.2 KB

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