|
|
@@ -15,7 +15,7 @@
|
|
|
</van-tabs>
|
|
|
<div class="list-container">
|
|
|
<van-list v-model:loading="state.loading" :finished="state.finished" finished-text="没有更多了" @load="onLoad">
|
|
|
- <van-cell>
|
|
|
+ <van-cell v-for="item in state.list" :key="item" @click="toDetail(item.id)">
|
|
|
<template #default>
|
|
|
<div class="list">
|
|
|
<header class="flex justify-between">
|
|
|
@@ -33,33 +33,35 @@
|
|
|
</header>
|
|
|
<p class="inst-title">
|
|
|
<span>课题名称</span>
|
|
|
- <span class="title ml8">{{ 'item.pgName' }}</span>
|
|
|
+ <span class="title ml8">{{ item.pgName }}</span>
|
|
|
</p>
|
|
|
<p class="inst-title">
|
|
|
<span>申请平台</span>
|
|
|
- <span class="title ml8">{{ 'item.platformName' }}</span>
|
|
|
+ <span class="title ml8">
|
|
|
+ {{ formatData(item.platPlatformAppointCellRes, item.platPlatformAppointMolecularRes).platformName }}
|
|
|
+ </span>
|
|
|
</p>
|
|
|
<p class="inst-title">
|
|
|
<span>申请时长</span>
|
|
|
- <span class="title ml8">{{ 'item.platformTime' }}个月</span>
|
|
|
+ <span class="title ml8">
|
|
|
+ {{ formatData(item.platPlatformAppointCellRes, item.platPlatformAppointMolecularRes).platformTime }}
|
|
|
+ </span>
|
|
|
</p>
|
|
|
<p class="inst-title">
|
|
|
<span>入室周期</span>
|
|
|
<span class="title ml8">{{
|
|
|
- // item.appointEndDate
|
|
|
- // ? `${formatDate(new Date(item.appointEndDate), 'YYYY-mm-dd')}~${formatDate(new Date(item.appointEndDate), 'YYYY-mm-dd')}`
|
|
|
- // : '-'
|
|
|
- 1
|
|
|
+ item.appointEndDate
|
|
|
+ ? `${formatDate(new Date(item.appointEndDate), 'YYYY-mm-dd')}~${formatDate(new Date(item.appointEndDate), 'YYYY-mm-dd')}`
|
|
|
+ : '-'
|
|
|
}}</span>
|
|
|
</p>
|
|
|
<p class="inst-title">
|
|
|
<span>缴费金额(¥)</span>
|
|
|
- <span class="title ml8">{{ 'item.platformTime' }}</span>
|
|
|
+ <span class="title ml8">{{ item.price }}</span>
|
|
|
</p>
|
|
|
<footer class="flex justify-between mt4">
|
|
|
- <span class="title">{{ 'item.memberName' }}</span>
|
|
|
- <!-- <span class="time">{{ formatDate(new Date(item.createdTime), 'YYYY-mm-dd') }}</span> -->
|
|
|
- <span class="time">{{ 1 }}</span>
|
|
|
+ <span class="title">{{ item.memberName }}</span>
|
|
|
+ <span class="time">{{ formatDate(new Date(item.createdTime), 'YYYY-mm-dd') }}</span>
|
|
|
</footer>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -71,8 +73,11 @@
|
|
|
|
|
|
<script name="entryMine" lang="ts" setup>
|
|
|
import { reactive, onMounted } from 'vue'
|
|
|
+ import { useRouter } from 'vue-router'
|
|
|
+ import to from 'await-to-js'
|
|
|
|
|
|
import { usePlatformAppointApi } from '/@/api/platform/appoint'
|
|
|
+ import { formatDate } from '/@/utils/formatTime'
|
|
|
|
|
|
enum EntryMineStatus {
|
|
|
TO_BE_PAID = '10',
|
|
|
@@ -81,6 +86,7 @@
|
|
|
}
|
|
|
|
|
|
const platformAppointApi = usePlatformAppointApi()
|
|
|
+ const router = useRouter()
|
|
|
|
|
|
const state = reactive({
|
|
|
queryParams: {
|
|
|
@@ -101,9 +107,41 @@
|
|
|
}
|
|
|
|
|
|
const onLoad = async () => {
|
|
|
- const response = await platformAppointApi.getUserInfoList(state.queryParams)
|
|
|
+ const [err, res]: ToResponse = await to(platformAppointApi.getList(state.queryParams))
|
|
|
+ if (err) return
|
|
|
+ const list = res?.data?.list || []
|
|
|
+ for (const item of list) {
|
|
|
+ state.list.push(item)
|
|
|
+ }
|
|
|
+ state.loading = false
|
|
|
+ state.queryParams.pageNum++
|
|
|
+ if (list.length < state.queryParams.pageSize) {
|
|
|
+ state.finished = true
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log('response', res)
|
|
|
+ }
|
|
|
+
|
|
|
+ const formatData = (cellRes: any[], molecularRes: any[]) => {
|
|
|
+ if (cellRes && cellRes.length && (!molecularRes || !molecularRes.length)) {
|
|
|
+ return { platformName: cellRes[0].platformName, platformTime: cellRes[0].platformTime }
|
|
|
+ }
|
|
|
+ if (molecularRes && molecularRes.length && (!cellRes || !cellRes.length)) {
|
|
|
+ return { platformName: molecularRes[0].platformName, platformTime: molecularRes[0].platformTime }
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ platformName: `${cellRes[0].platformName} / ${molecularRes[0].platformName}`,
|
|
|
+ platformTime: `${cellRes[0].platformTime}个月 / ${molecularRes[0].platformTime}个月`
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- console.log('response', response)
|
|
|
+ const toDetail = (id: number) => {
|
|
|
+ router.push({
|
|
|
+ path: '/entry/detail',
|
|
|
+ query: {
|
|
|
+ id
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|