2024-01-16 17:24:49 +08:00
|
|
|
|
<template>
|
|
|
|
|
<view>
|
|
|
|
|
<cu-custom bgColor="bg-gradual-blueness">
|
|
|
|
|
<block slot="content">通知公告</block>
|
|
|
|
|
</cu-custom>
|
|
|
|
|
<view class="top-fixed">
|
|
|
|
|
<scroll-view scroll-x class="bg-white nav" scroll-with-animation :scroll-left="scrollLeft">
|
|
|
|
|
<view class="flex text-center">
|
|
|
|
|
<view class="cu-item flex-sub" :class="index==TabCur?'text-blue cur':''" v-for="(item,index) in tabNav" :key="index" @tap="tabSelect" :data-id="index">
|
|
|
|
|
{{tabNav[index]}}
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</scroll-view>
|
|
|
|
|
<view class="cu-bar search bg-white">
|
|
|
|
|
<view class="search-form radius">
|
|
|
|
|
<text class="cuIcon-search"></text>
|
|
|
|
|
<input v-model="KEYWORDS" placeholder="请输入关键字"></input>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="action">
|
|
|
|
|
<button class="cu-btn bg-green shadow-blur radius" @click="getQuery()">搜索</button>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="line"></view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<block v-if="TabCur==0">
|
|
|
|
|
<view class="select-fixed top-fixed">
|
|
|
|
|
<view class="cu-bar search bg-white">
|
|
|
|
|
<view class="search-form radius" style="margin-left: 0;">
|
|
|
|
|
<text class="cuIcon-search"></text>
|
|
|
|
|
<input @input="InputBlur" placeholder="请输入关键字"
|
|
|
|
|
confirm-type="search"></input>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
<view class="action">
|
|
|
|
|
<button class="cu-btn bg-green shadow-blur radius" @click="getQuery">搜索</button>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="line"></view>
|
|
|
|
|
</view>
|
|
|
|
|
<scroll-view class="dy-scroll-nobg" scroll-y :style="'top:'+sTop+'px;height:calc(100vh - '+totalHeight+'px)'">
|
|
|
|
|
<view v-if="list.length>0" >
|
|
|
|
|
<view class="news-list">
|
2024-02-28 19:33:03 +08:00
|
|
|
|
<view class="news-item" v-for="item in pclist" :key="item.NOTIFICATION_ID" @click="$noMultipleClicks(goToPcDetail, item.NOTIFICATION_ID)">
|
2024-01-16 17:24:49 +08:00
|
|
|
|
<view class="news-media-list">
|
|
|
|
|
<view class="news-media-body">
|
|
|
|
|
<view class="news-media-title">
|
|
|
|
|
{{item.SYNOPSIS}}
|
|
|
|
|
</view>
|
|
|
|
|
<view class="news-media-text">
|
|
|
|
|
<text>{{item.CREATTIME}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-else-if="dataFlag=='noData'" class="dy-null">
|
|
|
|
|
<view class="dy-null-img">
|
|
|
|
|
<image src="../../static/null.png" mode=""></image>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="dy-null-title">
|
|
|
|
|
暂无数据
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="cu-tabbar-height"></view>
|
|
|
|
|
</scroll-view>
|
|
|
|
|
</block>
|
|
|
|
|
<block v-if="TabCur==1">
|
|
|
|
|
<scroll-view class="dy-scroll-nobg" scroll-y :style="'top:'+sTop+'px;height:calc(100vh - '+totalHeight+'px)'">
|
|
|
|
|
<view v-if="pclist.length>0" >
|
|
|
|
|
<view class="news-list">
|
|
|
|
|
<view class="news-item" v-for="item in pclist" :key="item.NOTICECORP_ID" >
|
|
|
|
|
<view class="news-media-list">
|
|
|
|
|
<view class="news-media-body">
|
2024-03-30 16:03:50 +08:00
|
|
|
|
<view @click="$noMultipleClicks(goToPcDetail,item.NOTIFICATION_ID)">
|
|
|
|
|
<view class="dy-title-flex">
|
|
|
|
|
<text>通知标题:</text>
|
|
|
|
|
<text class="bg-red light cu-tag radius">{{item.LEVEL}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view>
|
|
|
|
|
<text>{{item.TITLE}}</text>
|
|
|
|
|
<text class="bg-red light cu-tag bg-green radius" style="float:right; height:40upx;">
|
|
|
|
|
<template v-if="item.TYPE=='0'">未读</template>
|
|
|
|
|
<template v-else-if="item.TYPE=='1'">已读</template>
|
|
|
|
|
</text>
|
|
|
|
|
</view>
|
|
|
|
|
|
2024-01-16 17:24:49 +08:00
|
|
|
|
</view>
|
|
|
|
|
<view class="news-media-text">
|
2024-02-28 19:33:03 +08:00
|
|
|
|
<text>{{item.CREATETIME}}</text>
|
2024-01-16 17:24:49 +08:00
|
|
|
|
<view v-if="item.TYPE=='1'" style="float:right;">
|
2024-02-28 19:33:03 +08:00
|
|
|
|
<button class="cu-btn round bg-red" style="height:40upx;" @click="deleteNotice(item.NOTIFICATION_ID)">删除</button>
|
2024-01-16 17:24:49 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-else-if="dataFlag=='noData'" class="dy-null">
|
|
|
|
|
<view class="dy-null-img">
|
|
|
|
|
<image src="../../static/null.png" mode=""></image>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="dy-null-title">
|
|
|
|
|
暂无数据
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="cu-tabbar-height"></view>
|
|
|
|
|
</scroll-view>
|
|
|
|
|
</block>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
basePath,corpinfoId,loginUserId,loginUser
|
|
|
|
|
} from '@/common/tool.js';
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
dataFlag:'noData',
|
|
|
|
|
background:{"url":""},
|
|
|
|
|
sTop:0,
|
|
|
|
|
totalHeight:0,
|
|
|
|
|
TabCur: 0,
|
|
|
|
|
scrollLeft: 0,
|
|
|
|
|
tabNav: ['平台公告', '企业公告'],
|
|
|
|
|
noClick:true,
|
2024-03-22 17:16:00 +08:00
|
|
|
|
KEYWORDS:'',
|
2024-01-16 17:24:49 +08:00
|
|
|
|
list: [],
|
|
|
|
|
pclist: [],
|
|
|
|
|
page:1,//分页参数--页数
|
|
|
|
|
rows:10,//分页参数--每页数据条数
|
|
|
|
|
totalCount:0,//分页参数--初始化页数
|
|
|
|
|
isEnd:false,//防止多次刷新
|
|
|
|
|
totalPage:0,//分页参数--分页数量
|
|
|
|
|
showCount :-1,
|
|
|
|
|
currentPage:1,
|
|
|
|
|
tabCur :0,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted(e){
|
|
|
|
|
|
|
|
|
|
this.getData();
|
|
|
|
|
let that=this;
|
|
|
|
|
let CustomBar = this.CustomBar;
|
|
|
|
|
uni.getSystemInfo({ //调用uni-app接口获取屏幕高度
|
|
|
|
|
success(res) { //成功回调函数
|
|
|
|
|
let titleH=uni.createSelectorQuery().select(".top-fixed"); //想要获取高度的元素名(class/id)
|
|
|
|
|
titleH.boundingClientRect(data=>{
|
|
|
|
|
that._data.sTop=data.height //计算高度:元素高度=窗口高度-元素距离顶部的距离(data.top)
|
|
|
|
|
that.totalHeight = data.height+CustomBar
|
|
|
|
|
}).exec()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 滑动到底方法
|
|
|
|
|
scrolltolower(){
|
|
|
|
|
var _this = this;
|
|
|
|
|
_this.showCount = -1;
|
|
|
|
|
_this.currentPage = _this.currentPage + 1;
|
|
|
|
|
_this.isEnd = false;
|
|
|
|
|
if("0"==_this.TabCur ){
|
|
|
|
|
if(_this.totalPage >= _this.currentPage){
|
|
|
|
|
_this.getDate();//开始分页查询
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ("1"==_this.TabCur){
|
|
|
|
|
if(_this.totalPage >= _this.currentPage){
|
|
|
|
|
_this.getPcData();//开始分页查询
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onReady() {
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
tabSelect(e) {
|
|
|
|
|
this.TabCur = e.currentTarget.dataset.id;
|
|
|
|
|
this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
|
|
|
|
|
if("1" ==this.TabCur){
|
|
|
|
|
this.getPcData();
|
|
|
|
|
}
|
|
|
|
|
if("0" == this.TabCur){
|
|
|
|
|
this.getData();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
getQuery() { //搜索按钮事件
|
|
|
|
|
var _this = this;
|
|
|
|
|
if(_this.TabCur == 0){
|
|
|
|
|
_this.getData();
|
|
|
|
|
}else{
|
|
|
|
|
_this.getPcData();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
getData() {
|
|
|
|
|
var _this = this;
|
|
|
|
|
uni.showLoading({
|
|
|
|
|
title: '请稍候'
|
|
|
|
|
})
|
|
|
|
|
uni.request({
|
|
|
|
|
url: basePath + '/app/notice/list',
|
|
|
|
|
method: 'POST',
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
header: {
|
|
|
|
|
'Content-type':'application/x-www-form-urlencoded'
|
|
|
|
|
},
|
|
|
|
|
data: {
|
|
|
|
|
showCount : _this.showCount,
|
|
|
|
|
currentPage : _this.currentPage,
|
2024-03-22 17:16:00 +08:00
|
|
|
|
KEYWORDS:_this.KEYWORDS,
|
2024-01-16 17:24:49 +08:00
|
|
|
|
corpinfoId :corpinfoId,
|
|
|
|
|
CORPINFO_ID:loginUser.CORPINFO_ID,
|
|
|
|
|
USER_ID:loginUser.USER_ID,
|
|
|
|
|
},
|
|
|
|
|
success: (res) => {
|
|
|
|
|
if("success" == res.data.result){
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
_this.list = res.data.varList;
|
|
|
|
|
console.log(res.data.varList)
|
|
|
|
|
} else {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: res.data.message,
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getPcData() {
|
|
|
|
|
var _this = this;
|
|
|
|
|
uni.showLoading({
|
|
|
|
|
title: '请稍候'
|
|
|
|
|
})
|
|
|
|
|
uni.request({
|
2024-02-28 19:33:03 +08:00
|
|
|
|
url: basePath + '/app/trafficNotice/listForCp',
|
2024-01-16 17:24:49 +08:00
|
|
|
|
method: 'POST',
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
header: {
|
|
|
|
|
'Content-type':'application/x-www-form-urlencoded'
|
|
|
|
|
},
|
|
|
|
|
data: {
|
|
|
|
|
showCount : _this.showCount,
|
|
|
|
|
currentPage : _this.currentPage,
|
2024-02-28 19:33:03 +08:00
|
|
|
|
KEYWORDS:_this.KEYWORDS,
|
2024-01-16 17:24:49 +08:00
|
|
|
|
loginUserId :loginUserId,
|
2024-03-22 17:16:00 +08:00
|
|
|
|
// CORPINFO_ID:loginUser.CORPINFO_ID,
|
2024-01-16 17:24:49 +08:00
|
|
|
|
USER_ID:loginUser.USER_ID,
|
|
|
|
|
},
|
|
|
|
|
success: (res) => {
|
|
|
|
|
if("success" == res.data.result){
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
_this.pclist = res.data.varList;
|
|
|
|
|
console.log(res.data.varList)
|
|
|
|
|
} else {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: res.data.message,
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//跳转事件
|
|
|
|
|
goToDetail(e) {
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: '/pages/news/news-list-detail?id='+e+'&type=0',
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
goToPcDetail(e){
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: '/pages/news/news-list-detail?id='+e+'&type=1',
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
deleteNotice(ID){
|
|
|
|
|
var _this = this;
|
|
|
|
|
uni.showModal({
|
|
|
|
|
title: '',
|
|
|
|
|
content: '确定要删除这条记录?',
|
|
|
|
|
cancelColor:"#000000",
|
|
|
|
|
cancelText: '取消',
|
|
|
|
|
confirmText: '确定',
|
|
|
|
|
success: res => {
|
|
|
|
|
if (res.confirm) {
|
|
|
|
|
uni.showLoading({
|
|
|
|
|
title: '处理中'
|
|
|
|
|
})
|
|
|
|
|
uni.request({
|
2024-02-28 19:33:03 +08:00
|
|
|
|
url: basePath+'/app/trafficNotice/delete',
|
2024-01-16 17:24:49 +08:00
|
|
|
|
method: 'POST',
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
header: {
|
|
|
|
|
'Content-type':'application/x-www-form-urlencoded'
|
|
|
|
|
},
|
|
|
|
|
data: {
|
2024-02-28 19:33:03 +08:00
|
|
|
|
NOTIFICATION_ID: ID
|
2024-01-16 17:24:49 +08:00
|
|
|
|
},
|
|
|
|
|
success: (res) => {
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: '删除成功',
|
|
|
|
|
duration: 1500
|
|
|
|
|
});
|
|
|
|
|
_this.getQuery()
|
|
|
|
|
},
|
|
|
|
|
fail: (err) => {
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
uni.showModal({
|
|
|
|
|
content: err.errMsg,
|
|
|
|
|
showCancel: false
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
.news-list {
|
|
|
|
|
background-color: #FFFFFF;
|
|
|
|
|
position: relative;
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.news-item {
|
|
|
|
|
display: flex;
|
|
|
|
|
position: relative;
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.news-media-list {
|
|
|
|
|
padding: 11px 15px;
|
|
|
|
|
display: flex;
|
|
|
|
|
width: 100%;
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.news-media-logo {
|
|
|
|
|
width: 90px;
|
|
|
|
|
height: 70px;
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.news-media-body {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.news-media-title {
|
|
|
|
|
height: 37px;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
width: 100%;
|
|
|
|
|
line-height: 18px;
|
|
|
|
|
display: -webkit-box;
|
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
|
-webkit-line-clamp: 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.news-item::after {
|
|
|
|
|
position: absolute;
|
|
|
|
|
z-index: 3;
|
|
|
|
|
right: 0;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
left: 15px;
|
|
|
|
|
height: 1px;
|
|
|
|
|
content: '';
|
|
|
|
|
-webkit-transform: scaleY(.5);
|
|
|
|
|
transform: scaleY(.5);
|
|
|
|
|
background-color: #c8c7cc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.news-media-text {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
width: 100%;
|
|
|
|
|
line-height: 15px;
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
color: #8f8f94;
|
|
|
|
|
}
|
|
|
|
|
</style>
|