Commit 72781568 authored by 罗超's avatar 罗超

1

parent 2e6d3ed1
<template>
<view class="buy-notice-restaurant">
<view class="meal-info">
<image :src="mealData.MealPic" mode="aspectFit" class="MealPic"></image>
<view class="right">
<view class="name">{{mealData.MealName}}</view>
<view class="sale">已售 {{mealData.SaleCount}}</view>
</view>
</view>
<view class="ticket-title">
套餐内容
<text class="ticket-title-bg"></text>
</view>
<view class="meal-con">
{{mealData.MealDesc}}
</view>
<view class="ticket-title">
购买须知
<text class="ticket-title-bg"></text>
</view>
<view class="buy-notice-con">
<rich-text :nodes="mealData.OtherTag"></rich-text>
</view>
<view class="btn-box">
<view class="price">
<text class="price-pre"></text>
{{mealData.LPriceB}}
</view>
<view class="btn" @click="subscribe">
立即预订
</view>
</view>
</view>
</template>
<script>
export default{
props:{
mealData:{
type:Object,
default:{}
}
},
data(){
return{
}
},
methods:{
subscribe(){
this.$emit("success")
}
}
}
</script>
<style lang="scss" scoped>
.buy-notice-restaurant{
height: 70vh;
padding: 45rpx 45rpx 120rpx 45rpx;
overflow-y: scroll;
overflow-x: hidden;
.meal-info{
display: flex;
padding-bottom: 50rpx;
border-bottom: 1rpx solid #E7E7E7;
.MealPic{
width: 129rpx;
height: 129rpx;
background-color: #DFBE6E;
border-radius: 20rpx;
}
.right{
flex-grow: 5;
margin-left: 35rpx;
.name{
font-size: 34rpx;
font-family: PingFang SC;
font-weight: bold;
color: #1B1D1E;
}
.sale{
width: 120rpx;
height: 40rpx;
background-color: #ECF1F4;
border-radius: 4rpx;
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 500;
color: #111111;
text-align: center;
line-height: 38rpx;
margin-top: 20rpx;
}
}
}
.ticket-title {
// width: 70rpx;
height: 50rpx;
font-size: 34rpx;
font-family: PingFang SC;
font-weight: bold;
color: #1F1F1F;
background-color: transparent;
// line-height: 44rpx;
position: relative;
margin: 40rpx 0;
.ticket-title-bg {
width: 70rpx;
height: 10rpx;
background-color: #DFBE6E;
border-radius: 4px;
position: absolute;
left: 0;
bottom: 6rpx;
z-index: 1;
opacity: 0.6;
}
}
.meal-con{
white-space: pre-wrap;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 500;
color: #111111;
}
.buy-notice-con{
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 800;
color: #111111;
}
.btn-box{
position: fixed;
right: 55rpx;
bottom:100rpx;
display: flex;
justify-content: flex-end;
align-items: center;
.price{
font-size: 40rpx;
font-family: PingFang SC;
font-weight: 500;
color: #D91818;
// line-height: 38rpx;
.price-pre{
font-size: 22rpx;
}
}
.btn{
width: 300rpx;
height: 80rpx;
background-color: #111111;
border-radius: 20rpx;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: bold;
color: #FFFFFF;
text-align: center;
line-height: 78rpx;
margin-left: 45rpx;
}
}
}
</style>
...@@ -9,57 +9,84 @@ ...@@ -9,57 +9,84 @@
<view class="f11"> <view class="f11">
<text class="king" style="margin-right: 14rpx;" v-if="data.MinBuyNum>0">{{data.MinBuyNum}}人起订</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"> <text>
{{item.Name}} <text v-if="index!=data.UsageTimeList.length-1"></text> <text v-for="(item,index) in data.UsageTimeList" :key="index" v-if="data.UsageTimeList[0].ID!==0">
</text>可用,</text> {{item.Name}}
<text v-if="index!=data.UsageTimeList.length-1"></text>
</text>
<text v-if="data.UsageTimeList[0].ID!==0">可用,</text>
<text v-if="data.UsageTimeList[0].ID===0">
使用时间不限
</text>
</text>
<text v-if="data.IsHoliday===1">节假日可用</text> <text v-if="data.IsHoliday===1">节假日可用</text>
</view> </view>
<viwe class="give f11"> <viwe class="give f11">
<text v-if="data.MakeDay===0">可预约当天</text> <text v-if="data.MakeDay===0">可预约当天</text>
<text v-if="data.MakeDay>0">提前{{data.MakeDay}}天预约</text> <text v-if="data.MakeDay>0">提前{{data.MakeDay}}天预约</text>
</viwe> </viwe>
<view class="price" style="margin-top:30rpx;"> <view class="buy-know" @click="seeBuyNotice">
购买须知
</view>
<view class="price" style="margin-top:10rpx;">
<text class="f11" style="margin-right: 10rpx;"></text> <text class="f11" style="margin-right: 10rpx;"></text>
<text v-if="data.LPriceB">{{data.LPriceB}}</text> <text v-if="data.LPriceB">{{data.LPriceB}}</text>
<text v-if="!data.LPriceB">暂无报价</text> <text v-if="!data.LPriceB">暂无报价</text>
</view> </view>
</view> </view>
<view class="rm-opera"> <view class="rm-opera">
<view class="buy" @click="previewOrder"> <view class="buy" @click="previewOrder" v-if="data.RemainingInventory>0">
<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 disabled" v-if="data.RemainingInventory===0">
<view class="buy-content"></view> <view class="buy-content"></view>
<view class="buy-tips">已售罄</view> <view class="buy-tips">已售罄</view>
</view> -->
</view> </view>
</view>
<u-popup v-model="showBuyNotice" mode="bottom" border-radius="40" :safe-area-inset-bottom="true">
<buyNotice :mealData="data" @success="buyNoticeSuccess"></buyNotice>
</u-popup>
</view> </view>
</template> </template>
<script> <script>
import buyNotice from "./buyNotice.vue"
export default { export default {
props:{ components: {
data:{ buyNotice
type:Object, },
dafault:{} props: {
data: {
type: Object,
dafault: {}
}
},
data() {
return {
showBuyNotice: false
} }
}, },
mounted() { mounted() {
console.log(this.data) console.log(this.data)
}, },
methods: { methods: {
previewOrder(){ previewOrder() {
uni.navigateTo({ this.$emit("success")
url:"/pages/restaurant/order"
})
}, },
buyNoticeSuccess(){
this.showBuyNotice = false
this.previewOrder()
},
seeBuyNotice() {
this.showBuyNotice = true
}
}, },
} }
</script> </script>
<style> <style scoped>
.package-good { .package-good {
margin-bottom: 30rpx; margin-bottom: 30rpx;
display: flex; display: flex;
...@@ -79,7 +106,8 @@ ...@@ -79,7 +106,8 @@
width: 1px; width: 1px;
flex: 1; flex: 1;
} }
.package-good .rm-opera{
.package-good .rm-opera {
margin-left: 10rpx; margin-left: 10rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -87,14 +115,16 @@ ...@@ -87,14 +115,16 @@
justify-items: center; justify-items: center;
align-items: center; align-items: center;
} }
.package-good .rm-opera .warm-count{
.package-good .rm-opera .warm-count {
text-align: center; text-align: center;
font-size: 18rpx; font-size: 18rpx;
font-weight: 500; font-weight: 500;
color: #111111; color: #111111;
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
.package-good .rm-opera .buy{
.package-good .rm-opera .buy {
width: 70rpx; width: 70rpx;
height: 81rpx; height: 81rpx;
background: #FFFFFF; background: #FFFFFF;
...@@ -103,26 +133,31 @@ ...@@ -103,26 +133,31 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.package-good .rm-opera .buy.disabled{
.package-good .rm-opera .buy.disabled {
background: #EBEBEB; background: #EBEBEB;
border: 2rpx solid #DCDCDC; border: 2rpx solid #DCDCDC;
} }
.package-good .rm-opera .buy.disabled .buy-tips{
.package-good .rm-opera .buy.disabled .buy-tips {
background: #A09E9E; background: #A09E9E;
color: #fff; color: #fff;
} }
.package-good .rm-opera .buy.disabled .buy-content{
.package-good .rm-opera .buy.disabled .buy-content {
color: #A09E9E; color: #A09E9E;
} }
.package-good .rm-opera .buy .buy-tips{
.package-good .rm-opera .buy .buy-tips {
height: 27rpx; height: 27rpx;
background: #000000; background: #000000;
text-align: center; text-align: center;
color:#DFBE6E; color: #DFBE6E;
font-size: 18rpx; font-size: 18rpx;
line-height: 27rpx; line-height: 27rpx;
} }
.package-good .rm-opera .buy .buy-content{
.package-good .rm-opera .buy .buy-content {
height: 1px; height: 1px;
flex: 1; flex: 1;
text-align: center; text-align: center;
...@@ -133,6 +168,7 @@ ...@@ -133,6 +168,7 @@
font-weight: 800; font-weight: 800;
color: #111111; color: #111111;
} }
.package-good .rm-right .package-name { .package-good .rm-right .package-name {
font-size: 30rpx; font-size: 30rpx;
font-weight: 800; font-weight: 800;
...@@ -147,14 +183,14 @@ ...@@ -147,14 +183,14 @@
background: #ECF1F4; background: #ECF1F4;
border-radius: 4rpx; border-radius: 4rpx;
padding: 10rpx; padding: 10rpx;
margin-top:15rpx; margin-top: 15rpx;
display: inline-block; display: inline-block;
} }
.package-good .rm-right .price{ .package-good .rm-right .price {
font-weight: 800; font-weight: 800;
font-size: 40rpx; font-size: 40rpx;
color:#111; color: #111;
} }
.package-good .rm-left { .package-good .rm-left {
...@@ -182,4 +218,12 @@ ...@@ -182,4 +218,12 @@
right: 0; right: 0;
bottom: 0; bottom: 0;
} }
.buy-know {
margin-top: 10rpx;
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 800;
color: #111111;
}
</style> </style>
...@@ -42,9 +42,6 @@ ...@@ -42,9 +42,6 @@
default:{} default:{}
} }
}, },
created() {
console.log(this.data)
},
data() { data() {
return { return {
// key: value // key: value
......
This diff is collapsed.
...@@ -3,15 +3,15 @@ ...@@ -3,15 +3,15 @@
<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" <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" clearabled @search="searchList" @clear="searchList"></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="msg.OrderBy" :title="optionsTitle[0]" :options="options1" @change="change"> <u-dropdown-item v-model="msg.OrderBy" :title="optionsTitle[0]" :options="options1" @change="getFoodList">
</u-dropdown-item> </u-dropdown-item>
<u-dropdown-item v-model="msg.FoodTypeIds" :title="optionsTitle[1]" :options="classOptions"> <u-dropdown-item v-model="msg.FoodTypeIds" :title="optionsTitle[1]" :options="classOptions" @change="getFoodList">
</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;">
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
<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.ID)!=-1}" @click="setRestaurantPrice(x.ID)">{{x.Name}}</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 v-for="(x,i) in rates" class="hotel-rate" :class="{'active':msg.DiningPriceType===x.ID}" @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;">
...@@ -81,7 +82,7 @@ ...@@ -81,7 +82,7 @@
Name:"", Name:"",
OrderBy:0, OrderBy:0,
FoodTypeIds:0, FoodTypeIds:0,
DiningPriceType:-1, DiningPriceType:0,
}, },
page_count:1, page_count:1,
status: "loadmore", status: "loadmore",
...@@ -187,9 +188,6 @@ ...@@ -187,9 +188,6 @@
restaurantType restaurantType
}, },
created() { created() {
// uni.navigateTo({
// url:"/pages/hotel/detail"
// })
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: "美食", title: "美食",
}); });
...@@ -213,7 +211,10 @@ ...@@ -213,7 +211,10 @@
this.getFoodList(); this.getFoodList();
}, },
methods: { methods: {
searchList(){
this.msg.pageIndex=1
this.getFoodList();
},
scroll: function(e) { scroll: function(e) {
this.old.scrollTop = e.detail.scrollTop; this.old.scrollTop = e.detail.scrollTop;
}, },
...@@ -233,89 +234,93 @@ ...@@ -233,89 +234,93 @@
} }
}, },
setRestaurantPrice(rateId){ setRestaurantPrice(rateId){
if(rateId==-1){ this.msg.DiningPriceType=rateId
this.tempRateAndPrice.rate=[-1] // if(rateId==-1){
}else{ // this.tempRateAndPrice.rate=[-1]
if(this.tempRateAndPrice.rate.indexOf(-1)!=-1){ // }else{
this.tempRateAndPrice.rate.splice(this.tempRateAndPrice.rate.indexOf(-1),1) // if(this.tempRateAndPrice.rate.indexOf(-1)!=-1){
} // this.tempRateAndPrice.rate.splice(this.tempRateAndPrice.rate.indexOf(-1),1)
let temp=this.tempRateAndPrice.rate.indexOf(rateId) // }
if(temp==-1){ // let temp=this.tempRateAndPrice.rate.indexOf(rateId)
this.tempRateAndPrice.rate.push(rateId) // if(temp==-1){
}else{ // this.tempRateAndPrice.rate.push(rateId)
this.tempRateAndPrice.rate.splice(temp,1) // }else{
} // this.tempRateAndPrice.rate.splice(temp,1)
} // }
console.log(this.tempRateAndPrice.rate) // }
},
setRestaurant(typeId){
if(typeId==-1){
this.tempRateAndPrice.types=[-1]
}else{
if(this.tempRateAndPrice.types.indexOf(-1)!=-1){
this.tempRateAndPrice.types.splice(this.tempRateAndPrice.types.indexOf(-1),1)
}
let temp=this.tempRateAndPrice.types.indexOf(typeId)
if(temp==-1){
this.tempRateAndPrice.types.push(typeId)
}else{
this.tempRateAndPrice.types.splice(temp,1)
}
}
}, },
// setRestaurant(typeId){
// if(typeId==-1){
// this.tempRateAndPrice.types=[-1]
// }else{
// if(this.tempRateAndPrice.types.indexOf(-1)!=-1){
// this.tempRateAndPrice.types.splice(this.tempRateAndPrice.types.indexOf(-1),1)
// }
// let temp=this.tempRateAndPrice.types.indexOf(typeId)
// if(temp==-1){
// this.tempRateAndPrice.types.push(typeId)
// }else{
// this.tempRateAndPrice.types.splice(temp,1)
// }
// }
// },
resetPrice(){ resetPrice(){
this.optionsTitle[2]="筛选" // this.optionsTitle[2]="筛选"
this.searchObj.rateAndPrice={ // this.searchObj.rateAndPrice={
types:[-1], // types:[-1],
priceText:"不限", // priceText:"不限",
rate:[-1] // rate:[-1]
} // }
this.msg.DiningPriceType=0
this.getFoodList();
this.closeDropdown(); this.closeDropdown();
}, },
surePrice(){ surePrice(){
let result="" // let result=""
if(this.tempRateAndPrice.types.length>0){ // if(this.tempRateAndPrice.types.length>0){
this.options2.forEach(x=>{ // this.options2.forEach(x=>{
if(this.tempRateAndPrice.types.indexOf(x.value)!=-1){ // if(this.tempRateAndPrice.types.indexOf(x.value)!=-1){
result+=x.label+"," // result+=x.label+","
} // }
}) // })
} // }
if(this.tempRateAndPrice.rate.length>0){ // if(this.tempRateAndPrice.rate.length>0){
this.rates.forEach(x=>{ // this.rates.forEach(x=>{
if(this.tempRateAndPrice.rate.indexOf(x.value)!=-1){ // if(this.tempRateAndPrice.rate.indexOf(x.value)!=-1){
result+=x.label+"," // result+=x.label+","
} // }
}) // })
} // }
result=result==""?"筛选":result // result=result==""?"筛选":result
console.log(result) // console.log(296,result)
this.optionsTitle[2]=result // this.optionsTitle[2]=result
this.$forceUpdate() // this.$forceUpdate()
this.searchObj.rateAndPrice=this.tempRateAndPrice // this.searchObj.rateAndPrice=this.tempRateAndPrice
this.closeDropdown(); // this.msg.DiningPriceType=this.tempRateAndPrice.rate.toString();
}, this.getFoodList();
sureType(item){
this.searchObj.rtype=item.Id
this.optionsTitle[1]=item.Id==-1?'菜系':item.Name
this.closeDropdown(); this.closeDropdown();
item.newTimespan=this.rand(1000,9999)
this.currentTypeObj=item
},
rangechange4(e){
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}之间`
}
}, },
// sureType(item){
// this.searchObj.rtype=item.Id
// this.optionsTitle[1]=item.Id==-1?'菜系':item.Name
// this.closeDropdown();
// item.newTimespan=this.rand(1000,9999)
// this.currentTypeObj=item
// },
// rangechange4(e){
// 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}之间`
// }
// },
closeDropdown() { closeDropdown() {
this.$refs.uDropdown.close(); this.$refs.uDropdown.close();
}, },
......
This diff is collapsed.
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
</view> </view>
<view> <view>
<view class="no-data" v-if="details.mealList.length==0"> <view class="no-data" v-if="details.mealList.length===0">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/CustomizedCar/no-data.png" mode="aspectFit" class="no-data-img"></image> <image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/CustomizedCar/no-data.png" mode="aspectFit" class="no-data-img"></image>
<view class="zhanwu"> <view class="zhanwu">
暂无数据 暂无数据
......
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