Commit 8ccd26d9 authored by 罗超's avatar 罗超

完善酒店列表信息

parent 4c5be41b
<template> <template>
<view class="u-dropdown" style="padding: 0 15px;"> <view class="u-dropdown" style="padding: 0 30rpx;">
<view class="u-dropdown__menu" :style="{ <view class="u-dropdown__menu" :style="{
height: $u.addUnit(height) height: $u.addUnit(height)
}" :class="{ }" :class="{
......
<template>
</template>
<script>
</script>
<style>
</style>
...@@ -51,12 +51,22 @@ ...@@ -51,12 +51,22 @@
<u-popup v-model="showTimePopup" mode="bottom" border-radius="20" length="95%" :safe-area-inset-bottom="true"> <u-popup v-model="showTimePopup" mode="bottom" border-radius="20" length="95%" :safe-area-inset-bottom="true">
<canlendar @finish="chosenDateResult"></canlendar> <canlendar @finish="chosenDateResult"></canlendar>
</u-popup> </u-popup>
<view class="morewhere">
<view v-for="(x,i) in threeLevelList" class="item" @click="chosenMorewhere(x.id)" :class="{'active':searchObj.moreSearch.indexOf(x.id)!=-1}">{{x.name}}</view>
</view>
<scroll-view :scroll-y="true" @scrolltolower="lower" :enable-back-to-top="true" :enable-flex="true" :scroll-top="scrollTop"
@scroll="scroll" style="height: calc(100% - 224rpx); padding-bottom: 0px;">
<u-loadmore v-if="showLoading" :status="status" :load-text="loadText" :font-size="24" :margin-top="20"
:margin-bottom="20" bg-color="#F5F5F5" color="#111" />
</scroll-view>
</view> </view>
</template> </template>
<script> <script>
import rangeSlider from "./components/range-slider.vue" import rangeSlider from "./components/range-slider.vue"
import canlendar from "./components/time/index.vue" import canlendar from "./components/time/index.vue"
import hotelGood from './components/hotel-good.vue';
export default { export default {
data() { data() {
return { return {
...@@ -73,7 +83,8 @@ ...@@ -73,7 +83,8 @@
priceText:"不限", priceText:"不限",
rate:[] rate:[]
}, },
date:{} date:{},
moreSearch:[]
}, },
tempRateAndPrice:{ tempRateAndPrice:{
price:{}, price:{},
...@@ -174,12 +185,50 @@ ...@@ -174,12 +185,50 @@
fontSize: '30rpx', fontSize: '30rpx',
width: '100%', width: '100%',
background:"#111" background:"#111"
} },
threeLevelList:[
{
name:"民宿",
id:0
},
{
name:"大床房",
id:1
},
{
name:"双床房",
id:2
},
{
name:"含早餐",
id:3
},
{
name:"免费取消",
id:4
},
{
name:"优惠活动",
id:5
}
],
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多商品了",
},
scrollTop: 0,
old: {
scrollTop: 0,
},
showLoading:false,
status: "loadmore",
} }
}, },
components: { components: {
rangeSlider, rangeSlider,
canlendar canlendar,
hotelGood
}, },
created() { created() {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
...@@ -202,6 +251,34 @@ ...@@ -202,6 +251,34 @@
this.searchObj.date=obj this.searchObj.date=obj
}, },
methods: { methods: {
scroll: function(e) {
this.old.scrollTop = e.detail.scrollTop;
},
goTop: function(e) {
this.scrollTop = this.old.scrollTop;
this.$nextTick(function() {
this.scrollTop = 0;
});
},
lower(e) {
// TODO: 滚动到了底部,实现翻页加载
// if (this.msg.pageIndex < this.page_count) {
// this.status = "loading";
// this.msg.pageIndex++;
// this.init();
// } else {
// this.isover = true;
// this.status = "nomore";
// }
},
chosenMorewhere(id){
let i=this.searchObj.moreSearch.indexOf(id)
if(i==-1){
this.searchObj.moreSearch.push(id)
}else{
this.searchObj.moreSearch.splice(i,1)
}
},
chosenDateResult(obj){ chosenDateResult(obj){
this.searchObj.date=obj this.searchObj.date=obj
this.showTimePopup=false this.showTimePopup=false
...@@ -362,4 +439,30 @@ ...@@ -362,4 +439,30 @@
background: #111111; background: #111111;
color: #FFFFFF; color: #FFFFFF;
} }
.hotel-list .morewhere{
padding:10rpx 30rpx;
display: flex;
align-items: center;
overflow-x: auto;
flex-wrap: nowrap;
}
.hotel-list .morewhere .item{
padding: 0 20rpx;
height: 36rpx;
line-height: 36rpx;
background: #ECF1F4;
border-radius: 8rpx;
margin-right: 26rpx;
font-size: 22rpx;
color: #999999;
font-weight: 400;
flex-shrink: 0;
}
.hotel-list .morewhere .item.active{
background: #111111;
color: #FFFFFF;
}
.hotel-list .morewhere .item:last-child{
margin-right: 0;
}
</style> </style>
...@@ -4,8 +4,8 @@ export default { ...@@ -4,8 +4,8 @@ export default {
// Vue.prototype.host2 = "http://192.168.0.110:8200" // Vue.prototype.host2 = "http://192.168.0.110:8200"
// Vue.prototype.host2 = "https://mallApi.oytour.com" // Vue.prototype.host2 = "https://mallApi.oytour.com"
// Vue.prototype.host2 = "http://192.168.1.5:8088" // Vue.prototype.host2 = "http://192.168.1.5:8088"
//Vue.prototype.host2 = "http://192.168.20.17:8014" Vue.prototype.host2 = "http://192.168.20.17:8014"
Vue.prototype.host2 = "http://192.168.20.13:8088" //Vue.prototype.host2 = "http://192.168.20.13:8088"
// Vue.prototype.host2 = "http://testmall.oytour.com/" // Vue.prototype.host2 = "http://testmall.oytour.com/"
Vue.prototype.request = function(param, success, failed) { Vue.prototype.request = function(param, success, failed) {
......
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