Browse Source

feat: 房态

2912631854@qq.com 1 year ago
parent
commit
b71750af7b
2 changed files with 304 additions and 296 deletions
  1. 9 6
      pages/house/index.vue
  2. 295 290
      pagesHouse/Mine/PersonalEditing/PersonalEditing.vue

+ 9 - 6
pages/house/index.vue

@@ -10,7 +10,8 @@
 			<view v-for="(item,key,i) in leftData" :key="i"
 				:class="indexArr[i]!=key.split('-')[0]?'mg0 fixedItem':'fixedItem'">
 				<view class="head" v-if="indexArr[i]==key.split('-')[0]" style="margin-top: 16rpx;">
-					<text>{{key.split('-')[0]}}F</text>
+					<!-- <text>{{key.split('-')[0]}}F</text> -->
+					<view class="roomType" :style="{'left':scrollLeft+'px'}">{{key.split('-')[1]}}</view>
 					<view class="rightIcon" @click="open(i,key.split('-')[0],false)" v-if="opens[i]">
 						<text>收起</text>
 						<u-icon name="arrow-up-fill" size="18" style="margin-left: 10rpx;"></u-icon>
@@ -21,10 +22,11 @@
 					</view>
 				</view>
 				<template v-if="opens[i]">
-					<view class="roomType" :style="{'left':scrollLeft+'px'}">{{key.split('-')[1]}}</view>
+					<!-- 	<view class="roomType" :style="{'left':scrollLeft+'px'}">{{key.split('-')[1]}}</view> -->
 					<text v-for="(item2,index2) in item" class="roomNumber">
 						{{item2.roomNumber}}
 					</text>
+
 				</template>
 			</view>
 		</view>
@@ -59,7 +61,8 @@
 				<view class="floorData" v-if="leftData.length!=0">
 					<view v-for="(item,key,i) in leftData" :key="i">
 						<view class="head" v-if="indexArr[i]==key.split('-')[0]" style="opacity: 0;">
-							<text>{{key.split('-')[0]}}F</text>
+							<!-- <text>{{key.split('-')[0]}}F</text> -->
+							<view class="roomType" :style="{'left':scrollLeft+'px'}">{{key.split('-')[1]}}</view>
 							<view class="rightIcon" @click="open(i,key.split('-')[0],false)" v-if="opens[i]">
 								<text>收起</text>
 								<u-icon name="arrow-up-fill" size="18" style="margin-left: 10rpx;"></u-icon>
@@ -70,7 +73,7 @@
 							</view>
 						</view>
 						<template v-if="opens[i]">
-							<view class="roomType" style="opacity: 0;">{{key.split('-')[1]}}</view>
+							<!-- <view class="roomType" style="opacity: 0;">{{key.split('-')[1]}}</view> -->
 							<view class="table">
 								<view class="tr" v-for="(item2,index2) in item" :key="index2">
 									<view class="td" :style="{'left':scrollLeft+'px'}">{{item2.roomNumber}}</view>
