Files
2026-10-27 13:54:39 +08:00

97 lines
1.7 KiB
Vue

<template>
<view class="rental-info">
<view class="info-row">
<text class="row-label">租赁物品</text>
<text class="row-value">{{ itemName }}</text>
</view>
<view class="info-row last">
<text class="row-label">押金</text>
<view class="row-value-wrap">
<text v-if="creditFree" class="free-tag">免押金</text>
<text class="amount" :class="{ 'is-free': creditFree }">{{ depositAmount }}</text>
<text class="amount-unit" :class="{ 'is-free': creditFree }">元</text>
</view>
</view>
</view>
</template>
<script setup>
defineProps({
itemName: {
type: String,
default: ''
},
depositAmount: {
type: [Number, String],
default: ''
},
// 信用免押时展示「免押金」标签,现场付押金时不展示
creditFree: {
type: Boolean,
default: true
}
})
</script>
<style>
.rental-info {
padding: 0 40rpx;
}
.info-row {
display: flex;
align-items: center;
justify-content: space-between;
height: 112rpx;
border-bottom: 1rpx solid #eeeeee;
}
.info-row.last {
border-bottom: none;
}
.row-label {
font-size: 28rpx;
color: #666666;
}
.row-value {
font-size: 28rpx;
font-weight: 600;
color: #1a1a1a;
}
.row-value-wrap {
display: flex;
align-items: center;
}
.free-tag {
margin-right: 12rpx;
padding: 2rpx 10rpx;
border: 1rpx solid rgba(30, 107, 255, 0.45);
border-radius: 8rpx;
font-size: 24rpx;
color: #1e6bff;
}
.amount {
font-size: 34rpx;
font-weight: 600;
color: #1a1a1a;
}
.amount-unit {
margin-left: 4rpx;
font-size: 26rpx;
font-weight: 600;
color: #1a1a1a;
}
/* 免押时把原押金划掉 */
.amount.is-free,
.amount-unit.is-free {
text-decoration: line-through;
}
</style>