소스 검색

重要提醒:移动端的首页新增和提示未读

“yueshang” 1 년 전
부모
커밋
12040cf92f
7개의 변경된 파일193개의 추가작업 그리고 81개의 파일을 삭제
  1. 68 61
      api/notice/index.js
  2. 20 1
      api/remind/index.js
  3. 75 17
      pages/index.vue
  4. 19 0
      pages/work/index.vue
  5. 9 1
      pagesA/fire/remind/details/details.vue
  6. 2 1
      pagesA/fire/remind/index.vue
  7. BIN
      static/appimg/impt_tip.png

+ 68 - 61
api/notice/index.js

@@ -1,61 +1,68 @@
-import request from '@/utils/request'
-// 通知公告列表首页
-// export function getNoticeList(query) {
-// 	return request({
-// 		url: '/admin-api/s9/cominfo/getself',
-// 		method: 'get',
-// 		params: query
-// 	})
-// }
-//通知公告
-export function getNoticeList(query) {
-	return request({
-		url: '/admin-api/system/notice/page',
-		method: 'get',
-		params: query
-	})
-}
-// 指令列表
-export function getNoticeLists(query) {
-	return request({
-		url: '/admin-api/s9/cominfo/getselfpage',
-		method: 'get',
-		params: query
-	})
-}
-// 设置当前用户的所有通知公告指令为已读
-export function getNoticeAllRead(query) {
-	return request({
-		url: '/admin-api/s9/cominfo/setallread',
-		method: 'post',
-		params: query
-	})
-}
-// 设置单条通知公告指令为已读
-export function getNoticeOlnyRead(query) {
-	return request({
-		url: '/admin-api/s9/cominfo/setisread',
-		method: 'post',
-		params: query
-	})
-}
-
-// 是否需要完善用户基本信息
-export function isNeedInfo(query) {
-	return request({
-		url: '/admin-api/backend/s9-user/isneedreplenish',
-		method: 'post',
-		params: query
-	})
-}
-// 指令未读的数量
-export function getNoticeReadData(query) {
-	return request({
-		url: '/admin-api/s9/cominfo/getunread',
-		method: 'post',
-		header: {
-			'content-type': 'application/x-www-form-urlencoded'
-		},
-		params: query
-	})
-}
+import request from '@/utils/request'
+// 通知公告列表首页
+// export function getNoticeList(query) {
+// 	return request({
+// 		url: '/admin-api/s9/cominfo/getself',
+// 		method: 'get',
+// 		params: query
+// 	})
+// }
+//通知公告
+export function getNoticeList(query) {
+	return request({
+		url: '/admin-api/system/notice/page',
+		method: 'get',
+		params: query
+	})
+}
+// 指令列表
+export function getNoticeLists(query) {
+	return request({
+		url: '/admin-api/s9/cominfo/getselfpage',
+		method: 'get',
+		params: query
+	})
+}
+// 设置当前用户的所有通知公告指令为已读
+export function getNoticeAllRead(query) {
+	return request({
+		url: '/admin-api/s9/cominfo/setallread',
+		method: 'post',
+		params: query
+	})
+}
+// 设置单条通知公告指令为已读
+export function getNoticeOlnyRead(query) {
+	return request({
+		url: '/admin-api/s9/cominfo/setisread',
+		method: 'post',
+		params: query
+	})
+}
+
+// 是否需要完善用户基本信息
+export function isNeedInfo(query) {
+	return request({
+		url: '/admin-api/backend/s9-user/isneedreplenish',
+		method: 'post',
+		params: query
+	})
+}
+// 指令未读的数量
+export function getNoticeReadData(query) {
+	return request({
+		url: '/admin-api/s9/cominfo/getunread',
+		method: 'post',
+		header: {
+			'content-type': 'application/x-www-form-urlencoded'
+		},
+		params: query
+	})
+}
+export function getRemindLists(query) {
+	return request({
+		url: '/admin-api/backend/remind-broad/page',
+		method: 'get',
+		params: query
+	})
+}

+ 20 - 1
api/remind/index.js

