From c1f27d8d5a64c928324307e7ff86b8ec5985d892 Mon Sep 17 00:00:00 2001 From: lvyuankang <1344032923@qq.com> Date: Wed, 1 Jan 2025 16:18:52 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/common/utils/request.ts | 1 + entry/src/main/ets/pages/UserInfo.ets | 43 +++++++++++++++---- .../main/ets/pages/compontents/imageBtn.ets | 4 +- 3 files changed, 37 insertions(+), 11 deletions(-) diff --git a/entry/src/main/ets/common/utils/request.ts b/entry/src/main/ets/common/utils/request.ts index 60ae9c7b..489b2745 100644 --- a/entry/src/main/ets/common/utils/request.ts +++ b/entry/src/main/ets/common/utils/request.ts @@ -96,6 +96,7 @@ export default async function request(req: any) { } catch (e) { console.info('test-error' + url + ' error:resp: '+ JSON.stringify(e)) if(!e||!(e?.message)){ + httpRequest.destroy(); return {code:-1} } const code = e?.code; diff --git a/entry/src/main/ets/pages/UserInfo.ets b/entry/src/main/ets/pages/UserInfo.ets index 650fe585..07c9ca69 100644 --- a/entry/src/main/ets/pages/UserInfo.ets +++ b/entry/src/main/ets/pages/UserInfo.ets @@ -25,6 +25,8 @@ import { initJudgeUdp } from '../common/utils/UdpJudge'; import errorMsgDialog from './compontents/errorMsgDialog' import { delPic } from '../common/service/videoService'; import { getCurrentHourTime } from '../common/utils/tools'; +import imageBtn from './compontents/imageBtn' + @Entry @Component struct UserInfo { @@ -88,6 +90,7 @@ struct UserInfo { 'Param828Str':'0',//828考生待考界面,安全员显示考试员 'Param830Str':'0',//同一学员连续第二次考试时不再验证身份 'Param364':'0',//考前上车准备 + 'Param398':'0',//考前上车准备 } private title = '' private type = '2' @@ -447,6 +450,7 @@ struct UserInfo { //398参数为1 第二场考试上车准备不考 if(sys.v_no === '398' && decodeURIComponent(sys.v_value) == '1' && this.currentUser.kssycs == '1'){ + that.systemParam.Param398=decodeURIComponent(sys.v_value) that.isBoardPrePareSetPopupOpen = false; } @@ -567,6 +571,11 @@ struct UserInfo { if (globalThis.singlePlay || this.updateTimeLimit) { return } + + // this.isBoardPrePareSetPopupOpen=true + this.isFirstBoardPrePareSetPopupBtnShow=false + console.log('isFirstBoardPrePareSetPopupBtnShow',this.isFirstBoardPrePareSetPopupBtnShow,this.isBoardPrePareSetPopupOpen) + this.startExam=false await upDateTableByArray('USER', []) await upDateTableByArray('USERLIST', []) this.type = '2' @@ -639,7 +648,15 @@ struct UserInfo { this.lsh = this.currentUser.lsh globalThis.lsh = this.lsh globalThis.ksyh = this.currentUser.ksy1sfzmhm + //364 绕车一周评判时机(1-开始考试后判 2-开始考试前判) + if (this.systemParam.Param364 == '2') { + this.isBoardPrePareSetPopupOpen = true; + } + //398参数为1 第二场考试上车准备不考 + if(this.systemParam.Param398 == '1' && this.currentUser.kssycs == '1'){ + this.isBoardPrePareSetPopupOpen = false; + } this.pageIndex = 0 getSyncData('USER').then(data => { if (data?.[0]) { @@ -1104,10 +1121,13 @@ struct UserInfo { .margin({ left: 53 * this.ratio }) Column() { - Image($r('app.media.yydj_btn')) - .commStyle() - Image($r('app.media.gx_btn')) - .commStyle() + // Image($r('app.media.yydj_btn')) + // .commStyle() + imageBtn({btnWidth:220 * this.ratio,btnHeight:69 * this.ratio,imgSrc:$r('app.media.yydj_btn')}).margin({ bottom: 12 * this.ratio }) + + // Image($r('app.media.gx_btn')) + // .commStyle() + imageBtn({btnWidth:220 * this.ratio,btnHeight:69 * this.ratio,imgSrc:$r('app.media.gx_btn')}).margin({ bottom: 12 * this.ratio }) .onClick(() => { // this.avPlayer.playAudio(['button_media.wav']) if (this.isExamStart && !globalThis.singlePlay) { @@ -1117,8 +1137,9 @@ struct UserInfo { this.numCount = 0 this.getExaminationStudentInfoFn() }) - Image($r('app.media.qk_btn')) - .commStyle() + // Image($r('app.media.qk_btn')) + // .commStyle() + imageBtn({btnWidth:220 * this.ratio,btnHeight:69 * this.ratio,imgSrc:$r('app.media.qk_btn')}).margin({ bottom: 12 * this.ratio }) .onClick(() => { // this.avPlayer.playAudio(['button_media.wav']) // 已开始考试不能缺考 已考过一次学员不能缺考 车上不能缺考 @@ -1131,15 +1152,18 @@ struct UserInfo { if (this.isBoardPrePareSetPopupOpen && !this.isFirstBoardPrePareSetPopupBtnShow) { //上车准备 - Image($r('app.media.sczb_btn')).commStyle().onClick(async () => { + // Image($r('app.media.sczb_btn')).commStyle() + imageBtn({btnWidth:220 * this.ratio,btnHeight:69 * this.ratio,imgSrc:$r('app.media.sczb_btn')}).margin({ bottom: 12 * this.ratio }) + .onClick(async () => { if(this.systemParam.Param612Str=='1'){ return } await this.prePareSCZB() }) } else { - Image($r('app.media.ksks_btn')) - .commStyle() + // Image($r('app.media.ksks_btn')) + // .commStyle() + imageBtn({btnWidth:220 * this.ratio,btnHeight:69 * this.ratio,imgSrc:$r('app.media.ksks_btn')}).margin({ bottom: 12 * this.ratio }) .onClick(async () => { if(this.systemParam.Param612Str=='1'){ return @@ -1298,4 +1322,5 @@ type systemParam={ 'Param770Str':string,//车上没有缺考功能 'Param830Str':string,//同一学员连续第二次考试时不再验证身份 'Param364':string,//考前上车准备 + 'Param398':string,//考前上车准备 } \ No newline at end of file diff --git a/entry/src/main/ets/pages/compontents/imageBtn.ets b/entry/src/main/ets/pages/compontents/imageBtn.ets index adb4eb9e..883a11cb 100644 --- a/entry/src/main/ets/pages/compontents/imageBtn.ets +++ b/entry/src/main/ets/pages/compontents/imageBtn.ets @@ -2,8 +2,8 @@ export default struct imageBtn { //状态变量unPressed,用于控制按钮的状态 @State unPressed: boolean = true - btnWidth: string - btnHeight: string + btnWidth: string | number + btnHeight: string | number imgSrc:Resource opacityNum:number=1 @Styles customStyle(){