添加通知

dev
xiepeng 2024-04-01 18:56:06 +08:00
parent a2f671f125
commit d8b2081e39
4 changed files with 339 additions and 4 deletions

View File

@ -316,6 +316,10 @@
"path": "pages/news/news-list-detail",
"style": {}
},
{
"path": "pages/news/notice-list-detail",
"style": {}
},
{
"path": "pages/application/other-apps/videos/videos",
"style": {}

View File

@ -73,6 +73,35 @@
<view class="cu-tabbar-height"></view>
</scroll-view>
</block>
<block v-if="TabCur==2">
<scroll-view class="dy-scroll-nobg" scroll-y :style="'top:'+sTop+'px;height:calc(100vh - '+totalHeight+'px)'">
<view v-if="txlist.length>0" >
<view class="news-list">
<view class="news-item" v-for="item in txlist" :key="item.NOTICECORP_ID" @click="$noMultipleClicks(goToPcDetail,item.NOTICECORP_ID)">
<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>
</view>
</template>
@ -89,10 +118,11 @@
totalHeight:0,
TabCur: 0,
scrollLeft: 0,
tabNav: ['平台公告', '企业公告'],
tabNav: ['平台公告', '企业公告', '业务提醒'],
noClick:true,
list: [],
pclist: [],
txlist: [],
page:1,//--
rows:10,//--
totalCount:0,//--
@ -134,6 +164,11 @@
_this.getPcData();//
}
}
if ("2"==_this.TabCur){
if(_this.totalPage >= _this.currentPage){
_this.getTxData();//
}
}
},
onReady() {
@ -143,6 +178,9 @@
tabSelect(e) {
this.TabCur = e.currentTarget.dataset.id;
this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
if("2" ==this.TabCur){
this.getTxData();
}
if("1" ==this.TabCur){
this.getPcData();
}
@ -215,6 +253,39 @@
}
});
},
getTxData() {
var _this = this;
uni.showLoading({
title: '请稍候'
})
uni.request({
url: basePath + '/app/notice/listForCp',
method: 'POST',
dataType: 'json',
header: {
'Content-type':'application/x-www-form-urlencoded'
},
data: {
showCount : _this.showCount,
currentPage : _this.currentPage,
loginUserId :loginUserId,
CORPINFO_ID:loginUser.CORPINFO_ID,
USER_ID:loginUser.USER_ID,
},
success: (res) => {
if("success" == res.data.result){
uni.hideLoading();
_this.pclist = res.data.varList;
} else {
uni.showToast({
title: res.data.message,
duration: 2000
});
}
}
});
},
//
goToDetail(e) {
uni.navigateTo({

View File

@ -41,7 +41,7 @@
<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">
<view class="news-item" v-for="item in pclist" :key="item.NOTIFICATION_ID" @click="$noMultipleClicks(goToPcDetail, item.NOTIFICATION_ID)">
<view class="news-item" v-for="item in list" :key="item.NOTIFICATION_ID" @click="$noMultipleClicks(goToPcDetail, item.NOTIFICATION_ID)">
<view class="news-media-list">
<view class="news-media-body">
<view class="news-media-title">
@ -109,6 +109,42 @@
<view class="cu-tabbar-height"></view>
</scroll-view>
</block>
<block v-if="TabCur==2">
<scroll-view class="dy-scroll-nobg" scroll-y :style="'top:'+sTop+'px;height:calc(100vh - '+totalHeight+'px)'">
<view v-if="txlist.length>0" >
<view class="news-list">
<view class="news-item" v-for="item in txlist" :key="item.NOTICECORP_ID" >
<view class="news-media-list">
<view class="news-media-body">
<view class="news-media-title" @click="$noMultipleClicks(goToTxDetail,item.NOTICECORPUSERID_ID)">
{{item.SYNOPSIS}}
<text style="float:right;">
<template v-if="item.TYPE=='0'"></template>
<template v-else-if="item.TYPE=='1'">已读</template>
</text>
</view>
<view class="news-media-text">
<text>{{item.CREATTIME}}</text>
<view v-if="item.TYPE=='1'" style="float:right;">
<button class="cu-btn round bg-red" style="height:40upx;" @click="deleteNoticeTx(item.NOTICECORPUSERID_ID)"></button>
</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>
@ -125,11 +161,12 @@
totalHeight:0,
TabCur: 0,
scrollLeft: 0,
tabNav: ['平台公告', '企业公告'],
tabNav: ['平台公告', '企业公告', '业务提醒'],
noClick:true,
KEYWORDS:'',
list: [],
pclist: [],
txlist: [],
page:1,//--
rows:10,//--
totalCount:0,//--
@ -171,6 +208,11 @@
_this.getPcData();//
}
}
if ("2"==_this.TabCur){
if(_this.totalPage >= _this.currentPage){
_this.getTxData();//
}
}
},
onReady() {
},
@ -178,6 +220,9 @@
tabSelect(e) {
this.TabCur = e.currentTarget.dataset.id;
this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
if("2" ==this.TabCur){
this.getTxData();
}
if("1" ==this.TabCur){
this.getPcData();
}
@ -262,17 +307,99 @@
}
});
},
getTxData() {
var _this = this;
uni.showLoading({
title: '请稍候'
})
uni.request({
url: basePath + '/app/notice/listForCp',
method: 'POST',
dataType: 'json',
header: {
'Content-type':'application/x-www-form-urlencoded'
},
data: {
showCount : _this.showCount,
currentPage : _this.currentPage,
loginUserId :loginUserId,
CORPINFO_ID:loginUser.CORPINFO_ID,
USER_ID:loginUser.USER_ID,
},
success: (res) => {
if("success" == res.data.result){
uni.hideLoading();
_this.txlist = 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',
url: '/pages/news/notice-list-detail?id='+e+'&type=0',
});
},
goToTxDetail(e){
uni.navigateTo({
url: '/pages/news/notice-list-detail?id='+e+'&type=1',
});
},
goToPcDetail(e){
uni.navigateTo({
url: '/pages/news/news-list-detail?id='+e+'&type=1',
});
},
deleteNoticeTx(ID){
var _this = this;
uni.showModal({
title: '',
content: '确定要删除这条记录?',
cancelColor:"#000000",
cancelText: '取消',
confirmText: '确定',
success: res => {
if (res.confirm) {
uni.showLoading({
title: '处理中'
})
uni.request({
url: basePath+'/app/notice/delete',
method: 'POST',
dataType: 'json',
header: {
'Content-type':'application/x-www-form-urlencoded'
},
data: {
NOTICECORPUSERID_ID: ID
},
success: (res) => {
uni.hideLoading();
uni.showToast({
icon: 'none',
title: '删除成功',
duration: 1500
});
_this.getQuery()
},
fail: (err) => {
uni.hideLoading();
uni.showModal({
content: err.errMsg,
showCancel: false
});
}
})
}
}
})
},
deleteNotice(ID){
var _this = this;
uni.showModal({

View File

@ -0,0 +1,133 @@
<template>
<view>
<cu-custom bgColor="bg-gradual-blueness" :isBack="true">
<block slot="backText">返回</block>
<block slot="content">通知详情</block>
</cu-custom>
<scroll-view scroll-y>
<view class="message-warp">
<view class="title">
{{pd.SYNOPSIS}}
</view>
<view class="info">
<!-- <text>双控平台</text>-->
<text>{{pd.CREATTIME}}</text>
</view>
<view class="content">
<rich-text :nodes="content"></rich-text>
</view>
<view class="message-warp" v-if="pd.FILEPATH">
<view class="cu-item" @click="$noMultipleClicks(goStuToOpen,pd.FILEPATH)">
<view class="content">
<text class="cuIcon-read text-blue"></text>
<text class="text-grey">附件</text>
</view>
</view>
</view>
</view>
<view class="cu-tabbar-height"></view>
</scroll-view>
</view>
</template>
<script>
import {
basePath,loginUserId,corpinfoId,loginUser,baseImgPath
} from '@/common/tool.js';
import HTMLParser from "@/components/html-parser.js"
export default {
data() {
return {
id:'',
content:'',
pd:[],
type:'',
noClick:true,
}
},
onLoad(e){
this.type =e.type;
this.id=e.id;
this.getData();
console.log(e)
},
methods: {
getData() {
var _this = this;
uni.showLoading({
title: '请稍候'
})
var url = basePath + '/app/notice/goEdit'
if("1"==_this.type){
url = basePath + '/app/notice/goEditForPc'
}
console.log(_this.id)
uni.request({
url:url,
method: 'POST',
dataType: 'json',
header: {
'Content-type':'application/x-www-form-urlencoded'
},
data: {
NOTICECORPUSERID_ID:_this.id,
loginUserId:loginUserId,
corpinfoId:corpinfoId,
ISMAIN:loginUser.ISMAIN,
CORPINFO_ID:loginUser.CORPINFO_ID,
USER_ID:loginUser.USER_ID,
},
success: (res) => {
if("success" == res.data.result){
uni.hideLoading();
_this.pd = res.data.pd;
_this.content= new HTMLParser(res.data.pd.CONTENT.trim());
var pages = getCurrentPages(); //
var prePage = pages[pages.length - 2]; //
prePage.$vm.initflag = true; // A init true
} else {
uni.showToast({
title: res.data.message,
duration: 2000
});
}
}
});
},
goStuToOpen(e) {
var url=baseImgPath + e ;
var url2 = encodeURI(url);
plus.runtime.openURL(url2, function(res) {
});
},
}
}
</script>
<style>
.message-warp{
background-color: #fff;
padding: 30upx;
}
.message-warp .title {
font-size: 34upx;
margin-bottom: 20upx;
}
.info {
display: flex;
justify-content: space-between;
color: #888;
font-size: 24upx;
margin-bottom: 20upx;
}
.content {
padding: 0upx;
line-height: 1.6;
}
.content img{
width: 100%;
height: auto;
}
</style>