二手车交易,车源发布做缓存

This commit is contained in:
2025-03-14 11:44:06 +08:00
parent 558e3e3e8c
commit 905bfc0785
2 changed files with 22 additions and 10 deletions

View File

@ -90,21 +90,22 @@
</div>
</div>
</div>
<van-dialog v-model="show" title="电话" show-cancel-button>
<!-- <van-dialog v-model="show" title="电话" show-cancel-button>
<van-button type="primary" :to="{tel:this.detailInfo.contactNumber}">打电话1</van-button>
<van-button type="primary" to="tel:15237688303">打电话2</van-button>
<a href="tel:15237688303">
<van-button type="primary">打电话3</van-button>
<a href="tel:15237688303">{{this.detailInfo.contactNumber}}
<van-button type="primary">{{}}</van-button>
</a>
</van-dialog>
</van-dialog>-->
</div>
</template>
<script>
import {myMixins} from "@/utils/myMixins"
import {carInfoDetail,saveRecord} from "@/api/secondHandCar";
// import { Dialog } from 'vant';
import { Dialog } from 'vant';
export default {
name: "forSale",
mixins:[myMixins],
@ -171,7 +172,7 @@ export default {
},
handle(){
this.show=true
/* Dialog.alert({
Dialog.alert({
message:this.detailInfo.contactNumber ,
confirmButtonText:'拨打电话',
showCancelButton:true,
@ -181,7 +182,7 @@ export default {
window.location.href = `tel:${this.detailInfo.contactNumber}`;
}).catch(() => {
// on cancel
});*/
});
},
onChange(index) {
this.current = index;

View File

@ -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