作者 lihongjuan

1

<template>
<view class="content">
<view class="teacherfooter">
<view class="teacherfootitem" @click="gotab(item,index)" v-for="(item,index) in list" :key="index">
<view class="teacherfootitemtop shou">
<image :src="currentTabIndex == index?item.selectedIconPath:item.iconPath"></image>
</view>
<view class="teacherfootname " :class="currentTabIndex == index?'activename':''" >{{item.text}}</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: [{
"pagePath": "/pages/school/school",
"iconPath": "/static/xuexiao_icon@2x3.png",
"selectedIconPath": "/static/xuexiao_icon@2x.png",
"text": "学校",
}, {
"pagePath": "/pages/schoolmate/schoolmate",
"iconPath": "/static/zhaoxiaoyou_icon@2x.png",
"selectedIconPath": "/static/zhaoxiaoyou_icon@2x2.png",
"text": "找校友"
},
{
"pagePath": "/pages/homePage/homePage",
"iconPath": "/static/wodezhuye_icon@2x.png",
"selectedIconPath": "/static/wodezhuye_icon@2x2.png",
"text": "我的主页"
}
],
currentTabIndex: this.current
}
},
// props: ["current"],
props: {
current: { type: [Number, String],default: 0 },
},
onLoad() {
},
methods: {
gotab(item,index) {
console.log(item.pagePath);
let url=item.pagePath;
uni.switchTab({url})
// uni.switchTab({
// url:"/pages/nearshop/nearshop"
// })
}
}
}
</script>
<style>
</style>
... ...
... ... @@ -2,8 +2,12 @@
export default {
onLaunch: function() {
console.log('App Launch')
},
onShow: function() {
uni.hideTabBar({
})
console.log('App Show')
},
onHide: function() {
... ... @@ -152,6 +156,9 @@
margin: 0 auto;
}
}
.teacherfootname{
margin-top:20rpx;
}
}
}
... ... @@ -190,7 +197,7 @@
.shou {
width: 37rpx;
width: 52rpx;
height: 37rpx;
font-size: 0;
}
... ...
<template>
<view class="content">
<view class="teacherfooter">
<view class="teacherfootitem" @click="gotab(item,index)" v-for="(item,index) in list" :key="index">
<view class="teacherfootitemtop shou">
<image :src="currentTabIndex == index?item.selectedIconPath:item.iconPath"></image>
</view>
<view class="teacherfootname " :class="currentTabIndex == index?'activename':''" >{{item.text}}</view>
</view>
</view>
</view>
</template>
<script>
let chosetype=uni.getStorageSync("chosetype");
export default {
data() {
return {
list:chosetype==1? [{
"pagePath": "/pages/school/school",
"iconPath": "/static/xuexiao_icon@2x3.png",
"selectedIconPath": "/static/xuexiao_icon@2x.png",
"text": "学校",
}, {
"pagePath": "/pages/schoolmate/schoolmate",
"iconPath": "/static/zhaoxiaoyou_icon@2x.png",
"selectedIconPath": "/static/zhaoxiaoyou_icon@2x2.png",
"text": "找校友"
},
{
"pagePath": "/pages/homePage/homePage",
"iconPath": "/static/wodezhuye_icon@2x.png",
"selectedIconPath": "/static/wodezhuye_icon@2x2.png",
"text": "我的主页"
}
]:[{
"pagePath": "/pages/schoolmate/schoolmate",
"iconPath": "/static/zhaoxiaoyou_icon@2x.png",
"selectedIconPath": "/static/zhaoxiaoyou_icon@2x2.png",
"text": "找校友"
},
{
"pagePath": "/pages/homePage/collegeHome",
"iconPath": "/static/wodezhuye_icon@2x.png",
"selectedIconPath": "/static/wodezhuye_icon@2x2.png",
"text": "我的主页"
}
],
currentTabIndex: this.current
}
},
// props: ["current"],
props: {
current: { type: [Number, String],default: 0 },
},
onLoad() {
// console.log('我是底部菜单',chosetype)
// if(chosetype==1){
// this.list=[{
// "pagePath": "/pages/school/school",
// "iconPath": "/static/xuexiao_icon@2x3.png",
// "selectedIconPath": "/static/xuexiao_icon@2x.png",
// "text": "学校",
// }, {
// "pagePath": "/pages/schoolmate/schoolmate",
// "iconPath": "/static/zhaoxiaoyou_icon@2x.png",
// "selectedIconPath": "/static/zhaoxiaoyou_icon@2x2.png",
// "text": "找校友"
// },
// {
// "pagePath": "/pages/homePage/homePage",
// "iconPath": "/static/wodezhuye_icon@2x.png",
// "selectedIconPath": "/static/wodezhuye_icon@2x2.png",
// "text": "我的主页"
// }
// ]
// }else if(chosetype==2){
// this.list=[{
// "pagePath": "/pages/schoolmate/schoolmate",
// "iconPath": "/static/zhaoxiaoyou_icon@2x.png",
// "selectedIconPath": "/static/zhaoxiaoyou_icon@2x2.png",
// "text": "找校友"
// },
// {
// "pagePath": "/pages/homePage/homePage",
// "iconPath": "/static/wodezhuye_icon@2x.png",
// "selectedIconPath": "/static/wodezhuye_icon@2x2.png",
// "text": "我的主页"
// }
// ]
// }
},
methods: {
gotab(item,index) {
console.log(item)
console.log(item.pagePath);
let url=item.pagePath;
uni.switchTab({url})
// uni.switchTab({
// url:"/pages/nearshop/nearshop"
// })
}
},
onShow(){
}
}
</script>
<style>
</style>
... ...
... ... @@ -239,6 +239,39 @@
],
"tabBar": {
"color": "",
"selectedColor": "#2D5575",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"list": [{
"pagePath": "pages/school/school",
"iconPath": "static/xuexiao_icon@2x3.png",
"selectedIconPath": "/static/xuexiao_icon@2x.png",
"text": "学校"
}, {
"pagePath": "pages/schoolmate/schoolmate",
"iconPath": "static/zhaoxiaoyou_icon@2x.png",
"selectedIconPath": "/static/zhaoxiaoyou_icon@2x2.png",
"text": "找校友"
},
{
"pagePath": "pages/homePage/homePage",
"iconPath": "static/wodezhuye_icon@2x.png",
"selectedIconPath": "/static/wodezhuye_icon@2x2.png",
"text": "我的主页"
},
{
"pagePath": "pages/homePage/collegeHome",
"iconPath": "static/wodezhuye_icon@2x.png",
"selectedIconPath": "/static/wodezhuye_icon@2x2.png",
"text": "我的主页"
}
]
},
"globalStyle": {
"navigationBarTextStyle": "black",
... ...
... ... @@ -33,7 +33,7 @@
<image class="right" src="../../static/dizhi_btn@2x.png"></image>
</view>
<!-- <tab></tab> -->
<view class="collegefooter" v-if="type == 2">
<!-- <view class="collegefooter" v-if="type == 2">
<view class="teacherfootitem" @click="footerselChange" :data-id="2" data-jump="1" :data-url="'/pages/schoolmate/schoolmate?type='+2">
<view class="teacherfootitemtop">
<image :src="footersel==2?'/static/zhaoxiaoyou_icon@2x2.png':'/static/zhaoxiaoyou_icon@2x.png'"></image>
... ... @@ -46,17 +46,22 @@
</view>
<view class="teacherfootname" :class="footersel==3?'selactive':''">我的主页</view>
</view>
</view>
</view> -->
<tabBar :current="currentTabIndex" backgroundColor="#fbfbfb" color="#999" tintColor="#42b983"></tabBar>
</view>
</template>
<script>
import app from "../../App.vue";
import tabBar from '../../components/tabvue/tabvue.vue'
export default {
components: {
tabBar,
},
data(){
return{
currentTabIndex: 2,
currentTabIndex: 1,
footersel:3,
type:"",
userinfolist:{},
... ...
... ... @@ -48,7 +48,7 @@
</view>
<!-- <tab></tab> -->
<!-- <tab :current="currentTabIndex" @getData="tabClick"></tab> -->
<view class="teacherfooter" v-if="type==1">
<!-- <view class="teacherfooter" v-if="type==1">
<view class="teacherfootitem" @click="jumpschool==true?footerselChange(1,'/pages/school/school?type=1'):''" :data-id="1" :data-url="'/pages/school/school?type='+1">
<view class="teacherfootitemtop" >
... ... @@ -84,14 +84,20 @@
</view>
</view>
-->
<tabBar :current="currentTabIndex" backgroundColor="#fbfbfb" color="#999" tintColor="#42b983"></tabBar>
</view>
</template>
<script>
import app from "../../App.vue";
import tabBar from '../../components/tabvue/tabvue.vue'
export default {
components: {
tabBar,
},
data() {
return {
currentTabIndex: 2,
... ... @@ -101,7 +107,8 @@
token:'',
head_image:'',
jumpschool:true,
jumpschoolk:true
jumpschoolk:true,
}
},
methods: {
... ...
... ... @@ -375,8 +375,9 @@ export default {
title: '注册成功',
icon: 'none'
});
uni.setStorageSync("chosetype",2)
setTimeout(() => {
uni.navigateTo({
uni.switchTab({
url: '/pages/schoolmate/schoolmate?type=' + 2
});
}, 1500);
... ...
... ... @@ -128,8 +128,9 @@ export default {
title:"注册成功",
icon:"none"
})
uni.setStorageSync("chosetype",1)
setTimeout(() => {
uni.navigateTo({
uni.switchTab({
url: "/pages/school/school?type="+1
})
}, 1500);
... ...
... ... @@ -76,19 +76,22 @@
token:uni.getStorageSync('token')
}
app.post(url,params,"get").then((res)=>{
uni.setStorageSync("chosetype",1)
if(res.level==1){
wx.redirectTo({
wx.switchTab({
url:'../school/school'
})
}else if (res.level==2){
wx.redirectTo({
uni.setStorageSync("chosetype",2)
wx.switchTab({
url:'../schoolmate/schoolmate?type='+2
})
}
}).catch((err)=>{
console.log(err)
uni.setStorageSync("chosetype",1)
uni.clearStorageSync()
wx.redirectTo({
wx.switchTab({
url:'../school/school'
})
})
... ... @@ -185,11 +188,13 @@
app.post(url,params,"get").then((res)=>{
console.log(res)
if(res.level==1){
wx.redirectTo({
uni.setStorageSync("chosetype",1)
wx.switchTab({
url:'../school/school'
})
}else if (res.level==2){
wx.redirectTo({
uni.setStorageSync("chosetype",2)
wx.switchTab({
url:'../schoolmate/schoolmate?type='+2
})
}
... ...
... ... @@ -64,8 +64,11 @@ export default {
</script>
<style lang="less">
page{
background-color: rgba(249,249,249,1);
}
.content{
background-color: rgba(249,249,249,1);
// background-color: rgba(249,249,249,1);
.top{
padding: 18rpx 32rpx;
display: flex;
... ...
... ... @@ -31,7 +31,7 @@
<view class="btn" @click="tosearchpage">立即关注</view>
</view>
<!-- <tab :current="currentTabIndex" @getData="tabClick"></tab> -->
<view class="teacherfooter">
<!-- <view class="teacherfooter">
<view class="teacherfootitem">
<view class="teacherfootitemtop" @click="footerselChange" :data-id="1" >
<image :src="footersel==1?'/static/xuexiao_icon@2x.png':'/static/xuexiao_icon@2x3.png'"></image>
... ... @@ -50,7 +50,8 @@
</view>
<view class="teacherfootname" :class="footersel==3?'selactive':''">我的主页</view>
</view>
</view>
</view> -->
<tabBar :current="currentTabIndex" backgroundColor="#fbfbfb" color="#999" tintColor="#42b983"></tabBar>
</view>
... ... @@ -58,9 +59,12 @@
<script>
import app from "../../App.vue";
import tabBar from '../../components/tabvue/tabvue.vue'
export default {
components: {
tabBar,
},
data() {
return {
currentTabIndex: 0,
... ... @@ -75,8 +79,8 @@
}
},
onLoad(options){
this.code2Token();
this.token=uni.getStorageSync('token')
console.log(options);
// this.getschoollist();
// this.isuesrlogin()
... ... @@ -84,6 +88,11 @@
},
onShow() {
this.code2Token();
this.token=uni.getStorageSync('token')
uni.hideTabBar({
})
this.page=1;
this.schoollist=[];
this.getlikeschool();
... ... @@ -155,6 +164,8 @@
}else{
that.isnulldata=false
}
console.log('显示关注',this.isnulldata)
}).catch((err)=>{
console.log(err)
})
... ...
... ... @@ -85,7 +85,9 @@
<view class="text"><text @click="tobuy">购买畅读卡</text>可以额外找到888人</view>
</view> -->
<!-- <tab :current="currentTabIndex" @getData="tabClick"></tab> -->
<view class="teacherfooter" v-if="type == 1">
<tabBar :current="currentTabIndex" backgroundColor="#fbfbfb" color="#999" tintColor="#42b983"></tabBar>
<!-- <view class="teacherfooter" v-if="type == 1">
<view class="teacherfootitem" @click="jumpschool==true?footerselChange(1,'/pages/school/school?type=1'):''" :data-id="1" :data-url="'/pages/school/school?type='+1">
<view class="teacherfootitemtop" >
... ... @@ -113,20 +115,27 @@
</view>
<view class="teacherfootname" :class="footersel==2?'selactive':''">找校友</view>
</view>
<!-- -->
<view class="teacherfootitem" @click="footerselChangek" :data-id="3">
<view class="teacherfootitemtop">
<image :src="footersel==3?'/static/wodezhuye_icon@2x2.png':'/static/wodezhuye_icon@2x.png'"></image>
</view>
<view class="teacherfootname" :class="footersel==3?'selactive':''">我的主页</view>
</view>
</view>
</view> -->
</view>
</view>
</template>
<script>
import app from "../../App.vue";
import tabBar from '../../components/tabvue/tabvue.vue'
let chosetype=uni.getStorageSync("chosetype");
export default {
components: {
tabBar,
},
data() {
return {
selpro:-1,
... ... @@ -142,7 +151,7 @@
// active2:false,
active3: false,
active4: false,
currentTabIndex: 1,
currentTabIndex: chosetype==1?1:0,
footersel: 2,
type: "",
province_id: "",
... ... @@ -171,7 +180,6 @@
vip_level:'',
jumpschool:true,
jumpschoolk:true
}
},
methods: {
... ... @@ -556,6 +564,9 @@
},
onShow() {
uni.hideTabBar({
})
this.page = 1;
this.schoolmateList = []
... ... @@ -575,9 +586,12 @@
</script>
<style lang="less">
.content {
page{
background-color: rgba(249, 249, 249, 1);
height: 100vh;
}
.content {
// height: 100vh;
padding-bottom: 120rpx;
box-sizing: border-box;
.nodata {
... ...
... ... @@ -58,9 +58,9 @@
methods: {
switchTab(item){
console.log(item)
// console.log(item)
let url=item.pagePath;
console.log(url)
// console.log(url)
uni.switchTab({url})
// this.$emit('getData', item.index)
// this.currentTabIndex = item.index;
... ...