zhengnaiwen_citu пре 8 месеци
родитељ
комит
cced45d5b1
3 измењених фајлова са 42 додато и 28 уклоњено
  1. 33 24
      components/ResumeStatus/index.vue
  2. 3 3
      pages/index/crowdsourcing.vue
  3. 6 1
      pages/index/my.vue

+ 33 - 24
components/ResumeStatus/index.vue

@@ -1,12 +1,12 @@
 <template>
 	<slot name="header"></slot>
 	<view class="content">
-		<view v-for="(item,index) in items" :key="item.title" class="content-box">
+		<view v-for="(item,index) in items" :key="item.label" class="content-box">
 			<view class="content-box-value">
-				{{ item.value }}
+				{{ item.count }}
 			</view>
 			<view class="content-box-title">
-				{{ item.title }}
+				{{ item.label }}
 			</view>
 		</view>
 	</view>
@@ -14,31 +14,40 @@
 </template>
 
 <script setup>
-import { reactive } from 'vue';
+import { ref } from 'vue';
 import { getRecommendCount } from '@/api/position.js'
-const items = reactive([
-	{
-		value: 0,
-		title: '已推荐',
-		key: '0'
-	},
-	{
-		value: 0,
-		title: '已入职',
-		key: '1'
-	},
-	{
-		value: 0,
-		title: '已结算',
-		key: '2'
+import { getDict } from '@/hooks/useDictionaries.js'
+const props = defineProps({
+	type: {
+		type: String,
+		default: 'menduner_hire_job_cv_status'
 	}
-])
+})
+
+const items = ref([])
+
+// 获取状态
 
 async function recommendCount () {
-	const { data } = await getRecommendCount()
-	items.forEach(e => {
-		e.value = data.find(e => e.key === e.key)?.value || 0
-	})
+	try {
+		const { data: dict } = await getDict(props.type)
+		items.value = dict.data.map(e => {
+			return {
+				...e,
+				count: 0
+			}
+		})
+		console.log(items)
+		const { data } = await getRecommendCount()
+		if (!data) {
+			return
+		}
+		items.value.forEach(e => {
+			e.count = data.find(_e => _e.key === e.value)?.value || 0
+		})
+	} catch (error) {
+		console.log(error)
+	}
 }
 recommendCount()
 </script>

+ 3 - 3
pages/index/crowdsourcing.vue

@@ -24,10 +24,10 @@
 						<template #header>
 							<view class="content-top-recommend-box-title">
 								<text class="title">我的推荐</text>
-								<view class="route">
+								<!-- <view class="route">
 									<text>推荐好友入职得赏金</text>
 									<uni-icons type="icon-right" custom-prefix="iconfont" color="#999"/>
-								</view>
+								</view> -->
 							</view>
 						</template>
 						
@@ -178,7 +178,7 @@ async function getList () {
 	const { data } = await getJobAdvertisedHire({
 		...pageInfo.value
 	})
-	if (!data.list) {
+	if (!data?.list) {
 		pageInfo.pageNo--
 		return
 	}

+ 6 - 1
pages/index/my.vue

@@ -6,7 +6,11 @@
 				<view v-if="!useUserStore.isLogin" class="font-weight-bold font-size-20">点击登录</view>
 				<view v-else class="font-weight-bold font-size-20">{{ baseInfo?.name || userInfo?.phone }}</view>
 			</view>
-			<view class="d-flex" style="margin-top: 80rpx;">
+			<view style="padding: 40rpx 0;">
+				<resume-status></resume-status>
+			</view>
+			
+			<view class="d-flex">
 				<view v-for="(item, index) in itemList" :key="index" @tap="handleToLink(item)" class="parent">
 					<view class="d-flex justify-space-between">
 						<view>
@@ -43,6 +47,7 @@
 
 <script setup>
 import { ref, computed } from 'vue'
+import ResumeStatus from '@/components/ResumeStatus'
 import { userStore } from '@/store/user'
 import { getUserAvatar } from '@/utils/avatar'
 import { getAccessToken } from '@/utils/request'