...
|
...
|
@@ -34,6 +34,7 @@ Page({ |
|
|
CarBrandName: '',
|
|
|
s4_id: '',
|
|
|
color: 1,
|
|
|
che_id: '',
|
|
|
},
|
|
|
onLoad: function (options) {
|
|
|
let that = this
|
...
|
...
|
@@ -60,29 +61,28 @@ Page({ |
|
|
let that = this
|
|
|
let carNum = e.detail.value
|
|
|
let sheng_id = that.data.sheng_id
|
|
|
let reg = /^(([A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/
|
|
|
const careg = reg.test(carNum);
|
|
|
if (!careg) {
|
|
|
wx.showToast({
|
|
|
icon: 'none',
|
|
|
title: '请输入正确车牌号',
|
|
|
})
|
|
|
return;
|
|
|
} else {
|
|
|
that.setData({
|
|
|
pai: carNum
|
|
|
})
|
|
|
console.log(that.data.shengItem, "shengItem");
|
|
|
if (sheng_id != '') {
|
|
|
that.getRegister()
|
|
|
}
|
|
|
|
|
|
}
|
|
|
// let reg = /^(([A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/
|
|
|
// const careg = reg.test(carNum);
|
|
|
// if (!careg) {
|
|
|
// wx.showToast({
|
|
|
// icon: 'none',
|
|
|
// title: '请输入正确车牌号',
|
|
|
// })
|
|
|
// return;
|
|
|
// } else {
|
|
|
// that.setData({
|
|
|
// pai: carNum
|
|
|
// })
|
|
|
// console.log(that.data.shengItem, "shengItem");
|
|
|
// if (sheng_id != '') {
|
|
|
// that.getRegister()
|
|
|
// }
|
|
|
// }
|
|
|
},
|
|
|
paiInput(e) { // c车牌号
|
|
|
let that = this
|
|
|
let carNum = e.detail.value
|
|
|
// let sheng_id = that.data.sheng_id
|
|
|
let sheng_id = that.data.sheng_id
|
|
|
let reg = /^(([A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/
|
|
|
const careg = reg.test(carNum);
|
|
|
if (!careg) {
|
...
|
...
|
@@ -96,10 +96,9 @@ Page({ |
|
|
pai: carNum
|
|
|
})
|
|
|
console.log(that.data.shengItem, "shengItem");
|
|
|
// if (sheng_id != '') {
|
|
|
// that.getRegister()
|
|
|
// }
|
|
|
|
|
|
if (sheng_id != '') {
|
|
|
that.getRegister()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
},
|
...
|
...
|
@@ -118,29 +117,56 @@ Page({ |
|
|
console.log(data, "注册");
|
|
|
if (data.code == 1) {
|
|
|
let msg = data.msg
|
|
|
a.popSuccessTest(msg)
|
|
|
a.popTest(msg)
|
|
|
|
|
|
}
|
|
|
|
|
|
} catch (err) {
|
|
|
let msg = err.msg
|
|
|
// a.popTest(msg)
|
|
|
// a.popTest(err.msg)
|
|
|
console.log(err);
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '该车已被注册,是否申请加入车辆管理?',
|
|
|
success: function (res) {
|
|
|
if (res.confirm) {
|
|
|
|
|
|
|
|
|
} else {
|
|
|
if (err.code == -1) {
|
|
|
if (err.data.che_id != '') {
|
|
|
that.setData({
|
|
|
che_id: err.data.che_id
|
|
|
})
|
|
|
that.sendShen()
|
|
|
}
|
|
|
} else if (err.code == 0) {
|
|
|
a.popTest(err.msg)
|
|
|
}
|
|
|
|
|
|
}
|
|
|
},
|
|
|
sendShen() {
|
|
|
let that = this
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '该车已被注册,是否申请加入车辆管理?',
|
|
|
success: async function (res) {
|
|
|
if (res.confirm) {
|
|
|
try {
|
|
|
const {
|
|
|
data
|
|
|
} = await request({
|
|
|
url: 'api/new2/sendShen',
|
|
|
data: {
|
|
|
che_id: that.data.che_id
|
|
|
}
|
|
|
})
|
|
|
console.log(data);
|
|
|
a.popTest(data.msg)
|
|
|
|
|
|
} catch (err) {
|
|
|
console.log(err);
|
|
|
a.popTest(err.msg)
|
|
|
}
|
|
|
} else {
|
|
|
// a.popTest('该车已被注册过,您不能绑定该车牌号')
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
|
|
|
bindTimeChange(e) { // 时间
|
|
|
this.setData({
|
|
|
buy_time: e.detail.value
|
...
|
...
|
@@ -176,7 +202,6 @@ Page({ |
|
|
})
|
|
|
that.popTest()
|
|
|
}
|
|
|
|
|
|
},
|
|
|
onShow: function () {
|
|
|
|
...
|
...
|
@@ -329,15 +354,15 @@ Page({ |
|
|
obj.buy_time = that.data.buy_time
|
|
|
obj.km = that.data.km
|
|
|
console.log(obj);
|
|
|
let reg = /^(([A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/
|
|
|
let careg = reg.test(obj.pai);
|
|
|
if (!careg) {
|
|
|
wx.showToast({
|
|
|
icon: 'none',
|
|
|
title: '请输入正确车牌号',
|
|
|
})
|
|
|
return;
|
|
|
}
|
|
|
// let reg = /^(([A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/
|
|
|
// let careg = reg.test(obj.pai);
|
|
|
// if (!careg) {
|
|
|
// wx.showToast({
|
|
|
// icon: 'none',
|
|
|
// title: '请输入正确车牌号',
|
|
|
// })
|
|
|
// return;
|
|
|
// }
|
|
|
if (that.data.selected) {
|
|
|
try {
|
|
|
const {
|
...
|
...
|
|