Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
xugenyuan
2024-10-18 14:21:15 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7594a7c06f6d4030f2288d895b0bc7c9f591f97c
7594a7c0
1 parent
7fe5e0cf
ref |> log转换Logger
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
61 additions
and
48 deletions
sight_harmony/commons/wdShareBase/oh-package.json5
sight_harmony/commons/wdShareBase/src/main/ets/System/WDSystemShare.ets
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/RmhTitle.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentCustomDialog.ets
sight_harmony/features/wdComponent/src/main/ets/pages/OtherNormalUserHomePage.ets
sight_harmony/features/wdComponent/src/main/ets/pages/SearchCreatorPage.ets
sight_harmony/features/wdComponent/src/main/ets/pages/VisitorCommentPage.ets
sight_harmony/features/wdComponent/src/main/ets/utils/infomationCardClick.ets
sight_harmony/features/wdComponent/src/main/ets/utils/searchShowRed.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/GrayManageModel.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/LiveModel.ets
sight_harmony/features/wdPlayer/src/main/ets/controller/WDAliPlayerController.ets
sight_harmony/features/wdPlayer/src/main/ets/pages/AliPlayerRenderView.ets
sight_harmony/features/wdPlayer/src/main/ets/pages/WDPlayerRenderLiveView.ets
sight_harmony/features/wdPlayer/src/main/ets/pages/WDPlayerRenderVLiveView.ets
sight_harmony/features/wdPlayer/src/main/ets/pages/WDPlayerRenderView.ets
sight_harmony/commons/wdShareBase/oh-package.json5
View file @
7594a7c
...
...
@@ -7,5 +7,6 @@
"license"
:
"Apache-2.0"
,
"packageType"
:
"InterfaceHar"
,
"dependencies"
:
{
"wdKit"
:
"file:../wdKit"
}
}
\ No newline at end of file
...
...
sight_harmony/commons/wdShareBase/src/main/ets/System/WDSystemShare.ets
View file @
7594a7c
...
...
@@ -9,6 +9,7 @@ import { uniformTypeDescriptor as utd } from '@kit.ArkData';
import { JSON } from '@kit.ArkTS';
import { image } from '@kit.ImageKit';
import { WDShareBase } from '../WDShareBase';
import { Logger } from 'wdKit';
const TAG = "WDSystemShare"
...
...
@@ -32,9 +33,9 @@ export class WDSystemShare implements WDShareInterface {
selectionMode: systemShare.SelectionMode.SINGLE
});
console.lo
g(TAG, "分享控制器调用完成")
Logger.debu
g(TAG, "分享控制器调用完成")
} catch (e) {
console.log
(TAG, "异常1" + JSON.stringify(e))
Logger.error
(TAG, "异常1" + JSON.stringify(e))
fail(e)
}
})
...
...
@@ -45,7 +46,7 @@ export class WDSystemShare implements WDShareInterface {
if (contentType === ShareContentType.PrueText) {
let prueText = content as ShareContentText
console.lo
g(TAG, "分享纯文本")
Logger.debu
g(TAG, "分享纯文本")
resolve(new systemShare.SharedData({
utd: utd.UniformDataType.PLAIN_TEXT,
content: prueText.text
...
...
@@ -55,7 +56,7 @@ export class WDSystemShare implements WDShareInterface {
if (contentType === ShareContentType.ImageAndText) {
let imageAndText = content as ShareContentImageAndText
console.lo
g(TAG, "分享图片和文本")
Logger.debu
g(TAG, "分享图片和文本")
let data: systemShare.SharedData = new systemShare.SharedData({
utd: utd.UniformDataType.PLAIN_TEXT,
content: imageAndText.title
...
...
@@ -68,11 +69,11 @@ export class WDSystemShare implements WDShareInterface {
return
}
console.lo
g(TAG, "分享链接和文本")
Logger.debu
g(TAG, "分享链接和文本")
let link = content as ShareContentLink
let posterImg: Uint8Array | undefined = undefined
let shareLink = this.generateShareLink(link)
console.lo
g("TAG, 分享 shareLink ==> " + shareLink)
Logger.debu
g("TAG, 分享 shareLink ==> " + shareLink)
if (!context || !link.posterImg) {
let data: systemShare.SharedData = new systemShare.SharedData({
...
...
@@ -100,7 +101,7 @@ export class WDSystemShare implements WDShareInterface {
resolve(data)
})
.catch((e: Error) => {
console.log
(TAG, "异常" + JSON.stringify(e))
Logger.error
(TAG, "异常" + JSON.stringify(e))
fail(e)
})
})
...
...
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
View file @
7594a7c
...
...
@@ -663,7 +663,7 @@ export struct DynamicDetailComponent {
styleType: 1,
onCommentIconClick:()=>{
const info = componentUtils.getRectangleById('comment');
console.log(
JSON.stringify(info))
Logger.debug(TAG,
JSON.stringify(info))
if (!this.offsetY) {
this.offsetY = componentUtils.getRectangleById('comment').windowOffset.y
...
...
@@ -861,7 +861,7 @@ export struct DynamicDetailComponent {
this.newsStatusOfUser = data[0];
// Logger.info(TAG, `newsStatusOfUser:${JSON.stringify(this.newsStatusOfUser)}`)
} catch (exception) {
console
.error(TAG, JSON.stringify(exception))
Logger
.error(TAG, JSON.stringify(exception))
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
View file @
7594a7c
...
...
@@ -360,7 +360,7 @@ export struct ImageAndTextPageComponent {
this.getRecommend()
}
if (this.contentDetailData?.openLikes === 1) {
console.lo
g(TAG, '点赞this.getInteractDataStatus()')
Logger.debu
g(TAG, '点赞this.getInteractDataStatus()')
this.getInteractDataStatus()
this.queryContentInteractCount()
}
...
...
@@ -425,11 +425,11 @@ export struct ImageAndTextPageComponent {
}
// console.log(TAG,'contentDetailData', JSON.stringify(params.contentList))
let data = await MultiPictureDetailViewModel.getInteractDataStatus(params)
console.lo
g(TAG, '查询用户对作品点赞、收藏状态', JSON.stringify(data))
Logger.debu
g(TAG, '查询用户对作品点赞、收藏状态', JSON.stringify(data))
this.newsStatusOfUser = data[0];
// console.log(TAG, `newsStatusOfUser:${JSON.stringify(this.newsStatusOfUser)}`)
} catch (exception) {
console.error
(TAG,'exception', JSON.stringify(exception))
Logger.debug
(TAG,'exception', JSON.stringify(exception))
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/RmhTitle.ets
View file @
7594a7c
...
...
@@ -18,6 +18,8 @@ import { InfomationCardClick } from '../../utils/infomationCardClick'
import measure from '@ohos.measure'
import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel'
const TAG = "RmhTitle"
@Component
export struct RmhTitle {
@State compDTO: CompDTO = new CompDTO()
...
...
@@ -57,7 +59,7 @@ export struct RmhTitle {
status: this.followStatus == '0' ? 1 : 0,
}
ContentDetailRequest.postInteractAccentionOperate(params2).then(res => {
console.log('rmhTitle-data',
JSON.stringify(res.data))
Logger.debug(TAG, 'rmhTitle-data' +
JSON.stringify(res.data))
InfomationCardClick.track(
this.compDTO,
...
...
@@ -74,7 +76,7 @@ export struct RmhTitle {
this.followStatus = '1'
// 弹窗样式与何时调用待确认
ContentDetailRequest.postPointLevelOperate({ operateType: 6 }).then((res) => {
console.log(
'关注号主获取积分==', JSON.stringify(res.data))
Logger.debug(TAG,
'关注号主获取积分==', JSON.stringify(res.data))
if (res.data?.showToast) {
// ToastUtils.showToast(res.data.ruleName + '+' + res.data.rulePoint + '积分', 1000);
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentComponent.ets
View file @
7594a7c
import { DateTimeUtils, EmitterEventId, EmitterUtils, LazyDataSource,
Logger,
PublicDialogManager,
StringUtils } from 'wdKit/Index';
import { CommentItemCustomType, commentItemModel, WDPublicUserType } from '../model/CommentModel';
...
...
@@ -325,8 +326,9 @@ export struct CommentComponent {
,this.publishCommentModel.targetType
,this.firstPageHotIds)
.then(commentListModel => {
console.log('评论:', JSON.stringify(commentListModel.list))
Logger.debugOptimize('Comment', () => {
return '评论:' + JSON.stringify(commentListModel.list)
})
if (pageIndex == 1) {
// 保存第一页热门评论ids
if (commentListModel.hotIds.length > 0) {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentCustomDialog.ets
View file @
7594a7c
...
...
@@ -160,7 +160,7 @@ export struct CommentCustomDialog {
// this.textInputController.stopEditing()
inputMethod.getController().hideTextInput((err: BusinessError) => {
if (err) {
console.error
(`Failed to hideTextInput: ${JSON.stringify(err)}`);
Logger.error(TAG,
(`Failed to hideTextInput: ${JSON.stringify(err)}`);
return;
}
// console.log('Succeeded in hiding text input.');
...
...
@@ -188,7 +188,7 @@ export struct CommentCustomDialog {
// this.textInputController.stopEditing()
inputMethod.getController().hideTextInput((err: BusinessError) => {
if (err) {
console.error(
`Failed to hideTextInput: ${JSON.stringify(err)}`);
Logger.debug(TAG,
`Failed to hideTextInput: ${JSON.stringify(err)}`);
return;
}
// console.log('Succeeded in hiding text input.');
...
...
sight_harmony/features/wdComponent/src/main/ets/pages/OtherNormalUserHomePage.ets
View file @
7594a7c
import router from '@ohos.router'
import { Params } from 'wdBean';
import { DateTimeUtils, NetworkUtil, NumberFormatterUtils, StringUtils } from 'wdKit';
import { DateTimeUtils,
Logger,
NetworkUtil, NumberFormatterUtils, StringUtils } from 'wdKit';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import { TrackingPageBrowse, TrackConstants, ParamType, Tracking } from 'wdTracking/Index';
import { OtherHomePageBottomCommentComponent } from '../components/mine/home/OtherHomePageBottomCommentComponent';
...
...
@@ -422,7 +422,7 @@ struct OtherNormalUserHomePage {
}
this.getUserLevel()
}).catch((err:Error)=>{
console.log(TAG,
JSON.stringify(err))
Logger.error(TAG,
JSON.stringify(err))
})
}
getUserLevel(){
...
...
@@ -440,7 +440,7 @@ struct OtherNormalUserHomePage {
this.levelId = value[0].level
}
}).catch((err:Error)=>{
console.log
(TAG,JSON.stringify(err))
Logger.error
(TAG,JSON.stringify(err))
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/pages/SearchCreatorPage.ets
View file @
7594a7c
...
...
@@ -2,7 +2,7 @@ import { Params } from 'wdBean/Index';
import { CustomTitleUI } from '../components/reusable/CustomTitleUI';
import { router } from '@kit.ArkUI';
import { FollowListDetailItem } from '../viewmodel/FollowListDetailItem';
import { LazyDataSource, SPHelper, StringUtils } from 'wdKit/Index';
import { LazyDataSource,
Logger,
SPHelper, StringUtils } from 'wdKit/Index';
import SearcherAboutDataModel from '../model/SearcherAboutDataModel';
import { CreatorDetailRequestItem } from '../viewmodel/CreatorDetailRequestItem';
import { FollowListStatusRequestItem } from '../viewmodel/FollowListStatusRequestItem';
...
...
@@ -133,7 +133,7 @@ struct SearchCreatorPage {
this.isLoading = false
}).catch((err:Error)=>{
console.log(TAG,"请求失败"
)
Logger.error(TAG,"请求失败" + JSON.stringify(err)
)
this.isLoading = false
this.count = this.count===-1?0:this.count
})
...
...
@@ -190,7 +190,7 @@ struct SearchCreatorPage {
.layoutWeight(1)
.scrollBar(BarState.Off)
.onReachEnd(()=>{
console.lo
g(TAG,"触底了");
Logger.debu
g(TAG,"触底了");
if(!this.isLoading){
this.isLoading = true
//加载分页数据
...
...
sight_harmony/features/wdComponent/src/main/ets/pages/VisitorCommentPage.ets
View file @
7594a7c
import { TAG } from '@ohos/hypium/src/main/Constant';
import { ContentDTO } from 'wdBean/Index';
import { SpConstants } from 'wdConstant/Index'
import { DateTimeUtils, LazyDataSource, NetworkUtil, SPHelper, StringUtils} from 'wdKit/Index'
import { DateTimeUtils, LazyDataSource,
Logger,
NetworkUtil, SPHelper, StringUtils} from 'wdKit/Index'
import { ProcessUtils } from 'wdRouter/Index';
import { VisitorCommentComponent } from '../components/mine/home/VisitorCommentComponent';
import { CustomPullToRefresh } from '../components/reusable/CustomPullToRefresh';
...
...
@@ -176,7 +176,7 @@ struct VisitorCommentPage {
this.isGetRequest = true
this.isLoading = false
}).catch((err: Error) => {
console.log(TAG,
JSON.stringify(err))
Logger.error(TAG, "get " +
JSON.stringify(err))
this.isGetRequest = true
this.isLoading = false
})
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/infomationCardClick.ets
View file @
7594a7c
import { TrackingContent, TrackConstants, ParamType } from 'wdTracking';
import { CompDTO, ContentDTO } from 'wdBean';
import { Logger } from 'wdKit';
export class InfomationCardClick {
...
...
@@ -95,7 +96,7 @@ export class InfomationCardClick {
} else if (contentDTO.source) {
extParams['saAuthorName'] = contentDTO.source;
}
console.lo
g('InfomationCardClick-params:', JSON.stringify(extParams))
Logger.debu
g('InfomationCardClick-params:', JSON.stringify(extParams))
if (action === 'detailPageShow') {
TrackingContent.common(TrackConstants.EventType.Click, pageId, pageName, extParams);
} else if (action === 'like') {
...
...
@@ -106,7 +107,7 @@ export class InfomationCardClick {
TrackingContent.follow(bl, followUserId, followUserName, pageId, pageName, extParams)
}
} catch (err) {
console.log
('InfomationCardClick-err', JSON.stringify(err))
Logger.error
('InfomationCardClick-err', JSON.stringify(err))
}
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/searchShowRed.ets
View file @
7594a7c
import { Logger } from "wdKit";
export interface textItem {
content: string,
isRed: boolean
...
...
@@ -8,6 +10,8 @@ export interface titleInitRes {
textArr: textItem[]
}
const TAG = "SearchShowRed"
export class SearchShowRed {
// title: this.contentDTO.title
static titleInit(title: string) {
...
...
@@ -27,7 +31,9 @@ export class SearchShowRed {
res.push(content);
}
console.log('SearchShowRed-res', JSON.stringify(res))
Logger.debugOptimize(TAG, () => {
return 'SearchShowRed-res' + JSON.stringify(res)
})
SearchShowRed.formatTitle(
html.replaceAll('<em>', '').replaceAll('</em>', ''),
...
...
@@ -41,7 +47,9 @@ export class SearchShowRed {
titleMarked,
textArr
}
console.log('SearchShowRed-titleInitRes', JSON.stringify(titleInitRes))
Logger.debugOptimize(TAG, () => {
return 'SearchShowRed-titleInitRes ' + JSON.stringify(titleInitRes)
})
return titleInitRes
}
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/GrayManageModel.ets
View file @
7594a7c
import { Logger } from 'wdKit';
import { HttpUtils } from 'wdNetwork/Index';
export interface mournsInfoModel{
...
...
@@ -80,7 +81,7 @@ export class GrayManageModel {
this.videoList = mourns.videoList
this.serverList = mourns.serverList
this.grayUserList = mourns.greyUserList
console.lo
g(TAG, 'LaunchDataModel.mourns', JSON.stringify(mourns))
Logger.debu
g(TAG, 'LaunchDataModel.mourns', JSON.stringify(mourns))
}
// 国殇模式开启
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/LiveModel.ets
View file @
7594a7c
...
...
@@ -118,7 +118,7 @@ export class LiveModel {
fail(data.message)
return
}
console.log('LiveLikeComponent data.data',
data.data)
Logger.debug(TAG, 'LiveLikeComponent data.data ' +
data.data)
success(data.data)
}, (error: Error) => {
fail(error.message)
...
...
sight_harmony/features/wdPlayer/src/main/ets/controller/WDAliPlayerController.ets
View file @
7594a7c
...
...
@@ -157,7 +157,7 @@ export class WDAliPlayerController {
if (this.pageParam) {
console.log(
'播放视频pageParam', JSON.stringify(this.pageParam))
Logger.debug(TAG,
'播放视频pageParam', JSON.stringify(this.pageParam))
// 播放埋点
TrackingPlay.videoPositivePlay(Math.floor((DateTimeUtils.getTimeStamp() - this.creatStartTime) / 1000),
this.pageName, this.pageName, this.pageParam)
...
...
@@ -172,7 +172,7 @@ export class WDAliPlayerController {
if (this.pageParam) {
let initDuration = Math.floor(Number(this.duration) / 1000)
let currentPlayTime: number = Math.floor((DateTimeUtils.getTimeStamp() - this.creatStartTime) / 1000) //当前播放时间
console.log(
'播放结束')
Logger.debug(TAG,
'播放结束')
// 播放结束埋点
TrackingPlay.videoPlayEnd(currentPlayTime, initDuration, currentPlayTime, this.pageName, this.pageName,
this.pageParam)
...
...
@@ -279,7 +279,7 @@ export class WDAliPlayerController {
this.status = PlayerConstants.STATUS_ERROR;
this.watchStatus();
console.log(
'播放错误',JSON.stringify(error))
Logger.error(TAG,
'播放错误',JSON.stringify(error))
TrackingPlay.videoPlayError(errorInfo.getMsg(), this.pageName, this.pageName, this.pageParam)
}
});
...
...
sight_harmony/features/wdPlayer/src/main/ets/pages/AliPlayerRenderView.ets
View file @
7594a7c
import componentUtils from '@ohos.arkui.componentUtils';
import { WDPlayerController } from '../controller/WDPlayerController'
import { WindowModel } from 'wdKit';
import { Logger } from '../utils/Logger';
import { WindowModel, Logger } from 'wdKit';
import { enableAliPlayer } from '../utils/GlobalSetting';
import { WDAliPlayerController } from '../controller/WDAliPlayerController';
...
...
@@ -24,11 +23,11 @@ class MGPlayRenderViewIns {
static add() {
MGPlayRenderViewIns.intCount++;
WindowModel.shared.setWindowKeepScreenOn(true);
console.log(
"add-- +1")
Logger.debug(TAG,
"add-- +1")
}
static del() {
console.log(
"del-- -1")
Logger.debug(TAG,
"del-- -1")
MGPlayRenderViewIns.intCount--;
if (MGPlayRenderViewIns.intCount <= 0) {
WindowModel.shared.setWindowKeepScreenOn(false);
...
...
sight_harmony/features/wdPlayer/src/main/ets/pages/WDPlayerRenderLiveView.ets
View file @
7594a7c
import componentUtils from '@ohos.arkui.componentUtils';
import { WindowModel } from 'wdKit';
import { Logger } from '../utils/Logger';
import { WindowModel, Logger } from 'wdKit';
import { enableAliPlayer } from '../utils/GlobalSetting';
import { WDAliPlayerController } from '../controller/WDAliPlayerController';
...
...
@@ -23,11 +22,11 @@ class MGPlayRenderViewIns {
static add() {
MGPlayRenderViewIns.intCount++;
WindowModel.shared.setWindowKeepScreenOn(true);
console.log(
"add-- +1")
Logger.debug(TAG,
"add-- +1")
}
static del() {
console.log(
"del-- -1")
Logger.debug(TAG,
"del-- -1")
MGPlayRenderViewIns.intCount--;
if (MGPlayRenderViewIns.intCount <= 0) {
WindowModel.shared.setWindowKeepScreenOn(false);
...
...
sight_harmony/features/wdPlayer/src/main/ets/pages/WDPlayerRenderVLiveView.ets
View file @
7594a7c
...
...
@@ -24,11 +24,11 @@ class MGPlayRenderViewIns {
static add() {
MGPlayRenderViewIns.intCount++;
WindowModel.shared.setWindowKeepScreenOn(true);
console.log(
"add-- +1")
Logger.debug(TAG,
"add-- +1")
}
static del() {
console.log(
"del-- -1")
Logger.debug(TAG,
"del-- -1")
MGPlayRenderViewIns.intCount--;
if (MGPlayRenderViewIns.intCount <= 0) {
WindowModel.shared.setWindowKeepScreenOn(false);
...
...
sight_harmony/features/wdPlayer/src/main/ets/pages/WDPlayerRenderView.ets
View file @
7594a7c
...
...
@@ -24,11 +24,11 @@ class MGPlayRenderViewIns {
static add() {
MGPlayRenderViewIns.intCount++;
WindowModel.shared.setWindowKeepScreenOn(true);
console.log(
"add-- +1")
Logger.debug(TAG,
"add-- +1")
}
static del() {
console.log(
"del-- -1")
Logger.debug(TAG,
"del-- -1")
MGPlayRenderViewIns.intCount--;
if (MGPlayRenderViewIns.intCount <= 0) {
WindowModel.shared.setWindowKeepScreenOn(false);
...
...
@@ -66,7 +66,6 @@ export struct WDPlayerRenderView {
}
this.playerController.onVideoSizeChange = (width: number, height: number) => {
console.log(`WDPlayerRenderView onVideoSizeChange width:${width} videoTop:${height}`)
Logger.info(TAG, ` onVideoSizeChange width:${width} height:${height}`)
this.videoWidth = width;
this.videoHeight = height;
...
...
Please
register
or
login
to post a comment