@@ -32,4 +32,23 @@ export function remindBroadFinish(data) {
     method: 'post',
     data: data
   })
-}
+}
+// 指令未读的数量
+export function getRemindReadData(query) {
+	return request({
+		url: '/admin-api/backend/remind-broad/unread',
+		method: 'get',
+		header: {
+			'content-type': 'application/x-www-form-urlencoded'
+		},
+		params: query
+	})
+}
+// 设置单条重要提醒为已读
+export function getRemindOlnyRead(query) {
+	return request({
+		url: '/admin-api/backend/remind-broad/setisread',
+		method: 'post',
+		params: query
+	})
+}

+ 75 - 17
pages/index.vue

@@ -6,7 +6,7 @@
 			<image slot="right" :src="`${urls}/navBg@2x.png`" class="bgTopImg"></image>
 		</view> -->
 		<view class="container  uni-container"
-			style="display:flex;flex-direction: column;justify-content: space-between;height: 100%;">
+			style="display:flex;flex-direction: column;justify-content: space-around;height: 100%;">
 			<view class="nav">
 				<!-- 	<u-scroll-list indicatorColor="#fff0f0" indicatorActiveColor="#f56c6c" >
 				<view class="scroll-list" style="flex-direction: row;">
@@ -28,7 +28,7 @@
 					</u-grid>
 					<u-grid :border="false" col="3" v-else>
 						<u-grid-item v-for="(item, listIndex) in goodsStreet" :key="listIndex">
-							<image @click="handleToInfo(item.menuUrl)" class="scroll-list__goods-item__image  "
+							<image @click="handleToInfo(item.menuUrl)" class="scroll-list__goods-item__image"
 								:src="item.thumbnail" mode=""></image>
 							<text class="grid-text">{{ item.name }}</text>
 						</u-grid-item>
@@ -105,6 +105,24 @@
 						<view v-else>暂无通知</view>
 					</view>
 				</view>
+				
+				<view  v-if="remindData.length !=0">
+					<view class=""  v-for="(item,index) in remindData" :key="index">
+						<view class="back-image" v-if="isStreet"  @click.nativite="onRemindClick(item)">
+							<image :src="laba" class="back-notice"></image>
+							<view style="display: flex;padding-top: 40rpx;cursor: pointer;">
+								<image :src="gonggao" class="back-size-tips"></image>
+								<view>
+									<view >
+										{{ item.remind_title }}
+									</view>
+								</view>
+							
+							</view>
+						</view>
+					</view>
+				</view>
+				<view v-else>暂无重要提醒</view>
 				<!-- <view class="back-image back-image2">
 					<image :src="laba" class="back-notice"></image>
 					<view style="display: flex;padding-top: 40rpx;">
@@ -116,13 +134,14 @@
 					</view>
 				</view> -->
 			</view>
-			<view class=""  v-if="!isStreet">
+			<view class="" v-if="!isStreet">
 				<u-cell-group :border="false">
 					<u-cell :border="false" :boritemder="false" isLink rightIconStyle="color:#4CB2B6;font-size: 24rpx;">
 						<view slot="title" class="u-slot-title">
 							<text class="u-cell-text">待办任务</text>
 						</view>
-						<text slot="value" style="font-size: 28rpx;color: #4CB2B6;cursor: pointer;" @click="goInformDetails">更多</text>
+						<text slot="value" style="font-size: 28rpx;color: #4CB2B6;cursor: pointer;"
+							@click="goInformDetails">更多</text>
 					</u-cell>
 				</u-cell-group>
 				<uni-card v-if="tableDatas.length>0">
@@ -203,14 +222,17 @@
 		getNoticeList,
 		getNoticeAllRead,
 		getNoticeOlnyRead,
-		isNeedInfo
+		isNeedInfo,
+		getRemindLists
 	} from '@/api/notice'; // 通知公告列表
+	import {getRemindOlnyRead} from '@/api/remind'
 	import {
 		checkGetPerson, //单位转发任务获取人员
 		taskList, //获取除草稿箱以外的列表  //获取当前日期的任务列表
 		checkSubmitForwardTask, //确认转发任务
 	} from "@/api/check_active";
 	import storage from '@/utils/storage';
