Files
jobslink-user-clent/pages/project/project.vue

598 lines
14 KiB
Vue
Raw Normal View History

2024-02-02 14:44:30 +08:00
<template>
<view>
2024-02-17 09:42:41 +08:00
<view class="titleSearch">
2024-02-17 18:22:11 +08:00
<view class="searchName"> </view>
2024-02-17 09:42:41 +08:00
2024-03-07 17:34:17 +08:00
<u-search placeholder="搜任务/搜岗位/搜政策/搜招工" @focus="goSeach" shape="round" :showAction="false"></u-search>
2024-02-17 09:42:41 +08:00
</view>
2024-02-19 20:28:04 +08:00
<view class="navPosition" @click="navTo('/pages/project/projectList')">
<u-icon name="map" color="#2979ff" size="16"></u-icon>
<view class="positionText">四川德阳市</view>
<u-icon name="arrow-right" color="#666666" size="14"></u-icon>
</view>
2024-02-17 18:22:11 +08:00
<view class="content">
<view class="typeButtonWrapper">
<view class="typeButtonLeft">
2024-02-15 18:30:40 +08:00
2024-02-17 18:22:11 +08:00
<view v-for="(item, index) in nonReactiveArray" :key="index"
:class="['typeButton', index == activeTab ? 'activeButton' : '']" @click="changeTab(index)">{{ item
}}</view>
</view>
<!-- 筛选 -->
<view class="screenButton" @click="showPopUp = true">
筛选
<view class="arrow-up-right"> </view>
</view>
2024-02-15 18:30:40 +08:00
</view>
2024-02-17 09:42:41 +08:00
2024-02-17 18:22:11 +08:00
<u-popup closeable :show="showPopUp" mode="right" @close="closePopUp">
<view class="popUpWrapper">
<verticalMenu :closePopUp="closePopUp" :subMitPopUp="subMitPopUp" />
</view>
</u-popup>
2024-02-17 09:42:41 +08:00
2024-02-17 18:22:11 +08:00
<block v-if="activeTab == 0">
2024-02-19 23:17:06 +08:00
<view v-if="newList.length > 0" style="padding-bottom: 20rpx;">
2024-02-17 18:22:11 +08:00
<block v-for="(item, index) in newList" :key="index">
<companyList :companyitem="item"></companyList>
</block>
</view>
<view v-else>
<image src="../../static/img/pic_notask.svg" class="nothing" mode=""></image>
<view class="nothing_text">暂无信息</view>
</view>
</block>
2024-02-02 14:44:30 +08:00
2024-02-17 18:22:11 +08:00
<block v-if="activeTab == 1">
<view>
2024-02-19 09:08:07 +08:00
<!-- <view class="location" @click="gomap">
2024-02-17 18:22:11 +08:00
<image src="../../static/img/location.svg" mode=""></image>
{{ currentAddress }}切换位置
<image src="../../static/img/right.svg" mode=""></image>
2024-02-19 09:08:07 +08:00
</view> -->
2024-02-02 14:44:30 +08:00
</view>
2024-02-19 23:17:06 +08:00
<view v-if="companyList.length > 0" style="padding-bottom: 20rpx;">
2024-02-17 18:22:11 +08:00
<block v-for="(item, index) in companyList" :key="item.id">
2024-02-19 09:08:07 +08:00
<workList :companyitem="item" :near="activeTab === 0"></workList>
2024-02-17 18:22:11 +08:00
</block>
2024-02-02 14:44:30 +08:00
</view>
2024-02-17 18:22:11 +08:00
<view v-else>
<image src="../../static/img/pic_notask.svg" mode="" class="nothing"></image>
<view class="nothingContnt">
暂无信息
</view>
</view>
</block>
2024-03-07 17:34:17 +08:00
<block v-if="activeTab == 2">
<view>
<!-- <view class="location" @click="gomap">
<image src="../../static/img/location.svg" mode=""></image>
{{ currentAddress }}切换位置
<image src="../../static/img/right.svg" mode=""></image>
</view> -->
</view>
<view v-if="policyContentList.length > 0" style="padding-bottom: 20rpx;">
<block v-for="(item, index) in policyContentList" :key="item.id">
<userrecruitList :companyitem="item"></userrecruitList>
</block>
</view>
<view v-else>
<image src="../../static/img/pic_notask.svg" mode="" class="nothing"></image>
<view class="nothingContnt">
暂无信息
</view>
</view>
</block>
2024-02-02 14:44:30 +08:00
2024-03-07 17:34:17 +08:00
<!-- <block v-if="activeTab == 2">
2024-02-19 10:03:49 +08:00
<view v-for="(item, index) in policyContentList" :key="index" style="width: 90%;height: 100rpx;background-color: #fff;border-radius: 10rpx;margin:20rpx 5% 20rpx 5%;display: flex;align-items: center" @click="goPolicyInfo(item.id)">
2024-02-19 09:08:07 +08:00
<image :src="item.headPic" style="width: 60rpx;height: 60rpx;margin: 0 20rpx;"></image>
<view style="font-size: 26rpx;">{{ item.articleTitle }}</view>
2024-02-02 14:44:30 +08:00
</view>
2024-03-07 17:34:17 +08:00
</block> -->
2024-02-17 18:22:11 +08:00
<cs-button></cs-button>
</view>
2024-02-02 14:44:30 +08:00
</view>
</template>
<script>
2024-02-15 18:30:40 +08:00
import vTabs from '@/components/v-tabs/v-tabs.vue';
import testData from '@/common/textdata.js';
import companyList from '@/components/companyList/companyList.vue';
2024-02-19 09:08:07 +08:00
import workList from '@/components/companyList/workList.vue'
2024-03-07 17:34:17 +08:00
import userrecruitList from './userrecruitList.vue'
2024-02-15 18:30:40 +08:00
import {
newMissionAll,
recommendMission,
nearMission
} from '@/api/mission.js';
2024-02-19 09:08:07 +08:00
import {getPolicyContent} from '@/api/newIndex.js'
2024-03-07 17:34:17 +08:00
import {getPushListByUserId } from '@/api/userrecruit.js'
2024-02-15 18:30:40 +08:00
import {
getcoder
} from "@/api/map.js";
import verticalMenu from '@/components/vertical-menu/vertical-menu.vue';
2024-02-17 18:22:11 +08:00
2024-02-15 18:30:40 +08:00
export default {
components: {
vTabs,
2024-02-19 09:08:07 +08:00
companyList,
verticalMenu,
2024-03-07 17:34:17 +08:00
workList,
userrecruitList
2024-02-15 18:30:40 +08:00
},
2024-02-17 18:22:11 +08:00
2024-02-15 18:30:40 +08:00
data() {
return {
2024-02-19 09:08:07 +08:00
policyContentList: [],
2024-02-15 18:30:40 +08:00
activeTab: 0,
companyList: [],
recommendList: [],
newList: [],
2024-02-19 09:08:07 +08:00
2024-02-15 18:30:40 +08:00
nearPage: {
current: 1,
size: 10,
total: 0
},
recommendPage: {
current: 1,
size: 10,
total: 0
},
newPage: {
current: 1,
size: 10,
total: 0
},
2024-03-07 17:34:17 +08:00
policyPage: {
current: 1,
size: 10,
total: 0
},
2024-02-15 18:30:40 +08:00
currentAddress: '',
currentPoint: {
latitude: 0,
longitude: 0
},
key: 'FW3BZ-6JTK6-GCUS5-MZCRR-3GPR5-HJFEI',
open: false,
showPopUp: false,
2024-02-17 18:22:11 +08:00
2024-03-13 17:36:43 +08:00
nonReactiveArray: ["推荐任务", "推荐岗位", "个体户招工"],
2024-02-15 18:30:40 +08:00
}
},
onLoad: function () {
this.getData()
2024-02-19 09:08:07 +08:00
this.getPolicy()
2024-02-15 18:30:40 +08:00
},
onShow: function () {
if (this.$store.state.user.token) {
this.$store.dispatch('refreshAuthState').then((e) => {
var auth = this.$store.state.auth
if (!auth.bankCardState) {
this.step()
}
})
}
const value = uni.getStorageSync('active');
if (value) {
this.activeTab = value;
uni.removeStorageSync('active')
}
},
/*页面滚动到底部 换页*/
onReachBottom: function () {
this.upLoad()
},
/*下拉刷新*/
onPullDownRefresh: function () {
if (!this.$store.state.user.token) {
uni.redirectTo({
url: "/pages/login/login"
});
} else {
this.download();
}
},
methods: {
step() {
var that = this
that.open = true
uni.showModal({
title: '实名认证',
content: `检查到您还未实名认证,实名认证之后才可进行操作哦`,
showCancel: false,
confirmText: '立即认证',
success: function (res) {
if (res.confirm) {
that.goSign(0)
} else if (res.cancel) {
that.step()
}
that.open = false
}
});
2024-02-02 14:44:30 +08:00
},
2024-02-15 18:30:40 +08:00
// 步骤
goSign(active) {
uni.navigateTo({
url: `/pages/projectInfo/signContract?active=${active}`
})
2024-02-02 14:44:30 +08:00
},
2024-02-15 18:30:40 +08:00
goResume: function () {
uni.navigateTo({
url: '/pageMy/my/resume/addSkill'
})
2024-02-02 14:44:30 +08:00
},
2024-02-15 18:30:40 +08:00
/*定位*/
getLocation: function () {
var that = this;
uni.getLocation({
type: 'gcj02',
success: function (res) {
that.currentPoint = {
latitude: res.latitude,
longitude: res.longitude
2024-02-02 14:44:30 +08:00
}
2024-02-15 18:30:40 +08:00
that.getAddrByPoint(res);
that.getNearList(that.currentPoint)
},
complete: function (e) { }
});
2024-02-02 14:44:30 +08:00
},
2024-02-15 18:30:40 +08:00
/*逆地址解析*/
getAddrByPoint: function (point) {
var that = this;
var location = point.latitude + ',' + point.longitude
getcoder(location, encodeURI(that.key), 0).then(res => {
that.currentAddress = res.data.result.address
});
2024-02-02 14:44:30 +08:00
},
2024-02-15 18:30:40 +08:00
goSeach: function () {
uni.navigateTo({
url: '../seach/seach'
})
2024-02-02 14:44:30 +08:00
},
2024-02-15 18:30:40 +08:00
gomap: function () {
uni.navigateTo({
url: '../mapSeach/mapSeach'
})
},
2024-02-19 09:08:07 +08:00
getPolicy(){
2024-03-07 17:34:17 +08:00
let params = {
current: this.policyPage.current,
size: this.policyPage.size,
}
getPushListByUserId(params).then((res) => {
if(res.data.code === 200 ){
const {records, current, total, size } = res.data.data
2024-03-13 09:35:02 +08:00
console.log('个体招工', records, current, total, size)
2024-03-07 17:34:17 +08:00
if(!records.length) {
return uni.showToast({
icon: "none",
title: '没有更多了',
})
}
if(current === 1) {
this.policyContentList = records
} else {
this.policyContentList = this.policyContentList.concat(records);
}
this.policyPage.current = current + 1;
this.policyPage.total = total;
}
})
// getPolicyContent(1).then(res=>{
// this.policyContentList=res.data.data.records
// })
2024-02-19 09:08:07 +08:00
},
2024-02-15 18:30:40 +08:00
changeTab: function (e) {
this.activeTab = e;
},
//附近任务;
getNearList: function (point) {
2024-02-19 09:08:07 +08:00
nearMission(this.nearPage.current, this.nearPage.size).then(res => {
2024-02-15 18:30:40 +08:00
if (this.nearPage.current === 1) {
this.companyList = [];
2024-02-02 14:44:30 +08:00
}
2024-02-15 18:30:40 +08:00
this.nearPage.current += 1;
this.nearPage.total = res.data.data.total;
if (res.data.data && res.data.data.records.length) {
this.companyList = this.companyList.concat(res.data.data.records);
2024-02-02 14:44:30 +08:00
}
2024-02-15 18:30:40 +08:00
})
},
2024-02-19 10:03:49 +08:00
goPolicyInfo(data){
if(data){
// var val=encodeURIComponent(data)
uni.navigateTo({
url:`/pages/user/policyContent?id=${data}`
})
}
else{
// uni.showToast({
// title:'暂无内容',
// icon:'none'
// })
}
},
2024-02-15 18:30:40 +08:00
//推荐任务;
getRecommendList: function () {
recommendMission(this.recommendPage.current, this.recommendPage.size, '').then(res => {
if (this.recommendPage.current === 1) {
this.recommendList = [];
2024-02-02 14:44:30 +08:00
}
2024-02-15 18:30:40 +08:00
this.recommendPage.current += 1;
this.recommendPage.total = res.data.data.total;
if (res.data.data && res.data.data.records.length) {
this.recommendList = this.recommendList.concat(res.data.data.records);
2024-02-02 14:44:30 +08:00
}
2024-02-15 18:30:40 +08:00
})
},
//最新任务;
getNewList: function () {
newMissionAll(this.newPage.current, this.newPage.size, '').then(res => {
if (this.newPage.current === 1) {
this.newList = [];
}
this.newPage.total = res.data.data.total;
if (res.data.data && res.data.data.records.length) {
this.newList = this.newList.concat(res.data.data.records);
2024-03-07 17:34:17 +08:00
this.newPage.current += 1;
2024-02-15 18:30:40 +08:00
}
})
},
//上拉加载
upLoad: function () {
if (this.activeTab === 0) {
if (this.nearPage.current <= Math.ceil(this.nearPage.total / this.nearPage.size)) {
2024-03-07 17:34:17 +08:00
// this.getNearList(this.currentPoint);
this.getNewList();
2024-02-02 14:44:30 +08:00
} else {
2024-02-15 18:30:40 +08:00
uni.showToast({
icon: "none",
title: '已经是最后一页',
})
}
return
}
if (this.activeTab === 1) {
if (this.recommendPage.current <= Math.ceil(this.recommendPage.total / this.recommendPage.size)) {
2024-02-02 14:44:30 +08:00
this.getRecommendList();
2024-02-15 18:30:40 +08:00
} else {
uni.showToast({
icon: "none",
title: '已经是最后一页',
})
}
return
}
if (this.activeTab === 2) {
2024-03-07 17:34:17 +08:00
this.getPolicy()
2024-02-15 18:30:40 +08:00
}
},
//下拉刷新
download: function () {
if (this.activeTab === 0) {
this.nearPage.current = 1;
2024-03-07 17:34:17 +08:00
this.newPage.current = 1;
2024-02-15 18:30:40 +08:00
this.getLocation();
2024-03-07 17:34:17 +08:00
this.getNewList();
2024-02-15 18:30:40 +08:00
setTimeout(function () {
uni.stopPullDownRefresh();
}, 1000);
return
}
if (this.activeTab === 1) {
this.recommendPage.current = 1;
this.getRecommendList();
setTimeout(function () {
uni.stopPullDownRefresh();
}, 1000);
return
}
if (this.activeTab === 2) {
2024-03-07 17:34:17 +08:00
this.policyPage.current = 1;
this.getPolicy()
2024-02-15 18:30:40 +08:00
setTimeout(function () {
uni.stopPullDownRefresh();
}, 1000);
return
2024-02-02 14:44:30 +08:00
}
2024-02-15 18:30:40 +08:00
},
getData: function () {
if (!this.$store.state.user.token) {
uni.redirectTo({
url: "/pages/login/login"
});
} else {
uni.$emit('newsReadChange');
this.nearPage.current = 1;
this.recommendPage.current = 1;
this.newPage.current = 1;
this.getLocation();
this.getRecommendList();
this.getNewList();
2024-02-19 09:08:07 +08:00
this.getNearList();
2024-02-15 18:30:40 +08:00
}
},
2024-02-17 18:22:11 +08:00
2024-02-15 18:30:40 +08:00
closePopUp() {
this.showPopUp = false
2024-02-17 18:22:11 +08:00
},
subMitPopUp({submitData,areaModal,industryModal}) {
console.log(submitData,areaModal,industryModal,"------确定");
this.showPopUp = false
2024-02-02 14:44:30 +08:00
}
}
2024-02-15 18:30:40 +08:00
}
2024-02-02 14:44:30 +08:00
</script>
2024-02-17 18:22:11 +08:00
<style scoped>
2024-02-19 20:28:04 +08:00
.navPosition{
padding: 0 24rpx 20rpx 30rpx;
display: flex;
align-item: center;
font-size: 26rpx;
.positionText{
margin: 0 10rpx;
}
}
2024-02-17 18:22:11 +08:00
.titleSearch {
2024-02-17 09:42:41 +08:00
display: flex;
width: 80%;
margin: 0 auto;
font-size: 22px;
font-weight: bold;
2024-02-17 18:22:11 +08:00
padding: 20rpx;
2024-02-17 09:42:41 +08:00
}
2024-02-17 18:22:11 +08:00
.searchName {
margin-right: 28rpx;
2024-02-17 09:42:41 +08:00
}
2024-02-17 18:22:11 +08:00
.content {
background-color: #f3f4f8;
padding-top: 20rpx;
min-height: 80vh;
}
2024-02-15 18:30:40 +08:00
.screenButton {
2024-02-17 18:22:11 +08:00
/* position: absolute;
2024-02-15 18:30:40 +08:00
top: 10px;
z-index: 1;
2024-02-17 18:22:11 +08:00
left: 30rpx; */
position: relative;
2024-02-15 18:30:40 +08:00
width: 50px;
text-align: center;
line-height: 30px;
font-size: 14px;
2024-02-17 18:22:11 +08:00
background-color: #fff;
}
.typeButtonWrapper {
width: 92%;
margin: 0 auto;
display: flex;
justify-content: space-between;
/* margin-bottom: 10rpx; */
}
.typeButtonLeft {
display: flex;
2024-02-19 20:28:04 +08:00
2024-02-17 18:22:11 +08:00
}
.typeButton {
font-size: 14px;
2024-03-13 17:36:43 +08:00
padding: 10rpx 30rpx;
2024-02-17 18:22:11 +08:00
background: #fff;
border-radius: 50px;
margin-right: 10rpx;
2024-02-19 20:28:04 +08:00
white-space: nowrap;
2024-02-17 18:22:11 +08:00
}
.activeButton {
color: #4171f9;
background-color: #cfdaf8;
2024-02-15 18:30:40 +08:00
}
2024-02-02 14:44:30 +08:00
2024-02-15 18:30:40 +08:00
.arrow-up-right {
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid #949396;
/* 这里的颜色可以根据你的需要进行修改 */
border-bottom: 10px solid transparent;
position: absolute;
top: 3px;
right: 3px;
2024-02-02 14:44:30 +08:00
2024-02-15 18:30:40 +08:00
}
2024-02-02 14:44:30 +08:00
2024-02-15 18:30:40 +08:00
.topseach {
width: 25px;
height: 25px;
position: absolute;
top: 10px;
right: 30rpx;
}
2024-02-02 14:44:30 +08:00
2024-02-15 18:30:40 +08:00
.location image:last-child {
margin-left: auto;
}
2024-02-02 14:44:30 +08:00
2024-02-15 18:30:40 +08:00
.location image {
width: 40rpx;
height: 40rpx;
margin-right: 10rpx;
}
2024-02-02 14:44:30 +08:00
2024-02-15 18:30:40 +08:00
.location {
padding: 20rpx 30rpx;
display: flex;
align-items: center;
justify-content: flex-start;
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #333333;
}
2024-02-02 14:44:30 +08:00
2024-02-15 18:30:40 +08:00
.btn {
margin: 0 auto;
color: #999;
border: 1rpx solid #999;
font-size: 28rpx;
height: 52rpx;
line-height: 52rpx;
text-align: center;
width: 180rpx;
border-radius: 5rpx;
margin-top: 30rpx;
}
.nothing_text {
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #666666;
text-align: center;
}
.nothingContnt {
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #333333;
margin-top: 30rpx;
text-align: center;
}
.nothing {
width: 400rpx;
height: 200rpx;
display: block;
margin: 0 auto;
margin-top: 300rpx;
}
2024-02-17 18:22:11 +08:00
2024-02-15 18:30:40 +08:00
.popUpWrapper {
2024-02-17 09:42:41 +08:00
width: 100%;
2024-02-15 18:30:40 +08:00
}
2024-02-02 14:44:30 +08:00
</style>