RecommendSearchVehicles.vue
1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<template>
<text class="recommend-search" v-if="visible">为您推荐</text>
<view class="car-list" v-if="visible">
<template v-for="(car, index) in contents" :key="index">
<auction-vehicle-item :auction-vehicle="car"></auction-vehicle-item>
</template>
</view>
</template>
<script lang="ts">
import {Component, Prop} from "vue-facing-decorator";
import {PaginationComponent} from "@/components/PaginationComponent";
import {AuctionVehicle} from "lib/src/entity/auction/entity/AuctionVehicle";
import {AuctionController} from "@/api/AuctionController";
import AuctionVehicleItem from "@/components/AuctionVehicleItem.vue";
import {onLoad} from "@dcloudio/uni-app";
@Component({
components: {AuctionVehicleItem}
})
export default class RecommendSearchVehicles extends PaginationComponent<AuctionVehicle> {
@Prop({type: Boolean, default: false})
visible: boolean;
created(): void {
this.init(this.axios, AuctionController.PAGE_RANDOM_AUCTION_VEHICLE);
this.buildQueryForm({});
onLoad((option) => {
this.pageReload();
});
}
get contents(): AuctionVehicle[] {
return this.pagination.content;
}
}
</script>
<style lang="scss" scoped>
.car-list {
padding: 10px;
}
.recommend-search {
font-size: 18px;
font-weight: 500;
letter-spacing: 0px;
line-height: 25.2px;
margin-left: 12px;
color: #333333;
}
</style>