Compare commits

...

2 Commits

Author SHA1 Message Date
2f4eadea15 Merge pull request 'carchekc和dialog' (#53) from lv_chengmai into main
Reviewed-on: #53
2024-08-12 09:26:33 +08:00
75058b49bb carchekc和dialog 2024-08-12 09:28:12 +08:00
2 changed files with 35 additions and 19 deletions

View File

@ -47,7 +47,8 @@ export default struct Index {
if (status == 'idle') {
if (val == 'kszj.wav') {
console.log('finsh')
this.getCheckList()
this.initfackCheck(0)
// this.getCheckList(true)
} else {
this.subFlag = false
this.getNextNode()
@ -283,11 +284,24 @@ export default struct Index {
}
}, parseInt(this.checkListCopy[0].time) * 1000)
}
initfackCheck(index){
const that=this
setTimeout(()=>{
console.log('indexindex',index)
if(index>=3){
this.getCheckList()
return
}
that.passArray[index]=true
that.warnFlag[index]='2'
that.passArray=JSON.parse(JSON.stringify(that.passArray))
that.warnFlag=JSON.parse(JSON.stringify(that.warnFlag))
index++
this.initfackCheck(index)
},1000)
getCheckList() {
if (!this.breakFlag) {
return
}
}
async getCheckList() {
this.index = this.checkListCopy[0].key
this.passArray[this.index] = true
this.passArray = JSON.parse(JSON.stringify(this.passArray))
@ -333,7 +347,7 @@ export default struct Index {
Image(this.passArray[0] ? (this.warnFlag[0] == '0' ? $r('app.media.cheliangmoxing') : (this.warnFlag[0] == '1' ? $r('app.media.cheliangmoxing_r') : $r('app.media.cheliangmoxing_g'))) : $r('app.media.cheliangmoxing'))
.width(138.5 * this.ratio)
.height(112.5 * this.ratio)
Image(this.passArray[1] ? (this.warnFlag[1] == '0' ? $r('app.media.weixingxinhao') : (this.warnFlag[1] == '1' ? $r('app.media.weixingxinhao_r') : $r('app.media.weixingxinhao_g'))) : $r('app.media.weixingxinhao'))
Image(this.passArray[0] ? (this.warnFlag[1] == '0' ? $r('app.media.weixingxinhao') : (this.warnFlag[1] == '1' ? $r('app.media.weixingxinhao_r') : $r('app.media.weixingxinhao_g'))) : $r('app.media.weixingxinhao'))
.width(138.5 * this.ratio)
.height(112.5 * this.ratio)
Image(this.passArray[2] ? (this.warnFlag[2] == '0' ? $r('app.media.shipinjiankong') : (this.warnFlag[2] == '1' ? $r('app.media.shipingjiankong_r') : $r('app.media.shipinjiankong_g'))) : $r('app.media.shipinjiankong'))

View File

@ -28,6 +28,7 @@ struct Index {
@State isSingle: boolean = false;
@State deviceId: string = '';
@State angle: number = 0
@State dialogRatio: number = 0.8
@State ratio: number = 1700 / 960
@State loading: boolean = true
@State fd: number = -1;
@ -41,11 +42,11 @@ struct Index {
@Styles
commStyle(){
.width(220 * this.ratio)
.height(69 * this.ratio)
.width(220 * this.ratio*this.dialogRatio)
.height(69 * this.ratio*this.dialogRatio)
.backgroundImage($r('app.media.button_nor'))
.backgroundImageSize({ width: '100%', height: '100%' })
.margin({ bottom: 12 * this.ratio })
.margin({ bottom: 12 * this.ratio})
}
build() {
@ -185,32 +186,33 @@ struct Index {
if (this.dialogVisiable) {
Flex({justifyContent:FlexAlign.Center}) {
Text('确认是否退出应用')
.fontSize(28 * this.ratio)
.margin({top:100*this.ratio})
.fontSize(28 * this.ratio*this.dialogRatio)
.margin({top:100*this.ratio*this.dialogRatio})
Row() {
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Text(' 取 消 ').fontSize(24 * this.ratio).fontColor('#fff').width(100 * this.ratio)
Text(' 取 消 ').fontSize(24 * this.ratio*this.dialogRatio).fontColor('#fff').width(100 * this.ratio*this.dialogRatio)
}
.commStyle()
.onClick(() => {
this.dialogVisiable = false
})
}).margin({right:10*this.ratio})
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Text(' 确 定 ').fontSize(24 * this.ratio).fontColor('#fff').width(100 * this.ratio)
Text(' 确 定 ').fontSize(24 * this.ratio*this.dialogRatio).fontColor('#fff').width(100 * this.ratio*this.dialogRatio)
}
.commStyle()
.onClick(() => {
router.back()
})
}.position({ y: 265 * this.ratio, x: 115 * this.ratio })
}.position({ y: 265 * this.ratio*this.dialogRatio, x: 115 * this.ratio*this.dialogRatio })
}
.width(660 * this.ratio)
.height(360 * this.ratio)
.position({ x: 150 * this.ratio, y: 98 * this.ratio })
.width(660 * this.ratio*this.dialogRatio)
.height(360 * this.ratio*this.dialogRatio)
.position({ x: 220 * this.ratio, y: 98 * this.ratio-265/2*(1-this.ratio*this.dialogRatio) })
.backgroundColor('#E6E3DF')
.borderRadius(19 * this.ratio)
//
.borderRadius(19 * this.ratio*this.dialogRatio)
}
if (this.loading) {
Column() {