Commit d120022a authored by youjie's avatar youjie

no message

parent cca2de35
This diff is collapsed.
This diff is collapsed.
<template>
<div class="SamplePriceList">
<div v-for="(x,i) in rooms">
<span>{{x.name}}</span>
<span>{{x.price}}</span>
</div>
</div>
</template>
<script>
export default {
props: {
price: {
type: Object,
default: {},
require: true
}
},
data() {
return {
rooms: []
};
},
watch: {
price: {
handler: function (val, oldVal) {
this.setCurrentHotel()
},
deep: true
},
},
created() {
},
mounted() {
this.setCurrentHotel()
},
methods: {
setCurrentHotel() {
let temp = this.price.PriceList?this.price.PriceList[0]:null
if(!temp) return
let roomTyps = ['BidroomPrice', 'SingleroomPrice', 'AddBedPrice', 'GuideRoomPrice']
let roomLangs = ['大床房', '自然单间', '三人间', '司机房']
roomTyps.forEach((x, i) => {
if (temp[x] > 0) {
this.rooms.push({
price:this.moneyFormat(temp[x]),
name:roomLangs[i]
})
}
})
}
}
};
</script>
<style scoped>
.SamplePriceList{
display: flex;
flex-direction: row;
justify-content: center;
}
.SamplePriceList>div{
display: flex;
flex-direction: column;
justify-content: center;
padding: 0 10px;
}
.SamplePriceList>div>span{
display: flex;
justify-content: center;
}
.SamplePriceList>div>span:first-child{
font-size: 12px;
color: gray;
margin-bottom: 5px;
}
</style>
\ No newline at end of file
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