zhengnaiwen_citu 8 månader sedan
förälder
incheckning
e51f5e203f

+ 14 - 1
api/position.js

@@ -115,7 +115,20 @@ export const getRecommendCount = (params) => {
     params,
     custom: {
       showLoading: false,
-      auth: false
+      auth: true
+    }
+  })
+}
+
+// 获取统计信息
+export const getRecommendationList = (params) => {
+  return request({
+    url: '/app-api/menduner/system/job-cv-rel/hire/page',
+    method: 'GET',
+    params,
+    custom: {
+      showLoading: false,
+      auth: true
     }
   })
 }

+ 5 - 0
components/PositionList/index.vue

@@ -82,10 +82,15 @@ const props = defineProps({
   list: { type: Array, default: () => [] },
   noMore: { type: Boolean, default: false },
   showWelfareTag: { type: Boolean, default: true }
+  // toDetail: Function
 })
 
 //岗位详情
 const toDetail = (isPosition, item) =>{
+	// if (props.toDetail) {
+	// 	props.toDetail(item)
+	// 	return
+	// }
   const url = isPosition
     ? `/pagesB/positionDetail/index?id=${item.job?.id}`
     : `/pagesB/companyDetail/index?id=${item.enterprise?.id}`

+ 16 - 9
components/ResumeStatus/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<slot name="header"></slot>
 	<view class="content">
-		<view v-for="(item,index) in items" :key="item.label" class="content-box">
+		<view v-for="(item,index) in items" :key="item.label" class="content-box" @tap="handleTo(item)">
 			<view class="content-box-value">
 				{{ item.count }}
 			</view>
@@ -17,20 +17,27 @@
 import { ref } from 'vue';
 import { getRecommendCount } from '@/api/position.js'
 import { getDict } from '@/hooks/useDictionaries.js'
-const props = defineProps({
-	type: {
-		type: String,
-		default: 'menduner_hire_job_cv_status'
-	}
-})
+// const props = defineProps({
+// 	type: {
+// 		type: String,
+// 		default: 'menduner_hire_job_cv_status'
+// 	}
+// })
 
 const items = ref([])
 
-// 获取状态
+const handleTo = (item) => {
+	uni.navigateTo({
+		url: "/pagesA/recommendation/index"
+	})
+}
 
 async function recommendCount () {
 	try {
-		const { data: dict } = await getDict(props.type)
+		const { data: dict } = await getDict('menduner_hire_job_cv_status')
+		if (!dict?.data) {
+			return
+		}
 		items.value = dict.data.map(e => {
 			return {
 				...e,

+ 6 - 0
pages.json

@@ -65,6 +65,12 @@
 					"style": {
 						"navigationBarTitleText": "个人信息"
 					}
+				},
+				{
+					"path": "recommendation/index",
+					"style": {
+						"navigationBarTitleText": "我的推荐"
+					}
 				}
 			]
 		},

+ 36 - 50
pages/index/crowdsourcing.vue

@@ -133,69 +133,55 @@ const pageInfo = ref({
 	pageSize: 10
 })
 
+const loading = ref(false)
 const total = ref(0)
 
-// 选择地区
-// const handleMap = () => {
-// 	// 检测是否登录	
-// 	// 未登录
-// 	if (!useUserStore.isLogin) {
-// 		console.log(111)
-// 		showAuthModal()
-// 		return
-// 	}
-// 	// 已登录
-	
-// }
-// 切换同城、最新
-// const handleChoose = (item) => {
-// 	chooseItem.value = item
-// }
-
 const loadingMore = (e) => {
-	console.log(total.value, items.length)
+	// console.log(total.value, items.length)
 	if (total.value === items.length) {
 		return
 	}
+	if (loading.value) {
+		return
+	}
 	pageInfo.value.pageNo++
 	getList()
 }
 
-// async function getRatio () {}
-
-// async function getDictionaries () {
-
-// 	const { data } = await getDict('menduner_pay_unit')
-// 	unitDict.value =  data.data
-	
-// 	const { data: _data } = await getDict('menduner_area_type')
-// 	areaDict.value = _data.data
-// 	getList()
+// function handleDetails (item) {
+// 	console.log(item)
 // }
 
-
 async function getList () {
-	const { data } = await getJobAdvertisedHire({
-		...pageInfo.value
-	})
-	if (!data?.list) {
+	loading.value = true
+	try {
+		const { data } = await getJobAdvertisedHire({
+			...pageInfo.value
+		})
+		if (!data?.list) {
+			pageInfo.pageNo--
+			return
+		}
+		const _items = dealDictArrayData([], data.list)
+		items.push(..._items.map(e => {
+			return {
+				job: e,
+				enterprise: {
+					welfareList: e.tagList,
+					logoUrl: e.logoUrl,
+					anotherName: e.anotherName,
+					industryName: e.industryName,
+					scaleName: e.scaleName
+				}
+			}
+		}))
+		total.value = +data.total
+	} catch (error) {
 		pageInfo.pageNo--
-		return
+	} finally {
+		loading.value = false
 	}
-	const _items = dealDictArrayData([], data.list)
-	items.push(..._items.map(e => {
-		return {
-			job: e,
-			enterprise: {
-				welfareList: e.tagList,
-				logoUrl: e.logoUrl,
-				anotherName: e.anotherName,
-				industryName: e.industryName,
-				scaleName: e.scaleName
-			}
-		}
-	}))
-	total.value = +data.total
+	
 }
 
 getList()
@@ -204,7 +190,7 @@ getList()
 <style scoped lang="scss">
 $defaultColor: #999;
 @mixin box {
-	border-radius: 24rpx;
+	// border-radius: 24rpx;
 	width: 100%;
 	height: 100%;
 	background: #FFF;
@@ -242,7 +228,7 @@ $defaultColor: #999;
 			padding: 24rpx;
 		}
 		&-recommend {
-			padding: 24rpx;
+			padding: 0 24rpx;
 			&-box {
 				@include box;
 				&-title {

+ 103 - 0
pagesA/recommendation/index.vue

@@ -0,0 +1,103 @@
+<template>
+	<layout-page>
+		<uni-segmented-control :current="current" :values="controlListText" @clickItem="handleChange" styleType="text" activeColor="#00897B"></uni-segmented-control>
+		<scroll-view class="scrollBox defaultBgc" scroll-y="true" @scrolltolower="loadingMore" style="height: calc(100vh - 72rpx);">
+		  <view v-if="items.length" class="listBox">
+		    <m-list :items="items"></m-list>
+		    <uni-load-more :status="more" />
+		  </view>
+		  <view v-else class="nodata-img-parent">
+		    <image
+				src="https://minio.citupro.com/dev/static/nodata.png"
+				mode="widthFix"
+				style="width: 100vw;height: 100vh;"
+			></image>
+		  </view>
+		</scroll-view>
+	</layout-page>
+</template>
+
+<script setup>
+import { ref } from 'vue'
+import layoutPage from '@/layout'
+
+import MList from './list'
+import { getDict } from '@/hooks/useDictionaries.js'
+import { getRecommendationList } from '@/api/position.js'
+	
+const current = ref(0)
+const controlList = ref([])
+const controlListText = ref([])
+const pageInfo = ref({
+	pageNo: 1,
+	pageSize: 10
+})
+const total = ref(0)
+const items = ref([])
+const loading = ref(false)
+const more = ref('more')
+
+async function initDict () {
+	try {
+		const { data } = await getDict('menduner_hire_job_cv_status')
+		if (!data?.data) {
+			return
+		}
+		controlList.value = data.data
+		controlListText.value = data.data.map(e => e.label)
+		current.value = +controlList.value[0].value
+		init()
+	} catch (error) {
+		// console.log(error)
+	}
+}
+
+
+function handleChange (val) {
+	current.value = val.currentIndex
+	pageInfo.value.pageNo = 1
+	total.value = 0
+	items.value = []
+	init()
+}
+
+function loadingMore () {
+	if (total.value === items.value.length) {
+		return
+	}
+	if (loading.value) {
+		return
+	}
+	more.value = 'loading'
+  pageInfo.value.pageNo++
+	init()
+}
+
+async function init () {
+	try {
+		loading.value = true
+		const { data } = await getRecommendationList({
+			...pageInfo.value,
+			status: current.value
+		})
+		if (!data?.list) {
+			pageInfo.value.pageNo--
+			return
+		}
+		items.value.push(...data.list)
+		total.value = +data.total
+		more.value = items.value.length === total.value ? 'noMore' : 'more'
+	} catch (error) {
+		pageInfo.value.pageNo--
+	} finally {
+		loading.value = false
+	}
+}
+
+
+initDict()
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 66 - 0
pagesA/recommendation/list.vue

@@ -0,0 +1,66 @@
+<template>
+	<view
+		class="list"
+		v-for="item in items"
+		:key="item.id"
+	>
+		<view class="list-top">
+			<text class="list-top-person">牛人:{{ item.sendPerson?.name }}</text>
+			<text class="list-top-time">{{ timesTampChange(item.createTime) }}</text>
+		</view>
+		<view class="list-remuneration">
+			薪酬:
+			{{ item.job?.payFrom }}
+			{{ item.job?.payFrom && item.job?.payTo ? ' - ' : '' }}
+			{{ item.job?.payTo }}
+		</view>
+		<view class="list-company">
+			<text>{{ item.enterprise?.anotherName }}</text>
+			<text>{{ item.enterprise?.anotherName && item.job?.name ? ' · ' : '' }}</text>
+			<text>{{ item.job?.name }}</text>
+		</view>
+	</view>
+</template>
+
+<script setup>
+import { timesTampChange } from '@/utils/date'
+const props = defineProps({
+	items: {
+		type: Array,
+		default: () => []
+	}
+})
+</script>
+
+<style lang="scss" scoped>
+.list {
+	background: #FFF;
+	margin-top: 20rpx;
+	&-top {
+		padding: 20rpx;
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		&-person {
+			font-size: .9em;
+			color: #333;
+		}
+		&-time {
+			font-size: .75em;
+			color: #999;
+		}
+	}
+	&-company {
+		padding: 30rpx 20rpx;
+		font-size: 28rpx;
+		color: #666;
+		background: linear-gradient(90deg, #f5fcfc 0, #fcfbfa 100%);
+	}
+	&-remuneration {
+		padding: 20rpx;
+		font-size: 28rpx;
+		color: #666;
+	}
+	
+}
+</style>