更新我要招工中的消息页面

This commit is contained in:
dengxin
2024-03-18 17:06:39 +08:00
parent d8930fb893
commit f3cfb8479a
10 changed files with 1688 additions and 663 deletions

View File

@@ -1,4 +1,191 @@
<template>
<view class="body">
<view v-for="(value,key) in data" class="newsList" @click="goList(value)" :key="key">
<view class="newsIcon">
<image :src="'../'+value.icon" mode=""></image>
<view v-if="news.unread[value.id] > 0" class="point"></view>
</view>
<view class="newsListRight">
<view class="head">
<view class="head_left">
{{value.title}}
</view>
<view class="head_right" v-if="value.data.length > 0">
{{value.data[0][0][value.prop.time]}}
</view>
</view>
<view class="content" v-if="value.data.length > 0">
{{value.prop.desc(value)}}
</view>
</view>
</view>
<cs-button></cs-button>
</view>
</template>
<script>
import {
mapGetters
} from 'vuex'
export default {
data() {
return {
loading: false
}
},
onLoad() {},
onShow() {
if (!this.$store.state.user.token) {
uni.redirectTo({
url: "/pages/login/login"
})
} else {
uni.$emit('newsReadChange')
}
},
onPullDownRefresh() {
this.loading = true
this.$store.dispatch("newsInit").then(() => {
this.loading = false
uni.stopPullDownRefresh();
}).catch(() => {
this.loading = false
uni.stopPullDownRefresh();
})
},
methods: {
goList(item) {
// if (item.data.length === 0) {
// uni.showToast({
// title: '暂无消息',
// icon: 'none'
// });
// return
// }
console.log(item.data)
// 任务推送、岗位推送、政策推送
if(item.title == '任务推送') {
console.log('任务推送')
uni.navigateTo({
url: './taskProjectList'
})
} else if(item.title == '岗位推送') {
console.log('岗位推送')
uni.navigateTo({
url: './jobProjectList'
})
} else if(item.title == '政策推送') {
console.log('政策推送')
uni.navigateTo({
url: './policyList'
})
} else {
uni.navigateTo({
url: './newsList?type=' + item.id
})
}
}
},
computed: {
...mapGetters(['news']),
data() {
console.log(this.news.data,'--------------------==========');
return this.news.data
}
}
}
</script>
<style>
.content {
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #666666;
width: 560rpx;
overflow: hidden;
white-space: nowrap;
/*不换行*/
text-overflow: ellipsis;
/*超出部分文字以...显示*/
}
.head_right {
float: right;
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #CCCCCC;
}
.head_left {
float: left;
font-family: PingFangSC-Regular;
font-size: 36rpx;
color: #333333;
}
.head {
overflow: hidden;
width: 560rpx;
}
.newsListRight {
float: left;
width: 560rpx;
height: 50rpx;
line-height: 50rpx;
padding-left: 30rpx;
}
.newsList .newsIcon {
position: relative;
width: 100rpx;
height: 100rpx;
display: inline-block;
float: left;
}
.newsList image {
width: 100rpx;
height: 100rpx;
}
.newsList .point {
position: absolute;
top: 5rpx;
right: 10rpx;
width: 20rpx;
height: 20rpx;
background: red;
border-radius: 50%;
}
.newsList {
border-bottom: 1rpx solid #dddddd;
padding-bottom: 30rpx;
padding-right: 30rpx;
padding-top: 30rpx;
overflow: hidden;
display: flex;
align-items: center;
}
.body {
background-color: #fefefe;
padding-left: 30rpx;
width: 720rpx;
}
page {
background: #f6f6f6;
}
</style>
<!-- <template>
<view class="1">
<CustomNavbar @back="back" :titke="'消息'"></CustomNavbar>
<empty content="暂无数据" mr-top="300"></empty>
@@ -28,4 +215,4 @@
</script>
<style lang="scss" scoped>
</style>
</style> -->

View File

