|
|
@@ -1,22 +1,23 @@
|
|
|
<template>
|
|
|
- <view class="hover_content">
|
|
|
- <view class="hover_menu flex">
|
|
|
- <div class="sider" :class="isSider ? 'hoverd' : 'hover'"></div>
|
|
|
- <view
|
|
|
+ <div class="hover_content">
|
|
|
+ <div class="hover_menu flex">
|
|
|
+ <div
|
|
|
class="menu_icon"
|
|
|
v-for="(menu, i) in menus"
|
|
|
:key="i"
|
|
|
@tap="click(i, menu.pagePath)"
|
|
|
>
|
|
|
- <view class="iconBox">
|
|
|
- <span class="iconfont" :class="[menu.icon, (selectedIndex == i)? 'hoverd' : 'hover']"></span>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ <!-- <uni-transition mode-class="fade" show="true" v-if="selectedIndex == i"> -->
|
|
|
+ <!-- <img :src="menu.selectedIconPath" /> -->
|
|
|
+ <image class="tabbar-list-li-icon-image" :src="selectedIndex == i ? menu.selectedIconPath : menu.iconPath" mode=""></image>
|
|
|
+ <!-- </uni-transition> -->
|
|
|
+<!-- <uni-transition mode-class="fade" show="true" v-else>
|
|
|
+ <img :src="menu.iconPath" />
|
|
|
+ </uni-transition> -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
-<style scoped src="../../static/iconfont.css">
|
|
|
-</style>
|
|
|
<style lang="scss" scoped>
|
|
|
.hover_content {
|
|
|
z-index: 999;
|
|
|
@@ -32,89 +33,67 @@
|
|
|
.hover_menu {
|
|
|
display: flex;
|
|
|
justify-content: space-around;
|
|
|
- align-items: center;
|
|
|
- margin-top: 10rpx;
|
|
|
- .sider {
|
|
|
- position: absolute;
|
|
|
- width: 60rpx;
|
|
|
- height: 60rpx;
|
|
|
- border-radius: 50%;
|
|
|
- left: 14%;
|
|
|
- transition: all 0.1s;
|
|
|
- background: rgb(14, 92, 246);
|
|
|
- &.hover {
|
|
|
- left: 14%;
|
|
|
- background: rgb(14, 92, 246);
|
|
|
- }
|
|
|
- &.hoverd {
|
|
|
- left: 61%;
|
|
|
- background: rgb(14, 92, 246);
|
|
|
- }
|
|
|
- }
|
|
|
+ margin-top: 10rpx;
|
|
|
.menu_icon {
|
|
|
- position: relative;
|
|
|
- .iconBox {
|
|
|
+ transition: all 0.5s;
|
|
|
+ image {
|
|
|
width: 60rpx;
|
|
|
height: 60rpx;
|
|
|
- border-radius: 50%;
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- align-items: center;
|
|
|
- .iconfont {
|
|
|
- z-index: 999;
|
|
|
- color: #fff;
|
|
|
- font-size: 30rpx;
|
|
|
- font-family: "iconfont" !important;
|
|
|
- -webkit-font-smoothing: antialiased;
|
|
|
- -moz-osx-font-smoothing: grayscale;
|
|
|
- &.hover{
|
|
|
- color: rgb(187, 187, 187);
|
|
|
- }
|
|
|
- &.hoverd{
|
|
|
- color: #fff;
|
|
|
- }
|
|
|
- }
|
|
|
+ border-radius: 100rpx;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
<script>
|
|
|
-import app from '../../App'
|
|
|
export default {
|
|
|
- data() {
|
|
|
+ props: ['selectedIndex'],
|
|
|
+ data() {
|
|
|
return {
|
|
|
- selectedIndex: app.globalData.selectedIndex,
|
|
|
- showselected: false,
|
|
|
- isSider: app.globalData.isSider,
|
|
|
+ // selectedIndex: 0,
|
|
|
+ // showselected: false,
|
|
|
menus: [
|
|
|
{
|
|
|
- pagePath: "pages/index/index",
|
|
|
- icon: "icon-zhuye",
|
|
|
- text: "首页",
|
|
|
+ pagePath: "/pages/index/index",
|
|
|
+ iconPath: "/static/tabbar/home-select.png",
|
|
|
+ selectedIconPath: "/static/tabbar/home-selected.png",
|
|
|
+ text: "Ê×Ò³",
|
|
|
},
|
|
|
{
|
|
|
- pagePath: "pages/selfCenter/index",
|
|
|
- icon: "icon-geren",
|
|
|
- text: "我的",
|
|
|
+ pagePath: "/pages/selfCenter/index",
|
|
|
+ iconPath: "/static/tabbar/user-select.png",
|
|
|
+ selectedIconPath: "/static/tabbar/user-selected.png",
|
|
|
+ text: "ÎÒµÄ",
|
|
|
},
|
|
|
],
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
click(index, src) {
|
|
|
- this.selectedIndex = index
|
|
|
- app.globalData.selectedIndex = index
|
|
|
- if (index == 0) {
|
|
|
- this.isSider = false;
|
|
|
- app.globalData.isSider = false
|
|
|
- } else {
|
|
|
- this.isSider = true;
|
|
|
- app.globalData.isSider = true
|
|
|
- }
|
|
|
- uni.redirectTo({
|
|
|
- url: "/" + src,
|
|
|
- });
|
|
|
+ // let that = this;
|
|
|
+ // that.selectedIndex = index
|
|
|
+ // getApp().globalData.selectedIndex = index
|
|
|
+ // if (index == 0) {
|
|
|
+ // that.isSider = false;
|
|
|
+ // getApp().globalData.isSider = false;
|
|
|
+ // } else {
|
|
|
+ // that.isSider = true;
|
|
|
+ // getApp().globalData.isSider = true;
|
|
|
+ // }
|
|
|
+ uni.switchTab({
|
|
|
+ url:src,
|
|
|
+ })
|
|
|
+ // var pages = getCurrentPages();
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url: "/" + src,
|
|
|
+ // // animationType: 'pop-in',
|
|
|
+ // // animationDuration: 200
|
|
|
+ // });
|
|
|
+ // if(pages.length > 9){
|
|
|
+ // uni.reLaunch({
|
|
|
+ // url: "/" + src,
|
|
|
+ // });
|
|
|
+ // }
|
|
|
},
|
|
|
},
|
|
|
};
|