Refactor API requests and update component imports
This commit is contained in:
@ -11,29 +11,29 @@
|
||||
@click="handleUserInfo"
|
||||
/>
|
||||
<div class="mt-10px text-16px text-[#333333] font-normal">
|
||||
<img v-if="userStore.userInfoRes.vipLevel === 1" src="@/assets/svg/vip.svg" alt="" class="relative top-12px" />
|
||||
<img v-if="userStore.userInfoRes.vipLevel === 2" src="@/assets/svg/svip.svg" alt="" class="relative top-12px" />
|
||||
<img v-if="userStore.userInfoRes.vipLevel === 1" src="~/assets/svg/vip.svg" alt="" class="relative top-12px" />
|
||||
<img v-if="userStore.userInfoRes.vipLevel === 2" src="~/assets/svg/svip.svg" alt="" class="relative top-12px" />
|
||||
Hi,{{ userStore.userInfoRes.nickname || '欢迎访问~' }}
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="isLogin" class="mt-20px flex flex-col gap-20px px-20px text-14px text-[#333333] font-normal">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center">
|
||||
<img src="@/assets/images/cad_0 (1).png" alt="" srcset="" />
|
||||
<img src="~/assets/images/cad_0 (1).png" alt="" srcset="" />
|
||||
<span class="title ml-4px" :title="`${userStaticInfo?.pointCount}`">我的积分: {{ userStaticInfo?.pointCount || 0 }}</span>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<img src="@/assets/images/cad_0 (2).png" alt="" srcset="" />
|
||||
<img src="~/assets/images/cad_0 (2).png" alt="" srcset="" />
|
||||
<span class="title ml-4px" :title="`${userStaticInfo?.followCount}`">我的收藏: {{ userStaticInfo?.followCount || 0 }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center">
|
||||
<img src="@/assets/images/cad_0 (3).png" alt="" srcset="" />
|
||||
<img src="~/assets/images/cad_0 (3).png" alt="" srcset="" />
|
||||
<span class="title ml-4px" :title="`${userStaticInfo?.projectCount}`">我的发布: {{ userStaticInfo?.projectCount || 0 }}</span>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<img src="@/assets/images/cad_0 (4).png" alt="" srcset="" />
|
||||
<img src="~/assets/images/cad_0 (4).png" alt="" srcset="" />
|
||||
<span class="title ml-4px" :title="`${userStaticInfo?.downloadCount}`">我的下载: {{ userStaticInfo?.downloadCount || 0 }}</span>
|
||||
</div>
|
||||
</div>
|
||||
@ -63,25 +63,25 @@
|
||||
>
|
||||
</div>
|
||||
<div v-if="!isLogin" class="mt-30px flex justify-between px-20px">
|
||||
<img src="@/assets/images/qq-v2.png" alt="QQ登录" class="social-icon" @click="handleLoginQQ" />
|
||||
<img src="@/assets/images/weixin-v2.png" alt="微信登录" class="social-icon" @click="handleLoginWechat" />
|
||||
<img src="@/assets/images/email-v2.png" alt="邮箱登录" class="social-icon" @click="handleLoginEmail" />
|
||||
<img src="@/assets/images/phone-v2.png" alt="手机登录" class="social-icon" @click="handleLoginPhone" />
|
||||
<img src="~/assets/images/qq-v2.png" alt="QQ登录" class="social-icon" @click="handleLoginQQ" />
|
||||
<img src="~/assets/images/weixin-v2.png" alt="微信登录" class="social-icon" @click="handleLoginWechat" />
|
||||
<img src="~/assets/images/email-v2.png" alt="邮箱登录" class="social-icon" @click="handleLoginEmail" />
|
||||
<img src="~/assets/images/phone-v2.png" alt="手机登录" class="social-icon" @click="handleLoginPhone" />
|
||||
</div>
|
||||
|
||||
<div class="sign-bonus mt-18px" @click="handleSign">
|
||||
<img src="@/assets/images/sign.png" alt="签到奖励" class="bonus-image" />
|
||||
<img src="~/assets/images/sign.png" alt="签到奖励" class="bonus-image" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { refreshToken as REFRESHTOKEN } from '@/utils/axios'
|
||||
import { refreshToken as REFRESHTOKEN } from '~/utils/axios'
|
||||
import { getCurrentInstance, computed, watchEffect, ref } from 'vue'
|
||||
import { handleLoginQQ, handleLoginWechat } from '@/utils/login'
|
||||
import { UserStatisticsCountRespVO } from '@/api/personal-center/types'
|
||||
import { getUserStatistics } from '@/api/personal-center/index'
|
||||
import useUserStore from '@/store/user'
|
||||
import { handleLoginQQ, handleLoginWechat } from '~/utils/login'
|
||||
import type { UserStatisticsCountRespVO } from '~/api/personal-center/types'
|
||||
import { getUserStatistics } from '~/api/personal-center/index'
|
||||
import useUserStore from '~/store/user'
|
||||
const userStore = useUserStore()
|
||||
const instance = getCurrentInstance()
|
||||
|
||||
@ -103,36 +103,36 @@
|
||||
|
||||
const handleLogin = () => {
|
||||
if (instance) {
|
||||
instance.appContext.config.globalProperties.$openLogin()
|
||||
// instance.appContext.config.globalProperties.$openLogin()
|
||||
}
|
||||
}
|
||||
|
||||
const handleRegister = () => {
|
||||
if (instance) {
|
||||
instance.appContext.config.globalProperties.$openRegister()
|
||||
// instance.appContext.config.globalProperties.$openRegister()
|
||||
}
|
||||
}
|
||||
|
||||
const handleLoginPhone = () => {
|
||||
if (instance) {
|
||||
instance.appContext.config.globalProperties.$openLogin('verify')
|
||||
// instance.appContext.config.globalProperties.$openLogin('verify')
|
||||
}
|
||||
}
|
||||
|
||||
const handleLoginEmail = () => {
|
||||
if (instance) {
|
||||
instance.appContext.config.globalProperties.$openLoginEmail()
|
||||
// instance.appContext.config.globalProperties.$openLoginEmail()
|
||||
}
|
||||
}
|
||||
|
||||
const handleUserInfo = () => {
|
||||
if (!isLogin.value) return
|
||||
window.open('/personal-detail', '_blank') // 修改为在新窗口打开
|
||||
navigateTo('/personal-detail') // 修改为在新窗口打开
|
||||
}
|
||||
|
||||
// 发布图纸
|
||||
const handleDrawe = () => {
|
||||
window.open('/upnew/drawe', '_blank') // 修改为在新窗口打开
|
||||
navigateTo('/upnew/drawe') // 修改为在新窗口打开
|
||||
}
|
||||
|
||||
// 推出登录
|
||||
@ -145,7 +145,7 @@
|
||||
}
|
||||
|
||||
const handleSign = () => {
|
||||
window.open('/sign-page', '_blank') // 修改为在新窗口打开
|
||||
navigateTo('/sign-page') // 修改为在新窗口打开
|
||||
}
|
||||
|
||||
watchEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user