Files
xdd-uniapp-new/pages/cloud/components/HotelItem.vue
T

111 lines
2.0 KiB
Vue

<template>
<view class="cover-box-wrap">
<view class="cover-box">
<image
:src="item.cover"
class="cover"
mode="scaleToFill"
/>
<view class="my-mask">
<image
class="icon"
:src="webUrl + '/20220510142728577618.png'"
mode="scaleToFill"
/>
<text>{{ item.cityName }}</text>
</view>
</view>
<view class="more-t">{{ item.content }}</view>
<view class="flex ai-center bottom">
<image
v-if="item.logo"
:src="item.logo"
class="logo"
mode="scaleToFill"
></image>
<image
v-else
:src="webUrl + '/20230609145651814148.png'"
class="logo"
/>
<text class="one-t">{{ item.name }}</text>
</view>
</view>
</template>
<script>
export default {
name: 'FunHotelItem',
props: {
item: {
type: Object,
default: () => {
return {}
}
}
},
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL
}
}
}
</script>
<style scoped lang="less">
.cover-box-wrap {
margin: 20rpx 0 0 0;
.cover-box {
position: relative;
width: 338rpx;
height: auto;
border-radius: 14rpx;
overflow: hidden;
}
.cover {
width: 338rpx;
height: 338rpx;
vertical-align: middle;
}
.icon {
width: 26rpx;
height: 26rpx;
margin-top: -6rpx;
margin-right: 6rpx;
vertical-align: middle;
}
.logo {
width: 36rpx;
height: 36rpx;
vertical-align: middle;
margin: 0 8rpx;
border-radius: 50%;
}
.item {
width: 328rpx;
box-sizing: border-box;
}
.my-mask {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 60rpx;
line-height: 60rpx;
box-sizing: border-box;
padding: 0 24rpx;
background: linear-gradient(rgba(51, 51, 51, 0), rgba(0, 0, 0, 1));
color: #fff;
font-size: 24rpx;
}
.more-t {
margin: 10rpx;
}
.one-t {
color: #666;
font-size: 24rpx;
}
.bottom {
margin: 0 0 20rpx 0;
}
}
</style>