Merge branch 'api10' of http://88.22.24.105:3000/harmony_car/subject-two into api10
This commit is contained in:
commit
524eecb149
@ -2,6 +2,7 @@ import router from '@ohos.router';
|
|||||||
import RealTime from '../compontents/judge/RealTime';
|
import RealTime from '../compontents/judge/RealTime';
|
||||||
import { GPSData, SignalData } from '../../mock';
|
import { GPSData, SignalData } from '../../mock';
|
||||||
import { SignalDataType } from '../../model';
|
import { SignalDataType } from '../../model';
|
||||||
|
import { ObtainSignalData } from '../../utils/business/ObtainSignalData';
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
export default struct SignDisplayCom {
|
export default struct SignDisplayCom {
|
||||||
@ -332,12 +333,12 @@ export default struct SignDisplayCom {
|
|||||||
|
|
||||||
if (showBack) {
|
if (showBack) {
|
||||||
this.ratio = 1.4
|
this.ratio = 1.4
|
||||||
globalThis.udpClient.onMessage_1 && globalThis.udpClient.onMessage_1((msg) => {
|
ObtainSignalData.getData((msg)=>{
|
||||||
console.log('getUDPonMessage_1bysignDisplay0', msg)
|
if (msg) {
|
||||||
if (msg) {
|
getSignal(msg)
|
||||||
getSignal(msg)
|
}
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
clearInterval(this.signalTimer)
|
clearInterval(this.signalTimer)
|
||||||
this.signalTimer = setInterval(() => {
|
this.signalTimer = setInterval(() => {
|
||||||
@ -351,16 +352,14 @@ export default struct SignDisplayCom {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onPageShow() {
|
onPageShow() {
|
||||||
console.info('SURENJUN', 123)
|
|
||||||
|
|
||||||
const getSignal = this.getSignal;
|
const getSignal = this.getSignal;
|
||||||
const that = this
|
const that = this
|
||||||
const showBack = this.showBack;
|
const showBack = this.showBack;
|
||||||
if (showBack) {
|
if (showBack) {
|
||||||
globalThis.udpClient.onMessage_1 && globalThis.udpClient.onMessage_1((msg) => {
|
ObtainSignalData.getData((msg)=>{
|
||||||
console.log('getUDPonMessage_1bysignDisplay2', msg)
|
if (msg) {
|
||||||
|
getSignal(msg)
|
||||||
getSignal(msg)
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
clearInterval(this.signalTimer)
|
clearInterval(this.signalTimer)
|
||||||
|
|||||||
@ -2,21 +2,20 @@ import router from '@ohos.router';
|
|||||||
|
|
||||||
@CustomDialog
|
@CustomDialog
|
||||||
export default struct errorMsgDialog {
|
export default struct errorMsgDialog {
|
||||||
dialogRatio: number = 0.8
|
|
||||||
title?: string
|
|
||||||
type: string //1 tip 2loading 3Dialog
|
|
||||||
@State angle: number = 0
|
|
||||||
@State ratio: number = 1700 / 960
|
|
||||||
private controller?: CustomDialogController
|
private controller?: CustomDialogController
|
||||||
cancel: () => void = () => {
|
cancel: () => void = () => {
|
||||||
}
|
}
|
||||||
confirm: () => void = () => {
|
confirm: () => void = () => {
|
||||||
}
|
}
|
||||||
|
dialogRatio: number = 0.8
|
||||||
|
title?: string
|
||||||
|
type: string //1 tip 2loading 3Dialog
|
||||||
|
@State angle: number = 0
|
||||||
|
|
||||||
@Styles
|
@Styles
|
||||||
commStyle(){
|
commStyle(){
|
||||||
.width(220 * this.ratio * this.dialogRatio * 0.6)
|
.width(220 * globalThis.ratio * this.dialogRatio * 0.6)
|
||||||
.height(69 * this.ratio * this.dialogRatio * 0.6)
|
.height(69 * globalThis.ratio * this.dialogRatio * 0.6)
|
||||||
.backgroundImage($r('app.media.button_nor'))
|
.backgroundImage($r('app.media.button_nor'))
|
||||||
.backgroundImageSize({ width: '100%', height: '100%' })
|
.backgroundImageSize({ width: '100%', height: '100%' })
|
||||||
// .margin({ bottom: 12 * this.ratio })
|
// .margin({ bottom: 12 * this.ratio })
|
||||||
@ -47,14 +46,14 @@ export default struct errorMsgDialog {
|
|||||||
Row() {
|
Row() {
|
||||||
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||||
Text(' 取 消 ')
|
Text(' 取 消 ')
|
||||||
.fontSize(24 * this.ratio * this.dialogRatio * 0.6)
|
.fontSize(24 * globalThis.ratio * this.dialogRatio * 0.6)
|
||||||
.fontColor('#fff')
|
.fontColor('#fff')
|
||||||
.width(60 * this.ratio * this.dialogRatio)
|
.width(60 * globalThis.ratio * this.dialogRatio)
|
||||||
}
|
}
|
||||||
.commStyle()
|
.commStyle()
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
if (this.controller != undefined) {
|
if (this.controller != undefined) {
|
||||||
const errorCode: number = AppStorage.get('errorMsg');
|
const errorCode = AppStorage.Get('errorMsg');
|
||||||
// const errorCodeFlage=AppStorage.Get('errorCodeFlage');
|
// const errorCodeFlage=AppStorage.Get('errorCodeFlage');
|
||||||
// console.log('errorCode',errorCode,errorCodeFlage)
|
// console.log('errorCode',errorCode,errorCodeFlage)
|
||||||
if (errorCode == 0) {
|
if (errorCode == 0) {
|
||||||
@ -67,18 +66,18 @@ export default struct errorMsgDialog {
|
|||||||
this.cancel()
|
this.cancel()
|
||||||
this.controller.close()
|
this.controller.close()
|
||||||
}
|
}
|
||||||
}).margin({ right: 10 * this.ratio * this.dialogRatio })
|
}).margin({ right: 10 * globalThis.ratio * this.dialogRatio })
|
||||||
|
|
||||||
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||||
Text(' 确 定 ')
|
Text(' 确 定 ')
|
||||||
.fontSize(24 * this.ratio * this.dialogRatio * 0.6)
|
.fontSize(24 * globalThis.ratio * this.dialogRatio * 0.6)
|
||||||
.fontColor('#fff')
|
.fontColor('#fff')
|
||||||
.width(60 * this.ratio * this.dialogRatio)
|
.width(60 * globalThis.ratio * this.dialogRatio)
|
||||||
}
|
}
|
||||||
.commStyle()
|
.commStyle()
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
const errorCode: number = AppStorage.get('errorCode');
|
const errorCode = AppStorage.Get('errorCode');
|
||||||
const errorCodeFlage: string = AppStorage.get('errorCodeFlage');
|
const errorCodeFlage = AppStorage.Get('errorCodeFlage');
|
||||||
console.log('errorCode', errorCode, errorCodeFlage)
|
console.log('errorCode', errorCode, errorCodeFlage)
|
||||||
if (errorCode == 0 && errorCodeFlage) {
|
if (errorCode == 0 && errorCodeFlage) {
|
||||||
router.replaceUrl({
|
router.replaceUrl({
|
||||||
@ -100,15 +99,42 @@ export default struct errorMsgDialog {
|
|||||||
|
|
||||||
.padding({ bottom: 20 })
|
.padding({ bottom: 20 })
|
||||||
}
|
}
|
||||||
|
if (this.type == '4') {
|
||||||
|
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||||
|
Text(' 确 定 ')
|
||||||
|
.fontSize(24 * globalThis.ratio * this.dialogRatio * 0.6)
|
||||||
|
.fontColor('#fff')
|
||||||
|
.width(60 * globalThis.ratio * this.dialogRatio)
|
||||||
|
}
|
||||||
|
.commStyle()
|
||||||
|
.onClick(() => {
|
||||||
|
const errorCode = AppStorage.Get('errorCode');
|
||||||
|
const errorCodeFlage = AppStorage.Get('errorCodeFlage');
|
||||||
|
console.log('errorCode', errorCode, errorCodeFlage)
|
||||||
|
if (errorCode == 0 && errorCodeFlage) {
|
||||||
|
router.replaceUrl({
|
||||||
|
url: 'pages/Index',
|
||||||
|
}, router.RouterMode.Single);
|
||||||
|
router.clear();
|
||||||
|
|
||||||
|
}
|
||||||
|
console.log('errorCode', errorCode, errorCodeFlage)
|
||||||
|
|
||||||
|
if (this.controller != undefined) {
|
||||||
|
this.confirm()
|
||||||
|
this.controller.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.backgroundColor('#E6E3DF')
|
.backgroundColor('#E6E3DF')
|
||||||
.borderRadius(19 * this.ratio)
|
.borderRadius(19 * globalThis.ratio)
|
||||||
.constraintSize({ minWidth: 520 })
|
.constraintSize({ minWidth: 520 })
|
||||||
}
|
}
|
||||||
|
|
||||||
aboutToAppear() {
|
aboutToAppear() {
|
||||||
AppStorage.SetOrCreate('errorMsg', 0);
|
AppStorage.SetOrCreate('errorMsg', 0);
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
console.log('this.type', this.type, this.angle)
|
console.log('this.type', this.type, this.angle)
|
||||||
if (this.type == '2') {
|
if (this.type == '2') {
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"meta": {
|
"meta": {
|
||||||
"stableOrder": true
|
"stableOrder": true
|
||||||
},
|
},
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 1,
|
||||||
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
|
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
|
||||||
"specifiers": {
|
"specifiers": {
|
||||||
"@ohos/crypto-js@2.0.3": "@ohos/crypto-js@2.0.3",
|
"@ohos/crypto-js@2.0.3": "@ohos/crypto-js@2.0.3",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user