bug修复

This commit is contained in:
xiaoxiao 2025-08-05 16:59:58 +08:00
parent 76b7785d84
commit 68c33cf3a5
11 changed files with 145 additions and 103 deletions

View File

@ -60,6 +60,7 @@ export struct HdGrid {
.fontColor(Color.Gray)
.fontSize($r('app.float.hd_list_load_font'))
}
.visibility(Visibility.None)
.height($r('app.float.hd_list_load_height'))
.width('100%')
.justifyContent(FlexAlign.Center)

View File

@ -1,15 +1,89 @@
import { HdNav, ScanUtil } from '@itcast/basic'
import { promptAction } from '@kit.ArkUI'
import { AESEncryptionDecryption, authStore, BasicConstant, HdNav, ScanUtil } from '@itcast/basic'
import { promptAction, router } from '@kit.ArkUI'
import { http } from '@kit.NetworkKit'
@Component
export struct CustomScanResultComp {
aboutToAppear(): void {
}
@State params:Record<string,string> = router.getParams() as Record<string,string>
build() {
Column() {
HdNav({isLeftAction:false,title:'扫描二维码',showRightIcon:false,showRightText:false})
HdNav({isLeftAction:false,title:'扫描登录',showRightIcon:false,showRightText:false})
Image($r('app.media.scan_success_icon'))
.objectFit(ImageFit.Contain)
.width(210)
.height(74)
.margin({top:70})
Text('确认电脑登录\n为确保账号安全请确认是您本人操作')
.textAlign(TextAlign.Center)
.fontSize(16)
.fontColor('rgba(102,102,102,1)')
.margin({top:50})
Text('确认登录')
.textAlign(TextAlign.Center)
.fontSize(18)
.fontColor(Color.White)
.width('90%')
.height(40)
.backgroundColor($r('app.color.main_color'))
.borderRadius(3)
.margin({left:15,right:15,top:100})
.onClick(()=>isAuthorization(this.params.id,true))
Text('确认登录')
.textAlign(TextAlign.Center)
.fontSize(18)
.fontColor('rgba(153,153,153,1)')
.borderWidth(1)
.borderColor('rgba(153,153,153,1)')
.width('90%')
.height(40)
.backgroundColor(Color.White)
.borderRadius(3)
.margin({left:15,right:15,top:20})
.onClick(()=>isAuthorization(this.params.id,false))
}
}
}
async function isAuthorization(str:string,type:boolean) {
let scanString = ''
if (type) {
scanString = `watchliveTo}${str}}${authStore.getUser().uuid},${authStore.getUser().realName},${authStore.getUser().photo}`
} else {
scanString = `watchliveCancel}${str}}${authStore.getUser().uuid},${authStore.getUser().realName},${authStore.getUser().photo}`
}
const scanData = await AESEncryptionDecryption.aesEncrypt(scanString,BasicConstant.ExpertAesKey)
const encodedString = encodeURIComponent(scanData)
let httpRequest = http.createHttp();
let data = "message="+encodedString;
httpRequest.request(
BasicConstant.sendWebsocketMsg,
{
method: http.RequestMethod.POST,
header: { 'Content-Type': 'application/x-www-form-urlencoded' },
extraData: data,
connectTimeout: 60000,
readTimeout: 60000,
}, (err, data) => {
if (!err) {
console.info('Result:' + JSON.stringify(data.result));
let json:Record<string,string> = JSON.parse(data.result+'') as Record<string,string>
if (type) {
promptAction.showToast({ message: String(json.message), duration: 1000 })
}
if(json.code == '1') {
router.back()
} else {
console.error('获取患者信息失败:'+json.message)
}
} else {
console.info('error:' + JSON.stringify(err))
httpRequest.off('headersReceive')
httpRequest.destroy()
}
})
}

View File

