소스 검색

消息接口对接,filter调整

gcz 3 년 전
부모
커밋
317f189842

+ 8 - 0
common/apiurl.js

@@ -41,6 +41,14 @@ const apiurl = {
 	findParkDeviceByIdUrl:'/roadspace/findParkDeviceById',
 	//道闸设备详细信息
 	controlDeviceUrl:'/roadspace/roadway/control',
+	//通知消息列表
+	inspecmsgUrl:'/inspecmsg',
+	//查看通知消息详情
+	inspecmsgDetailsUrl:'/inspecmsg/findById',
+	//修改通知为已读
+	updateInspecMsgStatusUrl:'/inspecmsg/updateInspecMsgStatus',
+	//查询未读通知数
+	getUnreadMsgTotalUrl:'/inspecmsg/selectNoRedNum',
 }
 
 export {

+ 9 - 1
common/http.api.js

@@ -26,6 +26,10 @@ const install = (Vue, vm) => {
 	let selectParkNum = (params = {}) => vm.$u.get(apiurl.selectParkNumUrl,params);
 	let findParkDeviceById = (params = {}) => vm.$u.get(apiurl.findParkDeviceByIdUrl,params);
 	let controlDevice = (params = {}) => vm.$u.post(apiurl.controlDeviceUrl, params);
+	let inspecmsg = (params = {}) => vm.$u.get(apiurl.inspecmsgUrl,params);
+	let inspecmsgDetails = (params = {}) => vm.$u.get(apiurl.inspecmsgDetailsUrl,params);
+	let updateInspecMsgStatus = (params = {}) => vm.$u.put(apiurl.updateInspecMsgStatusUrl,params);
+	let getUnreadMsgTotal = (params = {}) => vm.$u.get(apiurl.getUnreadMsgTotalUrl,params);
 	
 	// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
 	vm.$u.api = {
@@ -50,7 +54,11 @@ const install = (Vue, vm) => {
 		selectParkDeviceList,
 		selectParkNum,
 		findParkDeviceById,
-		controlDevice
+		controlDevice,
+		inspecmsg,
+		inspecmsgDetails,
+		updateInspecMsgStatus,
+		getUnreadMsgTotal
 	};
 }
 

+ 19 - 16
manifest.json

@@ -1,6 +1,6 @@
 {
     "name" : "智慧停车",
-    "appid" : "__UNI__6259CD7",
+    "appid" : "__UNI__15E6F0C",
     "description" : "",
     "versionName" : "1.5.0",
     "versionCode" : "100",
@@ -15,6 +15,9 @@
         "usingComponents" : true,
         "nvueCompiler" : "uni-app",
         "compilerVersion" : 3,
+        "compatible" : {
+            "ignoreVersion" : true
+        },
         "splashscreen" : {
             "alwaysShowBeforeRender" : true,
             "waiting" : true,
@@ -38,21 +41,21 @@
                     "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
                     "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
                     "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
-					/* 百度地图 */
-					"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\" />",  
-					"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />",  
-					"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\" />",  
-					"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\" />",  
-					"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />",  
-					"<uses-permission android:name=\"android.permission.INTERNET\"/>",  
-					"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\" />",  
-					"<uses-permission android:name=\"android.permission.READ_LOGS\" />",  
-					"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
-					/* 高德地图 */
-					"<uses-permission android:name=\"android.permission.INTERNET\" />",  
-					"<uses-permission android:name=\"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS\" />",  
-					"<uses-permission android:name=\"android.permission.BLUETOOTH\" />",  
-					"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\" />"
+                    /* 百度地图 */
+                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\" />",
+                    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />",
+                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\" />",
+                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\" />",
+                    "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />",
+                    "<uses-permission android:name=\"android.permission.INTERNET\"/>",
+                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\" />",
+                    "<uses-permission android:name=\"android.permission.READ_LOGS\" />",
+                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
+                    /* 高德地图 */
+                    "<uses-permission android:name=\"android.permission.INTERNET\" />",
+                    "<uses-permission android:name=\"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS\" />",
+                    "<uses-permission android:name=\"android.permission.BLUETOOTH\" />",
+                    "<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\" />"
                 ]
             },
             /* ios打包配置 */

+ 1 - 1
pages/center/message/message.scss

@@ -15,7 +15,7 @@
 		background-color: #fff;
 		border-radius: 15rpx;
 		.message-top{
-			margin-bottom: 20rpx;
+			margin-bottom: 0;
 			padding: 25rpx 40rpx;
 			.car{
 				font-size: 32rpx;

+ 8 - 8
pages/center/message/message.vue

@@ -13,15 +13,15 @@
 				<view class="page-box">
 					<view class="message" @click="goDetails(messageItem)">
 						<view class="message-top u-flex">
-							<view class="message-top-left u-flex-1">
-								<view class="car">{{messageItem.title}}</view>
+							<view class="message-top-left u-flex-3">
+								<view class="car">{{messageItem.msgType|filterMsgType}}</view>
 							</view>
-							<view class="message-top-right u-flex-2">
+							<view class="message-top-right u-flex-1">
 								<u-badge :is-dot="true" type="error" v-if="messageItem.readFlag=='0'"></u-badge>
 							</view>
 						</view>
 						<view class="message-center">
-							<view class="message-center-item">{{messageItem.content}}</view>
+							<view class="message-center-item">{{messageItem.content.replace(/<[^>]+>/g,' ')}}</view>
 						</view>
 						<view class="message-bottom">
 							<u-cell-item title="查看详情" style="color: #008CFF;"></u-cell-item>
@@ -70,7 +70,7 @@
 			upCallback(page) {
 				let pageNum = page.num; // 页码, 默认从1开始
 				let pageSize = page.size; // 页长, 默认每页10条
-				this.$u.api.getMessageList({
+				this.$u.api.inspecmsg({
 						pageSize: pageSize,
 						pageNum: pageNum
 					})
@@ -103,8 +103,8 @@
 			// 跳转消息详情
 			goDetails(item) {
 				if (Number(item.readFlag) === 0) {
-					this.$u.api.messageRead({
-							newId: item.id
+					this.$u.api.updateInspecMsgStatus({
+							id: item.id
 						})
 						.then(res => {
 							if (res.code == 200) {
@@ -123,7 +123,7 @@
 						})
 				} else {
 					this.$u.route({
-						url: 'pages/message/messageInfo',
+						url: 'pages/center/message/messageInfo',
 						params: {
 							details: JSON.stringify(item)
 						}

+ 4 - 3
pages/center/message/messageInfo.vue

@@ -9,8 +9,9 @@
 			title="消息详情"></u-navbar>
 		<view class="time">{{details.createTime}}</view>
 		<view class="box">
-			<view class="title">{{details.title}}</view>
-			<view class="content">{{details.content}}</view>
+			<view class="title">{{details.msgType|filterMsgType}}</view>
+			<view class="content" v-html="details.content"></view>
+			<!-- <view class="content">{{details.content}}</view> -->
 		</view>
 	</view>
 </template>
@@ -31,7 +32,7 @@
 		methods: {
 			customBack() {
 				this.$u.route({
-					url: 'pages/message/message'
+					url: 'pages/center/message/message'
 				});
 			}
 		}

+ 1 - 1
pages/equipmentList/equipmentList.vue

@@ -20,7 +20,7 @@
 		
 		<u-gap height="12" bg-color="#e7e7e7"></u-gap>
 		
-		<mescroll-uni ref="mescrollRef" @init="mescrollInit" top="300" @down="downCallback" :up="upOption" @up="upCallback" @emptyclick="emptyClick">
+		<mescroll-uni ref="mescrollRef" @init="mescrollInit" :top="config.platform=='h5'?300:400" @down="downCallback" :up="upOption" @up="upCallback" @emptyclick="emptyClick">
 			<view class="g-device-item u-flex u-row-between u-m-b-24" v-for="item in dataList" :key="item.id">
 				<view class="u-font-30" style="color: #414141;">
 					<view class="u-m-b-10 ">

+ 3 - 3
pages/index/index.vue

@@ -98,7 +98,7 @@
 		onShow() {
 			// this.deviceTypeList();
 			this.deviceStatis();
-			// this.getUnreadTotal();
+			this.getUnreadTotal();
 		},
 		methods: {
 			openPage(path,param) {
@@ -143,9 +143,9 @@
 			},
 			getUnreadTotal(){
 				let that = this;
-				this.$u.api.unreadTotal().then(res=>{
+				this.$u.api.getUnreadMsgTotal().then(res=>{
 					if(res.code==200){
-						this.newsTotal = res.data.noReadCount;
+						this.newsTotal = res.data.noRedNum;
 					}else{
 						uni.showToast({
 							icon:'none',

+ 23 - 10
utils/filter.js

@@ -111,8 +111,8 @@ Vue.filter("filterPayStatus",function(status){
 
 // 汽车类型
 Vue.filter("energyTpye",function(value){
-	status = Number(value);
-	switch (value){
+	let status = Number(value);
+	switch (status){
 		case 1:
 			return '汽油车'
 			break;
@@ -128,8 +128,8 @@ Vue.filter("energyTpye",function(value){
 
 // 设配类型
 Vue.filter("deviceType",function(value){
-	status = Number(value);
-	switch (value){
+	let status = Number(value);
+	switch (status){
 		case 1:
 			return '地磁'
 			break;
@@ -147,8 +147,8 @@ Vue.filter("deviceType",function(value){
 
 // 设配状态
 Vue.filter("deviceStatus",function(value){
-	status = Number(value);
-	switch (value){
+	let status = Number(value);
+	switch (status){
 		case 0:
 			return '异常'
 			break;
@@ -162,8 +162,8 @@ Vue.filter("deviceStatus",function(value){
 });
 // 车位锁设配状态
 Vue.filter("device2Status",function(value){
-	status = Number(value);
-	switch (value){
+	let status = Number(value);
+	switch (status){
 		case 0:
 			return '降板'
 			break;
@@ -196,8 +196,8 @@ Vue.filter("device2Status",function(value){
 
 // 查看设备事件信息事件类型
 Vue.filter("deviceLogMsgType",function(value){
-	status = Number(value);
-	switch (value){
+	let status = Number(value);
+	switch (status){
 		case 0:
 			return '事件帧'
 			break;
@@ -210,6 +210,19 @@ Vue.filter("deviceLogMsgType",function(value){
 	}
 });
 
+// 消息类型
+Vue.filter("filterMsgType",function(value){
+	let status = Number(value);
+	switch (status){
+		case 0:
+			return '欠费车入场通知'
+			break;
+		default:
+			return '未知'
+			break;
+	}
+});
+