|
@@ -0,0 +1,152 @@
|
|
|
|
+// 确认框
|
|
|
|
+import Want from '@ohos.app.ability.Want';
|
|
|
|
+import common from '@ohos.app.ability.common';
|
|
|
|
+@CustomDialog
|
|
|
|
+export struct ModifyMaterialNumDialog {
|
|
|
|
+ context = getContext(this) as common.UIAbilityContext;
|
|
|
|
+ @Prop currentMaterialName :string = ''
|
|
|
|
+ @Prop currentMaterialNo :string = ''
|
|
|
|
+ @Prop currentBatchNo :string = ''
|
|
|
|
+ @Prop currentUnit :string = ''
|
|
|
|
+ @Link materialNum :number
|
|
|
|
+ @State addClick:number = 1
|
|
|
|
+ @State subClick:number = 1
|
|
|
|
+ controller: CustomDialogController
|
|
|
|
+ onConfirm: () => void = () => {}
|
|
|
|
+ build() {
|
|
|
|
+ Column() {
|
|
|
|
+ // 标题
|
|
|
|
+ Column(){
|
|
|
|
+ Text("数量")
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_30'))
|
|
|
|
+ }.height('25%')
|
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
|
+ Column(){
|
|
|
|
+ Text(`物料名称:${this.currentMaterialName}`)
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_16'))
|
|
|
|
+ .fontWeight(FontWeight.Lighter)
|
|
|
|
+ Text(`型号:${this.currentMaterialNo}`)
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_16'))
|
|
|
|
+ .fontWeight(FontWeight.Lighter)
|
|
|
|
+ Text(`批次号:${this.currentBatchNo}`)
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_16'))
|
|
|
|
+ .fontWeight(FontWeight.Lighter)
|
|
|
|
+ Text(`数量(${this.currentUnit})`)
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_16'))
|
|
|
|
+ .margin({top:'4%',bottom:"2%",left:'2%'})
|
|
|
|
+ Row(){
|
|
|
|
+ Row() {
|
|
|
|
+ Button({ type: ButtonType.Normal }) {
|
|
|
|
+ Image($r('app.media.process_material_subtraction'))
|
|
|
|
+ .width('50%')
|
|
|
|
+ .height('50%')
|
|
|
|
+ .objectFit(ImageFit.Contain)
|
|
|
|
+ .fillColor($r('app.color.FFFFFF'))
|
|
|
|
+ }
|
|
|
|
+ .width('100%')
|
|
|
|
+ .height('100%')
|
|
|
|
+ .backgroundColor($r('app.color.20FFFFFF'))
|
|
|
|
+ .borderRadius($r('app.float.virtualSize_16'))
|
|
|
|
+ .scale({ x: this.addClick, y: this.addClick })
|
|
|
|
+ .animation({
|
|
|
|
+ duration: 200,
|
|
|
|
+ curve: Curve.Linear
|
|
|
|
+ })
|
|
|
|
+ .onClick(() => {
|
|
|
|
+ this.addClick = 0.9;
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.addClick = 1;
|
|
|
|
+ this.materialNum--
|
|
|
|
+ }, 200);
|
|
|
|
+ })
|
|
|
|
+ }.width('22%')
|
|
|
|
+ Row(){
|
|
|
|
+ Text(String(this.materialNum))
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_38'))
|
|
|
|
+ }
|
|
|
|
+ .width('56%')
|
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
|
+ Row() {
|
|
|
|
+ Button({ type: ButtonType.Normal }) {
|
|
|
|
+ Image($r('app.media.process_material_add'))
|
|
|
|
+ .width('50%')
|
|
|
|
+ .height('50%')
|
|
|
|
+ .objectFit(ImageFit.Contain)
|
|
|
|
+ .fillColor($r('app.color.FFFFFF'))
|
|
|
|
+ .borderRadius($r('app.float.virtualSize_16'))
|
|
|
|
+ }
|
|
|
|
+ .width('100%')
|
|
|
|
+ .height('100%')
|
|
|
|
+ .backgroundColor($r('app.color.20FFFFFF'))
|
|
|
|
+ .borderRadius($r('app.float.virtualSize_16'))
|
|
|
|
+ .scale({ x: this.subClick, y: this.subClick })
|
|
|
|
+ .animation({
|
|
|
|
+ duration: 200,
|
|
|
|
+ curve: Curve.Linear
|
|
|
|
+ })
|
|
|
|
+ .onClick(() => {
|
|
|
|
+ this.subClick = 0.9;
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.subClick = 1;
|
|
|
|
+ this.materialNum++
|
|
|
|
+ }, 200);
|
|
|
|
+ })
|
|
|
|
+ }.width('22%')
|
|
|
|
+ }
|
|
|
|
+ .height('22%')
|
|
|
|
+ .width('100%')
|
|
|
|
+ .backgroundColor($r('app.color.10FFFFFF'))
|
|
|
|
+ .borderRadius($r('app.float.virtualSize_16'))
|
|
|
|
+ }
|
|
|
|
+ .width('60%')
|
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
|
+ .alignItems(HorizontalAlign.Start)
|
|
|
|
+ .margin({bottom:"10%"})
|
|
|
|
+
|
|
|
|
+ Column(){
|
|
|
|
+ Divider()
|
|
|
|
+ .vertical(false)
|
|
|
|
+ .strokeWidth(1)
|
|
|
|
+ .color($r('app.color.15FFFFFF'))
|
|
|
|
+ Row(){
|
|
|
|
+ Row(){
|
|
|
|
+ Text('取消')
|
|
|
|
+ .fontColor($r('app.color.60FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_30'))
|
|
|
|
+ }
|
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
|
+ .width('50%')
|
|
|
|
+ .onClick(() => this.controller.close())
|
|
|
|
+ Divider()
|
|
|
|
+ .vertical(true)
|
|
|
|
+ .strokeWidth(1)
|
|
|
|
+ .color($r('app.color.15FFFFFF'))
|
|
|
|
+ Row(){
|
|
|
|
+ Text('确认')
|
|
|
|
+ .fontColor($r('app.color.007AFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_30'))
|
|
|
|
+ }
|
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
|
+ .width('50%')
|
|
|
|
+ .onClick(() => {
|
|
|
|
+ this.onConfirm();
|
|
|
|
+ this.controller.close();
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .width('100%')
|
|
|
|
+ .height('16%')
|
|
|
|
+ }
|
|
|
|
+ .height('34%')
|
|
|
|
+ .width('30%')
|
|
|
|
+ .backgroundColor($r('app.color.2A2A2A'))
|
|
|
|
+ .justifyContent(FlexAlign.End)
|
|
|
|
+ .borderRadius($r('app.float.virtualSize_16'))
|
|
|
|
+ }
|
|
|
|
+}
|