2022-08-26 09:52:43 +00:00
|
|
|
<template>
|
2022-09-08 08:28:56 +00:00
|
|
|
<view class="user">
|
|
|
|
|
<view v-for="(item, index) in state.pages" :key="index">
|
|
|
|
|
<template v-if="item.name == 'user-info'">
|
|
|
|
|
<w-user-info
|
|
|
|
|
:content="item.content"
|
|
|
|
|
:styles="item.styles"
|
|
|
|
|
:user="userInfo"
|
|
|
|
|
:is-login="isLogin"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="item.name == 'my-service'">
|
|
|
|
|
<w-my-service :content="item.content" :styles="item.styles" />
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="item.name == 'user-banner'">
|
|
|
|
|
<w-user-banner :content="item.content" :styles="item.styles" />
|
|
|
|
|
</template>
|
|
|
|
|
</view>
|
2022-09-13 11:07:36 +00:00
|
|
|
<tabbar />
|
2022-09-08 08:28:56 +00:00
|
|
|
</view>
|
2022-08-26 09:52:43 +00:00
|
|
|
</template>
|
|
|
|
|
|
2022-09-08 08:28:56 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { getDecorate } from '@/api/shop'
|
|
|
|
|
import { useUserStore } from '@/stores/user'
|
|
|
|
|
import { onShow } from '@dcloudio/uni-app'
|
|
|
|
|
import { storeToRefs } from 'pinia'
|
|
|
|
|
import { reactive } from 'vue'
|
|
|
|
|
const state = reactive<{
|
|
|
|
|
pages: any[]
|
|
|
|
|
}>({
|
|
|
|
|
pages: []
|
|
|
|
|
})
|
|
|
|
|
const getData = async () => {
|
|
|
|
|
const data = await getDecorate({ id: 2 })
|
|
|
|
|
state.pages = JSON.parse(data.pages)
|
|
|
|
|
}
|
|
|
|
|
const userStore = useUserStore()
|
|
|
|
|
const { userInfo, isLogin } = storeToRefs(userStore)
|
|
|
|
|
onShow(() => {
|
|
|
|
|
userStore.getUser()
|
|
|
|
|
})
|
|
|
|
|
getData()
|
|
|
|
|
</script>
|
2022-08-26 09:52:43 +00:00
|
|
|
|
|
|
|
|
<style></style>
|