Parcourir la source

好差评数据源更换

elis il y a 1 an
Parent
commit
c4ea3dacc9

+ 55 - 34
nnzwminiapp/pages/dataCenter/dataCenter.js

@@ -153,7 +153,7 @@ Page({
 		// this.barComponent8 = this.selectComponent('#streetlinechart8');
 		// this.init_bar8();
 		// 好差评图表
-		this.goodOrBad = this.selectComponent('#goodOrBad');
+		// this.goodOrBad = this.selectComponent('#goodOrBad');
 		this.init_goodOrBad();
 		// 获取本年办件数
 		this.getOfficeNumberByAreaInfo();
@@ -988,43 +988,64 @@ Page({
 	},
 	// 好差评图表
 	init_goodOrBad() {
-		this.goodOrBad.init((canvas, width, height, dpr) => {
-			// 初始化图表
-			const barChart = echarts.init(canvas, null, {
-				width: width,
-				height: height,
-				devicePixelRatio: dpr
-			});
-			request({
-				url: '/goodOrbad/getGoodOrBadByYearAndArea?area=1',
-				method: 'GET'
-			}).then(res => {
+		wx.request({
+			url: 'https://www.cqna.gov.cn/data//goodOrbad/getGoodOrBad?area=1',
+			method: 'GET',
+			success: res => {
+				res = res.data;
 				if (res.result === 'ok') {
-					let temp = [];
-					temp.push(res.data.veryDissatisfied);
-					temp.push(res.data.notSatisfied);
-					temp.push(res.data.basicSatisfied);
-					temp.push(res.data.satisfied);
-					temp.push(res.data.great);
-					// 计算最大值,以及分割值
-					var maxValue = Math.max(...temp)
-					maxValue = parseInt(maxValue/10000 + 1) * 10000
-					var interval = maxValue / 4
-					barChart.setOption(this.getGoodOrBadOption(maxValue, interval));
+
 					this.setData({
-						evalutionNum: res.data.goodOrBad,
-						evalutionRate: Math.floor(res.data.good / res.data.goodOrBad * 100 * 100) / 100
-					})
-					barChart.setOption({
-						series: [{
-							data: temp
-						}]
+						//  评价总量
+						evalutionNum: res.data.totalEvaluationNumber,
+						//  评价总量
+						goodevalutionRate: res.data.goodEvaluationRate,
+						//  评价总量
+						badevalutionNum: res.data.poorEvaluationNumber,
+						//  评价总量
+						badevalutionRate: res.data.poorEvaluationRate
 					})
+
 				}
-			})
-			// 注意这里一定要返回 chart 实例,否则会影响事件处理等
-			return barChart;
-		});
+			}
+		})
+		// this.goodOrBad.init((canvas, width, height, dpr) => {
+		// 	// 初始化图表
+		// 	const barChart = echarts.init(canvas, null, {
+		// 		width: width,
+		// 		height: height,
+		// 		devicePixelRatio: dpr
+		// 	});
+		// 	request({
+		// 		url: '/goodOrbad/getGoodOrBadByYearAndArea?area=1',
+		// 		method: 'GET'
+		// 	}).then(res => {
+		// 		if (res.result === 'ok') {
+		// 			let temp = [];
+		// 			temp.push(res.data.veryDissatisfied);
+		// 			temp.push(res.data.notSatisfied);
+		// 			temp.push(res.data.basicSatisfied);
+		// 			temp.push(res.data.satisfied);
+		// 			temp.push(res.data.great);
+		// 			// 计算最大值,以及分割值
+		// 			var maxValue = Math.max(...temp)
+		// 			maxValue = parseInt(maxValue/10000 + 1) * 10000
+		// 			var interval = maxValue / 4
+		// 			barChart.setOption(this.getGoodOrBadOption(maxValue, interval));
+		// 			this.setData({
+		// 				evalutionNum: res.data.goodOrBad,
+		// 				evalutionRate: Math.floor(res.data.good / res.data.goodOrBad * 100 * 100) / 100
+		// 			})
+		// 			barChart.setOption({
+		// 				series: [{
+		// 					data: temp
+		// 				}]
+		// 			})
+		// 		}
+		// 	})
+		// 	// 注意这里一定要返回 chart 实例,否则会影响事件处理等
+		// 	return barChart;
+		// });
 	},
 	// 近90天办理类别统计
 	init_processingCategory() {

+ 31 - 31
nnzwminiapp/pages/dataCenter/dataCenter.wxml

@@ -103,45 +103,45 @@
 				<view style="display: flex;justify-content: space-between;padding: 0 40rpx; height: 300rpx;">
 					<view style="display: flex;flex-wrap: wrap;justify-content: space-between;height: 130rpx;width: 100%">
 						<!-- 好评数 -->
-						<view style="margin-bottom: 30rpx; height: 100rpx;width:310rpx;display: flex;background-color:#E5F4FE;border-radius: 10px;">
-							<!-- 数据 -->
-							<view style="margin: 0 auto; width: 210rpx;height: 100%;display:flex;flex-direction: column;justify-content:center">
-								<view style="text-align: center;width: 100%; font-size: 19rpx;color: #999999;padding-bottom:8rpx">评价数</view>
-								<view style="width: 100%;display:flex;justify-content:left;align-items:center;color: #333333;">
-									<view style="width: 100%; text-align: center; font-size: 28rpx;font-weight: bold;">{{evalutionNum}}</view>
+						<view style="margin-bottom: 30rpx; height: 100rpx;width:324rpx;display: flex;background-color:#E5F4FE;border-radius: 10px;">
+								<!-- 数据 -->
+								<view style="margin: 0 auto; width: 210rpx;height: 100%;display:flex;flex-direction: column;justify-content:center">
+									<view style="text-align: center;width: 100%; font-size: 24rpx;color: #999999;padding-bottom:8rpx">评价数</view>
+									<view style="width: 100%;display:flex;justify-content:left;align-items:center;color: #333333;">
+										<view style="width: 100%; text-align: center; font-size: 28rpx;font-weight: bold;">{{evalutionNum}}</view>
+									</view>
 								</view>
 							</view>
-						</view>
-						<!-- 评价总量 -->
-						<view style="height: 100rpx;width:310rpx;display: flex;background-color:#E5F4FE;border-radius: 10px;">
-							<!-- 数据 -->
-							<view style="margin: 0 auto; width: 210rpx;height: 100%;display:flex;flex-direction: column;justify-content:center">
-								<view style="text-align: center;width: 100%; font-size: 19rpx;color: #999999;padding-bottom:8rpx">好评率</view>
-								<view style="width: 100%;display:flex;justify-content:left;align-items:center;color: #333333;">
-									<view style="width: 100%; text-align: center; font-size: 28rpx;font-weight: bold;">{{evalutionNum}}</view>
+							<!-- 评价总量 -->
+							<view style="height: 100rpx;width:324rpx;display: flex;background-color:#E5F4FE;border-radius: 10px;">
+								<!-- 数据 -->
+								<view style="margin: 0 auto; width: 210rpx;height: 100%;display:flex;flex-direction: column;justify-content:center">
+									<view style="text-align: center;width: 100%; font-size: 24rpx;color: #999999;padding-bottom:8rpx">好评率</view>
+									<view style="width: 100%;display:flex;justify-content:left;align-items:center;color: #333333;">
+										<view style="width: 100%; text-align: center; font-size: 28rpx;font-weight: bold;">{{goodevalutionRate}}%</view>
+									</view>
 								</view>
 							</view>
-						</view>
-						<!-- 好评【 -->
-						<view style="height: 100rpx;width:310rpx;display: flex;background-color:#E5F4FE;border-radius: 10px;">
-							<!-- 数据 -->
-							<view style="margin: 0 auto; width: 210rpx;height: 100%;display:flex;flex-direction: column;justify-content:center">
-								<view style="text-align: center;width: 100%; font-size: 19rpx;color: #999999;padding-bottom:8rpx">差评数</view>
-								<view style="width: 100%;display:flex;justify-content:left;align-items:center;color: #333333;">
-									<view style="width: 100%; text-align: center; font-size: 28rpx;font-weight: bold;">{{evalutionNum}}</view>
+							<!-- 好评【 -->
+							<view style="height: 100rpx;width:324rpx;display: flex;background-color:#E5F4FE;border-radius: 10px;">
+								<!-- 数据 -->
+								<view style="margin: 0 auto; width: 210rpx;height: 100%;display:flex;flex-direction: column;justify-content:center">
+									<view style="text-align: center;width: 100%; font-size: 24rpx;color: #999999;padding-bottom:8rpx">差评数</view>
+									<view style="width: 100%;display:flex;justify-content:left;align-items:center;color: #333333;">
+										<view style="width: 100%; text-align: center; font-size: 28rpx;font-weight: bold;">{{badevalutionNum}}</view>
+									</view>
 								</view>
 							</view>
-						</view>
-						<!-- 评价总量 -->
-						<view style="height: 100rpx;width:310rpx;display: flex;background-color:#E5F4FE;border-radius: 10px;">
-							<!-- 数据 -->
-							<view style="margin: 0 auto; width: 210rpx;height: 100%;display:flex;flex-direction: column;justify-content:center">
-								<view style="text-align: center;width: 100%; font-size: 19rpx;color: #999999;padding-bottom:8rpx">差评率</view>
-								<view style="width: 100%;display:flex;justify-content:left;align-items:center;color: #333333;">
-									<view style="width: 100%; text-align: center; font-size: 28rpx;font-weight: bold;">{{evalutionNum}}</view>
+							<!-- 评价总量 -->
+							<view style="height: 100rpx;width:324rpx;display: flex;background-color:#E5F4FE;border-radius: 10px;">
+								<!-- 数据 -->
+								<view style="margin: 0 auto; width: 210rpx;height: 100%;display:flex;flex-direction: column;justify-content:center">
+									<view style="text-align: center;width: 100%; font-size: 24rpx;color: #999999;padding-bottom:8rpx">差评整改率</view>
+									<view style="width: 100%;display:flex;justify-content:left;align-items:center;color: #333333;">
+										<view style="width: 100%; text-align: center; font-size: 28rpx;font-weight: bold;">{{badevalutionRate}}%</view>
+									</view>
 								</view>
 							</view>
-						</view>
 					</view>
 					<!-- 评价总量 -->
 

+ 55 - 34
nnzwminiapp/pages/dataCenterZWTJ/dataCenterZWTJ.js

@@ -92,7 +92,7 @@ Page({
 		this.barComponent = this.selectComponent('#annulus');
 		this.init_bar();
 		// 好差评图表
-		this.goodOrBad = this.selectComponent('#goodOrBad');
+		// this.goodOrBad = this.selectComponent('#goodOrBad');
 		this.init_goodOrBad();
 		// 实时办件详细
 		this.getListMatterRank();
@@ -238,43 +238,64 @@ Page({
 	},
 	// 好差评图表
 	init_goodOrBad() {
-		this.goodOrBad.init((canvas, width, height, dpr) => {
-			// 初始化图表
-			const barChart = echarts.init(canvas, null, {
-				width: width,
-				height: height,
-				devicePixelRatio: dpr
-			});
-			request({
-				url: '/goodOrbad/getGoodOrBadByYearAndArea?area=1',
-				method: 'GET'
-			}).then(res => {
+		wx.request({
+			url: 'https://www.cqna.gov.cn/data//goodOrbad/getGoodOrBad?area=1',
+			method: 'GET',
+			success: res => {
+				res = res.data;
 				if (res.result === 'ok') {
-					let temp = [];
-					temp.push(res.data.veryDissatisfied);
-					temp.push(res.data.notSatisfied);
-					temp.push(res.data.basicSatisfied);
-					temp.push(res.data.satisfied);
-					temp.push(res.data.great);
-					// 计算最大值,以及分割值
-					var maxValue = Math.max(...temp)
-					maxValue = parseInt(maxValue/10000 + 1) * 10000
-					var interval = maxValue / 4
-					barChart.setOption(this.getGoodOrBadOption(maxValue, interval));
+
 					this.setData({
-						evalutionNum: res.data.goodOrBad,
-						evalutionRate: Math.floor(res.data.good / res.data.goodOrBad * 100 * 100)  / 100
-					})
-					barChart.setOption({
-						series: [{
-							data: temp
-						}]
+						//  评价总量
+						evalutionNum: res.data.totalEvaluationNumber,
+						//  评价总量
+						goodevalutionRate: res.data.goodEvaluationRate,
+						//  评价总量
+						badevalutionNum: res.data.poorEvaluationNumber,
+						//  评价总量
+						badevalutionRate: res.data.poorEvaluationRate
 					})
+
 				}
-			})
-			// 注意这里一定要返回 chart 实例,否则会影响事件处理等
-			return barChart;
-		});
+			}
+		})
+		// this.goodOrBad.init((canvas, width, height, dpr) => {
+		// 	// 初始化图表
+		// 	const barChart = echarts.init(canvas, null, {
+		// 		width: width,
+		// 		height: height,
+		// 		devicePixelRatio: dpr
+		// 	});
+		// 	request({
+		// 		url: '/goodOrbad/getGoodOrBadByYearAndArea?area=1',
+		// 		method: 'GET'
+		// 	}).then(res => {
+		// 		if (res.result === 'ok') {
+		// 			let temp = [];
+		// 			temp.push(res.data.veryDissatisfied);
+		// 			temp.push(res.data.notSatisfied);
+		// 			temp.push(res.data.basicSatisfied);
+		// 			temp.push(res.data.satisfied);
+		// 			temp.push(res.data.great);
+		// 			// 计算最大值,以及分割值
+		// 			var maxValue = Math.max(...temp)
+		// 			maxValue = parseInt(maxValue/10000 + 1) * 10000
+		// 			var interval = maxValue / 4
+		// 			barChart.setOption(this.getGoodOrBadOption(maxValue, interval));
+		// 			this.setData({
+		// 				evalutionNum: res.data.goodOrBad,
+		// 				evalutionRate: Math.floor(res.data.good / res.data.goodOrBad * 100 * 100)  / 100
+		// 			})
+		// 			barChart.setOption({
+		// 				series: [{
+		// 					data: temp
+		// 				}]
+		// 			})
+		// 		}
+		// 	})
+		// 	// 注意这里一定要返回 chart 实例,否则会影响事件处理等
+		// 	return barChart;
+		// });
 	},
 	// 获取互联网申报情况图表
 	getScaOption() {

+ 32 - 31
nnzwminiapp/pages/dataCenterZWTJ/dataCenterZWTJ.wxml

@@ -196,47 +196,48 @@
 		<!-- 评价总量 -->
 		
 		<!-- 满意度 -->
-		<view style="display: flex;flex-wrap: wrap;justify-content: space-between;height: 280rpx;width: 100%">
+		<view style="display: flex;flex-wrap: wrap;justify-content: space-between;height: 200rpx;width: 100%;margin-bottom: 60rpx;">
+						<!-- 好评数 -->
 						<!-- 好评数 -->
 						<view style="margin-bottom: 30rpx; height: 100rpx;width:310rpx;display: flex;background-color:#E5F4FE;border-radius: 10px;">
-							<!-- 数据 -->
-							<view style="margin: 0 auto; width: 210rpx;height: 100%;display:flex;flex-direction: column;justify-content:center">
-								<view style="text-align: center;width: 100%; font-size: 19rpx;color: #999999;padding-bottom:8rpx">评价数</view>
-								<view style="width: 100%;display:flex;justify-content:left;align-items:center;color: #333333;">
-									<view style="width: 100%; text-align: center; font-size: 28rpx;font-weight: bold;">{{evalutionNum}}</view>
+								<!-- 数据 -->
+								<view style="margin: 0 auto; width: 210rpx;height: 100%;display:flex;flex-direction: column;justify-content:center">
+									<view style="text-align: center;width: 100%; font-size: 24rpx;color: #999999;padding-bottom:8rpx">评价数</view>
+									<view style="width: 100%;display:flex;justify-content:left;align-items:center;color: #333333;">
+										<view style="width: 100%; text-align: center; font-size: 28rpx;font-weight: bold;">{{evalutionNum}}</view>
+									</view>
 								</view>
 							</view>
-						</view>
-						<!-- 评价总量 -->
-						<view style="height: 100rpx;width:310rpx;display: flex;background-color:#E5F4FE;border-radius: 10px;">
-							<!-- 数据 -->
-							<view style="margin: 0 auto; width: 210rpx;height: 100%;display:flex;flex-direction: column;justify-content:center">
-								<view style="text-align: center;width: 100%; font-size: 19rpx;color: #999999;padding-bottom:8rpx">好评率</view>
-								<view style="width: 100%;display:flex;justify-content:left;align-items:center;color: #333333;">
-									<view style="width: 100%; text-align: center; font-size: 28rpx;font-weight: bold;">{{evalutionNum}}</view>
+							<!-- 评价总量 -->
+							<view style="height: 100rpx;width:310rpx;display: flex;background-color:#E5F4FE;border-radius: 10px;">
+								<!-- 数据 -->
+								<view style="margin: 0 auto; width: 210rpx;height: 100%;display:flex;flex-direction: column;justify-content:center">
+									<view style="text-align: center;width: 100%; font-size: 24rpx;color: #999999;padding-bottom:8rpx">好评率</view>
+									<view style="width: 100%;display:flex;justify-content:left;align-items:center;color: #333333;">
+										<view style="width: 100%; text-align: center; font-size: 28rpx;font-weight: bold;">{{goodevalutionRate}}%</view>
+									</view>
 								</view>
 							</view>
-						</view>
-						<!-- 好评【 -->
-						<view style="height: 100rpx;width:310rpx;display: flex;background-color:#E5F4FE;border-radius: 10px;">
-							<!-- 数据 -->
-							<view style="margin: 0 auto; width: 210rpx;height: 100%;display:flex;flex-direction: column;justify-content:center">
-								<view style="text-align: center;width: 100%; font-size: 19rpx;color: #999999;padding-bottom:8rpx">差评数</view>
-								<view style="width: 100%;display:flex;justify-content:left;align-items:center;color: #333333;">
-									<view style="width: 100%; text-align: center; font-size: 28rpx;font-weight: bold;">{{evalutionNum}}</view>
+							<!-- 好评【 -->
+							<view style="height: 100rpx;width:310rpx;display: flex;background-color:#E5F4FE;border-radius: 10px;">
+								<!-- 数据 -->
+								<view style="margin: 0 auto; width: 210rpx;height: 100%;display:flex;flex-direction: column;justify-content:center">
+									<view style="text-align: center;width: 100%; font-size: 24rpx;color: #999999;padding-bottom:8rpx">差评数</view>
+									<view style="width: 100%;display:flex;justify-content:left;align-items:center;color: #333333;">
+										<view style="width: 100%; text-align: center; font-size: 28rpx;font-weight: bold;">{{badevalutionNum}}</view>
+									</view>
 								</view>
 							</view>
-						</view>
-						<!-- 评价总量 -->
-						<view style="height: 100rpx;width:310rpx;display: flex;background-color:#E5F4FE;border-radius: 10px;">
-							<!-- 数据 -->
-							<view style="margin: 0 auto; width: 210rpx;height: 100%;display:flex;flex-direction: column;justify-content:center">
-								<view style="text-align: center;width: 100%; font-size: 19rpx;color: #999999;padding-bottom:8rpx">差评整改率</view>
-								<view style="width: 100%;display:flex;justify-content:left;align-items:center;color: #333333;">
-									<view style="width: 100%; text-align: center; font-size: 28rpx;font-weight: bold;">{{evalutionNum}}</view>
+							<!-- 评价总量 -->
+							<view style="height: 100rpx;width:310rpx;display: flex;background-color:#E5F4FE;border-radius: 10px;">
+								<!-- 数据 -->
+								<view style="margin: 0 auto; width: 210rpx;height: 100%;display:flex;flex-direction: column;justify-content:center">
+									<view style="text-align: center;width: 100%; font-size: 24rpx;color: #999999;padding-bottom:8rpx">差评整改率</view>
+									<view style="width: 100%;display:flex;justify-content:left;align-items:center;color: #333333;">
+										<view style="width: 100%; text-align: center; font-size: 28rpx;font-weight: bold;">{{badevalutionRate}}%</view>
+									</view>
 								</view>
 							</view>
-						</view>
 					</view>
 	</view>
 

+ 1 - 1
nnzwminiapp/pages/index/index.js

@@ -664,7 +664,7 @@ Page({
 	// 加载评价图表
 	init_bar3() {
 		wx.request({
-			url: 'https://www.cqna.gov.cn/data//goodOrbad/getGoodOrBadByYearAndArea?area=1',
+			url: 'https://www.cqna.gov.cn/data//goodOrbad/getGoodOrBad?area=1',
 			method: 'GET',
 			success: res => {
 				res = res.data;

+ 7 - 7
nnzwminiapp/pages/index/index.wxml

@@ -704,7 +704,7 @@
 							<view style="margin-bottom: 30rpx; height: 100rpx;width:310rpx;display: flex;background-color:#E5F4FE;border-radius: 10px;">
 								<!-- 数据 -->
 								<view style="margin: 0 auto; width: 210rpx;height: 100%;display:flex;flex-direction: column;justify-content:center">
-									<view style="text-align: center;width: 100%; font-size: 19rpx;color: #999999;padding-bottom:8rpx">评价数</view>
+									<view style="text-align: center;width: 100%; font-size: 24rpx;color: #999999;padding-bottom:8rpx">评价数</view>
 									<view style="width: 100%;display:flex;justify-content:left;align-items:center;color: #333333;">
 										<view style="width: 100%; text-align: center; font-size: 28rpx;font-weight: bold;">{{evalutionNum}}</view>
 									</view>
@@ -714,9 +714,9 @@
 							<view style="height: 100rpx;width:310rpx;display: flex;background-color:#E5F4FE;border-radius: 10px;">
 								<!-- 数据 -->
 								<view style="margin: 0 auto; width: 210rpx;height: 100%;display:flex;flex-direction: column;justify-content:center">
-									<view style="text-align: center;width: 100%; font-size: 19rpx;color: #999999;padding-bottom:8rpx">好评率</view>
+									<view style="text-align: center;width: 100%; font-size: 24rpx;color: #999999;padding-bottom:8rpx">好评率</view>
 									<view style="width: 100%;display:flex;justify-content:left;align-items:center;color: #333333;">
-										<view style="width: 100%; text-align: center; font-size: 28rpx;font-weight: bold;">{{evalutionNum}}</view>
+										<view style="width: 100%; text-align: center; font-size: 28rpx;font-weight: bold;">{{goodevalutionRate}}%</view>
 									</view>
 								</view>
 							</view>
@@ -724,9 +724,9 @@
 							<view style="height: 100rpx;width:310rpx;display: flex;background-color:#E5F4FE;border-radius: 10px;">
 								<!-- 数据 -->
 								<view style="margin: 0 auto; width: 210rpx;height: 100%;display:flex;flex-direction: column;justify-content:center">
-									<view style="text-align: center;width: 100%; font-size: 19rpx;color: #999999;padding-bottom:8rpx">差评数</view>
+									<view style="text-align: center;width: 100%; font-size: 24rpx;color: #999999;padding-bottom:8rpx">差评数</view>
 									<view style="width: 100%;display:flex;justify-content:left;align-items:center;color: #333333;">
-										<view style="width: 100%; text-align: center; font-size: 28rpx;font-weight: bold;">{{evalutionNum}}</view>
+										<view style="width: 100%; text-align: center; font-size: 28rpx;font-weight: bold;">{{badevalutionNum}}</view>
 									</view>
 								</view>
 							</view>
@@ -734,9 +734,9 @@
 							<view style="height: 100rpx;width:310rpx;display: flex;background-color:#E5F4FE;border-radius: 10px;">
 								<!-- 数据 -->
 								<view style="margin: 0 auto; width: 210rpx;height: 100%;display:flex;flex-direction: column;justify-content:center">
-									<view style="text-align: center;width: 100%; font-size: 19rpx;color: #999999;padding-bottom:8rpx">差评整改率</view>
+									<view style="text-align: center;width: 100%; font-size: 24rpx;color: #999999;padding-bottom:8rpx">差评整改率</view>
 									<view style="width: 100%;display:flex;justify-content:left;align-items:center;color: #333333;">
-										<view style="width: 100%; text-align: center; font-size: 28rpx;font-weight: bold;">{{evalutionNum}}</view>
+										<view style="width: 100%; text-align: center; font-size: 28rpx;font-weight: bold;">{{badevalutionRate}}%</view>
 									</view>
 								</view>
 							</view>

+ 116 - 89
nnzwminiapp/pages/serve/serve.js

@@ -11,35 +11,62 @@ Page({
 	data: {
 		naItem: 0,
 		imgUrl: imgUrl,
-    processingData: '',
-    scroll_height:""
+		processingData: '',
+		scroll_height: "",
+		evalutionNum: "",
+		//  评价总量
+		goodevalutionRate: "",
+		//  评价总量
+		badevalutionNum: "",
+		//  评价总量
+		badevalutionRate: ""
 	},
 	getProcessingData() {
+		// wx.request({
+		// 	url: 'https://zwykb.cq.gov.cn/inspur/county/compound?regionCode=500108',
+		// 	method: 'POST',
+		// 	success: res => {
+		// 		res.data.data.DISSSATIS_RATE = Math.floor(res.data.data.DISSSATIS_NUM / (res.data.data.TOTAL_NUM - res.data.data.SATIS_NUM) * 10000) / 100;
+		// 		res.data.data.SATIS_RATE = Math.floor(res.data.data.SATIS_NUM / res.data.data.TOTAL_NUM * 10000) / 100;
+		// 		this.setData({
+		// 			processingData: res.data.data
+		// 		})
+
+		// 	}
+		// })
 		wx.request({
-			url: 'https://zwykb.cq.gov.cn/inspur/county/compound?regionCode=500108',
-			method: 'POST',
+			url: 'https://www.cqna.gov.cn/data//goodOrbad/getGoodOrBad?area=1',
+			method: 'GET',
 			success: res => {
-        // console.log(res);
-				res.data.data.DISSSATIS_RATE = Math.floor(res.data.data.DISSSATIS_NUM / (res.data.data.TOTAL_NUM - res.data.data.SATIS_NUM) * 10000) / 100;
-				res.data.data.SATIS_RATE = Math.floor(res.data.data.SATIS_NUM / res.data.data.TOTAL_NUM * 10000) / 100;
-				this.setData({
-					processingData: res.data.data
-				})
+				res = res.data;
+				if (res.result === 'ok') {
+
+					this.setData({
+						//  评价总量
+						evalutionNum: res.data.totalEvaluationNumber,
+						//  评价总量
+						goodevalutionRate: res.data.goodEvaluationRate,
+						//  评价总量
+						badevalutionNum: res.data.poorEvaluationNumber,
+						//  评价总量
+						badevalutionRate: res.data.poorEvaluationRate
+					})
 
+				}
 			}
 		})
-  },
-  gotoDTSS(e) {
+	},
+	gotoDTSS(e) {
 		const search = e.currentTarget.dataset.item
-    if (search && search != '') {
-      wx.navigateTo({
-        url: '/pagesPublic/pages/map/map?se='+search,
-      })
-    } else {
-      wx.navigateTo({
-        url: '/pagesPublic/pages/map/map',
-      })
-    }
+		if (search && search != '') {
+			wx.navigateTo({
+				url: '/pagesPublic/pages/map/map?se=' + search,
+			})
+		} else {
+			wx.navigateTo({
+				url: '/pagesPublic/pages/map/map',
+			})
+		}
 	},
 	/**
 	 * 生命周期函数--监听页面初次渲染完成
@@ -74,26 +101,26 @@ Page({
 
 	},
 	onLoad() {
-    this.getProcessingData();
-    var windowWidth = wx.getSystemInfoSync().windowWidth;
-    var windowHeight = wx.getSystemInfoSync().windowHeight;
-    //rpx与px单位之间的换算 : 750/windowWidth = 屏幕的高度(rpx)/windowHeight
-    var scroll_height = 750*windowHeight/windowWidth;
-    wx.getSystemInfo({
-      success: res => {
-        let system =  res.system.split(" ")
-        // console.log(system);
-        if (res.safeArea.top > 20 && system[0]=='iOS') { //iphonex,xr,xs
-          scroll_height =  scroll_height-70
-        }
-      },
-      fail(err) {
-        console.error(err);
-      }
-    })
-     this.setData({
-        scroll_height:scroll_height
-    })
+		this.getProcessingData();
+		var windowWidth = wx.getSystemInfoSync().windowWidth;
+		var windowHeight = wx.getSystemInfoSync().windowHeight;
+		//rpx与px单位之间的换算 : 750/windowWidth = 屏幕的高度(rpx)/windowHeight
+		var scroll_height = 750 * windowHeight / windowWidth;
+		wx.getSystemInfo({
+			success: res => {
+				let system = res.system.split(" ")
+				// console.log(system);
+				if (res.safeArea.top > 20 && system[0] == 'iOS') { //iphonex,xr,xs
+					scroll_height = scroll_height - 70
+				}
+			},
+			fail(err) {
+				console.error(err);
+			}
+		})
+		this.setData({
+			scroll_height: scroll_height
+		})
 	},
 	naChangeItem: function (e) {
 		this.setData({
@@ -122,57 +149,57 @@ Page({
 			title: '服务'
 		}
 	},
-gotocsyjs(){
-  wx.navigateTo({
-    url: '/pages/web/web?url= '+"https://mp.weixin.qq.com/s/0AYTnOLSgLRlqNgyhhfMjg",
-  })
-},
-	gotoYkb(e){
+	gotocsyjs() {
+		wx.navigateTo({
+			url: '/pages/web/web?url= ' + "https://mp.weixin.qq.com/s/0AYTnOLSgLRlqNgyhhfMjg",
+		})
+	},
+	gotoYkb(e) {
 		// console.log(e);
 		// let url =  e.currentTarget.dataset.url
 		// console.log(url);
 		// wx.navigateTo({
 		//   url: '/pages/web/web?url='+url,
-    // })	
-    wx.navigateToMiniProgram({
-      appId: 'wxfc86707bae655315',
-      success(res) {
-        // 打开成功
-      }
-    })
-  },
-  
-  toPayMini() {
-    wx.navigateToMiniProgram({
-      appId: 'wxd2ade0f25a874ee2',
-      success(res) {
-        // 打开成功
-      }
-    })
-  },
-  gotoz() {
-  		wx.navigateTo({
-  			url: '/pages/web/web?url=' + "https://www.cqna.gov.cn/data/zyylgNew/index.html#/|id)1",
-  		})
-  	},
-  	gotoy() {
-  		wx.navigateTo({
-  			url: '/pages/web/web?url=' + "https://www.cqna.gov.cn/data/zyylgNew/index.html#/|id)2",
-  		})
-  	},
-  	gotoyy() {
-  		wx.navigateTo({
-  			url: '/pages/web/web?url=' + "https://www.cqna.gov.cn/data/zyylgNew/index.html#/|id)3",
-  		})
-  	},
-  	gotol() {
-  		wx.navigateTo({
-  			url: '/pages/web/web?url=' + "https://www.cqna.gov.cn/data/zyylgNew/index.html#/|id)4",
-  		})
-  	},
-  	gotog() {
-  		wx.navigateTo({
-  			url: '/pages/web/web?url=' + "https://www.cqna.gov.cn/data/zyylgNew/index.html#/|id)5",
-  		})
-  	}
+		// })	
+		wx.navigateToMiniProgram({
+			appId: 'wxfc86707bae655315',
+			success(res) {
+				// 打开成功
+			}
+		})
+	},
+
+	toPayMini() {
+		wx.navigateToMiniProgram({
+			appId: 'wxd2ade0f25a874ee2',
+			success(res) {
+				// 打开成功
+			}
+		})
+	},
+	gotoz() {
+		wx.navigateTo({
+			url: '/pages/web/web?url=' + "https://www.cqna.gov.cn/data/zyylgNew/index.html#/|id)1",
+		})
+	},
+	gotoy() {
+		wx.navigateTo({
+			url: '/pages/web/web?url=' + "https://www.cqna.gov.cn/data/zyylgNew/index.html#/|id)2",
+		})
+	},
+	gotoyy() {
+		wx.navigateTo({
+			url: '/pages/web/web?url=' + "https://www.cqna.gov.cn/data/zyylgNew/index.html#/|id)3",
+		})
+	},
+	gotol() {
+		wx.navigateTo({
+			url: '/pages/web/web?url=' + "https://www.cqna.gov.cn/data/zyylgNew/index.html#/|id)4",
+		})
+	},
+	gotog() {
+		wx.navigateTo({
+			url: '/pages/web/web?url=' + "https://www.cqna.gov.cn/data/zyylgNew/index.html#/|id)5",
+		})
+	}
 })

+ 11 - 4
nnzwminiapp/pages/serve/serve.wxml

@@ -123,29 +123,36 @@
 		</ul>
 		<view class="x-title"><span>好差评数据</span><span>(数据截至上一自然月)</span></view>
 		<ul class="hcpsj">
+		<!-- evalutionNum: "",
+		//  评价总量
+		goodevalutionRate: "",
+		//  评价总量
+		badevalutionNum: "",
+		//  评价总量
+		badevalutionRate: "" -->
 			<li>
 				<view class="top">
 					<image style="width: 22rpx;height: 27rpx" src="{{imgUrl}}hcpsj2.png" alt=""></image><span>评价数</span>
 				</view>
-				<view class="bottom"><span class="number" style="color: #556773;">{{processingData.TOTAL_NUM}}</span><span>个</span></view>
+				<view class="bottom"><span class="number" style="color: #556773;">{{evalutionNum}}</span><span>个</span></view>
 			</li>
 			<li>
 				<view class="top">
 					<image style="width: 26rpx;height: 27rpx" src="{{imgUrl}}hcpsj1.png" alt=""></image><span>好评率</span>
 				</view>
-				<view class="bottom"><span class="number" style="color: #556773;">{{processingData.SATIS_RATE}}</span><span>%</span></view>
+				<view class="bottom"><span class="number" style="color: #556773;">{{goodevalutionRate}}</span><span>%</span></view>
 			</li>
 			<li>
 				<view class="top">
 					<image style="width: 26rpx;height: 27rpx" src="{{imgUrl}}hcpsj4.png" alt=""></image><span>差评数</span>
 				</view>
-				<view class="bottom"><span class="number" style="color: #556773;">{{processingData.DISSSATIS_NUM}}</span><span>个</span></view>
+				<view class="bottom"><span class="number" style="color: #556773;">{{badevalutionNum}}</span><span>个</span></view>
 			</li>
 			<li>
 				<view class="top">
 					<image style="width: 24rpx;height: 25rpx" src="{{imgUrl}}hcpsj3.png" alt=""></image><span>差评整改率</span>
 				</view>
-				<view class="bottom"><span class="number" style="color: #556773;">{{processingData.DISSSATIS_RATE}}</span><span>%</span></view>
+				<view class="bottom"><span class="number" style="color: #556773;">{{badevalutionRate}}</span><span>%</span></view>
 			</li>
 		</ul>
 	</view>