188 lines
4.4 KiB
Vue
188 lines
4.4 KiB
Vue
<template>
|
|
<div class="equipCard" @click="cardClick">
|
|
<img
|
|
src="https://fc1tn.baidu.com/it/u=4185529537,1682541874&fm=202&src=766&fc=tdmatt&mola=new&crop=v1"
|
|
alt=""
|
|
/>
|
|
|
|
<div class="title">{{ name }}</div>
|
|
|
|
<ul class="item-details">
|
|
<li class="address">
|
|
<span>{{ company }}</span>
|
|
<span style="text-align: right; color: #ff4800">
|
|
<i style="font-size: 10px">¥</i>
|
|
<i style="font-size: 14px; font-weight: bold">{{ price }}</i>
|
|
<i style="font-size: 10px">/ 天</i>
|
|
</span>
|
|
</li>
|
|
<li>
|
|
<span>13867865678</span>
|
|
</li>
|
|
<li>
|
|
<span>{{ company }}</span>
|
|
<el-button class="lessee-btn" @click.stop="onHandelLessee">立即承租</el-button>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</template>
|
|
<script lang="ts" setup>
|
|
const props: any = defineProps({
|
|
url: {
|
|
type: String,
|
|
default:
|
|
'https://img1.baidu.com/it/u=2080801041,3349735074&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1701536400&t=117e17eae3082b7b524f890245f7826f',
|
|
},
|
|
name: {
|
|
type: String,
|
|
default: '测试装备',
|
|
},
|
|
tags: {
|
|
type: Array,
|
|
default: ['待租', '合肥市'],
|
|
},
|
|
company: {
|
|
type: String,
|
|
default: '安徽某科技有限公司',
|
|
},
|
|
price: {
|
|
type: [String, Number],
|
|
default: 99,
|
|
},
|
|
timeUnit: {
|
|
type: String,
|
|
default: '月',
|
|
},
|
|
id: {
|
|
type: [String, Number],
|
|
default: '',
|
|
},
|
|
})
|
|
|
|
const emit = defineEmits(['onClick'])
|
|
const cardClick = () => {
|
|
const data = {
|
|
id: props.id,
|
|
}
|
|
emit('onClick', data)
|
|
}
|
|
|
|
const onHandelLessee = () => {
|
|
console.log('立即租赁')
|
|
}
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
.equipCard {
|
|
width: 100%;
|
|
background: #f7f9fa;
|
|
display: flex;
|
|
flex-direction: column;
|
|
|
|
img {
|
|
height: 140px;
|
|
}
|
|
|
|
.title {
|
|
padding: 16px 2px;
|
|
font-size: 18px;
|
|
font-weight: bold;
|
|
color: #333333;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.item-details {
|
|
padding: 0 10px 15px 10px;
|
|
|
|
.address {
|
|
padding-right: 15px;
|
|
}
|
|
.address span {
|
|
width: 50%;
|
|
}
|
|
}
|
|
.item-details li {
|
|
padding: 4px 0;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
font-size: 12px;
|
|
|
|
span:first-child {
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.lessee-btn {
|
|
background-color: #1abc9c;
|
|
text-align: center;
|
|
padding: 10px 18px;
|
|
border-radius: 6px;
|
|
color: #fff;
|
|
}
|
|
}
|
|
|
|
.avatar {
|
|
width: 37%;
|
|
overflow: hidden;
|
|
border-radius: 15px;
|
|
.showImg {
|
|
width: 100%;
|
|
padding-bottom: 100%;
|
|
position: relative;
|
|
img {
|
|
position: absolute;
|
|
left: 0;
|
|
top: 0;
|
|
object-fit: cover;
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
}
|
|
}
|
|
.desc {
|
|
box-sizing: border-box;
|
|
margin-left: 10px;
|
|
flex: 1;
|
|
overflow: hidden;
|
|
|
|
.tag {
|
|
display: flex;
|
|
margin-top: 8px;
|
|
.item {
|
|
background: white;
|
|
font-size: 14px;
|
|
font-weight: 400;
|
|
color: #005af2;
|
|
padding: 2px 3px;
|
|
border: 1px solid #005af2;
|
|
margin-right: 10px;
|
|
border-radius: 4px;
|
|
}
|
|
}
|
|
.company {
|
|
margin-top: 10px;
|
|
font-size: 14px;
|
|
font-weight: 400;
|
|
color: #a5a4a4;
|
|
line-height: 20px;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
.price {
|
|
font-size: 14px;
|
|
font-weight: 400;
|
|
color: #ff4800;
|
|
margin-top: 20px;
|
|
span {
|
|
font-size: 25px;
|
|
font-weight: 600;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|