@@ -0,0 +1,154 @@
<template>
<view class="body">
<!-- <view class="tab">
<v-tabs :tabs="['全部任务','全部岗位']" v-model="activeTab" color="#999" activeColor="#000" fontSize="36rx"
activeFontSize="36rpx" @change='changeTab' />
</view> -->
<block v-for="(page, pIndex) in data" :key="pIndex">
<block v-for="(item, index) in page" :key="item.id">
<view class="probody">
<company-list :companyitem="item" :noApply="false"></company-list>
<view class="baddd"></view>
<!-- <block>
<image src="/static/img/tab.orange.svg" mode="" v-if="item.status === 1"></image>
<image src="/static/img/tab.blue.svg" mode="" v-else-if="item.status === 2"></image>
<image src="/static/img/tab.green.svg" mode="" v-else-if="item.status === 3"></image>
<image src="/static/img/tab.gray.svg" mode="" v-else></image>
</block> -->
</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>
</template>
<script>
import vTabs from '@/components/v-tabs/v-tabs.vue';
import companyList from '@/components/companyList/newJobList.vue';
import {
tuiJianMission
} from '@/api/mission.js';
export default {
components: {
vTabs,
companyList
},
data() {
return {
data: [],
activeTab: 0,
current: 1,
size: 10,
total: 0
}
},
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()
},
getData() {
var status = Number(this.activeTab) + 1
// 任务
// let ids = ["1758500271264247928","1758500271264247929","1758500271264247930","1758500271264247931","1758500271264247932","1758500271264247933"]
// let type = 0
// 岗位
let ids = ["1758500271264247823","1758500271264247824","1758500271264247825","1758500271264247826","1758500271264247827"]
let type = 1
tuiJianMission(ids, type).then(res => {
uni.stopPullDownRefresh();
if (this.current === 1) {
this.data = [];
}
this.current += 1;
this.total = res.data.data.total;
if (res.data.data && res.data.data.length) {
this.data.push(res.data.data);
}
})
},
changeTab: function(e) {
this.activeTab = e;
this.init()
}
}
}
</script>
<style scoped>
page {
height: 100%;
}
.tab {
height: 46px;
}
.body {
height: 100%;
}
.probody image {
width: 88rpx;
height: 88rpx;
position: absolute;
right: 0;
top: 0;
}
.probody {
width: 100%;
position: relative;
}
.baddd {
background: #f6f6f6;
height: 20rpx;
}
.nothing {
height: 100%;
padding-top: 50%;
box-sizing: border-box;
}
.nothing image {
width: 400rpx;
height: 200rpx;
display: block;
margin: 0 auto;
}
.nothingContnt {
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #666;
margin-top: 30rpx;
text-align: center;
}
</style>

View File

@@ -0,0 +1,100 @@
<template>
<view>
<view class="titlt">
<view class="title_left">
{{data.title}}
</view>
<view class="title_time">
{{data.createTime}}
</view>
</view>
<view class="content">
<rich-text :nodes="nodes"></rich-text>
</view>
</view>
</template>
<script>
import {
noticeDetail
} from '@/api/news.js';
import parseHtml from '@/untils/html-parser.js'
import {
mapGetters
} from 'vuex'
export default {
data() {
return {
content: {},
data: {},
nodes: []
}
},
onLoad({
type
}) {
this.id = type
uni.setNavigationBarTitle({
title: this.news.data[type].title
});
uni.$emit('getNewsDetail', (data) => {
this.data = data
})
this.nodes = parseHtml(this.data.content)
},
onShow() {
if (this.data.isRead === 0) {
this.$store.dispatch('readNew', {
key: this.id,
id: this.data.id
})
}
},
methods: {
},
computed: {
...mapGetters(['news']),
list() {
if (this.id) {
return this.news.data[this.id].data
}
}
}
}
</script>
<style>
.content {
padding: 10rpx 30rpx;
}
text {
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #666666;
}
.title_time {
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #CCCCCC;
float: right;
}
.titlt {
overflow: hidden;
padding: 10rpx 30rpx;
}
.title_left {
font-family: PingFangSC-Regular;
font-size: 32rpx;
color: #333333;
float: left;
}
</style>

