Commit ff3907d8 authored by 罗超's avatar 罗超

1

parent 06d9c78f
<template> <template>
<view class="package-good"> <view class="package-good">
<view class="rm-left"> <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> </image>
</view> </view>
<view class="rm-right"> <view class="rm-right">
<view class="package-name">海鲜团队用餐</view> <view class="package-name">{{data.MealName}}</view>
<view class="f11"> <view class="f11">
<text class="king" style="margin-right: 14rpx;">6人起订</text> <text class="king" style="margin-right: 14rpx;" v-if="data.MinBuyNum>0">{{data.MinBuyNum}}人起订</text>
<text>仅周五、周六可用,节假日可用</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> </view>
<viwe class="give f11"> <viwe class="give f11">
提前1天预约 <text v-if="data.MakeDay===0">可预约当天</text>
<text v-if="data.MakeDay>0">提前{{data.MakeDay}}天预约</text>
</viwe> </viwe>
<view class="price" style="margin-top:30rpx;"> <view class="price" style="margin-top:30rpx;">
<text class="f11" style="margin-right: 10rpx;"></text> <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> </view>
<view class="rm-opera"> <view class="rm-opera">
...@@ -23,12 +29,26 @@ ...@@ -23,12 +29,26 @@
<view class="buy-content"></view> <view class="buy-content"></view>
<view class="buy-tips">在线订</view> <view class="buy-tips">在线订</view>
</view> </view>
<!-- <view class="buy disabled">
<view class="buy-content"></view>
<view class="buy-tips">已售罄</view>
</view> -->
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
props:{
data:{
type:Object,
dafault:{}
}
},
mounted() {
console.log(this.data)
},
methods: { methods: {
previewOrder(){ previewOrder(){
uni.navigateTo({ uni.navigateTo({
......
<template> <template>
<view class="restaurant-list-item"> <view class="restaurant-list-item" @click="confirm">
<view class="img-box"> <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>
<view class="restaurant-info"> <view class="restaurant-info">
<view class="restaurant-name">北京街头卤煮火烧</view> <view class="restaurant-name">{{data.Name}}</view>
<view class="restaurant-start"> <view class="restaurant-start">
<view class="other-rate"> <view class="other-rate">
<text>老北京·地道</text> <text>{{data.Feature}}</text>
<span class="line"></span> <span class="line"></span>
</view> </view>
</view> </view>
<view class="localtion">环境内外装修以竹制品体现,夫妻肺片麻辣鲜香,口干嫩滑色泽红亮</view> <view class="localtion">{{data.Address}}</view>
<view> <view style="display: flex;flex-wrap: wrap;">
<u-tag text="川菜 " bg-color="#FFF" border-color="#DFBE6E" color="#DFBE6E" size="mini" style="margin-right: 20rpx;"></u-tag> <view v-for="(item,index) in data.FoodTag" :key="index">
<u-tag text="沟口" bg-color="#FFF" border-color="#DFBE6E" color="#DFBE6E" size="mini"></u-tag> <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>
<view class="price"> <view class="price">
<text></text> <text></text>
<text class="money">200</text> <text class="money">{{data.B2BPrice}}</text>
<text>/起</text> <text>/起</text>
</view> </view>
</view> </view>
...@@ -31,13 +36,25 @@ ...@@ -31,13 +36,25 @@
restaurantType:{ restaurantType:{
type:Number, type:Number,
default:0 default:0
},
data:{
type:Object,
default:{}
} }
}, },
created() {
console.log(this.data)
},
data() { data() {
return { return {
// key: value // key: value
} }
}, },
methods:{
confirm(){
this.$emit("confirm")
}
}
} }
</script> </script>
...@@ -58,6 +75,7 @@ ...@@ -58,6 +75,7 @@
} }
.restaurant-list-item .img-box image{ .restaurant-list-item .img-box image{
width: 100%; width: 100%;
height: 100%;
} }
.restaurant-list-item .restaurant-info{ .restaurant-list-item .restaurant-info{
width: 1px; width: 1px;
......
...@@ -61,12 +61,12 @@ ...@@ -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':''}"> ]" :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 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 == start[0] && index == start[1]">开始日期</view>
<view class="select-style" v-if="line == end[0] && index == end[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 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">{{ priceStauts[line][index] }}</view>
<view v-if="priceStauts[line][index] <0">无房</view> <view v-if="priceStauts[line][index] <0">无房</view>
</view> </view> -->
</view> </view>
</view> </view>
</view> </view>
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
<view class="submit"> <view class="submit">
<button class="sub-btn" :disabled="!isSub" @click="submit"> <button class="sub-btn" :disabled="!isSub" @click="submit">
<text v-if="isSub">确定</text> <text v-if="isSub">确定</text>
<text v-if="!isSub">请选择入住日期</text> <text v-if="!isSub">请选择结束日期</text>
</button> </button>
</view> </view>
</scroll-view> </scroll-view>
......
...@@ -14,26 +14,28 @@ ...@@ -14,26 +14,28 @@
<view @click="goback"> <view @click="goback">
<u-icon name="arrow-left" size="44"></u-icon> <u-icon name="arrow-left" size="44"></u-icon>
</view> </view>
<view style="flex: 1;margin-left: 30rpx; text-align: left;">老兵烧烤-九寨特色</view> <view style="flex: 1;margin-left: 30rpx; text-align: left;">{{details.Name}}</view>
</view> </view>
<view class="restaurant-content"> <view class="restaurant-content">
<view class="restaurant-base"> <view class="restaurant-base">
<view class="head"> <view class="head">
<view style="flex:1;"> <view style="flex:1;">
<view class="restaurant-name">老兵烧烤-九寨特色</view> <view class="restaurant-name">{{details.Name}}</view>
<view class="restaurant-tag"> <view class="restaurant-tag" style="display: flex;flex-wrap: wrap;">
<u-tag style="margin-right: 22rpx;" text="小吃" mode="plain" border-color="#DFBE6E" color="#DFBE6E" size="mini"/> <view v-for="(item,index) in details.FoodTag" :key="index">
<u-tag style="margin-right: 22rpx;" text="九寨特色" mode="plain" border-color="#DFBE6E" color="#DFBE6E" size="mini"/> <u-tag style="margin-right: 22rpx;" :text="item" mode="plain" border-color="#DFBE6E" color="#DFBE6E" size="mini" v-if="item"/>
<u-tag style="margin-right: 22rpx;" text="米饭不给钱" mode="plain" border-color="#DFBE6E" color="#DFBE6E" size="mini"/> </view>
<u-tag style="margin-right: 22rpx;" text="酒水免费" mode="plain" border-color="#DFBE6E" color="#DFBE6E" size="mini"/> <view v-for="(item,index) in details.GeographicTag" :key="index">
<u-tag style="margin-right: 22rpx;" :text="item" mode="plain" border-color="#DFBE6E" color="#DFBE6E" size="mini" v-if="item"/>
</view>
</view> </view>
</view> </view>
<!-- 关注 --> <!-- 关注 -->
<view class="op-box"> <view class="op-box">
<image v-if="!islike" <image v-if="details.FollowId===0"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1622453740000_840.png" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1622453740000_840.png"
@click="changeLike"></image> @click="changeLike"></image>
<image v-if="islike" <image v-if="details.FollowId>0"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1622453740000_764.png" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1622453740000_764.png"
@click="changeLike"></image> @click="changeLike"></image>
</view> </view>
...@@ -42,11 +44,11 @@ ...@@ -42,11 +44,11 @@
<view class="loc-left"> <view class="loc-left">
<view class="loc-name"> <view class="loc-name">
<u-icon name="clock" size="28" /> <u-icon name="clock" size="28" />
<text style="margin-left: 14rpx;">营业时间 11:30-12:30</text> <text style="margin-left: 14rpx;">营业时间 {{details.OpeningHours}}</text>
<u-tag style="margin-left: 22rpx;" text="营业中" bg-color="#DFBE6E" border-color="#DFBE6E" color="#ffffff"/> <u-tag style="margin-left: 22rpx;" text="营业中" bg-color="#DFBE6E" border-color="#DFBE6E" color="#ffffff" v-if="details.BusinessState===1"/>
</view> </view>
<view class="loc-remark"> <view class="loc-remark">
<view>无休息日,全年营业</view> <!-- <view>无休息日,全年营业</view> -->
</view> </view>
</view> </view>
</view> </view>
...@@ -54,15 +56,15 @@ ...@@ -54,15 +56,15 @@
<view class="loc-left"> <view class="loc-left">
<view class="loc-name"> <view class="loc-name">
<u-icon name="location" size="28" /> <u-icon name="location" size="28" />
<text style="margin-left: 14rpx;">沟口 | 九寨沟风景区沟口</text> <text style="margin-left: 14rpx;">{{details.Address}}</text>
</view> </view>
<view class="loc-remark"> <view class="loc-remark">
<view>距浦东国际机场14.5km,驾车约19min</view> <view>{{details.ParkInfo}}</view>
<view>距车站约1km,驾车约5min</view> <!-- <view>距车站约1km,驾车约5min</view> -->
</view> </view>
</view> </view>
<view class="loc-right"> <view class="loc-right">
<text style="margin-right: 20rpx;">地图详情</text> <text style="margin-right: 20rpx;" @click="goMap(details.Address,details.Lng,details.Lat)">地图详情</text>
<u-icon name="arrow" size="20" /> <u-icon name="arrow" size="20" />
</view> </view>
</view> </view>
...@@ -71,40 +73,30 @@ ...@@ -71,40 +73,30 @@
<view class="big-title" style="margin-top: 50rpx;"> <view class="big-title" style="margin-top: 50rpx;">
<text>推荐菜品</text> <text>推荐菜品</text>
</view> </view>
<view class="chooseDate" @click="chooseDate">
<text>选择日期</text>
<uni-calendar ref="calendar" :insert="true" :selected="calendar" @confirm="confirm"></uni-calendar>
</view>
<ul class="title-style-one hr"> <ul class="title-style-one hr">
<li> <li v-for="(item,index) in details.FoodRecommendList" :key="index">
<view class="item-title regular">鸡汤包饭</view> <view class="item-title regular">{{item.FoodName}}</view>
</li>
<li>
<view class="item-title regular">土豆片</view>
</li>
<li>
<view class="item-title regular">鸡脚</view>
</li>
<li>
<view class="item-title regular">鸡汤包饭</view>
</li>
<li>
<view class="item-title regular">土豆片</view>
</li>
<li>
<view class="item-title regular">鸡脚</view>
</li> </li>
</ul> </ul>
<view class="big-title"> <view class="big-title">
<text>优惠套餐</text> <text>优惠套餐</text>
</view> </view>
<view class="restaurant-room"> <view class="restaurant-room">
<view v-for="(item,index) in details.resultMealList" :key="index" class="room-list">
<view class="room-list"> <package-good :data="item"></package-good>
<package-good></package-good> <!-- <package-good-test></package-good-test> -->
<package-good-test></package-good-test>
</view> </view>
</view> </view>
</view> </view>
<view class="empty-block"></view> <!-- <view class="empty-block"></view> -->
<view class="detail-box"> <view class="detail-box">
<view class="flex"> <!-- <view class="flex">
<view class="big-title"> <view class="big-title">
<text>发现周边</text> <text>发现周边</text>
</view> </view>
...@@ -122,8 +114,8 @@ ...@@ -122,8 +114,8 @@
<near-good></near-good> <near-good></near-good>
<near-good></near-good> <near-good></near-good>
<near-good></near-good> <near-good></near-good>
</view> </view> -->
<view class="flex"> <!-- <view class="flex">
<view class="big-title"> <view class="big-title">
<text>精选推荐</text> <text>精选推荐</text>
</view> </view>
...@@ -134,13 +126,17 @@ ...@@ -134,13 +126,17 @@
<view> <view>
<recommed-restaurant></recommed-restaurant> <recommed-restaurant></recommed-restaurant>
<recommed-restaurant></recommed-restaurant> <recommed-restaurant></recommed-restaurant>
</view> -->
</view> </view>
<view class="">
</view> </view>
<!-- <u-popup v-model="showTimePopup" mode="bottom" border-radius="40" length="70%" :safe-area-inset-bottom="true" > -->
<!-- </u-popup> -->
</view> </view>
</scroll-view> </scroll-view>
<u-popup v-model="showTimePopup" mode="bottom" border-radius="20" length="85%" :safe-area-inset-bottom="true">
<canlendar @finish="chosenDateResult"></canlendar>
</u-popup>
</view> </view>
</template> </template>
...@@ -149,7 +145,7 @@ ...@@ -149,7 +145,7 @@
import packageGoodTest from './components/package-good2.vue'; import packageGoodTest from './components/package-good2.vue';
import nearGood from './components/near-good.vue'; import nearGood from './components/near-good.vue';
import recommedRestaurant from './components/recommed-restaurant.vue'; import recommedRestaurant from './components/recommed-restaurant.vue';
import canlendar from "./components/time/index.vue" import uniCanlendar from "./components/uni-calendar/uni-calendar.vue"
export default { export default {
data() { data() {
return { return {
...@@ -166,7 +162,8 @@ ...@@ -166,7 +162,8 @@
picUrl: "https://ak-d.tripcdn.com/images/200v0f0000007d6wgBCD6_R_1080_808_R5_D.jpg" picUrl: "https://ak-d.tripcdn.com/images/200v0f0000007d6wgBCD6_R_1080_808_R5_D.jpg"
} }
], ],
id: 0, ID: 0,
details:{},
typeList: [{ typeList: [{
Id: 0, Id: 0,
Name: '视频' Name: '视频'
...@@ -211,7 +208,11 @@ ...@@ -211,7 +208,11 @@
name: "优惠活动", name: "优惠活动",
id: 5 id: 5
} }
] ],
calendar: [{
date: "",
info: ''
}],
} }
}, },
components: { components: {
...@@ -219,7 +220,7 @@ ...@@ -219,7 +220,7 @@
packageGoodTest, packageGoodTest,
nearGood, nearGood,
recommedRestaurant, recommedRestaurant,
canlendar uniCanlendar
}, },
created() { created() {
let d1 = new Date(); let d1 = new Date();
...@@ -239,10 +240,25 @@ ...@@ -239,10 +240,25 @@
data: JSON.stringify(obj) data: JSON.stringify(obj)
}) })
this.searchObj.date = obj this.searchObj.date = obj
// let d = new Date();
let nextDate = new Date(d.getTime() + 24*60*60*1000);
let year=nextDate.getFullYear();
let month=nextDate.getMonth()+1
if(month<10){
month='0'+month
}
let day=nextDate.getDate()
if(day<10){
day='0'+day
}
let tomorrow = year+'-'+month+'-'+day
this.calendar[0].date=tomorrow
}, },
onLoad(options) { onLoad(options) {
// this.id=options.id if (options && options.id) {
// this.ProjectType=options.type this.ID = options.id
this.getDetail()
}
let that = this let that = this
uni.getSystemInfo({ uni.getSystemInfo({
success(res) { success(res) {
...@@ -256,13 +272,29 @@ ...@@ -256,13 +272,29 @@
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
}, },
methods: { methods: {
chooseDate(){
// this.showTimePopup=true
// this.$refs.calendar.open();
console.log(this.$refs,this)
},
confirm(e) {
this.Date = e.fulldate
this.calendar[0].date = e.fulldate
// this.getDetailByDate();
this.$forceUpdate()
},
// opencalendar(){
// this.$refs.calendar.open();
// },
goMap(name, lon, lat) { goMap(name, lon, lat) {
let newLon=parseFloat(lon)
let newLat=parseFloat(lat)
wx.openLocation({ wx.openLocation({
latitude:lat, latitude:newLat,
longitude:lon, longitude:newLon,
scale: 18, scale: 18,
name, name,
address:"武侯区科华中路 2 号", // address:"武侯区科华中路 2 号",
success:(res)=>{ success:(res)=>{
// console.log(res) // console.log(res)
}, },
...@@ -282,12 +314,13 @@ ...@@ -282,12 +314,13 @@
}) })
}, },
chosenDateResult(obj) { // chosenDateResult(obj) {
obj.startDay = this.formatMonthDay(obj.startDay)
obj.endDay = this.formatMonthDay(obj.endDay) // obj.startDay = this.formatMonthDay(obj.startDay)
this.searchObj.date = obj // obj.endDay = this.formatMonthDay(obj.endDay)
this.showTimePopup = false // this.searchObj.date = obj
}, // this.showTimePopup = false
// },
formatMonthDay(str) { formatMonthDay(str) {
let temp = str.split('-') let temp = str.split('-')
temp[0] = temp[0] > 9 ? temp[0] : "0" + temp[0] temp[0] = temp[0] > 9 ? temp[0] : "0" + temp[0]
...@@ -328,7 +361,19 @@ ...@@ -328,7 +361,19 @@
this.currentRoomType = i this.currentRoomType = i
}, },
changeLike() { changeLike() {
this.islike = !this.islike this.request2({
url: '/api/AppletDining/GetFollowDining',
data: {
ID: this.details.FollowId,
SourceId:this.details.ID
}
},
res => {
if (res.resultCode == 1) {
this.getDetail()
}
}
);
}, },
previewImage(i) { previewImage(i) {
// uni.previewImage({ // uni.previewImage({
...@@ -372,11 +417,41 @@ ...@@ -372,11 +417,41 @@
changeHandler(i) { changeHandler(i) {
this.active = i; this.active = i;
}, },
//获取详情
getDetail() {
this.request2({
url: '/api/AppletDining/GetDiningDetails',
data: {
ID: this.ID
}
},
res => {
if (res.resultCode == 1) {
res.data.FoodTag = res.data.FoodTag.split(',')
res.data.GeographicTag = res.data.GeographicTag.split(',')
this.details = res.data;
}
}
);
},
}, },
} }
</script> </script>
<style> <style scoped>
.chooseDate{
/* width: 150px; */
/* display: inline-block; */
height: 60rpx;
background-color: #ECF1F4;
border-radius: 20rpx;
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #111111;
line-height: 58rpx;
padding: 0 10rpx;
}
.restaurant-detail { .restaurant-detail {
height: 100vh; height: 100vh;
overflow: hidden; overflow: hidden;
......
...@@ -2,32 +2,30 @@ ...@@ -2,32 +2,30 @@
<view class="hotel-list"> <view class="hotel-list">
<view class="search-box"> <view class="search-box">
<view style="width: 1px; flex: 1;"> <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> text-color="#111" bg-color="rgba(0,0,0,0)" :show-action="false"></u-search>
</view> </view>
</view> </view>
<view> <view>
<u-dropdown ref="uDropdown" @open="open" @close="close" active-color="#000" inactive-color="#444"> <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>
<u-dropdown-item :title="optionsTitle[1]" @change="change2">
<view class="slot-content"> <u-dropdown-item v-model="msg.FoodTypeIds" :title="optionsTitle[1]" :options="classOptions">
<restaurant-type @sure-type="sureType" :current="currentTypeObj"></restaurant-type>
</view>
</u-dropdown-item> </u-dropdown-item>
<u-dropdown-item :title="optionsTitle[2]"> <u-dropdown-item :title="optionsTitle[2]">
<view class="slot-content" style="padding: 30rpx;background-color: #FFF;"> <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> <text style="font-size: 28rpx;color:#111;font-weight: 800;margin-right: 10rpx;">餐厅类型</text>
</view> </view>
<view class="hotel-rate-box"> <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 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;"> <view style="margin-top: 20rpx;">
<text style="font-size: 28rpx;color:#111;font-weight: 800;">价格</text> <text style="font-size: 28rpx;color:#111;font-weight: 800;">价格</text>
</view> </view>
<view class="hotel-rate-box"> <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>
<view style="box-shadow: 0px -10px 30px 0px rgba(36, 36, 36, 0.06);margin-top:40rpx;display: flex;"> <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;"> <view style="flex:1;margin-right: 30rpx;">
...@@ -39,18 +37,34 @@ ...@@ -39,18 +37,34 @@
</view> </view>
</view> </view>
</u-dropdown-item> </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> </u-dropdown>
</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% - 168rpx); padding-bottom: 0px;"> @scroll="scroll" style="height: calc(100% - 168rpx); padding-bottom: 0px;">
<restaurant-good></restaurant-good> <view v-for="(item,index) in restaurantList" :key="index">
<restaurant-good></restaurant-good> <restaurant-good :data="item" @confirm="confirm(item.ID)"></restaurant-good>
<restaurant-good></restaurant-good> </view>
<restaurant-good></restaurant-good>
<restaurant-good></restaurant-good> <u-loadmore
<u-loadmore v-if="showLoading" :status="status" :load-text="loadText" :font-size="24" :margin-top="20" :status="status"
:margin-bottom="20" bg-color="#F5F5F5" color="#111" /> :load-text="loadText"
:font-size="24"
:margin-top="20"
:margin-bottom="20"
bg-color="#FFF"
/>
</scroll-view> </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> </view>
</template> </template>
...@@ -61,9 +75,20 @@ ...@@ -61,9 +75,20 @@
export default { export default {
data() { data() {
return { return {
msg:{
pageIndex:1,
pageSize:10,
Name:"",
OrderBy:0,
FoodTypeIds:0,
DiningPriceType:-1,
},
page_count:1,
status: "loadmore",
restaurantList:[],//餐厅列表
searchObj:{ searchObj:{
searchKey:"", Name:"",
sort:1, OrderBy:0,
rtype:-1, rtype:-1,
rateAndPrice:{ rateAndPrice:{
types:[-1], types:[-1],
...@@ -77,52 +102,25 @@ ...@@ -77,52 +102,25 @@
}, },
optionsTitle: [ optionsTitle: [
"推荐排序", "推荐排序",
"菜系", "分类",
"筛选" "筛选",
"菜系"
], ],
rates: [ rates: [],//价格列表
{ options1: [
label:"不限",
value:-1
},
{
label:"50以下",
value:1
},
{
label:"50-100",
value:2
},
{
label:"100-150",
value:3
},
{ {
label:"150-200", label: '不限',
value:4 value: 0,
}, },
{ {
label:"200以上", label: '人均最高',
value:5
}
],
options1: [
{
label: '推荐排序',
value: 1, value: 1,
}, },
{ {
label: '好评优先', label: '人均最低',
value: 2, value: 2,
}, },
{
label: '低价优先',
value: 3,
},
{
label: '高价优先',
value: 4,
}
], ],
options2: [ options2: [
{ {
...@@ -150,6 +148,7 @@ ...@@ -150,6 +148,7 @@
value: 5, value: 5,
} }
], ],
classOptions:[],
btnStyle:{ btnStyle:{
borderRadius: '16rpx', borderRadius: '16rpx',
color: '#111', color: '#111',
...@@ -209,6 +208,9 @@ ...@@ -209,6 +208,9 @@
data: JSON.stringify(obj) data: JSON.stringify(obj)
}) })
this.searchObj.date=obj this.searchObj.date=obj
this.getFoodType();
this.getPriceEnum();
this.getFoodList();
}, },
methods: { methods: {
...@@ -222,15 +224,13 @@ ...@@ -222,15 +224,13 @@
}); });
}, },
lower(e) { lower(e) {
// TODO: 滚动到了底部,实现翻页加载 if (this.msg.pageIndex < this.page_count) {
// if (this.msg.pageIndex < this.page_count) { this.msg.pageIndex++;
// this.status = "loading"; this.status = "loading";
// this.msg.pageIndex++; this.getFoodList();
// this.init(); } else {
// } else { this.status = "nomore";
// this.isover = true; }
// this.status = "nomore";
// }
}, },
setRestaurantPrice(rateId){ setRestaurantPrice(rateId){
if(rateId==-1){ if(rateId==-1){
...@@ -246,6 +246,7 @@ ...@@ -246,6 +246,7 @@
this.tempRateAndPrice.rate.splice(temp,1) this.tempRateAndPrice.rate.splice(temp,1)
} }
} }
console.log(this.tempRateAndPrice.rate)
}, },
setRestaurant(typeId){ setRestaurant(typeId){
if(typeId==-1){ if(typeId==-1){
...@@ -340,34 +341,111 @@ ...@@ -340,34 +341,111 @@
this.$refs.uDropdown.highlight(index); this.$refs.uDropdown.highlight(index);
}, },
change(index) { change(index) {
let temp = this.options1.find(x => { // let temp = this.options1.find(x => {
if (x.value == index) { // if (x.ID == index) {
return x // return x
} else { // } else {
return false // return false
} // }
}) // })
this.optionsTitle[0] = temp.label // console.log(index,temp)
// this.optionsTitle[0] = temp.Name
}, },
change2(index){ change2(index){
if(index!=-1){ // if(index!=-1){
let temp = this.options2.find(x => { // let temp = this.options2.find(x => {
if (x.value == index) { // if (x.value == index) {
return x // return x
} else { // } else {
return false // 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)
})
}
}
);
},
// 获取餐食价格枚举
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(',')
}) })
this.optionsTitle[1] = temp.label if(this.msg.pageIndex==1){
}else{ this.restaurantList=res.data.pageData;
this.optionsTitle[1] = "附近" }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> </script>
<style> <style scoped>
/deep/.u-flex{
justify-content: center;
}
.hotel-list { .hotel-list {
height: 100vh; height: 100vh;
...@@ -405,7 +483,7 @@ ...@@ -405,7 +483,7 @@
flex-wrap: wrap; flex-wrap: wrap;
} }
.hotel-rate{ .hotel-rate{
width: 159rpx; width: 215rpx;
height: 60rpx; height: 60rpx;
background: #ECF1F4; background: #ECF1F4;
border-radius: 10rpx; border-radius: 10rpx;
......
...@@ -803,7 +803,7 @@ ...@@ -803,7 +803,7 @@
.tag-img { .tag-img {
width: 105rpx; width: 105rpx;
height: 32rpx; height: 32rpx;
background-color: #FFFFFF; // background-color: #FFFFFF;
border-radius: 4rpx; border-radius: 4rpx;
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<view class="search-box"> <view class="search-box">
<view style="width: 1px; flex: 1;"> <view style="width: 1px; flex: 1;">
<u-search placeholder="目的地/景点/主题" v-model="msg.Name" input-align="left" :value="searchObj.searchKey" <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> </view>
<view> <view>
...@@ -97,10 +97,6 @@ ...@@ -97,10 +97,6 @@
</template> </template>
<script> <script>
// import rangeSlider from "./components/range-slider.vue"
// import canlendar from "./components/time/index.vue"
// import Cascade from "./components/cascade.vue"
export default { export default {
data() { data() {
...@@ -120,7 +116,6 @@ ...@@ -120,7 +116,6 @@
page_count:1, page_count:1,
loading: false, loading: false,
status: "loadmore", status: "loadmore",
// count:0,
loadText: { loadText: {
loadmore: "轻轻上拉,加载更多", loadmore: "轻轻上拉,加载更多",
loading: "努力加载中", loading: "努力加载中",
...@@ -156,11 +151,6 @@ ...@@ -156,11 +151,6 @@
} }
} }
}, },
components: {
// rangeSlider,
// canlendar,
// Cascade
},
created() { created() {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: "门票", title: "门票",
...@@ -169,9 +159,9 @@ ...@@ -169,9 +159,9 @@
this.getList();// 获取景点门票类型 this.getList();// 获取景点门票类型
}, },
methods: { methods: {
openBuyNotice(){ searchList(){
console.log(1,this.$refs.popup) this.msg.pageIndex=1
this.$refs.popup.open() this.getList()
}, },
lower(e) { lower(e) {
if (this.msg.pageIndex < this.page_count) { if (this.msg.pageIndex < this.page_count) {
...@@ -192,9 +182,6 @@ ...@@ -192,9 +182,6 @@
this.showTimePopup=false this.showTimePopup=false
}, },
chosenDate(){ chosenDate(){
// uni.navigateTo({
// url:"/pages/hotel/components/time/index"
// })
this.showTimePopup=true this.showTimePopup=true
}, },
//筛选重置 //筛选重置
...@@ -235,7 +222,7 @@ ...@@ -235,7 +222,7 @@
}, },
res => { res => {
if(res.resultCode===1){ if(res.resultCode===1){
this.typeList=res.data // this.typeList=res.data
this.classOptions=[{ this.classOptions=[{
label: "不限", label: "不限",
value: 0, value: 0,
...@@ -259,6 +246,7 @@ ...@@ -259,6 +246,7 @@
data: this.msg data: this.msg
}, },
res => { res => {
if(res.resultCode===1){
this.page_count = res.data.pageCount; this.page_count = res.data.pageCount;
res.data.pageData.forEach(item=>{ res.data.pageData.forEach(item=>{
item.ScenicSpotTag=item.ScenicSpotTag.split(',') item.ScenicSpotTag=item.ScenicSpotTag.split(',')
...@@ -274,6 +262,8 @@ ...@@ -274,6 +262,8 @@
this.status = "nomore"; this.status = "nomore";
} }
} }
}
); );
}, },
changeScreen(field){ changeScreen(field){
...@@ -282,7 +272,6 @@ ...@@ -282,7 +272,6 @@
}else{ }else{
this.msg[field]=-1 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