17755135699 před 10 měsíci
rodič
revize
ae6b2bba02

+ 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')

+ 2 - 2
http/baseApi.js

@@ -1,11 +1,11 @@
 // 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

+ 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: "",

+ 39 - 16
pages/house/index.vue

@@ -1,16 +1,17 @@
 <template>
-	<scroll-view class="page" scroll-x="true" scroll-y="true" :style="{'height':(h-th)+'px','padding-top':mt+'px'}" @scroll="scroll" id="page" >
+	<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="tj">
-				<text>房间总数:</text>
+				<text class="label">房间总数:</text>
 				<text>{{info.totalRooms}}</text>
-				<text>在入住房间数:</text>
+				<text class="label">在入住房间数:</text>
 				<text>{{info.checkinRooms}}</text>
-				<text>待入住房间数:</text>
+				<text class="label">待入住房间数:</text>
 				<text>{{info.bookRooms}}</text>
 			</view>
-			<view class="date">
+			<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>
@@ -37,7 +38,7 @@
 						</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>
 						<view class="table">
 							<view class="tr" v-for="(item2,index2) in item" :key="index2">
 								<view class="td" :style="{'left':scrollLeft+'px'}">{{item2.roomNumber}}</view>
@@ -131,13 +132,14 @@
 				checkPrice: [],
 				checkDataRoomId: [],
 				checkStatus: '',
-				scrollLeft:0
+				scrollLeft: 0
 			}
 		},
 		onLoad() {
 			that = this;
 			this.getLeftData();
 			this.getData();
+			this.getTj();
 		},
 		filters: {
 			delDataStatus(roomNumber, id, roomId, name) {
@@ -159,7 +161,16 @@
 				this.getData();
 				this.$forceUpdate();
 			},
-			scroll(e){
+			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)
 			},
@@ -368,6 +379,22 @@
 		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 {
@@ -376,6 +403,7 @@
 		border: 1rpx solid #E9F0F5;
 		margin-bottom: 30rpx;
 		padding-left: 130rpx;
+
 		.item {
 			min-width: 130rpx;
 			width: 130rpx;
@@ -391,9 +419,10 @@
 			&:last-child {
 				border: 0;
 			}
+
 			&:first-child {
 				position: absolute;
-				left:0;
+				left: 0;
 				top: 0;
 				width: 130rpx;
 			}
@@ -471,7 +500,7 @@
 				align-items: center;
 				background-color: #fff;
 				position: relative;
-				padding-left:130rpx;
+				padding-left: 130rpx;
 
 				&:last-child {
 					border: 0;
@@ -599,10 +628,4 @@
 	.pd0 {
 		padding: 0 !important;
 	}
-	::v-deep.el-time-spinner__wrapper{
-		width: 50%;
-		&:last-child{
-			display: none;
-		}
-	}
 </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'

+ 30 - 21
pages/my/houseList.vue

@@ -24,7 +24,7 @@
 					<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>
 			<!-- 图片上传
@@ -156,32 +156,34 @@
 				<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>
 
 			<!-- 确定添加按钮 -->
@@ -462,4 +464,11 @@
 		background-color: #1372FF;
 		border-radius: 48rpx;
 	}
+	.uploadPicPic{
+		position: relative;
+		top: -96rpx;
+	}
+	.u-upload__deletable[data-v-69e2a36e] {
+		width: 0 !important;
+	}
 </style>

+ 1 - 1
pages/my/index.vue

@@ -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%;

+ 13 - 4
pages/my/roomType.vue

@@ -3,10 +3,10 @@
 			<c-nav-bar title="房型列表" :showIcon="true" :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>
@@ -30,7 +29,7 @@
 	export default {
 		data(){
 			return {
-				homestayId:this.$store.state.moduleHouse.homestayId,
+				homestayId:uni.getStorageSync('homestayId'),
 				roomType:[]
 			}
 		},
@@ -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',