|
@@ -9,9 +9,25 @@ import CardMenu from '@/components/card-menu.vue'
|
|
|
import SectionHeading from '@/components/section-heading.vue'
|
|
|
import StartMenuButton from '@/components/start-menu-button.vue'
|
|
|
import { designer, settled, treaty, vipBg } from '@/core/libs/pngs'
|
|
|
-import { integral, coupon, order, agent, setting, wechat, award, camera } from '@/core/libs/svgs'
|
|
|
+import {
|
|
|
+ integral,
|
|
|
+ coupon,
|
|
|
+ order,
|
|
|
+ agent,
|
|
|
+ setting,
|
|
|
+ wechat,
|
|
|
+ award,
|
|
|
+ camera,
|
|
|
+ vip,
|
|
|
+} from '@/core/libs/svgs'
|
|
|
import { getMemberUserInfo } from '@/core/libs/requests'
|
|
|
+import { useUserStore } from '@/store'
|
|
|
+import { storeToRefs } from 'pinia'
|
|
|
+import { isEmpty } from 'radash'
|
|
|
|
|
|
+const userStore = useUserStore()
|
|
|
+const { isLogined, userInfo } = storeToRefs(userStore)
|
|
|
+const { setUserInfo } = userStore
|
|
|
const { data, run } = useRequest(getMemberUserInfo)
|
|
|
const menus = ref([
|
|
|
{ title: '积分明细', icon: integral },
|
|
@@ -43,9 +59,25 @@ const pieces = ref([
|
|
|
iconSize: 44,
|
|
|
},
|
|
|
])
|
|
|
+const avatar = computed(() =>
|
|
|
+ !isEmpty(userInfo.value.avatar) ? userInfo.value.avatar : 'https://via.placeholder.com/72x72',
|
|
|
+)
|
|
|
+const nickNameClickHandle = async () => {
|
|
|
+ if (isLogined.value) return
|
|
|
+ uni.navigateTo({ url: '/pages/login/index' })
|
|
|
+}
|
|
|
+onShow(async () => {
|
|
|
+ if (isLogined.value) {
|
|
|
+ await run()
|
|
|
+ setUserInfo({
|
|
|
+ ...userInfo.value,
|
|
|
+ ...data.value,
|
|
|
+ })
|
|
|
+ }
|
|
|
+})
|
|
|
onMounted(async () => {
|
|
|
- await run()
|
|
|
- console.log(data)
|
|
|
+ // await run()
|
|
|
+ // console.log(data.value)
|
|
|
})
|
|
|
</script>
|
|
|
|
|
@@ -54,13 +86,13 @@ onMounted(async () => {
|
|
|
<div class="bg-black/30 backdrop-blur-[60px] aspect-[1.15/1]">
|
|
|
<StartMenuButton />
|
|
|
<div class="my-6.5 px-3.5 flex">
|
|
|
- <img
|
|
|
- class="w-[72px] h-[72px] rounded-full border border-white"
|
|
|
- src="https://via.placeholder.com/72x72"
|
|
|
- />
|
|
|
+ <img class="w-[72px] h-[72px] rounded-full border border-white" :src="avatar" />
|
|
|
<div class="ms-3.5 ml-3.5">
|
|
|
- <div class="text-white text-xl font-normal font-['PingFang SC'] leading-normal">
|
|
|
- 用户SEI142
|
|
|
+ <div
|
|
|
+ class="text-white text-xl font-normal font-['PingFang SC'] leading-normal"
|
|
|
+ @click="nickNameClickHandle"
|
|
|
+ >
|
|
|
+ {{ !isLogined ? '请点击登录' : userInfo?.nickname }}
|
|
|
</div>
|
|
|
<div
|
|
|
class="mt-2 w-[63px] h-[26px] bg-black/10 rounded-[20px] border border-white/60 flex items-center justify-center"
|
|
@@ -118,8 +150,9 @@ onMounted(async () => {
|
|
|
</div>
|
|
|
<div class="mx-3.5 box-border absolute left-0 right-0 top-0 p-3.5">
|
|
|
<div class="flex items-center">
|
|
|
+ <wd-img custom-class="vertical-bottom" :src="vip" width="35" mode="widthFix"></wd-img>
|
|
|
<div
|
|
|
- class="text-center text-[#faeac6] text-sm font-normal font-['PingFang SC'] leading-normal"
|
|
|
+ class="ml-2 text-center text-[#faeac6] text-sm font-normal font-['PingFang SC'] leading-normal"
|
|
|
>
|
|
|
查看会员等级权益
|
|
|
</div>
|