123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- <template>
- <view class="house-list">
- <view class="house-item" v-for="(item,index) in houseList" :key="index"
- @click="$navigateTo('/pages/houseDetail/houseDetail?id='+item.id)">
- <view class="house-item-box">
- <view class="house-item-img">
- <image :src="item.privewImage" mode="aspectFill"></image>
- <view class="house-item-floor">
- <uni-icons type="location" color="#fff" size="12"></uni-icons>
- <text>{{item.projectItemName}}-{{item.projectItemTargetName}}</text>
- </view>
- </view>
- <view class="house-item-info">
- <view class="house-item-name">{{item.name}}</view>
- <view class="house-item-tag">
- <text v-for="(tag,i) in item.tagList" :key="i">
- <text>{{tag.name}}</text>
- <text class="line" v-if="i < item.tagList.length-1">|</text>
- </text>
- </view>
- <view class="house-item-price">
- <text>{{item.price}}</text>
- <view class="price-type">/{{item.payType === 0 ? '月' : '年'}}</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- name: 'houseList',
- props: {
- list: {
- type: Array,
- default: () => {
- return []
- }
- },
- },
- data() {
- return {
- houseList: []
- }
- },
- created() {
- this.houseList = this.list;
- },
- onLoad() {
- },
- watch: {
- list() {
- this.houseList = this.list;
- }
- },
- }
- </script>
- <style lang="scss">
- .house-list {
- display: flex;
- flex-wrap: wrap;
- margin-top: 30rpx;
- padding-bottom: 60rpx;
- .house-item {
- width: 50%;
- box-sizing: border-box;
- margin-bottom: 30rpx;
- &:nth-child(2n-1) {
- padding-right: 16rpx;
- }
- &:nth-child(2n) {
- padding-left: 16rpx;
- }
- .house-item-box {
- background: $uni-white;
- border-radius: 16rpx;
- overflow: hidden;
- .house-item-img {
- position: relative;
- image {
- width: 100%;
- height: 260rpx !important;
- }
- }
- .house-item-floor {
- position: absolute;
- left: 0;
- bottom: 20rpx;
- width: 100%;
- color: #FFFFFF;
- font-size: 24rpx;
- display: flex;
- align-items: center;
- padding-left: 10rpx;
- }
- .house-item-info {
- padding: 10rpx 0 20rpx 0;
- .house-item-name {
- font-size: 28rpx;
- padding: 0 20rpx;
- }
- .house-item-tag {
- display: flex;
- padding-top: 10rpx;
- padding-left: 20rpx;
- color: $uni-extra-color;
- overflow: hidden;
- white-space: nowrap;
- text {
- font-size: 24rpx;
- }
- .line {
- margin: 0 10rpx;
- }
- }
- .house-item-price {
- display: flex;
- align-items: center;
- padding-top: 6rpx;
- color: $uni-error;
- padding-left: 20rpx;
- text {
- font-weight: bold;
- font-size: 30rpx;
- }
- .price-type {
- display: inline-block;
- font-size: 24rpx;
- scale: 0.9;
- }
- }
- }
- }
- }
- }
- </style>
|