二手车交易,全部页面&对接部分接口

This commit is contained in:
2025-03-11 11:09:01 +08:00
parent 24f25635d5
commit 76c6d6ef5b
7 changed files with 2295 additions and 111 deletions

View File

@ -0,0 +1,305 @@
<template>
<div class="wrap" >
<div class="headerWrap">
<img class="back" @click="h5GoBack" src="@/assets/secondHandCar/back.png" />
<span>在售</span>
<div style="opacity: 0;" class="back"></div>
</div>
<div class="contentWrap">
<van-swipe @change="onChange">
<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>
</template>
</van-swipe>
<div class="infoWrap">
<div class="titleWrap wrapCommon">
<div class="info">
<span>{{ detailInfo.vehicleType }}</span>
<span>{{ detailInfo.boardType?.label }}</span>
<span>{{ detailInfo.licenseType?.label }}</span>
<span>{{detailInfo.brandModel}}</span>
<span>{{ detailInfo.mileage }}公里</span>
<span>{{ detailInfo.emissionStandard?.label }}</span>
</div>
<div class="time">
<span>{{ detailInfo.createTime?.substring(0,10) }}</span><span>{{ detailInfo.areaName }}</span><span>发布</span>
</div>
<div class="price">
<span>{{ detailInfo.maxPrice / 10000 }}</span>
<span></span>
</div>
</div>
<div class="detailInfoWrap wrapCommon">
<div>
<img class="descImg firstDescImg" src="@/assets/secondHandCar/details.png" />
</div>
<div class="descItem descCommon">
<div class="itemInfo">
<span>{{ detailInfo.licenseType?.label }}</span>
<span>牌照类型</span>
</div>
<div class="suGang"></div>
<div class="itemInfo">
<span>{{ detailInfo.vehicleType }}</span>
<span>拖车类型</span>
</div>
<div class="suGang"></div>
<div class="itemInfo">
<span>{{ detailInfo.boardType?.label }}&nbsp;&nbsp;</span>
<span>拖车落板</span>
</div>
</div>
<div class="descItem descCommon">
<div class="itemInfo">
<span>{{detailInfo.brandModel}}</span>
<span>牌照类型</span>
</div>
<div class="suGang"></div>
<div class="itemInfo">
<span>{{ detailInfo.emissionStandard?.label }}</span>
<span>排放标准</span>
</div>
<div class="suGang"></div>
<div class="itemInfo">
<span>{{ detailInfo.mileage}}公里</span>
<span>行驶公里</span>
</div>
</div>
<div class="descItem descCommon">
<div class="itemInfo">
<span>{{ detailInfo.createTime?.substring(0,10) }}</span>
<span>发布日期</span>
</div>
</div>
<div>
<img class="descImg" src="@/assets/secondHandCar/description.png" />
</div>
<div class="descCommon desc">{{detailInfo.desc}}</div>
</div>
<div class="btnWrap" >
<div class="btn commonBtn" @click="noMultipleClicks(handle)">我想要</div>
</div>
</div>
</div>
</div>
</template>
<script>
import {myMixins} from "@/utils/myMixins"
import {carInfoDetail} from "@/api/secondHandCar";
export default {
name: "forSale",
mixins:[myMixins],
data(){
return{
current: 0,
noClick:true,
id:'',
queryType:'',
detailInfo:'',
imgSrcList:[],
}
},
async mounted() {
this.id=this.$route.query.id
this.queryType=this.$route.query.queryType
if( this.id){
let res = await carInfoDetail({
id:this.id,
queryType:this.queryType ,
})
this.detailInfo=res?.data
this.imgSrcList=res.data.otherPhoto?.split(',') || []
console.log("=",res,this.imgSrcList)
/*this.form={...res.data}
this.form.licenseType=res.data.licenseType?.code
this.form.boardType=res.data.boardType?.code
this.form.emissionStandard=res.data.emissionStandard?.code
this.auditRemark=res.data?.auditRemark
this.areaName=res.data?.areaName*/
}
},
methods:{
onChange(index) {
this.current = index;
},
handle(){
},
}
}
</script>
<style scoped lang="scss">
@import '@/styles/mixin.scss';
.wrap {
@include wh(100%, 100%);
position: relative;
background-color: #F6F6F6;
}
.headerWrap{
width: 100%;
box-sizing: border-box;
padding: 15px 16px;
position: relative;
display: flex;
justify-content: space-between;
align-items: center;
.back{
@include wh(15px,15px);
}
span{
font-weight: bold;
font-size: 16px;
color: #203152;
}
}
.contentWrap{
height: calc(100% - 42px);
overflow-y: auto;
.infoWrap{
box-sizing: border-box;
padding: 0 6px;
margin-top: -15px;
}
.wrapCommon{
width: 100%;
background: #FFFFFF;
border-radius: 6px;
backdrop-filter: blur(5.602678571428572px);
box-sizing: border-box;
margin-bottom: 12px;
}
.titleWrap{
height: 108px;
padding: 18px 0 15px 21px;
display: flex;
flex-direction: column;
justify-content: space-between;
.info{
font-weight: 600;
font-size: 15px;
color: #212020;
line-height: 21px;
span{
margin-right: 10px;
}
}
.time{
font-weight: 400;
font-size: 12px;
color: #999999;
line-height: 17px;
span:first-child{
margin-right: 20px;
}
span:last-child{
margin-left: 10px;
}
}
.price{
color: #FF5533;
line-height: 28px;
font-weight: 600;
span:first-child{
font-size: 20px;
margin-right: 4px;
}
span:last-child{
font-size: 11px;
}
}
}
.detailInfoWrap{
box-sizing: border-box;
padding: 18px 28px 15px 22px;
.descImg{
@include wh(72px, 19px);
}
.firstDescImg{
margin-bottom: 24px;
}
.descCommon{
width: 100%;
box-sizing: border-box;
padding-left: 15px;
}
.descItem{
display: flex;
justify-content: space-between;
align-items: baseline;
margin-bottom: 20px;
}
.itemInfo{
display: flex;
flex-direction: column;
span:first-child{
font-weight: bold;
font-size: 14px;
color: #282828;
line-height: 20px;
margin-bottom: 2px;
}
span:last-child{
font-weight: 400;
font-size: 10px;
color: #999999;
line-height: 14px;
}
}
.suGang{
width: 1px;
height: 8px;
border-right: 1px solid #999999;
opacity: 0.5;
}
.desc{
font-weight: 400;
font-size: 12px;
color: #282828;
margin-top: 10px;
}
}
.btnWrap{
padding-bottom: 20px;
}
.commonBtn{
height: 46px;
line-height: 46px;
text-align: center;
font-weight: bold;
border-radius: 5px;
color: #FFFFFF;
}
.btn{
width: 296px;
background: #4A7FEB;
margin: 0 auto;
font-size: 15px;
}
}
.custom-indicator {
position: absolute;
right: 5px;
bottom: 20px;
padding: 2px 5px;
font-size: 12px;
background: rgba(0, 0, 0, 0.1);
color: wheat;
}
.van-swipe-item{
height: 215px;
background-color: pink;
.swipeImg{
width: 100%;
height: 100%;
}
}
</style>