From d2f4d757191c4f892135ffcbbe03be6976f9234a Mon Sep 17 00:00:00 2001
From: Lou <luzhiping@qqyjz.com>
Date: Sun, 28 Apr 2024 17:45:01 +0800
Subject: [PATCH] 更新

---
 pages/login/login-account.vue  |   10 +++-
 subPackage/school/trouble.vue  |    2 
 utils/func.js                  |   21 +++++++---
 subPackage/school/security.vue |   57 ++++++++++++++++++++++------
 4 files changed, 67 insertions(+), 23 deletions(-)

diff --git a/pages/login/login-account.vue b/pages/login/login-account.vue
index d18bdf2..e8e851b 100644
--- a/pages/login/login-account.vue
+++ b/pages/login/login-account.vue
@@ -169,16 +169,20 @@
 				},
 				screenHeight: "",
 				loginType: 1, //登录类型 1账号密码   2 一键登录
-				isAgreement: true
+				isAgreement: true,
+				pageType: ""
 			}
 		},
 
 		onLoad(option) {
 			console.log(option);
 			if (option.type) {
-				//type 1   安全隐患    2 矛盾纠纷   3 护学打卡
+				//type 1   安全隐患    2 矛盾纠纷   3 护学打卡  4校园安保
 
 				uni.setStorageSync("pageType", option.type);
+			}
+			if (option.code) {
+				uni.setStorageSync("houseCode", option.code);
 			}
 
 
@@ -205,7 +209,7 @@
 						.then(data => {
 							uni.setStorageSync("phoneNmber", this.form.phone)
 							// this.getUserInfo(data);
-							this.$u.func.login(data)
+							this.$u.func.login(data, this.pageType)
 						})
 						.catch(err => {
 							this.$u.func.showToast({
diff --git a/subPackage/school/security.vue b/subPackage/school/security.vue
index 2a12a60..1ac4907 100644
--- a/subPackage/school/security.vue
+++ b/subPackage/school/security.vue
@@ -1,7 +1,7 @@
 <template>
 	<view class="wrap">
 
-		<view class="info-row flex j-c-s-b a-i-c bgc-ff" @click="isShowPopup = true">
+		<view class="info-row flex j-c-s-b a-i-c bgc-ff" @click="isShowPopup = true" v-if="!from">
 			<text class="f-28">场所名称</text>
 			<view class="flex">
 				<text class="mr-10">{{selectedPlace.placeName}}</text>
@@ -135,7 +135,9 @@
 		updatePlaceCheck,
 		auditPlaceCheck
 	} from "@/api/reporting/reporting.js"
-
+	import {
+		getQrCodeDetail
+	} from "@/api/system/index"
 	export default {
 		mixins: [uploadMixin],
 		data() {
@@ -187,7 +189,8 @@
 				isShowPopup: false,
 				selectedPlace: {},
 				placeList: [],
-				placeName: ""
+				placeName: "",
+				from: "" //页面进入来源
 			}
 		},
 		async onLoad(option) {
@@ -196,20 +199,21 @@
 				this.isEdit = true;
 				this.getDetail(option.taskId)
 			} else {
-				this.info.houseCode = "d8460d16ec5a40ccbfe64ba65d34159c7427";
-				this.info.placeName = "校学小学场所"
-				// this.info.houseCode = uni.getStorageSync("siteInfo").houseCode;
-				// this.info.placeName = uni.getStorageSync("siteInfo").name;
+				if (uni.getStorageSync("houseCode")) {
+					let houseCode = uni.getStorageSync("houseCode");
+					this.getHouseType(houseCode);
+				} else {
+					this.info.houseCode = "d8460d16ec5a40ccbfe64ba65d34159c7427";
+					this.info.placeName = "校学小学场所"
+				}
 			}
 			this.getPlaceList();
 			// if (option.houseCode) {
 			// 	this.info.houseCode = option.houseCode;
 			// }
-
 		},
 
 		methods: {
-
 			getPlaceList() {
 				getLocationRecord({
 					roleName: uni.getStorageSync('activeRole').roleName,
@@ -492,11 +496,40 @@
 				this.selectedPlace = item;
 				this.info.houseCode = item.houseCode;
 				this.isShowPopup = false;
-
-
-
 			},
 
+			getHouseType(code) {
+				getQrCodeDetail({
+					roleName: uni.getStorageSync("activeRole").roleName,
+					addressCode: code
+				}).then(res => {
+					let {
+						isJur,
+						doorplateType,
+						addressLevel
+					} = res.data;
+					if (isJur == 1) {
+						if (doorplateType == "中门牌" || doorplateType == "小门牌") {
+							if (res.data.labelCode == 160102 || res.data.labelCode == 160103) {
+								this.info.houseCode = code;
+								this.info.placeName = poi;
+								this.from = "jump"
+							} else {
+								this.$showTips("该场所不是校园类型");
+							}
+						}
+					} else {
+						uni.showModal({
+							title: "提示!",
+							content: "该区域不是您管辖范围",
+							showCancel: false
+						})
+					}
+
+				})
+			},
+
+
 		}
 	}
 </script>
diff --git a/subPackage/school/trouble.vue b/subPackage/school/trouble.vue
index 06e6494..671f45b 100644
--- a/subPackage/school/trouble.vue
+++ b/subPackage/school/trouble.vue
@@ -97,7 +97,7 @@
 
 			async getAllBizDict() {
 
-				//反诈类别
+
 				await this.getBizDict('hiddenDangerType', this.troubleTypeList);
 			},
 
diff --git a/utils/func.js b/utils/func.js
index dfca499..eada620 100644
--- a/utils/func.js
+++ b/utils/func.js
@@ -11,7 +11,7 @@
 const install = (Vue, vm) => {
 
 	// 登录操作 1
-	const login = async (userInfo) => {
+	const login = async (userInfo, pageType) => {
 		vm.$u.vuex('userInfo', userInfo)
 		vm.$u.vuex('accessToken', userInfo.access_token)
 		vm.$u.vuex('isLogin', true)
@@ -33,11 +33,16 @@
 		let appMenu = data.filter(e => e.name == 'app')[0].children
 		console.log("当前角色菜单:", appMenu)
 		store.commit('SET_MENU', appMenu)
-
-		//跳转到首页
-		uni.switchTab({
-			url: '/pages/home/index'
-		})
+		if (pageType == 4 && resDetail.data.roleAlias == "mj") {
+			uni.navigateTo({
+				url: '/subPackage/school/security'
+			})
+		} else {
+			//跳转到首页
+			uni.switchTab({
+				url: '/pages/home/index'
+			})
+		}
 
 	}
 
@@ -53,7 +58,9 @@
 		if (uni.getStorageSync("pageType")) {
 			uni.removeStorageSync("pageType")
 		}
-
+		if (uni.getStorageSync("houseCode")) {
+			uni.removeStorageSync("houseCode")
+		}
 		uni.redirectTo({
 			url: '/pages/login/login-account'
 		})

--
Gitblit v1.9.3