| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 | <template>	<view class="main-content">		<view>			<indexBox v-if=" pageAction == 'index' " />			<meBox v-if=" pageAction == 'me' " />		</view>		<view class="main-tabar">			<view class="main-tabar-info">				<view class="main-tabar-item" @click="clickTabbar('index')">					<view>						<image :src="pageAction=='index'?(staticUrl+'tabar/index_1.png'):(staticUrl+'tabar/index_0.png')"></image>					</view>					<text :style="{ color: pageAction=='index'? '#ED0000':'#595D60'  }">{{ '首页' }}</text>				</view>				<view class="main-tabar-item"> 					<view>						<image :src="pageAction=='me'?(staticUrl+'tabar/me_1.png'):(staticUrl+'tabar/me_0.png')"  @click="clickTabbar('me')"></image>					</view>					<text :style="{ color: pageAction=='me'? '#ED0000':'#595D60'  }">{{ '我的' }}</text>				</view>			</view>		</view>	</view></template><script>	import indexBox from "../index/index.vue"	import meBox from "../me/index.vue"	export default {		components: {			indexBox,			meBox		},		data() {			return {				title: '主页',				pageAction: 'index',				staticUrl:this.$commonConfig.staticUrl,			}		},		onLoad(e) {			this.pageAction = e.router || 'index'																																																											},		onUnload() {			console.log("dsfasfasdf======")					},		onShow() {					},				methods: {						clickTabbar(type){				if( this.pageAction == type ) return				this.pageAction = type								uni.reLaunch({					url: "/pages/main/index?router="+type				})			},		}	}</script><style lang="scss" scoped>	.main-content {		width: 100%;		height: 100%;		position: relative;	}		/** tabar  */	.main-tabar {		width: 80vw;		height: 100rpx;		position: fixed;		bottom: 20rpx;		left: 50%;		transform: translateX(-50%);		box-sizing: border-box;		.main-tabar-info {			width: 100%;			height: 100%;			display: flex;			justify-content: space-between;			background: #FFFFFF;			box-shadow: 0rpx 2rpx 20rpx 0rpx rgba(181,179,179,0.5);			border-radius: 40rpx;			.main-tabar-item {				flex: 1;				display: flex;				align-items: center;				flex-direction: column;				justify-content: center;				image {					width: 50rpx;					height: 50rpx;				}				text {					font-size: 24rpx;				}			}		}	}</style>
 |