@@ -126,7 +129,7 @@
 	export default {
 		data() {
 			return {
-				homestayId: uni.getStorageSync('homestayId')||0,
+				homestayId: uni.getStorageSync('homestayId') || 0,
 				areaShow: false,
 				passengerDefault: [0],
 				info: {},
@@ -247,7 +250,7 @@
 						this.clearData();
 						this.areaShow = false;
 						this.init()
-					}else{
+					} else {
 						this.$showToast(res.data.msg);
 					}
 

+ 295 - 290
pagesHouse/Mine/PersonalEditing/PersonalEditing.vue

@@ -1,110 +1,111 @@
-<template>
-	<view class="page" :style="{'min-height':h+'px'}">
-
-		<view class="from-content">
-			<view class="one-image" @click="upImage">
-				<view class="user">
-					店铺标志
-				</view>
-				<view class="image">
-					<image :src="list.shopSign">
-					</image>
-					<u-icon @click="more()" name="arrow-right" color="#AAA"></u-icon>
-				</view>
-			</view>
-			<view class="one-realName">
-				<view class="realName">
-					店铺名称
-				</view>
-				<view class="right">
-					<input type="text" v-model="list.name" border="none" placeholder="请输入手机号" style="height: 48rpx;" />
-				</view>
-			</view>
-			<view class="one-mobile">
-				<view class="mobile">
-					联系电话
-				</view>
-				<view class="right">
-					<input type="text" v-model="list.phone" border="none" placeholder="请输入手机号" style="height: 48rpx;" />
-				</view>
-			</view>
-			<view class="one-mobile">
-				<view class="mobile">
-					商家地址
-				</view>
-				<view class="right">
-					<input type="text" v-model="list.areaDetail" border="none" placeholder="请输入" style="height: 48rpx;" />
-				</view>
-
-			</view>
-
-			<!-- 	<view class="one" @click="nav">
-				<view class="">
-					营业执照
-				</view>
-				<input type="text" v-model="dto.creditCode" border="none" placeholder="请输入" style="height: 48rpx;" />
-			</view>
-			<view class="one">
-				<view class="">
-					统一社会信用代码
-				</view>
-				<view class="">
-					<u-icon name="arrow-right"></u-icon>
-				</view>
-			</view> -->
-
-		</view>
-
-		<!-- <view class="from-content">
-			<view class="title">
-				店铺照片
-			</view>
-			<view class="pics">
-				<image :src='item' v-for="(item,index) in shopImgs" :key="index"></image>
-			</view>
-
-		</view> -->
-		<view class="from-content1">
-			<button class="tenant-button" @click="save">
-				立即保存
-			</button>
-		</view>
-
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				h: uni.getSystemInfoSync().windowHeight - 87,
-				mt: uni.getSystemInfoSync().statusBarHeight + 44,
-				fileList: [],
-				dto: {
-					name: '黄沙村渔家乐', //昵称
-					phone: '18755113256', //手机号
-					shopSign: '', // 头像
-					idCode: '', // 证件号
-					id: '',
-					areaDetail: ''
+<template>
+	<view class="page" :style="{'min-height':h+'px'}">
+
+		<view class="from-content">
+			<view class="one-image" @click="upImage">
+				<view class="user">
+					店铺标志
+				</view>
+				<view class="image">
+					<image :src="list.shopSign">
+					</image>
+					<u-icon @click="more()" name="arrow-right" color="#AAA"></u-icon>
+				</view>
+			</view>
+			<view class="one-realName">
+				<view class="realName">
+					店铺名称
+				</view>
+				<view class="right">
+					<input type="text" v-model="list.name" border="none" placeholder="请输入手机号" style="height: 48rpx;" />
+				</view>
+			</view>
+			<view class="one-mobile">
+				<view class="mobile">
+					联系电话
+				</view>
+				<view class="right">
+					<input type="text" v-model="list.phone" border="none" placeholder="请输入手机号" style="height: 48rpx;" />
+				</view>
+			</view>
+			<view class="one-mobile">
+				<view class="mobile">
+					商家地址
+				</view>
+				<view class="right">
+					<input type="text" v-model="list.areaDetail" border="none" placeholder="请输入"
+						style="height: 48rpx;" />
+				</view>
+
+			</view>
+
+			<!-- 	<view class="one" @click="nav">
+				<view class="">
+					营业执照
+				</view>
+				<input type="text" v-model="dto.creditCode" border="none" placeholder="请输入" style="height: 48rpx;" />
+			</view>
+			<view class="one">
+				<view class="">
+					统一社会信用代码
+				</view>
+				<view class="">
+					<u-icon name="arrow-right"></u-icon>
+				</view>
+			</view> -->
+
+		</view>
+
+		<!-- <view class="from-content">
+			<view class="title">
+				店铺照片
+			</view>
+			<view class="pics">
+				<image :src='item' v-for="(item,index) in shopImgs" :key="index"></image>
+			</view>
+
+		</view> -->
+		<view class="from-content1">
+			<button class="tenant-button" @click="save">
+				立即保存
+			</button>
+		</view>
+
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				h: uni.getSystemInfoSync().windowHeight - 87,
+				mt: uni.getSystemInfoSync().statusBarHeight + 44,
+				fileList: [],
+				dto: {
+					name: '黄沙村渔家乐', //昵称
+					phone: '18755113256', //手机号
+					shopSign: '', // 头像
+					idCode: '', // 证件号
+					id: '',
+					areaDetail: ''
 				},
-				list:{
+				list: {
 					name: '黄沙村渔家乐', //昵称
 					phone: '18755113256', //手机号
 					shopSign: '', // 头像
 					idCode: '', // 证件号
 					id: '',
 					areaDetail: ''
-				},
-				shopImgs: [],
-			}
-		},
-		onLoad() {
-			this.getInfo();
-		},
-
-		methods: {
-			getInfo() {
+				},
+				shopImgs: [],
+			}
+		},
+		onLoad() {
+			this.getInfo();
+		},
+
+		methods: {
+			getInfo() {
 				this.$api.get('/api/merchant/food/merchant/' + uni.getStorageSync('merchantId')).then(res => {
 					console.log(res)
 					if (res.data.code == 0) {
@@ -114,34 +115,34 @@
 								'https://i.ringzle.com/file/20240225/26feb8cc8f744123a980211ebdfb8d40.png';
 						}
 					}
-				})
-			},
-			// 上传头像
-			upImage() {
-				uni.chooseImage({
-					sourceType: ['album'], //从相册选择
-					success: chooseImageRes => {
-						const tempFilePaths = chooseImageRes.tempFilePaths;
-						uni.uploadFile({
-							url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例,非真实的接口地址
-							filePath: tempFilePaths[0],
-							name: 'file',
-							header: {
-								token: wx.getStorageSync('access_token')
-							},
-							success: res => {
-								let data = JSON.parse(res.data);
-								this.dto.shopSign = data.data.url;
-								this.save();
-							}
-						});
-					},
-					fail: err => {
-						this.myToast('图片上传失败', 'none');
-					}
-				});
-
-			},
+				})
+			},
+			// 上传头像
+			upImage() {
+				uni.chooseImage({
+					sourceType: ['album'], //从相册选择
+					success: chooseImageRes => {
+						const tempFilePaths = chooseImageRes.tempFilePaths;
+						uni.uploadFile({
+							url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload', // 仅为示例,非真实的接口地址
+							filePath: tempFilePaths[0],
+							name: 'file',
+							header: {
+								token: wx.getStorageSync('access_token')
+							},
+							success: res => {
+								let data = JSON.parse(res.data);
+								this.dto.shopSign = data.data.url;
+								this.save();
+							}
+						});
+					},
+					fail: err => {
+						this.myToast('图片上传失败', 'none');
+					}
+				});
+
+			},
 			save() {
 				this.dto.idCardFront = this.list.idCardFront
 				this.dto.name = this.list.name
@@ -160,25 +161,29 @@
 				this.dto.phone = this.list.phone
 				this.dto.areaDetail = this.list.areaDetail
 				this.dto.id = uni.getStorageSync('merchantId')
-				this.dto.id = uni.getStorageSync('merchantId')
-				this.$api.put('/api/merchant/food/updateMerchantInfo',this.dto).then(res => {
-				})
-			}
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
+				this.dto.id = uni.getStorageSync('merchantId')
+				this.$api.put('/api/merchant/food/updateMerchantInfo', this.dto).then(res => {
+					if (res.data.code == 0) {
+						this.$showToast('保存成功');
+					}
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
 	//保存样式
-	.from-content1{
+	.from-content1 {
 		position: fixed;
 		bottom: 30rpx;
 		padding: 0 24rpx;
 		left: 0;
 		z-index: 10;
-		    width: 100%;
-		    box-sizing: border-box;
-	}
+		width: 100%;
+		box-sizing: border-box;
+	}
+
 	.tenant-button {
 		background: #007A69;
 		border-radius: 40rpx;
@@ -187,153 +192,153 @@
 		color: #FFFFFF;
 		height: 88rpx;
 		line-height: 88rpx;
-		
-	}
-
-	.page {
-		box-sizing: border-box;
-		padding: 30rpx;
-		// padding-top: 150rpx;
-
-	}
-
-	.pics {
-		display: grid;
-		grid-template-columns: repeat(3, 1fr);
-		gap: 12rpx
-	}
-
-	.from-content {
-		.title {
-			margin: 40rpx 0 36rpx;
-			font-size: 30rpx;
-			font-weight: Regular;
-			color: #111111;
-		}
-
-
-		.one-image {
-			width: 100%;
-			display: flex;
-			align-items: center;
-			justify-content: space-between;
-
-			.image {
-				display: flex;
-				align-items: center;
-
-				image {
-					width: 124rpx;
-					border-radius: 100rpx;
-					height: 124rpx;
-					border-radius: 100rpx;
-				}
-
-			}
-
-
-			.user {
-				margin-top: 24rpx;
-				font-size: 30rpx;
-				color: #111;
-				font-weight: Regular;
-			}
-
-		}
-
-		.one-realName {
-			width: 100%;
-			display: flex;
-			align-items: center;
-			height: 120rpx;
-
-			border-bottom: 1rpx solid #EFEFEF;
-
-			.realName {
-				width: 188rpx;
-				height: 120rpx;
-				line-height: 120rpx;
-				font-size: 30rpx;
-				color: #333333;
-				font-weight: Regular;
-			}
-
-			.right {
-				text-align: right;
-				width: 100%;
-				font-size: 30rpx;
-				color: #666666;
-				font-weight: Regular;
-				// display: flex;
-				// justify-content: space-between;
-			}
-		}
-
-		.one-mobile {
-			display: flex;
-			width: 100%;
-			align-items: center;
-			height: 120rpx;
-
-			border-bottom: 1rpx solid #EFEFEF;
-
-			.right {
-				width: 100%;
-				text-align: right;
-				font-size: 30rpx;
-				color: #666666;
-				font-weight: Regular;
-			}
-
-			.mobile {
-				width: 188rpx;
-				height: 120rpx;
-				line-height: 120rpx;
-				font-size: 30rpx;
-				color: #333333;
-				font-weight: Regular;
-			}
-
-			.replacement {
-				border-radius: 50rpx;
-				width: 80rpx;
-				height: 48rpx;
-				line-height: 48rpx;
-				border: 1rpx solid #025EA7;
-				color: #025EA7;
-				font-weight: Regular;
-				font-size: 24rpx;
-				text-align: center;
-			}
-		}
-
-		.one {
-			height: 120rpx;
-			line-height: 120rpx;
-			display: flex;
-			border-bottom: 1rpx solid #EFEFEF;
-			justify-content: space-between;
-			align-items: center;
-			font-size: 30rpx;
-			color: #333333;
-			font-weight: Regular;
-		}
-	}
-
-	.btn {
-		margin: 120rpx auto;
-		width: 650rpx;
-		height: 88rpx;
-		display: flex;
-		background-color: #01B9F9;
-		line-height: 88rpx;
-		border-radius: 50rpx;
-
-		.btn-btn {
-			margin: 0 auto;
-			font-size: 32rpx;
-			color: #FFFFFF;
-			font-weight: Regular;
-		}
-	}
+
+	}
+
+	.page {
+		box-sizing: border-box;
+		padding: 30rpx;
+		// padding-top: 150rpx;
+
+	}
+
+	.pics {
+		display: grid;
+		grid-template-columns: repeat(3, 1fr);
+		gap: 12rpx
+	}
+
+	.from-content {
+		.title {
+			margin: 40rpx 0 36rpx;
+			font-size: 30rpx;
+			font-weight: Regular;
+			color: #111111;
+		}
+
+
+		.one-image {
+			width: 100%;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+
+			.image {
+				display: flex;
+				align-items: center;
+
+				image {
+					width: 124rpx;
+					border-radius: 100rpx;
+					height: 124rpx;
+					border-radius: 100rpx;
+				}
+
+			}
+
+
+			.user {
+				margin-top: 24rpx;
+				font-size: 30rpx;
+				color: #111;
+				font-weight: Regular;
+			}
+
+		}
+
+		.one-realName {
+			width: 100%;
+			display: flex;
+			align-items: center;
+			height: 120rpx;
+
+			border-bottom: 1rpx solid #EFEFEF;
+
+			.realName {
+				width: 188rpx;
+				height: 120rpx;
+				line-height: 120rpx;
+				font-size: 30rpx;
+				color: #333333;
+				font-weight: Regular;
+			}
+
+			.right {
+				text-align: right;
+				width: 100%;
+				font-size: 30rpx;
+				color: #666666;
+				font-weight: Regular;
+				// display: flex;
+				// justify-content: space-between;
+			}
+		}
+
+		.one-mobile {
+			display: flex;
+			width: 100%;
+			align-items: center;
+			height: 120rpx;
+
+			border-bottom: 1rpx solid #EFEFEF;
+
+			.right {
+				width: 100%;
+				text-align: right;
+				font-size: 30rpx;
+				color: #666666;
+				font-weight: Regular;
+			}
+
+			.mobile {
+				width: 188rpx;
+				height: 120rpx;
+				line-height: 120rpx;
+				font-size: 30rpx;
+				color: #333333;
+				font-weight: Regular;
+			}
+
+			.replacement {
+				border-radius: 50rpx;
+				width: 80rpx;
+				height: 48rpx;
+				line-height: 48rpx;
+				border: 1rpx solid #025EA7;
+				color: #025EA7;
+				font-weight: Regular;
+				font-size: 24rpx;
+				text-align: center;
+			}
+		}
+
+		.one {
+			height: 120rpx;
+			line-height: 120rpx;
+			display: flex;
+			border-bottom: 1rpx solid #EFEFEF;
+			justify-content: space-between;
+			align-items: center;
+			font-size: 30rpx;
+			color: #333333;
+			font-weight: Regular;
+		}
+	}
+
+	.btn {
+		margin: 120rpx auto;
+		width: 650rpx;
+		height: 88rpx;
+		display: flex;
+		background-color: #01B9F9;
+		line-height: 88rpx;
+		border-radius: 50rpx;
+
+		.btn-btn {
+			margin: 0 auto;
+			font-size: 32rpx;
+			color: #FFFFFF;
+			font-weight: Regular;
+		}
+	}
 </style>