|
@@ -7,10 +7,10 @@ import { onMounted, ref } from 'vue'
|
|
|
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, vip, scan } from '@/core/libs/svgs'
|
|
|
-import { getMemberUserInfo } from '@/core/libs/requests'
|
|
|
-import { useUserStore } from '@/store'
|
|
|
+import { designer, settled, treaty, vipBg } from '../../core/libs/pngs'
|
|
|
+import { integral, coupon, order, agent, setting, vip, scan } from '../../core/libs/svgs'
|
|
|
+import { getMemberUserInfo, getTasks } from '../../core/libs/requests'
|
|
|
+import { useUserStore } from '../../store'
|
|
|
import { storeToRefs } from 'pinia'
|
|
|
import { isEmpty } from 'radash'
|
|
|
import TasksCard from './components/tasks-card.vue'
|
|
@@ -19,6 +19,9 @@ const userStore = useUserStore()
|
|
|
const { isLogined, userInfo } = storeToRefs(userStore)
|
|
|
const { setUserInfo } = userStore
|
|
|
const { data, run } = useRequest(getMemberUserInfo)
|
|
|
+const { data: taskData, run: getTaskData } = useRequest(() => getTasks({}), {
|
|
|
+ initialData: { list: [] },
|
|
|
+})
|
|
|
const menus = ref([
|
|
|
{ title: '积分明细', icon: integral },
|
|
|
{ title: '优惠券包', icon: coupon },
|
|
@@ -49,13 +52,6 @@ const pieces = ref([
|
|
|
iconSize: 44,
|
|
|
},
|
|
|
])
|
|
|
-const tasks = ref([
|
|
|
- { title: '到店打卡获取积分', score: 150, completed: true },
|
|
|
- { title: '到店打卡获取积分', score: 150 },
|
|
|
- { title: '到店打卡获取积分', score: 150 },
|
|
|
- { title: '到店打卡获取积分', score: 150 },
|
|
|
- { title: '到店打卡获取积分', score: 150 },
|
|
|
-])
|
|
|
const avatar = computed(() =>
|
|
|
!isEmpty(userInfo.value.avatar) ? userInfo.value.avatar : 'https://via.placeholder.com/72x72',
|
|
|
)
|
|
@@ -82,6 +78,7 @@ const handleToHomepage = () => {
|
|
|
onMounted(async () => {
|
|
|
// await run()
|
|
|
// console.log(data.value)
|
|
|
+ await getTaskData()
|
|
|
})
|
|
|
</script>
|
|
|
|
|
@@ -208,7 +205,7 @@ onMounted(async () => {
|
|
|
</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
- <TasksCard custom-class="my-6" :items="tasks"></TasksCard>
|
|
|
+ <TasksCard custom-class="my-6" :items="taskData.list"></TasksCard>
|
|
|
<SectionHeading custom-class="my-6" title="和筑巢荟一起共同成长"></SectionHeading>
|
|
|
<CardMenu :items="pieces" custom-class="grid-cols-2" />
|
|
|
</view>
|