添加车辆优化

This commit is contained in:
Vinjor 2024-11-23 09:58:45 +08:00
parent c03f00cf94
commit e99495791d
2 changed files with 37 additions and 4 deletions

View File

@ -644,9 +644,35 @@ export default {
* 添加车辆和客户信息
*/
addCarUserInfo(){
uni.navigateTo({
url: `/pages/myCar/addCarUser`
})
if(this.userInfo){
//
uni.navigateTo({
url: '/pages/myCar/addCarUser?userInfo='+JSON.stringify(this.userInfo)
})
}else if(this.phone != ''){
//
const params = {
phoneOrCar: this.phone
}
request({
url: '/admin-api/base/custom/page',
method: 'GET',
params: params
}).then(res => {
if (res.data.records.length > 0) {
this.userInfo = res.data.records[0]
//
uni.navigateTo({
url: '/pages/myCar/addCarUser?userInfo='+JSON.stringify(this.userInfo)
})
}
})
}else{
//
uni.navigateTo({
url: `/pages/myCar/addCarUser`
})
}
},
editUserInfo(userInfo) {
if (this.phone == '') return uni.showToast({

View File

@ -202,8 +202,15 @@ export default {
natureIndex: 0,
};
},
onLoad() {
onLoad(data) {
//
if(data && data.hasOwnProperty("userInfo")){
let thisUserInfoObj = JSON.parse(data.userInfo)
console.log("thisUserInfoObj",thisUserInfoObj)
this.userInfo.cusName = thisUserInfoObj.cusName
this.userInfo.sex = thisUserInfoObj.sex
this.userInfo.phoneNumber = thisUserInfoObj.phoneNumber
}
this.bo1 = false;
this.bo2 = true;
this.pageTitle = '添加车辆信息'