View File

@@ -0,0 +1,202 @@
<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>
</view>
<view style="clear:both"></view>
</view>
</m-slide-list>
<!-- <view class="news-loading">
加载中...
</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'
export default {
components: {
mSlideList
},
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
uni.stopPullDownRefresh();
})
},
// onPageScroll(obj) {},
onReachBottom() {
if (!this.loading) {
this.loading = true
this.$store.dispatch("newsGetNextPage", this.id).then(() => {
this.loading = false
})
}
},
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;
}
.news-item {
height: 160rpx;
}
.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;
.icon-image {
border-radius: 10rpx;
width: 100rpx;
height: 100rpx;
float: left;
}
.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;
}
.list-right {
position: relative;
float: left;
margin-left: 25rpx;
margin-right: 30rpx;
.point {
position: absolute;
top: 15rpx;
left: -25rpx;
width: 20rpx;
height: 20rpx;
background: red;
border-radius: 50%;
}
.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;
}
.list-detail {
width: 350rpx;
font-size: 14px;
color: #a9a9a9;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
}
}
.list-right-1 {
position: absolute;
right: 30rpx;
color: #a9a9a9;
font-size: 24rpx;
}
}
.news-loading {}
</style>

View File

@@ -0,0 +1,185 @@
<template>
<view class="body">
<!-- <block v-for="(page, pIndex) in data" :key="pIndex">
<block v-for="(item, index) in page" :key="item.id">
<view class="probody">
<company-list :companyitem="item" :noApply="false"></company-list>
<view class="baddd"></view>
</view>
</block>
</block> -->
<view class="newPeojectList">
<view style="background-color: #fff;padding: 20rpx 30rpx;">
<view v-for="(item,index) in policyContentList" :key="index" style="display: flex;align-items: center;padding: 20rpx 0;border-bottom:1rpx solid #ddd;" @click="toArticleDetail(item.id)">
<image src="../../../static/img/policy_icon.png" style="width: 60rpx;height:60rpx;margin-right: 20rpx;border-radius: 10rpx;" mode=""></image>
<view style="font-size: 32rpx;">{{ item.name }}</view>
</view>
</view>
<view v-if="policyContentList.length<=0">
<image src="../../../static/img/pic_notask.svg" class="nothing" mode=""></image>
<view class="nothing_text">暂无最新资讯</view>
<view class="baddd"></view>
</view>
</view>
<!-- <view class="nothing" v-if="data.length === 0">
<image src="/static/img/pic_notask.svg" mode=""></image>
<view class="nothingContnt">
暂无政策信息
</view>
</view> -->
</view>
</template>
<script>
import vTabs from '@/components/v-tabs/v-tabs.vue';
// import companyList from '@/components/companyList/applyList.vue';
import {
getNewsPolicyList
} from '@/api/mission.js';
export default {
components: {
vTabs,
// companyList
},
data() {
return {
policyContentList: [],
activeTab: 0,
current: 1,
size: 10,
total: 0
}
},
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.policyContentList = []
this.getData()
},
toArticleDetail(id) {
if(id){
uni.navigateTo({
url:`/pages/user/policyDetail?id=${id}`
})
}
},
getData() {
var status = Number(this.activeTab) + 1
// 任务
let ids = ["1767522008019800065","1767523160165748738"]
// let type = 0
// 岗位
// let ids = ["1758500271264247823","1758500271264247824","1758500271264247825","1758500271264247826","1758500271264247827"]
// let type = 1
getNewsPolicyList(ids).then(res => {
uni.stopPullDownRefresh();
if (this.current === 1) {
this.policyContentList = [];
}
this.current += 1;
// this.total = res.data.data.total;
if (res.data.data && res.data.data.length) {
this.policyContentList = res.data.data;
// console.log(this.policyContentList)
}
})
},
gomap: function() {
uni.navigateTo({
url: '../mapSeach/mapSeach'
})
},
changeTab: function(e) {
this.activeTab = e;
this.init()
}
}
}
</script>
<style scoped>
page {
height: 100%;
}
.tab {
height: 46px;
}
.body {
height: 100%;
}
.probody image {
width: 88rpx;
height: 88rpx;
position: absolute;
right: 0;
top: 0;
}
.probody {
width: 100%;
position: relative;
}
.baddd {
background: #f6f6f6;
height: 20rpx;
}
.nothing {
height: 100%;
padding-top: 50%;
box-sizing: border-box;
}
.nothing image {
width: 400rpx;
height: 200rpx;
display: block;
margin: 0 auto;
}
.nothingContnt {
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #666;
margin-top: 30rpx;
text-align: center;
}
.nothing {
width: 345px;
height: 130px;
display: block;
}
.nothing_text {
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #666666;
text-align: center;
margin-bottom: 20rpx;
width: 690rpx;
}
</style>

