lv_chengmai #23
@ -137,27 +137,30 @@ export async function getSingleCenterTable(param) {
 | 
				
			|||||||
      if (result) {
 | 
					      if (result) {
 | 
				
			||||||
        reslove(true)
 | 
					        reslove(true)
 | 
				
			||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
        promptAction.showDialog({
 | 
					        // promptAction.showToast({
 | 
				
			||||||
          title: '提示',
 | 
					        //   title: '提示',
 | 
				
			||||||
          message: '联网更新失败,请检查网络后重新更新',
 | 
					        //   message: '联网更新失败,请检查网络后重新更新',
 | 
				
			||||||
          buttons: [
 | 
					        //   buttons: [
 | 
				
			||||||
            {
 | 
					        //     {
 | 
				
			||||||
              text: '确认',
 | 
					        //       text: '确认',
 | 
				
			||||||
              color: '#000000',
 | 
					        //       color: '#000000',
 | 
				
			||||||
            },
 | 
					        //     },
 | 
				
			||||||
            {
 | 
					        //     {
 | 
				
			||||||
              text: '取消',
 | 
					        //       text: '取消',
 | 
				
			||||||
              color: '#000000',
 | 
					        //       color: '#000000',
 | 
				
			||||||
            }
 | 
					        //     }
 | 
				
			||||||
          ],
 | 
					        //   ],
 | 
				
			||||||
        })
 | 
					        // })
 | 
				
			||||||
          .then(data => {
 | 
					        //   .then(data => {
 | 
				
			||||||
            reslove(false)
 | 
					        //     reslove(false)
 | 
				
			||||||
          })
 | 
					        //   })
 | 
				
			||||||
          .catch(err => {
 | 
					        //   .catch(err => {
 | 
				
			||||||
            reslove(false)
 | 
					        //     reslove(false)
 | 
				
			||||||
          })
 | 
					        //   })
 | 
				
			||||||
 | 
					        promptAction.showToast({
 | 
				
			||||||
 | 
					          message: `联网更新失败,请检查网络后重新更新`,
 | 
				
			||||||
 | 
					          duration: 3000
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
        reslove(false)
 | 
					        reslove(false)
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }).catch((error) => {
 | 
					    }).catch((error) => {
 | 
				
			||||||
 | 
				
			|||||||
@ -6,7 +6,7 @@ export async function getTCP() {
 | 
				
			|||||||
  getSyncData('IpConfigTable').then(async (result:Array<any>)=>{
 | 
					  getSyncData('IpConfigTable').then(async (result:Array<any>)=>{
 | 
				
			||||||
    console.log('result222',JSON.stringify(result))
 | 
					    console.log('result222',JSON.stringify(result))
 | 
				
			||||||
    if(result.length){
 | 
					    if(result.length){
 | 
				
			||||||
      if(globalThis.TcpClient&&globalThis.TcpClient.closeTcp){
 | 
					      if(globalThis.TcpClient&&globalThis.getCloseTcp){
 | 
				
			||||||
        globalThis.TcpClient.closeTcp(async ()=>{
 | 
					        globalThis.TcpClient.closeTcp(async ()=>{
 | 
				
			||||||
          // const tcpClient: TcpClient =new TcpClient(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort)
 | 
					          // const tcpClient: TcpClient =new TcpClient(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort)
 | 
				
			||||||
          // globalThis.TcpClient = tcpClient
 | 
					          // globalThis.TcpClient = tcpClient
 | 
				
			||||||
 | 
				
			|||||||
@ -42,7 +42,7 @@ export async function getUDP() {
 | 
				
			|||||||
export async function getUDP2() {
 | 
					export async function getUDP2() {
 | 
				
			||||||
  getSyncData('IpConfigTable').then(async (result:Array<any>)=>{
 | 
					  getSyncData('IpConfigTable').then(async (result:Array<any>)=>{
 | 
				
			||||||
    if(result.length){
 | 
					    if(result.length){
 | 
				
			||||||
      if(globalThis.udpClient2&&globalThis.udpClient2.closeUdp){
 | 
					      if(globalThis.udpClient2&&globalThis.closeHeartSocket){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        globalThis.udpClient2.closeUdp(async ()=>{
 | 
					        globalThis.udpClient2.closeUdp(async ()=>{
 | 
				
			||||||
          setTimeout(()=>{
 | 
					          setTimeout(()=>{
 | 
				
			||||||
 | 
				
			|||||||
@ -39,11 +39,12 @@ export default class TcpClient {
 | 
				
			|||||||
            console.log(TAG,'tcpreBind', this.localIp,this.localIpPort)
 | 
					            console.log(TAG,'tcpreBind', this.localIp,this.localIpPort)
 | 
				
			||||||
            let promise=this.tcp.bind({ address:  this.localIp, port:parseInt(this.localIpPort), family: 1 }, err => {
 | 
					            let promise=this.tcp.bind({ address:  this.localIp, port:parseInt(this.localIpPort), family: 1 }, err => {
 | 
				
			||||||
                if (err) {
 | 
					                if (err) {
 | 
				
			||||||
 | 
					                    globalThis.getCloseTcp=true
 | 
				
			||||||
                    hilog.info(0x0000, 'testTag', "tcpreBinderror:" + JSON.stringify(err));
 | 
					                    hilog.info(0x0000, 'testTag', "tcpreBinderror:" + JSON.stringify(err));
 | 
				
			||||||
                    resolve(true)
 | 
					                    resolve(true)
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                console.log('testTag,rebindtestTag tcp bind success');
 | 
					                console.log('testTag,rebindtestTag tcp bind success');
 | 
				
			||||||
 | 
					                globalThis.getCloseTcp=false
 | 
				
			||||||
                resolve(false)
 | 
					                resolve(false)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            })
 | 
					            })
 | 
				
			||||||
@ -62,11 +63,12 @@ export default class TcpClient {
 | 
				
			|||||||
            let promise=this.tcp.bind({ address:  this.localIp, port:parseInt(this.localIpPort), family: 1 }, err => {
 | 
					            let promise=this.tcp.bind({ address:  this.localIp, port:parseInt(this.localIpPort), family: 1 }, err => {
 | 
				
			||||||
                if (err) {
 | 
					                if (err) {
 | 
				
			||||||
                    console.log('testTag tcp bind faile');
 | 
					                    console.log('testTag tcp bind faile');
 | 
				
			||||||
 | 
					                    globalThis.getCloseTcp=true
 | 
				
			||||||
                    hilog.info(0x0000, 'testTag', "tcpBinderror:" + JSON.stringify(err));
 | 
					                    hilog.info(0x0000, 'testTag', "tcpBinderror:" + JSON.stringify(err));
 | 
				
			||||||
                    resolve(true)
 | 
					                    resolve(true)
 | 
				
			||||||
                    return
 | 
					                    return
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					                globalThis.getCloseTcp=false
 | 
				
			||||||
                console.log('testTag tcp bind success');
 | 
					                console.log('testTag tcp bind success');
 | 
				
			||||||
                resolve(false)
 | 
					                resolve(false)
 | 
				
			||||||
            })
 | 
					            })
 | 
				
			||||||
@ -101,8 +103,11 @@ export default class TcpClient {
 | 
				
			|||||||
                        return;
 | 
					                        return;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
 | 
					                globalThis.getCloseTcp=false
 | 
				
			||||||
                resolve(true)
 | 
					                resolve(true)
 | 
				
			||||||
            }).catch(err => {
 | 
					            }).catch(err => {
 | 
				
			||||||
 | 
					                globalThis.getCloseTcp=true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                console.log('testTagconnect,error')
 | 
					                console.log('testTagconnect,error')
 | 
				
			||||||
                resolve(false)
 | 
					                resolve(false)
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
@ -153,6 +158,7 @@ export default class TcpClient {
 | 
				
			|||||||
            console.log(TAG,'tcpClose')
 | 
					            console.log(TAG,'tcpClose')
 | 
				
			||||||
            let promise = this.tcp.close();
 | 
					            let promise = this.tcp.close();
 | 
				
			||||||
            promise.then(() => {
 | 
					            promise.then(() => {
 | 
				
			||||||
 | 
					                globalThis.getCloseTcp=true
 | 
				
			||||||
                console.log(TAG,'tcpCloseSuccess')
 | 
					                console.log(TAG,'tcpCloseSuccess')
 | 
				
			||||||
                callback()
 | 
					                callback()
 | 
				
			||||||
                reslove(true)
 | 
					                reslove(true)
 | 
				
			||||||
@ -161,7 +167,5 @@ export default class TcpClient {
 | 
				
			|||||||
                reslove(false)
 | 
					                reslove(false)
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -57,7 +57,7 @@ export default class UdpClient {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
      console.log(`${TAG},udpCLient udp rebind success`);
 | 
					      console.log(`${TAG},udpCLient udp rebind success`);
 | 
				
			||||||
    }).catch(err => {
 | 
					    }).catch(err => {
 | 
				
			||||||
 | 
					      globalThis.closeUDPSocket=true
 | 
				
			||||||
      console.log(`${TAG},udpCLient udp rebind failed:${JSON.stringify(err)}`);
 | 
					      console.log(`${TAG},udpCLient udp rebind failed:${JSON.stringify(err)}`);
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@ -73,7 +73,7 @@ export default class UdpClient {
 | 
				
			|||||||
      globalThis.closeUDPSocket=false
 | 
					      globalThis.closeUDPSocket=false
 | 
				
			||||||
      console.log(`${TAG}udpCLient udp bind success`);
 | 
					      console.log(`${TAG}udpCLient udp bind success`);
 | 
				
			||||||
    }).catch(err => {
 | 
					    }).catch(err => {
 | 
				
			||||||
 | 
					      globalThis.closeUDPSocket=true
 | 
				
			||||||
      console.log(`${TAG}udpCLient udp bind failed:${JSON.stringify(err)}`);
 | 
					      console.log(`${TAG}udpCLient udp bind failed:${JSON.stringify(err)}`);
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@ -82,7 +82,12 @@ export default class UdpClient {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
  sendMsg(msg) {
 | 
					  sendMsg(msg) {
 | 
				
			||||||
    console.log(TAG,'UdpSend1111',this.oppositeIp,this.oppositeIpPort)
 | 
					    console.log(TAG,'UdpSend1111',this.oppositeIp,this.oppositeIpPort)
 | 
				
			||||||
 | 
					    this.udp.getState((err, data) => {
 | 
				
			||||||
 | 
					      if (err) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        console.log('getState fail');
 | 
				
			||||||
 | 
					        return;
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
        let promise = this.udp.send({
 | 
					        let promise = this.udp.send({
 | 
				
			||||||
          data: msg,
 | 
					          data: msg,
 | 
				
			||||||
          address: {
 | 
					          address: {
 | 
				
			||||||
@ -101,8 +106,13 @@ export default class UdpClient {
 | 
				
			|||||||
          console.log(`${TAG}udpCLient udp send fail:oppositeIp${this.oppositeIp},oppositeIpPort:${this.oppositeIpPort},localIp:${this.localIp},localIpPort,${this.localIpPort}`);
 | 
					          console.log(`${TAG}udpCLient udp send fail:oppositeIp${this.oppositeIp},oppositeIpPort:${this.oppositeIpPort},localIp:${this.localIp},localIpPort,${this.localIpPort}`);
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					      console.log('getState success:' + JSON.stringify(data));
 | 
				
			||||||
 | 
					    })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
  onError(callback?){
 | 
					  onError(callback?){
 | 
				
			||||||
   this.udp.on('error',async err => {
 | 
					   this.udp.on('error',async err => {
 | 
				
			||||||
 | 
					     globalThis.closeUDPSocket=true
 | 
				
			||||||
     console.log(TAG,'udpError',JSON.stringify(err))
 | 
					     console.log(TAG,'udpError',JSON.stringify(err))
 | 
				
			||||||
     await this.bindUdp()
 | 
					     await this.bindUdp()
 | 
				
			||||||
     await this.sendMsg('111')
 | 
					     await this.sendMsg('111')
 | 
				
			||||||
@ -115,7 +125,6 @@ export default class UdpClient {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  onMessage(callback?) {
 | 
					  onMessage(callback?) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
    this.udp.on('message', value => {
 | 
					    this.udp.on('message', value => {
 | 
				
			||||||
      console.log(TAG,'udponmessage')
 | 
					      console.log(TAG,'udponmessage')
 | 
				
			||||||
      // 收到的是ArrayBuffer 需要进行转换解析
 | 
					      // 收到的是ArrayBuffer 需要进行转换解析
 | 
				
			||||||
@ -187,14 +196,16 @@ export default class UdpClient {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  closeUdp(callback) {
 | 
					  closeUdp(callback) {
 | 
				
			||||||
    globalThis.closeUDPSocket=true
 | 
					 | 
				
			||||||
    this.udp.close(err => {
 | 
					    this.udp.close(err => {
 | 
				
			||||||
      hilog.info(0x0000,TAG, 'udpCLient', 'close');
 | 
					      hilog.info(0x0000,TAG, 'udpCLient', 'close');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (err) {
 | 
					      if (err) {
 | 
				
			||||||
        hilog.info(0x0000,TAG, 'udpCLient', 'closeonerror');
 | 
					        hilog.info(0x0000,TAG, 'udpCLient', 'closeonerror');
 | 
				
			||||||
 | 
					        globalThis.closeUDPSocket=false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
 | 
					        globalThis.closeUDPSocket=true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.udp.getState((err, data) => {
 | 
					        this.udp.getState((err, data) => {
 | 
				
			||||||
          if (err) {
 | 
					          if (err) {
 | 
				
			||||||
            console.log('getState fail');
 | 
					            console.log('getState fail');
 | 
				
			||||||
 | 
				
			|||||||
@ -64,7 +64,7 @@ export default class UdpClientByCenter {
 | 
				
			|||||||
            globalThis.closeHeartSocket=false
 | 
					            globalThis.closeHeartSocket=false
 | 
				
			||||||
            console.log(`${TAG} udp bind success`);
 | 
					            console.log(`${TAG} udp bind success`);
 | 
				
			||||||
        }).catch(err => {
 | 
					        }).catch(err => {
 | 
				
			||||||
 | 
					            globalThis.closeHeartSocket=true
 | 
				
			||||||
            console.log(`${TAG} udp bind failed:${JSON.stringify(err)}`);
 | 
					            console.log(`${TAG} udp bind failed:${JSON.stringify(err)}`);
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -81,7 +81,7 @@ export default class UdpClientByCenter {
 | 
				
			|||||||
            globalThis.closeHeartSocket=false
 | 
					            globalThis.closeHeartSocket=false
 | 
				
			||||||
            console.log(`${TAG} udp bind success`);
 | 
					            console.log(`${TAG} udp bind success`);
 | 
				
			||||||
        }).catch(err => {
 | 
					        }).catch(err => {
 | 
				
			||||||
 | 
					            globalThis.closeHeartSocket=true
 | 
				
			||||||
            console.log(`${TAG} udp bind failed:${JSON.stringify(err)}`);
 | 
					            console.log(`${TAG} udp bind failed:${JSON.stringify(err)}`);
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -153,6 +153,7 @@ export default class UdpClientByCenter {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
    onError(callback?){
 | 
					    onError(callback?){
 | 
				
			||||||
        this.udp.on('error',async err => {
 | 
					        this.udp.on('error',async err => {
 | 
				
			||||||
 | 
					            globalThis.closeHeartSocket=true
 | 
				
			||||||
            callback&&callback()
 | 
					            callback&&callback()
 | 
				
			||||||
            // callback&&callback()
 | 
					            // callback&&callback()
 | 
				
			||||||
            // this.closeUdp(()=>{
 | 
					            // this.closeUdp(()=>{
 | 
				
			||||||
@ -164,6 +165,11 @@ export default class UdpClientByCenter {
 | 
				
			|||||||
        this.stashFn=callback?callback:()=>{}
 | 
					        this.stashFn=callback?callback:()=>{}
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    sendMsg(param,context?) {
 | 
					    sendMsg(param,context?) {
 | 
				
			||||||
 | 
					        this.udp.getState((err, data) => {
 | 
				
			||||||
 | 
					            if (err) {
 | 
				
			||||||
 | 
					                globalThis.closeHeartSocket=true
 | 
				
			||||||
 | 
					                return;
 | 
				
			||||||
 | 
					            }else{
 | 
				
			||||||
                console.log('paramparam',JSON.stringify(param))
 | 
					                console.log('paramparam',JSON.stringify(param))
 | 
				
			||||||
                if(context){
 | 
					                if(context){
 | 
				
			||||||
                    this.context=context
 | 
					                    this.context=context
 | 
				
			||||||
@ -191,6 +197,9 @@ export default class UdpClientByCenter {
 | 
				
			|||||||
                    console.log(`${TAG} udp send fail:${JSON.stringify(err)}`);
 | 
					                    console.log(`${TAG} udp send fail:${JSON.stringify(err)}`);
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    onMessage(callback,type?) {
 | 
					    onMessage(callback,type?) {
 | 
				
			||||||
        this.udp.on('message', value => {
 | 
					        this.udp.on('message', value => {
 | 
				
			||||||
            let arr=[]
 | 
					            let arr=[]
 | 
				
			||||||
@ -223,6 +232,7 @@ export default class UdpClientByCenter {
 | 
				
			|||||||
                    if (err) {
 | 
					                    if (err) {
 | 
				
			||||||
                        return;
 | 
					                        return;
 | 
				
			||||||
                    }else{
 | 
					                    }else{
 | 
				
			||||||
 | 
					                        globalThis.closeHeartSocket=true
 | 
				
			||||||
                        if(!data.isisClose){
 | 
					                        if(!data.isisClose){
 | 
				
			||||||
                            setTimeout(()=>{
 | 
					                            setTimeout(()=>{
 | 
				
			||||||
                                callback()
 | 
					                                callback()
 | 
				
			||||||
 | 
				
			|||||||
@ -538,7 +538,7 @@ struct Index {
 | 
				
			|||||||
                if (this.examSubject == 3) {
 | 
					                if (this.examSubject == 3) {
 | 
				
			||||||
                  Row() {
 | 
					                  Row() {
 | 
				
			||||||
                    Text('考试路线:').fontColor('#E5CCA1').fontSize(this.FONTSIZE)
 | 
					                    Text('考试路线:').fontColor('#E5CCA1').fontSize(this.FONTSIZE)
 | 
				
			||||||
                    Text('线路6').fontColor('#FFAD33').fontSize(this.FONTSIZE)
 | 
					                    Text(`线路${globalThis.carInfo.wayno}`).fontColor('#FFAD33').fontSize(this.FONTSIZE)
 | 
				
			||||||
                  }
 | 
					                  }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -2,6 +2,7 @@ import TopLogo from './compontents/TopLogo';
 | 
				
			|||||||
import MA_SYSTEMPARM from '../common/constants/MA_SYSTEMPARM';
 | 
					import MA_SYSTEMPARM from '../common/constants/MA_SYSTEMPARM';
 | 
				
			||||||
import AccountTable from '../common/database/tables/AccountTable';
 | 
					import AccountTable from '../common/database/tables/AccountTable';
 | 
				
			||||||
import { getSyncData } from '../common/service/initable';
 | 
					import { getSyncData } from '../common/service/initable';
 | 
				
			||||||
 | 
					import router from '@ohos.router';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const cBg = $rawfile('judge/km3/road/luxian_pre.png');
 | 
					const cBg = $rawfile('judge/km3/road/luxian_pre.png');
 | 
				
			||||||
const lBg = $rawfile('judge/km3/road/luxian_nor.png');
 | 
					const lBg = $rawfile('judge/km3/road/luxian_nor.png');
 | 
				
			||||||
@ -17,20 +18,14 @@ export default struct Index {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  async aboutToAppear() {
 | 
					  async aboutToAppear() {
 | 
				
			||||||
    //读取systemparam表的no1等于4的
 | 
					    //读取systemparam表的no1等于4的
 | 
				
			||||||
    const db = new AccountTable(() => {
 | 
					 | 
				
			||||||
    }, MA_SYSTEMPARM);
 | 
					 | 
				
			||||||
    const systemParms: any = await getSyncData('MA_SYSTEMPARM')
 | 
					    const systemParms: any = await getSyncData('MA_SYSTEMPARM')
 | 
				
			||||||
    systemParms.forEach((systemParm) => {
 | 
					    systemParms.forEach((systemParm) => {
 | 
				
			||||||
 | 
					 | 
				
			||||||
      //TODO 字段名称待修改
 | 
					      //TODO 字段名称待修改
 | 
				
			||||||
      const {no1,no2,no3,txt1,txt2} = systemParm;
 | 
					      const {no1,no2,no3,txt1,txt2} = systemParm;
 | 
				
			||||||
      if (no1 == 4) {
 | 
					      if (no1 == 4) {
 | 
				
			||||||
        const temp = { no2, no3, txt1: decodeURI(txt1), txt2 }
 | 
					        const temp = { no2, no3, txt1: decodeURI(txt1), txt2 }
 | 
				
			||||||
        if (this.roadObj[no2]) {
 | 
					        console.info('surenjun', JSON.stringify(temp))
 | 
				
			||||||
          this.roadObj[no2].push(temp)
 | 
					        this.roadObj[no2] = no2
 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
          this.roadObj[no2] = temp
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@ -38,8 +33,8 @@ export default struct Index {
 | 
				
			|||||||
  build() {
 | 
					  build() {
 | 
				
			||||||
    Column() {
 | 
					    Column() {
 | 
				
			||||||
      TopLogo({ outFlag: $outFlag })
 | 
					      TopLogo({ outFlag: $outFlag })
 | 
				
			||||||
 | 
					      Flex({wrap:FlexWrap.Wrap,direction:FlexDirection.Row,justifyContent:FlexAlign.Start}){
 | 
				
			||||||
        List({}) {
 | 
					        List({}) {
 | 
				
			||||||
        ForEach(Reflect.ownKeys(this.roadObj), (roadIndex, index) => {
 | 
					 | 
				
			||||||
          ListItem() {
 | 
					          ListItem() {
 | 
				
			||||||
            Column() {
 | 
					            Column() {
 | 
				
			||||||
              Row() {
 | 
					              Row() {
 | 
				
			||||||
@ -49,7 +44,7 @@ export default struct Index {
 | 
				
			|||||||
              .width(90)
 | 
					              .width(90)
 | 
				
			||||||
              .height(80)
 | 
					              .height(80)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
              Text(`线路${index + 1 + ''}`) {
 | 
					              Text(`随机`) {
 | 
				
			||||||
              }.fontColor('#FFF2D9').fontSize(24).padding({ top: 10 })
 | 
					              }.fontColor('#FFF2D9').fontSize(24).padding({ top: 10 })
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
@ -59,11 +54,41 @@ export default struct Index {
 | 
				
			|||||||
          .height(220)
 | 
					          .height(220)
 | 
				
			||||||
          .margin({ left: 5, bottom: 10 })
 | 
					          .margin({ left: 5, bottom: 10 })
 | 
				
			||||||
          .onClick(async () => {
 | 
					          .onClick(async () => {
 | 
				
			||||||
            console.info(this.roadObj[roadIndex])
 | 
					            const roadArr = Reflect.ownKeys(this.roadObj).map((roadKey) => {
 | 
				
			||||||
 | 
					              return this.roadObj[roadKey]
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					            globalThis.carInfo.wayno = roadArr[Math.floor(Math.random()*roadArr.length)];
 | 
				
			||||||
 | 
					            router.pushUrl({
 | 
				
			||||||
 | 
					              url: 'pages/Judge',
 | 
				
			||||||
 | 
					            }, router.RouterMode.Single);
 | 
				
			||||||
 | 
					          })
 | 
				
			||||||
 | 
					          ForEach(Reflect.ownKeys(this.roadObj), (roadIndex) => {
 | 
				
			||||||
 | 
					            ListItem() {
 | 
				
			||||||
 | 
					              Column() {
 | 
				
			||||||
 | 
					                Row() {
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                .backgroundImage(lBg, ImageRepeat.NoRepeat)
 | 
				
			||||||
 | 
					                .backgroundImageSize({ width: '100%', height: '100%' })
 | 
				
			||||||
 | 
					                .width(90)
 | 
				
			||||||
 | 
					                .height(80)
 | 
				
			||||||
 | 
					                Text(`线路${this.roadObj[roadIndex] + ''}`) {
 | 
				
			||||||
 | 
					                }.fontColor('#FFF2D9').fontSize(24).padding({ top: 10 })
 | 
				
			||||||
 | 
					              }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            .backgroundImage(cBg, ImageRepeat.NoRepeat)
 | 
				
			||||||
 | 
					            .backgroundImageSize({ width: '100%', height: '100%' })
 | 
				
			||||||
 | 
					            .width(180)
 | 
				
			||||||
 | 
					            .height(220)
 | 
				
			||||||
 | 
					            .margin({ left: 5, bottom: 10 })
 | 
				
			||||||
 | 
					            .onClick(async () => {
 | 
				
			||||||
 | 
					              globalThis.carInfo.wayno = this.roadObj[roadIndex];
 | 
				
			||||||
 | 
					              router.pushUrl({
 | 
				
			||||||
 | 
					                url: 'pages/Judge',
 | 
				
			||||||
 | 
					              }, router.RouterMode.Single);
 | 
				
			||||||
            })
 | 
					            })
 | 
				
			||||||
          })
 | 
					          })
 | 
				
			||||||
      }.lanes(5).margin({ top: 50, left: 15 })
 | 
					        }.lanes(8).margin({ top: 50, left: 15 })
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    }.width('100%')
 | 
					    }.width('100%')
 | 
				
			||||||
    .height('100%')
 | 
					    .height('100%')
 | 
				
			||||||
    .backgroundColor('#1A1A1A')
 | 
					    .backgroundColor('#1A1A1A')
 | 
				
			||||||
 | 
				
			|||||||
@ -28,8 +28,7 @@ struct Index {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @State @Watch('outClick') outFlag: boolean = false;
 | 
					  @State @Watch('outClick') outFlag: boolean = false;  private vocObj = null;
 | 
				
			||||||
  private vocObj = null;
 | 
					 | 
				
			||||||
  scroller: Scroller = new Scroller()
 | 
					  scroller: Scroller = new Scroller()
 | 
				
			||||||
  build() {
 | 
					  build() {
 | 
				
			||||||
    Column() {
 | 
					    Column() {
 | 
				
			||||||
 | 
				
			|||||||
@ -642,14 +642,16 @@ struct UserInfo {
 | 
				
			|||||||
              //   });
 | 
					              //   });
 | 
				
			||||||
              //   return
 | 
					              //   return
 | 
				
			||||||
              // }
 | 
					              // }
 | 
				
			||||||
 | 
					              //TODO 科目三先写死
 | 
				
			||||||
 | 
					              globalThis.carInfo.examSubject = 3;
 | 
				
			||||||
              if (globalThis.singlePlay) {
 | 
					              if (globalThis.singlePlay) {
 | 
				
			||||||
 | 
					                const {examSubject} = globalThis.carInfo;
 | 
				
			||||||
                this.AccountTable.query('0', (result) => {
 | 
					                this.AccountTable.query('0', (result) => {
 | 
				
			||||||
                  if (result.length == 0) {
 | 
					                  if (result.length == 0) {
 | 
				
			||||||
                    this.AccountTable.insertData(this.currentUser, (id) => {
 | 
					                    this.AccountTable.insertData(this.currentUser, (id) => {
 | 
				
			||||||
                      this.AccountTable.query('0', (result) => {
 | 
					                      this.AccountTable.query('0', (result) => {
 | 
				
			||||||
                        console.log(result)
 | 
					 | 
				
			||||||
                        router.pushUrl({
 | 
					                        router.pushUrl({
 | 
				
			||||||
                          url: 'pages/Judge',
 | 
					                          url: examSubject == 3 ? 'pages/Roads':'pages/Judge',
 | 
				
			||||||
                        }, router.RouterMode.Single);
 | 
					                        }, router.RouterMode.Single);
 | 
				
			||||||
                        this.stopDeviceById()
 | 
					                        this.stopDeviceById()
 | 
				
			||||||
                      })
 | 
					                      })
 | 
				
			||||||
@ -658,7 +660,7 @@ struct UserInfo {
 | 
				
			|||||||
                    this.AccountTable.updateData(this.currentUser, (id) => {
 | 
					                    this.AccountTable.updateData(this.currentUser, (id) => {
 | 
				
			||||||
                      this.AccountTable.query('0', (result) => {
 | 
					                      this.AccountTable.query('0', (result) => {
 | 
				
			||||||
                        router.pushUrl({
 | 
					                        router.pushUrl({
 | 
				
			||||||
                          url: 'pages/Judge',
 | 
					                          url: examSubject == 3?'pages/Roads':'pages/Judge',
 | 
				
			||||||
                        }, router.RouterMode.Single);
 | 
					                        }, router.RouterMode.Single);
 | 
				
			||||||
                        this.stopDeviceById()
 | 
					                        this.stopDeviceById()
 | 
				
			||||||
                      })
 | 
					                      })
 | 
				
			||||||
 | 
				
			|||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -3,7 +3,7 @@
 | 
				
			|||||||
//考试回放开关
 | 
					//考试回放开关
 | 
				
			||||||
export const judgeConfig = {
 | 
					export const judgeConfig = {
 | 
				
			||||||
  //本地目录开关
 | 
					  //本地目录开关
 | 
				
			||||||
  isTrajectoryOpen: true,
 | 
					  isTrajectoryOpen: false,
 | 
				
			||||||
  //是否开启Udp
 | 
					  //是否开启Udp
 | 
				
			||||||
  udpOpen:false,
 | 
					  udpOpen:false,
 | 
				
			||||||
  // 本地模型地址
 | 
					  // 本地模型地址
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user