From c34b96f470aadd7f27d31fa5f5b0cec38289a03f Mon Sep 17 00:00:00 2001
From: Lou <luzhiping@qqyjz.com>
Date: Tue, 19 Dec 2023 17:13:40 +0800
Subject: [PATCH] 扫码逻辑更新,楼栋列表修改,部分页面优化

---
 pages/home/index.vue                          |   64 ++++++++++--
 api/system/index.js                           |   12 ++
 subPackage/user/editUserInfo/editUserInfo.vue |    2 
 subPackage/workbench/views/cscj.vue           |   54 ++++++++++
 subPackage/workbench/views/csjl.vue           |   11 +
 api/user.js                                   |    6 
 common/setting.js                             |    4 
 subPackage/house/family/index.vue             |   33 ++++--
 subPackage/statistics/index.vue               |   18 ++-
 subPackage/house/list/index.vue               |   89 ++++++++++++++++-
 10 files changed, 247 insertions(+), 46 deletions(-)

diff --git a/api/system/index.js b/api/system/index.js
index c5d6e96..4554431 100644
--- a/api/system/index.js
+++ b/api/system/index.js
@@ -22,3 +22,15 @@
 		}
 	})
 }
+
+//获取扫码详情
+export const getQrCodeDetail = (params) => {
+	return http.request({
+		url: '/blade-doorplateAddress/doorplateAddress/getDetail',
+		method: 'GET',
+		params: {
+			...params
+		}
+	})
+}
+
diff --git a/api/user.js b/api/user.js
index ff4fc91..4bf336c 100644
--- a/api/user.js
+++ b/api/user.js
@@ -95,11 +95,11 @@
 }
 
 //更新用户信息