@ -2,7 +2,9 @@ import { FlipperOptions,FlipperView,FlipperOptionsBuilder } from '@hshare/hshare
import { promptAction } from '@kit.ArkUI';
import { router } from '@kit.ArkUI'
import { meetingModel } from '../model/HomeModel'
import { TimestampUtil } from '@itcast/basic'
import { AESEncryptionDecryption, authStore, Base64Util, BasicConstant,
DataWebModels,
TimestampUtil } from '@itcast/basic'
@Component
export struct FlipperComp {
@ -10,13 +12,18 @@ export struct FlipperComp {
@State processedData: meetingModel[] = [];
options: FlipperOptions = FlipperOptionsBuilder.getInstance()
.setHeight(56)//View高度
.setInterval(3000)//上下滚动间隔,单位为毫秒
.setAnimateParam(500)//动画持续时间,单位为毫秒
.setHeight(56)
.setInterval(3000)
.setAnimateParam(500)
.setOnItemClicked((item: meetingModel, index: number) => {
let paramsInfo: DataWebModels = {
url:item.liveurl ,
title:'肝胆直播',
type:'live'
};
router.pushUrl({
url: 'pages/WebView/WebPage', // 目标url
params: {url:item.liveurl,title:item.title}
url: 'pages/WebView/LivebroadcastPages', // 目标url
params: paramsInfo // 添加params属性传递自定义参数
})
})
.setOnItemScrolled((item: meetingModel, index: number) => {
@ -56,13 +63,13 @@ export struct FlipperComp {
Column() {
Row({space:2}){
Image($r('app.media.meeting_live_icon')).width(30).height(13)
if (item.state === '1') {
if (item.state == '1') {
if (TimestampUtil.isToday(item.begin_date_timestamp)) {
Image($r('app.media.meeting_begin_play_icon')).width(16).height(16)
} else {
Image($r('app.media.meeting_noPlay_icon')).width(16).height(16)
}
} else if (item.state === '0' || item.state === '3') {
} else if (item.state == '0' || item.state == '3') {
if (TimestampUtil.isToday(item.begin_date_timestamp)) {
Image($r('app.media.meeting_begin_play_icon')).width(16).height(16)
} else {
@ -74,20 +81,20 @@ export struct FlipperComp {
}
Stack({alignContent:Alignment.Center}){
Image($r('app.media.meeting_timeBack_icon')).width(74).height(15).margin({top:-3})
if (item.state === '1') {
if (item.state == '1') {
if (TimestampUtil.isToday(item.begin_date_timestamp)) {
Text('开播'+TimestampUtil.format(item.begin_date_timestamp,'HH:mm'))
.fontSize(12).fontColor(Color.White)
} else {
Text(TimestampUtil.format(item.begin_date_timestamp,'MM月dd日'))
Text(TimestampUtil.format(item.begin_date_timestamp,'MM月DD日'))
.fontSize(12).fontColor(Color.White)
}
} else if (item.state === '0' || item.state === '3') {
} else if (item.state == '0' || item.state == '3') {
if (TimestampUtil.isToday(item.begin_date_timestamp)) {
Text('开播'+TimestampUtil.format(item.begin_date_timestamp,'HH:mm'))
.fontSize(12).fontColor(Color.White)
} else {
Text(TimestampUtil.format(item.begin_date_timestamp,'MM月dd日'))
Text(TimestampUtil.format(item.begin_date_timestamp,'MM月DD日'))
.fontSize(12).fontColor(Color.White)
}
} else {
@ -101,7 +108,10 @@ export struct FlipperComp {
Text(item.title)
.fontSize(14)
.fontColor('#333333')
.margin({left:9})
.width('70%')
.margin({left:9,right:10})
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}.margin({top:10}).width('100%').height(46)
}
}

View File

@ -7,7 +7,6 @@ import cryptoFramework from '@ohos.security.cryptoFramework';
import util from '@ohos.util';
import { BusinessError } from '@kit.BasicServicesKit';
import { rcp } from '@kit.RemoteCommunicationKit';
import { HashMap } from '@kit.ArkTS';
import { http } from '@kit.NetworkKit';
@Entry
@ -267,26 +266,10 @@ async function decryptString(str:string) {
console.error("解密失败:", error)
}
}
//liveScanSuccess}8c30fb02189a44ed95d856f39a1fe792}1CBMDQbuOX3xbxAcxE5,Ios测试,expert/2025-07-09/7a4e8aa78bcb495b87ede343b7763ef9.jpg
//liveScanSuccess}8c30fb02189a44ed95d856f39a1fe792}1CBMDQbuOX3xbxAcxE5,Ios测试,expert/2025-07-09/7a4e8aa78bcb495b87ede343b7763ef9.jpg
//liveScanSuccess}8c30fb02189a44ed95d856f39a1fe792}1CBMDQbuOX3xbxAcxE5,Ios测试,expert/2025-07-09/7a4e8aa78bcb495b87ede343b7763ef9.jpg
// PfLvaZPedZHfbA0uwxOiOF76Du652Bsm89X1x1BlPoADdXYM1Tvg4PHHXXhK7BP1XSBDBc5aQbgw9+K9+Vr4HZfYQ9BKFtpz1bDPF+FiIsb+P6hXUwIYu5dy9EJjZUZBFJr8GQibSH3XwyqjqmsHAW3AVOWYZY6qvNenjoGjmjR0Msts21E+E31RBCK3Kvaj
// PfLvaZPedZHfbA0uwxOiOF76Du652Bsm89X1x1BlPoADdXYM1Tvg4PHHXXhK7BP1XSBDBc5aQbgw9+K9+Vr4HZfYQ9BKFtpz1bDPF+FiIsb+P6hXUwIYu5dy9EJjZUZBFJr8GQibSH3XwyqjqmsHAW3AVOWYZY6qvNenjoGjmjR0Msts21E+E31RBCK3Kvaj
// PfLvaZPedZHfbA0uwxOiOF76Du652Bsm89X1x1BlPoADdXYM1Tvg4PHHXXhK7BP1XSBDBc5aQbgw9%2BK9%2BVr4HZfYQ9BKFtpz1bDPF%2BFiIsb%2BP6hXUwIYu5dy9EJjZUZBFJr8GQibSH3XwyqjqmsHAW3AVOWYZY6qvNenjoGjmjR0Msts21E%2BE31RBCK3Kvaj
// B2e%2B96mEodDQ5EIsmcpfh6cJbH7WhjSkXrIz8JtGf2gREqwSckolodE2%2FdNTTssxvwLTAltHlphKiSYWT91IpBUkt30diwj0VF1elbS193JwyOF4AU%2FhJ%2FRYQtxUHrB%2BlRo65QEhktb7z79lsRuJwUKISPEbTkrCVzRx9QDGcihdsOe44ABgLH%2BmyFhgEsMC
// B2e%2B96mEodDQ5EIsmcpfh6cJbH7WhjSkXrIz8JtGf2gREqwSckolodE2%2FdNTTssxvwLTAltHlphKiSYWT91IpBUkt30diwj0VF1elbS193JwyOF4AU%2FhJ%2FRYQtxUHrB%2BlRo65QEhktb7z79lsRuJwUKISPEbTkrCVzRx9QDGcihdsOe44ABgLH%2BmyFhgEsMC
// B2e+96mEodDQ5EIsmcpfh6cJbH7WhjSkXrIz8JtGf2gREqwSckolodE2/dNTTssxvwLTAltHlphKiSYWT91IpBUkt30diwj0VF1elbS193JwyOF4AU/hJ/RYQtxUHrB+lRo65QEhktb7z79lsRuJwUKISPEbTkrCVzRx9QDGcihdsOe44ABgLH+myFhgEsMC
async function pushScanPage(str:string) {
const liceScanSuccess = `videoScanSuccess}${str}}${authStore.getUser().uuid},${authStore.getUser().realName},${authStore.getUser().photo}`
// const textEncoder = new util.TextEncoder()
// const inputData: Uint8Array = textEncoder.encodeInto(liceScanSuccess)
// const scanData = await AESEncryptionDecryption.aes128Encrypt(inputData,BasicConstant.ExpertAesKey)
// const base64Data = AESEncryptionDecryption.customBase64Encode(scanData)
// const encodedString = encodeURIComponent(base64Data)
// let hashMap: HashMap<string, string> = new HashMap()
// hashMap.set('message',this.code)
const scanData =await AESEncryptionDecryption.aesEncrypt(liceScanSuccess,"deoep09_klodLdAo")
async function pushScanPage(str:string) {
const liceScanSuccess = `liveScanSuccess}${str}}${authStore.getUser().uuid},${authStore.getUser().realName},${authStore.getUser().photo}`
const scanData = await AESEncryptionDecryption.aesEncrypt(liceScanSuccess,BasicConstant.ExpertAesKey)
const encodedString = encodeURIComponent(scanData)
let httpRequest = http.createHttp();
let data = "message="+encodedString;
@ -294,69 +277,26 @@ async function pushScanPage(str:string) {
BasicConstant.sendWebsocketMsg,
{
method: http.RequestMethod.POST,
// Optional, default is http.RequestMethod.GET//Developers can add header fields according to their own business needs
header: { 'Content-Type': 'application/x-www-form-urlencoded' }, // This field is used to pass content when using POST requests
header: { 'Content-Type': 'application/x-www-form-urlencoded' },
extraData: data,
connectTimeout: 60000, // Optional, default is 60000ms
readTimeout: 60000, // Optional, default is 60000ms
connectTimeout: 60000,
readTimeout: 60000,
}, (err, data) => {
if (!err) {
// Data.read is the HTTP response content, which can be parsed according to business needs
console.info('Result:' + JSON.stringify(data.result));
console.info('code:' +
JSON.stringify(data.responseCode)); // Data.reader is an HTTP response header that can be parsed according to business needs
console.info('header:' + JSON.stringify(data.header));
console.info('cookies:' +
JSON.stringify(data.cookies)); // Starting from API8
let json:Record<string,string> = JSON.parse(data.result+'') as Record<string,string>
if(json.code == '1') {
router.pushUrl({url:'pages/VideoPage/CustomScanResultPage',params: {"id":str}})
} else {
console.error('获取患者信息失败:'+json.message)
promptAction.showToast({ message: String(json.message), duration: 1000 })
}
} else {
console.info('error:' + JSON.stringify(err)); // Unsubscribe from HTTP response header events
httpRequest.off('headersReceive'); // When the request is exhausted, call the destroy method to actively destroy it.
httpRequest.destroy();
}
})
// const postContent = new rcp.MultipartForm({
// 'message': encodedString
// })
// const postContent: rcp.RequestContent = {
// fields: {
// 'message': encodedString,
//
// }
// }
// const session = rcp.createSession()
// session.post(BasicConstant.sendWebsocketMsg, {
// data: postContent,
// headers: {
// 'Content-Type': 'application/x-www-form-urlencoded'
// }
// })
// .then((response) => {
// let json:Record<string,string> = JSON.parse(response+'') as Record<string,string>
// if(json.code == '1') {
// router.pushUrl({url:'pages/VideoPage/CustomScanPage'})
// } else {
// promptAction.showToast({ message: String(json.message), duration: 1000 })
// }
// })
// .catch((err: BusinessError) => {
// console.error(`Response err: Code is ${JSON.stringify(err.code)}, message is ${JSON.stringify(err)}`);
// })
// hdHttp.post<string>(BasicConstant.sendWebsocketMsg, {
// "message":base64Data
// } as Record<string,string>).then(async (res: HdResponse<string>) => {
// console.info('Response caseUuid'+res);
// let json:Record<string,string | Record<string,string> | Array<Record<string,string>>> = JSON.parse(res+'') as Record<string,string | Record<string,string> | Array<Record<string,string>>>;
// if(json.code == '1') {
//
// } else {
// console.error('获取患者信息失败:'+json.message)
// promptAction.showToast({ message: String(json.message), duration: 1000 })
// }
// }).catch((err: BusinessError) => {
// console.error(`Response fails: ${err}`);
// })
}

View File

@ -137,7 +137,7 @@ export struct HeaderView {
ForEach([{'title':'随访患者数','content':this.expertData['expert_apply_num'] || '0'},
{'title':'公益咨询数','content':this.expertData['consult_total_num'] || '0'}],
// {'title':'患者送花数','content':this.expertData['ping_flowewr_num'] || '0'}],
(item:object)=>{
(item:object,index:number)=>{
Column(){
Text(item['content']?.toString() || '0')
.fontSize(20)
@ -148,6 +148,13 @@ export struct HeaderView {
.fontColor('#333333')
.height(17)
}.height('100%').justifyContent(FlexAlign.Center)
.onClick(()=>{
if (index == 0) {
router.pushUrl({url:'pages/Netease/imTabPage'})
} else {
router.pushUrl({ url: 'pages/Netease/PublicConsultationPage' })
}
})
})
}
}.width('95%').height(65).borderRadius(5).backgroundColor(Color.White)

View File

@ -11,11 +11,14 @@ export struct MyPageSectionItem {
.width(24).height(24)
.objectFit(ImageFit.Auto)
Text(this.sectionItem.title)
.maxFontSize(14)
.minFontSize(6)
.maxLines(1)
// .maxFontSize(14)
// .minFontSize(6)
.fontSize(14)
// .maxLines(1)
.fontColor('#333333')
.margin({ top: 10 })
.textAlign(TextAlign.Center)
.width('120%')
}.width('100%')
if (this.sectionItem.status) {
Text().backgroundColor(Color.Red).width(10).height(10).borderRadius(5)

View File

@ -276,7 +276,7 @@ export struct GroupMessageSendingComp {
.scrollBar(BarState.Off)
.layoutWeight(1)
EmptyViewComp({promptText:'暂无随访计划',isVisibility:true})
EmptyViewComp({promptText:'暂无群发消息',isVisibility:true})
.width('100%')
.height('100%')
.visibility(this.messageList.length>0?Visibility.None:Visibility.Visible)

View File

@ -1,5 +1,5 @@
import { ApplyViews } from '../views/ApplyViews'
import { authStore, HdNav } from '@itcast/basic';
import { authStore, EmptyViewComp, HdNav } from '@itcast/basic';
import { applyListCallBacl,applyListModel,applyHistoryCallBacl,historyModel } from '../models/ApplyModel'
import HashMap from '@ohos.util.HashMap';
import { HdLoadingDialog } from '@itcast/basic'
@ -227,10 +227,14 @@ export struct PatientApplyPage {
})
}.width('100%').alignItems(HorizontalAlign.Start)
}
EmptyViewComp({promptText:'暂无新随访申请患者',isVisibility:true})
.visibility(this.historyArray.length>0||this.applyArray.length>0?Visibility.None:Visibility.Visible)
.width('100%')
.height('90%')
}.width('100%').height('100%').backgroundColor('#f4f4f4')
}
submintMessage(patient_user_uuid:string) {
submintMessage(patient_user_uuid:string) {//使用群发
const hashMap: HashMap<string, string> = new HashMap();
hashMap.set('msg_type','1')
hashMap.set('msg_content','你好,我已经是你的随访医生了')

View File

@ -38,7 +38,7 @@ export struct TabBarComp {
.width($r('app.float.tab_bar_item_icon_size'))
Text(item.label)
.fontSize($r('app.float.tab_bar_item_font_size'))
.fontColor(this.activeIndex === index ? $r('app.color.black') : $r('app.color.common_gray_01'))
.fontColor(this.activeIndex === index ? $r('app.color.main_color') : $r('app.color.common_gray_01'))
.animation({ duration: 300 })
}
}

View File

@ -2,7 +2,7 @@ import { CustomScanResultComp } from 'home'
@Entry
@Component
struct CustomScanPage {
struct CustomScanResultPage {
build() {
RelativeContainer() {
CustomScanResultComp()

View File

@ -14,11 +14,14 @@ struct WebPage {
private controller: webview.WebviewController = new webview.WebviewController();
@State params:RouteParams = router.getParams() as RouteParams;
// 修改为移动端User-Agent解决链接中有视频的问题
private customUserAgent: string = 'Mozilla/5.0 (Linux; Android 10; HarmonyOS) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 gdxz-expert';
@State contentWidth: number = 0;
@State contentHeight: number = 0;
@State url: string = this.params.url;
@State title: string = this.params.title;
customUserAgent: string = 'gdxz-expert';
// customUserAgent: string = 'gdxz-expert';
onBackPress(): boolean | void {
if (this.controller.accessStep(-1)) {
@ -61,7 +64,7 @@ struct WebPage {
})
})
.width('100%')
.layoutWeight(1)// 占据剩余空间
.layoutWeight(1)
.height('100%')
if (this.title == '随访二维码') {
Row(){