<template>
  <view class="content">
    <PatriarchCard />
    <AbountMine />

  </view>
</template>

<script setup lang="ts">
import { onShow } from '@dcloudio/uni-app'
import { bindApplyStore } from '@/store'
import db from '@/utils/db'

import PatriarchCard from './patriarchCard.vue';
import AbountMine from './aboutMine.vue';

const { getApplyBindInfoList } = bindApplyStore()

onShow(async () => {
  // 获取绑定申请信息并设置红点
  await getApplyBindInfoList()
  const hasApplyMsg = db.get('applyBindMsg')
  
  if (hasApplyMsg) {
    uni.setTabBarBadge({
      index: 3, // "我的"页面在tabBar中的索引
      text: '●'
    })
  } else {
    uni.removeTabBarBadge({
      index: 3
    })
  }
})
</script>

<style scoped lang="scss">
.content {
  padding: 30rpx;
}
</style>
