This commit is contained in:
dengxin
2024-03-19 17:19:44 +08:00
parent 723210a121
commit ef6c744d41
13 changed files with 2765 additions and 209 deletions

View File

@@ -1,202 +1,205 @@
<template>
<view>
<view :key="group" v-for="(item,group) in list">
<m-slide-list :prop="prop" :key="value.id" v-for="(value,index) in item" :value="value" :button="buttonList" @remove="click(value,group,index)"
@controller-reg="controller.reg" @controller-moving="controller.moving" @controller-opened="controller.opened"
@controller-closed="controller.closed">
<view class="news-item">
<view class="now-message-info" hover-class="uni-item--hover" @click="clickMethod(value)" :style="{width:windowWidth}">
<view class="list-right">
<view v-if="value[prop.isRead] === 0" class="point"></view>
<view class="list-title">{{ value[prop.title] }}</view>
<view class="list-detail">{{ value[prop.listDesc] }}</view>
</view>
<view class="list-right-1" v-if="value[prop.time]">{{ value[prop.time] }}</view>
<template>
<view class="body">
<!-- <view v-if="browsingResultList.length > 0" class="search-result">
<view v-for="(item, index) in browsingResultList" class="search-item" v-if="item.workname" :key="index" @click="">
<image src="../../static/img/search.svg" style="width: 32rpx;height: 32rpx;margin-right: 10rpx;" mode=""></image>
<view style="flex:1">{{ item.workname }}</view>
<view class="type" v-if="item.type == 0">任务</view>
<view class="type" v-else-if="item.type == 1">岗位</view>
<view class="type" v-else-if="item.type == 2">政策</view>
</view>
</view> -->
<block v-for="(page, pIndex) in data" :key="pIndex">
<block v-for="(item, index) in page" :key="item.id">
<view class="search-item" @click="toDetail(item)">
<!-- <company-list :companyitem="item" :noApply="false"></company-list> -->
<image src="/static/img/eyeopen.svg" style="width: 32rpx;height: 32rpx;margin-right: 10rpx;"
mode=""></image>
<view style="flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;">{{ item.workname }}
</view>
<view style="clear:both"></view>
<view class="type" v-if="item.type1 == 0">任务</view>
<view class="type" v-else-if="item.type1 == 1">岗位</view>
<view class="type" v-else-if="item.type1 == 2">招工</view>
<view class="baddd"></view>
</view>
</m-slide-list>
<!-- <view class="news-loading">
加载中...
</view> -->
</block>
</block>
<view class="nothing" v-if="data.length === 0">
<image src="/static/img/pic_notask.svg" mode=""></image>
<view class="nothingContnt">
暂无浏览信息
</view>
</view>
</view>
</view>
</template>
<script>
import mSlideList from '../../../components/mark-slide-list/mark-slide-list.vue';
import controller from '../../../components/mark-slide-list/controller';
import {
mapGetters
} from 'vuex'
import vTabs from '@/components/v-tabs/v-tabs.vue';
import {
recruitmentNewsList
} from '@/api/mission.js';
export default {
components: {
mSlideList
export default {
components: {
vTabs,
},
data() {
return {
data: [],
activeTab: 0,
current: 1,
size: 10,
total: 0,
browsingResultList: []
}
},
onLoad: function () {
this.init()
},
/*页面滚动到底部 换页*/
onReachBottom: function () {
if (this.current <= Math.ceil(this.total / this.size)) {
this.getData();
} else {
uni.showToast({
icon: "none",
title: '已经是最后一页',
})
}
},
/*下拉刷新*/
onPullDownRefresh: function () {
this.init()
},
methods: {
init() {
this.current = 1
this.data = []
this.getData()
},
data() {
return {
loading: false,
id: '',
controller: new controller(),
buttonList: [{
title: '删除',
background: '#ff3b32',
clickName: 'remove'
}]
};
},
onLoad({
type
}) {
this.id = type
uni.setNavigationBarTitle({
title: this.news.data[type].title
});
},
onPullDownRefresh() {
this.loading = true
this.$store.dispatch("newsReload", this.id).then(() => {
this.loading = false
uni.stopPullDownRefresh();
}).catch(() => {
this.loading = false
getData() {
var status = Number(this.activeTab) + 1
recruitmentNewsList(this.current, this.size, status).then(res => {
uni.stopPullDownRefresh();
console.log(res)
if (this.current === 1) {
this.data = [];
}
this.current += 1;
this.total = res.data.data.total;
if (res.data.data && res.data.data.records.length) {
this.data.push(res.data.data.records);
}
})
},
// onPageScroll(obj) {},
onReachBottom() {
if (!this.loading) {
this.loading = true
this.$store.dispatch("newsGetNextPage", this.id).then(() => {
this.loading = false
gomap: function () {
uni.navigateTo({
url: '../mapSeach/mapSeach'
})
},
changeTab: function (e) {
this.activeTab = e;
this.init()
},
toDetail(item) {
const no = item.id
// 判断是岗位还是任务 0任务1岗位2招工
if (item.type1 == 0) {
uni.navigateTo({
url: `/pages/recruit/subPage/newsDetail/projectInfo?missionNo=${encodeURIComponent(no)}&type=${item.type1}&isCan=1`
})
} else if (item.type1 == 1) {
uni.navigateTo({
url: `/pages/recruit/subPage/newsDetail/workInfo?workId=${encodeURIComponent(no)}&type=${item.type1}&isCan=1`
})
} else if (item.type1 == 2) {
uni.navigateTo({
url: `/pages/recruit/subPage/newsDetail/userrecruitInfo?workId=${encodeURIComponent(no)}&isCan=1&type=${item.type1}`
})
}
},
methods: {
//查看详情
clickMethod(data) {
this.news.data[this.id].navigateTo(data, this.$store.dispatch)
},
click(value, group, index) {
this.$store.dispatch('removeNew', {
id: value.id,
key: this.id,
group,
index
})
}
},
computed: {
...mapGetters(['news']),
list() {
if (this.id) {
return this.news.data[this.id].data
}
},
prop() {
if (this.id) {
return this.news.data[this.id].prop
}
},
windowWidth() {
return uni.getSystemInfoSync().windowWidth + 'px';
}
}
};
},
}
}
</script>
<style lang="scss" scoped>
.uni-item--hover {
background-color: #f1f1f1 !important;
}
<style scoped>
page {
height: 100%;
}
.news-item {
height: 160rpx;
}
.tab {
height: 46px;
}
.now-message-info {
position: relative;
box-sizing: border-box;
display: flex;
align-items: center;
/* justify-content: space-between; */
font-size: 16px;
clear: both;
height: 160rpx;
padding: 0 30rpx;
// margin-bottom: 20rpx;
background: #ffffff;
float: left;
border-bottom: 1px solid #f2f2f2;
.body {
height: 100%;
}
.icon-image {
border-radius: 10rpx;
width: 100rpx;
height: 100rpx;
float: left;
}
.probody image {
width: 88rpx;
height: 88rpx;
position: absolute;
right: 0;
top: 0;
}
.icon-circle {
background: #3396fb;
border-radius: 100%;
width: 100rpx;
height: 100rpx;
line-height: 100rpx;
text-align: center;
color: #ffffff;
font-weight: bold;
font-size: 20px;
float: left;
}
.probody {
width: 100%;
position: relative;
}
.list-right {
position: relative;
float: left;
margin-left: 25rpx;
margin-right: 30rpx;
.baddd {
background: #f6f6f6;
height: 20rpx;
}
.point {
position: absolute;
top: 15rpx;
left: -25rpx;
width: 20rpx;
height: 20rpx;
background: red;
border-radius: 50%;
}
.nothing {
height: 100%;
padding-top: 50%;
box-sizing: border-box;
}
.list-title {
width: 350rpx;
line-height: 1.5;
overflow: hidden;
margin-bottom: 10rpx;
color: #333;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
}
.nothing image {
width: 400rpx;
height: 200rpx;
display: block;
margin: 0 auto;
}
.list-detail {
width: 350rpx;
font-size: 14px;
color: #a9a9a9;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
}
}
.nothingContnt {
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #666;
margin-top: 30rpx;
text-align: center;
}
.list-right-1 {
position: absolute;
right: 30rpx;
color: #a9a9a9;
font-size: 24rpx;
}
}
.title {
font-size: 26rpx;
font-weight: bold;
border-bottom: 1rpx solid #ddd;
height: 60rpx;
line-height: 60rpx;
}
.news-loading {}
.search-item {
display: flex;
align-items: center;
font-size: 26rpx;
border-bottom: 1rpx solid #ddd;
height: 80rpx;
line-height: 80rpx;
padding: 10rpx 30rpx;
}
.search-item .type {
font-size: 20rpx;
color: #707070;
background-color: #dddddd;
border-radius: 15rpx;
height: 30rpx;
line-height: 30rpx;
padding: 0 20rpx;
}
</style>