Commit 88690202 authored by youjie's avatar youjie

优化

parent 5ca46b78
...@@ -173,7 +173,7 @@ ...@@ -173,7 +173,7 @@
border-radius="20" length="89%" border-radius="20" length="89%"
:safe-area-inset-bottom="true" :safe-area-inset-bottom="true"
:mask-close-able="false"> :mask-close-able="false">
<CheckDate :msg="parameters" @chosenDateResult="chosenDateResult"></CheckDate> <CheckDate :showTimePopup="showTimePopup" :msg="parameters" @chosenDateResult="chosenDateResult"></CheckDate>
</u-popup> </u-popup>
<u-popup v-model="showSearchCity" mode="Right" length="100%"> <u-popup v-model="showSearchCity" mode="Right" length="100%">
......
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
display: flex; display: flex;
flex-direction: column;"> flex-direction: column;">
<view style="width: 100%; height: 740rpx"> <view style="width: 100%; height: 740rpx">
<canlendar @finish="chosenDateResult" title="日期和人数"></canlendar> <canlendar v-if="showTimePopup"
:defaultDate="dayObj.start"
@finish="chosenDateResult" title="日期和人数"></canlendar>
</view> </view>
<view class="column" style="background: #ecf1f4; padding: 20rpx 0 50rpx 0;height: 1rpx;flex: 1;"> <view class="column" style="background: #ecf1f4; padding: 20rpx 0 50rpx 0;height: 1rpx;flex: 1;">
<view class="row line-flexBoxRoom"> <view class="row line-flexBoxRoom">
...@@ -110,7 +112,7 @@ ...@@ -110,7 +112,7 @@
<script> <script>
import canlendar from "./index"; import canlendar from "./index";
export default { export default {
props:['msg'], props:['msg','showTimePopup'],
components: { components: {
canlendar canlendar
}, },
...@@ -125,6 +127,7 @@ export default { ...@@ -125,6 +127,7 @@ export default {
}, },
TypeList: [], TypeList: [],
current: -1, current: -1,
dayObj: {},
} }
}, },
watch:{ watch:{
...@@ -136,6 +139,12 @@ export default { ...@@ -136,6 +139,12 @@ export default {
}, },
deep: true, deep: true,
}, },
showTimePopup: {
handler (val, oldval) {
},
deep: false,
immediate: true
},
}, },
created(){ created(){
for(let i=1;i<=18;i++){ for(let i=1;i<=18;i++){
...@@ -145,6 +154,15 @@ export default { ...@@ -145,6 +154,15 @@ export default {
}) })
} }
}, },
mounted() {
uni.getStorage({
key: "Time",
success: (res) => {
let obj = JSON.parse(res.data);
this.dayObj = obj
},
});
},
methods: { methods: {
getRooms(e){ getRooms(e){
if(e.value>this.parameters.rooms||e.value<this.parameters.rooms){ if(e.value>this.parameters.rooms||e.value<this.parameters.rooms){
...@@ -224,7 +242,6 @@ export default { ...@@ -224,7 +242,6 @@ export default {
}) })
} }
} }
this.showTimePopup = false;
this.$emit('chosenDateResult',this.parameters,obj) this.$emit('chosenDateResult',this.parameters,obj)
}, },
} }
......
...@@ -2,37 +2,12 @@ ...@@ -2,37 +2,12 @@
<view class="content"> <view class="content">
<scroll-view <scroll-view
:scroll-y="true" :scroll-y="true"
class="hotelSign-scroll"
scroll-with-animation="true"
style="height: 100%; flex: 1; box-sizing: border-box" style="height: 100%; flex: 1; box-sizing: border-box"
:scroll-top="scrollTop"
> >
<view class="header"> <view class="header">
<!-- <view class="bar"></view>
<view class="set text-gray">
<text @click="close" style="font-size:40upx;">返回</text>
<text @click="reset" style="font-size:35upx;color:#DDDDDD">清空</text>
</view> -->
<!-- <view class="in-and-out">
<view class="item" v-if="start.length > 0">
<view style="font-size:30upx;color:#C0C0C0">入住日期</view>
<view style="font-weight: bold;margin-top:10upx;font-size:36upx">{{ startDay }}</view>
<view style="font-size:24upx;margin-top:10upx">{{ startWeek }}</view>
</view>
<view class="item text" v-if="start.length == 0">
<view>入住日期</view>
</view>
<view class="item">
<view class="count-border" :class="day == 0 ? 'gray' : 'orange'">
<view class="count" style="font-size:26upx;line-height:26upx;">{{ day }}</view>
</view>
</view>
<view class="item text" v-if="end.length == 0">
<view>离店日期</view>
</view>
<view class="item" v-if="end.length > 0">
<view style="font-size:30upx;color:#C0C0C0">离店日期</view>
<view style="font-weight: bold;margin-top:10upx;font-size:36upx">{{ endDay }}</view>
<view style="font-size:24upx;margin-top:10upx">{{ endWeek }}</view>
</view>
</view> -->
<view <view
style=" style="
font-size: 32rpx; font-size: 32rpx;
...@@ -154,8 +129,7 @@ ...@@ -154,8 +129,7 @@
import json from "./day.js"; import json from "./day.js";
export default { export default {
props:['title'], props:['title','defaultDate'],
computed: {},
computed: { computed: {
//房间是否能预订 //房间是否能预订
isSub() { isSub() {
...@@ -226,10 +200,14 @@ export default { ...@@ -226,10 +200,14 @@ export default {
day: 0, //多少晚 day: 0, //多少晚
priceStauts: [], //价格状态 priceStauts: [], //价格状态
lastNot: [0, 10], //前置的无房操作 lastNot: [0, 10], //前置的无房操作
userDefaultDate: "",
scrollTop:0,
scrollHeight:0
}; };
}, },
mounted() { mounted() {
console.log("进入了...."); console.log("进入了....");
this.userDefaultDate = this.defaultDate;
uni.getSystemInfo({ uni.getSystemInfo({
success: (res) => { success: (res) => {
this.dayWidth = res.windowWidth; this.dayWidth = res.windowWidth;
...@@ -287,9 +265,22 @@ export default { ...@@ -287,9 +265,22 @@ export default {
// } // }
// }); // });
// } // }
setTimeout(()=>{
const that =this
const query = uni.createSelectorQuery().in(this);
query.selectAll('.hotelSign-scroll').boundingClientRect((rects) => {
that.scrollHeight = rects[0].height
that.calcDefautlOffset()
}).exec();
},500)
}, },
onShow(){
},
watch: { watch: {
defaultDate(newVal) {
this.userDefaultDate = newVal;
},
//离店日期 //离店日期
end(newVal) { end(newVal) {
if (this.end.length != 0) { if (this.end.length != 0) {
...@@ -366,6 +357,14 @@ export default { ...@@ -366,6 +357,14 @@ export default {
}, },
}, },
methods: { methods: {
calcDefautlOffset(){
const that =this
const query = uni.createSelectorQuery().in(this);
query.selectAll('.select-style').boundingClientRect((rects) => {
const top = rects[0].top-(that.scrollHeight)-20
that.scrollTop = top>0?top:0
}).exec();
},
//月份补零 //月份补零
setMonth(dateIndex) { setMonth(dateIndex) {
let month = this.date[dateIndex].month; let month = this.date[dateIndex].month;
......
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
border-radius="20" length="89%" border-radius="20" length="89%"
:safe-area-inset-bottom="true" :safe-area-inset-bottom="true"
:mask-close-able="false"> :mask-close-able="false">
<CheckDate :msg="searchObj" @chosenDateResult="chosenDateResult"></CheckDate> <CheckDate :showTimePopup="showTimePopup" :msg="searchObj" @chosenDateResult="chosenDateResult"></CheckDate>
</u-popup> </u-popup>
<auth v-if="showAuth&&is_show_auth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth> <auth v-if="showAuth&&is_show_auth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
</view> </view>
......
...@@ -74,8 +74,8 @@ ...@@ -74,8 +74,8 @@
</view> </view>
<view class="LastNameBox column val" style="width: 1px;flex: 1;"> <view class="LastNameBox column val" style="width: 1px;flex: 1;">
<view class="row items-center" v-for="(sItem,i) in item.GuestInfo" :key="i"> <view class="row items-center" v-for="(sItem,i) in item.GuestInfo" :key="i">
<input type="text" v-model="sItem.LastName" :placeholder="`${sItem.IsAdult?'住客':'儿童'} ${i+1} 姓`" /> <input type="text" v-model="sItem.LastName" :placeholder="`${sItem.IsAdult?'住客':sItem.Age+'岁儿童'} ${i+1} 姓`" />
<input type="text" v-model="sItem.FirstName" :placeholder="`${sItem.IsAdult?'住客':'儿童'} ${i+1} 名`" /> <input type="text" v-model="sItem.FirstName" :placeholder="`${sItem.IsAdult?'住客':sItem.Age+'岁儿童'} ${i+1} 名`" />
<!--<view class="row" style="margin-left:20rpx;"> <!--<view class="row" style="margin-left:20rpx;">
<image v-if="item.GuestInfo.length>1" <image v-if="item.GuestInfo.length>1"
style="width: 27rpx;height: 27rpx;display: block;" style="width: 27rpx;height: 27rpx;display: block;"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment