ref |> 文章详情页增加日志
Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
Showing
4 changed files
with
17 additions
and
4 deletions
| @@ -96,12 +96,12 @@ export struct WdWebLocalComponent { | @@ -96,12 +96,12 @@ export struct WdWebLocalComponent { | ||
| 96 | url = url.replace("%(?![0-9a-fA-F]{2})", "%25") | 96 | url = url.replace("%(?![0-9a-fA-F]{2})", "%25") |
| 97 | .replace("\\+", "%2B"); | 97 | .replace("\\+", "%2B"); |
| 98 | url = decodeURIComponent(url) | 98 | url = decodeURIComponent(url) |
| 99 | + Logger.debug(TAG, 'Web onLoadIntercept url: ' + url); | ||
| 99 | if (url.startsWith(BridgeUtil.YY_RETURN_DATA)) { | 100 | if (url.startsWith(BridgeUtil.YY_RETURN_DATA)) { |
| 100 | this.webviewControl.handlerReturnData(url) | 101 | this.webviewControl.handlerReturnData(url) |
| 101 | return true | 102 | return true |
| 102 | } | 103 | } |
| 103 | if (url.startsWith(BridgeUtil.YY_OVERRIDE_SCHEMA)) { | 104 | if (url.startsWith(BridgeUtil.YY_OVERRIDE_SCHEMA)) { |
| 104 | - Logger.debug(TAG, 'flushMessageQueue:'+url); | ||
| 105 | // this.webviewControl.flushMessageQueue() | 105 | // this.webviewControl.flushMessageQueue() |
| 106 | this.webviewControl.receiveDataFromH5(url) | 106 | this.webviewControl.receiveDataFromH5(url) |
| 107 | return true | 107 | return true |
| @@ -199,6 +199,9 @@ export struct H5NewsWebPageComponent { | @@ -199,6 +199,9 @@ export struct H5NewsWebPageComponent { | ||
| 199 | 199 | ||
| 200 | // 已登录->查询用户对作品点赞、收藏状态 | 200 | // 已登录->查询用户对作品点赞、收藏状态 |
| 201 | private async getInteractDataStatus() { | 201 | private async getInteractDataStatus() { |
| 202 | + if (!HttpUtils.isLogin()) { | ||
| 203 | + return | ||
| 204 | + } | ||
| 202 | try { | 205 | try { |
| 203 | const params: batchLikeAndCollectParams = { | 206 | const params: batchLikeAndCollectParams = { |
| 204 | contentList: [ | 207 | contentList: [ |
| @@ -40,7 +40,7 @@ import { LottieView } from '../components/lottie/LottieView'; | @@ -40,7 +40,7 @@ import { LottieView } from '../components/lottie/LottieView'; | ||
| 40 | 40 | ||
| 41 | const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; | 41 | const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; |
| 42 | 42 | ||
| 43 | -const TAG: string = 'ImageAndTextPageComponent' | 43 | +const TAG: string = 'ImageAndTextWebComponent' |
| 44 | /** | 44 | /** |
| 45 | * 图文详情页 | 45 | * 图文详情页 |
| 46 | * */ | 46 | * */ |
| @@ -410,6 +410,9 @@ export struct ImageAndTextPageComponent { | @@ -410,6 +410,9 @@ export struct ImageAndTextPageComponent { | ||
| 410 | 410 | ||
| 411 | // 已登录->查询用户对作品点赞、收藏状态 | 411 | // 已登录->查询用户对作品点赞、收藏状态 |
| 412 | private async getInteractDataStatus() { | 412 | private async getInteractDataStatus() { |
| 413 | + if (!HttpUtils.isLogin()) { | ||
| 414 | + return | ||
| 415 | + } | ||
| 413 | try { | 416 | try { |
| 414 | const params: batchLikeAndCollectParams = { | 417 | const params: batchLikeAndCollectParams = { |
| 415 | contentList: [ | 418 | contentList: [ |
| @@ -512,6 +515,7 @@ export struct ImageAndTextPageComponent { | @@ -512,6 +515,7 @@ export struct ImageAndTextPageComponent { | ||
| 512 | } | 515 | } |
| 513 | 516 | ||
| 514 | aboutToAppear() { | 517 | aboutToAppear() { |
| 518 | + Logger.debug(TAG, '文章详情页 aboutToAppear,开始请求接口数据'); | ||
| 515 | this.getDetail() | 519 | this.getDetail() |
| 516 | this.screenHeight = DisplayUtils.getDeviceHeight() | 520 | this.screenHeight = DisplayUtils.getDeviceHeight() |
| 517 | this.initAnimationConfig(); | 521 | this.initAnimationConfig(); |
| @@ -24,6 +24,7 @@ export struct ImageAndTextWebComponent { | @@ -24,6 +24,7 @@ export struct ImageAndTextWebComponent { | ||
| 24 | private webPrepared = false; | 24 | private webPrepared = false; |
| 25 | private dataPrepared = false; | 25 | private dataPrepared = false; |
| 26 | async onDetailDataUpdated() { | 26 | async onDetailDataUpdated() { |
| 27 | + Logger.debug(TAG, '详情内容已获取接口数据'); | ||
| 27 | if (this.action) { | 28 | if (this.action) { |
| 28 | let contentId: string = '' | 29 | let contentId: string = '' |
| 29 | let contentType: string = '' | 30 | let contentType: string = '' |
| @@ -92,6 +93,10 @@ export struct ImageAndTextWebComponent { | @@ -92,6 +93,10 @@ export struct ImageAndTextWebComponent { | ||
| 92 | 93 | ||
| 93 | } | 94 | } |
| 94 | 95 | ||
| 96 | + aboutToAppear(): void { | ||
| 97 | + Logger.debug(TAG, 'H5模板加载控件 aboutToAppear'); | ||
| 98 | + } | ||
| 99 | + | ||
| 95 | build() { | 100 | build() { |
| 96 | Column() { | 101 | Column() { |
| 97 | WdWebLocalComponent({ | 102 | WdWebLocalComponent({ |
| @@ -115,15 +120,16 @@ export struct ImageAndTextWebComponent { | @@ -115,15 +120,16 @@ export struct ImageAndTextWebComponent { | ||
| 115 | } | 120 | } |
| 116 | 121 | ||
| 117 | private onWebPrepared() { | 122 | private onWebPrepared() { |
| 123 | + Logger.debug(TAG, 'H5模板已加载,prepared'); | ||
| 118 | this.webPrepared = true | 124 | this.webPrepared = true |
| 119 | this.trySendData2H5() | 125 | this.trySendData2H5() |
| 120 | } | 126 | } |
| 121 | 127 | ||
| 122 | private sendContentData2H5(h5ReceiveAppData: H5ReceiveDetailBean) { | 128 | private sendContentData2H5(h5ReceiveAppData: H5ReceiveDetailBean) { |
| 123 | let jsonString = JSON.stringify(h5ReceiveAppData); | 129 | let jsonString = JSON.stringify(h5ReceiveAppData); |
| 124 | - Logger.debug('ImageAndTextWebComponent', 'jsCall_receiveAppData',jsonString); | 130 | + Logger.debug(TAG, '传递html数据至H5 jsCall_receiveAppData',jsonString); |
| 125 | this.webviewControl.callHandle(NativeCallH5Type.jsCall_receiveAppData, jsonString, (data: string) => { | 131 | this.webviewControl.callHandle(NativeCallH5Type.jsCall_receiveAppData, jsonString, (data: string) => { |
| 126 | - Logger.debug('ImageAndTextWebComponent', "from js data = " + data); | 132 | + Logger.debug(TAG, "from js data = " + data); |
| 127 | }) | 133 | }) |
| 128 | } | 134 | } |
| 129 | } | 135 | } |
-
Please register or login to post a comment