二手车交易,车源发布做缓存
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
<img class="bg" src="@/assets/secondHandCar/bg.png" />
|
||||
<img class="mine" src="@/assets/secondHandCar/mine.png" @click="goMine" />
|
||||
<el-input
|
||||
@blur="getList"
|
||||
placeholder="请输入"
|
||||
v-model.trim="topSearch">
|
||||
<img slot="suffix" class="search" src="@/assets/secondHandCar/search.png"/>
|
||||
@ -79,7 +80,7 @@
|
||||
<div class="right">
|
||||
<div class="title">{{item.vehicleType}}</div>
|
||||
<div v-if="activeTab==0" class="type">{{ item.boardType?.label }} | {{ item.licenseType?.label }} |
|
||||
{{ item.brandModel?.match(/^[\u4e00-\u9fa5]+/)?.[0]?.replace(/牌$/, '') }} | {{ item.mileage }}km | {{item.emissionStandard?.label}}</div>
|
||||
{{ item.brandModel?.match(/^[\u4e00-\u9fa5]+/)?.[0]?.replace(/牌$/, '') }} | {{ formatToWan(item.mileage) }}公里 | {{item.emissionStandard?.label}}</div>
|
||||
<div v-else class="type">{{ item.boardType?.label }} |
|
||||
{{item.vehicleType }} | {{item.emissionStandard?.label}}</div>
|
||||
<div class="date" v-show="activeTab==0 && item.registerDate">注册日期: {{item.registerDate?.substring(0,10)}}</div>
|
||||
@ -122,10 +123,10 @@ export default {
|
||||
name: "indexList",
|
||||
mixins:[myMixins],
|
||||
watch:{
|
||||
topSearch(){
|
||||
/* topSearch(){
|
||||
this.setSearchVal();
|
||||
this.getList()
|
||||
},
|
||||
},*/
|
||||
licenseType(){
|
||||
this.setSearchVal();
|
||||
this.getList()
|
||||
@ -192,6 +193,16 @@ export default {
|
||||
},
|
||||
|
||||
methods:{
|
||||
formatToWan(num) {
|
||||
let result = (num / 10000).toString();
|
||||
if (result.includes('.')) {
|
||||
let decimalPart = result.split('.')[1];
|
||||
if (decimalPart.length > 2) {
|
||||
result = parseFloat(result).toFixed(2);
|
||||
}
|
||||
}
|
||||
return result + '万';
|
||||
},
|
||||
async tabClick(type){
|
||||
this.activeTab=type
|
||||
this.pageNum = 1
|
||||
|
Reference in New Issue
Block a user