Showing
5 changed files
with
196 additions
and
22 deletions
47.6 KB
| @@ -86,7 +86,7 @@ export struct MorningEveningPaperComponent { | @@ -86,7 +86,7 @@ export struct MorningEveningPaperComponent { | ||
| 86 | offset: { dx: 12, dy: -150 }, | 86 | offset: { dx: 12, dy: -150 }, |
| 87 | 87 | ||
| 88 | }) | 88 | }) |
| 89 | - // private AudioSuspension = new AudioSuspensionModel() | 89 | + private AudioSuspension = new AudioSuspensionModel() |
| 90 | 90 | ||
| 91 | onCancel() { | 91 | onCancel() { |
| 92 | Logger.info(TAG, "cj2024 onCancel = ") | 92 | Logger.info(TAG, "cj2024 onCancel = ") |
| @@ -149,19 +149,22 @@ export struct MorningEveningPaperComponent { | @@ -149,19 +149,22 @@ export struct MorningEveningPaperComponent { | ||
| 149 | Logger.info(TAG, "pageInfoBean dateTime = " + dateTime) | 149 | Logger.info(TAG, "pageInfoBean dateTime = " + dateTime) |
| 150 | Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle) | 150 | Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle) |
| 151 | 151 | ||
| 152 | + Logger.info(TAG, "this.pageInfoBean = " + JSON.stringify(this.pageInfoBean)) | ||
| 153 | + | ||
| 152 | this.isHasTopView = this.pageInfoBean?.topicInfo?.frontLinkObject?true:false | 154 | this.isHasTopView = this.pageInfoBean?.topicInfo?.frontLinkObject?true:false |
| 153 | let coverUrl = this.isHasTopView?this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string :'' | 155 | let coverUrl = this.isHasTopView?this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string :'' |
| 154 | this.setComponentBgColor(coverUrl) | 156 | this.setComponentBgColor(coverUrl) |
| 155 | 157 | ||
| 156 | let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) | 158 | let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) |
| 157 | // this.compInfoBean = compInfoBean | 159 | // this.compInfoBean = compInfoBean |
| 160 | + Logger.info(TAG, "compInfoBean = " + JSON.stringify(compInfoBean)) | ||
| 158 | if (compInfoBean?.compList[0]) { | 161 | if (compInfoBean?.compList[0]) { |
| 159 | this.compListItem = compInfoBean?.compList[0] | 162 | this.compListItem = compInfoBean?.compList[0] |
| 160 | Logger.debug(TAG, '获取评论数据' + `${this.compListItem.operDataList.length}`) | 163 | Logger.debug(TAG, '获取评论数据' + `${this.compListItem.operDataList.length}`) |
| 161 | if (this.compListItem.operDataList && this.compListItem.operDataList.length > 0) { | 164 | if (this.compListItem.operDataList && this.compListItem.operDataList.length > 0) { |
| 162 | this.getAllContentInteractData(this.compListItem.operDataList) | 165 | this.getAllContentInteractData(this.compListItem.operDataList) |
| 163 | } | 166 | } |
| 164 | - Logger.debug('compInfoBean?.compList[0].audioDataList', JSON.stringify(compInfoBean?.compList[0].audioDataList)) | 167 | + Logger.debug(TAG, 'compInfoBean?.compList[0].audioDataList', JSON.stringify(compInfoBean?.compList[0].audioDataList)) |
| 165 | if (compInfoBean?.compList[0].audioDataList) { | 168 | if (compInfoBean?.compList[0].audioDataList) { |
| 166 | this.audioPlayUrl = compInfoBean?.compList[0].audioDataList[0].audioUrl | 169 | this.audioPlayUrl = compInfoBean?.compList[0].audioDataList[0].audioUrl |
| 167 | this.audioTitle = compInfoBean?.compList[0].audioDataList[0].title | 170 | this.audioTitle = compInfoBean?.compList[0].audioDataList[0].title |
| @@ -258,12 +261,11 @@ export struct MorningEveningPaperComponent { | @@ -258,12 +261,11 @@ export struct MorningEveningPaperComponent { | ||
| 258 | topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject }) | 261 | topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject }) |
| 259 | } | 262 | } |
| 260 | 263 | ||
| 261 | - //暂时不展示音频播报 | ||
| 262 | - // if (this.audioPlayUrl.length > 0){ | ||
| 263 | - // ListItem() { | ||
| 264 | - // this.AudioBarView(this.simpleAudioDialog) | ||
| 265 | - // } | ||
| 266 | - // } | 264 | + if (this.audioPlayUrl !== ""){ |
| 265 | + ListItem() { | ||
| 266 | + this.AudioBarView() | ||
| 267 | + } | ||
| 268 | + } | ||
| 267 | } | 269 | } |
| 268 | 270 | ||
| 269 | ListItem() { | 271 | ListItem() { |
| @@ -307,7 +309,7 @@ export struct MorningEveningPaperComponent { | @@ -307,7 +309,7 @@ export struct MorningEveningPaperComponent { | ||
| 307 | } | 309 | } |
| 308 | 310 | ||
| 309 | @Builder | 311 | @Builder |
| 310 | - AudioBarView(dialog: CustomDialogController) { | 312 | + AudioBarView() { |
| 311 | Row() { | 313 | Row() { |
| 312 | Stack({ alignContent: Alignment.Start }) { | 314 | Stack({ alignContent: Alignment.Start }) { |
| 313 | Image($r('app.media.listen_left_bg')) | 315 | Image($r('app.media.listen_left_bg')) |
| @@ -320,7 +322,7 @@ export struct MorningEveningPaperComponent { | @@ -320,7 +322,7 @@ export struct MorningEveningPaperComponent { | ||
| 320 | .margin({ left: 10 }) | 322 | .margin({ left: 10 }) |
| 321 | .alignSelf(ItemAlign.Start) | 323 | .alignSelf(ItemAlign.Start) |
| 322 | 324 | ||
| 323 | - Text('晚上好, 请收听今日新闻播报') | 325 | + Text(`${this.pageInfoBean.topicInfo.topicPattern === 1 ? '早上好' : this.pageInfoBean.topicInfo.topicPattern === 2 ? '中午好' : '晚上好'}, 请收听今日新闻播报`) |
| 324 | .fontSize(14) | 326 | .fontSize(14) |
| 325 | .margin({ left: 50 }) | 327 | .margin({ left: 50 }) |
| 326 | .fontColor(Color.Black) | 328 | .fontColor(Color.Black) |
| @@ -345,7 +347,7 @@ export struct MorningEveningPaperComponent { | @@ -345,7 +347,7 @@ export struct MorningEveningPaperComponent { | ||
| 345 | Logger.info("TAG", "cj compInfoBean onClick1 = " + this.isAudioPlaying) | 347 | Logger.info("TAG", "cj compInfoBean onClick1 = " + this.isAudioPlaying) |
| 346 | // dialog.open() | 348 | // dialog.open() |
| 347 | // this.playerController.firstPlay(this.audioPlayUrl, this.audioTitle) | 349 | // this.playerController.firstPlay(this.audioPlayUrl, this.audioTitle) |
| 348 | - // this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle) | 350 | + this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle) |
| 349 | Logger.info(TAG, "this.audioPlayUrl = " + this.audioPlayUrl) | 351 | Logger.info(TAG, "this.audioPlayUrl = " + this.audioPlayUrl) |
| 350 | Logger.info("TAG", "cj compInfoBean onClick2 = " + this.isAudioPlaying) | 352 | Logger.info("TAG", "cj compInfoBean onClick2 = " + this.isAudioPlaying) |
| 351 | }) | 353 | }) |
| @@ -221,6 +221,8 @@ export class PageHelper { | @@ -221,6 +221,8 @@ export class PageHelper { | ||
| 221 | // let pageDto = page | 221 | // let pageDto = page |
| 222 | let index = pageInfo.groups.indexOf(group) | 222 | let index = pageInfo.groups.indexOf(group) |
| 223 | 223 | ||
| 224 | + Logger.debug(TAG, 'yyyy parseGroup print') | ||
| 225 | + this.printComp(pageDto) | ||
| 224 | // 解析楼层组件 | 226 | // 解析楼层组件 |
| 225 | this.analysisPageGroupCompData(pageDto, pageInfo) | 227 | this.analysisPageGroupCompData(pageDto, pageInfo) |
| 226 | 228 | ||
| @@ -293,7 +295,8 @@ export class PageHelper { | @@ -293,7 +295,8 @@ export class PageHelper { | ||
| 293 | if (pageDto.compAdList != null) { | 295 | if (pageDto.compAdList != null) { |
| 294 | pageInfo.pageAdList.push(...pageDto.compAdList) | 296 | pageInfo.pageAdList.push(...pageDto.compAdList) |
| 295 | } | 297 | } |
| 296 | - | 298 | + // TODO 待删除 |
| 299 | + Logger.debug(TAG, 'yyyy analysisPageGroupCompData size, '+pageInfo?.oneRequestPageGroupCompList?.length) | ||
| 297 | } | 300 | } |
| 298 | 301 | ||
| 299 | } | 302 | } |
| @@ -340,6 +343,8 @@ export class PageHelper { | @@ -340,6 +343,8 @@ export class PageHelper { | ||
| 340 | pageModel.currentPage++; | 343 | pageModel.currentPage++; |
| 341 | pageModel.hasMore = true; | 344 | pageModel.hasMore = true; |
| 342 | 345 | ||
| 346 | + Logger.debug(TAG, 'yyyy compLoadMore print') | ||
| 347 | + this.printComp(data) | ||
| 343 | //移除音频 和 活动 | 348 | //移除音频 和 活动 |
| 344 | this.loadMorePageComp(pageModel, data) | 349 | this.loadMorePageComp(pageModel, data) |
| 345 | // 参与批查 | 350 | // 参与批查 |
| @@ -366,6 +371,8 @@ export class PageHelper { | @@ -366,6 +371,8 @@ export class PageHelper { | ||
| 366 | pageCompList.forEach((comp: CompDTO) => { | 371 | pageCompList.forEach((comp: CompDTO) => { |
| 367 | pageModel.pageInfo.oneRequestPageGroupCompList.add(comp) | 372 | pageModel.pageInfo.oneRequestPageGroupCompList.add(comp) |
| 368 | }) | 373 | }) |
| 374 | + // TODO 待删除 | ||
| 375 | + Logger.debug(TAG, 'yyyy loadMorePageComp size, ' + pageModel.pageInfo.oneRequestPageGroupCompList?.length) | ||
| 369 | 376 | ||
| 370 | // 记录 | 377 | // 记录 |
| 371 | pageModel.pageTotalCompSize = pageCompList.length + pageModel.pageTotalCompSize | 378 | pageModel.pageTotalCompSize = pageCompList.length + pageModel.pageTotalCompSize |
| @@ -843,6 +850,31 @@ export class PageHelper { | @@ -843,6 +850,31 @@ export class PageHelper { | ||
| 843 | // 从第二页开始删 | 850 | // 从第二页开始删 |
| 844 | pageModel.compList.deleteItems(pageModel.firstPageEndIndex + 1) | 851 | pageModel.compList.deleteItems(pageModel.firstPageEndIndex + 1) |
| 845 | } | 852 | } |
| 853 | + | ||
| 854 | + /** | ||
| 855 | + * 临时打印comp相关信息,用于问题定位。TODO 待删除 | ||
| 856 | + */ | ||
| 857 | + private printComp(pageDto: PageDTO) { | ||
| 858 | + Logger.debug(TAG, 'yyyy printComp pageDto.compList.size: ' + pageDto?.compList?.length) | ||
| 859 | + new Promise<void>(() => { | ||
| 860 | + let tmpCompList: CompDTO[] = Array.from(pageDto.compList) | ||
| 861 | + tmpCompList.forEach((v, k) => { | ||
| 862 | + if (v && v.operDataList) { | ||
| 863 | + Logger.warn(TAG, 'yyyy printComp comp forEach, ' + v.compStyle) | ||
| 864 | + v.operDataList.forEach((cv, ci) => { | ||
| 865 | + if (cv) { | ||
| 866 | + Logger.debug(TAG, 'yyyy printComp ContentDTO print, ' + v.compStyle) | ||
| 867 | + Logger.debug(TAG, 'yyyy printComp ContentDTO xxxx newsTitle, ' + cv.newsTitle) | ||
| 868 | + } else { | ||
| 869 | + Logger.warn(TAG, 'yyyy printComp ContentDTO is null, ' + v.compStyle) | ||
| 870 | + } | ||
| 871 | + }) | ||
| 872 | + } else { | ||
| 873 | + Logger.warn(TAG, 'yyyy printComp comp is null or operDataList is empty, ' + v?.compStyle) | ||
| 874 | + } | ||
| 875 | + }) | ||
| 876 | + }) | ||
| 877 | + } | ||
| 846 | } | 878 | } |
| 847 | 879 | ||
| 848 | 880 |
| 1 | +import { CommonConstants } from 'wdConstant'; | ||
| 2 | +import { Logger } from 'wdKit'; | ||
| 3 | + | ||
| 4 | +const TAG = 'EmptyComponent'; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * WDViewDefaultType 缺省页 无网络 | ||
| 8 | + */ | ||
| 9 | +export const enum WDViewDefaultType { | ||
| 10 | + /// 0.默认 | ||
| 11 | + WDViewDefaultType_Default, | ||
| 12 | + /// 1.无网 | ||
| 13 | + WDViewDefaultType_NoNetwork, | ||
| 14 | +} | ||
| 15 | + | ||
| 16 | +/** | ||
| 17 | + * 空数据/无数据 | ||
| 18 | + */ | ||
| 19 | +@Preview | ||
| 20 | +@Component | ||
| 21 | +export struct EmptyComponent { | ||
| 22 | + @State emptyWidth: string | number = CommonConstants.FULL_PARENT; | ||
| 23 | + @State emptyHeight: string | number = CommonConstants.FULL_PARENT; | ||
| 24 | + @State emptyType: number = WDViewDefaultType.WDViewDefaultType_NoNetwork; // 缺省图类型,传枚举 | ||
| 25 | + @State emptyButton: boolean = false | ||
| 26 | + @State timeNum: number = 10 | ||
| 27 | + /** | ||
| 28 | + * The empty image width percentage setting. | ||
| 29 | + */ | ||
| 30 | + readonly EMPTY_IMAGE_WIDTH: string = '15%'; | ||
| 31 | + /** | ||
| 32 | + * The empty image height percentage setting. | ||
| 33 | + */ | ||
| 34 | + readonly EMPTY_IMAGE_HEIGHT: string = '15%'; | ||
| 35 | + /** | ||
| 36 | + * The empty data text component margin top. | ||
| 37 | + */ | ||
| 38 | + readonly EMPTY_TIP_TEXT_MARGIN_TOP: string = '10'; | ||
| 39 | + /** | ||
| 40 | + * The empty data text opacity. | ||
| 41 | + */ | ||
| 42 | + readonly TEXT_OPACITY: number = 0.4; | ||
| 43 | + private timer: number = -1 | ||
| 44 | + retry: () => void = () => { | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + build() { | ||
| 48 | + this.noProgrammeData(); | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + /** | ||
| 52 | + * 无数据,空白view组件 | ||
| 53 | + */ | ||
| 54 | + @Builder | ||
| 55 | + noProgrammeData() { | ||
| 56 | + Column() { | ||
| 57 | + Image(this.buildNoDataTipImage()) | ||
| 58 | + .width(160) | ||
| 59 | + .height(112) | ||
| 60 | + .objectFit(ImageFit.Contain) | ||
| 61 | + | ||
| 62 | + Text(this.emptyType !== 8 ? this.buildNoDataTip() : `${this.buildNoDataTip()}(${this.timeNum}s)`) | ||
| 63 | + .fontSize($r('app.float.font_size_14'))// .fontColor('#FF999999') | ||
| 64 | + .fontWeight(FontWeight.Normal) | ||
| 65 | + .opacity(this.TEXT_OPACITY) | ||
| 66 | + .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP }) | ||
| 67 | + .onClick((event: ClickEvent) => { | ||
| 68 | + Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`); | ||
| 69 | + }) | ||
| 70 | + | ||
| 71 | + if (this.isShowButton()) { | ||
| 72 | + if (this.emptyType !== 15) { | ||
| 73 | + Button('点击重试') | ||
| 74 | + .type(ButtonType.Normal) | ||
| 75 | + .width(80) | ||
| 76 | + .height(28) | ||
| 77 | + .backgroundColor('#fffffff') | ||
| 78 | + .fontColor('#FF666666') | ||
| 79 | + .border({ width: 1 }) | ||
| 80 | + .borderColor('#FFEDEDED') | ||
| 81 | + .borderRadius(4) | ||
| 82 | + .fontSize($r('app.float.font_size_12')) | ||
| 83 | + .margin({ top: 16 }) | ||
| 84 | + .padding(0) | ||
| 85 | + .onClick(() => { | ||
| 86 | + this.retry() | ||
| 87 | + }) | ||
| 88 | + } else { | ||
| 89 | + Button('点击重试') | ||
| 90 | + .type(ButtonType.Normal) | ||
| 91 | + .width(80) | ||
| 92 | + .height(28) | ||
| 93 | + .backgroundColor(Color.Black) | ||
| 94 | + .fontColor('#FFCCCCCC') | ||
| 95 | + .border({ width: 1 }) | ||
| 96 | + .borderColor('#4DFFFFFF') | ||
| 97 | + .borderRadius(4) | ||
| 98 | + .fontSize($r('app.float.font_size_12')) | ||
| 99 | + .margin({ top: 16 }) | ||
| 100 | + .padding(0) | ||
| 101 | + .onClick(() => { | ||
| 102 | + this.retry() | ||
| 103 | + }) | ||
| 104 | + } | ||
| 105 | + } | ||
| 106 | + } | ||
| 107 | + .justifyContent(FlexAlign.Center) | ||
| 108 | + .width(this.emptyWidth) | ||
| 109 | + .height(this.emptyHeight) | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + buildNoDataTip(): string { | ||
| 113 | + Logger.info(TAG, "buildNoDataTip"); | ||
| 114 | + let contentString: string = '暂无内容' | ||
| 115 | + if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) { | ||
| 116 | + contentString = '网络出小差了,请检查网络后重试' | ||
| 117 | + } | ||
| 118 | + return contentString | ||
| 119 | + } | ||
| 120 | + | ||
| 121 | + buildNoDataTipImage(): Resource | string { | ||
| 122 | + Logger.info(TAG, "buildNoDataTip"); | ||
| 123 | + let imageString: Resource | string = "" | ||
| 124 | + if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) { | ||
| 125 | + imageString = $r('app.media.icon_no_net1') | ||
| 126 | + } | ||
| 127 | + return imageString | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + isShowButton() { | ||
| 131 | + if (this.emptyType === 1 || this.emptyType === 9 || this.emptyType === 15) { | ||
| 132 | + return true | ||
| 133 | + } else { | ||
| 134 | + return false | ||
| 135 | + } | ||
| 136 | + } | ||
| 137 | +} | ||
| 138 | + |
| 1 | import router from '@ohos.router'; | 1 | import router from '@ohos.router'; |
| 2 | import webview from '@ohos.web.webview'; | 2 | import webview from '@ohos.web.webview'; |
| 3 | import { SpConstants } from 'wdConstant/Index'; | 3 | import { SpConstants } from 'wdConstant/Index'; |
| 4 | -import { Logger, SPHelper } from 'wdKit'; | 4 | +import { Logger, NetworkUtil, SPHelper } from 'wdKit'; |
| 5 | import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/src/main/ets/bean/content/Params'; | 5 | import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/src/main/ets/bean/content/Params'; |
| 6 | +import { EmptyComponent } from './EmptyComponent'; | ||
| 6 | 7 | ||
| 7 | 8 | ||
| 8 | const TAG = 'LoginProtocolWebview'; | 9 | const TAG = 'LoginProtocolWebview'; |
| @@ -12,7 +13,7 @@ const TAG = 'LoginProtocolWebview'; | @@ -12,7 +13,7 @@ const TAG = 'LoginProtocolWebview'; | ||
| 12 | struct LoginProtocolWebview { | 13 | struct LoginProtocolWebview { |
| 13 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 14 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 14 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 15 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 15 | - webUrl: string = '' | 16 | + @State webUrl: string = '' |
| 16 | webviewController: webview.WebviewController = new webview.WebviewController() | 17 | webviewController: webview.WebviewController = new webview.WebviewController() |
| 17 | userProtocol = "https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1005.html" | 18 | userProtocol = "https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1005.html" |
| 18 | privateProtocol = 'https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1001.html' | 19 | privateProtocol = 'https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1001.html' |
| @@ -22,6 +23,7 @@ struct LoginProtocolWebview { | @@ -22,6 +23,7 @@ struct LoginProtocolWebview { | ||
| 22 | collectionProtocol = 'https://cdnpeoplefront.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1002.html'//收集个人信息明示清单 | 23 | collectionProtocol = 'https://cdnpeoplefront.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1002.html'//收集个人信息明示清单 |
| 23 | thirdVendorProtocol = 'https://cdnpeoplefront.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1004.html'//第三方信息共享清单 | 24 | thirdVendorProtocol = 'https://cdnpeoplefront.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1004.html'//第三方信息共享清单 |
| 24 | @State contentID:string = "0" | 25 | @State contentID:string = "0" |
| 26 | + @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() | ||
| 25 | 27 | ||
| 26 | async aboutToAppear() { | 28 | async aboutToAppear() { |
| 27 | if (router.getParams()) { | 29 | if (router.getParams()) { |
| @@ -33,24 +35,17 @@ struct LoginProtocolWebview { | @@ -33,24 +35,17 @@ struct LoginProtocolWebview { | ||
| 33 | if (params.contentID == "1") { //"人民日报客户端网络服务使用协议" | 35 | if (params.contentID == "1") { //"人民日报客户端网络服务使用协议" |
| 34 | this.webUrl = this.userProtocol | 36 | this.webUrl = this.userProtocol |
| 35 | this.webUrl = await SPHelper.default.get(SpConstants.NET_SERVICE_PROTOCOL, this.userProtocol) as string | 37 | this.webUrl = await SPHelper.default.get(SpConstants.NET_SERVICE_PROTOCOL, this.userProtocol) as string |
| 36 | - this.webviewController.loadUrl(this.webUrl) | ||
| 37 | - | ||
| 38 | } else if(params.contentID == "2"){ //"人民日报客户端用户隐私协议" | 38 | } else if(params.contentID == "2"){ //"人民日报客户端用户隐私协议" |
| 39 | this.webUrl = this.privateProtocol | 39 | this.webUrl = this.privateProtocol |
| 40 | this.webUrl = await SPHelper.default.get(SpConstants.PRIVATE_PROTOCOL, this.privateProtocol) as string | 40 | this.webUrl = await SPHelper.default.get(SpConstants.PRIVATE_PROTOCOL, this.privateProtocol) as string |
| 41 | - this.webviewController.loadUrl(this.webUrl) | ||
| 42 | }else if(params.contentID == "3"){ //注销协议 | 41 | }else if(params.contentID == "3"){ //注销协议 |
| 43 | this.webUrl = await SPHelper.default.get(SpConstants.LOGOUT_PROTOCOL, this.logoutProtocol) as string | 42 | this.webUrl = await SPHelper.default.get(SpConstants.LOGOUT_PROTOCOL, this.logoutProtocol) as string |
| 44 | - this.webviewController.loadUrl(this.webUrl) | ||
| 45 | } else if(params.contentID == "4"){ //华为用户认证协议 | 43 | } else if(params.contentID == "4"){ //华为用户认证协议 |
| 46 | this.webUrl = this.huaweiAuthProtocol | 44 | this.webUrl = this.huaweiAuthProtocol |
| 47 | - this.webviewController.loadUrl(this.webUrl) | ||
| 48 | } else if(params.contentID == "5"){ //收集个人信息明示清单 | 45 | } else if(params.contentID == "5"){ //收集个人信息明示清单 |
| 49 | this.webUrl = this.collectionProtocol | 46 | this.webUrl = this.collectionProtocol |
| 50 | - this.webviewController.loadUrl(this.webUrl) | ||
| 51 | } else if(params.contentID == "6"){ //第三方信息共享清单 | 47 | } else if(params.contentID == "6"){ //第三方信息共享清单 |
| 52 | this.webUrl = this.thirdVendorProtocol | 48 | this.webUrl = this.thirdVendorProtocol |
| 53 | - this.webviewController.loadUrl(this.webUrl) | ||
| 54 | } | 49 | } |
| 55 | } | 50 | } |
| 56 | 51 | ||
| @@ -75,7 +70,7 @@ struct LoginProtocolWebview { | @@ -75,7 +70,7 @@ struct LoginProtocolWebview { | ||
| 75 | .alignItems(VerticalAlign.Center) | 70 | .alignItems(VerticalAlign.Center) |
| 76 | .width('100%') | 71 | .width('100%') |
| 77 | .height(44) | 72 | .height(44) |
| 78 | - | 73 | + if(this.isConnectNetwork){ |
| 79 | Web({ src: this.webUrl, controller: this.webviewController }) | 74 | Web({ src: this.webUrl, controller: this.webviewController }) |
| 80 | .domStorageAccess(true) | 75 | .domStorageAccess(true) |
| 81 | .databaseAccess(true) | 76 | .databaseAccess(true) |
| @@ -89,6 +84,13 @@ struct LoginProtocolWebview { | @@ -89,6 +84,13 @@ struct LoginProtocolWebview { | ||
| 89 | Logger.info(TAG, 'onHttpErrorReceive event.response.getResponseCode:' + event?.response.getResponseCode()); | 84 | Logger.info(TAG, 'onHttpErrorReceive event.response.getResponseCode:' + event?.response.getResponseCode()); |
| 90 | }) | 85 | }) |
| 91 | .padding({bottom:this.contentID === "2" ? "40lpx" : 0 }) | 86 | .padding({bottom:this.contentID === "2" ? "40lpx" : 0 }) |
| 87 | + }else{ | ||
| 88 | + EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => { | ||
| 89 | + this.isConnectNetwork = NetworkUtil.isNetConnected() | ||
| 90 | + }}) | ||
| 91 | + .layoutWeight(1) | ||
| 92 | + .width('100%') | ||
| 93 | + } | ||
| 92 | } | 94 | } |
| 93 | }.width("100%") | 95 | }.width("100%") |
| 94 | .height("100%") | 96 | .height("100%") |
-
Please register or login to post a comment