index.vue 5.9 KB

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