Commit 472b93d5 authored by zhengke's avatar zhengke

修改

parents 57d3b819 94829e92
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
<view class="hotel-start"> <view class="hotel-start">
<!-- TODO:判定是否为星级酒店,如果是显示星级,不是,显示另外一种方式 --> <!-- TODO:判定是否为星级酒店,如果是显示星级,不是,显示另外一种方式 -->
<view class="rate" v-if="item.Star>=1&&item.Star<=5"> <view class="rate" v-if="item.Star>=1&&item.Star<=5">
<u-rate active-color="#FEB969" inactive-color="#FFF" :current="item.Star" active-icon="star" inactive-icon="star" disabled></u-rate> <u-rate active-color="#FEB969" inactive-color="#FFF" is-fill="true" :current="item.Star" active-icon="star"
<text style="margin-left: 20rpx;vertical-align: top;">{{item.Star}}</text> inactive-icon="star" disabled :count="5"></u-rate>
<text style="margin-left: 20rpx;vertical-align: top;">{{item.StarName}}</text>
</view> </view>
<view class="other-rate" v-if="item.Star==9"> <view class="other-rate" v-if="item.Star==9">
<text>温泉酒店</text> <text>温泉酒店</text>
...@@ -23,8 +24,8 @@ ...@@ -23,8 +24,8 @@
</view> </view>
<view class="localtion">{{item.Address}}</view> <view class="localtion">{{item.Address}}</view>
<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" <u-tag v-for="(subItem,subIndex) in item.TagList" :key="subIndex" style="margin-right:10rpx;" :text="subItem"
size="mini"></u-tag> bg-color="#FFF" border-color="#DFBE6E" color="#DFBE6E" size="mini"></u-tag>
</view> </view>
<view class="price"> <view class="price">
<text></text> <text></text>
...@@ -43,13 +44,13 @@ ...@@ -43,13 +44,13 @@
type: Array, type: Array,
default: null default: null
}, },
dayObj:{ dayObj: {
type: Object, type: Object,
default: null default: null
}, },
searchObj:{ searchObj: {
type:Object, type: Object,
default:null default: null
} }
}, },
data() { data() {
...@@ -60,11 +61,17 @@ ...@@ -60,11 +61,17 @@
created() { created() {
console.log(this.HotelList, 'hotel'); console.log(this.HotelList, 'hotel');
}, },
methods:{ methods: {
goHotelDetail(id){ getStar(num) {
if (num) {
return num.toFixed(1);
}
return 0.0;
},
goHotelDetail(id) {
let myDayObj = JSON.stringify(this.dayObj); let myDayObj = JSON.stringify(this.dayObj);
uni.navigateTo({ 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)
}); });
} }
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<view class="days">{{day}}</view> <view class="days">{{day}}</view>
<view style="width: 1px; flex: 1;"> <view style="width: 1px; flex: 1;">
<u-search placeholder="关键字/位置/品牌/酒店名" v-model="searchObj.Name" input-align="left" :value="searchObj.Name" <u-search placeholder="关键字/位置/品牌/酒店名" v-model="searchObj.Name" input-align="left" :value="searchObj.Name"
text-color="#111" bg-color="rgba(0,0,0,0)" @change="getList(1)" :show-action="false"></u-search> text-color="#111" bg-color="rgba(0,0,0,0)" @change="research()" :show-action="false"></u-search>
</view> </view>
</view> </view>
<view> <view>
...@@ -55,9 +55,9 @@ ...@@ -55,9 +55,9 @@
</view> </view>
<scroll-view :scroll-y="true" @scrolltolower="lower" :enable-back-to-top="true" :enable-flex="true" :scroll-top="scrollTop" <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;"> @scroll="scroll" style="height: calc(100% - 224rpx); padding-bottom: 0px;">
<hotel-good :HotelList="HotelList" :dayObj="dayObj" :searchObj="searchObj"></hotel-good> <hotel-good :HotelList="HotelList" :dayObj="dayObj" :searchObj="searchObj"></hotel-good>
<u-loadmore v-if="showLoading" :status="status" :load-text="loadText" :font-size="24" :margin-top="20" <u-loadmore v-if="showLoading" :status="status" :load-text="loadText" :font-size="24" :margin-top="20"
:margin-bottom="20" bg-color="#F5F5F5" color="#111" /> :margin-bottom="20" bg-color="#F5F5F5" color="#111" />
</scroll-view> </scroll-view>
</view> </view>
</template> </template>
...@@ -162,8 +162,8 @@ ...@@ -162,8 +162,8 @@
}, },
showLoading: false, showLoading: false,
status: "loadmore", status: "loadmore",
page_count:0, page_count: 0,
dayObj:{} dayObj: {}
} }
}, },
components: { components: {
...@@ -208,6 +208,11 @@ ...@@ -208,6 +208,11 @@
this.scrollTop = 0; this.scrollTop = 0;
}); });
}, },
research()
{
this.searchObj.pageIndex=1;
this.getList(1);
},
lower(e) { lower(e) {
// TODO: 滚动到了底部,实现翻页加载 // TODO: 滚动到了底部,实现翻页加载
if (this.searchObj.pageIndex < this.page_count) { if (this.searchObj.pageIndex < this.page_count) {
...@@ -224,17 +229,16 @@ ...@@ -224,17 +229,16 @@
} else { } else {
obj.IsCheck = 0; obj.IsCheck = 0;
} }
this.getList(1); this.research()
}, },
chosenDateResult(obj) { chosenDateResult(obj) {
console.log(obj,'obj');
this.searchObj.QStartDate = obj.start; this.searchObj.QStartDate = obj.start;
this.searchObj.QEndDate = obj.end; this.searchObj.QEndDate = obj.end;
this.startDay = obj.startDay; this.startDay = obj.startDay;
this.endDay = obj.endDay; this.endDay = obj.endDay;
this.day = obj.day; this.day = obj.day;
this.dayObj = obj; this.dayObj = obj;
this.getList(1); this.research()
this.showTimePopup = false this.showTimePopup = false
}, },
chosenDate() { chosenDate() {
...@@ -266,7 +270,7 @@ ...@@ -266,7 +270,7 @@
this.closeDropdown(); this.closeDropdown();
this.searchObj.StartPrice = 0; this.searchObj.StartPrice = 0;
this.searchObj.EndPrice = 1000; this.searchObj.EndPrice = 1000;
this.getList(1); this.research()
}, },
surePrice() { surePrice() {
let result = "" let result = ""
...@@ -284,7 +288,7 @@ ...@@ -284,7 +288,7 @@
this.optionsTitle[2] = result this.optionsTitle[2] = result
this.$forceUpdate() this.$forceUpdate()
this.closeDropdown(); this.closeDropdown();
this.getList(1); this.research()
}, },
rangechange4(e) { rangechange4(e) {
this.searchObj.StartPrice = e.minValue; this.searchObj.StartPrice = e.minValue;
...@@ -326,7 +330,7 @@ ...@@ -326,7 +330,7 @@
} }
}) })
this.optionsTitle[0] = temp.label this.optionsTitle[0] = temp.label
this.getList(1); this.research()
}, },
change2(index) { change2(index) {
if (index != -1) { if (index != -1) {
...@@ -380,7 +384,6 @@ ...@@ -380,7 +384,6 @@
this.searchObj.QStars = this.tempRateAndPrice.rate.toString(); this.searchObj.QStars = this.tempRateAndPrice.rate.toString();
if(type==1){ if(type==1){
this.HotelList=[]; this.HotelList=[];
} }
this.request2({ this.request2({
url: '/api/Hotel/AppGetHotelPage', url: '/api/Hotel/AppGetHotelPage',
......
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