Преглед на файлове

Merge branch 'master' of http://git.ringzle.com:3000/htcwl/hotelHomestayWx

2912631854@qq.com преди 9 месеца
родител
ревизия
8d498a060c
променени са 14 файла, в които са добавени 809 реда и са изтрити 500 реда
  1. 2 2
      App.vue
  2. 16 15
      pages.json
  3. 20 24
      pages/home/condition.vue
  4. 31 54
      pages/home/details.vue
  5. 240 116
      pages/home/index.vue
  6. 1 1
      pages/house/breast.vue
  7. 1 1
      pages/house/createOrder.vue
  8. 86 29
      pages/house/index.vue
  9. 5 5
      pages/house/orderInfo.vue
  10. 26 10
      pages/login/select.vue
  11. 366 237
      pages/my/houseList.vue
  12. 2 2
      pages/my/index.vue
  13. 12 3
      pages/my/roomType.vue
  14. 1 1
      pagesMy/orderList/orderList.vue

+ 2 - 2
App.vue

@@ -6,8 +6,8 @@
 		onShow: function() {
 			console.log('App Show')
 			this.autoUpdate();
-			// if(uni.getStorageSync('userInfo')) uni.reLaunch({ url:'/pages/home/index' })
-			// else uni.reLaunch({ url:'/pages/login/index' })
+			if(uni.getStorageSync('userInfo')) uni.reLaunch({ url:'/pages/home/index' })
+			else uni.reLaunch({ url:'/pages/login/index' })
 		},
 		onHide: function() {
 			console.log('App Hide')

+ 16 - 15
pages.json

@@ -1,19 +1,6 @@
 {
 	"pages": [
-		// {
-		// 	"path": "pages/login/index",
-		// 	"style": {
-		// 		"navigationBarTitleText": "登录",
-		// 		"navigationStyle": "custom"
-		// 	}
-		// },
-		// {
-		// 	"path": "pages/login/forgot",
-		// 	"style": {
-		// 		"navigationBarTitleText": "忘记密码",
-		// 		"navigationStyle": "custom"
-		// 	}
-		// },
+		//首页
 		{
 			"path": "pages/home/index",
 			"style": {
@@ -35,7 +22,21 @@
 				"navigationStyle": "custom"
 			}
 		},
-
+		// 登录
+		{
+			"path": "pages/login/index",
+			"style": {
+				"navigationBarTitleText": "登录",
+				"navigationStyle": "custom"
+			}
+		},
+		{
+			"path": "pages/login/forgot",
+			"style": {
+				"navigationBarTitleText": "忘记密码",
+				"navigationStyle": "custom"
+			}
+		},
 		{
 			"path": "pages/login/select",
 			"style": {

+ 20 - 24
pages/home/condition.vue

@@ -3,7 +3,8 @@
 		<c-nav-bar title="房情表"></c-nav-bar>
 		<view class="table">
 			<view class="t_th">
-				<view class="tt_year b_rb" @tap="show=true">
+				<!-- <view class="tt_year b_rb" @tap="show=true"> -->
+				<view class="tt_year b_rb">
 					<text>{{year}}年</text>
 					<u-icon name="arrow-down" size="24" color="#999999"></u-icon>
 				</view>
@@ -20,10 +21,10 @@
 					</view>
 					<u-icon name="arrow-right" size="24" color="#999999"></u-icon>
 				</view>
-				<view class="ti_num b_rb">{{item.num}}</view>
-				<view class="ti_num b_rb">{{item.ksNum}}</view>
-				<view class="ti_num b_rb">{{item.zyNum}}</view>
-				<view class="ti_num b_rb">{{item.bksNum}}</view>
+				<view class="ti_num b_rb">{{item.totalNums}}</view>
+				<view class="ti_num b_rb">{{item.saleNums}}</view>
+				<view class="ti_num b_rb">{{item.occupyNums}}</view>
+				<view class="ti_num b_rb">{{item.unSaleNums}}</view>
 			</view>
 		</view>
 		<u-calendar :show="show" :monthNum="24" mode="single" @confirm="confirm"></u-calendar>
@@ -38,8 +39,7 @@
 				weekCfg:{0:'周日',1:'周一',2:'周二',3:'周三',4:'周四',5:'周五',6:'周六'},
 				show:false,
 				startDate:new Date().Format('yyyy-MM-dd'),
-				list:[],
-				resData:[]
+				list:[]
 			}
 		},
 		onLoad() {
@@ -47,23 +47,19 @@
 		},
 		methods: {
 			getList(){
-				this.resData = [];
-				for(let i=0;i<7;i++){
-					this.resData.push({
-						date:new Date(new Date().setDate(new Date(this.startDate).getDate()+i)).Format('yyyy-MM-dd'),
-						num:10,
-						ksNum:10,
-						zyNum:10,
-						bksNum:10
-					})
-				}
-				this.list = this.resData;
-				let n = new Date().Format('yyyy-MM-dd');
-				this.list.forEach(l=>{
-					let w = new Date(l.date).getDay();
-					l.yr = new Date(l.date).Format('MM-dd');
-					l.week = n==l.date?'今天':this.weekCfg[w];
-					l.color = n==l.date?'c_today':([6,0].includes(w)?'c_week':'c_normal');
+				this.$api.get('/merchant/hotel/home/getRoomConditionList',{
+					homestayId:uni.getStorageSync('homestayId')
+				}).then(res=>{
+					if(res.data.code===0){
+						this.list = res.data.data;
+						let n = new Date().Format('yyyy-MM-dd');
+						this.list.forEach(l=>{
+							let w = new Date(l.dateDay).getDay();
+							l.yr = new Date(l.dateDay).Format('MM-dd');
+							l.week = n==l.dateDay?'今天':this.weekCfg[w];
+							l.color = n==l.dateDay?'c_today':([6,0].includes(w)?'c_week':'c_normal');
+						})
+					}else this.$showToast(res.data.msg)
 				})
 			},
 			confirm(e){

+ 31 - 54
pages/home/details.vue

@@ -10,11 +10,11 @@
 				<view class="b_grey b_rb">不可售</view>
 			</view>
 			<view v-if="list.length>0" class="t_item" v-for="(item,index) in list" :key="index">
-				<view class="b_grey b_rb">{{item.title}}</view>
-				<view class="b_rb" :class="(index==list.length-1||index==list.length-2)?'b_grey':''">{{item.num}}</view>
-				<view class="b_rb" :class="(index==list.length-1||index==list.length-2)?'b_grey':''">{{item.ksNum}}</view>
-				<view class="b_rb" :class="(index==list.length-1||index==list.length-2)?'b_grey':''">{{item.zyNum}}</view>
-				<view class="b_rb" :class="(index==list.length-1||index==list.length-2)?'b_grey':''">{{item.bksNum}}</view>
+				<view class="b_grey b_rb">{{item.houseBaseName}}</view>
+				<view class="b_rb" :class="(index==list.length-1||index==list.length-2)?'b_grey':''">{{item.totalNums}}</view>
+				<view class="b_rb" :class="(index==list.length-1||index==list.length-2)?'b_grey':''">{{item.saleNums}}</view>
+				<view class="b_rb" :class="(index==list.length-1||index==list.length-2)?'b_grey':''">{{item.occupyNums}}</view>
+				<view class="b_rb" :class="(index==list.length-1||index==list.length-2)?'b_grey':''">{{item.unSaleNums}}</view>
 			</view>
 		</view>
 	</view>
@@ -32,61 +32,38 @@
 		onLoad(option) {
 			if(option.item){
 				this.item = JSON.parse(decodeURIComponent(option.item));
-				this.title = this.item.yr+'房情表';
+				this.title = this.item.dateDay+'房情表';
 				this.getList();
 			} 
 		},
 		methods: {
 			getList(){
-				let resData = [
-					{
-						title:'大床房',
-						num:10,
-						ksNum:10,
-						zyNum:10,
-						bksNum:0,
-					},
-					{
-						title:'海景房',
-						num:10,
-						ksNum:10,
-						zyNum:10,
-						bksNum:0,
-					},
-					{
-						title:'标准间',
-						num:10,
-						ksNum:10,
-						zyNum:10,
-						bksNum:0,
-					},
-					{
-						title:'家庭房',
-						num:10,
-						ksNum:10,
-						zyNum:10,
-						bksNum:0,
-					}
-				];
-				let allNums = resData.reduce((cur,pre)=>cur+pre.num,0);
-				let ksNums = resData.reduce((cur,pre)=>cur+pre.ksNum,0);
-				let zyNums = resData.reduce((cur,pre)=>cur+pre.zyNum,0);
-				let bksNums = resData.reduce((cur,pre)=>cur+pre.bksNum,0);
-				resData.push({
-					title:'占房屋总数的比例',
-					num:'-',
-					ksNum:(ksNums/allNums*100).toFixed(2)+'%',
-					zyNum:(zyNums/allNums*100).toFixed(2)+'%',
-					bksNum:(bksNums/allNums*100).toFixed(2)+'%'
+				this.$api.get('/merchant/hotel/home/getRoomConditionList',{
+					homestayId:uni.getStorageSync('homestayId'),
+					dateDay:this.item.dateDay
+				}).then(res=>{
+					if(res.data.code===0){
+						this.list = res.data.data.splice(0,res.data.data.length-3);
+						let totalNums = this.list.reduce((cur,pre)=>cur+pre.totalNums,0);
+						let saleNums = this.list.reduce((cur,pre)=>cur+pre.saleNums,0);
+						let occupyNums = this.list.reduce((cur,pre)=>cur+pre.occupyNums,0);
+						let unSaleNums = this.list.reduce((cur,pre)=>cur+pre.unSaleNums,0);
+						this.list.push({
+							houseBaseName:'占房屋总数的比例',
+							totalNums:'-',
+							saleNums:(saleNums/totalNums*100).toFixed(2)+'%',
+							occupyNums:(occupyNums/totalNums*100).toFixed(2)+'%',
+							unSaleNums:(unSaleNums/totalNums*100).toFixed(2)+'%'
+						})
+						this.list.push({
+							houseBaseName:'总计',
+							totalNums:totalNums,
+							saleNums:saleNums,
+							occupyNums:occupyNums,
+							unSaleNums:unSaleNums
+						})
+					}else this.$showToast(res.data.msg)
 				})
-				resData.push({
-					title:'总计',
-					num:allNums,
-					ksNum:ksNums,
-					zyNum:zyNums,
-					bksNum:bksNums
-				})
-				this.list = resData;
 			}
 		}
 	}

+ 240 - 116
pages/home/index.vue

@@ -1,79 +1,106 @@
 <template>
 	<view class="page" :style="{'min-height':(h-th)+'px'}">
 		<u-navbar bgColor="transparent">
-			<view class="u-nav-slot" slot="left" style="display: flex;" @tap="show=true">
+			<view class="u-nav-slot" slot="left" style="display: flex;" @tap="shShow=true">
 				<text>{{name}}</text>
 				<u-icon name="arrow-down" size="28" :bold="true" color="#fff"></u-icon>
 			</view>
 		</u-navbar>
 		<view class="bg" :style="{'padding-top':(mt+30)+'px'}">
 			<view class="b_money">
-				<text>{{resData.orderMoney.toFixed(2)}}</text>
+				<text v-if="item">{{item.todayOrderAmount.toFixed(2)}}</text>
+				<text v-else>0.00</text>
 				<text>今日订单金额</text>
 			</view>
 			<view class="b_items">
 				<view @tap="toTurn">
-					<text>{{resData.yrzNum}}</text>
+					<text>{{item.stayedInRooms||0}}</text>
 					<text>已入住</text>
 				</view>
 				<view @tap="toTurn">
-					<text>{{resData.drzNum}}</text>
+					<text>{{item.toCheckinRooms||0}}</text>
 					<text>待入住</text>
 				</view>
 				<view>
-					<text>{{resData.dqrNum}}</text>
+					<text>{{item.undeterminedOrders||0}}</text>
 					<text>待确认</text>
 				</view>
 				<view>
-					<text>{{resData.dclNum}}</text>
+					<text>{{item.pendingOrders||0}}</text>
 					<text>待处理</text>
 				</view>
 				<view>
-					<text>{{resData.zrddNum}}</text>
+					<text>{{item.yestOrders||0}}</text>
 					<text>昨日订单</text>
 				</view>
 				<view @tap="toTurn">
-					<text>{{resData.zrscNum}}</text>
+					<text>{{item.yestSaleRooms||0}}</text>
 					<text>昨日售出</text>
 				</view>
 				<view @tap="toTurn">
-					<text>{{resData.zrkfNum}}</text>
+					<text>{{item.yestVacantRooms||0}}</text>
 					<text>昨日空房</text>
 				</view>
 				<view>
-					<text>{{resData.rzl}}</text>
+					<text>{{item.yestCheckinRatio||0}}%</text>
 					<text>入住率</text>
 				</view>
 			</view>
 		</view>
 		<view class="title">
 			<text>今日新增</text>
-			<view>
+			<view @tap="toAll">
 				<text>全部</text>
 				<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
 			</view>
 		</view>
-		<view class="card" v-for="(item,index) in list" :key="index">
-			<view class="c_top">
-				<text>订单号:{{item.no}}</text>
-				<text :class="statusStyle[item.status]||'s_default'">{{statusCfg[item.status]}}</text>
-			</view>
-			<view class="c_middle">
-				<image :src="item.img"></image>
-				<view class="cm_info">
-					<view class="cmi_title">{{item.name}}</view>
-					<view class="cmi_pre">{{item.person}}</view>
-					<view class="cmi_pre">{{item.phone}}</view>
-					<view class="cmi_pre">{{item.date}}<span>{{item.nights}}</span></view>
+		<block v-if="list.length>0">
+			<view class="card" v-for="(item,index) in list" :key="index">
+				<view class="c_top">
+					<text>订单号:{{item.orderCode}}</text>
+					<text v-if='item.orderStatus==-1&&item.status==1' class="orange">待确认</text>
+					<text v-else-if='item.status==0&&item.orderStatus==-1' class="red">待支付</text>
+					<text v-else-if='item.orderStatus==1&&item.status==1' class="green">已预订</text>
+					<text v-else :class="statusClass[item.orderStatus]">{{status[item.orderStatus]}}</text>
+				</view>
+				<view class="c_middle">
+					<image :src="item.cover"></image>
+					<view class="cm_info">
+						<view class="cmi_title">{{item.houseBaseName}}</view>
+						<view class="cmi_pre">{{item.guestName}}</view>
+						<view class="cmi_pre">{{item.guestPhone}}</view>
+						<view class="cmi_pre">{{item.date}}<span>共{{item.num}}晚</span></view>
+					</view>
+					<view class="cm_price">¥{{item.orderAmount?item.orderAmount.toFixed(2):''}}</view>
+				</view>
+				<view class="c_bottom">
+					<view class="btn" v-if="item.orderStatus==-1" :class="item.orderStatus==-1?'btn_jj':''" @tap="cancle(item)">拒绝</view>
+					<view class="btn" v-if="item.orderStatus==-1" @tap="toConfrimOrder(item)">确认订单</view>
+					<view class="btn" v-if="item.orderStatus==1" @tap="checkIn(2,item)">办理入住</view>
+					<view class="btn" v-if="item.orderStatus==2" @tap="toBltf(item)">办理退房</view>
+					<view class="btn" v-if="item.orderStatus==3||item.orderStatus==4" :class="item.orderStatus==3||item.orderStatus==4?'btn_xq':''" @tap="handleDetail(item)">详情</view>
 				</view>
-				<view class="cm_price">¥{{item.price.toFixed(2)}}</view>
 			</view>
-			<view class="c_bottom">
-				<view class="btn" :class="item.status==0||item.status==4?'btn_xq':''">{{btnTextCfg[item.status]}}</view>
+		</block>
+		<block v-else>
+			<view class="empty">
+				暂无数据
 			</view>
-		</view>
+		</block>
 		<Tabbar :tabbarIndex="0"></Tabbar>
-		<u-picker :show="show" :columns="nameList" @close="show=false" @cancel="show=false" @confirm="confirm"></u-picker>
+		<u-picker :show="shShow" :columns="nameList" @close="shShow=false" @cancel="shShow=false" @confirm="confirm"></u-picker>
+		<!-- 取消订单 -->
+		<u-modal :show="show" @confirm="confirmCheck" :show-cancel-button="true" @cancel="show=false">
+			<view class="slot-content">
+				<input type="text" v-model="check.refundReason" placeholder="请输入原因" />
+			</view>
+		</u-modal>
+		<!-- 确认订单 -->
+		<u-modal :show="show2" content="确定该操作?" @confirm="confirmOrder" :show-cancel-button="true" @cancel="show2=false">
+		</u-modal>
+		<!-- 办理退房 -->
+		<u-modal :show="show3" content="确定该操作?" @confirm="checkoutRoom" :show-cancel-button="true" @cancel="show3=false">
+		</u-modal>
 	</view>
 </template>
 
@@ -81,101 +108,178 @@
 	export default {
 		data() {
 			return {
-				name:'一家民宿',
-				nameList:[['一家民宿','我家民宿','他家民宿']],
-				show:false,
+				name:'',
+				shList:[],
+				nameList:[],
+				shShow:false,
+				item:null,
 				list:[],
-				resData:{
-					orderMoney:66614,
-					yrzNum:68,
-					drzNum:0,
-					dqrNum:12,
-					dclNum:16,
-					zrddNum:48,
-					zrscNum:48,
-					zrkfNum:20,
-					rzl:'69.65%',
-					list:[//status:0 待支付、1 待确认、2 已预订、3 已入住、4 已取消
-						{
-							no:'A20231213102359619119',
-							status:2,
-							img:'../../static/room1.png',
-							name:'海景房-305',
-							person:'李琳',
-							phone:'13911924328',
-							date:'03/11 - 03/12',
-							price:1288,
-							nights:'(共两晚)'
-						},
-						{
-							no:'A20231213102359619119',
-							status:3,
-							img:'../../static/room2.png',
-							name:'海景房-306',
-							person:'郑一璇',
-							phone:'15753988251',
-							date:'03/11 - 03/12',
-							price:1288,
-							nights:'(共两晚)'
-						},
-						{
-							no:'A20231213102359619119',
-							status:4,
-							img:'../../static/room3.png',
-							name:'海景房-307',
-							person:'钱萌',
-							phone:'13710484614',
-							date:'03/11 - 03/12',
-							price:1288,
-							nights:'(共两晚)'
-						},
-						{
-							no:'A20231213102359619119',
-							status:1,
-							img:'../../static/room4.png',
-							name:'海景房-308',
-							person:'赵健民',
-							phone:'15877425550',
-							date:'03/11 - 03/12',
-							price:1288,
-							nights:'(共两晚)'
-						},
-						{
-							no:'A20231213102359619119',
-							status:0,
-							img:'../../static/room5.png',
-							name:'海景房-309',
-							person:'李琳',
-							phone:'13911924328',
-							date:'03/11 - 03/12',
-							price:1288,
-							nights:'(共两晚)'
-						}
-					]
+				statusClass: ['', 'green', 'blue', 'grey', 'grey'],
+				status: ['', '已预订', '已入住', '已退房', '已取消'],
+				page:1,
+				limit:10,
+				finished:false,
+				
+				show: false,
+				show2: false,
+				show3: false,
+				check: {
+					initiator: 1,
+					refundReason: "",
+					status: -1,
+					orderCode: "",
 				},
-				statusCfg:{0:'待支付',1:'待确认',2:'已预订',3:'已入住',4:'已取消'},
-				statusStyle:{0:'s_dzf',1:'s_dqr',2:'s_yyd',3:'s_yrz',4:'s_yqx'},
-				btnTextCfg:{0:'详情',1:'确认订单',2:'办理入住',3:'办理退房',4:'详情'}
+				orderId: '',
+				orderInfo: {}
 			}
 		},
-		onLoad() {
+		mounted() {
+			this.getType();
+			this.getDetails();
 			this.getList();
 		},
 		onReachBottom() {
-			console.log('触底啦~');
+			if(this.finished) return
+			this.getList();
 		},
 		methods: {
+			getType(){
+				this.$api.post('/merchant/register/getMerchantStoreList').then(res=>{
+					if(res.data.code===0){
+						this.shList = res.data.data;
+						let shs = [];
+						this.shList.forEach(d=>shs.push(d.merchantName));
+						this.nameList = [shs];
+						let t = this.shList.find(d=>d.merchantId==uni.getStorageSync('homestayId'));
+						this.name = t?t.merchantName:''
+					}else this.$showToast(res.data.msg);
+				})
+			},
 			confirm(e){
 				this.name = e.value[0];
-				this.show = false;
+				this.shShow = false;
+				let t = this.shList.find(d=>d.merchantName==this.name);
+				if(t){
+					if(t.merchantType==2){//酒店民宿
+						uni.setStorageSync('homestayId',t.merchantId);
+						this.getDetails();
+						this.page = 1;
+						this.finished = false;
+						this.list = [];
+						this.getList();
+					} else{
+						this.item = null;
+						this.list = [];
+						uni.setStorageSync('merchantId',t.merchantId);
+					} 
+				}
+			},
+			getDetails(){
+				this.$api.get('/merchant/hotel/home/getHotelHomeInfo/'+uni.getStorageSync('homestayId')).then(res=>{
+					if(res.data.code===0){
+						this.item = res.data.data;
+					}else this.$showToast(res.data.msg);
+				})
 			},
 			getList(){
-				this.list = this.resData.list;
+				this.$api.get('/merchant/hotel/order/getMerchantOrderPageList', {
+					homestayId: uni.getStorageSync('homestayId'),
+					limit: this.limit,
+					page: this.page,
+					orderStatus: '',
+					// orderTime:new Date().Format('yyyy-MM-dd')
+				}).then(res => {
+					if(res.data.code===0){
+						this.list = [...this.list,...res.data.data.list];
+						this.list.forEach(l=>{
+							l.date = new Date(l.arriveDate).Format('MM/dd')+" - "+new Date(l.leaveDate).Format('MM/dd');
+						})
+						if (res.data.data.list.length == 0) this.finished = true;
+						else this.page++;
+					}else this.$showToast(res.data.msg);
+				})
+			},
+			handleDetail(item) {
+				uni.navigateTo({
+					url: '/pages/house/orderInfo?orderId='+item.id
+				})
+			},
+			toAll(){
+				uni.navigateTo({
+					url:'/pagesMy/orderList/orderList'
+				})
 			},
 			toTurn(){
 				uni.navigateTo({
 					url:'/pages/home/condition'
 				})
+			},
+			cancle(item) {
+				this.show = true;
+				this.check.orderCode = item.orderCode;
+			},
+			//取消订单
+			confirmCheck() {
+				this.$api.post("/merchant/hotel/order/cancelOrder", this.check)
+				.then((res) => {
+					if (res.data.code !== 0) {
+						return this.$showToast(res.data.msg);
+					}
+					this.show = false;
+					this.$showToast('操作成功');
+					setTimeout(() => {
+						this.init();
+					}, 1500)
+				});
+			},
+			toConfrimOrder(item){
+				this.orderInfo = item;
+				this.show2 = true;
+			},
+			// 确认订单
+			confirmOrder() {
+				this.$api.get(`/merchant/hotel/order/confirm/${this.orderInfo.id}`)
+				.then((res) => {
+					if (res.data.code !== 0) {
+						return this.$showToast(res.data.msg);
+					}
+					this.show2 = false;
+					this.$showToast('操作成功');
+					setTimeout(() => {
+						this.init();
+					}, 1500)
+				});
+			},
+			//办理入住
+			checkIn(orderStatus,item) {
+				this.orderInfo = item;
+				uni.redirectTo({
+					url: "/pages/house/createOrder?id=" + this.orderInfo.id + '&orderStatus=' + orderStatus
+				})
+			},
+			toBltf(item){
+				this.orderInfo = item;
+				this.show3 = true;
+			},
+			//办理退房
+			checkoutRoom() {
+				this.$api.get("/merchant/hotel/order/checkout/" + this.orderInfo.id)
+				.then((res) => {
+					if (res.data.code !== 0) {
+						return this.$showToast(res.data.msg);
+					}
+					this.show3 = false;
+					this.$showToast('操作成功');
+					setTimeout(() => {
+						this.init();
+					}, 1500)
+				});
+			},
+			init(){
+				this.page = 1;
+				this.finished = false;
+				this.list = [];
+				this.getList();
 			}
 		}
 	}
@@ -188,7 +292,7 @@
 		box-sizing: border-box;
 		.bg{
 			width: 100%;
-			height: 660rpx;
+			height: 743rpx;
 			background: url(https://i.ringzle.com/file/20240107/8bc656fc64fd4386a6b336a7dc8c86d0.png) no-repeat;
 			background-size: 100%  100%;
 			box-sizing: border-box;
@@ -356,27 +460,47 @@
 						font-size: 24rpx;
 						color: #999999;
 					}
+					&.btn_jj{
+						background: #FFFFFF;
+						border: 1rpx solid #F9423A;
+						font-size: 24rpx;
+						color: #FA6760;
+					}
+					&:last-child{
+						margin-left: 20rpx;
+					}
 				}
 			}
 		}
-	
-		.s_dzf{
-			color: #F9423A !important;
+		
+		.empty{
+			width: 100%;
+			text-align: center;
+			padding-top: 100rpx;
+			font-size: 34rpx;
+			font-family: PingFang SC, PingFang SC;
+			font-weight: 400;
+			color: #999999;
 		}
-		.s_dqr{
-			color: #FF9100 !important;
+		
+		.red {
+			color: #F9423A !important;
 		}
-		.s_yyd{
+		
+		.green {
 			color: #39CE77 !important;
 		}
-		.s_yrz{
+		
+		.blue {
 			color: #1372FF !important;
 		}
-		.s_yqx{
+		
+		.grey {
 			color: #4C5F76 !important;
 		}
-		.s_default{
-			color: #111111 !important;
+		
+		.orange {
+			color: #FF9100 !important;
 		}
 	}
 	

+ 1 - 1
pages/house/breast.vue

@@ -40,7 +40,7 @@
 	export default {
 		data() {
 			return {
-				homestayId: this.$store.state.moduleHouse.homestayId,
+				homestayId: uni.getStorageSync('homestayId'),
 				list: [],
 				list2: []
 			}

+ 1 - 1
pages/house/createOrder.vue

@@ -180,7 +180,7 @@
 					guestPhone: "",
 					guestSourceId: null,
 					guestSourceName: null,
-					homestayId: this.$store.state.moduleHouse.homestayId,
+					homestayId: uni.getStorageSync('homestayId'),
 					houseBaseId: 0,
 					houseBaseName: '',
 					leaveDate: "",

+ 86 - 29
pages/house/index.vue

@@ -1,9 +1,18 @@
 <template>
-	<view class="page" :style="{'height':(h-th)+'px','padding-top':mt+'px'}">
+	<scroll-view class="page" scroll-x="true" scroll-y="true" :style="{'height':(h-th)+'px','padding-top':mt+'px'}"
+		@scroll="scroll" id="page">
 		<c-nav-bar title="房态" :showIcon="false" :titleStyle="titleStyle"></c-nav-bar>
 		<view class="content" v-if="xdata.length!=0">
-			<view class="date">
-				<view class="item">
+			<view class="tj">
+				<text class="label">房间总数:</text>
+				<text>{{info.totalRooms}}</text>
+				<text class="label">在入住房间数:</text>
+				<text>{{info.checkinRooms}}</text>
+				<text class="label">待入住房间数:</text>
+				<text>{{info.bookRooms}}</text>
+			</view>
+			<view class="date"> 
+				<view class="item" :style="{'left':scrollLeft+'px'}">
 					<u-icon name="calendar-fill" color="#B9C2D2" size="40" style="margin-bottom:10rpx;"></u-icon>
 					<text style="font-size: 24rpx;">2024</text>
 				</view>
@@ -14,8 +23,10 @@
 				</view>
 			</view>
 			<view class="floorData" v-if="leftData.length!=0">
-				<view v-for="(item,key,i) in leftData" :key="i" style="margin-bottom: 16rpx;padding-top: 108rpx;position: relative;" :class="indexArr[i]==key.split('-')[0]?'big':opens[i]?'small':'pd0'">
-					<view class="head" v-if="indexArr[i]==key.split('-')[0]">
+				<view v-for="(item,key,i) in leftData" :key="i"
+					style="margin-bottom: 16rpx;padding-top: 108rpx;position: relative;"
+					:class="indexArr[i]==key.split('-')[0]?'big':opens[i]?'small':'pd0'">
+					<view class="head" v-if="indexArr[i]==key.split('-')[0]" :style="{'left':scrollLeft+'px'}">
 						<text>{{key.split('-')[0]}}F</text>
 						<view class="rightIcon" @click="open(i,key.split('-')[0],false)" v-if="opens[i]">
 							<text>收起</text>
@@ -27,10 +38,10 @@
 						</view>
 					</view>
 					<template v-if="opens[i]">
-						<view class="roomType">{{key.split('-')[1]}}</view>
+						<view class="roomType" :style="{'left':scrollLeft+'px'}">{{key.split('-')[1]}}</view>
 						<view class="table">
 							<view class="tr" v-for="(item2,index2) in item" :key="index2">
-								<view class="td">{{item2.roomNumber}}</view>
+								<view class="td" :style="{'left':scrollLeft+'px'}">{{item2.roomNumber}}</view>
 								<view class="td" v-for="(roomData,ind) in xdata" :key="ind"
 									:class="'s'+delDataStatus(item2.roomNumber,item2.houseBaseId,roomData.roomDataList,'status')">
 									<!-- 空置房-->
@@ -70,7 +81,7 @@
 		<u-picker :itemHeight="88" :immediateChange="true" :show="areaShow" :columns="areaTxt" title="房态选择"
 			:defaultIndex="passengerDefault" @cancel="areaShow=false;clearData();"
 			@confirm="passengerConfirm"></u-picker>
-	</view>
+	</scroll-view>
 </template>
 
 <script>
@@ -78,7 +89,7 @@
 	export default {
 		data() {
 			return {
-				homestayId:this.$store.state.moduleHouse.homestayId,
+				homestayId: this.$store.state.moduleHouse.homestayId,
 				areaShow: false,
 				passengerDefault: [0],
 				areaTxt: [
@@ -120,13 +131,15 @@
 				checkDataDate: [],
 				checkPrice: [],
 				checkDataRoomId: [],
-				checkStatus: ''
+				checkStatus: '',
+				scrollLeft: 0
 			}
 		},
 		onLoad() {
 			that = this;
 			this.getLeftData();
 			this.getData();
+			this.getTj();
 		},
 		filters: {
 			delDataStatus(roomNumber, id, roomId, name) {
@@ -148,6 +161,19 @@
 				this.getData();
 				this.$forceUpdate();
 			},
+			getTj() {
+				this.$api.get('/merchant/hotel/room/state/getRoomStateCount', {
+					homestayId: this.homestayId
+				}).then(res => {
+					if (res.data.code == 0) {
+						this.info = res.data.data;
+					}
+				})
+			},
+			scroll(e) {
+				//this.scrollLeft = e.detail.scrollLeft; // div 到左边的距离
+				//console.log(e)
+			},
 			//关房
 			tabCli(roomNumber, id, roomId) {
 				this.clearData();
@@ -159,10 +185,10 @@
 						}
 					}
 					//已预订,已入住
-					if (obj.status == 1 || obj.status == 2|| obj.status == -1) {
-						let orderId= obj.orderId;
+					if (obj.status == 1 || obj.status == 2 || obj.status == -1) {
+						let orderId = obj.orderId;
 						uni.navigateTo({
-							url:"/pages/house/orderInfo?orderId="+orderId
+							url: "/pages/house/orderInfo?orderId=" + orderId
 						})
 						//到详情
 					} else {
@@ -353,13 +379,30 @@
 		box-sizing: border-box;
 		overflow-y: auto;
 		overflow-x: auto;
+
+		.tj {
+			padding: 30rpx 0;
+			text-align: center;
+			text {
+				font-size: 28rpx;
+				color: #f44;
+				font-weight: bold;
+				margin: 0 10rpx;
+
+				&.label {
+					color: #333;
+					margin: 0
+				}
+			}
+		}
 	}
 
 	.date {
 		display: flex;
-
+		position: relative;
 		border: 1rpx solid #E9F0F5;
 		margin-bottom: 30rpx;
+		padding-left: 130rpx;
 
 		.item {
 			min-width: 130rpx;
@@ -377,6 +420,13 @@
 				border: 0;
 			}
 
+			&:first-child {
+				position: absolute;
+				left: 0;
+				top: 0;
+				width: 130rpx;
+			}
+
 			text {
 				&:nth-child(2) {
 					margin: 6rpx 0;
@@ -391,13 +441,15 @@
 		.roomType {
 			padding: 0 30rpx;
 			display: flex;
+			width: 400rpx;
 			// justify-content: space-between;
 		}
 
 		.head {
 			position: absolute;
-			top:0;
-			left:0;
+			top: 0;
+			left: 0;
+
 			&>text {
 				&:first-child {
 					font-size: 32rpx;
@@ -410,15 +462,15 @@
 				align-items: center;
 				font-size: 24rpx;
 				color: #1F2425;
-				
+
 			}
 		}
 
 		.roomType {
 			position: absolute;
-			top:40rpx;
-			left:0;
-			
+			top: 40rpx;
+			left: 0;
+
 			color: #333;
 			font-size: 24rpx;
 			// position: relative;
@@ -448,7 +500,8 @@
 				align-items: center;
 				background-color: #fff;
 				position: relative;
-			
+				padding-left: 130rpx;
+
 				&:last-child {
 					border: 0;
 				}
@@ -457,9 +510,10 @@
 					&:first-child {
 						position: absolute;
 						left: 0;
-						top:0;
+						top: 0;
 						z-index: 1;
 					}
+
 					display: flex;
 					align-items: center;
 					justify-content: center;
@@ -475,7 +529,7 @@
 					.tdP,
 					.cellBox {
 						display: flex;
-						width:100%;
+						width: 100%;
 						height: 100%;
 						flex-direction: column;
 						align-items: center;
@@ -562,13 +616,16 @@
 			}
 		}
 	}
-	.small{
-		padding-top: 68rpx!important;
-		.roomType{
-			top:0!important;
+
+	.small {
+		padding-top: 68rpx !important;
+
+		.roomType {
+			top: 0 !important;
 		}
 	}
-	.pd0{
-		padding: 0!important;
+
+	.pd0 {
+		padding: 0 !important;
 	}
 </style>

+ 5 - 5
pages/house/orderInfo.vue

@@ -12,7 +12,7 @@
 				<!-- 房间/预定信息 -->
 				<view class="reservations">
 					<text
-						style="font-size: 30rpx; color: #333333; font-weight: 700;">{{orderInfo.houseBaseName}}-{{orderInfo.roomNumber}}</text>
+						style="font-size: 30rpx; color: #333333; font-weight: 700;">{{orderInfo.houseBaseName}}-{{orderInfo.detailFormList[0].roomNumber}}</text>
 					<text style="font-size: 24rpx; color: #39CE77;" v-if="isOrderPanding">{{getStatusText()}}</text>
 				</view>
 				<!-- 时间/价格 -->
@@ -46,22 +46,22 @@
 						<text>{{orderInfo.orderTime}}</text>
 					</view>
 				</u-cell>
-				<u-cell>
+				<!-- <u-cell>
 					<text slot="icon" style="font-size: 30rpx; margin-right: 20rpx;">办理员工</text>
 					<view slot="title" class="title">
 						<text>何伟婷</text>
 					</view>
-				</u-cell>
+				</u-cell> -->
 				<u-cell>
 					<text slot="icon" style="font-size: 30rpx; margin-right: 20rpx;">取消原因</text>
 					<view slot="title" class="title">
-						<text>-</text>
+						<text>{{orderInfo.refundReason}}</text>
 					</view>
 				</u-cell>
 				<u-cell>
 					<text slot="icon" style="font-size: 30rpx; margin-right: 80rpx;">备注</text>
 					<view slot="title" class="title">
-						<text>-</text>
+						<text>{{orderInfo.remarks}}</text>
 					</view>
 				</u-cell>
 

+ 26 - 10
pages/login/select.vue

@@ -3,8 +3,8 @@
 		<c-nav-bar title="选择门店" backUrl="/pages/login/index" @goBack="goBack" :showHome="false"></c-nav-bar>
 		<view class="card" v-for="(item,index) in list" :key="index" @tap="toHome(item)">
 			<view>
-				<text>{{item.name}}</text>
-				<text>{{item.type}}</text>
+				<text>{{item.merchantName}}</text>
+				<text>{{item.typeName}}</text>
 			</view>
 			<view>进店</view>
 		</view>
@@ -16,9 +16,14 @@
 		data() {
 			return {
 				userInfo:null,
+				merchantId:'',
+				types:[],
 				list:[]
 			}
 		},
+		created() {
+			this.getType();
+		},
 		onLoad(option) {
 			if(option.userInfo) this.userInfo = JSON.parse(decodeURIComponent(option.userInfo));
 			this.getList();
@@ -27,16 +32,27 @@
 			goBack(e){
 				uni.clearStorageSync();
 			},
+			getType(){
+				this.$api.post('/api/dict/getListByTypes',['BusinessType']).then(res=>{
+					if(res.data.code===0){
+						this.types = res.data.data
+					}else this.$showToast(res.data.msg);
+				})
+			},
 			getList(){
-				this.list = [
-					{ name:'一家民宿', type:'酒店民宿'},
-					{ name:'石柱村渔家乐', type:'渔家乐' },
-					{ name:'周游嵊泗', type:'旅行社' }
-				]
+				this.$api.post('/merchant/register/getMerchantStoreList').then(res=>{
+					if(res.data.code===0){
+						this.list = res.data.data;
+						this.list.forEach(l=>{
+							let t = this.types.find(t=>t.dictValue==l.merchantType);
+							l.typeName = t?t.dictLabel:''
+						})
+					}else this.$showToast(res.data.msg);
+				})
 			},
-			toHome(item){
-				console.log(item)
-				this.$store.state.moduleHouse.homestayId=item.merchantId||'1711268640588517378';
+			toHome(item){//1711268640588517378   1721450548101648385
+				if(item.merchantType==2) uni.setStorageSync('homestayId',item.merchantId);
+				else uni.setStorageSync('merchantId',item.merchantId);
 				uni.setStorageSync('userInfo',this.userInfo);
 				uni.reLaunch({
 					url:'/pages/home/index'

+ 366 - 237
pages/my/houseList.vue

@@ -1,253 +1,348 @@
 <template>
-	<view class="page" :style="{'height':(h-th)+'px','padding-top':mt+'px'}">
-			<c-nav-bar title="房间列表" :showIcon="false" :titleStyle="titleStyle"></c-nav-bar>
+	<view class="page" :style="{'height':(h)+'px','padding-top':mt+'px'}">
+		<c-nav-bar title="房间列表" :showIcon="true" :titleStyle="titleStyle"></c-nav-bar>
 		<view class="body">
 			<!-- 房型信息 -->
-			
+
 			<view class="typeInfo">
 				<view class="titleInfo">
 					<text style="font-size: 32rpx; font-weight: 700;">房型信息</text>
 				</view>
 				<view class="cellBox">
 					<text style="font-size: 30rpx; margin-right: 30rpx;">房型名称</text>
-					<input v-model="form.name" type="text" placeholder="请输入房型"  style="width: 210rpx;height: 42rpx; font-size: 30rpx;"/>
+					<input v-model="form.name" type="text" placeholder="请输入房型"
+						style="width: 210rpx;height: 42rpx; font-size: 30rpx;" />
 				</view>
 				<view class="bigRoom">
 					<text style="font-size: 30rpx;color: black; margin-right: 90rpx;">简称</text>
-					<input v-model="form.shortName" type="text" placeholder="请输入简称"  style="width: 210rpx;height: 42rpx; font-size: 30rpx;"/>
+					<input v-model="form.shortName" type="text" placeholder="请输入简称"
+						style="width: 210rpx;height: 42rpx; font-size: 30rpx;" />
 				</view>
 			</view>
 			<view class="shelves">
 				<view style="margin-left: 30rpx;">
-					<text style="font-size: 30rpx; " >是否上架</text>
+					<text style="font-size: 30rpx; ">是否上架</text>
 				</view>
 				<view style="margin-right: 30rpx;">
-					<u-switch v-model="checked" size="50" @change="change(status)" active-color="#07C160" ></u-switch>
+					<u-switch v-model="checked" size="50" active-color="#07C160"> </u-switch>
 				</view>
 			</view>
 			<!-- 图片上传
 			 -->
-			 <view class="uploadPic">
-			 	<view style=" margin-left: 30rpx;">
+			<view class="uploadPic">
+				<view style=" margin-left: 30rpx;">
 					<text style="font-size: 32rpx; font-weight: 700; ">封面图片(0/1)</text>
-			 		
-			 	</view>
+
+				</view>
 				<view style="margin-top: 20rpx; margin-left: 30rpx; color: #777; font-size: 24rpx;">
 					<text>仅能上传1张,需展示房间内容</text>
 				</view>
 				<view class="pic">
 					<!-- 图片 -->
-					<view v-show="false" >
-						<u-upload :action="action" :file-list="fileList" >
-							<!-- <img src="https://img.51miz.com/Element/00/77/24/47/cd39208d_E772447_a1d65d72.png" style="width: 190rpx; height: 120rpx;" /> -->
-						</u-upload>
-						
-					</view>
+					<u-upload :fileList="fileList" multiple :maxCount="1" :maxSize="1 * 1024 * 1024"
+						@afterRead="afterRead" @oversize="overSize" width="120" height="120">
+
+					</u-upload>
+				</view>
+
+			</view>
+			<!-- 价格信息 -->
+			<view class="priceInfo">
+				<!-- 标题 -->
+				<view class="titleInfo">
+					<text style="font-size: 32rpx; font-weight: 700; margin-left: 10rpx;">价格信息</text>
 				</view>
-				
-			 </view>
-			 <!-- 价格信息 -->
-			 <view class="priceInfo">
-				 <!-- 标题 -->
-			 	<view class="titleInfo">
-			 		<text style="font-size: 32rpx; font-weight: 700; margin-left: 10rpx;">价格信息</text>
-			 	</view>
 				<!-- 周末周日区分 -->
-					<view class="week">
-						<view class="weekend">
-							<view >
-								<text style="font-size: 30rpx; " >区分平日周末</text>
-							</view>
-							<view >
-								<u-switch v-model="weekedChecked" size="50"  active-color="#07C160" ></u-switch>
-							</view>
+				<view class="week">
+					<view class="weekend">
+						<view>
+							<text style="font-size: 30rpx; ">区分平日周末</text>
+						</view>
+						<view>
+							<u-switch v-model="weekedChecked" size="50" active-color="#07C160"></u-switch>
 						</view>
 					</view>
-					
+				</view>
+				<!-- 平日价格 -->
+				
+
 				<!-- 每日价格 -->
-					<view class="priceBoxWeek">
-						<view class="weekendBox">
-							<view >
-								<text style="font-size: 30rpx; margin-right: 90rpx; " >周一</text>
-							</view>
-							<view style="display: flex;">
-								<text style="font-size: 30rpx;">¥</text> <input v-model="form.mondayPrice" type="text" placeholder="请输入价格"   style="width: 210rpx;height: 42rpx; font-size: 30rpx;"/> 
-							</view>
+				<view class="priceBoxWeek">
+					<view class="weekendBox">
+						<view>
+							<text style="font-size: 30rpx; margin-right: 90rpx; ">周一</text>
+						</view>
+						<view style="display: flex;">
+							<text style="font-size: 30rpx;">¥</text> <input v-model="form.mondayPrice" type="text"
+								placeholder="请输入价格" style="width: 210rpx;height: 42rpx; font-size: 30rpx;" />
 						</view>
 					</view>
-					
-					<view class="priceBoxWeek">
-						<view class="weekendBox">
-							<view >
-								<text style="font-size: 30rpx; margin-right: 90rpx; " >周二</text>
-							</view>
-							<view style="display: flex;">
-								<text style="font-size: 30rpx;">¥</text> <input v-model="form.tuesdayPrice" type="text" placeholder="请输入价格"   style="width: 210rpx;height: 42rpx; font-size: 30rpx;"/> 
-							</view>
+				</view>
+
+				<view class="priceBoxWeek">
+					<view class="weekendBox">
+						<view>
+							<text style="font-size: 30rpx; margin-right: 90rpx; ">周二</text>
+						</view>
+						<view style="display: flex;">
+							<text style="font-size: 30rpx;">¥</text> <input v-model="form.tuesdayPrice" type="text"
+								placeholder="请输入价格" style="width: 210rpx;height: 42rpx; font-size: 30rpx;" />
 						</view>
 					</view>
-					
-					<view class="priceBoxWeek">
-						<view class="weekendBox">
-							<view >
-								<text style="font-size: 30rpx; margin-right: 90rpx; " >周三</text>
-							</view>
-							<view style="display: flex;">
-								<text style="font-size: 30rpx;">¥</text> <input v-model="form.wednesdayPrice" type="text" placeholder="请输入价格"   style="width: 210rpx;height: 42rpx; font-size: 30rpx;"/> 
-							</view>
+				</view>
+
+				<view class="priceBoxWeek">
+					<view class="weekendBox">
+						<view>
+							<text style="font-size: 30rpx; margin-right: 90rpx; ">周三</text>
+						</view>
+						<view style="display: flex;">
+							<text style="font-size: 30rpx;">¥</text> <input v-model="form.wednesdayPrice" type="text"
+								placeholder="请输入价格" style="width: 210rpx;height: 42rpx; font-size: 30rpx;" />
 						</view>
 					</view>
-					
-					<view class="priceBoxWeek">
-						<view class="weekendBox">
-							<view >
-								<text style="font-size: 30rpx; margin-right: 90rpx; " >周四</text>
-							</view>
-							<view style="display: flex;">
-								<text style="font-size: 30rpx;">¥</text> <input v-model="form.thursdayPrice" type="text" placeholder="请输入价格"   style="width: 210rpx;height: 42rpx; font-size: 30rpx;"/> 
-							</view>
+				</view>
+
+				<view class="priceBoxWeek">
+					<view class="weekendBox">
+						<view>
+							<text style="font-size: 30rpx; margin-right: 90rpx; ">周四</text>
+						</view>
+						<view style="display: flex;">
+							<text style="font-size: 30rpx;">¥</text> <input v-model="form.thursdayPrice" type="text"
+								placeholder="请输入价格" style="width: 210rpx;height: 42rpx; font-size: 30rpx;" />
 						</view>
 					</view>
-					
-					<view class="priceBoxWeek">
-						<view class="weekendBox">
-							<view >
-								<text style="font-size: 30rpx; margin-right: 90rpx; " >周五</text>
-							</view>
-							<view style="display: flex;">
-								<text style="font-size: 30rpx;">¥</text> <input v-model="form.fridayPrice" type="text" placeholder="请输入价格"   style="width: 210rpx;height: 42rpx; font-size: 30rpx;"/> 
-							</view>
+				</view>
+
+				<view class="priceBoxWeek">
+					<view class="weekendBox">
+						<view>
+							<text style="font-size: 30rpx; margin-right: 90rpx; ">周五</text>
+						</view>
+						<view style="display: flex;">
+							<text style="font-size: 30rpx;">¥</text> <input v-model="form.fridayPrice" type="text"
+								placeholder="请输入价格" style="width: 210rpx;height: 42rpx; font-size: 30rpx;" />
 						</view>
 					</view>
-					
-					<view class="priceBoxWeek">
-						<view class="weekendBox">
-							<view >
-								<text style="font-size: 30rpx; margin-right: 90rpx; " >周六</text>
-							</view>
-							<view style="display: flex;">
-								<text style="font-size: 30rpx;">¥</text> <input v-model="form.saturdayPrice" type="text" placeholder="请输入价格"   style="width: 210rpx;height: 42rpx; font-size: 30rpx;"/> 
-							</view>
+				</view>
+
+				<view class="priceBoxWeek">
+					<view class="weekendBox">
+						<view>
+							<text style="font-size: 30rpx; margin-right: 90rpx; ">周六</text>
+						</view>
+						<view style="display: flex;">
+							<text style="font-size: 30rpx;">¥</text> <input v-model="form.saturdayPrice" type="text"
+								placeholder="请输入价格" style="width: 210rpx;height: 42rpx; font-size: 30rpx;" />
 						</view>
 					</view>
-					
-					<view class="priceBoxWeek">
-						<view class="weekendBox" style=" border-bottom: 1rpx solid #fff;">
-							<view  style="margin-top: 10rpx;">
-								<text style="font-size: 30rpx; margin-right: 90rpx; " >周日</text>
-							</view>
-							<view style="display: flex; margin-top: 10rpx;">
-								<text style="font-size: 30rpx;">¥</text> <input v-model="form.sundayPrice" type="text" placeholder="请输入价格"   style="width: 210rpx;height: 42rpx; font-size: 30rpx;
+				</view>
+
+				<view class="priceBoxWeek">
+					<view class="weekendBox" style=" border-bottom: 1rpx solid #fff;">
+						<view style="margin-top: 10rpx;">
+							<text style="font-size: 30rpx; margin-right: 90rpx; ">周日</text>
+						</view>
+						<view style="display: flex; margin-top: 10rpx;">
+							<text style="font-size: 30rpx;">¥</text> <input v-model="form.sundayPrice" type="text"
+								placeholder="请输入价格" style="width: 210rpx;height: 42rpx; font-size: 30rpx;
 								
-								 "/> 
-							</view>
+								 " />
 						</view>
 					</view>
-			 </view>
-			 <!-- 房间列表 -->
-			 <view class="everyHouseList" style="padding-top: 20rpx;">
-			 	 <view class="HouseListTitleInfo" >
-			 	 	<text style="font-size: 32rpx; font-weight: 700;">房间列表</text>
+				</view>
+			</view>
+			<!-- 房间列表 -->
+			<view class="everyHouseList" style="padding-top: 20rpx;">
+				<view class="HouseListTitleInfo">
+					<text style="font-size: 32rpx; font-weight: 700;">房间列表</text>
 					<text style="font-size: 24rpx; color: #777;">共8个房间</text>
-			 	 </view>
-				 <!-- 房间号 -->
-				 <view class="priceBoxWeek">
-				 	<view class="weekendBox" style="display: flex; justify-content: space-between;">						
+				</view>
+				<!-- 房间号 -->
+				<view class="priceBoxWeek" v-for="(room,index) in form.roomFloor" :key="index">
+					<view class="weekendBox" style="display: flex; justify-content: space-between;">
 						<view style="display: flex;">
-							<text> 楼层:</text><input style="width: 50rpx;" v-model="form.roomFloor[0].floor" type="text" />
+							<text style="font-size: 30rpx;"> 楼层:</text><input
+								style="width: 70rpx; margin-bottom: 5rpx; font-size: 28rpx;" v-model="room.floor"
+								type="text" />
 						</view>
 						<view style="display: flex;">
-								<text > 房间号:</text><input style="width: 50rpx;"  v-model="form.roomFloor[0].roomNumber" type="text" />
+							<text style="font-size: 30rpx;"> 房间号:</text><input
+								style="width: 70rpx; margin-bottom: 5rpx; font-size: 28rpx;" v-model="room.roomNumber"
+								type="text" />
 						</view>
-						
-				 		<view style="display: flex; margin-top: 10rpx;">
+
+						<view style="display: flex; margin-top: 10rpx;" @click="delRoom(index)">
 							<u-icon name="trash"></u-icon>
-				 		</view>
-				 	</view>
-				 </view>
-				 
-				
-			 </view>
-			 
-			 <!-- 添加按钮 -->
-			 <view class="submit">
-			 	<u-icon name="plus-circle" color=" #1372FF"></u-icon>
+						</view>
+					</view>
+				</view>
+			</view>
+			<view class="submit" @click="addRoom">
+				<u-icon name="plus-circle" color=" #1372FF"></u-icon>
 				<text style="color: #1372FF; font-size: 30rpx;">添加房间</text>
-			 </view>
-			 
-			 <!-- 确定添加按钮 -->
-			 <view class="addSubmit" @click="addNewRoom">
-				 
-			 	<text style="line-height: 96rpx; margin-left:310rpx; font-size: 32rpx; color: #fff;">确定</text>
-			 </view>
-		</view>
-			
 			</view>
+			<!-- 确定添加按钮 -->
+			<view class="addSubmit" @click="addNewRoom">
+				<text style="line-height: 96rpx; margin-left:310rpx; font-size: 32rpx; color: #fff;">确定</text>
+			</view>
+		</view>
+		<!-- 确定添加按钮 -->
+		<view class="addSubmit" @click="addNewRoom">
+
+			<text style="line-height: 96rpx; margin-left:310rpx; font-size: 32rpx; color: #fff;">确定</text>
+		</view>
+		</view>
+
+	</view>
+
 </template>
 
 <script>
-	export default{
-		data(){
-			return{
-				checked:false,
-				weekedChecked:false,
-				action: '',//图片服务器地址
-							fileList: [
-								{
-									url: '',
-								}
-							],
-				
-				form:{
-					homestayId:'',
-					mondayPrice:'',
-					tuesdayPrice:'',
-					wednesdayPrice:'',
-					thursdayPrice:'',
-					fridayPrice:'',
-					saturdayPrice:'',
-					sundayPrice:'',
-					name:'',
-					shortName:'',
-					roomFloor:[
-					{	floor:'',
-						roomNumber:''}
-					]
-					
+	export default {
+		data() {
+			return {
+				checked: false,
+				weekedChecked: false,
+				action: '', //图片服务器地址
+				fileList: [],
+
+				form: {
+					homestayId: '',
+					mondayPrice: '',
+					tuesdayPrice: '',
+					wednesdayPrice: '',
+					thursdayPrice: '',
+					fridayPrice: '',
+					saturdayPrice: '',
+					sundayPrice: '',
+					name: '',
+					shortName: '',
+					roomFloor: [{
+						floor: '',
+						roomNumber: ''
+					}]
+
 				},
-					
-				
+
+
 			}
-			
-		},
-		onLoad({id}){
-			this.form.homestayId=id
-			console.log(this.form.homestayId)
-			
+
 		},
-		methods:{
-			// change(status) {
-			// 				console.log(status);
-			// 			},
-			addNewRoom(){
-				this.$api.post('/merchant/hotel/mine/addHouseBase',this.form).then(res=>{
-					console.log(res)
-					if(res.data.code===0){
-						this.$showToast('添加成功');
-						setTimeout(()=>{
-							uni.reLaunch({
-								url:'/pages/my/roomType'
+		onLoad({id,houseBaseId}){
+				this.form.homestayId=id
+				// console.log(houseBaseId)
+				this.id=houseBaseId
+				// console.log(this.id)
+				this.getTypeInfo()
+				
+			},
+		methods: {
+			// 删除图片
+			deletePic(event) {
+				this.fileList.splice(event.index, 1)
+			},
+			// 新增图片
+			async afterRead(event) {
+				const result = await this.uploadFilePromise(event.file[0].url);
+				//图片路径
+				console.log(result)
+			},
+			// 图片大小超出最大允许大小
+			overSize(e) {
+				uni.$u.toast('上传图片大小不能超过10MB!')
+			},
+			//上传图片
+			uploadFilePromise(url) {
+				console.log(url)
+				return new Promise((resolve, reject) => {
+					let a = uni.uploadFile({
+						url: 'https://i.ringzle.com/island-cloud-server/oss/file/upload',
+						filePath: url,
+						name: 'file',
+						header: {
+							token: wx.getStorageSync('access_token')
+						},
+						success: (res) => {
+							console.log(res)
+							let data = JSON.parse(res.data) //最终传给的是字符串,这里需要转换格式
+							this.fileList.push({
+								url: data.data.url
 							})
-						},1500)
-					}
+							resolve(data.data.url)
+						}
+					});
 				})
-			}
+			},
+			// 添加&编辑房屋
+						addNewRoom(){
+								if(this.checked===true){
+									this.form.isPutAway=1
+								}else{
+									this.form.isPutAway=0
+								}
+								// console.log(this.form)
+							if(!this.id){
+								this.$api.post('/merchant/hotel/mine/addHouseBase',this.form).then(res=>{
+									// console.log(res)
+									if(res.data.code===0){
+										this.$showToast('添加成功');
+										setTimeout(()=>{
+											uni.reLaunch({
+												url:'/pages/my/roomType'
+											})
+										},1500)
+									}
+								})
+								console.log('这是')
+							}else{
+								// console.log('这是修改')
+								// if(this.)
+								this.$api.put('/merchant/hotel/mine/updHouseBase',this.form).then(res=>{
+									// console.log('修改成功')
+									if(res.data.code===0){
+										this.$showToast('添加成功')
+										setTimeout(()=>{
+											uni.reLaunch({
+												url:'/pages/my/roomType'
+											})
+										},1500)
+									}
+								})
+								
+							}
+						},
+						// 添加房间
+						addRoom(){
+							const newRoom = {floor:'',roomNumber:''}
+							this.form.roomFloor.push(newRoom)
+						},
+						// 删除房间
+						delRoom(index){
+							this.form.roomFloor.splice(index,1)
+						},
+					
+						// 获取当前房型信息
+						getTypeInfo(){
+							if(this.id){
+							this.$api.get(`/merchant/hotel/mine/getHouseBaseInfo/${this.id}`).then((res)=>{
+								// console.log(res)
+								if(res.data.code===0){
+									this.form=res.data.data				
+								}
+							})
+								
+							}else{
+								return
+							}
+						}
 		}
-		
+
 	}
 </script>
 
-<style lang="scss"> 
+<style lang="scss">
 	.page {
 		background: #F3F4F4;
 		padding-bottom: 260rpx;
@@ -255,41 +350,48 @@
 		overflow-y: auto;
 		overflow-x: auto;
 	}
+
 	.body {
 		padding-top: 20rpx;
 		padding-left: 30rpx;
 		padding-right: 30rpx;
 	}
-	.typeInfo{
+
+	.typeInfo {
 		background-color: #fff;
-		width: 650rpx;
-		height: 290rpx;
-		border-radius: 10rpx;
-		padding-top: 30rpx;
-		padding-left: 15rpx;
-		padding-right: 30rpx;
+		width: 100%;
+		height: 145px;
+		border-radius: 5px;
+		padding-top: 15px;
+		padding-left: 7px;
+		padding-right: 15px;
+		box-sizing: border-box;
 	}
-	.titleInfo{
-	// margin-top: 30rpx;
-	margin-left: 20rpx;
-	margin-bottom: 40rpx;
+
+	.titleInfo {
+		// margin-top: 30rpx;
+		margin-left: 20rpx;
+		margin-bottom: 40rpx;
 	}
-	.cellBox{
+
+	.cellBox {
 		margin-left: 20rpx;
 		display: flex;
 		padding-bottom: 40rpx;
 		border-bottom: 1rpx solid #E1E1E1;
 	}
-	.bigRoom{
+
+	.bigRoom {
 		margin-left: 20rpx;
 		width: 100%;
 		height: 102rpx;
 		display: flex;
 		// justify-content: center;
 		align-items: center;
-		
+
 	}
-	.shelves{
+
+	.shelves {
 		width: 695rpx;
 		height: 102rpx;
 		background-color: #fff;
@@ -301,27 +403,31 @@
 		// padding-left: 30rpx;
 		// padding-right: 30rpx;
 	}
-	.uploadPic{
+
+	.uploadPic {
 		padding-top: 28rpx;
 		width: 690rpx;
-		height: 293rpx;
+		// height: 293rpx;
 		background-color: #fff;
 		border-radius: 10rpx;
 		margin-top: 20rpx;
 	}
-	.pic{
-		margin-left: 30rpx;
-		margin-top: 20rpx;
-		width: 190rpx;
-		height: 120rpx;
-		background-color: pink;
+
+	.pic {
+		// margin-left: 30rpx;
+		// margin-top: 20rpx;
+		// width: 190rpx;
+		// height: 120rpx;
+		margin: 20rpx 30rpx;
+		padding-bottom: 20rpx;
 	}
+
 	// .custom-upload-button{
 	// 	width: 190rpx;
 	// 	height: 120rpx;
-	
+
 	// }
-	.priceInfo{
+	.priceInfo {
 		width: 690rpx;
 		height: 908rpx;
 		background-color: #fff;
@@ -329,19 +435,22 @@
 		margin-top: 20rpx;
 		padding-top: 30rpx;
 	}
-	.week{
-		
+
+	.week {
+
 		padding-left: 30rpx;
 		padding-right: 30rpx;
 		margin-bottom: 20rpx;
 	}
-	.weekend{
+
+	.weekend {
 		display: flex;
 		justify-content: space-between;
 		border-bottom: 1rpx solid #E1E1E1;
 		padding-bottom: 30rpx;
 	}
-	.everyDay{
+
+	.everyDay {
 		padding-left: 30rpx;
 		padding-right: 30rpx;
 		width: 100%;
@@ -350,29 +459,33 @@
 		display: flex;
 		align-items: center;
 	}
-	.days{
+
+	.days {
 		display: flex;
 		align-items: center;
 		border-bottom: 1rpx solid #E1E1E1;
 		padding-bottom: 30rpx;
 	}
-	.priceBoxWeek{
+
+	.priceBoxWeek {
 		display: flex;
 		align-items: center;
 		height: 102rpx;
-	   padding-left: 30rpx;
-	  padding-right: 30rpx;
+		padding-left: 30rpx;
+		padding-right: 30rpx;
 	}
-	.weekendBox{
-	width: 630rpx;
-	display: flex;
-	margin-top: 20rpx;
-	// margin-right: 90rpx;
-	// justify-content: space-between;
-	border-bottom: 1rpx solid #E1E1E1;
-	padding-bottom: 32rpx;
+
+	.weekendBox {
+		width: 630rpx;
+		display: flex;
+		margin-top: 20rpx;
+		// margin-right: 90rpx;
+		// justify-content: space-between;
+		border-bottom: 1rpx solid #E1E1E1;
+		padding-bottom: 32rpx;
 	}
-	.everyHouseList{
+
+	.everyHouseList {
 		// padding-right: 30rpx;
 		width: 690rpx;
 		// height: 908rpx;
@@ -381,14 +494,16 @@
 		margin-top: 20rpx;
 		// padding-top: 30rpx;
 	}
-	.HouseListTitleInfo{
+
+	.HouseListTitleInfo {
 		margin-right: 30rpx;
 		margin-left: 20rpx;
 		margin-bottom: 40rpx;
 		display: flex;
 		justify-content: space-between;
 	}
-	.submit{
+
+	.submit {
 		margin-top: 20rpx;
 		border-radius: 10rpx;
 		width: 690rpx;
@@ -398,16 +513,30 @@
 		justify-content: center;
 		align-items: center;
 	}
-	.addSubmit{
-		  position: fixed;  /* 固定定位 */  
-		    bottom: 20rpx;         /* 底部对齐 */  
-		    left: 0;            /* 可选:左对齐 */  
-		    width: 690rpx;         /* 可选:宽度为 100% */  
-			height: 96rpx;
-			margin-left: 30rpx;
-			// padding-top: 20rpx;
-			margin-top: 30rpx;
-		    background-color: #1372FF;
-			border-radius: 48rpx;
+
+	.addSubmit {
+		position: fixed;
+		/* 固定定位 */
+		bottom: 20rpx;
+		/* 底部对齐 */
+		left: 0;
+		/* 可选:左对齐 */
+		width: 690rpx;
+		/* 可选:宽度为 100% */
+		height: 96rpx;
+		margin-left: 30rpx;
+		// padding-top: 20rpx;
+		margin-top: 30rpx;
+		background-color: #1372FF;
+		border-radius: 48rpx;
+	}
+
+	.uploadPicPic {
+		position: relative;
+		top: -96rpx;
+	}
+
+	.u-upload__deletable[data-v-69e2a36e] {
+		width: 0 !important;
 	}
 </style>

+ 2 - 2
pages/my/index.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="page" :style="{'height':(h-th)+'px'}">
+	<view class="page" :style="{'height':(h)+'px'}">
 		<c-nav-bar title="我的" bgColor="transparent" :titleStyle="titleStyle" :showIcon="false"></c-nav-bar>
 		<view class="bg" :style="{'padding-top':(mt+30)+'px'}">
 			<view class="account">
@@ -112,7 +112,7 @@
 
 		.bg {
 			width: 100%;
-			height: 360rpx;
+			height: 412rpx;
 			padding: 0 60rpx;
 			background: url(https://i.ringzle.com/file/20240107/fc66824bcef14a3b9e19f8b966a128c7.png) no-repeat;
 			background-size: 100% 100%;

+ 12 - 3
pages/my/roomType.vue

@@ -3,10 +3,10 @@
 			<c-nav-bar title="房型列表" :showIcon="false" :titleStyle="titleStyle"></c-nav-bar>
 			<!-- 房型数量 -->
 			<view class="typeNum">
-					<text style="font-size: 24rpx; color: #777;">共3个房型</text>
+					<text style="font-size: 24rpx; color: #777;">共{{roomType.length}}个房型</text>
 			</view>
 			<!-- 房型选择 -->
-			<view class="type" v-for="item in roomType" :key="item.houseBaseId">
+			<view class="type" v-for="item in roomType" :key="item.houseBaseId" @click="goEditTypeInfo(item.houseBaseId)">
 				<view class="top">
 					<text style="font-size: 30rpx; color: #333;" >{{item.name}}</text>
 					<u-icon name="arrow-right"></u-icon>
@@ -14,7 +14,6 @@
 				<view class="under">
 					<text style="font-size: 24rpx; color: #777;">大床房</text>
 					<text style="font-size: 24rpx; color: #777;">{{item.roomCount}}间</text>
-					
 				</view>
 				
 			</view>
@@ -41,11 +40,14 @@
 		methods:{
 			// 获取房型列表信息
 			getHomestayId(){
+			
+				
 				this.$api.get(`/merchant/hotel/mine/getHouseBaseList/${this.homestayId}`,{
 					homestayId:this.homestayId
 				}).then((res)=>{
 					// console.log(res)
 					this.roomType=res.data.data
+					
 					// let roomSymbleName=this.roomType.name
 					// console.log(roomSymbleName)
 					// console.log(this.roomType)
@@ -56,6 +58,13 @@
 				uni.navigateTo({
 					url:`/pages/my/houseList?id=${this.homestayId}`
 				})
+			},
+			// 修改房型信息
+			goEditTypeInfo(houseBaseId){
+				uni.navigateTo({
+					url:`/pages/my/houseList?houseBaseId=${houseBaseId}`
+				})
+				console.log(houseBaseId)
 			}
 		}
 	}

+ 1 - 1
pagesMy/orderList/orderList.vue

@@ -80,7 +80,7 @@
 				dataList: [],
 				limit: 10,
 				page: 1,
-				homestayId: this.$store.state.moduleHouse.homestayId,
+				homestayId: uni.getStorageSync('homestayId'),
 				statusClass: [
 					'',
 					'green',