-export const updateUserInfo = (params) => {
+export const updateUserInfo = (data) => {
 	return http.request({
 		url: '/blade-system/user/update',
-		method: 'get',
-		params: params
+		method: 'POST',
+	    data: data
 	})
 }
 
diff --git a/common/setting.js b/common/setting.js
index 9be882d..f8f9fe8 100644
--- a/common/setting.js
+++ b/common/setting.js
@@ -12,8 +12,10 @@
 	// devUrl: 'https://sk.hubeishuiyi.cn',
 	// devUrl: 'http://192.168.1.156:9528',
 	// devUrl:'http://192.168.1.50:9528',
-	// devUrl: 'http://192.168.0.102:9528',
+	// devUrl: 'http://192.168.0.112:9528',
 	devUrl:'https://srgdjczzxtpt.com:2080/api',
+	
+	// devUrl:'http://z4042833u6.wicp.vip',
 	// devUrl: 'http://192.168.0.103:9528',
 	// devUrl: 'https://srgdjczzxtpt.com:2080/api',
 	minioBaseUrl: "https://srgdjczzxtpt.com:2080/gminio/jczz/",
diff --git a/pages/home/index.vue b/pages/home/index.vue
index 6bb1519..355ba1b 100644
--- a/pages/home/index.vue
+++ b/pages/home/index.vue
@@ -170,7 +170,8 @@
 	} from "@/api/article/article";
 	import {
 		getBannerList,
-		getContact
+		getContact,
+		getQrCodeDetail
 	} from "@/api/system/index"
 	import {
 		minioBaseUrl
@@ -760,24 +761,59 @@
 			},
 			
 			getHouseType(code){
+				// getQrCodeDetail
+				
 				getPublicSecurityDetail({
-					addressCode:code
+					// roleName:"网格员"
+					addressCode:code,
 				}).then(res=>{
 					console.log(res)
-					let { doorplateType, addressLevel,aoiName,addressName,neiName } = res.data;
-					if(doorplateType == "户室牌"){
-						this.$u.func.globalNavigator(`/subPackage/house/roomDetails/index?id=${code}&from=scan`,"navTo")
-					}else if (doorplateType =="中门牌"){
-						this.$u.func.globalNavigator(
-							`/subPackage/house/houseNumber/index?stdId=${code}`, "navTo")
-					}else if (doorplateType == "楼幢牌" || doorplateType == "单元牌"){
-						let url = "/subPackage/house/family/index"
-						this.$u.func.globalNavigator(`${url}?id=${code}&address=${addressName}&neiName=${neiName}&aoiName=${aoiName}`,"navTo")
-					}else if (doorplateType  =="大门牌"){
-						this.$u.func.globalNavigator(`/subPackage/house/list/index?id=${code}&title=${aoiName}`,"navTo")
-					}
+					let {isJur,doorplateType, addressLevel,aoiName,addressName,neiName,buildingName,unitName } = res.data;
+					// if(isJur == 1){
+					   if(doorplateType == "户室牌"){
+					   	this.$u.func.globalNavigator(`/subPackage/house/roomDetails/index?id=${code}&from=scan`,"navTo")
+					   }else if (doorplateType =="中门牌"){
+					   	if(addressLevel == 4){    //自建房
+					   		this.showAction(code)
+					   	}else {                  //商铺
+					   		this.$u.func.globalNavigator(
+					   			`/subPackage/house/houseNumber/index?stdId=${code}`, "navTo")
+					   	}
+					   }else if (doorplateType == "楼幢牌"){
+					   	let url = "/subPackage/house/family/index"
+					   	this.$u.func.globalNavigator(`${url}?id=${code}&address=${addressName}&neiName=${neiName}&housingName=${aoiName}&buildingName=${buildingName}`,"navTo")
+					   }else if ( doorplateType == "单元牌"){
+					   	let url = "/subPackage/house/family/index"
+					   	this.$u.func.globalNavigator(`${url}?id=${code}&address=${addressName}&neiName=${neiName}&housingName=${aoiName}&buildingName=${buildingName}&unitName=${unitName}`,"navTo")
+					   }else if (doorplateType  =="大门牌"){
+					   	this.$u.func.globalNavigator(`/subPackage/house/list/index?id=${code}&title=${aoiName}&neiName=${neiName}&address=${addressName}`,"navTo")
+					   }
+						   
+					// }else {
+					//     uni.showModal({
+					//     	title:"提示!",
+					// 		content:"该区域不是您管辖范围",
+					// 		showCancel:false
+					//     })	
+					// }
 				})	
+			},
+			
+			showAction(code){
+				uni.showActionSheet({
+					title:"请选择",
+					itemList: ['场所', '户室'],
+					success:(res)=>{
+						if(res.tapIndex == 0){
+							this.$u.func.globalNavigator(
+								`/subPackage/house/houseNumber/index?stdId=${code}`, "navTo")
+						}else {
+							this.$u.func.globalNavigator(`/subPackage/house/roomDetails/index?id=${code}&from=scan`,"navTo")
+						}
+					}
+				})
 			}
+			
 		}
 	}
 </script>
diff --git a/subPackage/house/family/index.vue b/subPackage/house/family/index.vue
index 63442a4..a4348fa 100644
--- a/subPackage/house/family/index.vue
+++ b/subPackage/house/family/index.vue
@@ -8,10 +8,11 @@
 			<block  v-if="addressName">
 			<view class="cur-header">
 				<u-icon name="/static/icon/map.png" width="15" height="18"></u-icon>
-				<view>{{housingName}}/{{buildingName}}</view>
+				<view>{{neiName}}/{{housingName}}{{buildingName}}</view>
 			</view>
-			<view class="house-address f-26  bgc-ff"  >
-				{{addressName}}
+			<view class="house-address f-26  bgc-ff">
+				<text>标准地址:</text>
+				<text>{{addressName}}</text>
 			</view>
 			</block>
 			<view class="h0 flex-1 build-list-box content">
@@ -137,15 +138,17 @@
 				isShowBuild: false,
 				isShowShop: false,
 				currentId: '',
-				housingName: '',
-				buildingName: 0,
+				housingName: '',    //楼盘名称
+				buildingName: 1,    //楼栋名称
 				addressType: 1,
 				// 社区编号
 				neiCode: "",
 				buildingList: [],
 				shopList: [],
 				curSelectSite: {},
