Commit 57190e4d authored by 黄奎's avatar 黄奎

11

parent 5e840888
<template>
<view class="hotel-list-item"
:class="[isMap?'hotel-mapList':'']" @click="goHotelDetail(item.hotelid)">
<view class="img-box">
<image :src="item.coverimg" mode="aspectFill"></image>
<view class="hotel-list-item" :class="[isMap?'hotel-mapList':'']" @click="goHotelDetail(item.hotelid)">
<view class="img-box">
<image v-if="item.coverimg&&item.coverimg!=''" :src="item.coverimg" mode="aspectFill"></image>
<image v-else src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/defaultHotelImg.png"
mode="aspectFill"></image>
</view>
<view class="hotel-info column">
<view class="hotel-name row items-center">
<img v-if="item.starRating>=3" class="hotel-SubR"
:class="[item.starRating==3?'hotel-SubStar3':item.starRating==4?'hotel-SubStar4':item.starRating==5?'hotel-SubStar5':'']"
:src="item.starRating==3?StarImgs[0]:item.starRating==4?StarImgs[1]:item.starRating==5?StarImgs[2]:''" />
<text v-else class="hotel-Economy">经济型</text>
{{item.name}}
</view>
<view class="hotel-info column">
<view class="hotel-name row items-center">
<img v-if="item.Star>=3" class="hotel-SubR" :class="[item.Star==3?'hotel-SubStar3':item.Star==4?'hotel-SubStar4':item.Star==5?'hotel-SubStar5':'']" :src="item.Star==3?StarImgs[0]:item.Star==4?StarImgs[1]:item.Star==5?StarImgs[2]:''"/>
<text v-else class="hotel-Economy">经济型</text>
{{item.name}}
<view class="hotel-Subtitle row">
<view class="hotel-SubText" v-if="item.areaList.length>0">
<text v-for="(t,i) in item.areaList" :key="i">{{ t }}
<template v-if="i!=item.areaList.length-1"></template>
</text>
</view>
<view class="hotel-Subtitle row">
<view class="hotel-SubText" v-if="item.areaList.length>0">
<text v-for="(t,i) in item.areaList" :key="i">{{ t }}
<template v-if="i!=item.areaList.length-1"></template>
</text>
</view>
</view>
<view class="hotel-start">
<view class="other-rate" v-for="(tItem,i) in item.tagList" :key="i">
<text>{{tItem}}</text>
</view>
<view class="hotel-start">
<view class="other-rate" v-for="(t,i) in item.tagList" :key="i">
<text>温泉酒店</text>
</view>
</view>
<view class="localtion row items-start">
<view class="localtionL">
<img style="width: 18rpx;height: 21rpx;"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638759918789658713.png" />
</view>
<view class="localtion row items-start">
<view class="localtionL">
<img
style="width: 18rpx;height: 21rpx;"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638759918789658713.png"/>
</view>
<view class="localtionR" style="width:1px;flex:1">
{{item.address}}
</view>
<view class="localtionR" style="width:1px;flex:1">
{{item.address}}
</view>
<!-- <view>
<u-tag v-for="(subItem,subIndex) in item.TagList" :key="subIndex" style="margin-right:10rpx;" :text="subItem" bg-color="#FFF" border-color="#DFBE6E" color="#DFBE6E"
size="mini"></u-tag>
</view>-->
<view class="hotel-price">
<view class="hotel-priceL">
<view>
{{ item.brandname }}
</view>
</view>
<view class="price">
<text>CNY</text>
<text class="money">{{item.unitprice}}</text>
<text></text>
</view>
<view class="hotel-price">
<view class="hotel-priceL">
<view>
{{ item.brandname }}
</view>
</view>
<view class="price">
<text>CNY</text>
<text class="money">{{item.unitprice}}</text>
<text></text>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: ['item','isMap','dayObj','searchObj'],
props: ['item', 'isMap', 'dayObj', 'searchObj'],
data() {
return {
StarImgs: [
......@@ -64,16 +61,14 @@
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/hotel4stars.png',
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/hotel5stars.png',
],
myDayObj:null,
myDayObj: null,
}
},
created() {
// console.log(this.HotelList, 'hotel');
},
watch:{
created() {},
watch: {
dayObj: {
handler (val, oldval) {
if(val){
handler(val, oldval) {
if (val) {
this.myDayObj = val
}
},
......@@ -81,11 +76,12 @@
immediate: true
}
},
methods:{
goHotelDetail(id){
methods: {
goHotelDetail(id) {
let myDayObj = JSON.stringify(this.myDayObj);
uni.navigateTo({
url: "/pages/hotel/detail?id=" + id + '&dayObj=' + myDayObj+'&searchObj='+JSON.stringify(this.searchObj)
url: "/pages/hotel/detail?id=" + id + '&dayObj=' + myDayObj + '&searchObj=' + JSON.stringify(
this.searchObj)
});
}
}
......@@ -93,7 +89,8 @@
</script>
<style>
@import url("@/asset/css/flex.css");
@import url("@/asset/css/flex.css");
.hotel-list-item {
margin: 0 0 25rpx 0;
padding-bottom: 25rpx;
......@@ -133,15 +130,15 @@
-webkit-line-clamp: 2;
overflow: hidden;
}
.hotel-Economy{
.hotel-Economy {
font-weight: 500;
font-size: 22rpx;
color: #757776;
margin-left: 10rpx;
}
.hotel-list-item .hotel-info .hotel-start {
}
.hotel-list-item .hotel-info .hotel-start {}
.hotel-list-item .hotel-info .hotel-start .rate {
font-size: 30rpx;
......@@ -179,16 +176,18 @@
position: absolute;
z-index: 1;
}
.hotel-list-item .hotel-info .localtion{
}
.hotel-list-item .hotel-info .localtionL{
.hotel-list-item .hotel-info .localtion {}
.hotel-list-item .hotel-info .localtionL {
margin-right: 9rpx;
}
.hotel-list-item .hotel-info .localtionL img{
.hotel-list-item .hotel-info .localtionL img {
position: relative;
top: -7rpx;
}
.hotel-list-item .hotel-info .localtionR {
font-size: 22rpx;
font-weight: 500;
......@@ -214,49 +213,59 @@
font-size: 34rpx;
margin-left: 5rpx;
}
.hotel-Subtitle{
.hotel-Subtitle {
font-size: 22rpx;
color: #FF3166;
padding: 5rpx 0;
}
.hotel-SubText{
.hotel-SubText {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.hotel-SubR{
.hotel-SubR {
max-width: 102rpx;
height: 35rpx;
margin-right: 10rpx;
position: relative;
top: 6rpx;
}
.hotel-Subtitle img{
.hotel-Subtitle img {
height: 35rpx;
display: block;
}
.hotel-SubStar3 img{
.hotel-SubStar3 img {
width: 74rpx;
}
.hotel-SubStar4 img{
.hotel-SubStar4 img {
width: 81rpx;
}
.hotel-SubStar5 img{
.hotel-SubStar5 img {
width: 102rpx;
}
.hotel-price{
.hotel-price {
height: 1px;
flex: 1;
display: flex;
justify-content: space-between;
align-items: flex-end;
}
.hotel-priceL{
.hotel-priceL {
width: 198rpx;
background: url('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638759918587388853.png')no-repeat;
background-size: 198rpx 26rpx;
}
.hotel-priceL view{
.hotel-priceL view {
width: 198rpx;
font-size: 20rpx;
color: #fff;
......@@ -268,9 +277,10 @@
top: -3rpx;
text-align: center;
}
.hotel-list-item.hotel-mapList{
.hotel-list-item.hotel-mapList {
margin: 0;
padding-bottom: 0;
border-bottom: 0;
}
</style>
</style>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<template>
<view class="hotel-list column" style="background: #F3F1EF;">
<view class="hotel-listHeader">
<hotelHeaders :title="pageTitle"></hotelHeaders>
<hotelSearch
:msg="searchObj"
:daysObj="dayObj"
:isMap="1"
@change="change"
@getItem="getItem"></hotelSearch>
<!-- <view style="padding: 9rpx 30rpx 19rpx 30rpx;">
<scroll-view :scroll-x="true">
<view class="ComprehensiveSortings row">
<view v-for="(item,index) in searchObj.TagList" :key="index"
:class="[item.IsCheck==1?'active':'']"
@click="chosenMorewhere(item)">
{{ item.Name }}
</view>
</view>
</scroll-view>
</view> -->
<hotelHeaders :title="pageTitle"></hotelHeaders>
<hotelSearch :msg="searchObj" :daysObj="dayObj" :isMap="1" @change="change" @getItem="getItem">
</hotelSearch>
</view>
<view style="height: 1px;flex: 1;overflow: hidden;">
<view class="no-data" v-if="HotelList.length === 0&&!showLoading" style="margin-top: 200rpx;">
......@@ -28,20 +13,17 @@
</view>
<view class="column hotelScrollBox" style="padding: 0 30rpx 0 30rpx;height:100%">
<scroll-view :scroll-y="true" @scrolltolower="lower" :enable-back-to-top="true" :enable-flex="true"
:scroll-top="scrollTop" @scroll="scroll"
v-if="HotelList.length > 0" class="hotelScroll">
:scroll-top="scrollTop" @scroll="scroll" v-if="HotelList.length > 0" class="hotelScroll">
<view style="padding: 0 31rpx;">
<view v-for="(item,index) in HotelList" :key="index">
<hotel-good :item="item" :dayObj="dayObj" :searchObj="searchObj"></hotel-good>
</view>
</view>
<u-loadmore v-if="showLoading" :status="status" :load-text="loadText" :font-size="24" :margin-top="20"
:margin-bottom="20" bg-color="#F5F5F5" color="#111" />
<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>
</view>
</template>
......@@ -118,12 +100,12 @@
let month1 = d1.getMonth() + 1;
let day1 = d1.getDate();
let Month1 = month1>9?month1:'0'+month1;
let Day1 = day1>9?day1:'0'+day1;
let Month1 = month1 > 9 ? month1 : '0' + month1;
let Day1 = day1 > 9 ? day1 : '0' + day1;
let month2 = d2.getMonth() + 1;
let day2 = d2.getDate();
let Month2 = month2>9?month2:'0'+month2;
let Day2 = day2>9?day2:'0'+day2;
let Month2 = month2 > 9 ? month2 : '0' + month2;
let Day2 = day2 > 9 ? day2 : '0' + day2;
var obj = {
start: `${d1.getFullYear()}-${Month1}-${Day1}`,
end: `${d1.getFullYear()}-${Month2}-${Day2}`,
......@@ -141,10 +123,9 @@
data: JSON.stringify(obj),
});
this.getSearchCondition();
// this.getList();
},
methods: {
getItem(parameters,obj) {
getItem(parameters, obj) {
this.searchObj = {
...this.searchObj,
...parameters
......@@ -181,7 +162,7 @@
this.research();
},
change(item) {
this.searchObj ={
this.searchObj = {
...this.searchObj,
...item,
}
......@@ -206,16 +187,15 @@
},
//获取列表数据
getList(type) {
if(this.showLoading) return
if (this.showLoading) return
uni.showLoading({
title: "加载中",
});
this.showLoading = true;
// this.searchObj.QStars = this.tempRateAndPrice.rate.toString();
if (type == 1) {
this.HotelList = [];
}
this.apipost('dmc_post_B2BAndB2CGetDidaHotelPage',this.searchObj,
this.apipost('dmc_post_B2BAndB2CGetDidaHotelPage', this.searchObj,
(res) => {
if (res.resultCode == 1) {
this.showLoading = false
......@@ -227,7 +207,7 @@
}
this.page_count = res.data.pageCount;
}
},(err)=>{
}, (err) => {
this.showLoading = false
uni.hideLoading();
uni.showToast({
......@@ -242,18 +222,21 @@
</script>
<style lang="scss" scoped>
@import url("@/asset/css/flex.css");
.hotelScroll{
height: 1px;
flex: 1;
border-radius: 18rpx 18rpx 0 0;
overflow: hidden;
background: #fff;
padding-top: 34rpx;
}
/deep/.hotelScrollBox .u-dropdown-item scroll-view{
@import url("@/asset/css/flex.css");
.hotelScroll {
height: 1px;
flex: 1;
border-radius: 18rpx 18rpx 0 0;
overflow: hidden;
background: #fff;
padding-top: 34rpx;
}
/deep/.hotelScrollBox .u-dropdown-item scroll-view {
height: 100vh !important;
}
/deep/.u-flex {
justify-content: center;
}
......@@ -299,7 +282,7 @@
margin-top: -6px;
}
.hotel-list .search-box .date text{
.hotel-list .search-box .date text {
color: #757776;
margin-right: 7rpx;
font-size: 22rpx;
......@@ -320,7 +303,8 @@
padding-left: 33rpx;
padding-right: 15rpx;
}
.hotel-rateTetx{
.hotel-rateTetx {
width: 50%;
margin-bottom: 16rpx;
}
......@@ -394,14 +378,15 @@
margin-top: 20rpx;
}
}
.hotel-listHeader{
.hotel-listHeader {
background: url('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/hotelBj.png') no-repeat;
background-size: 100% auto;
}
.ComprehensiveSortings{
}
.ComprehensiveSortings view{
.ComprehensiveSortings {}
.ComprehensiveSortings view {
background: #E9E4E0;
white-space: nowrap;
border-radius: 6rpx;
......@@ -412,27 +397,33 @@
padding: 8rpx 13rpx;
border: 1rpx solid #E9E4E0;
}
.ComprehensiveSortings view.active{
.ComprehensiveSortings view.active {
color: #B99846;
border: 1rpx solid #B99846;
}
/deep/.search-box .u-input{
/deep/.search-box .u-input {
font-size: 24rpx;
}
/deep/.hotel-listHeader .u-dropdown__menu{
/deep/.hotel-listHeader .u-dropdown__menu {
justify-content: space-between;
}
/deep/.hotel-listHeader .u-dropdown__menu__item {
flex: inherit !important;
}
/deep/.hotel-listHeader .u-flex{
/deep/.hotel-listHeader .u-flex {
justify-content: flex-start;
}
/deep/.u-dropdown__menu__item:first-child{
/deep/.u-dropdown__menu__item:first-child {
padding-left: 40rpx;
}
/deep/.u-dropdown__menu__item:last-child{
/deep/.u-dropdown__menu__item:last-child {
padding-right: 40rpx;
}
</style>
</style>
\ No newline at end of file
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