<template>
	<view>
		<modeBaseMine v-if="modeType == 'base'" ref="modeBaseMine"></modeBaseMine>
		<modeCareMine v-if="modeType == 'care'" ref="modeCareMine"></modeCareMine>
	</view>
</template>

<script>
	import modeBaseMine from '@/pages/BaseTabBar/Mine.vue'
	import modeCareMine from '@/pages/CareTabBar/Mine.vue'
	var that;
	export default {
		data() {
			return {
				modeType: ''
			}
		},
		components:{
			modeBaseMine,
			modeCareMine
		},
		onLoad(option) {
			that = this;
			that.modeType = uni.getStorageSync('modeType') || 'base';
			that.$nextTick(function() {
				if (that.modeType == 'base'){
					that.$refs.modeBaseMine.getData(option);
				}else if (that.modeType == 'care'){
					that.$refs.modeCareMine.getData(option);
				}
			})
		},
		onShow(){
			that.$nextTick(function() {
				if (that.modeType == 'base'){
					that.$refs.modeBaseMine.init();
				}else if (that.modeType == 'care'){
					that.$refs.modeCareMine.init();
				}
			})
		}
	}
</script>