-				addressName:""
+				addressName:""    ,//详细地址
+				neiName:""   ,//居委会名称
+				unitName:""    //单元名称
 			}
 		},
 		onLoad(e) {
@@ -160,14 +163,22 @@
 			this.housingName = housingName
 			this.buildingName = buildingName
 			if(addressType){
-					this.addressType = addressType
+				this.addressType = addressType
 			}
-		
 			this.neiCode = neiCode
-			if(e.address){
+			
+			if(e.address){       //扫码跳入
 				this.addressName = e.address;
-				this.housingName = e.neiName;
-				this.buildingName = e.aoiName
+				this.neiName = e.neiName;
+				if(e.unitName){
+					uni.setNavigationBarTitle({
+						title:`${housingName}${buildingName}${e.unitName}`
+					})
+				}else{
+					uni.setNavigationBarTitle({
+						title:`${housingName}${buildingName}`
+					})
+				}
 			}
 
 		},
diff --git a/subPackage/house/list/index.vue b/subPackage/house/list/index.vue
index eb8cd26..5103c59 100644
--- a/subPackage/house/list/index.vue
+++ b/subPackage/house/list/index.vue
@@ -2,9 +2,39 @@
 	<view class="container">
 		<view class="header">
 			<u-icon name="/static/icon/map.png" width="15" height="18"></u-icon>
-			<text>{{ curSelectSite.name }}/{{ curHouseTitle }}</text>
+			<text v-if="!addressName">{{ curSelectSite.name }}/{{ curHouseTitle }}</text>
+			<text v-if="addressName">{{ neiName }}/{{ curHouseTitle }}</text>
 		</view>
+	   <view class="house-address f-26 bgc-ff"   v-if="addressName">
+	   	   <text>标准地址:</text>
+		   <text>{{addressName}}</text>
+	   </view>
+	   
+
+	   <view class="cell flex j-c-s-b flex-wrap "   v-if="addressName">
+	   	<view class="cell-item">
+	   		<text class="f-28 mb-20 c-99">楼栋数(幢)</text>
+	   		<text class="f-30 fw">{{houseData.result1}}</text>
+	   		<image class="cell-item-icon" src="/static/icon/statistics-nav-01.png" mode="aspectFill"></image>
+	   	</view>
+	   	<view class="cell-item">
+	   		<text class="f-28 mb-20 c-99">房屋数(套)</text>
+	   		<text class="f-30 fw">{{houseData.result2}}</text>
+	   		<image class="cell-item-icon" src="/static/icon/statistics-nav-02.png" mode="aspectFill"></image>
+	   	</view>
+	   	<view class="cell-item">
+	   		<text class="f-28 mb-20 c-99">住户数(人)</text>
+	   		<text class="f-30 fw">{{houseData.result3}}</text>
+	   		<image class="cell-item-icon" src="/static/icon/statistics-nav-03.png" mode="aspectFill"></image>
+	   	</view>
+	   	<view class="cell-item">
+	   		<text class="f-28 mb-20 c-99">单元数</text>
+	   		<text class="f-30 fw">{{houseData.result4}}</text>
+	   		<image class="cell-item-icon" src="/static/icon/statistics-nav-01.png" mode="aspectFill"></image>
+	   	</view>
+	   </view>
 	
+	   
 		<view class="flex f-d-c main">
 			<view class="flex house-container">
 				<view class="house-list-box" v-if="isShowAoi" v-for="(item, index) in houseList"
@@ -37,6 +67,7 @@
 	import {
 		getHouseList
 	} from "@/api/doorplateAddress/doorplateAddress";
+	import { getHouseStatistics } from "@/api/statistics/statistics.js"
 	export default {
 		components: {},
 
@@ -53,7 +84,10 @@
 				}],
 				shopList: [{
 					name: '-'
-				}]
+				}],
+				addressName:"",
+				neiName:"",
+				houseData:{}
 			}
 		},
 		onLoad(e) {
@@ -66,8 +100,12 @@
 			if(e.addressType){
 				this.addressType = e.addressType
 			}
-			
-
+			if(e.address){
+				this.addressName = e.address;
+				this.neiName = e.neiName;
+				uni.setNavigationBarTitle({title})
+				this.getHouseData(id)
+			}
 		},
 		onShow() {
 			this.curSelectSite = uni.getStorageSync('siteInfo')
@@ -145,7 +183,17 @@
 					let url = `/subPackage/house/houseNumber/index?stdId=${id}`
 					this.$u.func.globalNavigator(url, "navTo")
 				}
