<template>
	<ContentWrap v-loading="formLoading" style="overflow-y: auto;" class="ContentWrap">
		<div class="top" style="position: relative;overflow: hidden;">
			<van-tabs v-model:active="activeName">
				<van-tab title="基本信息" name="info"/>
        <van-tab title="团队" name="team" />
        <van-tab title="积分" name="points" />
        <van-tab title="看点" name="highlights" />
        <van-tab title="任务" name="task" />
        <van-tab title="订单" name="order" />
        <van-tab title="售后" name="aftersales" />
        <van-tab title="收藏" name="collection" />
        <van-tab title="点赞" name="like" />
        <van-tab title="签到" name="signin" />
        <van-tab title="收获地址" name="address" />
			</van-tabs>
		</div>
		<div class="bottom">
      <UserForm :obj="userObj" ref="userFormRef" :isDetail="true" :openType="openType" v-if="activeName == 'info'" />
      <AfterSale :obj="userObj"  v-if="activeName == 'aftersales'" />
      <Order :obj="userObj"  v-if="activeName == 'order'" />
		</div>

	</ContentWrap>

</template>

<script lang="ts" setup>
import AfterSale from '@/components/ZxTemplate/AfterSale/AfterSale.vue'

import { useRoute } from 'vue-router';
const route = useRoute();
console.log(route.query)
const openType = route.query.type;
const userObj = JSON.parse(route.query.obj);
import { propTypes } from '@/utils/propTypes'

defineOptions({ name: 'ProductSpuForm' })

const formLoading = ref(false) // 表单的加载中：1）修改时的数据加载；2）提交的按钮禁用
const activeName = ref('info') // Tag 激活的窗口

onMounted(() => {
  // 当子组件挂载时，改变父组件的样式
  document.getElementsByTagName('section')[1].style.padding = '0px';
  document.getElementsByTagName('section')[1].style.width = '100%';
  document.getElementsByTagName('section')[1].style.background = '#f5f7f9';
  document.getElementsByTagName('section')[1].querySelector('div').style.border = 'none';
});
onUnmounted(() => {
  // 当子组件卸载时，恢复父组件的原始样式
  document.getElementsByTagName('section')[1].style.width = 'auto';
  document.getElementsByTagName('section')[1].style.padding = '20px';
  document.getElementsByTagName('section')[1].style.background = 'var(--el-color-white)';
});
</script>



<style src="@/styles/MobileTab.css"  lang="scss" scoped> </style>