|
|
@@ -1,12 +1,12 @@
|
|
|
<template>
|
|
|
<div class="demand">
|
|
|
- <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
|
|
|
+ <el-tabs v-model="form.activeName" class="demo-tabs" @tab-click="handleClick">
|
|
|
<el-tab-pane v-for="tab in tabs" :key="tab.name" :label="$t(tab.label)" :name="tab.name">
|
|
|
<ul class="demand-list">
|
|
|
- <li v-for="(item, index) in 5" :key="index">
|
|
|
+ <li v-for="(item, index) in list" :key="index">
|
|
|
<div class="flex-center-between">
|
|
|
- <div class="title">需求标题需求标题需求标题需求标题</div>
|
|
|
- <div class="price">¥2000.00-3000.00</div>
|
|
|
+ <div class="title">{{ item.title }}</div>
|
|
|
+ <div class="price">¥{{ item.budgetMin }}-{{ item.budgetMax }}</div>
|
|
|
</div>
|
|
|
<div class="flex-align-center content">
|
|
|
<div class="flex-align-center">
|
|
|
@@ -16,11 +16,11 @@
|
|
|
<ul class="flex-align-center list">
|
|
|
<div class="li">
|
|
|
<img src="/src/assets/imgs/yuangong.png" alt="">
|
|
|
- <div class="">15{{ $t('common.renbaoming') }}</div>
|
|
|
+ <div class="">{{ item.publishCount }}{{ $t('common.renbaoming') }}</div>
|
|
|
</div>
|
|
|
<div class="li">
|
|
|
<img src="/src/assets/imgs/rili.png" alt="">
|
|
|
- <div class="">{{ $t('common.signUpDeadline') }}:2024-11-19 17:00</div>
|
|
|
+ <div class="">{{ $t('common.signUpDeadline') }}:{{ item.publishTime }}</div>
|
|
|
</div>
|
|
|
</ul>
|
|
|
</div>
|
|
|
@@ -28,11 +28,11 @@
|
|
|
<div class="info">
|
|
|
<div class="info-left">
|
|
|
<el-avatar :size="30" :src="appStore.avatarDefault" />
|
|
|
- <div class="name">花花</div>
|
|
|
+ <div class="name">{{ item.nickName }}</div>
|
|
|
<div class="date">2024-11-18 {{ $t('common.publish') }}</div>
|
|
|
</div>
|
|
|
<div class="info-right flex-align-center">
|
|
|
- <template v-if="activeName == 'first'">
|
|
|
+ <template v-if="form.activeName === 0">
|
|
|
<div class="btn" @click="dialogVisible = true">
|
|
|
<img src="/src/assets/imgs/my/jilu@2x.png" alt="">
|
|
|
<div>{{ $t('personalCenter.viewSignUpRecord') }}</div>
|
|
|
@@ -62,18 +62,20 @@
|
|
|
</ul>
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
- <Pagination :total="20" :page-size="10" :current-page="1" @page-change="handlePageChange" />
|
|
|
+ <template v-if="list.length">
|
|
|
+ <Pagination :total="form.total" :page-size="form.pageSize" :current-page="form.pageNum" @page-change="handlePageChange" />
|
|
|
+ </template>
|
|
|
+ <el-empty v-else :description="$t('common.empty')" />
|
|
|
|
|
|
- <el-dialog v-model="dialogVisible" :title="$t('personalCenter.viewSignUpRecord')" width="1138"
|
|
|
- :before-close="handleClose">
|
|
|
+ <el-dialog v-model="dialogVisible" :title="$t('personalCenter.viewSignUpRecord')" width="1138">
|
|
|
<div class="detail">
|
|
|
<div class="detail-top">
|
|
|
<div class="flex-center-between">
|
|
|
<div class="flex-align-center">
|
|
|
<div class="tag">报名中</div>
|
|
|
- <div class="name">【Linux】【操作】Linux操作集锦系列之十五——如何破解pdf、doc、zip、rar等密码</div>
|
|
|
+ <div class="name">{{ item.title }}</div>
|
|
|
</div>
|
|
|
- <div class="price">¥2000.00-3000.00</div>
|
|
|
+ <div class="price">¥{{ item.budgetMin }}-{{ item.budgetMax }}</div>
|
|
|
</div>
|
|
|
<div class="flex-align-center content">
|
|
|
<div class="flex-align-center">
|
|
|
@@ -135,22 +137,55 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
-import { ref } from 'vue'
|
|
|
+import { ref,onMounted } from 'vue'
|
|
|
import { useAppStore } from '@/pinia/appStore'
|
|
|
import type { TabsPaneContext } from 'element-plus'
|
|
|
import Pagination from '@/components/Pagination.vue'
|
|
|
+
|
|
|
+import { getWorkflowApplyByUserId,userQuestList } from '@/api/my.js'
|
|
|
+
|
|
|
const appStore = useAppStore();
|
|
|
-const activeName = ref('first')
|
|
|
const tabs = ref([
|
|
|
- { label: 'personalCenter.publishDemandRecord', name: 'first' },
|
|
|
- { label: 'personalCenter.myDemandRecord', name: 'second' }
|
|
|
+ { label: 'personalCenter.publishDemandRecord', name: 0 },
|
|
|
+ { label: 'personalCenter.myDemandRecord', name: 1 }
|
|
|
])
|
|
|
|
|
|
const dialogVisible = ref(false)
|
|
|
|
|
|
-const handleClick = (tab: TabsPaneContext, event: Event) => {
|
|
|
- console.log(tab, event)
|
|
|
+const list = ref([])
|
|
|
+const form = ref({
|
|
|
+ pageNum:1,
|
|
|
+ pageSize:10,
|
|
|
+ total: 0,
|
|
|
+ activeName:0
|
|
|
+})
|
|
|
+
|
|
|
+const handleClick = (tab: TabsPaneContext) => {
|
|
|
+ list.value = []
|
|
|
+ form.value.pageNum = 1;
|
|
|
+ form.value.activeName = tab.props.name;
|
|
|
+ getList()
|
|
|
}
|
|
|
+
|
|
|
+// 获取列表
|
|
|
+const getList = async () =>{
|
|
|
+ let res = await (form.value.activeName === 0 ? userQuestList(form.value) : getWorkflowApplyByUserId(form.value))
|
|
|
+ console.log(res.rows)
|
|
|
+ list.value = res.rows || [];
|
|
|
+ form.value.total = res.total;
|
|
|
+}
|
|
|
+
|
|
|
+const handlePageChange = (page) =>{
|
|
|
+ list.value = []
|
|
|
+ form.value.pageNum = page;
|
|
|
+ getList()
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(()=>{
|
|
|
+ getList()
|
|
|
+})
|
|
|
+
|
|
|
+
|
|
|
</script>
|
|
|
<style scoped lang="scss">
|
|
|
.demand {
|
|
|
@@ -360,6 +395,7 @@ const handleClick = (tab: TabsPaneContext, event: Event) => {
|
|
|
height: 32px;
|
|
|
border-radius: 4px;
|
|
|
font-size: 14px;
|
|
|
+
|
|
|
&:hover {
|
|
|
opacity: 0.7;
|
|
|
}
|