|  | @@ -17,25 +17,39 @@ import { NetImages } from '../../../core/libs/net-images'
 | 
	
		
			
				|  |  |  import ProgressEvo from '@/components/progress-evo.vue'
 | 
	
		
			
				|  |  |  import { Certificate } from '@/core/libs/models'
 | 
	
		
			
				|  |  |  import dayjs from 'dayjs'
 | 
	
		
			
				|  |  | +import { useUserStore } from '@/store'
 | 
	
		
			
				|  |  | +import { storeToRefs } from 'pinia'
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +const id = ref()
 | 
	
		
			
				|  |  |  const router = useRouter()
 | 
	
		
			
				|  |  | +const userStore = useUserStore()
 | 
	
		
			
				|  |  | +const { userInfo } = storeToRefs(userStore)
 | 
	
		
			
				|  |  |  const active = ref('badge')
 | 
	
		
			
				|  |  |  const tabs = ref([
 | 
	
		
			
				|  |  |    { label: '徽章', value: 'badge' },
 | 
	
		
			
				|  |  |    { label: '证书', value: 'certificate' },
 | 
	
		
			
				|  |  |  ])
 | 
	
		
			
				|  |  | -const { data: statistics, run: setStatistics } = useRequest(() => getHonorStatistics())
 | 
	
		
			
				|  |  | -const { data: badges, run: setBadges } = useRequest(() => getBadges({}), {
 | 
	
		
			
				|  |  | +const { data: statistics, run: setStatistics } = useRequest(() =>
 | 
	
		
			
				|  |  | +  getHonorStatistics({ userId: id.value }),
 | 
	
		
			
				|  |  | +)
 | 
	
		
			
				|  |  | +const { data: badges, run: setBadges } = useRequest(() => getBadges({ userId: id.value }), {
 | 
	
		
			
				|  |  |    initialData: {},
 | 
	
		
			
				|  |  |  })
 | 
	
		
			
				|  |  | -const { data: certificates, run: setCertificates } = useRequest(() => getCertificates({}), {
 | 
	
		
			
				|  |  | -  initialData: [],
 | 
	
		
			
				|  |  | -})
 | 
	
		
			
				|  |  | +const { data: certificates, run: setCertificates } = useRequest(
 | 
	
		
			
				|  |  | +  () => getCertificates({ userId: id.value }),
 | 
	
		
			
				|  |  | +  {
 | 
	
		
			
				|  |  | +    initialData: [],
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  | +)
 | 
	
		
			
				|  |  |  const currentCertificate = ref<Certificate | undefined>()
 | 
	
		
			
				|  |  | -onLoad(async (query?: Record<string | 'active', string>) => {
 | 
	
		
			
				|  |  | +const isOwner = computed(() => String(userInfo.value?.userId) === id.value)
 | 
	
		
			
				|  |  | +onLoad(async (query?: Record<string | 'active' | 'id', string>) => {
 | 
	
		
			
				|  |  |    if (query?.active) {
 | 
	
		
			
				|  |  |      active.value = query.active
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  | +  if (query?.id) {
 | 
	
		
			
				|  |  | +    id.value = query.id
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  |    await setStatistics()
 | 
	
		
			
				|  |  |    await setBadges()
 | 
	
		
			
				|  |  |    await setCertificates()
 | 
	
	
		
			
				|  | @@ -108,10 +122,15 @@ onLoad(async (query?: Record<string | 'active', string>) => {
 | 
	
		
			
				|  |  |        </template>
 | 
	
		
			
				|  |  |      </div>
 | 
	
		
			
				|  |  |      <template v-if="active === 'badge'">
 | 
	
		
			
				|  |  | +      <!--      v-if="String(userInfo.userId) === id"-->
 | 
	
		
			
				|  |  |        <Card custom-class="border border-solid bg-[#25221f]! border-[rgba(255,236,185,0.20)]">
 | 
	
		
			
				|  |  |          <div class="grid grid-cols-[90px_1fr] gap-x-4">
 | 
	
		
			
				|  |  |            <div class="grid-row-start-1 grid-row-end-4 col-start-1">
 | 
	
		
			
				|  |  | -            <wd-img width="90" height="90" src="https://via.placeholder.com/86x91"></wd-img>
 | 
	
		
			
				|  |  | +            <wd-img
 | 
	
		
			
				|  |  | +              width="90"
 | 
	
		
			
				|  |  | +              height="90"
 | 
	
		
			
				|  |  | +              src="https://image.zhuchaohui.com/zhucaohui/1f8f9129cc24b2a9bc25d8a2821da64233994c38efea36a80f4b1aade0476bab.png"
 | 
	
		
			
				|  |  | +            ></wd-img>
 | 
	
		
			
				|  |  |            </div>
 | 
	
		
			
				|  |  |            <div class="row-start-1 col-start-2 flex items-center justify-between">
 | 
	
		
			
				|  |  |              <div
 | 
	
	
		
			
				|  | @@ -166,8 +185,10 @@ onLoad(async (query?: Record<string | 'active', string>) => {
 | 
	
		
			
				|  |  |            </div>
 | 
	
		
			
				|  |  |          </div>
 | 
	
		
			
				|  |  |        </Card>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |        <template v-for="([key, it], index) in Object.entries(badges)" :key="index">
 | 
	
		
			
				|  |  |          <Card
 | 
	
		
			
				|  |  | +          v-if="!(!isOwner && ['积分徽章'].includes(key))"
 | 
	
		
			
				|  |  |            custom-class="bg-[#171615]! text-white border border-solid border-[rgba(255,236,185,0.20)]"
 | 
	
		
			
				|  |  |          >
 | 
	
		
			
				|  |  |            <div class="flex items-center gap-2 py-4">
 | 
	
	
		
			
				|  | @@ -212,6 +233,7 @@ onLoad(async (query?: Record<string | 'active', string>) => {
 | 
	
		
			
				|  |  |                  height="100%"
 | 
	
		
			
				|  |  |                  :src="it.certificateImage"
 | 
	
		
			
				|  |  |                  mode="aspectFill"
 | 
	
		
			
				|  |  | +                custom-class="vertical-bottom"
 | 
	
		
			
				|  |  |                ></wd-img>
 | 
	
		
			
				|  |  |              </div>
 | 
	
		
			
				|  |  |            </template>
 |