开放平台
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

123 wiersze
2.8 KiB

  1. <template>
  2. <div class="control">
  3. <Header />
  4. <div class="nuxt-child">
  5. <nuxt-child keep-alive />
  6. </div>
  7. <!-- 页面浮动功能点 -->
  8. <div class="suspension-box">
  9. <el-tooltip effect="dark" content="投诉建议" placement="left">
  10. <div class="item">
  11. <i class="iconfont MinIcontousu"></i>
  12. </div>
  13. </el-tooltip>
  14. <el-tooltip effect="dark" placement="left">
  15. <div slot="content">
  16. <img class="tooltip-img" src="@/static/img/boos.png" alt="" />
  17. <p class="tooltip-p">扫码添加专属客服</p>
  18. </div>
  19. <div class="item">
  20. <i class="iconfont MinIconlianxi"></i>
  21. </div>
  22. </el-tooltip>
  23. <el-tooltip effect="dark" content="回到顶部" placement="left">
  24. <div class="item" @click="onScrollInto">
  25. <i class="iconfont MinIconhuidaodingbu"></i>
  26. </div>
  27. </el-tooltip>
  28. </div>
  29. </div>
  30. </template>
  31. <script>
  32. import Header from "@/components/domain/header";
  33. export default {
  34. meta: { title: "控制台" },
  35. components: {
  36. Header,
  37. },
  38. methods: {
  39. // 回到顶部
  40. onScrollInto: function () {
  41. // 控制回到该元素可见范围内
  42. // document.getElementById("target").scrollIntoView();
  43. // 带过渡效果的回到顶部
  44. const upRoll = setInterval(() => {
  45. const top = document.documentElement.scrollTop; // 每次获取页面被卷去的部分
  46. const speed = top / 10; // 每次滚动多少 (步长值)
  47. if (document.documentElement.scrollTop !== 0) {
  48. document.documentElement.scrollTop -= speed; // 不在顶部 每次滚动到的位置
  49. } else {
  50. clearInterval(upRoll); // 回到顶部清除定时器
  51. }
  52. }, 20);
  53. },
  54. },
  55. };
  56. </script>
  57. <style lang="scss" scoped>
  58. .control {
  59. width: 100%;
  60. // min-height: calc(100vh - 80px);
  61. min-height: 100vh;
  62. background: #f7f8fa;
  63. }
  64. .suspension-box {
  65. position: fixed;
  66. width: 52px;
  67. right: 20px;
  68. top: 60%;
  69. z-index: 99;
  70. .item {
  71. width: 52px;
  72. height: 52px;
  73. background: #fff;
  74. border-radius: 8px;
  75. border: 1px solid #dddddd;
  76. box-shadow: 0px 2px 10px 0px rgba(51, 51, 51, 0.1);
  77. margin-bottom: 10px;
  78. display: flex;
  79. align-items: center;
  80. justify-content: center;
  81. transition: background-color 0.6s, box-shadow 0.6s;
  82. i {
  83. font-size: 25px;
  84. color: #515151;
  85. transition: color 0.6s;
  86. }
  87. }
  88. .item:hover {
  89. background-color: #1890ff;
  90. box-shadow: 0px 2px 10px 0px rgba(24, 144, 255, 0.6);
  91. transition: background-color 0.6s, box-shadow 0.6s;
  92. i {
  93. color: #fff;
  94. transition: color 0.6s;
  95. }
  96. }
  97. }
  98. .tooltip-img {
  99. width: 112px;
  100. height: 112px;
  101. }
  102. .tooltip-p {
  103. text-align: center;
  104. }
  105. .nuxt-child {
  106. width: 1200px;
  107. margin: 20px auto 0;
  108. padding-bottom: 20px;
  109. }
  110. </style>