176 lines
5.3 KiB
Vue
176 lines
5.3 KiB
Vue
<template>
|
||
<view class="cont">
|
||
<div class="tab" @tap.stop="changeTabbar(0)">
|
||
<image src="https://api.ccttiot.com/smartmeter/img/static/upJM8VILTPn0Oa398g7L" mode="" v-show="indexs!=0"></image>
|
||
<image src="https://api.ccttiot.com/smartmeter/img/static/uS7VHOhENrnwJYI0vL4A" mode="" v-show="indexs==0"></image>
|
||
<div class="txt" :class="indexs==0?'act1':''">首页</div>
|
||
</div>
|
||
<div class="tab" @tap.stop="changeTabbar(11)" v-if="flag">
|
||
<image style="" src="https://api.ccttiot.com/ELGFwxiS07Gs5158a30b87df9217c87c4856e96d023b.png" mode="" v-show="indexs!=11"></image>
|
||
<image style="" src="https://api.ccttiot.com/SW4M0VEYKdnP24bf12384c8e800a59f4ce9c2a19967d.png" mode="" v-show="indexs==11"></image>
|
||
<div class="txt" :class="indexs==11?'act1':''">圈子</div>
|
||
</div>
|
||
<div @tap.stop="changeTabbar(1)">
|
||
<image style="width: 90rpx;height: 90rpx;position: fixed;left: 50%;transform: translateX(-50%);bottom:110rpx;" src="https://api.ccttiot.com/smartmeter/img/static/u3o5HsEKiDwIQroCz6DM" mode="" v-show="indexs!=1"></image>
|
||
<image style="width: 90rpx;height: 90rpx;position: fixed;left: 50%;transform: translateX(-50%);bottom:110rpx;" src="https://api.ccttiot.com/smartmeter/img/static/u3o5HsEKiDwIQroCz6DM" mode="" v-show="indexs==1"></image>
|
||
<div class="txt" style="margin-top: 44rpx;color: #3D3D3D;font-size: 28rpx;" :class="indexs==1?'act1':''">AI识图</div>
|
||
</div>
|
||
<div class="tab" @tap.stop="changeTabbar(22)" v-if="flag">
|
||
<image style="" src="https://api.ccttiot.com/ipUVahSpqeNJc11c0f6980f96f9fc405d7cf48d1a999.png" mode="" v-show="indexs!=22"></image>
|
||
<image style="" src="https://api.ccttiot.com/UtfaQvEPCM2rc449e6e2f86606b8d105ade75277b8f1.png" mode="" v-show="indexs==22"></image>
|
||
<div class="txt" :class="indexs==22?'act1':''">消息</div>
|
||
</div>
|
||
<div class="tab" @tap.stop="changeTabbar(2)">
|
||
<image src="https://api.ccttiot.com/smartmeter/img/static/uk8KlKhorxKWvBtJE2j8" mode="" v-show="indexs!=2"></image>
|
||
<image src="https://api.ccttiot.com/smartmeter/img/static/u3sPW0uZjzlB4GkcauI9" mode="" v-show="indexs==2"></image>
|
||
<div class="txt" :class="indexs==2?'act1':''">我的</div>
|
||
</div>
|
||
<image class="botimg" src="https://api.ccttiot.com/smartmeter/img/static/uV7nJgKVc4tgTuSqB699" mode=""></image>
|
||
<!-- <view class="u-page">
|
||
|
||
</view> -->
|
||
<!-- 与包裹页面所有内容的元素u-page同级,且在它的下方 -->
|
||
<!-- <u-tabbar v-model="current" :list="list" icon-size='40rpx' active-color='#3996fd' inactive-color="#c8c7cb"></u-tabbar> -->
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
export default {
|
||
props: {
|
||
indexs: [Number, String], //题目id
|
||
},
|
||
data() {
|
||
return {
|
||
currentTabbarIndex: 0,
|
||
|
||
// 自定义底栏对应页面的加载情况
|
||
tabberPageLoadFlag: [],
|
||
ispop: false,
|
||
flag:false
|
||
}
|
||
},
|
||
mounted() {
|
||
this.getver()
|
||
this.currentTabbarIndex = this.indexs
|
||
// const index = Number(this.indexs || 0)
|
||
// // 根据底部tabbar菜单列表设置对应页面的加载情况
|
||
// for (let i = 0; i < 5; i++) {
|
||
// this.tabberPageLoadFlag.push(i === index)
|
||
// }
|
||
// this.changeTabbar(index)
|
||
},
|
||
methods:{
|
||
getver(){
|
||
this.$u.get(`/system/config/configKey/app.version`).then(res => {
|
||
if (res.code == 200) {
|
||
if(res.data == '1.0.60'){
|
||
this.flag = true
|
||
}else{
|
||
this.flag = false
|
||
}
|
||
}
|
||
})
|
||
},
|
||
changeTabbar(index) {
|
||
if (this.currentTabbarIndex === index) return
|
||
// this._switchTabbarPage(index)
|
||
if(index==0){
|
||
uni.switchTab({
|
||
url:'/pages/index/index',
|
||
routeType: 'wx://modal',
|
||
success() {
|
||
this.currentTabbarIndex = index
|
||
}
|
||
})
|
||
console.log('点击了',index);
|
||
}else if(index==1){
|
||
uni.switchTab({
|
||
url:'/pages/tj',
|
||
routeType: 'wx://modal',
|
||
success() {
|
||
this.currentTabbarIndex = index
|
||
}
|
||
})
|
||
}else if(index==2){
|
||
uni.switchTab({
|
||
url:'/pages/my',
|
||
routeType: 'wx://modal',
|
||
success() {
|
||
this.currentTabbarIndex = index
|
||
}
|
||
})
|
||
}else if(index==11){
|
||
uni.switchTab({
|
||
url:'/pages/nearbystores/index',
|
||
routeType: 'wx://modal',
|
||
success() {
|
||
this.currentTabbarIndex = index
|
||
}
|
||
})
|
||
}else if(index==22){
|
||
uni.switchTab({
|
||
url:'/pages/nearbystores/xiaoxi',
|
||
routeType: 'wx://modal',
|
||
success() {
|
||
this.currentTabbarIndex = index
|
||
}
|
||
})
|
||
}
|
||
},
|
||
}
|
||
}
|
||
</script>
|
||
<style lang="scss" scoped>
|
||
::v-deep.u-tabbar__content__item__button {
|
||
top: 20rpx !important;
|
||
}
|
||
|
||
::v-deep.u-tabbar {
|
||
.u-tabbar__content__item:nth-child(2) {
|
||
.u-tabbar__content__item__button {
|
||
width: 32rpx !important;
|
||
}
|
||
}
|
||
}
|
||
.botimg{
|
||
width: 100%;
|
||
height: 144rpx;
|
||
position: fixed;
|
||
left: 0;
|
||
bottom: 0;
|
||
z-index: -1;
|
||
box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.3);
|
||
}
|
||
.cont {
|
||
position: fixed;
|
||
left: 0;
|
||
bottom: 0;
|
||
width:100%;
|
||
background-color: #eee;
|
||
height: 144rpx;
|
||
box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(53, 140, 255, 0.1);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-around;
|
||
.tab{
|
||
width: 60rpx;
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
justify-content: center;
|
||
image{
|
||
width: 40rpx;
|
||
height: 40rpx;
|
||
}
|
||
.txt{
|
||
margin-top: 10rpx;
|
||
font-size: 24rpx;
|
||
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
||
font-weight: 400;
|
||
color: #808080;
|
||
}
|
||
.act1{
|
||
color: #48893B;
|
||
}
|
||
}
|
||
}
|
||
</style> |