17755135699 10 months ago
parent
commit
42b747606a

+ 3 - 3
http/baseApi.js

@@ -1,11 +1,11 @@
-// const BaseApi = 'http://192.168.2.190:8080' //汪瑶
+const BaseApi = 'http://192.168.2.190:8080' //汪瑶
 // const BaseApi = 'http://192.168.2.205:8080' //汪辉
-// const BaseApi = 'http://192.168.2.19:8080' //李勇
+ //const BaseApi = 'http://192.168.2.19:8080' //李勇
 // const BaseApi = 'http://192.168.3.13:8080' //徐涛
 // const BaseApi = 'http://192.168.2.39:8080' //肖添伟
 // const BaseApi = 'http://192.168.3.6:8080' //朱壮波
 
-const BaseApi = 'https://i.ringzle.com/island-cloud-server' //测试服务器 
+//const BaseApi = 'https://i.ringzle.com/island-cloud-server' //测试服务器 
 
 export {
 	BaseApi

+ 270 - 101
http/index.js

@@ -1,108 +1,277 @@
-import http from './interface'
-
-export const $http = (url, method, data, json, isAuth, isBuffer) => {
-	let authorization = uni.getStorageSync('authorization') || 'Basic cmVucmVuaW86cmVucmVuaW8=';
-	let access_token = uni.getStorageSync('access_token') || '';
-	//设置请求前拦截器
-	http.interceptor.request = (config) => {
-		uni.showLoading({
-			title: '加载中...'
-		})
-		config.header = {
-			'content-type': json ? 'application/json' : 'application/x-www-form-urlencoded',
-			'access_token': access_token
-		}
-		if (isAuth) config.header.authorization = authorization;
-		if (isBuffer) config.responseType = 'arrayBuffer';
-	}
-	//设置请求结束后拦截器
-	http.interceptor.response = async (response) => {
-		//判断返回状态 执行相应操作
-		uni.hideLoading()
-		if ((response.data && response.data.code && response.data.code === 401) ||
-			(response.data && response.data.msg && (response.data.msg.indexOf('未授权') > -1 ||
-				response.data.msg.indexOf('重新登录') > -1))) {
-			return uni.showModal({
-				title: '温馨提示',
-				content: '当前登录已失效,是否重新登录?',
-				success: (res) => {
+import http from './interface'
+import {
+	decrypt
+} from '../utils/aes.js'
+
+//解密脱敏字段集合 type(姓名 1、手机号 2、身份证 3)
+const tmList = [{
+		prop: 'card',
+		type: 3
+	},
+	{
+		prop: 'phone',
+		type: 2
+	},
+	{
+		prop: 'passengerName',
+		type: 1
+	},
+	{
+		prop: 'contactNum',
+		type: 2
+	},
+	{
+		prop: 'linkPerson',
+		type: 1
+	},
+	{
+		prop: 'linkPhone',
+		type: 2
+	},
+	{
+		prop: 'passName',
+		type: 1
+	},
+	{
+		prop: 'credentialNum',
+		type: 3
+	},
+	{
+		prop: 'phoneNum',
+		type: 2
+	},
+	{
+		prop: 'guestName',
+		type: 1
+	},
+	{
+		prop: 'guestPhone',
+		type: 2
+	},
+	{
+		prop: 'touristName',
+		type: 1
+	},
+	{
+		prop: 'touristCode',
+		type: 3
+	},
+	{
+		prop: 'touristPhone',
+		type: 2
+	},
+	{
+		prop: 'landlinePhone',
+		type: 2
+	},
+	{
+		prop: 'linkName',
+		type: 1
+	},
+	{
+		prop: 'linkMobile',
+		type: 2
+	},
+	{
+		prop: 'idCode',
+		type: 3
+	},
+	{
+		prop: 'complainantName',
+		type: 1
+	},
+	{
+		prop: 'complainantPhone',
+		type: 2
+	},
+	{
+		prop: 'idCard',
+		type: 3
+	},
+	{
+		prop: 'guestName',
+		type: 1
+	},
+	{
+		prop: 'guestPhone',
+		type: 2
+	},
+	{
+		prop: 'checkInName',
+		type: 1
+	},
+	{
+		prop: 'checkInPhone',
+		type: 2
+	},
+	{
+		prop: 'legalPerson',
+		type: 1
+	},
+	{
+		prop: 'operatorCard',
+		type: 3
+	}
+];
+// 不做脱敏处理的api集合(页面上需要编辑单独处理的)
+const apiList = [
+	'/api/commonPerson/list',
+]
+//解密脱敏处理
+function dealJmTmData(data, url) {
+	if (!data) return;
+	let keys = Object.keys(data);
+	keys.forEach(k => {
+		let _t = tmList.find(t => t.prop == k);
+		if (_t) {
+			data[k] = data[k] ? (decrypt(data[k]) || data[k]) : '';
+			if (!apiList.includes(url)) data[k] = tmRules(data[k], _t.type);
+		}
+
+		if (typeof data[k] === 'object') {
+			dealJmTmData(data[k], url);
+		} else if (Array.isArray(data[k])) {
+			data[k].forEach(dk => {
+				if (typeof dk === 'object') {
+					dealJmTmData(dk, url);
+				}
+			})
+		}
+	})
+}
+
+// 脱敏规则
+function tmRules(value, type) {
+	if (!value) return;
+	let res = '';
+	if (type == 1) {
+		let arr = Array.from(value)
+		if (arr.length === 2) {
+			res = arr[0] + '*'
+		} else if (arr.length > 2) {
+			for (let i = 1; i < arr.length - 1; i++) {
+				arr[i] = '*'
+			}
+			res = arr.join("")
+		} else {
+			res = value
+		}
+	} else if (type == 2) {
+		res = value.replace(/^(.{3})(?:\d+)(.{4})$/, "$1****$2");
+	} else if (type == 3) {
+		res = value.replace(/^(.{4})(?:\d+)(.{4})$/, "$1**********$2");
+	}
+
+	return res;
+}
+
+export const $http = (url, method, data, json, isAuth, isBuffer) => {
+	let authorization = uni.getStorageSync('authorization') || 'Basic cmVucmVuaW86cmVucmVuaW8=';
+	let access_token = uni.getStorageSync('access_token') || '';
+	//设置请求前拦截器
+	http.interceptor.request = (config) => {
+		uni.showLoading({
+			title: '加载中...'
+		})
+		config.header = {
+			'content-type': json ? 'application/json' : 'application/x-www-form-urlencoded',
+			'access_token': access_token
+		}
+		if (isAuth) config.header.authorization = authorization;
+		if (isBuffer) config.responseType = 'arrayBuffer';
+	}
+	//设置请求结束后拦截器
+	http.interceptor.response = async (response) => {
+		//判断返回状态 执行相应操作
+
+		uni.hideLoading()
+		if ((response.data && response.data.code && response.data.code === 401) ||
+			(response.data && response.data.msg && (response.data.msg.indexOf('未授权') > -1 ||
+				response.data.msg.indexOf('重新登录') > -1))) {
+			return uni.showModal({
+				title: '温馨提示',
+				content: '当前登录已失效,是否重新登录?',
+				success: (res) => {
 					if (res.confirm) {
 						uni.clearStorageSync();
 						// #ifdef APP-PLUS
-							uni.reLaunch({
-								url: '/pages/login/appIndex'
-							})
+						uni.reLaunch({
+							url: '/pages/login/appIndex'
+						})
 						// #endif
 						// #ifdef MP-WEIXIN
-							uni.reLaunch({
-								url: '/pages/login/index'
-							})
+						uni.reLaunch({
+							url: '/pages/login/index'
+						})
 						// #endif
-					}
-				}
-			})
-		}
-
-		// 请根据后端规定的状态码判定
-		if (response.data.code === 300) { //token失效
-			//	return response.data = await doRequest(response, url)//动态刷新token,并重新完成request请求
-		} else {
-			if (response.data.code == 10021 && response.data.msg) {
-				uni.showToast({
-					title: response.data.msg,
-					icon: 'none',
-					duration: 1500
-				})
-			}
-		}
-
-		return response;
-	}
-	return http.request({
-		method: method,
-		url: url,
-		dataType: 'json',
-		data,
-	})
-}
-
-async function login() {
-	return new Promise(resolve => {
-		uni.login({
-			provider: 'weixin',
-			success(loginRes) {
-				resolve(loginRes.code)
-			},
-			fail() {}
-		});
-	})
-}
-
-function postJson(url, data, json = true, isAuth = true, isBuffer = false) {
-	return $http(url, 'POST', data, json, isAuth, isBuffer)
-}
-
-function get(url, data, json = true, isAuth = true, isBuffer = false) {
-
-	return $http(url, 'GET', data, json, isAuth, isBuffer)
-}
-
-function post(url, data, json = true, isAuth = true, isBuffer = false) {
-	return $http(url, 'POST', data, json, isAuth, isBuffer)
-}
-
-function put(url, data, json = true, isAuth = true, isBuffer = false) {
-	return $http(url, 'PUT', data, json, isAuth, isBuffer)
-}
-
-function del(url, data, json = true, isAuth = true, isBuffer = false) {
-	return $http(url, 'DELETE', data, json, isAuth, isBuffer)
-}
-
-export default {
-	postJson,
-	get,
-	post,
-	put,
-	del
+					}
+				}
+			})
+		}
+
+		// 请根据后端规定的状态码判定
+		if (response.data.code === 300) { //token失效
+			//	return response.data = await doRequest(response, url)//动态刷新token,并重新完成request请求
+		} else {
+			if (response.data.code == 10021 && response.data.msg) {
+				uni.showToast({
+					title: response.data.msg,
+					icon: 'none',
+					duration: 1500
+				})
+			}
+		}
+		//数据解密脱敏处理
+		if (response.data && response.data.data) {
+			dealJmTmData(response.data.data, url);
+		}
+		return response;
+	}
+	return http.request({
+		method: method,
+		url: url,
+		dataType: 'json',
+		data,
+	})
+}
+
+async function login() {
+	return new Promise(resolve => {
+		uni.login({
+			provider: 'weixin',
+			success(loginRes) {
+				resolve(loginRes.code)
+			},
+			fail() {}
+		});
+	})
+}
+
+function postJson(url, data, json = true, isAuth = true, isBuffer = false) {
+	return $http(url, 'POST', data, json, isAuth, isBuffer)
+}
+
+function get(url, data, json = true, isAuth = true, isBuffer = false) {
+
+	return $http(url, 'GET', data, json, isAuth, isBuffer)
+}
+
+function post(url, data, json = true, isAuth = true, isBuffer = false) {
+	return $http(url, 'POST', data, json, isAuth, isBuffer)
+}
+
+function put(url, data, json = true, isAuth = true, isBuffer = false) {
+	return $http(url, 'PUT', data, json, isAuth, isBuffer)
+}
+
+function del(url, data, json = true, isAuth = true, isBuffer = false) {
+	return $http(url, 'DELETE', data, json, isAuth, isBuffer)
+}
+
+export default {
+	postJson,
+	get,
+	post,
+	put,
+	del
 }

+ 14 - 26
package-lock.json

@@ -1,41 +1,29 @@
 {
-  "name": "hotelHomestayWx",
-  "lockfileVersion": 3,
   "requires": true,
-  "packages": {
-    "": {
-      "dependencies": {
-        "@qiun/ucharts": "^2.5.0-20230101",
-        "debounce": "^2.0.0",
-        "uniapp-qrcode": "^1.0.2",
-        "uview-ui": "^2.0.36"
-      }
+  "lockfileVersion": 1,
+  "dependencies": {
+    "@qiun/ucharts": {
+      "version": "2.5.0-20230101"
     },
-    "node_modules/@qiun/ucharts": {
-      "version": "2.5.0-20230101",
-      "resolved": "https://registry.npmjs.org/@qiun/ucharts/-/ucharts-2.5.0-20230101.tgz",
-      "integrity": "sha512-C7ccBgfPuGF6dxTRuMW0NPPMSCf1k/kh3I9zkRVBc5PaivudX/rPL+jd2Wty6gn5ya5L3Ob+YmYe09V5xw66Cw=="
+    "crypto-js": {
+      "version": "4.2.0",
+      "resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.2.0.tgz",
+      "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q=="
     },
-    "node_modules/debounce": {
+    "debounce": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/debounce/-/debounce-2.0.0.tgz",
-      "integrity": "sha512-xRetU6gL1VJbs85Mc4FoEGSjQxzpdxRyFhe3lmWFyy2EzydIcD4xzUvRJMD+NPDfMwKNhxa3PvsIOU32luIWeA==",
-      "engines": {
-        "node": ">=18"
-      }
+      "integrity": "sha512-xRetU6gL1VJbs85Mc4FoEGSjQxzpdxRyFhe3lmWFyy2EzydIcD4xzUvRJMD+NPDfMwKNhxa3PvsIOU32luIWeA=="
     },
-    "node_modules/uniapp-qrcode": {
+    "uniapp-qrcode": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/uniapp-qrcode/-/uniapp-qrcode-1.0.2.tgz",
       "integrity": "sha512-jcWwWz4yXsO7if/+78MMXj5VUdZTLu2D6L/IKb4mJkIw87oF11pO3WS/jS27SUcPCrX/BKcir5a2R1uvkaoR9g=="
     },
-    "node_modules/uview-ui": {
+    "uview-ui": {
       "version": "2.0.36",
-      "resolved": "https://registry.npmmirror.com/uview-ui/-/uview-ui-2.0.36.tgz",
-      "integrity": "sha512-ASSZT6M8w3GTO1eFPbsgEFV0U5UujK+8pTNr+MSUbRNcRMC1u63DDTLJVeArV91kWM0bfAexK3SK9pnTqF9TtA==",
-      "engines": {
-        "HBuilderX": "^3.1.0"
-      }
+      "resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.36.tgz",
+      "integrity": "sha512-ASSZT6M8w3GTO1eFPbsgEFV0U5UujK+8pTNr+MSUbRNcRMC1u63DDTLJVeArV91kWM0bfAexK3SK9pnTqF9TtA=="
     }
   }
 }

+ 1 - 0
package.json

@@ -1,6 +1,7 @@
 {
   "dependencies": {
     "@qiun/ucharts": "^2.5.0-20230101",
+    "crypto-js": "^4.2.0",
     "debounce": "^2.0.0",
     "uniapp-qrcode": "^1.0.2",
     "uview-ui": "^2.0.36"

+ 6 - 3
pages.json

@@ -339,21 +339,24 @@
 					"path": "Mine/PersonalEditing/PersonalEditing",
 					"style": {
 						"navigationBarTitleText": "编辑",
-						"enablePullDownRefresh": false
+						"enablePullDownRefresh": false,
+						"navigationStyle": "custom"
 					}
 				},
 				{
 					"path": "Mine/Businesses/Businesses",
 					"style": {
 						"navigationBarTitleText": "商户信息",
-						"enablePullDownRefresh": false
+						"enablePullDownRefresh": false,
+						"navigationStyle": "custom"
 					}
 				},
 				{
 					"path": "Mine/Businesses/Catering",
 					"style": {
 						"navigationBarTitleText": "商户信息",
-						"enablePullDownRefresh": false
+						"enablePullDownRefresh": false,
+						"navigationStyle": "custom"
 					}
 				},
 				{

+ 123 - 42
pages/house/createOrder.vue

@@ -47,8 +47,7 @@
 				<view class="end" v-if="dataForm.leaveDate">
 					<text>离店日期</text>
 					<text @click="showPick()" class="txt">{{dataForm.leaveDate.substring(5,10)}}</text>
-					<u-datetime-picker :show="leaveDateShow"  mode="date" ref="picker"
-						@cancel="leaveDateShow=false"
+					<u-datetime-picker :show="leaveDateShow" mode="date" ref="picker" @cancel="leaveDateShow=false"
 						@confirm="credentialsConfirmtime" :defaultIndex="credentialsDefaulttime"></u-datetime-picker>
 				</view>
 			</view>
@@ -161,10 +160,13 @@
 </template>
 
 <script>
+	import {
+		encrypt
+	} from '../../utils/aes.js'
 	export default {
 		data() {
 			return {
-				credentialsDefaulttime:[10,1,0],
+				credentialsDefaulttime: [10, 1, 0],
 				titleStyle: {
 					fontSize: '34rpx',
 					fontWeight: "bold",
@@ -189,7 +191,7 @@
 						checkInPersonList: [],
 						checkInType: 0,
 						checkInTypeName: '',
-						id:0,
+						id: 0,
 						otherAmount: 0,
 						roomAmount: 0,
 						roomIds: "",
@@ -224,13 +226,17 @@
 						}
 					]
 				],
-				flowTypeNames:['微信','支付宝','云闪付'],
+				flowTypeNames: ['微信', '支付宝', '云闪付'],
 				roomId: '',
 				laiyuan: [
 					[]
 				],
 				currentDate: '',
-				today: ''
+				today: '',
+				//加密备用
+				tempCheckInPersonList: null,
+				tempGuestName: null,
+				tempGuestPhone: null
 			}
 		},
 		onReady() {
@@ -261,23 +267,23 @@
 			this.currentDate = year + '-' + mon + '-' + day;
 		},
 		methods: {
-			showPick(){
-				this.leaveDateShow=true;
-				this.$refs.picker.innerValue=new Date().getTime()
+			showPick() {
+				this.leaveDateShow = true;
+				this.$refs.picker.innerValue = new Date().getTime()
 			},
 			//i计算天数
-			getDaysBetween(dateString1,dateString2){
-			    var  startDate =Date.parse(dateString1);
-			    var  endDate =Date.parse(dateString2);
-			    if (startDate>endDate){
-			        return 0;
-			    }
-			    if (startDate==endDate){
-			        return 1;
-			    }
-			    var days=(endDate - startDate)/(1*24*60*60*1000);
-				this.dataForm.num=days;
-			    //return  days;
+			getDaysBetween(dateString1, dateString2) {
+				var startDate = Date.parse(dateString1);
+				var endDate = Date.parse(dateString2);
+				if (startDate > endDate) {
+					return 0;
+				}
+				if (startDate == endDate) {
+					return 1;
+				}
+				var days = (endDate - startDate) / (1 * 24 * 60 * 60 * 1000);
+				this.dataForm.num = days;
+				//return  days;
 			},
 			credentialsConfirmtime(e) {
 				// 创建一个Date对象并传入时间戳
@@ -288,13 +294,13 @@
 				const day = ('0' + date.getDate()).slice(-2);
 				// 格式化时间
 				const formattedTime = `${year}-${month}-${day}`;
-			
+
 				this.dataForm.leaveDate = formattedTime;
-				this.getDaysBetween(this.dataForm.arriveDate,this.dataForm.leaveDate);
+				this.getDaysBetween(this.dataForm.arriveDate, this.dataForm.leaveDate);
 				this.leaveDateShow = false;
 			},
 			compareDate(data) {
-				let data2=data.substring(0,10);
+				let data2 = data.substring(0, 10);
 				if (
 					new Date(data2).getTime() < new Date(this.currentDate).getTime()
 				) {
@@ -381,20 +387,25 @@
 			delPer(index) {
 				this.dataForm.detailFormList[0].checkInPersonList.splice(index, 1)
 			},
-			confirmOrder(orderStatus) {
-				if(!this.dataForm.guestName){
+			confirmOrder(orderStatus) {		
+				if (!this.dataForm.guestName) {
 					this.$showToast('请输入姓名');
 					return
 				}
-				if(!this.$u.test.mobile(this.dataForm.guestPhone)){
+				let value = this.dataForm.guestPhone;
+				if (value.indexOf("**") > -1) {
+					value = value.replace(/\*/g, "5");
+				}
+				if (!this.$u.test.mobile(value)) {
 					this.$showToast('请输入正确手机号');
 					return
 				}
-				if(!this.dataForm.guestSourceName){
+				if (!this.dataForm.guestSourceName) {
 					this.$showToast('请选择来源');
 					return
 				}
-				if(!this.dataForm.detailFormList[0].checkInPersonList||this.dataForm.detailFormList[0].checkInPersonList.length==0){
+				if (!this.dataForm.detailFormList[0].checkInPersonList || this.dataForm.detailFormList[0].checkInPersonList
+					.length == 0) {
 					this.$showToast('请添加入住人');
 					return
 				}
@@ -411,7 +422,70 @@
 				} else {
 					url = '/merchant/hotel/order/placeOrder'
 				}
-				this.$api.post(url, this.dataForm).then(res => {
+				//加密
+				let newDataForm = JSON.parse(JSON.stringify(this.dataForm));
+				if (
+					newDataForm.guestName &&
+					this.tempGuestName != newDataForm.guestName
+				) {
+					//编辑了
+					newDataForm.guestName = encrypt(
+						newDataForm.guestName
+					);
+				} else {
+					newDataForm.guestName = null;
+				}
+				if (
+					newDataForm.guestPhone &&
+					this.tempGuestPhone != newDataForm.guestPhone
+				) {
+					newDataForm.guestPhone = encrypt(
+						newDataForm.guestPhone
+					);
+				} else {
+					newDataForm.guestPhone = null;
+				}
+				let checkInPersonList =
+					newDataForm.detailFormList[0].checkInPersonList;
+				//入住人里面身份证
+				//let len = this.tempCheckInPersonList;
+				checkInPersonList.forEach((element, i) => {
+					//姓名 checkInName,idCard,checkInPhone
+					//新增直接加密,编辑判断是否修改
+					if (
+						(!this.tempCheckInPersonLis) ||
+						element.checkInName &&
+						element.checkInName != this.tempCheckInPersonList[i].checkInName
+					) {
+						element.checkInName = encrypt(element.checkInName);
+					} else {
+						element.checkInName = null;
+					}
+					//身份证
+					if (
+						(!this.tempCheckInPersonLis) ||
+						element.idCard &&
+						element.idCard != this.tempCheckInPersonList[i].idCard
+					) {
+						element.idCard = encrypt(element.idCard);
+					} else {
+						element.idCard = null;
+					}
+					//手机号
+					if (
+						(!this.tempCheckInPersonLis) ||
+						element.checkInPhone &&
+						element.checkInPhone != this.tempCheckInPersonList[i].checkInPhone
+					) {
+						element.checkInPhone = encrypt(
+							element.checkInPhone
+						);
+					} else {
+						element.checkInPhone = null;
+					}
+				});
+				newDataForm.detailFormList[0].checkInPersonList = checkInPersonList;
+				this.$api.post(url, newDataForm).then(res => {
 					if (res.data.code == 0) {
 						this.$showToast('操作成功');
 						setTimeout(() => {
@@ -456,20 +530,25 @@
 							...this.dataForm,
 							...res.data.data,
 						};
+						//加密备用
+						this.tempCheckInPersonList =
+							this.dataForm.detailFormList[0].checkInPersonList || []; //入住人集合
+						this.tempGuestName = this.dataForm.guestName;
+						this.tempGuestPhone = this.dataForm.guestPhone;
 						this.compareDate(this.dataForm.arriveDate);
 						this.dataForm.detailFormList[0].checkInType = res.data.data.detailFormList[0].checkInType;
 						this.dataForm.detailFormList[0].checkInTypeName = this.checkInType[0].filter((item => item
-							.val ==this.dataForm.detailFormList[0].checkInType))[0].label;
+							.val == this.dataForm.detailFormList[0].checkInType))[0].label;
 						this.totalMOney = this.dataForm.orderAmount;
-						this.dataForm.flowRecord.forEach((i,index)=>{
-							let flowTypeName=i.flowType==1?'收款':'退款';
-							var payTypeName='微信';
-							if(i.payType){
-								payTypeName=this.flowTypeNames[i.payType-1];
+						this.dataForm.flowRecord.forEach((i, index) => {
+							let flowTypeName = i.flowType == 1 ? '收款' : '退款';
+							var payTypeName = '微信';
+							if (i.payType) {
+								payTypeName = this.flowTypeNames[i.payType - 1];
 							}
-							
-							this.$set(this.dataForm.flowRecord[index],'flowTypeName',flowTypeName)
-							this.$set(this.dataForm.flowRecord[index],'payTypeName',payTypeName)
+
+							this.$set(this.dataForm.flowRecord[index], 'flowTypeName', flowTypeName)
+							this.$set(this.dataForm.flowRecord[index], 'payTypeName', payTypeName)
 						})
 					}
 				})
@@ -491,7 +570,7 @@
 						this.dataForm.houseBaseName = res.data.data.houseBaseName;
 						this.dataForm.num = res.data.data.num;
 						this.totalMOney = res.data.data.roomAmount;
-						
+
 					}
 				})
 			},
@@ -560,7 +639,7 @@
 				border-radius: 48rpx;
 				border: 1rpx solid #D1D1D1;
 				color: #999;
-				margin:0 3%;
+				margin: 0 3%;
 				flex: 1;
 
 				&:last-child {
@@ -641,9 +720,11 @@
 		align-items: center;
 		padding: 26rpx 0;
 		border-bottom: 1rpx solid #E1E1E1;
-		&:last-child{
+
+		&:last-child {
 			border: 0;
 		}
+
 		text {
 			font-size: 30rpx;
 			color: #333;

+ 10 - 16
pages/house/stayCheck.vue

@@ -150,11 +150,19 @@
 			},
 			conform() {
 				this.checkInPersonList.forEach((item) => {
-					if (!this.$u.test.mobile(item.checkInPhone)) {
+					let checkInPhone = item.checkInPhone;
+					if (checkInPhone.indexOf("**") > -1) {
+						checkInPhone = checkInPhone.replace(/\*/g, "5");
+					}
+					if (!this.$u.test.mobile(checkInPhone)) {
 						this.$showToast('请输入正确手机号');
 						return
 					}
-					if (!this.$u.test.idCard(item.idCard)) {
+					let idCard = item.idCard;
+					if (idCard.indexOf("**") > -1) {
+						idCard = idCard.replace(/\*/g, "1");
+					}
+					if (!this.$u.test.idCard(idCard)) {
 						this.$showToast('请输入正确身份证号');
 						return
 					}
@@ -162,25 +170,11 @@
 					this.getOpenerEventChannel().emit('addSuccess', {
 						'data': list
 					});
-					//
 					uni.navigateBack();
 
 				})
-
-				// this.$api.post('/merchant/hotel/order/updOrder', this.orderInfo).then(res => {
-				// 	if (res.data.code == 0) {
-				// 		this.$showToast('操作成功');
-				// 		setTimeout(() => {
-
-				// 		}, 1500)
-				// 	}
-				// })
 			},
 		}
-		// onReady(){
-		// 	this.$refs.form.setRules(this.rules)
-		// }
-
 	}
 </script>
 

+ 2 - 2
pagesHouse/Mine/Businesses/Businesses.vue

@@ -1,6 +1,6 @@
 <template>
-	<view class="page" :style="{'min-height':h+'px'}">
-
+	<view class="page" :style="{'min-height':(h)+'px','padding-top':mt+'px'}">
+		<c-nav-bar title="商户信息"></c-nav-bar>
 		<view class="tenant-title">
 			<text>基本信息</text>
 		</view>

+ 46 - 10
pagesHouse/Mine/Businesses/Catering.vue

@@ -1,6 +1,6 @@
 <template>
-	<view class="page" :style="{'min-height':h+'px'}">
-
+	<view class="page" :style="{'min-height':(h)+'px','padding-top':mt+'px'}">
+		<c-nav-bar title="商户信息"></c-nav-bar>
 		<view class="tenant-title">
 			<text>基本信息</text>
 		</view>
@@ -78,7 +78,6 @@
 						style="height: 48rpx;" />
 				</view>
 			</view>
-
 			<view class="one-mobile">
 				<view class="mobile">
 					企业地址
@@ -180,6 +179,9 @@
 </template>
 
 <script>
+	import {
+		encrypt
+	} from '../../../utils/aes.js'
 	export default {
 		data() {
 			return {
@@ -228,7 +230,10 @@
 					areaDetail: '', //企业地址
 				},
 				typeList: {},
-				companyType: ''
+				companyType: '',
+				tempLegalPerson:null,
+				tempIdCard:null,
+				tempLinkName:null
 			}
 		},
 		onLoad() {
@@ -238,13 +243,12 @@
 		methods: {
 			// 获取数据 
 			getList() {
-				// this.$api.get('/merchant/merchantFisherman/home?id=' + this.homestayId).then(res => {
-				// 	console.log(res.data);
-				// })
 				let id = this.fishermanId
 				this.$api.get(`/api/merchant/food/merchant/${id}`).then(res => {
-					console.log(res.data);
 					this.list = res.data.data
+					this.tempIdCard = this.list.idCard;
+					this.tempLegalPerson = this.list.legalPerson;
+					this.tempLinkName = this.list.linkName;
 					this.getDict()
 				})
 			},
@@ -272,14 +276,46 @@
 				this.dto.creditCode = this.list.creditCode
 				this.dto.idCardReverse = this.list.idCardReverse
 				this.dto.licensePic = this.list.licensePic
-				// this.dto.usccl = this.list.usccl
 				this.dto.storeFrontPic = this.list.storeFrontPic
 				this.dto.shopImgs = this.list.shopImgs
 				this.dto.linkName = this.list.linkName
 				this.dto.phone = this.list.phone
 				this.dto.areaDetail = this.list.areaDetail
 				this.dto.id = uni.getStorageSync('merchantId')
-				this.$api.put('/api/merchant/food/updateMerchantInfo', this.dto).then(res => {
+				//加密
+				let newDataForm = JSON.parse(JSON.stringify(this.dto));
+				if (
+					newDataForm.legalPerson &&
+					this.tempLegalPerson != newDataForm.legalPerson
+				) {
+					//编辑了
+					newDataForm.legalPerson = encrypt(
+						newDataForm.legalPerson
+					);
+				} else {
+					newDataForm.legalPerson = null;
+				}
+				if (
+					newDataForm.idCard &&
+					this.tempIdCard != newDataForm.idCard
+				) {
+					newDataForm.idCard = encrypt(
+						newDataForm.idCard
+					);
+				} else {
+					newDataForm.idCard = null;
+				}
+				if (
+					newDataForm.linkName &&
+					this.tempLinkName != newDataForm.linkName
+				) {
+					newDataForm.linkName = encrypt(
+						newDataForm.linkName
+					);
+				} else {
+					newDataForm.linkName = null;
+				}
+				this.$api.put('/api/merchant/food/updateMerchantInfo', newDataForm).then(res => {
 					console.log('0000', res.data);
 					if (res.data.code == 0) {
 						this.$showToast('保存成功');

+ 1 - 1
pagesHouse/home/bill.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="page" :style="{'min-height':(h-th)+'px','padding-top':mt+'px'}">
+	<view class="page" :style="{'min-height':(h)+'px','padding-top':mt+'px'}">
 		<c-nav-bar title="交易账单"></c-nav-bar>
 		<view class="query">
 			<u-icon @click="show=true" name="calendar" label="自定义查询" labelPos="right" labelColor="#666" color="#666"