Преглед изворни кода

Merge branch '长阳分支中职' of http://8.141.155.183:3000/bjquanjiang/DigitalScholl into 长阳分支中职

应县
dyy пре 10 месеци
родитељ
комит
06866852d5
5 измењених фајлова са 147 додато и 1 уклоњено
  1. +135
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/tabbar/tabbar.vue
  2. +2
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/main.js
  3. +4
    -1
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/contact.vue
  4. +2
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/home.vue
  5. +4
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/my.vue

+ 135
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/tabbar/tabbar.vue Прегледај датотеку

@@ -0,0 +1,135 @@
<template>
<view class="tab">
<view v-for="(item,index) in list" :key="index" class="tab-item" @click="switchTab(item, index)">
<img class="tab_img" :src="selectedPath == item.pagePath ? item.selectedIconPath : item.iconPath"></img>
<view class="tab_text" :style="{color: selectedPath == item.pagePath ? selectedColor : color}">{{item.text}}</view>
</view>
</view>
</template>
<script>
export default {
name:'tabBar',
props: {
selectedPath: { // 当前选中的tab index
default: '/pages/home'
},
},
data() {
return {
color: "#8c8c8c",
selectedColor: "#3398DC",
list: [],
// currentIndex:0,
}
},
watch: {
"$store.state.loginUser":{
handler:function(newVal,oldVal){
this.setList(newVal.Description)
}
}
},
created() {
// let index = this.list.findIndex(e=>e.pagePath==this.selectedPath)
// this.currentIndex = index;
let userInfo = this.GET_GLOBAL("loginUser");
if(!userInfo)return
this.setList(userInfo.Description)
},
methods: {
setList(role){
if (role=="学生") {
this.list = [
{
"index":0,
"pagePath": "/pages/home",
"iconPath": "static/img-bar/tab-home.png",
"selectedIconPath": "static/img-bar/tab-home-active.png",
"text": "首页"
},
{
"index":3,
"pagePath": "/pages/my",
"iconPath": "static/img-bar/tab-my.png",
"selectedIconPath": "static/img-bar/tab-my-active.png",
"text": "我的"
}
]
}else{
this.list = [
{
"index":0,
"pagePath": "/pages/home",
"iconPath": "static/img-bar/tab-home.png",
"selectedIconPath": "static/img-bar/tab-home-active.png",
"text": "首页"
},
// {
// "index":1,
// "pagePath": "/pages/msg",
// "iconPath": "static/img-bar/tab-msg.png",
// "selectedIconPath": "static/img-bar/tab-msg-active.png",
// "text": "消息"
// },
{
"index":2,
"pagePath": "/pages/contact",
"iconPath": "static/img-bar/tab-contact.png",
"selectedIconPath": "static/img-bar/tab-contact-active.png",
"text": "通讯录"
},
{
"index":3,
"pagePath": "/pages/my",
"iconPath": "static/img-bar/tab-my.png",
"selectedIconPath": "static/img-bar/tab-my-active.png",
"text": "我的"
}
]
}
},
switchTab(item, index) {
// this.currentIndex = item.index;
let url = item.pagePath;
uni.switchTab({
url: url
});
}
}
}
</script>
<style lang="scss">
.tab {
background: rgb(245, 245, 245);
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 100rpx;
display: flex;
justify-content: center;
align-items: center;
padding-bottom: env(safe-area-inset-bottom); // 适配iphoneX的底部
border-top: 2rpx solid #CDCDCD;
.tab-item {
flex: 1;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
.tab_img {
width: 48rpx;
height: 48rpx;
}
.tab_text {
font-size: 20rpx;
margin-top: 6rpx;
}
}
}
</style>

+ 2
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/main.js Прегледај датотеку

@@ -4,6 +4,8 @@ import App from '@/App.vue'
import store from '@/common/store.js'
import mixins from '@/common/mixins.js'
import '@/components/learun-mpui'
import tabBar from "@/components/tabbar/tabbar.vue"
Vue.component('tabBar',tabBar)

// import '@/common/css/common.less';



+ 4
- 1
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/contact.vue Прегледај датотеку

@@ -9,6 +9,7 @@
<view v-else-if="ready" class="user-item-list">
<l-organize-single-item v-for="item of searchList" @click="userClick" :key="item.id" :item="item" />
</view>
<tabBar selectedPath='/pages/contact'></tabBar>
</view>
</template>

@@ -29,7 +30,9 @@ export default {
uni.stopPullDownRefresh()
})
},

onShow() {
uni.hideTabBar()
},
methods: {
// 处理点击用户的场合,跳转到消息页
userClick(item) {


+ 2
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/home.vue Прегледај датотеку

@@ -173,6 +173,7 @@
<!--#endif -->
</view>
</view>
<tabBar selectedIndex='/pages/home'></tabBar>
</view>
</template>

@@ -209,6 +210,7 @@ export default {
await this.init(param);
},
async onShow() {
uni.hideTabBar()
if(this.ready){
this.ready = false
await this.refresh()


+ 4
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/my.vue Прегледај датотеку

@@ -80,11 +80,15 @@
</view>

<view class="footer">{{ copyRightDisplay }}</view>
<tabBar selectedPath='/pages/my'></tabBar>
</view>
</template>

<script>
export default {
onShow() {
uni.hideTabBar()
},
methods: {
// 点击「注销登录」按钮
async logout() {


Loading…
Откажи
Сачувај