Browse Source

消息推送, 消息通知调整

zhengkaixin 1 year ago
parent
commit
379687b8e5

+ 3 - 0
App.vue

@@ -51,5 +51,8 @@
 		color: rgba(16,16,16,1);
 		font-size: 32rpx;
 		margin-right: 32rpx;
+	}
+	.item-title{
+		white-space: pre;
 	}
 </style>

+ 9 - 0
apis/pagejs/deduction.js

@@ -66,4 +66,13 @@ import request from '@/apis/utils/request'
  		data: data,
  		url: url
  	})
+ }
+ 
+ export function monthlyElectricity(data) {
+ 	var url='/mobile/tenantElectricityMeter/monthlyElectricity';
+ 	return request({
+ 		method: 'post',
+ 		data: data,
+ 		url: url
+ 	})
  }

+ 327 - 157
pages/deductionRecord/monthlyPush.vue

@@ -1,163 +1,333 @@
-<template>
-	<view>
-		<u-navbar title="电费月度账单"  title-color="#101010" ></u-navbar>
-		<view class="background">
-			<view class="recharge-details">
-				<view class="headline">
-					2024年1月电费月度账单
-				</view>
-				<view class="sum">
-					1000.00
-				</view>
-				
-				<view class="details">
-					<view class="item">
-						<view class="item-title">
-							用户信息
-						</view>
-						<view class="item-value">
-							3~6楼联通公司
-						</view>
-					</view>
-					<view class="item">
-						<view class="item-title">
-							户号
-						</view>
-						<view class="item-value">
-								00880088
-						</view>
-					</view>
-					<view class="item">
-						<view class="item-title">
-							收费标准
-						</view>
-						<view class="item-value">
-								1.3元/度C
-						</view>
-					</view>
-					<view class="item">
-						<view class="item-title">
-							度数
-						</view>
-						<view class="item-value">
-								
-								61.53度 (起止码100-161.53)
-								
-						
-
-						</view>
-					</view>
-					<view class="item">
-						<view class="item-title">
-							可用余额
-						</view>
-						<view class="item-value">
-														
-							650.51元
-						</view>
-					</view>
-					<view class="item">
-						<view class="item-title">
-							统计截止日期
-						</view>
-						<view class="item-value">					
-							2024-01-02 00:00:01
-						</view>
-					</view>
-				</view>
-				
-				<view class="details">
-					<view class="chart-box">
-						<view class="title">
-							1月用电量趋势
-						</view>
-						<image class="img" src="@/assets/img/jVzkNKE@1x.png" mode=""></image>
-					</view>
-				</view>
+<template>
+	<view>
+		<u-navbar title="电费月度账单" :isBack="isBack" title-color="#101010"></u-navbar>
+		<view class="background">
+			<view class="recharge-details1">
+				<view class="headline">
+					{{thisparseUnixTime(queryYearMonth)}}电费月度账单
+				</view>
+				<view class="sum">
+					{{detail.kwhMap.fee}}元
+				</view>
+
+				<view class="details">
+					<view class="item">
+						<view class="item-title">
+							业主方
+						</view>
+						<view class="item-value">
+							{{detail.tenantInfo.name}}
+						</view>
+					</view>
+					<view class="item">
+						<view class="item-title">
+							地址
+						</view>
+						<view class="item-value">
+							{{detail.tenantContract.address}}
+						</view>
+					</view>
+					<!-- <view class="item">
+						<view class="item-title">
+							收费标准
+						</view>
+						<view class="item-value">
+								{{detail.kwhMap.kwh}}元/度
+						</view>
+					</view> -->
+					<view class="item">
+						<view class="item-title">
+							度数
+						</view>
+						<view class="item-value">
+
+							{{detail.kwhMap.kwh}}度
+
+
+
+						</view>
+					</view>
+					<view class="item">
+						<view class="item-title">
+							起止码
+						</view>
+						<view class="item-value">
+
+							{{detail.kwhMap.startMeter}}-{{detail.kwhMap.endMeter}}
+
+
+
+						</view>
+					</view>
+					<view class="item">
+						<view class="item-title">
+							可用余额
+						</view>
+						<view class="item-value">
+
+							{{detail.balance}}元
+						</view>
+					</view>
+					<view class="item">
+						<view class="item-title">
+							统计截止日期
+						</view>
+						<view class="item-value">
+							{{detail.endTime}}
+						</view>
+					</view>
+				</view>
+
+
+			</view>
+			<!-- 返回 -->
+			<!-- <button class="back">返回</button> -->
+			<view class="recharge-details2">
+				<view class="details">
+					<view class="title">
+						{{thisparseUnixTime(queryYearMonth)}}用电量趋势
+					</view>
+					<view id="pieEcharts">
+
+					</view>
+				</view>
 			</view>
