查验结果
This commit is contained in:
parent
f2e13a9f35
commit
4a73135476
@ -43,6 +43,24 @@ function label() {
|
||||
}
|
||||
|
||||
|
||||
@CustomDialog
|
||||
@Component
|
||||
struct ImagePreview {
|
||||
@Prop image: string = ""
|
||||
private controller: CustomDialogController
|
||||
|
||||
build() {
|
||||
Image(this.image)
|
||||
.alt($rawfile("images/vehicle/default.png"))
|
||||
.width("100%")
|
||||
.height("100%")
|
||||
.backgroundColor(0x000000)
|
||||
.onClick(() => {
|
||||
this.controller.close()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@Component
|
||||
@Entry
|
||||
struct Detail {
|
||||
@ -64,11 +82,24 @@ struct Detail {
|
||||
@State plate: string = ""
|
||||
@State leftForward: string = ""
|
||||
@State rightBackward: string = ""
|
||||
@State currentImage: string = ""
|
||||
private imagePreviewController = new CustomDialogController({
|
||||
builder: ImagePreview({
|
||||
image: this.currentImage
|
||||
}),
|
||||
customStyle: true,
|
||||
autoCancel: true
|
||||
})
|
||||
|
||||
aboutToAppear(): void {
|
||||
this.getData()
|
||||
}
|
||||
|
||||
preview(url: string) {
|
||||
this.currentImage = url
|
||||
this.imagePreviewController.open()
|
||||
}
|
||||
|
||||
getData() {
|
||||
let param = router.getParams() as RouterParams
|
||||
getInspectResultDetailUsingGet({ id: param.id }).then((res => {
|
||||
@ -144,6 +175,9 @@ struct Detail {
|
||||
.width("100%")
|
||||
.height("100%")
|
||||
.objectFit(ImageFit.Fill)
|
||||
.onClick(() => {
|
||||
this.preview(this.vin)
|
||||
})
|
||||
Text("车辆识别代号照片").label()
|
||||
}.margin({ right: 6 }).layoutWeight(1)
|
||||
|
||||
@ -189,6 +223,9 @@ struct Detail {
|
||||
.width("100%")
|
||||
.height("100%")
|
||||
.objectFit(ImageFit.Fill)
|
||||
.onClick(() => {
|
||||
this.preview(this.leftForward)
|
||||
})
|
||||
Text("左前45度照片").label()
|
||||
}.margin({ right: 6 }).layoutWeight(1).height("100%")
|
||||
|
||||
@ -273,6 +310,9 @@ struct Detail {
|
||||
.width("100%")
|
||||
.height("100%")
|
||||
.objectFit(ImageFit.Fill)
|
||||
.onClick(() => {
|
||||
this.preview(this.rightBackward)
|
||||
})
|
||||
Text("右后45度照片").label()
|
||||
}.margin({ left: 6 }).layoutWeight(1).height("100%")
|
||||
}.margin({ right: 6 }).layoutWeight(1)
|
||||
@ -352,6 +392,9 @@ struct Detail {
|
||||
.width("100%")
|
||||
.height("100%")
|
||||
.objectFit(ImageFit.Fill)
|
||||
.onClick(() => {
|
||||
this.preview(this.plate)
|
||||
})
|
||||
Text("车辆铭牌照片").label()
|
||||
}.margin({ right: 6 }).layoutWeight(1)
|
||||
|
||||
|
||||
@ -45,7 +45,10 @@ export class WebsocketClient {
|
||||
} else {
|
||||
Logger.info(Tag, "receive", message)
|
||||
this.messageCallback.forEach(cb => {
|
||||
cb(this.deal ? this.deal(message) : message)
|
||||
let result: string = this.deal ? this.deal(message) : message
|
||||
if (result) {
|
||||
cb(result)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user