Commit 96971673 authored by 肖健's avatar 肖健

免费挪车牌选择车辆,车牌号不渲染的问题

parent 135efa7c
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
default: 8 default: 8
} }
}, },
data() { data() {
return { return {
focus: false, focus: false,
...@@ -63,6 +64,12 @@ ...@@ -63,6 +64,12 @@
this.$emit('input', val.join('')); this.$emit('input', val.join(''));
this.$emit('change', val); this.$emit('change', val);
}, },
value(val){
for (let i = 0 ; i < val.length; i++) {
this.fill[i] = val.substring(i,i+1)
}
this.$forceUpdate()
}
}, },
methods: { methods: {
focusHandler(index = 0) { focusHandler(index = 0) {
......
...@@ -73,13 +73,17 @@ ...@@ -73,13 +73,17 @@
import CarNumber from "@/common/codecook-carnumber/codecook-carnumber.vue"; import CarNumber from "@/common/codecook-carnumber/codecook-carnumber.vue";
export default { export default {
components: { components: {
CarNumber, CarNumber,
}, },
data() { data() {
return { return {
carNumber: "",
model1: { model1: {
carInfo: {}, carInfo: {
carNo: '',
brand: '',
carModel: '',
mileage: '',
},
}, },
rules: { rules: {
"carInfo.brand": { "carInfo.brand": {
...@@ -95,17 +99,16 @@ export default { ...@@ -95,17 +99,16 @@ export default {
trigger: ["blur", "change"], trigger: ["blur", "change"],
}, },
"carInfo.carNo": [{ "carInfo.carNo": [{
min: 7, min: 7,
max: 8, max: 8,
message: '车牌长度在7-8个字符之间' message: '车牌长度在7-8个字符之间'
}, },
{
{ type: "string",
type: "string", required: true,
required: true, message: "请填写车牌号",
message: "请填写车牌号", trigger: ["blur", "change"],
trigger: ["blur", "change"], },
},
] ]
}, },
carId: '', carId: '',
...@@ -113,11 +116,6 @@ export default { ...@@ -113,11 +116,6 @@ export default {
freeCode: {}, freeCode: {},
}; };
}, },
watch: {
carNumber(num) {
//console.log(num);
},
},
methods: { methods: {
goLoveCar() { goLoveCar() {
uni.navigateTo({ uni.navigateTo({
...@@ -147,15 +145,21 @@ export default { ...@@ -147,15 +145,21 @@ export default {
}, },
getCarInfo() { getCarInfo() {
if (this.carId) { const that = this
if (that.carId) {
let opts = { let opts = {
url: '/app/vehicleAdmin/' + this.carId, url: '/app/vehicleAdmin/' + this.carId,
method: 'get' method: 'get'
}; };
this.http.httpTokenRequest(opts, {}).then(res => { that.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.model1.carInfo = res.data.data that.$nextTick(() => {
} that.model1.carInfo = res.data.data;
that.model1.carInfo.carNo = res.data.data.carNo;
console.log(that.model1.carInfo)
that.$set(that.model1.carInfo, 'carNo', res.data.data.carNo);
})
}
}) })
} }
...@@ -177,8 +181,12 @@ export default { ...@@ -177,8 +181,12 @@ export default {
this.$refs.form1.setRules(this.rules) this.$refs.form1.setRules(this.rules)
}, },
onShow() { onShow() {
this.$nextTick(() => {
this.getCarInfo() this.getCarInfo()
this.getMoveCode() this.getMoveCode()
})
}, },
onLoad(e) { onLoad(e) {
this.orderId = e.orderId this.orderId = e.orderId
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment