二手车交易,测试优化
This commit is contained in:
@@ -16,11 +16,8 @@
|
||||
<van-swipe-item v-for="(item,i) in imgSrcList" :key="i">
|
||||
<img v-if="item" class="swipeImg" :src="item" />
|
||||
</van-swipe-item>
|
||||
<van-swipe-item>
|
||||
<img class="swipeImg" src="@/assets/secondHandCar/45angle.png" />
|
||||
</van-swipe-item>
|
||||
<template #indicator>
|
||||
<div class="custom-indicator">{{ current + 1 }}/{{(imgSrcList.length + 1)}}</div>
|
||||
<div class="custom-indicator">{{ current + 1 }}/{{imgSrcList.length}}</div>
|
||||
</template>
|
||||
</van-swipe>
|
||||
<div class="infoWrap">
|
||||
@@ -99,6 +96,7 @@
|
||||
<script>
|
||||
import {myMixins} from "@/utils/myMixins"
|
||||
import {carInfoDetail,saveRecord} from "@/api/secondHandCar";
|
||||
import { Dialog } from 'vant';
|
||||
export default {
|
||||
name: "forSale",
|
||||
mixins:[myMixins],
|
||||
@@ -123,17 +121,21 @@ export default {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
this.id=this.$route.query.id || urlParams.get('id');
|
||||
this.queryType=this.$route.query.queryType || urlParams.get('queryType');
|
||||
this.isList=this.$route.query.isList
|
||||
this.isList=this.$route.query.isList || urlParams.get('isList');
|
||||
if( this.id){
|
||||
let res = await carInfoDetail({
|
||||
id:this.id,
|
||||
queryType:this.queryType ,
|
||||
})
|
||||
this.detailInfo=res?.data
|
||||
this.imgSrcList=res.data.otherPhoto?.split(',') || []
|
||||
if(res.data.otherPhoto){
|
||||
this.imgSrcList=res.data.otherPhoto.split(',') || []
|
||||
}
|
||||
this.imgSrcList.push(res?.data?.vehicleAnglePhoto)
|
||||
console.log("this.imgSrcList",this.imgSrcList)
|
||||
}
|
||||
},
|
||||
beforeUnmount() {
|
||||
destroyed() {
|
||||
this.getDuration()
|
||||
},
|
||||
methods:{
|
||||
@@ -159,12 +161,17 @@ export default {
|
||||
await saveRecord({type:this.recordType,carInfoId:this.id,duration})
|
||||
},
|
||||
handle(){
|
||||
this.recordType=2
|
||||
this.getDuration()
|
||||
window.location.href = `tel:${this.detailInfo.contactNumber}`;
|
||||
Dialog.alert({
|
||||
message:this.detailInfo.contactNumber ,
|
||||
confirmButtonText:'拨打电话',
|
||||
showCancelButton:true,
|
||||
}).then(() => {
|
||||
this.recordType=2
|
||||
this.getDuration()
|
||||
window.location.href = `tel:${this.detailInfo.contactNumber}`;
|
||||
})
|
||||
},
|
||||
onChange(index) {
|
||||
console.log("index",index)
|
||||
this.current = index;
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user