index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <template>
  2. <view class="web-header">
  3. <!-- 首页 -->
  4. <div class="header-borer flex r_flex_space">
  5. <view class="r_flex_space r_wzjc" @click="onTargetPage(0)">
  6. <img
  7. class="logo-img"
  8. src="/static/background/gs-logo-z.png"
  9. style="width: 28rpx; height: 28rpx; margin: 5rpx"
  10. />
  11. 海南省信息通信有限公司
  12. </view>
  13. <view class="r_flex_space header-right">
  14. <view class="nav-list r_cursor" @click="onTargetPage('pages/web/home/index')"> 首页 </view>
  15. <view class="nav-list r_cursor" @click="onTargetPage('pages/web/product/index')">
  16. 产品与服务
  17. </view>
  18. <view class="nav-list r_cursor" @click="onTargetPage('pages/web/dynamic/index')">
  19. 最新动态
  20. </view>
  21. <view class="nav-list r_cursor" @click="onTargetPage('pages/web/about/index')">
  22. 关于我们
  23. </view>
  24. <view class="nav-list r_cursor" @click="onTargetPage('pages/web/contact/index')">
  25. 联系我们
  26. </view>
  27. <view class="nav-long r_flex_center r_cursor" @click="onTargetPage(0)">
  28. 登录
  29. </view>
  30. </view>
  31. </div>
  32. </view>
  33. </template>
  34. <script>
  35. import { getTabBarLinks } from "@/core/app";
  36. export default {
  37. /**
  38. * 组件的属性列表
  39. * 用于组件自定义设置
  40. */
  41. props: {
  42. right: {
  43. type: Number,
  44. default: 30,
  45. },
  46. bottom: {
  47. type: Number,
  48. default: 100,
  49. },
  50. },
  51. data() {
  52. return {
  53. // 弹窗显示控制
  54. isShow: false,
  55. transparent: true,
  56. };
  57. },
  58. computed: {
  59. rightPx() {
  60. return uni.upx2px(this.right);
  61. },
  62. bottomPx() {
  63. return uni.upx2px(this.bottom);
  64. },
  65. },
  66. methods: {
  67. /**
  68. * 导航菜单切换事件
  69. */
  70. onToggleShow() {
  71. const app = this;
  72. app.isShow = !app.isShow;
  73. app.transparent = false;
  74. },
  75. /**
  76. * 导航页面跳转
  77. */
  78. onTargetPage(data) {
  79. if (data) {
  80. this.$navTo(data);
  81. }
  82. },
  83. },
  84. };
  85. </script>
  86. <style lang="scss" scoped>
  87. /* 快捷导航 */
  88. .shortcut {
  89. position: fixed;
  90. right: calc(var(--window-right) + var(--right));
  91. bottom: calc(var(--window-bottom) + var(--bottom));
  92. width: 76rpx;
  93. height: 76rpx;
  94. line-height: 1;
  95. z-index: 5;
  96. border-radius: 50%;
  97. }
  98. .r_wzjc {
  99. font-weight: 900;
  100. }
  101. .header-borer {
  102. font-size: 11rpx;
  103. height: 35rpx;
  104. }
  105. .nav-long {
  106. font-size: 8rpx;
  107. width: 65rpx;
  108. height: 35rpx;
  109. background: #016fff;
  110. border-radius: 0px 0px 0px 0px;
  111. color: #fff;
  112. text-align: center;
  113. }
  114. .web-header {
  115. }
  116. /* 导航菜单元素 */
  117. .nav-list {
  118. padding-top: 6rpx;
  119. font-size: 11rpx;
  120. font-weight: 900;
  121. margin-right: 40rpx;
  122. }
  123. .nav-item .iconfont {
  124. font-size: 40rpx;
  125. }
  126. /* 导航开关 */
  127. .nav-item__switch {
  128. opacity: 1;
  129. }
  130. .shortcut_click_show {
  131. margin-bottom: 0;
  132. background: #ff5454;
  133. }
  134. /* 显示动画 */
  135. .show_80 {
  136. bottom: 384rpx;
  137. animation: show_80 0.3s forwards;
  138. }
  139. .show_60 {
  140. bottom: 288rpx;
  141. animation: show_60 0.3s forwards;
  142. }
  143. .show_40 {
  144. bottom: 192rpx;
  145. animation: show_40 0.3s forwards;
  146. }
  147. .show_20 {
  148. bottom: 96rpx;
  149. animation: show_20 0.3s forwards;
  150. }
  151. @keyframes show_20 {
  152. from {
  153. bottom: 0;
  154. transform: rotate(0deg);
  155. opacity: 0;
  156. }
  157. to {
  158. bottom: 96rpx;
  159. transform: rotate(360deg);
  160. opacity: 1;
  161. }
  162. }
  163. @keyframes show_40 {
  164. from {
  165. bottom: 0;
  166. transform: rotate(0deg);
  167. opacity: 0;
  168. }
  169. to {
  170. bottom: 192rpx;
  171. transform: rotate(360deg);
  172. opacity: 1;
  173. }
  174. }
  175. @keyframes show_60 {
  176. from {
  177. bottom: 0;
  178. transform: rotate(0deg);
  179. opacity: 0;
  180. }
  181. to {
  182. bottom: 288rpx;
  183. transform: rotate(360deg);
  184. opacity: 1;
  185. }
  186. }
  187. @keyframes show_80 {
  188. from {
  189. bottom: 0;
  190. transform: rotate(0deg);
  191. opacity: 0;
  192. }
  193. to {
  194. bottom: 384rpx;
  195. transform: rotate(360deg);
  196. opacity: 1;
  197. }
  198. }
  199. /* 隐藏动画 */
  200. .hide_80 {
  201. bottom: 0;
  202. animation: hide_80 0.3s;
  203. opacity: 0;
  204. }
  205. .hide_60 {
  206. bottom: 0;
  207. animation: hide_60 0.3s;
  208. opacity: 0;
  209. }
  210. .hide_40 {
  211. bottom: 0;
  212. animation: hide_40 0.3s;
  213. opacity: 0;
  214. }
  215. .hide_20 {
  216. bottom: 0;
  217. animation: hide_20 0.3s;
  218. opacity: 0;
  219. }
  220. @keyframes hide_20 {
  221. from {
  222. bottom: 96rpx;
  223. transform: rotate(360deg);
  224. opacity: 1;
  225. }
  226. to {
  227. bottom: 0;
  228. transform: rotate(0deg);
  229. opacity: 0;
  230. }
  231. }
  232. @keyframes hide_40 {
  233. from {
  234. bottom: 192rpx;
  235. transform: rotate(360deg);
  236. opacity: 1;
  237. }
  238. to {
  239. bottom: 0;
  240. transform: rotate(0deg);
  241. opacity: 0;
  242. }
  243. }
  244. @keyframes hide_60 {
  245. from {
  246. bottom: 288rpx;
  247. transform: rotate(360deg);
  248. opacity: 1;
  249. }
  250. to {
  251. bottom: 0;
  252. transform: rotate(0deg);
  253. opacity: 0;
  254. }
  255. }
  256. @keyframes hide_80 {
  257. from {
  258. bottom: 384rpx;
  259. transform: rotate(360deg);
  260. opacity: 1;
  261. }
  262. to {
  263. bottom: 0;
  264. transform: rotate(0deg);
  265. opacity: 0;
  266. }
  267. }
  268. </style>