| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357 |
- <template>
- <view class="web-header">
- <!-- 首页 -->
- <div class="header-borer flex r_flex_space">
- <view class="r_flex_space r_wzjc" @click="onTargetPage(0)">
- <img
- class="logo-img"
- src="/static/background/gs-logo-z.png"
- style="width: 28rpx; height: 28rpx; margin: 5rpx"
- />
- 海南省信息通信有限公司
- </view>
- <view class="r_flex_space header-right">
- <view
- class="nav-list r_transform3 r_cursor"
- :class="routeName == 'pages/web/home/index' ? 'avtive' : ''"
- @click="onTargetPage('pages/web/home/index')"
- >
- 首页
- </view>
- <view
- class="nav-list r_transform3 r_cursor"
- :class="routeName == 'pages/web/product/index' ? 'avtive' : ''"
- @click="onTargetPage('pages/web/product/index')"
- >
- 产品与服务
- </view>
- <view
- class="nav-list r_transform3 r_cursor"
- :class="routeName == 'pages/web/dynamic/index' ? 'avtive' : ''"
- @click="onTargetPage('pages/web/dynamic/index')"
- >
- 最新动态
- </view>
- <view
- class="nav-list r_transform3 r_cursor"
- :class="routeName == 'pages/web/about/index' ? 'avtive' : ''"
- @click="onTargetPage('pages/web/about/index')"
- >
- 关于我们
- </view>
- <view
- class="nav-list r_transform3 r_cursor"
- :class="routeName == 'pages/web/contact/index' ? 'avtive' : ''"
- @click="onTargetPage('pages/web/contact/index')"
- >
- 联系我们
- </view>
- <view
- class="nav-long r_flex_center r_cursor"
- @click="
- () => {
- $toast('暂未开通');
- }
- "
- >
- 登录
- </view>
- </view>
- </div>
- </view>
- </template>
- <script>
- import { getTabBarLinks } from "@/core/app";
- export default {
- /**
- * 组件的属性列表
- * 用于组件自定义设置
- */
- props: {
- right: {
- type: Number,
- default: 30,
- },
- bottom: {
- type: Number,
- default: 100,
- },
- },
- data() {
- return {
- // 弹窗显示控制
- isShow: false,
- transparent: true,
- routeName: "",
- };
- },
- computed: {
- rightPx() {
- return uni.upx2px(this.right);
- },
- bottomPx() {
- return uni.upx2px(this.bottom);
- },
- },
- onLoad(options) {
- console.log("页面参数:", options);
- console.log("当前路径:", this.$page.route);
- },
- mounted() {
- // 获取当前页面路由信息
- const pages = getCurrentPages();
- const currentPage = pages[pages.length - 1];
- // 获取当前页面路径
- const route = currentPage.route;
- this.routeName = route;
- },
- methods: {
- /**
- * 导航菜单切换事件
- */
- onToggleShow() {
- const app = this;
- app.isShow = !app.isShow;
- app.transparent = false;
- },
- /**
- * 导航页面跳转
- */
- onTargetPage(data) {
- if (data) {
- this.$navTo(data);
- }
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- /* 快捷导航 */
- .shortcut {
- position: fixed;
- right: calc(var(--window-right) + var(--right));
- bottom: calc(var(--window-bottom) + var(--bottom));
- width: 76rpx;
- height: 76rpx;
- line-height: 1;
- z-index: 5;
- border-radius: 50%;
- }
- .avtive {
- color: #016fff;
- }
- .r_wzjc {
- font-weight: 900;
- }
- .header-borer {
- font-size: 11rpx;
- height: 35rpx;
- }
- .nav-long {
- font-size: 8rpx;
- width: 65rpx;
- height: 35rpx;
- background: #016fff;
- border-radius: 0px 0px 0px 0px;
- color: #fff;
- text-align: center;
- }
- .web-header {
- }
- /* 导航菜单元素 */
- .nav-list {
- padding-top: 6rpx;
- font-size: 11rpx;
- font-weight: 900;
- margin-right: 40rpx;
- &:hover {
- color: #016fff;
- }
- }
- .nav-item .iconfont {
- font-size: 40rpx;
- }
- /* 导航开关 */
- .nav-item__switch {
- opacity: 1;
- }
- .shortcut_click_show {
- margin-bottom: 0;
- background: #ff5454;
- }
- /* 显示动画 */
- .show_80 {
- bottom: 384rpx;
- animation: show_80 0.3s forwards;
- }
- .show_60 {
- bottom: 288rpx;
- animation: show_60 0.3s forwards;
- }
- .show_40 {
- bottom: 192rpx;
- animation: show_40 0.3s forwards;
- }
- .show_20 {
- bottom: 96rpx;
- animation: show_20 0.3s forwards;
- }
- @keyframes show_20 {
- from {
- bottom: 0;
- transform: rotate(0deg);
- opacity: 0;
- }
- to {
- bottom: 96rpx;
- transform: rotate(360deg);
- opacity: 1;
- }
- }
- @keyframes show_40 {
- from {
- bottom: 0;
- transform: rotate(0deg);
- opacity: 0;
- }
- to {
- bottom: 192rpx;
- transform: rotate(360deg);
- opacity: 1;
- }
- }
- @keyframes show_60 {
- from {
- bottom: 0;
- transform: rotate(0deg);
- opacity: 0;
- }
- to {
- bottom: 288rpx;
- transform: rotate(360deg);
- opacity: 1;
- }
- }
- @keyframes show_80 {
- from {
- bottom: 0;
- transform: rotate(0deg);
- opacity: 0;
- }
- to {
- bottom: 384rpx;
- transform: rotate(360deg);
- opacity: 1;
- }
- }
- /* 隐藏动画 */
- .hide_80 {
- bottom: 0;
- animation: hide_80 0.3s;
- opacity: 0;
- }
- .hide_60 {
- bottom: 0;
- animation: hide_60 0.3s;
- opacity: 0;
- }
- .hide_40 {
- bottom: 0;
- animation: hide_40 0.3s;
- opacity: 0;
- }
- .hide_20 {
- bottom: 0;
- animation: hide_20 0.3s;
- opacity: 0;
- }
- @keyframes hide_20 {
- from {
- bottom: 96rpx;
- transform: rotate(360deg);
- opacity: 1;
- }
- to {
- bottom: 0;
- transform: rotate(0deg);
- opacity: 0;
- }
- }
- @keyframes hide_40 {
- from {
- bottom: 192rpx;
- transform: rotate(360deg);
- opacity: 1;
- }
- to {
- bottom: 0;
- transform: rotate(0deg);
- opacity: 0;
- }
- }
- @keyframes hide_60 {
- from {
- bottom: 288rpx;
- transform: rotate(360deg);
- opacity: 1;
- }
- to {
- bottom: 0;
- transform: rotate(0deg);
- opacity: 0;
- }
- }
- @keyframes hide_80 {
- from {
- bottom: 384rpx;
- transform: rotate(360deg);
- opacity: 1;
- }
- to {
- bottom: 0;
- transform: rotate(0deg);
- opacity: 0;
- }
- }
- </style>
|