二手车交易,打电话问题

This commit is contained in:
2025-03-15 16:47:01 +08:00
parent 4f20dffc52
commit 678d4f6436
2 changed files with 51 additions and 4 deletions

View File

@ -226,7 +226,9 @@ export default {
this.vehicleAnglePhotoList=[{url:res.data?.vehicleAnglePhoto}]
console.log("th",this.form)
}
console.log("this.$route.params",this.$route.params)
// 监听 message 事件
window.addEventListener('message', this.handleMessage);
// console.log("this.$route.query==",this.$route.query)
if(this.$route.params.form){
this.form={...this.$route.params.form}
}
@ -249,7 +251,42 @@ export default {
this.otherImgSrc=this.$route.params.otherImgSrc
}
},
beforeDestroy() {
// 移除事件监听器
window.removeEventListener('message', this.handleMessage);
},
methods:{
// 处理接收到的消息
handleMessage(event) {
// 解析消息数据
const data = event.data;
console.log("data",data)
// 检查消息类型(可选)
if (data.type === 'updateCarSourceParams') {
// 更新组件数据
if (data.form) {
this.form = data.form;
}
if (data.radio) {
this.radio = data.radio;
}
if (data.areaName) {
this.areaName = data.areaName;
}
if (data.vehicleLicensePhotoList) {
this.vehicleLicensePhotoList = data.vehicleLicensePhotoList;
}
if (data.vehicleAnglePhotoList) {
this.vehicleAnglePhotoList = data.vehicleAnglePhotoList;
}
if (data.otherImgSrcList) {
this.otherImgSrcList = data.otherImgSrcList;
}
if (data.otherImgSrc) {
this.otherImgSrc = data.otherImgSrc;
}
}
},
backHandle(){
if(this.$route.query.homePage){//返回列表
this.$router.push({ name: "indexList"})
@ -269,12 +306,12 @@ export default {
url = 'https://crm1.sino-assist.com'
// url = 'http://localhost:8080'
}
sessionStorage.setItem('formInfo',JSON.stringify(this.form))
/* sessionStorage.setItem('formInfo',JSON.stringify(this.form))
sessionStorage.setItem('areaName',this.areaName)
sessionStorage.setItem('vehicleLicensePhotoList',JSON.stringify(this.vehicleLicensePhotoList))
sessionStorage.setItem('vehicleAnglePhotoList',JSON.stringify(this.vehicleAnglePhotoList))
sessionStorage.setItem('otherImgSrcList',JSON.stringify(this.otherImgSrcList))
sessionStorage.setItem('otherImgSrc',JSON.stringify(this.otherImgSrc))
sessionStorage.setItem('otherImgSrc',JSON.stringify(this.otherImgSrc))*/
let urls=url + '/h5/supplier/dispatch/res/privacy.html'
this.$router.push({ name: "privacyComponent", query: {url:urls,type:1,homePage:this.homePage},params: {
@ -284,7 +321,6 @@ export default {
vehicleAnglePhotoList:this.vehicleAnglePhotoList,
otherImgSrcList:this.otherImgSrcList,
otherImgSrc:this.otherImgSrc,
}})
},
closeParentDialog() {

View File

@ -30,6 +30,17 @@ export default {
},
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{