-			<!-- 返回 -->
-			<button class="back">返回</button>
+			<u-divider   nonetext="没有找到相关内容" style="margin-top: 20rpx;"
+				border-color="#CFD2D5">已经到底了</u-divider>
 		</view>
-		
-	</view> 
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				
-			}
-		},
-		methods: {
-			
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-	.background{
-		padding: 24rpx 32rpx;
-		height: 400rpx;
-		background: linear-gradient(180deg, rgba(203,234,255,1) 0%,rgba(203,234,255,0) 100%);
-		.recharge-details{
-			
-			background-color: #fff;
-			border-radius: 8px;
+		
+
+
+	</view>
+</template>
+
+<script>
+	import * as API from '@/apis/pagejs/deduction.js'
+	import {
+		parseUnixTime
+	} from '@/apis/utils'
+	import * as echarts from "echarts";
+	export default {
+		data() {
+			return {
+				isBack: false,
+				id: "",
+				queryYearMonth: "",
+				detail: {
+					tenantInfo: {},
+					tenantContract: {},
+					kwhMap: {},
+					endTime: {},
+					balance: {},
+				},
+				myChart: null,
+			}
+		},
+		onLoad(op) {
+			if (op.site) {
+				this.isBack = true
+			}
+			if (op.id) {
+				this.id = op.id
+				this.queryYearMonth = op.m
+				this.getDetail()
+			}
+		},
+		methods: {
+			thisparseUnixTime(time) {
+				if (!time) {
+					return ''
+				}
+				return parseUnixTime(new Date(time), '{y}年{m}月')
+			},
+			getDetail() {
+				uni.showLoading({
+					mask: true,
+					title: '加载中...'
+				})
+				API.monthlyElectricity({
+					contractId: this.id,
+					queryYearMonth: this.queryYearMonth
+				}).then((response) => {
+					uni.hideLoading();
+					this.detail = response.data;
+					this.getPle(this.detail.graphMap)
+
+					//this.transferAccountsInfo=this.detail.accountInfo;
+				}).catch(error => {
+					uni.hideLoading();
+					uni.showToast({
+						title: error
+					})
+				})
+			},
+			getPle(list) {
+
+				if (!this.myChart) {
+					this.myChart = echarts.init(document.getElementById('pieEcharts'), null, {
+						width: uni.upx2px(650),
+						height: uni.upx2px(420)
+					});
+				}
+				var data1 = [];
+				var data2 = [];
+				this.myChart.clear();
+				for (var i in list) {
+					data1.push(i)
+					data2.push(list[i].kwh)
+				}
+
+				var headitemby = ""
+				var showkey = "";
+				var option = {
+					tooltip: {
+						trigger: 'axis',
+						formatter: (value) => {
+							var time=this.thisparseUnixTime(this.queryYearMonth);
+							var name = value[0].name;
+							var obj = list[name]
+							var text = `<p>${time}${name}日</p>`
+
+						
+							if (obj.kwh != undefined) {
+								text += `<p>电量:${obj.kwh}度</p>`
+							}
+							if (obj.fee != undefined) {
+								text += ` <p>电费:${obj.fee}元</p>`
+							}
+							return text
+
+						}
+					},
+					grid: {
+						top: 20,
+						left: 5,
+						right: 5,
+						bottom: 20,
+						containLabel: true
+					},
+					xAxis: {
+						type: 'category',
+						data: data1,
+						axisLabel: {
+
+							textStyle: {
+								color: "#333"
+							}
+						},
+					},
+					yAxis: {
+						type: 'value'
+					},
+					series: [{
+						name: '电量',
+						data: data2,
+						type: 'line'
+					}]
+				}
+				console.log(option)
+				this.myChart.setOption(option);
+
+
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.background {
+		padding: 24rpx 24rpx;
+		height: 400rpx;
+		background: linear-gradient(180deg, rgba(203, 234, 255, 1) 0%, rgba(203, 234, 255, 0) 100%);
+
+		.recharge-details1 {
 			padding: 40rpx 32rpx;
-			text-align: center;
-			.headline{
-				color: rgb(16,16,16);
-				font-size: 36rpx;
-				
+			border-radius: 8px 8px 0 0;
+		}
+
+		.recharge-details2 {
+			border-radius:  0 0 8px 8px;
+			padding: 5rpx 20rpx 40rpx 20rpx;
+		
+			.details {
+				border-radius: 8px ;
+			background: linear-gradient(180deg, rgba(208,236,255,1) 0%,rgba(208,236,236,0) 100%);
 			}
-			.sum{
-				color: rgb(16,16,16);
-				font-size: 48rpx;
-				margin-top: 32rpx;
-
+			#pieEcharts{
+				text-align: start;
 			}
 			
-			.details{
-				margin-top: 40rpx;
-				padding-top: 40rpx;
-				border-top: 1px solid rgba(241,241,241,1);
-				.item{
-					display: flex;
-					align-items: center;
-					justify-content: space-between;
-					margin-bottom:16rpx;
-					.item-title{
-						color: rgb(119,119,119);
-					}
-					.item-value{
-						color: rgb(48,48,48);
-					}
-				}
-				.chart-box{
-					background-color: rgba(208,236,255,1);
-					border-radius: 8px;
-					.title{
-						text-align: left;
-						padding: 24rpx 28rpx;
-						color: rgba(16,16,16,1);
-					}
-				}
-				.img{
-					width: 622rpx;
-					height: 304rpx;
-				}
-			}
-		}
-	}
- // 返回
- .back{
-	 border: 1px solid rgba(205,205,205,1);
-	 line-height: 88rpx;
-	 border-radius: 8px;
-	 background-color: rgba(255,255,255,1);
-	 color: rgba(119,119,119,1);
-	 font-size: 32rpx;
-	 margin-top: 24rpx;
- }
-</style>
+		}
+
+		.recharge-details1,
+		.recharge-details2 {
+
+			background-color: #fff;
+			
+
+			text-align: center;
+
+			.headline {
+				color: rgb(16, 16, 16);
+				font-size: 36rpx;
+
+			}
+
+			.sum {
+				color: rgb(16, 16, 16);
+				font-size: 48rpx;
+				margin-top: 32rpx;
+
+			}
+
+			.details {
+				margin-top: 40rpx;
+				padding-top: 40rpx;
+				border-top: 1px solid rgba(241, 241, 241, 1);
+
+				.item {
+					display: flex;
+					align-items: center;
+					justify-content: space-between;
+					margin-bottom: 16rpx;
+
+					.item-title {
+						color: rgb(119, 119, 119);
+						white-space: pre;
+					}
+
+					.item-value {
+						color: rgb(48, 48, 48);
+					}
+				}
+
+				.chart-box {
+					background-color: rgba(208, 236, 255, 1);
+					border-radius: 8px;
+
+					.title {
+						text-align: left;
+						padding: 24rpx 28rpx;
+						color: rgba(16, 16, 16, 1);
+					}
+				}
+
+				.img {
+					width: 622rpx;
+					height: 304rpx;
+				}
+			}
+		}
+	}
+
+	// 返回
+	.back {
+		border: 1px solid rgba(205, 205, 205, 1);
+		line-height: 88rpx;
+		border-radius: 8px;
+		background-color: rgba(255, 255, 255, 1);
+		color: rgba(119, 119, 119, 1);
+		font-size: 32rpx;
+		margin-top: 24rpx;
+	}
+</style>

+ 29 - 10
pages/message/messageList.vue

@@ -11,6 +11,7 @@
 					<view>{{item.name}}</view>
 					<view class="billAmount">¥{{item.billAmount}}元</view>
 				</view>
+				
 				<view class="item-time" style="display: flex;justify-content: space-between;">
 					  <!-- {{item.tenantName}} -->
 					
@@ -18,22 +19,33 @@
 					<view >{{item.payTime?'已支付':''}}</view>
 				</view>
 			</view>
-			<u-divider :isnone="list.length==0"   nonetext="没有找到相关内容"
-				border-color="#CFD2D5">已经到底了</u-divider>
+			
 		</view>
 		<view class="main" v-else >
-			<view class="item" v-for="(item,i) in list" :key="i">
+			<view class="item" v-for="(item,i) in list"
+			 
+			  @click="gotoUrlBtn(item)"
+			  
+			 :key="i">
 				<view class="item-message">
-					<view v-html="item.content"></view>
-					<view class="billAmount"></view>
+					<view>{{item.title}}</view>
+					<view v-if="item.jumpStatus" class="gotoBtn">查看详情</view>
 				</view>
 				<view class="item-time">
-					{{item.createTime}}  <!-- {{item.tenantName}} -->
+					<view v-html="item.content"></view>
+					
+				</view>
+				<view class="item-time" style="display: flex;justify-content: space-between;">
+					  <!-- {{item.tenantName}} -->
+					
+					<view>{{item.createTime}}</view>
+				
 				</view>
 			</view>
-			<u-divider :isnone="list.length==0"   nonetext="没有找到相关内容"
-				border-color="#CFD2D5">已经到底了</u-divider>
+			
 		</view>
+		<u-divider :isnone="list.length==0"   nonetext="没有找到相关内容"
+			border-color="#CFD2D5">已经到底了</u-divider>
 	</view>
 </template>
 
@@ -83,6 +95,11 @@
 			}
 		},
 		methods: {
+			gotoUrlBtn(item){
+				if(item.jumpStatus){
+					this.gotoUrl(item.jumpUrl+'&site=1')
+				}
+			},
 			getList(){
 				if(this.type=='AA'){
 					this.getBillList()
@@ -165,12 +182,14 @@
 			.item-message{
 				line-height: 44rpx;
 				display: flex;
-				    justify-content: space-between;
+				justify-content: space-between;
 				color: rgba(51,51,51,1);
 				.billAmount{
 					    color: #F44336;
 				}
-				
+				.gotoBtn{
+					color:#1677FF
+				}
 			}
 			.item-time{
 				color: rgb(153,153,153);

+ 21 - 4
pages/meterManagement/meterManagement.vue

@@ -4,9 +4,9 @@
 		<view class="background">
 			
 			<view  v-for="(query,i) in queryList" :key="i">
-				<view class="meter-title">
+				<!-- <view class="meter-title" v-if="queryList.length>1">
 					<span class="icon"></span>
-				{{query.remark}} </view>
+				{{query.remark}} </view> -->
 				<view class="meter-info"  v-if="query.meterId&&query.item"   >
 					<view class="title">
 						<view class="icon">
@@ -32,7 +32,7 @@
 							</view>
 							<view class="details-item">
 								<view class="details-title">
-									电表编号
+									设备编号
 								</view>
 								<view class="details-value">
 									{{query.item.deviceNo}}
@@ -56,7 +56,14 @@
 												
 								</view>
 							</view>
-							
+							<view class="details-item" v-if="queryList.length>1">
+								<view class="details-title">
+									所属合同
+								</view>
+								<view class="details-value">
+									{{query.remark}}
+								</view>
+							</view>
 						</view>
 						
 						<view class="unbind" 
@@ -74,6 +81,8 @@
 				<view  class="meter-info" v-else >
 					<view class="content">
 						<view class="details">
+							
+							
 							<view class="details-item">
 								<view class="details-title">
 									绑定电表
@@ -86,6 +95,14 @@
 								</view>
 								
 							</view>
+							<view class="details-item" v-if="queryList.length>1" >
+								<view class="details-title">
+									所属合同
+								</view>
+								<view class="details-value">
+									{{query.remark}}
+								</view>
+							</view>
 						</view>
 						<view class="unbind" v-if="!timeEnd(query.contractEndTime)"
 						@click="getScanCode(query)">

+ 5 - 5
pages/mine/electronicMonitoring.vue

@@ -188,7 +188,7 @@
 			<view class="infos">
 				<view class="item" style="width: 30%;">
 					<view class="item-title">
-						类型
+						设备类型
 					</view>
 					<view class="item-value">
 						{{meterDetail.deviceTypeN}}
@@ -237,7 +237,7 @@
 						</view>
 						<view class="item">
 							<view class="item-title">
-								类型
+								设备类型
 							</view>
 							<view class="item-value">
 								{{meterDetail.deviceTypeN}}
@@ -245,7 +245,7 @@
 						</view>
 						<view class="item">
 							<view class="item-title">
-								编号
+								设备编号
 							</view>
 							<view class="item-value">
 								{{meterDetail.deviceNo}}
@@ -253,7 +253,7 @@
 						</view>
 						<view class="item">
 							<view class="item-title">
-								所属公司
+								产权单位
 							</view>
 							<view class="item-value">
 								{{meterDetail.companyFullName}}
@@ -643,7 +643,7 @@
 								text+=`<p>电价:${obj.electricityPrice}元/度</p>`
 							}
 							if(obj.kwh!=undefined){
-								text+=`电量:${obj.kwh}度`
+								text+=`<p>电量:${obj.kwh}度</p>`
 							}
 							if(obj.amount!=undefined){
 								text+=` <p>电费:${obj.amount}元</p>`

+ 2 - 0
pages/mine/mine.vue

@@ -307,6 +307,8 @@
 					this.regUser = response.data.regUser;
 
 					this.personInfo = response.data.tenantInfo;
+					this.userList=response.data.userList
+					
 					this.prefetch();
 					this.getContractList()
 					//this.homePage()