xugenyuan

ref |> 文章详情页增加日志

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
... ... @@ -96,12 +96,12 @@ export struct WdWebLocalComponent {
url = url.replace("%(?![0-9a-fA-F]{2})", "%25")
.replace("\\+", "%2B");
url = decodeURIComponent(url)
Logger.debug(TAG, 'Web onLoadIntercept url: ' + url);
if (url.startsWith(BridgeUtil.YY_RETURN_DATA)) {
this.webviewControl.handlerReturnData(url)
return true
}
if (url.startsWith(BridgeUtil.YY_OVERRIDE_SCHEMA)) {
Logger.debug(TAG, 'flushMessageQueue:'+url);
// this.webviewControl.flushMessageQueue()
this.webviewControl.receiveDataFromH5(url)
return true
... ...
... ... @@ -199,6 +199,9 @@ export struct H5NewsWebPageComponent {
// 已登录->查询用户对作品点赞、收藏状态
private async getInteractDataStatus() {
if (!HttpUtils.isLogin()) {
return
}
try {
const params: batchLikeAndCollectParams = {
contentList: [
... ...
... ... @@ -40,7 +40,7 @@ import { LottieView } from '../components/lottie/LottieView';
const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
const TAG: string = 'ImageAndTextPageComponent'
const TAG: string = 'ImageAndTextWebComponent'
/**
* 图文详情页
* */
... ... @@ -410,6 +410,9 @@ export struct ImageAndTextPageComponent {
// 已登录->查询用户对作品点赞、收藏状态
private async getInteractDataStatus() {
if (!HttpUtils.isLogin()) {
return
}
try {
const params: batchLikeAndCollectParams = {
contentList: [
... ... @@ -512,6 +515,7 @@ export struct ImageAndTextPageComponent {
}
aboutToAppear() {
Logger.debug(TAG, '文章详情页 aboutToAppear,开始请求接口数据');
this.getDetail()
this.screenHeight = DisplayUtils.getDeviceHeight()
this.initAnimationConfig();
... ...
... ... @@ -24,6 +24,7 @@ export struct ImageAndTextWebComponent {
private webPrepared = false;
private dataPrepared = false;
async onDetailDataUpdated() {
Logger.debug(TAG, '详情内容已获取接口数据');
if (this.action) {
let contentId: string = ''
let contentType: string = ''
... ... @@ -92,6 +93,10 @@ export struct ImageAndTextWebComponent {
}
aboutToAppear(): void {
Logger.debug(TAG, 'H5模板加载控件 aboutToAppear');
}
build() {
Column() {
WdWebLocalComponent({
... ... @@ -115,15 +120,16 @@ export struct ImageAndTextWebComponent {
}
private onWebPrepared() {
Logger.debug(TAG, 'H5模板已加载,prepared');
this.webPrepared = true
this.trySendData2H5()
}
private sendContentData2H5(h5ReceiveAppData: H5ReceiveDetailBean) {
let jsonString = JSON.stringify(h5ReceiveAppData);
Logger.debug('ImageAndTextWebComponent', 'jsCall_receiveAppData',jsonString);
Logger.debug(TAG, '传递html数据至H5 jsCall_receiveAppData',jsonString);
this.webviewControl.callHandle(NativeCallH5Type.jsCall_receiveAppData, jsonString, (data: string) => {
Logger.debug('ImageAndTextWebComponent', "from js data = " + data);
Logger.debug(TAG, "from js data = " + data);
})
}
}
\ No newline at end of file
... ...