From d4485779c60a2902ec09365869f1623cc315e3c9 Mon Sep 17 00:00:00 2001
From: zhouxueli <2841188632@qq.com>
Date: Thu, 13 Mar 2025 13:31:37 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BA=8C=E6=89=8B=E8=BD=A6=E4=BA=A4=E6=98=93?=
=?UTF-8?q?=EF=BC=8C=E5=85=AC=E9=87=8C=E8=BD=AC=E5=8C=96=E6=95=B0=E5=80=BC?=
=?UTF-8?q?=E8=BD=AC=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/secondHandCar/forSale.vue | 18 +++++++++++++++---
src/views/secondHandCar/indexList.vue | 4 ++--
src/views/secondHandCar/mineRelease.vue | 2 +-
src/views/secondHandCar/wantBuySale.vue | 4 +++-
4 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/src/views/secondHandCar/forSale.vue b/src/views/secondHandCar/forSale.vue
index 268f1be7..9def4c11 100644
--- a/src/views/secondHandCar/forSale.vue
+++ b/src/views/secondHandCar/forSale.vue
@@ -68,7 +68,7 @@
- {{ detailInfo.mileage}}公里
+ {{ formatToWan(detailInfo.mileage)}}公里
行驶公里
@@ -84,7 +84,7 @@
{{detailInfo.desc}}
@@ -108,15 +108,17 @@ export default {
duration:'',
startTime: null, // 记录进入时间
recordType:1,
+ isList:false,//是否是首页列表跳转过来的
}
},
async mounted() {
- console.log(" localStorage.setItem('indexActiveTab', this.activeTab);", localStorage.getItem('indexActiveTab'))
+ // console.log(" localStorage.setItem('indexActiveTab', this.activeTab);", localStorage.getItem('indexActiveTab'))
// 页面加载时记录进入时间
this.startTime = new Date();
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
if( this.id){
let res = await carInfoDetail({
id:this.id,
@@ -130,6 +132,16 @@ export default {
this.getDuration()
},
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 + '万';
+ },
getDuration(){
// 页面卸载时记录离开时间并计算浏览时长
const endTime = new Date();
diff --git a/src/views/secondHandCar/indexList.vue b/src/views/secondHandCar/indexList.vue
index 103a8b54..84168431 100644
--- a/src/views/secondHandCar/indexList.vue
+++ b/src/views/secondHandCar/indexList.vue
@@ -210,9 +210,9 @@ export default {
},
viewCarSource(item){
if(this.activeTab===0){//车源查看
- this.$router.push({ name: "forSale", query: {type:1 , id:item.id,queryType:1 }})
+ this.$router.push({ name: "forSale", query: {type:1 , id:item.id,queryType:1,isList:true }})
}else{//求购查看
- this.$router.push({ name: "wantBuySale", query: { type:1 ,id:item.id ,queryType:2}})
+ this.$router.push({ name: "wantBuySale", query: { type:1 ,id:item.id ,queryType:2,isList:true}})
}
this.setSearchVal();
},
diff --git a/src/views/secondHandCar/mineRelease.vue b/src/views/secondHandCar/mineRelease.vue
index 6989553a..56f4f5fa 100644
--- a/src/views/secondHandCar/mineRelease.vue
+++ b/src/views/secondHandCar/mineRelease.vue
@@ -106,7 +106,7 @@ export default {
itemHandle(item){//审核
this.$router.push({
name: item.type==1 ? "forSale" : 'wantBuySale',
- query: { id:item.id,queryType:3},
+ query: { id:item.id,queryType:3,isList:false},
})
sessionStorage.setItem('mineActiveTab',String(this.activeTab) )
},
diff --git a/src/views/secondHandCar/wantBuySale.vue b/src/views/secondHandCar/wantBuySale.vue
index 93eea6be..28cc3939 100644
--- a/src/views/secondHandCar/wantBuySale.vue
+++ b/src/views/secondHandCar/wantBuySale.vue
@@ -45,7 +45,7 @@
{{detailInfo.desc}}
- 我有车源
+ 我有车源
@@ -65,6 +65,7 @@ export default {
duration:'',
startTime: null, // 记录进入时间
recordType:1,
+ isList:false,
}
},
async mounted() {
@@ -73,6 +74,7 @@ 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
if( this.id) {
let res = await carInfoDetail({
id: this.id,