+	// import gonggao from '@/static/appimg/impt_tip.png'
 	let that = null;
 	import config from '@/config'
 	const baseUrlImg = config.baseUrlImg
@@ -219,7 +241,7 @@
 			return {
 				urls: baseUrlImg,
 				bgImg: `${baseUrlImg}/navBg@2x.png`,
-				isStreet:null,//判断是否是街道人员
+				isStreet: null, //判断是否是街道人员
 				opts: {
 					legend: {
 						show: false
@@ -261,7 +283,8 @@
 
 				chartsDataLine3: {},
 				tongzhi: `${baseUrlImg}/tongzhi.png`,
-				gonggao: `${baseUrlImg}/gonggao.png`,
+				gonggao: `${baseUrlImg}/impt_tip.png`,
+				gonggao: gonggao,
 				laba: `${baseUrlImg}/laba.png`,
 				//import biankuang from '@/static/images/biankuang.png'
 				LoadingModel: false,
@@ -312,6 +335,7 @@
 				zhuanfa: `${baseUrlImg}/zhuanfa.png`,
 				// 通知公告数据
 				tableData: [],
+				remindData:[],
 				// tableData数据加载中
 				loading: false,
 				// echarts数据
@@ -364,21 +388,22 @@
 			const date = new Date()
 			this.formData.receivDate = uni.$u.timeFormat(date, 'yyyy-mm-dd')
 			this.getDatas()
-			this.getData()
+			this.getData();
+			this.getRemind();
 			const deptId = uni.getStorageSync('getUserInfo_key').streetInfo ? uni.getStorageSync('getUserInfo_key')
 				.streetInfo
 				.id : ''; //登录用户
 			if (deptId != '') {
-					this.isStreetPerson = true
-					this.$forceUpdate()
-				}else{
-					this.isStreetPerson = false
-				}
+				this.isStreetPerson = true
+				this.$forceUpdate()
+			} else {
+				this.isStreetPerson = false
+			}
 		},
 		onLoad: function(option) {
 
-				that = this;
-			
+			that = this;
+
 			// // 判断用户信息是否需要完善
 			// const value = uni.getStorageSync('getUserInfo_key');
 			// if (
@@ -426,6 +451,18 @@
 
 
 			},
+		getRemind(){
+			getRemindLists().then(res=>{
+				if(!res.data.records) return;
+				if( res.data.records.length>3){
+					this.remindData = res.data.records.slice(0,3);
+				}else{
+					this.remindData = res.data.records;
+				}
+		
+				
+			})
+		},
 			// 获取数据
 			getData() {
 				this.$modal.isLoadingModel(true);
@@ -439,9 +476,9 @@
 					// this.tableData = response.data ?? [...this.tableData, ...response.data.list];
 					if (this.tableData && response.data?.list.length > 0) {
 						this.arrtongzhi = response.data.list.filter(i => i.type == 1);
-						this.arrgonggao =response.data.list.filter(i => i.type == 2);
+						this.arrgonggao = response.data.list.filter(i => i.type == 2);
 					}
-					
+
 					// this.checkactiveGetEchart();
 				});
 			},
@@ -483,6 +520,16 @@
 					}
 				});
 			},
+			onRemindClick(val){
+
+				uni.navigateTo({
+					url: `/pagesA/fire/remind/details/details?id=${val.broad_id}`,
+					success: function(res) {
+						// 通过eventChannel向被打开页面传送数据
+						res.eventChannel.emit('acceptDataFromOpenerPage', val);
+					}
+				});
+			},
 			// 根据不同的url,进行页面的跳转
 			handleToInfo(url) {
 				this.$tab.navigateTo(url);
@@ -754,11 +801,22 @@
 		margin: 0 20rpx 0 60rpx;
 	}
 
+	.back-size {
+		width: 30px;
+		height: 21px;
+	}
+
 	.back-sizes {
 		width: 32rpx;
 		height: 32rpx;
 	}
 
