index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <div class="set">
  3. <Header @confirmExit="confirmExit"></Header>
  4. <div class="main">
  5. <div class="li" @click="getConfig">
  6. <div class="liBox">
  7. <div class="pic"><img src="@/assets/images/common/set1.png"></div>
  8. <div class="name">
  9. 部署
  10. </div>
  11. </div>
  12. </div>
  13. <div class="li" @click="getLogout">
  14. <div class="liBox">
  15. <div class="pic"><img src="@/assets/images/common/set2.png"></div>
  16. <div class="name">
  17. 退出
  18. </div>
  19. </div>
  20. </div>
  21. </div>
  22. <div style=" color: #ffffff; font-size:2rem">
  23. <div @click="getCmdtest(1)">左滑动</div>
  24. <div @click="getCmdtest(2)">举左手</div>
  25. <div @click="getCmdtest(3)">双手胸前交叉</div>
  26. </div>
  27. </div>
  28. </template>
  29. <script setup name="Login" lang="ts">
  30. const { proxy } = getCurrentInstance() as any;
  31. const router = useRouter();
  32. //设置
  33. const getConfig = () => {
  34. //跳转
  35. router.push({ path: '/set/config' });
  36. };
  37. // 退出
  38. const getLogout = () => {
  39. proxy?.$modal.confirm("确定退出吗?").then(() => {
  40. proxy?.$modal.loading();
  41. let params = {};
  42. proxy?.$http.common.logout(params).then((res: any) => {
  43. });
  44. proxy?.$modal?.closeLoading()
  45. //清空缓存
  46. localStorage.clear();
  47. //跳转
  48. router.push({ path: '/login' });
  49. }).finally(() => {
  50. });
  51. };
  52. // 手势
  53. const getCmdtest = (data: any) => {
  54. let params = {
  55. hctrl_name: 'handcontroller_2',
  56. cmd: data
  57. };
  58. proxy?.$http.common.cmdtest(params).then((res: any) => {
  59. });
  60. };
  61. /**
  62. * 返回
  63. */
  64. const confirmExit = () => {
  65. router.go(-1);
  66. };
  67. onMounted(() => {
  68. })
  69. </script>
  70. <style lang="scss" scoped>
  71. $topPadding: 5.19rem;
  72. $waiPadding: 6.51rem;
  73. .main {
  74. width: calc(100% - ($waiPadding * 2));
  75. height: 60vh;
  76. padding-top: 10rem;
  77. margin: 0 auto;
  78. display: flex;
  79. justify-content: center;
  80. align-items: center;
  81. overflow: hidden;
  82. .li {
  83. width: 13vw;
  84. height: 19vw;
  85. border-radius: 1.6rem;
  86. box-sizing: border-box;
  87. box-shadow: inset 0px 1px 0px 2px rgba(255, 255, 255, 0.9046), inset 0px 3px 6px 0px rgba(0, 0, 0, 0.0851);
  88. display: flex;
  89. align-items: center;
  90. justify-content: center;
  91. text-align: center;
  92. cursor: pointer;
  93. margin: 0 20px;
  94. background: radial-gradient(167% 126% at 97% 6%, #35FFC6 0%, #00FFE8 100%);
  95. .liBox {
  96. .name {
  97. width: 100%;
  98. font-size: 2.48rem;
  99. color: #1A293A;
  100. padding: 0.5rem 0;
  101. }
  102. .pic {
  103. width: 10vw;
  104. height: 10vw;
  105. border-radius: 50%;
  106. background: radial-gradient(78% 78% at 53% 50%, #07121A 0%, #2A4256 49%, #5180A9 100%);
  107. box-shadow: 0px 0px 2px 2px #FFFFFF;
  108. margin-bottom: 2vh;
  109. overflow: hidden;
  110. display: flex;
  111. align-items: center;
  112. justify-content: center;
  113. flex-shrink: 0;
  114. img {
  115. width: 50%;
  116. height: 50%;
  117. transition: all 1s;
  118. }
  119. }
  120. }
  121. &:hover {
  122. img {
  123. transform: translateY(-0.5vw);
  124. }
  125. }
  126. }
  127. }
  128. </style>