|
@@ -1,89 +1,90 @@
|
|
|
-<template >
|
|
|
+<template>
|
|
|
<view>
|
|
|
- <u-tabbar v-model="myCurrent" :list="tabbarList"
|
|
|
- :before-switch="beforeSwitch" active-color="#0DBAC7" ></u-tabbar>
|
|
|
-
|
|
|
+ <u-tabbar v-model="myCurrent" :list="tabbarList" :before-switch="beforeSwitch" active-color="#0DBAC7">
|
|
|
+ </u-tabbar>
|
|
|
+
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-
|
|
|
- export default {
|
|
|
- name:"ParentsTabbar",
|
|
|
- props:{
|
|
|
+ export default {
|
|
|
+ name: "ParentsTabbar",
|
|
|
+ props: {
|
|
|
current: 0,
|
|
|
elderStatus: false
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- activeColor:"#5098FF",
|
|
|
- oldindex:this.current,
|
|
|
- myCurrent:this.current,
|
|
|
- tabbarList: [
|
|
|
- {
|
|
|
-
|
|
|
- iconPath: "home",
|
|
|
- selectedIconPath: "home-fill",
|
|
|
- text: '主页 ',
|
|
|
- pagePath2:"/pages/parents/homePage/homePage",
|
|
|
- },
|
|
|
- {
|
|
|
- iconPath: "bookmark",
|
|
|
- selectedIconPath: "bookmark-fill",
|
|
|
- text: '课程',
|
|
|
- pagePath2:"/pages/parents/course/course",
|
|
|
- },{
|
|
|
- iconPath: "chat",
|
|
|
- selectedIconPath: "chat-fill",
|
|
|
- text: '消息',
|
|
|
- pagePath2:"/pages/parents/news/news",
|
|
|
+ activeColor: "#5098FF",
|
|
|
+ oldindex: this.current,
|
|
|
+ myCurrent: this.current,
|
|
|
+ tabbarList: [{
|
|
|
+
|
|
|
+ iconPath: "home",
|
|
|
+ selectedIconPath: "home-fill",
|
|
|
+ text: '主页 ',
|
|
|
+ pagePath2: "/pages/parents/homePage/homePage",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ iconPath: "bookmark",
|
|
|
+ selectedIconPath: "bookmark-fill",
|
|
|
+ text: '课程',
|
|
|
+ pagePath2: "/pages/parents/course/course",
|
|
|
+ }, {
|
|
|
+ iconPath: "chat",
|
|
|
+ selectedIconPath: "chat-fill",
|
|
|
+ text: '消息',
|
|
|
+ pagePath2: "/pages/parents/news/news",
|
|
|
count: 99,
|
|
|
- isDot: false,
|
|
|
- customIcon: false,
|
|
|
- },
|
|
|
+ isDot: false,
|
|
|
+ customIcon: false,
|
|
|
+ },
|
|
|
{
|
|
|
iconPath: "account",
|
|
|
selectedIconPath: "account-fill",
|
|
|
text: '我的',
|
|
|
- pagePath2:"/pages/parents/mine/mine",
|
|
|
+ pagePath2: "/pages/parents/mine/mine",
|
|
|
}
|
|
|
- ],
|
|
|
+ ],
|
|
|
};
|
|
|
-
|
|
|
- },methods:{
|
|
|
- setcount(c){
|
|
|
- this.myCurrent=c
|
|
|
+
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ setcount(c) {
|
|
|
+ this.myCurrent = c
|
|
|
},
|
|
|
- beforeSwitch(index){
|
|
|
-
|
|
|
-
|
|
|
- if(index==this.current){
|
|
|
+ beforeSwitch(index) {
|
|
|
+
|
|
|
+
|
|
|
+ if (index == this.current) {
|
|
|
return false
|
|
|
}
|
|
|
- var url =this.tabbarList[index].pagePath2;
|
|
|
-
|
|
|
+ var url = this.tabbarList[index].pagePath2;
|
|
|
+
|
|
|
uni.navigateTo({
|
|
|
url: url
|
|
|
})
|
|
|
- if(index==1){
|
|
|
- this.myCurrent=this.oldindex;
|
|
|
+ if (index == 1) {
|
|
|
+ this.myCurrent = this.oldindex;
|
|
|
return false;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
return true;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
-
|
|
|
- },mounted(){
|
|
|
-
|
|
|
- },destroyed(){
|
|
|
-
|
|
|
+
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+
|
|
|
+ },
|
|
|
+ destroyed() {
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style>
|
|
|
-
|
|
|
+
|
|
|
</style>
|