-			}
+			},
+			
+			getHouseData(code) {
+				getHouseStatistics({
+					code: code,
+					roleType: 1
+				}).then(res => {
+					this.houseData = res.data;
+				})
+			},
+			
 		}
 	}
 </script>
@@ -195,4 +243,35 @@
 			}
 		}
 	}
+	.house-address{
+		padding: 20rpx;
+	}
+	.cell {
+		padding: 20rpx;
+	
+		.cell-item {
+			// width: 220rpx;
+			width: calc(50% - 20rpx);
+			height: 190rpx;
+			border-radius: 10rpx;
+			margin-bottom: 20rpx;
+			display: flex;
+			flex-direction: column;
+			justify-content: center;
+			background-color: #fff;
+			padding: 0 20rpx;
+			box-sizing: border-box;
+			position: relative;
+			box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.1);
+		}
+	
+		.cell-item-icon {
+			width: 64rpx;
+			height: 64rpx;
+			position: absolute;
+			right: 20rpx;
+			top: 20rpx;
+		}
+	}
+	
 </style>
\ No newline at end of file
diff --git a/subPackage/statistics/index.vue b/subPackage/statistics/index.vue
index 9a55d60..c2c6699 100644
--- a/subPackage/statistics/index.vue
+++ b/subPackage/statistics/index.vue
@@ -27,32 +27,36 @@
 		</view>
 
 		<view class="">
-			<caption-row title="共治人员"></caption-row>
+			<caption-row title="共治力量"></caption-row>
 			<view class="menu bgc-ff flex flex-wrap">
 				<view class="menu-item flex f-d-c a-i-c">
 					<text class="c-main f-32 fw mb-20">0</text>
 					<text class="f-28">党员</text>
 				</view>
 				<view class="menu-item flex f-d-c a-i-c">
-					<text class="c-main f-32 fw mb-20">{{gridData.gridStatistics}}</text>
-					<text class="f-28">网格</text>
+					<text class="c-main f-32 fw mb-20">0</text>
+					<text class="f-28">党组织</text>
 				</view>
 				<view class="menu-item flex f-d-c a-i-c">
+					<text class="c-main f-32 fw mb-20">{{gridData.gridStatistics}}</text>
+					<text class="f-28">网格员</text>
+				</view>
+			<!-- 	<view class="menu-item flex f-d-c a-i-c">
 					<text class="c-main f-32 fw mb-20">0</text>
 					<text class="f-28">社工</text>
-				</view>
+				</view> -->
 				<view class="menu-item flex f-d-c a-i-c">
 					<text class="c-main f-32 fw mb-20">{{gridData.companyStatistics}}</text>
-					<text class="f-28">物业</text>
+					<text class="f-28">物业人员</text>
 				</view>
 				<view class="menu-item flex f-d-c a-i-c">
 					<text class="c-main f-32 fw mb-20">0</text>
 					<text class="f-28">业委会</text>
 				</view>
-				<view class="menu-item flex f-d-c a-i-c">
+				<!-- <view class="menu-item flex f-d-c a-i-c">
 					<text class="c-main f-32 fw mb-20">0</text>
 					<text class="f-28">群团组织</text>
-				</view>
+				</view> -->
 			</view>
 		</view>
 
