|
|
@@ -9,7 +9,7 @@
|
|
|
@tap="click(i, menu.pagePath)"
|
|
|
>
|
|
|
<view class="iconBox">
|
|
|
- <span class="iconfont" :class="[menu.icon, selectedIndex == i? '' : 'hover']"></span>
|
|
|
+ <span class="iconfont" :class="[menu.icon, (selectedIndex == i)? 'hoverd' : 'hover']"></span>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -40,7 +40,7 @@
|
|
|
height: 60rpx;
|
|
|
border-radius: 50%;
|
|
|
left: 14%;
|
|
|
- transition: all 0.3s;
|
|
|
+ transition: all 0.1s;
|
|
|
background: rgb(14, 92, 246);
|
|
|
&.hover {
|
|
|
left: 14%;
|
|
|
@@ -48,6 +48,7 @@
|
|
|
}
|
|
|
&.hoverd {
|
|
|
left: 61%;
|
|
|
+ background: rgb(14, 92, 246);
|
|
|
}
|
|
|
}
|
|
|
.menu_icon {
|
|
|
@@ -69,6 +70,9 @@
|
|
|
&.hover{
|
|
|
color: rgb(187, 187, 187);
|
|
|
}
|
|
|
+ &.hoverd{
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -76,12 +80,13 @@
|
|
|
}
|
|
|
</style>
|
|
|
<script>
|
|
|
+import app from '../../App'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- selectedIndex: getApp().globalData.selectedIndex,
|
|
|
+ selectedIndex: app.globalData.selectedIndex,
|
|
|
showselected: false,
|
|
|
- isSider: getApp().globalData.isSider,
|
|
|
+ isSider: app.globalData.isSider,
|
|
|
menus: [
|
|
|
{
|
|
|
pagePath: "pages/index/index",
|
|
|
@@ -98,12 +103,14 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
click(index, src) {
|
|
|
+ this.selectedIndex = index
|
|
|
+ app.globalData.selectedIndex = index
|
|
|
if (index == 0) {
|
|
|
this.isSider = false;
|
|
|
- getApp().globalData.isSider = false
|
|
|
+ app.globalData.isSider = false
|
|
|
} else {
|
|
|
this.isSider = true;
|
|
|
- getApp().globalData.isSider = true
|
|
|
+ app.globalData.isSider = true
|
|
|
}
|
|
|
uni.redirectTo({
|
|
|
url: "/" + src,
|