Commit ff3907d8 authored by 罗超's avatar 罗超

1

parent 06d9c78f
<template>
<view class="package-good">
<view class="rm-left">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1622459632000_216.png" mode="aspectFill">
<image :src="data.MealPic" mode="aspectFit">
</image>
</view>
<view class="rm-right">
<view class="package-name">海鲜团队用餐</view>
<view class="package-name">{{data.MealName}}</view>
<view class="f11">
<text class="king" style="margin-right: 14rpx;">6人起订</text>
<text>仅周五、周六可用,节假日可用</text>
<text class="king" style="margin-right: 14rpx;" v-if="data.MinBuyNum>0">{{data.MinBuyNum}}人起订</text>
<text><text v-for="(item,index) in data.UsageTimeList" :key="index">
{{item.Name}} <text v-if="index!=data.UsageTimeList.length-1"></text>
</text>可用,</text>
<text v-if="data.IsHoliday===1">节假日可用</text>
</view>
<viwe class="give f11">
提前1天预约
<text v-if="data.MakeDay===0">可预约当天</text>
<text v-if="data.MakeDay>0">提前{{data.MakeDay}}天预约</text>
</viwe>
<view class="price" style="margin-top:30rpx;">
<text class="f11" style="margin-right: 10rpx;"></text>
<text>889</text>
<text v-if="data.LPriceB">{{data.LPriceB}}</text>
<text v-if="!data.LPriceB">暂无报价</text>
</view>
</view>
<view class="rm-opera">
......@@ -23,12 +29,26 @@
<view class="buy-content"></view>
<view class="buy-tips">在线订</view>
</view>
<!-- <view class="buy disabled">
<view class="buy-content"></view>
<view class="buy-tips">已售罄</view>
</view> -->
</view>
</view>
</template>
<script>
export default {
props:{
data:{
type:Object,
dafault:{}
}
},
mounted() {
console.log(this.data)
},
methods: {
previewOrder(){
uni.navigateTo({
......
<template>
<view class="restaurant-list-item">
<view class="restaurant-list-item" @click="confirm">
<view class="img-box">
<image src="https://dimg04.c-ctrip.com/images/03551120008nt5eb8BB53_C_500_500_Q80.jpg" mode="aspectFill"></image>
<image :src="data.CoverImg" mode="aspectFill"></image>
</view>
<view class="restaurant-info">
<view class="restaurant-name">北京街头卤煮火烧</view>
<view class="restaurant-name">{{data.Name}}</view>
<view class="restaurant-start">
<view class="other-rate">
<text>老北京·地道</text>
<text>{{data.Feature}}</text>
<span class="line"></span>
</view>
</view>
<view class="localtion">环境内外装修以竹制品体现,夫妻肺片麻辣鲜香,口干嫩滑色泽红亮</view>
<view>
<u-tag text="川菜 " bg-color="#FFF" border-color="#DFBE6E" color="#DFBE6E" size="mini" style="margin-right: 20rpx;"></u-tag>
<u-tag text="沟口" bg-color="#FFF" border-color="#DFBE6E" color="#DFBE6E" size="mini"></u-tag>
<view class="localtion">{{data.Address}}</view>
<view style="display: flex;flex-wrap: wrap;">
<view v-for="(item,index) in data.FoodTag" :key="index">
<u-tag :text="item" bg-color="#FFF" border-color="#DFBE6E" color="#DFBE6E" size="mini" style="margin-right: 20rpx;" v-if="item"></u-tag>
</view>
<view v-for="(item,index) in data.GeographicTag" :key="index">
<u-tag :text="item" bg-color="#FFF" border-color="#DFBE6E" color="#DFBE6E" size="mini" style="margin-right: 20rpx;" v-if="item"></u-tag>
</view>
</view>
<view class="price">
<text></text>
<text class="money">200</text>
<text class="money">{{data.B2BPrice}}</text>
<text>/起</text>
</view>
</view>
......@@ -31,13 +36,25 @@
restaurantType:{
type:Number,
default:0
},
data:{
type:Object,
default:{}
}
},
created() {
console.log(this.data)
},
data() {
return {
// key: value
}
},
methods:{
confirm(){
this.$emit("confirm")
}
}
}
</script>
......@@ -58,6 +75,7 @@
}
.restaurant-list-item .img-box image{
width: 100%;
height: 100%;
}
.restaurant-list-item .restaurant-info{
width: 1px;
......
......@@ -61,12 +61,12 @@
]" :style="{ width: (dayWidth - 10) / 7 + 'px',borderRadius:line == end[0] && index == end[1]?'0px 6px 6px 0px':'',backgroundColor:line == end[0] && index == end[1]?'#111':'',color:line == end[0] && index == end[1]?'#FFFFFF':''}">
<view style="padding-top:2px;padding-bottom:2px;">{{ item }}</view>
<view class="select-style" v-if="line == start[0] && index == start[1]">入住</view>
<view class="select-style" v-if="line == end[0] && index == end[1]">离店</view>
<view style="font-size:12px;padding-bottom: 3px;" v-if="priceStauts.length > 0">
<view class="select-style" v-if="line == start[0] && index == start[1]">开始日期</view>
<view class="select-style" v-if="line == end[0] && index == end[1]">结束日期</view>
<!-- <view style="font-size:12px;padding-bottom: 3px;" v-if="priceStauts.length > 0">
<view v-if="priceStauts[line][index]>0">{{ priceStauts[line][index] }}</view>
<view v-if="priceStauts[line][index] <0">无房</view>
</view>
</view> -->
</view>
</view>
</view>
......@@ -74,7 +74,7 @@
<view class="submit">
<button class="sub-btn" :disabled="!isSub" @click="submit">
<text v-if="isSub">确定</text>
<text v-if="!isSub">请选择入住日期</text>
<text v-if="!isSub">请选择结束日期</text>
</button>
</view>
</scroll-view>
......
This diff is collapsed.
......@@ -2,32 +2,30 @@
<view class="hotel-list">
<view class="search-box">
<view style="width: 1px; flex: 1;">
<u-search placeholder="美食名称" v-model="searchObj.searchKey" input-align="left" :value="searchObj.searchKey"
<u-search placeholder="美食名称" v-model="msg.Name" input-align="left"
text-color="#111" bg-color="rgba(0,0,0,0)" :show-action="false"></u-search>
</view>
</view>
<view>
<u-dropdown ref="uDropdown" @open="open" @close="close" active-color="#000" inactive-color="#444">
<u-dropdown-item v-model="searchObj.sort" :title="optionsTitle[0]" :options="options1" @change="change">
<u-dropdown-item v-model="msg.OrderBy" :title="optionsTitle[0]" :options="options1" @change="change">
</u-dropdown-item>
<u-dropdown-item :title="optionsTitle[1]" @change="change2">
<view class="slot-content">
<restaurant-type @sure-type="sureType" :current="currentTypeObj"></restaurant-type>
</view>
<u-dropdown-item v-model="msg.FoodTypeIds" :title="optionsTitle[1]" :options="classOptions">
</u-dropdown-item>
<u-dropdown-item :title="optionsTitle[2]">
<view class="slot-content" style="padding: 30rpx;background-color: #FFF;">
<view>
<!-- <view>
<text style="font-size: 28rpx;color:#111;font-weight: 800;margin-right: 10rpx;">餐厅类型</text>
</view>
<view class="hotel-rate-box">
<view v-for="(x,i) in options2" :key="i" class="hotel-rate" :class="{'active':tempRateAndPrice.types.indexOf(x.value)!=-1}" @click="setRestaurant(x.value)">{{x.label}}</view>
</view>
</view> -->
<view style="margin-top: 20rpx;">
<text style="font-size: 28rpx;color:#111;font-weight: 800;">价格</text>
</view>
<view class="hotel-rate-box">
<view v-for="(x,i) in rates" class="hotel-rate" :class="{'active':tempRateAndPrice.rate.indexOf(x.value)!=-1}" @click="setRestaurantPrice(x.value)">{{x.label}}</view>
<view v-for="(x,i) in rates" class="hotel-rate" :class="{'active':tempRateAndPrice.rate.indexOf(x.ID)!=-1}" @click="setRestaurantPrice(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;">
......@@ -39,18 +37,34 @@
</view>
</view>
</u-dropdown-item>
<!-- <u-dropdown-item :title="optionsTitle[3]" @change="change2">
<view class="slot-content">
<restaurant-type @sure-type="sureType" :current="currentTypeObj"></restaurant-type>
</view>
</u-dropdown-item> -->
</u-dropdown>
</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% - 168rpx); padding-bottom: 0px;">
<restaurant-good></restaurant-good>
<restaurant-good></restaurant-good>
<restaurant-good></restaurant-good>
<restaurant-good></restaurant-good>
<restaurant-good></restaurant-good>
<u-loadmore v-if="showLoading" :status="status" :load-text="loadText" :font-size="24" :margin-top="20"
:margin-bottom="20" bg-color="#F5F5F5" color="#111" />
<view v-for="(item,index) in restaurantList" :key="index">
<restaurant-good :data="item" @confirm="confirm(item.ID)"></restaurant-good>
</view>
<u-loadmore
:status="status"
:load-text="loadText"
:font-size="24"
:margin-top="20"
:margin-bottom="20"
bg-color="#FFF"
/>
</scroll-view>
<!-- 加载中 -->
<view class="loading" v-if="loading">
<u-loading mode="flower" size="48"></u-loading>
<Text style="color: #fff; margin-top: 10rpx;">加载中...</Text>
</view>
</view>
</template>
......@@ -61,9 +75,20 @@
export default {
data() {
return {
msg:{
pageIndex:1,
pageSize:10,
Name:"",
OrderBy:0,
FoodTypeIds:0,
DiningPriceType:-1,
},
page_count:1,
status: "loadmore",
restaurantList:[],//餐厅列表
searchObj:{
searchKey:"",
sort:1,
Name:"",
OrderBy:0,
rtype:-1,
rateAndPrice:{
types:[-1],
......@@ -77,52 +102,25 @@
},
optionsTitle: [
"推荐排序",
"菜系",
"筛选"
"分类",
"筛选",
"菜系"
],
rates: [
{
label:"不限",
value:-1
},
{
label:"50以下",
value:1
},
{
label:"50-100",
value:2
},
{
label:"100-150",
value:3
},
rates: [],//价格列表
options1: [
{
label:"150-200",
value:4
label: '不限',
value: 0,
},
{
label:"200以上",
value:5
}
],
options1: [
{
label: '推荐排序',
label: '人均最高',
value: 1,
},
{
label: '好评优先',
label: '人均最低',
value: 2,
},
{
label: '低价优先',
value: 3,
},
{
label: '高价优先',
value: 4,
}
],
options2: [
{
......@@ -150,6 +148,7 @@
value: 5,
}
],
classOptions:[],
btnStyle:{
borderRadius: '16rpx',
color: '#111',
......@@ -209,6 +208,9 @@
data: JSON.stringify(obj)
})
this.searchObj.date=obj
this.getFoodType();
this.getPriceEnum();
this.getFoodList();
},
methods: {
......@@ -222,15 +224,13 @@
});
},
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";
// }
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.status = "loading";
this.getFoodList();
} else {
this.status = "nomore";
}
},
setRestaurantPrice(rateId){
if(rateId==-1){
......@@ -246,6 +246,7 @@
this.tempRateAndPrice.rate.splice(temp,1)
}
}
console.log(this.tempRateAndPrice.rate)
},
setRestaurant(typeId){
if(typeId==-1){
......@@ -340,34 +341,111 @@
this.$refs.uDropdown.highlight(index);
},
change(index) {
let temp = this.options1.find(x => {
if (x.value == index) {
return x
} else {
return false
}
})
this.optionsTitle[0] = temp.label
// let temp = this.options1.find(x => {
// if (x.ID == index) {
// return x
// } else {
// return false
// }
// })
// console.log(index,temp)
// this.optionsTitle[0] = temp.Name
},
change2(index){
if(index!=-1){
let temp = this.options2.find(x => {
if (x.value == index) {
return x
} else {
return false
// if(index!=-1){
// let temp = this.options2.find(x => {
// if (x.value == index) {
// return x
// } else {
// return false
// }
// })
// this.optionsTitle[1] = temp.label
// }else{
// this.optionsTitle[1] = "附近"
// }
},
// 获取餐食类型
getFoodType(){
this.request2({
url: '/api/AppletDining/GetFoodType',
data: {
ClassType:0
}
},
res => {
if(res.resultCode===1){
this.typeList=res.data
this.classOptions=[{
label: "不限",
value: 0,
}]
res.data.map(i=>{
let obj={
label: i.Name,
value: i.ID,
}
this.classOptions.push(obj)
})
}
})
this.optionsTitle[1] = temp.label
}else{
this.optionsTitle[1] = "附近"
}
}
);
},
// 获取餐食价格枚举
getPriceEnum(){
this.request2({
url: '/api/AppletDining/GetDiningPriceType',
data: {}
},
res => {
if(res.resultCode===1){
this.rates=res.data
}
}
);
},
// 获取餐食列表
getFoodList(){
// this.msg.DiningPriceType=this.searchObj.rateAndPrice.join(",")
this.request2({
url: '/api/AppletDining/GetDiningPage',
data: this.msg
},
res => {
if(res.resultCode===1){
this.page_count = res.data.pageCount;
res.data.pageData.forEach(item=>{
item.FoodTag=item.FoodTag.split(',')
item.GeographicTag=item.GeographicTag.split(',')
})
if(this.msg.pageIndex==1){
this.restaurantList=res.data.pageData;
}else if(this.msg.pageIndex>1){
this.restaurantList=[...this.restaurantList,...res.data.pageData];
}
if (this.page_count == 1) {
this.status = "nomore";
}
}
}
);
},
confirm(id){
uni.navigateTo({
url:"/pages/restaurant/detail?id="+id
})
}
},
}
</script>
<style>
<style scoped>
/deep/.u-flex{
justify-content: center;
}
.hotel-list {
height: 100vh;
......@@ -405,7 +483,7 @@
flex-wrap: wrap;
}
.hotel-rate{
width: 159rpx;
width: 215rpx;
height: 60rpx;
background: #ECF1F4;
border-radius: 10rpx;
......
......@@ -803,7 +803,7 @@
.tag-img {
width: 105rpx;
height: 32rpx;
background-color: #FFFFFF;
// background-color: #FFFFFF;
border-radius: 4rpx;
}
......
......@@ -3,7 +3,7 @@
<view class="search-box">
<view style="width: 1px; flex: 1;">
<u-search placeholder="目的地/景点/主题" v-model="msg.Name" input-align="left" :value="searchObj.searchKey"
text-color="#111" bg-color="rgba(0,0,0,0)" :show-action="false"></u-search>
text-color="#111" bg-color="rgba(0,0,0,0)" :show-action="false" @search="searchList" @clear="searchList"></u-search>
</view>
</view>
<view>
......@@ -97,10 +97,6 @@
</template>
<script>
// import rangeSlider from "./components/range-slider.vue"
// import canlendar from "./components/time/index.vue"
// import Cascade from "./components/cascade.vue"
export default {
data() {
......@@ -120,7 +116,6 @@
page_count:1,
loading: false,
status: "loadmore",
// count:0,
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
......@@ -156,11 +151,6 @@
}
}
},
components: {
// rangeSlider,
// canlendar,
// Cascade
},
created() {
uni.setNavigationBarTitle({
title: "门票",
......@@ -169,9 +159,9 @@
this.getList();// 获取景点门票类型
},
methods: {
openBuyNotice(){
console.log(1,this.$refs.popup)
this.$refs.popup.open()
searchList(){
this.msg.pageIndex=1
this.getList()
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
......@@ -192,9 +182,6 @@
this.showTimePopup=false
},
chosenDate(){
// uni.navigateTo({
// url:"/pages/hotel/components/time/index"
// })
this.showTimePopup=true
},
//筛选重置
......@@ -235,7 +222,7 @@
},
res => {
if(res.resultCode===1){
this.typeList=res.data
// this.typeList=res.data
this.classOptions=[{
label: "不限",
value: 0,
......@@ -259,20 +246,23 @@
data: this.msg
},
res => {
this.page_count = res.data.pageCount;
res.data.pageData.forEach(item=>{
item.ScenicSpotTag=item.ScenicSpotTag.split(',')
item.GeographicTag=item.GeographicTag.split(',')
})
if(this.msg.pageIndex==1){
this.dataList=res.data.pageData;
}else if(this.msg.pageIndex>1){
this.dataList=[...this.dataList,...res.data.pageData];
if(res.resultCode===1){
this.page_count = res.data.pageCount;
res.data.pageData.forEach(item=>{
item.ScenicSpotTag=item.ScenicSpotTag.split(',')
item.GeographicTag=item.GeographicTag.split(',')
})
if(this.msg.pageIndex==1){
this.dataList=res.data.pageData;
}else if(this.msg.pageIndex>1){
this.dataList=[...this.dataList,...res.data.pageData];
}
if (this.page_count == 1) {
this.status = "nomore";
}
}
if (this.page_count == 1) {
this.status = "nomore";
}
}
);
},
......@@ -282,7 +272,6 @@
}else{
this.msg[field]=-1
}
console.log(this.msg)
}
},
}
......
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