@@ -23,45 +23,8 @@ export default {
},
async mounted() {
this.url=this.$route.query.url
- console.log("1122",this.$route.params.form,this.$route.params.radio)
},
- beforeUnmount() {
-
- },
- methods:{
- backHandle(){
- const data = {
- form: this.$route.params.form,
- radio: this.$route.params.radio,
- areaName: this.$route.params.areaName,
- vehicleLicensePhotoList: this.$route.params.vehicleLicensePhotoList,
- vehicleAnglePhotoList: this.$route.params.vehicleAnglePhotoList,
- otherImgSrcList: this.$route.params.otherImgSrcList,
- otherImgSrc: this.$route.params.otherImgSrc,
- };
- // 向父页面(A 项目)发送消息,使用自定义事件名称
- window.parent.postMessage({ type: 'updateCarSourceParams', data }, '*');
- if(this.isWebFunc()){
- this.h5GoBack()
- }else{
- if(this.$route.query.type == 1){
- this.$router.push({ name: 'carSource',query: {type:1,homePage:this.$route.query.homePage},params: {
- form: this.$route.params.form,
- radio:this.$route.params.radio ,
- areaName:this.$route.params.areaName ,
- vehicleLicensePhotoList:this.$route.params.vehicleLicensePhotoList ,
- vehicleAnglePhotoList:this.$route.params.vehicleAnglePhotoList ,
- otherImgSrcList:this.$route.params.otherImgSrcList ,
- otherImgSrc:this.$route.params.otherImgSrc ,
-
- } })
-
- }else{
- this.$router.push({ name: 'wantBuy',query: {type:1,homePage:this.$route.query.homePage},params: { form: this.$route.params.form,radio:this.$route.params.radio } })
- }
- }
- },
- }
+ methods:{ }
}
@@ -93,7 +56,6 @@ export default {
}
.contentWrap{
height: calc(100% - 42px);
- //overflow-y: auto;
iframe{
overflow-y:hidden;
width: 100%;
diff --git a/src/views/secondHandCar/wantBuy.vue b/src/views/secondHandCar/wantBuy.vue
index 42db7fbb..867ac9e8 100644
--- a/src/views/secondHandCar/wantBuy.vue
+++ b/src/views/secondHandCar/wantBuy.vue
@@ -137,7 +137,6 @@ export default {
status:'',
supplierName:'',
supplierCode:'',
- homePage:false,
}
},
async mounted() {
@@ -145,7 +144,6 @@ export default {
this.type=this.$route.query.type || urlParams.get('type');
this.id=this.$route.query.id || urlParams.get('id');
this.queryType=this.$route.query.queryType || urlParams.get('queryType');
- this.homePage=this.$route.query.homePage
if( this.id){
let res = await carInfoDetail({
id:this.id,
@@ -164,23 +162,27 @@ export default {
this.ortherReason=res[1]
}
}
- if(this.$route.params.form){
- this.form={...this.$route.params.form}
- }
- if(this.$route.params.radio){
- this.radio=this.$route.params.radio
+ let wantBuyFormInfo=localStorage.getItem("wantBuyFormInfo") ? JSON.parse(localStorage.getItem("wantBuyFormInfo")) : ''
+ if(!wantBuyFormInfo){
+ return
}
+ this.form={...wantBuyFormInfo.form}
+ this.radio=wantBuyFormInfo.radio
+ this.ortherReason=wantBuyFormInfo.ortherReason
},
methods:{
+ clearStorageFormInfo(){
+ localStorage.setItem("wantBuyFormInfo",'')
+ },
backHandle(){
if(this.$route.query.homePage){//返回列表
this.$router.push({ name: "indexList"})
}else{//返回我的发布
this.$router.push({ name: "mineRelease"})
}
+ this.clearStorageFormInfo();
},
viewPrivacy(){
- // let host = window.location.host
let url='';
if (window.location.href.includes('www.sinoassist.com')) {
url = 'https://www.sinoassist.com'
@@ -193,43 +195,18 @@ export default {
// url = 'http://localhost:8080'
}
let urls=url + '/h5/supplier/dispatch/res/privacy.html'
- this.$router.push({ name: "privacyComponent", query: {url:urls,type:2,homePage:this.homePage},params: { form: this.form,radio:this.radio } })
- },
- closeParentDialog() {
- if (window.parent) {
- // 检查是否有父组件监听 'closeDialog' 事件
- const hasListener = window.parent.dispatchEvent(new Event('checkCloseDialog'));
- if (hasListener) {
- // 如果有监听器,向父组件发送消息以请求关闭 dialog
- window.parent.postMessage('closeDialog', '*');
- } else {
- // 如果没有监听器,则执行 history.back()
- window.history.back();
- }
- }
+ let data={form:this.form,radio:this.radio,ortherReason:this.ortherReason}
+ localStorage.setItem("wantBuyFormInfo",JSON.stringify(data))
+ this.$router.push({ name: "privacyComponent", query: {url:urls}})
},
+
// 审核操作
async auditHandle(type){
if (!type && !this.auditReason){
this.$toast('请填写不通过原因')
return
}
- let flag=this.validateHandle()
- if(flag){
- this.$toast(flag)
- return
- }
- if (this.form.vehicleType=='拖车' && !this.form.boardType) {
- this.$toast('落板方式不能为空')
- return
- }else if(this.form.vehicleType !=='拖车'){
- this.form.boardType=''
- }
- let rule=this.validationRules.find(item=>!item.value)
- if(rule){
- this.$toast(rule.name)
- return
- }
+ await this.commonMethods()
try {
await auditCarInfo({
id: this.id,
@@ -238,6 +215,7 @@ export default {
...this.form,
vehicleType: this.ortherReason ? (this.form.vehicleType+','+this.ortherReason) : this.form.vehicleType
})
+ this.clearStorageFormInfo()
setTimeout(()=>{
this.closeParentDialog()
},1000)
@@ -249,12 +227,7 @@ export default {
}
},
- // 发布求购
- async submitHandle(){
- if (!this.radio) {
- this.$toast('请勾选我已阅读并同意')
- return
- }
+ commonMethods() {
let flag=this.validateHandle()
if(flag){
this.$toast(flag)
@@ -271,11 +244,20 @@ export default {
this.$toast(rule.name)
return
}
+ },
+ // 发布求购
+ async submitHandle(){
+ if (!this.radio) {
+ this.$toast('请勾选我已阅读并同意')
+ return
+ }
+ await this.commonMethods()
try {
let res = await publishCarInfo({
...this.form,
vehicleType: this.ortherReason ? (this.form.vehicleType+','+this.ortherReason) : this.form.vehicleType
})
+ this.clearStorageFormInfo()
if(res.code == 200 && !res.msg){
this.$toast('发布成功')
if(this.isWebFunc()){
diff --git a/src/views/secondHandCar/wantBuySale.vue b/src/views/secondHandCar/wantBuySale.vue
index c14f8703..a10a5fcf 100644
--- a/src/views/secondHandCar/wantBuySale.vue
+++ b/src/views/secondHandCar/wantBuySale.vue
@@ -91,7 +91,6 @@ export default {
getDuration(){
const endTime = new Date();
const duration = (endTime - this.startTime) / 1000; // 计算时长(秒)
- console.log('浏览时长:', duration, '秒');
this.saveRecord(duration);
},
async saveRecord(duration){