+	.back-size-tips {
+		width: 59px;
+		height: 21px;
+		margin: 0 20rpx 0 60rpx;
+	}
+
 	.back-notice {
 		position: absolute;
 		top: 0;

+ 19 - 0
pages/work/index.vue

@@ -15,6 +15,8 @@
 									<text class="text">{{ item.menuName }}</text>
 									<u-badge v-if="item.menuName == '指令'&&unread != 0" :value="unread" type="error"
 										class="huibiao"></u-badge>
+										<u-badge v-if="item.menuName == '重要提醒'&&unreadTips != 0" :value="unreadTips" type="error"
+											class="huibiao"></u-badge>
 								</view>
 							</view>
 						</uni-grid-item>
@@ -29,6 +31,8 @@
 									<text class="text">{{ item.menuName }}</text>
 									<u-badge v-if="item.menuName == '指令'&&unread != 0" :value="unread" type="error"
 										class="huibiao"></u-badge>
+										<u-badge v-if="item.menuName == '重要提醒'&&unreadTips != 0" :value="unreadTips" type="error"
+											class="huibiao"></u-badge>
 								</view>
 							</view>
 						</uni-grid-item>
@@ -44,6 +48,8 @@
 									<text class="text">{{ item.menuName }}</text>
 									<u-badge v-if="item.menuName == '指令'&&unread != 0" :value="unread" type="error"
 										class="huibiao"></u-badge>
+										<u-badge v-if="item.menuName == '重要提醒'&&unread != 0" :value="unread" type="error"
+											class="huibiao"></u-badge>
 								</view>
 							</view>
 						</uni-grid-item>
@@ -59,6 +65,10 @@
 		getNoticeList, // 通知公告列表
 		getNoticeReadData //指令未读的数量
 	} from '@/api/notice';
+
+	import {
+		getRemindReadData  //重要通知未读的数量
+	} from "@/api/remind";
 	import {
 		getMenusByUser
 	} from '@/api/login';
@@ -103,6 +113,7 @@
 				urlList: [],
 				urlList1: [],
 				unread: 0, //未读数量
+				unreadTips:0,//重要提醒未读数量
 				urlList2: []
 			};
 		},
@@ -117,6 +128,7 @@
 			const intervalId = setInterval(() => {
 				if (this.$store.state.user && this.$store.state.user.id) {
 					this.getData();
+					this.getRemind();
 					this.getMenu();
 					clearInterval(intervalId); // 中止循环
 				}
@@ -136,6 +148,13 @@
 					this.unread = response.data
 				})
 			},
+			getRemind() {
+				getRemindReadData({
+					userId: this.$store.state.user.id
+				}).then(response => {
+					this.unreadTips = response.data
+				})
+			},
 			getMenu() {
 				getMenusByUser({
 					id: this.$store.state.user.id

+ 9 - 1
pagesA/fire/remind/details/details.vue

@@ -86,7 +86,8 @@
 <script>
 	let that = null
 	import {
-		getRemindBroadDetail
+		getRemindBroadDetail,
+		getRemindOlnyRead
 	} from "@/api/remind";
 	import config from '@/config'
 	import {
@@ -144,6 +145,13 @@
 			// 获取数据
 			getDatas(id) {
 				this.loading = true
+				getRemindOlnyRead({
+					broadIds: id
+				}).then(response => {
+					if (response.data == true) {
+						this.getData();
+					}
+				});
 				getRemindBroadDetail(this.broadId).then(response => {
 					console.log(response);
 					// 为数据赋值:通过展开运算符的形式,进行新旧数据的拼接 

+ 2 - 1
pagesA/fire/remind/index.vue

@@ -93,7 +93,8 @@
 	import {
 		getRemindBroadPage,// 重要通知列表 
 		setisread,//是否已阅
-		remindBroadFinish
+		remindBroadFinish,
+		getRemindOlnyRead
 	} from "@/api/remind";
 	import {
 		uploadFileComp

BIN
static/appimg/impt_tip.png