Commit 6c3b510f authored by zhengke's avatar zhengke

1

parents 70a06bdb 58824ac4
......@@ -34,7 +34,7 @@
:src="item.picUrl"
/>
<div class="good-info">
<div class="good-name" v-if="goodsInfo.showGoodsName">{{ item.name }}</div>
<div class="good-name" v-if="goodsInfo.showGoodsName">{{ item.name }} 1</div>
<view class="good-sub-name">{{item.subname}}</view>
<div class="good-price-info">
<span class="price" :style="{ color: mainColor }">{{ goodsInfo.showGoodsPrice ? getPrice(item.price) : '' }}
......
......@@ -309,6 +309,12 @@ export default {
that.minBlockLeft = minBlockLeft;
that.maxBlockLeft = maxBlockLeft;
},
_getMaxLength()
{
var that = this;
var MAX_LENGTH = that.width - that.blockSize;
return MAX_LENGTH;
},
/**
* 刷新整个视图
*/
......
......@@ -26,14 +26,14 @@
<view style="font-size: 24rpx;flex:1">¥0</view>
<view style="font-size: 24rpx;flex:1;color: #333;text-align: right;">¥1000以上</view>
</view>
<range-slider :width="690" :height="80" :step="10" :liveMode="true" background-color="#E2E2E2"
:block-size="40" active-color="#111111" min="0" max="1000" @rangechange="rangechange4"
:values="tempRateAndPrice.price"></range-slider>
<range-slider ref="rangeslider" :width="690" :height="80" :step="10" :liveMode="true" background-color="#E2E2E2"
:block-size="40" active-color="#111111" min="0" max="1000" @rangechange="rangechange4" :values="tempRateAndPrice.price"></range-slider>
<view style="margin: 20rpx 0 29rpx 0;">
<text style="font-size: 28rpx;color:#111;font-weight: 800;">星级</text>
</view>
<view class="hotel-rate-box">
<view v-for="(x,i) in rates" :key="i" class="hotel-rate" :class="{'active':tempRateAndPrice.rate.indexOf(x.Id)!=-1}" @click="setHotelRate(x.Id)">{{x.Name}}</view>
<view v-for="(x,i) in rates" :key="i" class="hotel-rate" :class="{'active':tempRateAndPrice.rate.indexOf(x.Id)!=-1}"
@click="setHotelRate(x.Id)">{{x.Name}}</view>
</view>
<view style="box-shadow: 0px -10px 30px 0px rgba(36, 36, 36, 0.06);margin-top:40rpx;display: flex;">
<view style="flex:1;margin-right: 30rpx;">
......@@ -45,7 +45,6 @@
</view>
</view>
</u-dropdown-item>
<!-- <u-dropdown-item v-model="value2" :title="optionsTitle[3]" :options="options2"></u-dropdown-item> -->
</u-dropdown>
</view>
<u-popup v-model="showTimePopup" mode="bottom" border-radius="20" length="95%" :safe-area-inset-bottom="true">
......@@ -70,30 +69,27 @@
export default {
data() {
return {
showTimePopup:false,
value1: 1,
value2: 2,
searchObj:{
pageIndex:1,
pageSize:15,
Name:'', //关键字
StartPrice:0,
EndPrice:1000,
QStartDate:'',
QEndDate:'',
OrderByType:'1', //排序类型
QStars:'', //星级
TagList:[] //查询标签
},
day:0,
startDay:'',
endDay:'',
HotelList:[], //酒店数据
tempRateAndPrice:{
price:{},
priceText:"不限",
rate:[]
showTimePopup: false,
searchObj: {
pageIndex: 1,
pageSize: 15,
Name: '', //关键字
StartPrice: 0,
EndPrice: 1000,
QStartDate: '',
QEndDate: '',
OrderByType: '1', //排序类型
QStars: '', //星级
TagList: [] //查询标签
},
day: 0,
startDay: '',
endDay: '',
HotelList: [], //酒店数据
tempRateAndPrice: {
price: {},
priceText: "不限",
rate: []
},
optionsTitle: [
"推荐排序",
......@@ -103,8 +99,7 @@
],
rates: [],
options1: [], //推荐排序数据
options2: [
{
options2: [{
label: '不限',
value: -1,
},
......@@ -141,20 +136,20 @@
value: 8,
},
],
btnStyle:{
btnStyle: {
borderRadius: '16rpx',
color: '#111',
fontSize: '30rpx',
width: '100%',
border:"1px solid #111",
background:"#FFF"
border: "1px solid #111",
background: "#FFF"
},
btnStyle2:{
btnStyle2: {
borderRadius: '16rpx',
color: '#fff',
fontSize: '30rpx',
width: '100%',
background:"#111"
background: "#111"
},
loadText: {
loadmore: "轻轻上拉,加载更多",
......@@ -165,7 +160,7 @@
old: {
scrollTop: 0,
},
showLoading:false,
showLoading: false,
status: "loadmore",
page_count:0,
dayObj:{}
......@@ -177,15 +172,12 @@
hotelGood
},
created() {
// uni.navigateTo({
// url:"/pages/hotel/detail"
// })
uni.setNavigationBarTitle({
title: "酒店",
});
let d1=new Date();
let d=new Date();
let d2=new Date(d.setDate(d.getDate()+1))
let d1 = new Date();
let d = new Date();
let d2 = new Date(d.setDate(d.getDate() + 1))
var obj = {
start: `${d1.getFullYear()}-${d1.getMonth()+1}-${d1.getDate()}`,
end: `${d2.getFullYear()}-${d2.getMonth()+1}-${d2.getDate()}`,
......@@ -197,7 +189,6 @@
key: 'Time',
data: JSON.stringify(obj)
})
// this.searchObj.date=obj
this.searchObj.QStartDate = obj.start;
this.searchObj.QEndDate = obj.end;
this.startDay = obj.startDay;
......@@ -226,84 +217,85 @@
this.status = "nomore";
}
},
chosenMorewhere(obj){
if(obj.IsCheck==0){
obj.IsCheck=1
}else{
obj.IsCheck=0;
chosenMorewhere(obj) {
if (obj.IsCheck == 0) {
obj.IsCheck = 1
} else {
obj.IsCheck = 0;
}
this.getList(1);
},
chosenDateResult(obj){
chosenDateResult(obj) {
this.searchObj.QStartDate = obj.start;
this.searchObj.QEndDate = obj.end;
this.startDay = obj.startDay;
this.endDay = obj.endDay;
this.day = obj.day;
this.getList(1);
this.showTimePopup=false
this.showTimePopup = false
},
chosenDate(){
// uni.navigateTo({
// url:"/pages/hotel/components/time/index"
// })
this.showTimePopup=true
chosenDate() {
this.showTimePopup = true
},
setHotelRate(rateId){
let temp=this.tempRateAndPrice.rate.indexOf(rateId)
if(temp==-1){
setHotelRate(rateId) {
let temp = this.tempRateAndPrice.rate.indexOf(rateId)
if (temp == -1) {
this.tempRateAndPrice.rate.push(rateId)
}else{
this.tempRateAndPrice.rate.splice(temp,1)
} else {
this.tempRateAndPrice.rate.splice(temp, 1)
}
},
resetPrice(){
this.optionsTitle[2]="价格/星级"
this.tempRateAndPrice={
price:{
minValue:0,
maxValue:1000
resetPrice() {
this.optionsTitle[2] = "价格/星级";
var obj = this.$refs.rangeslider;
obj.progressBarLeft = 0;
obj.progressBarWidth = obj._getMaxLength();
obj.minBlockLeft = 0;
obj.maxBlockLeft = obj._getMaxLength();
this.tempRateAndPrice = {
price: {
minValue: 0,
maxValue: 1000
},
priceText:"不限",
rate:[]
priceText: "不限",
rate: []
}
this.closeDropdown();
this.searchObj.StartPrice=0;
this.searchObj.EndPrice=1000;
this.searchObj.StartPrice = 0;
this.searchObj.EndPrice = 1000;
this.getList(1);
},
surePrice(){
let result=""
if(this.tempRateAndPrice.rate.length>0){
this.rates.forEach(x=>{
if(this.tempRateAndPrice.rate.indexOf(x.value)!=-1){
result+=x.label+","
surePrice() {
let result = ""
if (this.tempRateAndPrice.rate.length > 0) {
this.rates.forEach(x => {
if (this.tempRateAndPrice.rate.indexOf(x.value) != -1) {
result += x.label + ","
}
})
}
if(this.tempRateAndPrice.priceText!="不限"){
result+=this.tempRateAndPrice.priceText
if (this.tempRateAndPrice.priceText != "不限") {
result += this.tempRateAndPrice.priceText
}
result=result==""?"价格/星级":result
console.log(result)
this.optionsTitle[2]=result
result = result == "" ? "价格/星级" : result
this.optionsTitle[2] = result
this.$forceUpdate()
this.closeDropdown();
this.getList(1);
},
rangechange4(e){
rangechange4(e) {
this.searchObj.StartPrice = e.minValue;
this.searchObj.EndPrice = e.maxValue;
if(e.minValue==0){
if(e.maxValue==1000){
this.tempRateAndPrice.priceText="不限"
}else{
this.tempRateAndPrice.priceText=`¥${e.maxValue}以下`
if (e.minValue == 0) {
if (e.maxValue == 1000) {
this.tempRateAndPrice.priceText = "不限"
} else {
this.tempRateAndPrice.priceText = `¥${e.maxValue}以下`
}
}else if(e.maxValue==1000){
this.tempRateAndPrice.priceText=`¥${e.minValue}以上`
}else{
this.tempRateAndPrice.priceText=`¥${e.minValue} - ¥${e.maxValue}之间`
} else if (e.maxValue == 1000) {
this.tempRateAndPrice.priceText = `¥${e.minValue}以上`
} else {
this.tempRateAndPrice.priceText = `¥${e.minValue} - ¥${e.maxValue}之间`
}
},
closeDropdown() {
......@@ -313,8 +305,8 @@
// 展开某个下来菜单时,先关闭原来的其他菜单的高亮
// 同时内部会自动给当前展开项进行高亮
this.$refs.uDropdown.highlight();
if(index==2){
this.tempRateAndPrice=this.searchObj.rateAndPrice
if (index == 2) {
this.tempRateAndPrice = this.searchObj.rateAndPrice
}
},
close(index) {
......@@ -333,8 +325,8 @@
this.optionsTitle[0] = temp.label
this.getList(1);
},
change2(index){
if(index!=-1){
change2(index) {
if (index != -1) {
let temp = this.options2.find(x => {
if (x.value == index) {
return x
......@@ -343,12 +335,12 @@
}
})
this.optionsTitle[1] = temp.label
}else{
} else {
this.optionsTitle[1] = "附近"
}
},
//获取查询条件
getSearchCondition(){
getSearchCondition() {
this.request2({
url: '/api/Hotel/GetHotelQuery',
data: {}
......@@ -356,21 +348,21 @@
res => {
if (res.resultCode == 1) {
let tempObj = res.data;
this.options1=[];
this.rates=[];
if(tempObj&&tempObj.OrderByList.length>0){
tempObj.OrderByList.forEach(x=>{
this.options1 = [];
this.rates = [];
if (tempObj && tempObj.OrderByList.length > 0) {
tempObj.OrderByList.forEach(x => {
let obj = {
label:x.Name,
value:x.Id
label: x.Name,
value: x.Id
}
this.options1.push(obj);
})
}
if(tempObj&&tempObj.TagList){
if (tempObj && tempObj.TagList) {
this.searchObj.TagList = tempObj.TagList;
}
if(tempObj&&tempObj.StarList){
if (tempObj && tempObj.StarList) {
this.rates = tempObj.StarList;
}
}
......@@ -381,13 +373,14 @@
);
},
//获取列表数据
getList(type){
getList(type) {
this.searchObj.QStars = this.tempRateAndPrice.rate.toString();
this.dayObj.StartDate = this.searchObj.QStartDate;
this.dayObj.EndDate = this.searchObj.QEndDate;
this.dayObj.day = this.day;
if(type==1){
this.HotelList=[];
}
this.request2({
url: '/api/Hotel/AppGetHotelPage',
......@@ -408,7 +401,6 @@
<style>
.hotel-list {
height: 100vh;
}
.hotel-list .search-box {
......@@ -437,11 +429,13 @@
border-right: 1px solid #E2E2E2;
font-size: 24rpx;
}
.hotel-rate-box{
.hotel-rate-box {
display: flex;
align-items: center;
}
.hotel-rate{
.hotel-rate {
width: 160rpx;
height: 60rpx;
background: #ECF1F4;
......@@ -452,21 +446,25 @@
margin-right: 15rpx;
text-align: center;
}
.hotel-rate:last-child{
.hotel-rate:last-child {
margin-right: 0;
}
.hotel-rate.active{
.hotel-rate.active {
background: #111111;
color: #FFFFFF;
}
.hotel-list .morewhere{
padding:10rpx 30rpx;
.hotel-list .morewhere {
padding: 10rpx 30rpx;
display: flex;
align-items: center;
overflow-x: auto;
flex-wrap: nowrap;
}
.hotel-list .morewhere .item{
.hotel-list .morewhere .item {
padding: 0 20rpx;
height: 36rpx;
line-height: 36rpx;
......@@ -478,11 +476,13 @@
font-weight: 400;
flex-shrink: 0;
}
.hotel-list .morewhere .item.active{
.hotel-list .morewhere .item.active {
background: #111111;
color: #FFFFFF;
}
.hotel-list .morewhere .item:last-child{
.hotel-list .morewhere .item:last-child {
margin-right: 0;
}
</style>
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