View File

@@ -0,0 +1,159 @@
<template>
<view class="body">
<!-- <view class="tab">
<v-tabs :tabs="['全部任务','全部岗位']" v-model="activeTab" color="#999" activeColor="#000" fontSize="36rx"
activeFontSize="36rpx" @change='changeTab' />
</view> -->
<block v-for="(page, pIndex) in data" :key="pIndex">
<block v-for="(item, index) in page" :key="item.id">
<view class="probody">
<company-list :companyitem="item" :noApply="false"></company-list>
<view class="baddd"></view>
<!-- <block>
<image src="/static/img/tab.orange.svg" mode="" v-if="item.status === 1"></image>
<image src="/static/img/tab.blue.svg" mode="" v-else-if="item.status === 2"></image>
<image src="/static/img/tab.green.svg" mode="" v-else-if="item.status === 3"></image>
<image src="/static/img/tab.gray.svg" mode="" v-else></image>
</block> -->
</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>
</template>
<script>
import vTabs from '@/components/v-tabs/v-tabs.vue';
import companyList from '@/components/companyList/newTaskList.vue';
import {
tuiJianMission
} from '@/api/mission.js';
export default {
components: {
vTabs,
companyList
},
data() {
return {
data: [],
activeTab: 0,
current: 1,
size: 10,
total: 0
}
},
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()
},
getData() {
var status = Number(this.activeTab) + 1
// 任务
let ids = ["1758500271264247928","1758500271264247929","1758500271264247930","1758500271264247931","1758500271264247932","1758500271264247933"]
let type = 0
// 岗位
// let ids = ["1758500271264247823","1758500271264247824","1758500271264247825","1758500271264247826","1758500271264247827"]
// let type = 1
tuiJianMission(ids, type).then(res => {
uni.stopPullDownRefresh();
if (this.current === 1) {
this.data = [];
}
this.current += 1;
this.total = res.data.data.total;
if (res.data.data && res.data.data.length) {
this.data.push(res.data.data);
}
})
},
gomap: function() {
uni.navigateTo({
url: '../mapSeach/mapSeach'
})
},
changeTab: function(e) {
this.activeTab = e;
this.init()
}
}
}
</script>
<style scoped>
page {
height: 100%;
}
.tab {
height: 46px;
}
.body {
height: 100%;
}
.probody image {
width: 88rpx;
height: 88rpx;
position: absolute;
right: 0;
top: 0;
}
.probody {
width: 100%;
position: relative;
}
.baddd {
background: #f6f6f6;
height: 20rpx;
}
.nothing {
height: 100%;
padding-top: 50%;
box-sizing: border-box;
}
.nothing image {
width: 400rpx;
height: 200rpx;
display: block;
margin: 0 auto;
}
.nothingContnt {
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #666;
margin-top: 30rpx;
text-align: center;
}
</style>