diff --git a/subPackage/user/editUserInfo/editUserInfo.vue b/subPackage/user/editUserInfo/editUserInfo.vue
index 3fc9db7..c80d99c 100644
--- a/subPackage/user/editUserInfo/editUserInfo.vue
+++ b/subPackage/user/editUserInfo/editUserInfo.vue
@@ -15,7 +15,7 @@
 				
 			</view>
 		</view>
-		<footer-btn text="确定"   />
+		<footer-btn text="确定"   @click="submitInfo"  />
 	</view>
 </template>
 
diff --git a/subPackage/workbench/views/cscj.vue b/subPackage/workbench/views/cscj.vue
index 9492754..6ed926a 100644
--- a/subPackage/workbench/views/cscj.vue
+++ b/subPackage/workbench/views/cscj.vue
@@ -38,10 +38,27 @@
 					</u--input>
 				</u-form-item>
 
-				<u-form-item class="form-item" labelWidth="100" label="经纬度:" prop="location">
+				<!-- <u-form-item class="form-item" labelWidth="100" label="经纬度:" prop="location">
 					<u--input border="none" disabled disabledColor="#ffffff" v-model="form.jwd" placeholder="请输入">
 					</u--input>
+				</u-form-item> -->
+				
+				
+				<u-form-item label="经纬度:" prop="location">
+					<view class="address-row flex">
+						<view class="address-content f-28" v-if="form.jwd">
+							{{form.jwd}}
+						</view>
+						<view class="address-content f-28 c-99" v-if="!form.jwd">
+							请选择地址
+						</view>
+						<view class="location-btn c-main f-24" @click="getLocation()">
+							获取地址
+						</view>
+					</view>
 				</u-form-item>
+				
+				
 			</view>
 
 			<view class="item">
@@ -620,6 +637,16 @@
 					}
 				});
 			},
+			
+			getLocation() {
+				uni.chooseLocation({
+					success: (res) => {
+						this.form.lat = res.latitude;
+						this.form.lng = res.longitude;
+						this.form.jwd = `${Number(res.latitude).toFixed(6)},${Number(res.longitude).toFixed(6)}`
+					}
+				})
+			},
 
 			async getDoorplateAddressList(code, type) {
 				const res = await getDoorplateAddressList(code, type)
@@ -853,4 +880,29 @@
 		background-color: green;
 		border-radius: 0rpx 10rpx 10rpx 0rpx;
 	}
+	
+	
+	.address-row {
+		flex: 1;
+		justify-content: flex-end;
+		align-items: center;
+	}
+	
+	.address-content {
+		width: calc(100% - 116rpx - 20rpx);
+		margin-right: 20rpx;
+		text-align: right;
+	}
+	
+	.location-btn {
+		width: 116rpx;
+		height: 46rpx;
+		line-height: 46rpx;
+		border-radius: 4rpx;
+		border: 1px solid currentColor;
+		padding: 0;
+		background-color: #fff;
+		text-align: center;
+	}
+	
 </style>
\ No newline at end of file
diff --git a/subPackage/workbench/views/csjl.vue b/subPackage/workbench/views/csjl.vue
index 8b96655..8ccf15a 100644
--- a/subPackage/workbench/views/csjl.vue
+++ b/subPackage/workbench/views/csjl.vue
@@ -66,14 +66,18 @@
 				tabsType: 0,
 				status: 'nomore',
 				currentRole: {},
-				from:"home"   //页面跳入来源
+				from:"home"   ,//页面跳入来源
+				houseCode:""
 			}
 		},
 		onLoad(option){
 			if(option.from){
 				this.from = option.from;
-				this.iptContext = option.name;
+				// this.iptContext = option.name;
 				// this.getrRecordList(option.name);
+			}
+			if(option.stdId){
+				this.houseCode = option.stdId
 			}
 		},
 		
@@ -109,7 +113,8 @@
 					placeName,
 					isPerfect,
 					roleName,
-					...this.pagingParams
+					...this.pagingParams,
+					houseCode:this.houseCode
 				})
 				if (code !== 200) {
 					this.$u.func.showToast({

--
Gitblit v1.9.3