| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <template>
- <view>
- <home v-show="current==0"></home>
- <my v-show="current==1" ref="refMy"></my>
-
- <u-tabbar v-model="current" :list="list" active-color="#2F4379" :before-switch="beforeSwitch" ></u-tabbar>
- </view>
- </template>
- <script>
- import home from "@/components/home.vue"
- import my from "@/components/my.vue"
- import {mapState,mapMutations} from 'vuex';
- export default {
- components: {
- home,my
- },
- data() {
- return {
- list: [{
- iconPath: "/static/nav1.png",
- selectedIconPath: "/static/nav1_on.png",
- text: '学习中心',
- customIcon: false,
- },
- {
- iconPath: "/static/nav4.png",
- selectedIconPath: "/static/nav4_on.png",
- text: '我的',
- customIcon: false,
- },
-
- ],
- current:0
- }
- },
- onLoad(option) {
-
- },
- onShow(){
-
- },
- methods: {
- beforeSwitch(index) {
- let that = this
- if(index==this.current){
- return false
- }
- if(!this.$method.isLogin()){
- this.$navTo.togo('/pages/login/login');
- return false
- }else{
- if(index==1){
- this.$refs.refMy.init()
- }
- return true
- }
-
- },
-
- },
- onReachBottom() {
-
- },
- onPullDownRefresh() {
-
- },
- computed: {...mapState(['login'])}
- }
- </script>
- <style scoped>
-
- </style>
|