huangyuxin_wd
Showing 60 changed files with 753 additions and 289 deletions
... ... @@ -2,7 +2,7 @@
"string": [
{
"name": "app_name",
"value": "Sight"
"value": "人民日报"
},
{
"name": "app_desc",
... ... @@ -27,10 +27,6 @@
{
"name": "location_reason",
"value": " "
},
{
"name": "STORE_PERSISTENT_DATA",
"value": "STORE_PERSISTENT_DATASTORE_PERSISTENT_DATASTORE_PERSISTENT_DATA"
}
]
}
... ...
... ... @@ -14,6 +14,7 @@ export class SpConstants{
static USER_HEAD_PHOTO_URL = "headPhotoUrl"
static USER_SEX = "sex"
static USER_BIRTHDAY = "birthday"
static USER_MPAASUTDID = "mpaasUtdid"
//协议相关
static NET_SERVICE_PROTOCOL = "user_protocol" //人民日报客户端网络服务使用协议
static PRIVATE_PROTOCOL = "private_protocol" //人民日报客户端用户隐私协议
... ...
... ... @@ -10,8 +10,8 @@
"@tingyun/harmonyos": "file:./src/main/ets/tingyunAPM/tingyun_0.0.6.har",
"@umeng/common": "^1.0.21",
"@umeng/analytics": "^1.0.19",
// "@mpaas/udid": "0.0.3",
// "@mpaas/upgrade": "0.0.3",
// "@mpaas/framework": "0.0.3"
"@mpaas/udid": "0.0.2",
"@mpaas/upgrade": "0.0.2",
"@mpaas/framework": "0.0.2"
}
}
... ...
// import { MPUpgradeService } from '@mpaas/upgrade'
// import { upgradeRes } from '@mpaas/upgrade/src/main/ets/t4/a'
import { MPUpgradeService } from '@mpaas/upgrade'
import { upgradeRes } from '@mpaas/upgrade/src/main/ets/t4/a'
import { AppUtils } from '../utils/AppUtils'
import { SPHelper } from '../utils/SPHelper'
... ... @@ -16,7 +16,7 @@ export class MpaasUpgradeCheck {
/// 默认提示框
checkNewVersionAndShow() {
try {
// MPUpgradeService.checkNewVersionAndShow()
MPUpgradeService.checkNewVersionAndShow()
} catch (error) {
console.log("mpaas upgrade fail", JSON.stringify(error))
}
... ... @@ -25,70 +25,69 @@ export class MpaasUpgradeCheck {
checkNewVersion(): Promise<UpgradeTipContent | null> {
return new Promise((resolve, fail) => {
fail("a")
// MPUpgradeService.checkNewVersion().then((response)=>{
// let str = JSON.stringify(response)
// console.log("mpaas upgrade check", str)
//
// /*
// {
// "android64FileSize": 0,
// "downloadURL": "https://appgallery.huawei.com/#/app",
// "fileSize": 0,
// "fullMd5": "no md5",
// "guideMemo": "欢迎使用新版本",
// "isWifi": 0,
// "netType": "ALL",
// "newestVersion": "1.0.1",
// "resultStatus": 204,
// "silentType": 0,
// "upgradeVersion": "1.0.1"
// }*/
//
// let res = response as upgradeRes
//
// // AliUpgradeNewVersion = 201, /*当前使用的已是最新版本*/
// // AliUpgradeOneTime = 202, /*客户端已有新版本,单次提醒*/
// // AliUpgradeForceUpdate = 203, /*客户端已有新版本,强制升级(已废弃)*/
// // AliUpgradeEveryTime = 204, /*客户端已有新版本,多次提醒*/
// // AliUpgradeRejectLogin = 205, /*限制登录(已废弃)*/
// // AliUpgradeForceUpdateWithLogin = 206 /*客户端已有新版本,强制升级*/
//
// const currentAppVersoin = AppUtils.getAppVersionName()
//
// if (res.resultStatus == 201) {
// resolve(null)
// return
// }
//
// // 单次升级控制
// if (res.resultStatus == 202) {
// const oldOnceValue = SPHelper.default.getSync("upgradeOnceKey", false) as boolean
// if (true == oldOnceValue) {
// resolve(null)
// return
// }
// SPHelper.default.save("upgradeOnceKey", true)
// } else {
// SPHelper.default.save("upgradeOnceKey", false)
// }
//
// if (res.resultStatus == 202 || res.resultStatus == 204 || res.resultStatus == 206) {
// let content: UpgradeTipContent = {
// content: res.guideMemo,
// newVersion: res.upgradeVersion,
// downloadUrl: res.downloadURL,
// forceUpgrade: res.resultStatus == 206
// }
// resolve(content)
// return
// }
//
// resolve(null)
// }).catch((error: Error) => {
// console.log("mpaas upgrade fail", `name: ${error.name}, message: ${error.message}, \nstack: ${error.stack}`)
// fail("检测升级失败")
// })
MPUpgradeService.checkNewVersion().then((response)=>{
let str = JSON.stringify(response)
console.log("mpaas upgrade check", str)
/*
{
"android64FileSize": 0,
"downloadURL": "https://appgallery.huawei.com/#/app",
"fileSize": 0,
"fullMd5": "no md5",
"guideMemo": "欢迎使用新版本",
"isWifi": 0,
"netType": "ALL",
"newestVersion": "1.0.1",
"resultStatus": 204,
"silentType": 0,
"upgradeVersion": "1.0.1"
}*/
let res = response as upgradeRes
// AliUpgradeNewVersion = 201, /*当前使用的已是最新版本*/
// AliUpgradeOneTime = 202, /*客户端已有新版本,单次提醒*/
// AliUpgradeForceUpdate = 203, /*客户端已有新版本,强制升级(已废弃)*/
// AliUpgradeEveryTime = 204, /*客户端已有新版本,多次提醒*/
// AliUpgradeRejectLogin = 205, /*限制登录(已废弃)*/
// AliUpgradeForceUpdateWithLogin = 206 /*客户端已有新版本,强制升级*/
const currentAppVersoin = AppUtils.getAppVersionName()
if (res.resultStatus == 201) {
resolve(null)
return
}
// 单次升级控制
if (res.resultStatus == 202) {
const oldOnceValue = SPHelper.default.getSync("upgradeOnceKey", false) as boolean
if (true == oldOnceValue) {
resolve(null)
return
}
SPHelper.default.save("upgradeOnceKey", true)
} else {
SPHelper.default.save("upgradeOnceKey", false)
}
if (res.resultStatus == 202 || res.resultStatus == 204 || res.resultStatus == 206) {
let content: UpgradeTipContent = {
content: res.guideMemo,
newVersion: res.upgradeVersion,
downloadUrl: res.downloadURL,
forceUpgrade: res.resultStatus == 206
}
resolve(content)
return
}
resolve(null)
}).catch((error: Error) => {
console.log("mpaas upgrade fail", `name: ${error.name}, message: ${error.message}, \nstack: ${error.stack}`)
fail("检测升级失败")
})
})
}
}
\ No newline at end of file
... ...
// import { MPFramework } from '@mpaas/framework'
import { MPFramework } from '@mpaas/framework'
import { common } from '@kit.AbilityKit';
/*
... ... @@ -12,18 +12,17 @@ export class MpaasUtils {
// 启动时onCreate()方法调用
static initApp(context: common.UIAbilityContext) {
// MPFramework.create(context);
MPFramework.create(context);
}
// 获取mPaaS utdid
static async mpaasUtdid() {
// let utdid = await MPFramework.instance.udid
let utdid = "xxxxxxxxxx"
let utdid = await MPFramework.instance.udid
return utdid
}
// 登录和退出登录调用,用来管理白名单用
static setupUserId(userId?: string) {
// MPFramework.instance.userId = userId
MPFramework.instance.userId = userId
}
}
\ No newline at end of file
... ...
... ... @@ -26,7 +26,7 @@ export class HttpParams {
headers['imei'] = DeviceUtil.clientId()
headers['Accept-Language'] = 'zh'
headers['timestamp'] = DateTimeUtils.getTimeStamp() + ''
headers['mpassid'] = 'ZbHTMeTsfaYDAHqt8ZHIzcPs'
headers['mpaasid'] = HttpUtils.getMpaasUtdid()??'ZbHTMeTsfaYDAHqt8ZHIzcPs'
HttpParams.setLocationHeader(headers)
if (HttpUtils.isLogin()) {
headers['RMRB-X-TOKEN'] = HttpUtils.getUserToken()
... ...
... ... @@ -66,6 +66,10 @@ export class HttpUtils {
return SPHelper.default.getSync(SpConstants.USER_JWT_TOKEN, "") as string
}
static getMpaasUtdid(): string {
return SPHelper.default.getSync(SpConstants.USER_MPAASUTDID, "") as string
}
public static isLogin(): boolean {
let token = HttpUtils.getUserToken()
if (token == null || token == undefined || token.length <= 0) {
... ...
... ... @@ -17,3 +17,7 @@ export { RouterJumpInterceptor, JumpInterceptorAction } from './src/main/ets/rou
export { AppInnerLink } from './src/main/ets/utils/AppInnerLink'
export { ContentType } from './src/main/ets/common/ContentType'
export { AppInnerLinkGenerator } from "./src/main/ets/utils/AppInnerLinkGenerator"
export { AppLinkingManager } from "./src/main/ets/utils/AppLinkingManager"
\ No newline at end of file
... ...
import { ContentDetailDTO, ContentDTO, FrontLinkObject } from 'wdBean/Index';
import { BreakpointSystem } from 'wdKit/Index';
import { ContentType } from 'wdRouter/Index';
import { ContentType } from '../common/ContentType';
export class DeepLinkUtil {
export class AppInnerLinkGenerator {
private static DEEP_LINK_PREFIX = "rmrbapp://rmrb.app/openwith"
static generateDeepLinkWithConent(content: ContentDetailDTO): string {
return DeepLinkUtil.generate(content.newsType, content.newsId +'', content.reLInfo?.relId, content.newsLinkUrl)
return AppInnerLinkGenerator.generate(content.newsType, content.newsId +'', content.reLInfo?.relId, content.newsLinkUrl)
}
static generateDeepLinkWithProgram(content: ContentDTO) {
return DeepLinkUtil.generate(Number(content.objectType), content.objectId +'', content.relId, content.linkUrl)
return AppInnerLinkGenerator.generate(Number(content.objectType), content.objectId +'', content.relId, content.linkUrl)
}
static generateDeepLinkWithFrontObjectLink(content: FrontLinkObject) {
return DeepLinkUtil.generate(Number(content.newsType), content.newsId +'', content.newsRelId + '', content.linkUrl)
return AppInnerLinkGenerator.generate(Number(content.newsType), content.newsId +'', content.newsRelId + '', content.linkUrl)
}
private static generate(contentType: number, contentId?: string, relId?: string, link?: string): string {
let deeplink = DeepLinkUtil.DEEP_LINK_PREFIX
static generate(contentType: number, contentId?: string, relId?: string, link?: string): string {
let deeplink = AppInnerLinkGenerator.DEEP_LINK_PREFIX
let pubParam = `&contentId=${contentId}&relId=${relId}&skipType=1`
let pubParam = `&contentId=${contentId ?? ""}&relId=${relId ?? ""}&skipType=1`
let type: ContentType = Number(contentType)
switch (type) {
... ... @@ -65,5 +64,17 @@ export class DeepLinkUtil {
return deeplink
}
static generateCreatorPage(creatorId: string): string {
let deeplink = AppInnerLinkGenerator.DEEP_LINK_PREFIX
deeplink += `?type=owner_page&creatorId=${creatorId}&skipType=1`
return deeplink
}
static generateH5Topic(pageId:string, url:string) {
// rmrbapp://rmrb.app/openwith?type=topic&subType=h5&pageId=124&relId=23&url=https%3A%2F%2Fbaidu.com&skipType=1
let deeplink = AppInnerLinkGenerator.DEEP_LINK_PREFIX
deeplink += `?type=topic&subType=h5&pageId=${pageId}&relId=&url=${encodeURIComponent(url)}&skipType=1`
return deeplink
}
}
\ No newline at end of file
... ...
import { Logger } from 'wdKit'
import { Want } from '@kit.AbilityKit'
import { url } from '@kit.ArkTS'
import { AppInnerLinkGenerator } from './AppInnerLinkGenerator'
import { ContentType } from '../common/ContentType'
import { AppInnerLink } from './AppInnerLink'
import { HttpBizUtil, HttpUrlUtils, ResponseDTO } from 'wdNetwork'
import { ContentDetailDTO } from 'wdBean'
const TAG = "AppLinkingManager"
// 系统AppLinking拉起管理类
export class AppLinkingManager {
static readonly TEST_HOST = "pd-people-uat.pdnews.cn"
static readonly PRODUCT_HOST = "www.peopleapp.com"
private hasEnterMain = false
private lastUrlObj?: url.URL
private static manager: AppLinkingManager
private constructor() {
}
public static sharedInstance() {
if (!AppLinkingManager.manager) {
AppLinkingManager.manager = new AppLinkingManager()
}
return AppLinkingManager.manager
}
onWant(want: Want) {
this.onNewWant(want, true)
}
onNewWant(want: Want, startup: boolean = false) {
Logger.debug(TAG, "want: " + JSON.stringify(want))
let uri = want?.uri
if (!uri) {
return
}
let urlObject = url.URL.parseURL(want?.uri);
if (urlObject.protocol != "https:") {
return
}
if (urlObject.host != AppLinkingManager.PRODUCT_HOST && urlObject.host != AppLinkingManager.TEST_HOST) {
return
}
this.lastUrlObj = urlObject
if (this.hasEnterMain) {
this.comsumeLastUriContent()
}
}
// 首次进入主页,即可解析跳转推送
onReachMainPage() {
this.hasEnterMain = true
this.comsumeLastUriContent()
}
comsumeLastUriContent() {
Logger.debug(TAG, "尝试消费拉起链接: " + this.lastUrlObj?.toString())
if (!this.lastUrlObj) {
return
}
let path = this.lastUrlObj?.pathname ?? ""
if (this.dealWithRMHArticle()
|| this.dealWithNormalArticle()
|| this.dealWithCreator()
|| this.dealWithTopic()) {
this.lastUrlObj = undefined
return
}
Logger.debug(TAG, "未处理path: " + path)
this.lastUrlObj = undefined
}
dealWithRMHArticle() {
let path = this.lastUrlObj?.pathname ?? ""
if (path.startsWith("/rmharticle")) {
let contentId = path.split("/").pop()
let innerLink = AppInnerLinkGenerator.generate(ContentType.ImageText, contentId, undefined, undefined)
this.jumpInnerLink(innerLink)
return true
}
if (path.startsWith("/rmhphotos")) {
let contentId = path.split("/").pop()
let innerLink = AppInnerLinkGenerator.generate(ContentType.Pictures, contentId, undefined, undefined)
this.jumpInnerLink(innerLink)
return true
}
if (path.startsWith("/rmhmoments")) {
let contentId = path.split("/").pop()
let innerLink = AppInnerLinkGenerator.generate(ContentType.DynamicImageText, contentId, undefined, undefined)
this.jumpInnerLink(innerLink)
return true
}
if (path.startsWith("/rmhvideo")) {
let contentId = path.split("/").pop()
let innerLink = AppInnerLinkGenerator.generate(ContentType.Video, contentId, undefined, undefined)
this.jumpInnerLink(innerLink)
return true
}
if (path.startsWith("/column")) {
let contentId = path.split("/").pop()
if (!contentId || contentId.includes("-")) {
return false
}
let innerLink = AppInnerLinkGenerator.generate(ContentType.Live, contentId, undefined, undefined)
this.jumpInnerLink(innerLink)
return true
}
return false
}
dealWithCreator() {
let path = this.lastUrlObj?.pathname ?? ""
if (path.startsWith("/author")) {
let creatorId = path.split("/").pop()
let innerLink = AppInnerLinkGenerator.generateCreatorPage(creatorId ?? "")
this.jumpInnerLink(innerLink)
return true
}
return false
}
dealWithTopic() {
let path = this.lastUrlObj?.pathname ?? ""
let idArray = path.split("/").pop()?.split("-")
if (idArray?.length != 2) {
return false
}
let pageId = idArray[0]
let topicId = idArray[1]
let url = `${this.lastUrlObj!.protocol}//${this.lastUrlObj!.host}/h${path}`
if (path.startsWith("/votetopic")) {
let innerLink = AppInnerLinkGenerator.generateH5Topic(pageId, url)
this.jumpInnerLink(innerLink)
return true
}
if (path.startsWith("/articletopic")) {
let innerLink = AppInnerLinkGenerator.generateH5Topic(pageId, url)
this.jumpInnerLink(innerLink)
}
if (path.startsWith("/livetopic")) {
let innerLink = AppInnerLinkGenerator.generateH5Topic(pageId, url)
this.jumpInnerLink(innerLink)
}
if (path.startsWith("/timelinetopic")) {
let innerLink = AppInnerLinkGenerator.generateH5Topic(pageId, url)
this.jumpInnerLink(innerLink)
}
return false
}
dealWithNormalArticle() {
let path = this.lastUrlObj?.pathname ?? ""
if (!path.startsWith("/column")) {
return false
}
let idArray = path.split("/").pop()?.split("-")
if (idArray?.length != 2) {
return false
}
let contentId = idArray[0]
let relId = idArray[1]
let url = HttpUrlUtils.getHost() + HttpUrlUtils.DETAIL_PATH
url = url + "?&contentId=" + contentId + "&relId=" + relId // + "&relType=" + relType
HttpBizUtil.get<ResponseDTO<ContentDetailDTO[]>>(url).then((data: ResponseDTO<ContentDetailDTO[]>) => {
if (data.code != 0) {
Logger.warn(TAG, "error " + JSON.stringify(data))
return
}
if (!data.data || data.data.length == 0) {
Logger.warn(TAG, "empty data!!!")
return
}
let innerLink = AppInnerLinkGenerator.generateDeepLinkWithConent(data.data[0])
this.jumpInnerLink(innerLink)
}, (error: Error) => {
Logger.warn(TAG, "error " + JSON.stringify(error))
})
return true
}
jumpInnerLink(innerLink: string) {
Logger.debug(TAG, "即将跳转链接: " + innerLink)
AppInnerLink.jumpWithLink(innerLink)
}
}
\ No newline at end of file
... ...
... ... @@ -142,6 +142,25 @@ export class ProcessUtils {
content.traceInfo = compDTO.traceInfo
return content
}
static commentBeanToContentBean(comment:commentInfo){
if(comment == null){
return
}
let content = new ContentDTO()
content.objectType = comment.objectType||'0'
content.objectLevel = comment.objectLevel
content.objectId = comment.newsId
content.pageId = comment.pageId||''
content.newsTitle = comment.newsTitle
content.linkUrl = comment.linkUrl
content.relId = comment.relId
content.relType = comment.relType
content.commentInfo = comment
content.customParamTargetLayout = "comment"
return content
}
/**
* 页面跳转
*/
... ... @@ -241,6 +260,8 @@ export class ProcessUtils {
extra: {
relType: content?.relType,
relId: content?.relId,
sourcePage: '5',
commentId: content?.commentInfo?.commentId
} as ExtraDTO,
targetLayout: content.customParamTargetLayout
} as Params,
... ... @@ -310,7 +331,9 @@ export class ProcessUtils {
relType: content?.relType,
relId: content?.relId,
channelId: content?.channelId,
pageId: content?.pageId
pageId: content?.pageId,
sourcePage: '5',
commentId: content?.commentInfo?.commentId
} as ExtraDTO,
targetLayout: content.customParamTargetLayout
} as Params,
... ... @@ -336,6 +359,10 @@ export class ProcessUtils {
type: 'JUMP_H5_BY_WEB_VIEW',
params: {
url: content.linkUrl,
extra: {
sourcePage: '5',
commentId: content?.commentInfo?.commentId
} as ExtraDTO
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
... ... @@ -351,21 +378,28 @@ export class ProcessUtils {
}
static commentGotoWeb(content: commentInfo) {
let taskAction: Action = {
type: 'JUMP_INNER_NEW_PAGE',
params: {
contentID: content?.newsId,
pageID: 'IMAGE_TEXT_DETAIL',
extra: {
relType: content?.relType,
relId: content?.relId,
sourcePage: '5',
commentId: content?.commentId
} as ExtraDTO
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
Logger.debug(TAG, `commentGotoWeb, ${content.newsId}`);
let contentBean = ProcessUtils.commentBeanToContentBean(content)
if(contentBean == null){
return
}
ProcessUtils.processPage(contentBean)
// let taskAction: Action = {
// type: 'JUMP_INNER_NEW_PAGE',
// params: {
// contentID: content?.newsId,
// url:content?.linkUrl,
// pageID: 'IMAGE_TEXT_DETAIL',
// extra: {
// relType: content?.relType,
// relId: content?.relId,
// sourcePage: '5',
// commentId: content?.commentId
// } as ExtraDTO
// } as Params,
// };
// WDRouterRule.jumpWithAction(taskAction)
// Logger.debug(TAG, `commentGotoWeb, ${content.newsId}`);
}
public static gotoWeb(content: ContentDTO) {
... ... @@ -399,6 +433,8 @@ export class ProcessUtils {
extra: {
relType: content?.relType,
relId: content?.relId,
sourcePage: '5',
commentId: content?.commentInfo?.commentId
} as ExtraDTO,
targetLayout: content.customParamTargetLayout
} as Params,
... ... @@ -420,6 +456,8 @@ export class ProcessUtils {
extra: {
relType: content?.relType,
relId: content?.relId,
sourcePage: '5',
commentId: content?.commentInfo?.commentId
} as ExtraDTO
} as Params,
};
... ... @@ -460,7 +498,9 @@ export class ProcessUtils {
relType: content?.relType,
relId: content?.relId,
extra: content?.extra,
title: content?.newsTitle
title: content?.newsTitle,
sourcePage: '5',
commentId: content?.commentInfo?.commentId
} as ExtraDTO
} as Params,
};
... ... @@ -481,6 +521,8 @@ export class ProcessUtils {
extra: {
relType: content?.relType,
relId: content?.relId,
sourcePage: '5',
commentId: content?.commentInfo?.commentId
} as ExtraDTO,
targetLayout: content.customParamTargetLayout
} as Params,
... ...
... ... @@ -27,6 +27,7 @@ export struct WdWebComponent {
build() {
Column() {
Web({ src: this.webUrl, controller: this.webviewControl })
.backgroundColor(Color.White)
.domStorageAccess(true)
.databaseAccess(true)
.javaScriptAccess(true)
... ...
... ... @@ -59,6 +59,7 @@ export struct WdWebLocalComponent {
controller: this.webviewControl,
renderMode: RenderMode.SYNC_RENDER
})// Web({ src: this.webResource, controller: this.webviewControl })
.backgroundColor(Color.White)
.domStorageAccess(true)
.databaseAccess(true)
.javaScriptAccess(true)
... ...
... ... @@ -69,9 +69,9 @@ export class ContentDTO implements BaseDTO {
vImageUrl: string = '';
screenType: string = '';
source: string = '';
objectType: string = '';
objectType: string = '';//0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,14动态图文,15动态视频
objectId: string = '';
objectLevel: string = '';
objectLevel: string = '';// 对象分类;频道(1:一级频道,2:二级频道),专题(21:文章专题,22:音频专题,23:直播专题,24:话题专题)
channelId: string = '';
relId: string = '';
relType: string = '';
... ...
... ... @@ -12,5 +12,11 @@ export interface commentInfo {
relType: string;
newsType?: string,
objectType?: string,
userType?: number
objectLevel: string,
userType?: number,
leaderArticle?: number,
linkUrl: string,
newsCoverUrl: string,
normalLinkUrl: string,
pageId: string
}
... ...
... ... @@ -84,6 +84,7 @@ export struct DynamicDetailComponent {
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
@State offsetY: number = 0
@State isScrollTop: boolean = true
@State executedStartTime: number = new Date().getTime()
pageParam: ParamType = {}
commentListAreaInfo?: Area
... ... @@ -118,7 +119,9 @@ export struct DynamicDetailComponent {
})
}
aboutToDisappear() {
this.viewBlogInsightIntentShare()
}
onPageHide() {
}
... ... @@ -675,7 +678,6 @@ export struct DynamicDetailComponent {
this.getInteractDataStatus()
this.makeJumpInfo()
this.interactDataV2()
this.viewBlogInsightIntentShare()
this.pageParam = {
'contentType': `${this.contentDetailData.newsType}`,
... ... @@ -858,7 +860,7 @@ export struct DynamicDetailComponent {
*/
private viewBlogInsightIntentShare(){
let context = getContext(this) as common.UIAbilityContext;
viewBlogItemInsightIntentShare(context,this.contentDetailData, this.interactDataDTO)
viewBlogItemInsightIntentShare(this.executedStartTime, context,this.contentDetailData, this.interactDataDTO)
}
checkToScrollCommentArea() {
... ...
... ... @@ -64,6 +64,7 @@ export struct ImageAndTextPageComponent {
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State isScrollTop: boolean = true
@State offsetY: number = 0
@State executedStartTime: number = new Date().getTime()
pageShowTime:number = 0;
pageHideTime:number = 0;
lastTimeoutId?: number
... ... @@ -293,7 +294,7 @@ export struct ImageAndTextPageComponent {
if (this.detailContentEmpty) {
this.emptyType = 18
}
console.log(TAG, "dl", JSON.stringify(detailBeans))
console.log(TAG, "dl1111111111", JSON.stringify(detailBeans[0]))
if (detailBeans && detailBeans.length > 0) {
this.contentDetailData = detailBeans[0];
let dateTime =
... ... @@ -324,9 +325,6 @@ export struct ImageAndTextPageComponent {
} else {
this.operationButtonList = ['comment', 'collect', 'share']
}
//意图上报
this.viewBlogInsightIntentShare()
}
}
}
... ... @@ -334,7 +332,7 @@ export struct ImageAndTextPageComponent {
//意图上报
private viewBlogInsightIntentShare() {
let context = getContext(this) as common.UIAbilityContext;
viewBlogItemInsightIntentShare(context, this.contentDetailData, this.interactData)
viewBlogItemInsightIntentShare(this.executedStartTime, context, this.contentDetailData, this.interactData)
}
private async getRecommend() {
... ... @@ -342,10 +340,10 @@ export struct ImageAndTextPageComponent {
imei: HttpUtils.getImei(),
userId: HttpUtils.getUserId(),
contentId: String(this.contentDetailData?.newsId),
recType: Number(this.contentDetailData?.reLInfo?.relType),
recType: 1,
contentType: this.contentDetailData?.newsType,
relId: this.contentDetailData?.reLInfo?.relId,
channelId: String(this.contentDetailData?.reLInfo?.channelId)
// channelId: String(this.contentDetailData?.reLInfo?.channelId)
}
let recommendList = await DetailViewModel.postRecommendList(params)
if (recommendList.length > 0) {
... ... @@ -463,6 +461,8 @@ export struct ImageAndTextPageComponent {
}
aboutToDisappear() {
//意图上报
this.viewBlogInsightIntentShare()
}
checkToScrollCommentArea() {
... ...
... ... @@ -122,12 +122,6 @@ export struct MorningEveningPaperComponent {
}
async aboutToAppear() {
// let windowHight: window.Window = await window.getLastWindow(getContext(this));
// await windowHight.setWindowLayoutFullScreen(true);
// WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
// this.topSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height)
// this.bottomSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height)
const dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as String
console.info(TAG, `aboutToAppear = ` + dailyPaperTopicPageId)
const currentTime = new Date().getTime()
... ... @@ -238,12 +232,6 @@ export struct MorningEveningPaperComponent {
private async pickColor(imageSource: image.ImageSource | undefined) {
if (imageSource) {
const pixelMap: image.PixelMap = await imageNet2PixelMap(imageSource);
// let allPixels: number[] = await traverseAllPixel(pixelMap);
// let maxPixel: number = findMaxPixel(allPixels);
// let rgb: ColorRgb = ColorUtils.numberToRgb(maxPixel);
// let hsv: ColorHsv = ColorUtils.rgb2hsv(rgb);
// rgb = ColorUtils.hsv2rgb(hsv);
// this.mixedBgColor = "#" + rgb.red.toString(16) + rgb.green.toString(16) + rgb.blue.toString(16);
effectKit.createColorPicker(pixelMap, (err, colorPicker) => {
let color = colorPicker.getLargestProportionColor();
console.log(TAG, "compInfoBean compStyle = " + color)
... ... @@ -256,9 +244,6 @@ export struct MorningEveningPaperComponent {
}
async aboutToDisappear() {
// let windowHight: window.Window = await window.getLastWindow(getContext(this));
// await windowHight.setWindowLayoutFullScreen(false);
// WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}
onPageHide() {
... ...
... ... @@ -3,7 +3,7 @@ import { matrix4, promptAction, window } from '@kit.ArkUI';
import { BusinessError } from '@kit.BasicServicesKit';
import { ScaleModel } from '../model/ScaleModel';
import { OffsetModel } from '../model/OffsetModel';
import { windowSizeManager } from '../utils/Managers';
import { WindowSizeManager } from '../utils/Managers';
import { runWithAnimation } from '../utils/FuncUtils';
import { PhotoListBean } from 'wdBean/Index';
import { http } from '@kit.NetworkKit';
... ... @@ -31,12 +31,12 @@ export struct MultiPictureDetailItemComponent {
private swiperControllerItem: SwiperController = new SwiperController()
@State currentOffset: number = 0
@Consume duration: number
windowSizeManager: WindowSizeManager = new WindowSizeManager();
async aboutToAppear() {
this.imageUri = this.MultiPictureDetailItem.picPath
this.getPicture()
console.log(TAG, JSON.stringify(this.MultiPictureDetailItem))
}
/**
... ... @@ -113,15 +113,15 @@ export struct MultiPictureDetailItemComponent {
// const imageSource: image.ImageSource = image.createImageSource(this.imageUri);
imageSource.getImageInfo(0).then((data: image.ImageInfo) => {
this.imageWHRatio = data.size.width / data.size.height;
this.imageDefaultSize = this.calcImageDefaultSize(this.imageWHRatio, windowSizeManager.get());
if (this.imageDefaultSize.width === windowSizeManager.get().width) {
this.imageDefaultSize = this.calcImageDefaultSize(this.imageWHRatio, this.windowSizeManager.get());
if (this.imageDefaultSize.width === this.windowSizeManager.get().width) {
this.fitWH = "width";
} else {
this.fitWH = "height";
}
this.imageScaleInfo.maxScaleValue += this.fitWH === "width" ?
(windowSizeManager.get().height / this.imageDefaultSize.height) :
(windowSizeManager.get().width / this.imageDefaultSize.width);
(this.windowSizeManager.get().height / this.imageDefaultSize.height) :
(this.windowSizeManager.get().width / this.imageDefaultSize.width);
}).catch((err: BusinessError) => {
console.error(`[error][getImageInfo]${err.message}`);
});
... ... @@ -237,7 +237,6 @@ export struct MultiPictureDetailItemComponent {
.indicator(false)
.displayCount(1)
.loop(false)
.zIndex(10)
.onGestureSwipe((index: number, extraInfo: SwiperAnimationEvent) => {
console.info("onGestureSwipe current offset: " + extraInfo.currentOffset)
this.currentOffset = Math.abs(extraInfo.currentOffset)
... ... @@ -275,7 +274,7 @@ export struct MultiPictureDetailItemComponent {
// 已经是缩小状态,双击放大
fn = () => {
this.isEnableSwipe = false;
const ratio: number = this.calcFitScaleRatio(this.imageDefaultSize, windowSizeManager.get());
const ratio: number = this.calcFitScaleRatio(this.imageDefaultSize, this.windowSizeManager.get());
this.imageScaleInfo.scaleValue = ratio;
this.imageOffsetInfo.reset();
this.matrix = matrix4.identity().scale({
... ...
import { Action, H5ReceiveDetailBean, ContentDetailDTO, InteractDataDTO, TopicInfo,TopicDetailData,ShareInfoDTO } from 'wdBean';
import {
Action,
H5ReceiveDetailBean,
ContentDetailDTO,
InteractDataDTO,
TopicInfo,
TopicDetailData,
ShareInfoDTO
} from 'wdBean';
import { WdWebComponent } from 'wdWebComponent';
import { CommonConstants } from 'wdConstant'
import { BridgeWebViewControl } from 'wdJsBridge/Index';
... ... @@ -7,7 +15,7 @@ import { OperRowListView } from './view/OperRowListView';
import DetailViewModel from '../viewmodel/DetailViewModel';
import { publishCommentModel } from '../components/comment/model/PublishCommentModel';
import { EmptyComponent } from '../components/view/EmptyComponent';
import { NetworkUtil, WindowModel,Logger } from 'wdKit';
import { NetworkUtil, WindowModel, Logger } from 'wdKit';
import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
import { PageRepository } from '../repository/PageRepository';
... ... @@ -45,6 +53,7 @@ export struct SpacialTopicPageComponent {
@State topicDetail: TopicDetailData = {} as TopicDetailData
@State shareInfo: ShareInfoDTO = {} as ShareInfoDTO
@State showBottomView: boolean = false;
@State executedStartTime: number = new Date().getTime()
private trySendData2H5() {
if (!this.webPrepared) {
... ... @@ -60,24 +69,24 @@ export struct SpacialTopicPageComponent {
}
private sendContentData2H5(h5ReceiveAppData: H5ReceiveDetailBean) {
Logger.debug('SpacialTopicPageComponent', 'jsCall_receiveAppData',JSON.stringify(h5ReceiveAppData));
Logger.debug('SpacialTopicPageComponent', 'jsCall_receiveAppData', JSON.stringify(h5ReceiveAppData));
this.webviewControl.callHandle(NativeCallH5Type.jsCall_receiveAppData,
JSON.stringify(h5ReceiveAppData), (data: string) => {
Logger.debug('SpacialTopicPageComponent', "from js data = " + data);
})
}
private receiveH5SendToNativeData(dataString:string | undefined) {
private receiveH5SendToNativeData(dataString: string | undefined) {
// this.topicDetail = JSON.parse(dataString);
if (dataString == undefined) {
return
}
Logger.debug('SpacialTopicPageComponent111',dataString);
Logger.debug('SpacialTopicPageComponent111', dataString);
this.topicDetail = JSON.parse(dataString);
this.topicInfo = this.topicDetail.topicInfo;
if(this.topicInfo){
if (this.topicInfo) {
// 转换详情数据
this.contentDetailData.openComment = Number(this.topicInfo.commentFlag)
this.contentDetailData.commentDisplay = Number(this.topicInfo.commentShowFlag)
... ... @@ -121,9 +130,9 @@ export struct SpacialTopicPageComponent {
}
//意图上报
private viewBlogInsightIntentShare(){
private viewBlogInsightIntentShare() {
let context = getContext(this) as common.UIAbilityContext;
viewBlogItemInsightIntentShare(context,this.contentDetailData)
viewBlogItemInsightIntentShare(this.executedStartTime, context, this.contentDetailData)
}
build() {
... ... @@ -158,23 +167,23 @@ export struct SpacialTopicPageComponent {
emptyButton: true,
retry: () => {
// this.getDetail()
this.reload ++
this.reload++
}
}).padding({ bottom: 200 })
} else {
if (!this.isPageEnd) {
channelSkeleton().padding({ top:`${this.topSafeHeight}px`,bottom: this.bottomSafeHeight })
channelSkeleton().padding({ top: `${this.topSafeHeight}px`, bottom: this.bottomSafeHeight })
}
}
//底部交互区
if (this.showBottomView){
if (this.showBottomView) {
OperRowListView({
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
topicInfo: this.topicInfo,
styleType: 1,
onCommentIconClick:()=>{
onCommentIconClick: () => {
this.showCommentList = true
}
})
... ... @@ -185,7 +194,7 @@ export struct SpacialTopicPageComponent {
showCommentList: $showCommentList,
publishCommentModel: $publishCommentModel,
interactData: $interactData,
}).visibility(this.showComment?Visibility.Visible:Visibility.Hidden)
}).visibility(this.showComment ? Visibility.Visible : Visibility.Hidden)
}
}
}.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)
... ...
... ... @@ -122,7 +122,7 @@ export struct Card10Component {
ProcessUtils.processPage(this.contentDTO)
})
if (this.contentDTO.objectType == '5') {
Notes({ objectType: 5 }).margin({ left: 5, bottom: 5 })
Notes({ objectType: 5,objectLevel:this.contentDTO.objectLevel }).margin({ left: 5, bottom: 5 })
}
}.alignContent(Alignment.BottomStart)
... ... @@ -212,7 +212,7 @@ export struct Card10ComponentTimelineItem {
Column() {
Stack() {
if (this.slideItem.objectType == '5') {
Notes({ objectType: 5 })
Notes({ objectType: 5,objectLevel:this.slideItem.objectLevel })
}
Text(this.slideItem.newsTitle)
.fontSize($r('app.float.font_size_17'))
... ... @@ -255,7 +255,7 @@ export struct Card10ComponentTimelineItem {
Column() {
Stack() {
if (this.slideItem.objectType == '5') {
Notes({ objectType: 5 })
Notes({ objectType: 5,objectLevel:this.slideItem.objectLevel })
}
Text(this.slideItem.newsTitle)
.fontSize($r('app.float.font_size_17'))
... ...
... ... @@ -41,7 +41,7 @@ export struct Card11Component {
Column() {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType, }).height(28).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(28).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(28).align(Alignment.Center)
... ...
... ... @@ -56,7 +56,7 @@ export struct Card20Component {
if (this.contentDTO.newsTitle) {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(29).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(29).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(29).align(Alignment.Center)
... ...
... ... @@ -49,7 +49,7 @@ export struct Card2Component {
Column() {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(29).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(29).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(29).align(Alignment.Center)
... ...
... ... @@ -39,7 +39,7 @@ export struct Card3Component {
Column() {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(29).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(29).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(29).align(Alignment.Center)
... ...
... ... @@ -49,7 +49,7 @@ export struct Card4Component {
Column() {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(19).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(19).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(19).align(Alignment.Center)
... ...
... ... @@ -77,7 +77,7 @@ export struct Card5Component {
Row() {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(20).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(20).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(20).align(Alignment.Center)
... ...
... ... @@ -46,7 +46,7 @@ export struct Card6Component {
Column() {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(28).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(28).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(28).align(Alignment.Center)
... ...
... ... @@ -108,7 +108,7 @@ export struct Card9Component {
topRight: $r('app.float.image_border_radius')
})
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(20).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(20).align(Alignment.Center)
.margin({ left: 5, bottom: 5 })
} else {
if (this.contentDTO.seoTags) {
... ...
... ... @@ -2,12 +2,14 @@
* 表示
* objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,
14动态图文,15动态视频16问政;100人民号,101标签
* objectLevel: 对象分类;频道(1:一级频道,2:二级频道),专题(21:文章专题,22:音频专题,23:直播专题,24:话题专题)
*/
@Preview
@Component
export struct Notes {
@State objectType: number | string = 5
@State objectLevel: number | string = -1
@State newTags: string = ''
@State seoTags: string = ''
build() {
... ... @@ -30,16 +32,19 @@ export struct Notes {
returnTypeTitleFn(): string {
if (this.newTags) {
return this.newTags
} else {
}
if (this.objectType == 5) {
if (this.objectLevel == 24) {
return '调查'
}
return '专题'
} else if (this.objectType == 10) {
}
if (this.objectType == 10) {
return 'H5'
} else if (this.objectType == 8) {
return '文章'
}
if (this.objectType == 8) {
return '文章'
}
return ''
}
}
\ No newline at end of file
... ...
... ... @@ -381,7 +381,7 @@ struct QualityCommentItem {
Row() {
Text(DateTimeUtils.getCommentTime(DateTimeUtils.getDateTimestamp(this.item.createTime)))
.fontSize(12)
.fontSize(14)
.fontColor('#999999')
Row({ space: 16 }) {
... ...
... ... @@ -420,6 +420,7 @@ class CommentViewModel {
newModel.fromUserHeader = model.fromUserHeader
newModel.fromUserId = model.fromUserId
newModel.fromUserName = model.fromUserName
newModel.h5Url = model.h5Url
if (model.fromUserType) {
newModel.fromUserType = model.fromUserType
}
... ...
... ... @@ -219,7 +219,7 @@ struct CarouselLayout01CardView {
// 文本信息
Stack() {
if(this.item.objectType == '5'){
Notes({ objectType: this.item.objectType })
Notes({ objectType: this.item.objectType,objectLevel:this.item.objectLevel })
} else {
if (this.item.seoTags) {
Notes({ newTags: this.item.seoTags })
... ...
... ... @@ -26,6 +26,7 @@ export default struct MinePageUserSimpleInfoUI {
this.userName = SPHelper.default.getSync(SpConstants.USER_NAME,"") as string
this.headPhotoUrl = SPHelper.default.getSync(SpConstants.USER_HEAD_PHOTO_URL,"") as string
///用户类型1普通用户
let userType = SPHelper.default.getSync(SpConstants.USER_Type,"") as string
if (userType && userType.length > 0) {
this.userType = userType
... ... @@ -44,7 +45,7 @@ export default struct MinePageUserSimpleInfoUI {
Stack(){
Image(this.isLogin?(this.headPhotoUrl?this.headPhotoUrl:this.userType === "1"?$r('app.media.default_head_userPage'):$r('app.media.AccountOwner_DefaultIcon')):$r('app.media.default_head_userPage'))
.alt($r('app.media.default_head_userPage'))
.alt(this.userType === "1"?$r('app.media.default_head_userPage'):$r('app.media.AccountOwner_DefaultIcon'))
.width(`${this.calcHeight(120)}lpx`)
.height(`${this.calcHeight(120)}lpx`)
.objectFit(ImageFit.Cover)
... ...
... ... @@ -144,7 +144,7 @@ export struct EmptyComponent {
.type(ButtonType.Normal)
.width(80)
.height(28)
.backgroundColor('#fffffff')
.backgroundColor(Color.White)
.fontColor('#FF666666')
.border({ width: 1 })
.borderColor('#FFEDEDED')
... ...
... ... @@ -2,7 +2,7 @@ import { CompDTO, ContentDTO } from 'wdBean';
import { CommonConstants } from 'wdConstant';
import { CardParser } from '../CardParser';
const RECOMMEND_LIST_TITLE = '相关推荐'
const RECOMMEND_LIST_TITLE = '推荐阅读'
@Component
export struct RecommendList {
... ...
... ... @@ -39,11 +39,6 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
identifier,
intentActionInfo: {
actionMode
//目前不考虑发生时段
// executedTimeSlots: {
// executedEndTime: new Date().getTime(),
// executedStartTime: pageModel.executedStartTime
// }
},
intentEntityInfo: {
entityName: 'Blog',
... ... @@ -55,7 +50,7 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
blogTitle: item?.newsTitle,
blogType: 'Normal',
blogCategory: entityGroupId === '2001' ? '推荐' : '热点',
categoryDisplayName: item.newsTitle, //卡片上的主标题
categoryDisplayName: item?.newsTitle, //卡片上的主标题
description: item?.newsSummary || '', //必传
blogSubTitle: item?.newsSummary.length > 20 ?
item?.newsSummary.substring(0, 20) : item?.newsSummary,
... ... @@ -86,35 +81,40 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
}
//ViewBlog意图共享-节目详情 详情页上报
export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, item: ContentDetailDTO,
export function viewBlogItemInsightIntentShare(executedStartTime: number ,context: common.UIAbilityContext, item: ContentDetailDTO,
interactData?: InteractDataDTO) {
let identifier = generateUUID()
console.log('zzzz', JSON.stringify(item))
let executedEndTime: number = new Date().getTime()
let viewBlogInsightIntentItem: insightIntent.InsightIntent = {
intentName: 'ViewBlog',
intentVersion: '1.0.1',
identifier,
intentActionInfo: {
actionMode: ActionMode.EXECUTED
actionMode: ActionMode.EXECUTED,
executedTimeSlots: {
executedEndTime: executedEndTime,
executedStartTime: executedStartTime
}
},
intentEntityInfo: {
entityName: 'Blog',
entityId: `objectId=${item?.newsId}&objectType=${item?.newsType}` || '',
displayName: item?.newsTitle || '',
entityGroupId: String(item?.reLInfo?.channelId), //channelId
logoURL: item.fullColumnImgUrls.length > 0 ? item.fullColumnImgUrls[0]?.url :
item.firstFrameImageUri || 'https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png',
metadataModificationTime: new Date(item.publishTime).getTime() || 0,
logoURL: item?.fullColumnImgUrls?.length > 0 ? item.fullColumnImgUrls[0]?.url :
item?.firstFrameImageUri || 'https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png',
metadataModificationTime: new Date(item?.publishTime).getTime() || 0,
blogTitle: item?.newsTitle,
blogType: 'Normal',
blogCategory: item?.reLInfo?.channelId === 2001 ? '推荐' : '热点',
categoryDisplayName: item.newsTitle || '',
blogSubTitle: item?.newsSummary.length > 20 ?
categoryDisplayName: item?.newsTitle || '',
blogSubTitle: item?.newsSummary?.length > 20 ?
item?.newsSummary.substring(0, 20) : item?.newsSummary,
description: item?.newsSummary || '', //必传
blogAuthor: item?.newsSourceName,
blogPublishTime: `${new Date(item.publishTime).getTime()}` || '',
tag: item?.newsTags.split(','),
blogPublishTime: `${new Date(item?.publishTime).getTime()}` || '',
tag: item?.newsTags?.split(','),
viewCount: item?.viewCount || 0,
likeCount: interactData?.likeNum || 0,
forwardCount: interactData?.shareNum || 0,
... ... @@ -142,7 +142,7 @@ export function viewColumInsightIntentShare(context: common.UIAbilityContext, en
intentVersion: '1.0.1',
identifier: generateUUID(),
intentActionInfo: {
actionMode: ActionMode.EXECUTED
actionMode: ActionMode.EXPECTED
},
intentEntityInfo: {
entityName: 'Column',
... ...
import { window } from '@kit.ArkUI';
import { common } from '@kit.AbilityKit';
class WindowSizeManager {
export class WindowSizeManager {
private size: window.Size = { width: 0, height: 0 };
// 获取UIAbility上下文
private context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext
constructor() {
window.getLastWindow(getContext()).then((value: window.Window) => {
window.getLastWindow(this.context).then((value: window.Window) => {
const rect: window.Rect = value.getWindowProperties().windowRect;
this.size.width = px2vp(rect.width);
this.size.height = px2vp(rect.height);
console.log(`[windowWidth]${this.size.width} [windowHeight]${this.size.height}`);
// console.log('MultiPictureDetailItemComponent', `[windowWidth]${this.size.width} [windowHeight]${this.size.height}`);
})
}
... ... @@ -16,5 +19,3 @@ class WindowSizeManager {
return this.size;
}
}
\ No newline at end of file
export const windowSizeManager: WindowSizeManager = new WindowSizeManager();
\ No newline at end of file
... ...
... ... @@ -34,6 +34,7 @@ export struct TabChatItemComponent {
top: 10, bottom: 4
})
.onClick(() => {
if (this.item.customizeExpression == 1) {return}
this.gotoMultipleListImagePage(this.item.pictureUrls[0])
})
}
... ...
... ... @@ -255,14 +255,20 @@ export struct TabLiveItemComponent {
if (this.item.isWall == 1) {
Blank().layoutWeight(1)
Text() {
Span(' 上墙 ')
.foregroundColor("#CB0000")
Text(' 上墙 ')
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.fontSize(11)
.lineHeight(20)
.textBackgroundStyle({ color: "#70FFC63F", radius: 2 })
}.lineHeight(20).fontSize('14fp').fontWeight(400)
.fontWeight(400)
.fontColor("#CB0000")
.backgroundColor('#F1EFEB')
.padding({
left: 4,
top: 1,
right: 4,
bottom: 1
})
.borderRadius(2)
}
}
.alignItems(VerticalAlign.Top)
... ...
... ... @@ -118,7 +118,7 @@ export struct DetailPlayShortVideoPage {
if (!this.onlyWifiLoadVideo) {
await this.playerController.pause()
} else {
await this.playerController.play()
this.playerController.resetPlay()
await this.playerController.startRenderFrame(() => {
this.imageVisible = false
})
... ... @@ -185,7 +185,8 @@ export struct DetailPlayShortVideoPage {
}
this.videoLandScape = this.contentDetailData.videoInfo[0]?.videoLandScape
this.ratio = (this.contentDetailData.videoInfo[0]?.resolutionWidth || 16) /
this.ratio = this.videoLandScape == 2 ? (this.contentDetailData.videoInfo[0]?.resolutionWidth || 9) /
(this.contentDetailData.videoInfo[0]?.resolutionHeight || 16):(this.contentDetailData.videoInfo[0]?.resolutionWidth || 16) /
(this.contentDetailData.videoInfo[0]?.resolutionHeight || 9)
this.playerController.onCanplay = async () => {
this.ratio = this.playerController.videoWidth / this.playerController.videoHeight
... ... @@ -209,6 +210,9 @@ export struct DetailPlayShortVideoPage {
this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
this.publishCommentModel.targetTitle = String(this.contentDetailData?.newsTitle || '')
this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')
///解决初始化竖屏视频时 this.ratio未更新导致显示错误
this.calculatePlayerRect()
}
contentTrackingDict() {
... ...
import { Action, ContentDetailDTO, InteractDataDTO } from 'wdBean/Index';
import { NetworkUtil, Logger, NetworkType, SPHelper, WindowModel, StringUtils } from 'wdKit';
import { NetworkUtil, WindowModel } from 'wdKit';
import { ContentDetailRequest } from 'wdDetailPlayApi/Index'
import { ResponseDTO } from 'wdNetwork/Index';
import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage'
... ... @@ -48,8 +48,9 @@ export struct DetailVideoListPage {
@State isShowAudioCom: boolean = false
@StorageLink('GestureLoadStrategy') GestureLoadStrategy: number = 0
async aboutToAppear(): Promise<void> {
async getDetail() {
// 注册监听网络连接
this.netStatus = undefined
let netStatus = NetworkUtil.isNetConnected()
if (netStatus) {
this.openFullScreen()
... ... @@ -69,7 +70,10 @@ export struct DetailVideoListPage {
// 无网络
this.netStatus = 1
}
}
aboutToAppear() {
this.getDetail()
}
aboutToDisappear(): void {
... ... @@ -233,7 +237,7 @@ export struct DetailVideoListPage {
if (this.netStatus !== undefined) {
EmptyComponent({
emptyType: 1, emptyButton: true, isBlack: true, retry: () => {
this.getContentDetail(this.contentId, this.relId, this.relType)
this.getDetail()
}
})
.id('e_empty_content')
... ... @@ -244,7 +248,7 @@ export struct DetailVideoListPage {
} else if (this.isOffLine) {
EmptyComponent({
emptyType: 15, emptyButton: true, retry: () => {
this.getContentDetail(this.contentId, this.relId, this.relType)
this.getDetail()
}
})
.id('e_empty_content')
... ...
... ... @@ -9,7 +9,7 @@ import {
contentListParams,
getRecCompInfoParams
} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
import { Logger, WindowModel, DateTimeUtils } from 'wdKit/Index';
import { NetworkUtil, Logger, WindowModel, DateTimeUtils } from 'wdKit/Index';
import { PictureLoading } from './PictureLoading';
import { DisplayDirection } from 'wdConstant/Index';
import { window } from '@kit.ArkUI';
... ... @@ -61,7 +61,8 @@ export struct VideoChannelDetail {
@State interactDataList: InteractDataDTO[] = []
@State totalCount: number = 0
@State isMouted: boolean = false
@State isRequestError: boolean = false
@State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
@State isOffLine: boolean = false // 存储视频下线状态用来展示缺省图
@State isRequesting: boolean = false
pageShowTime: number = 0;
pageHideTime: number = 0;
... ... @@ -120,10 +121,23 @@ export struct VideoChannelDetail {
}
}
aboutToAppear() {
getDetail() {
// 注册监听网络连接
this.netStatus = undefined
let netStatus = NetworkUtil.isNetConnected()
if (netStatus) {
this.openFullScreen()
// 根据视频频道传参查询视频楼层信息
this.getRecCompInfo()
} else {
// 无网络
this.netStatus = 1
}
}
aboutToAppear() {
this.getDetail()
Logger.info(TAG, 'aboutToAppear');
}
... ... @@ -193,7 +207,7 @@ export struct VideoChannelDetail {
}
await ContentDetailRequest.getRecCompInfo(params).then(async res => {
this.isRequestError = false
this.isOffLine = res.data == null ? true : false
console.log('根据视频频道传参查询视频楼层信息totalCount', res.data?.totalCount + '')
this.totalCount = res.data?.totalCount || 0
... ... @@ -229,7 +243,6 @@ export struct VideoChannelDetail {
}).catch(() => {
// 获取内容失败请重试
this.isRequestError = true
this.isRequesting = false
})
}
... ... @@ -272,11 +285,17 @@ export struct VideoChannelDetail {
build() {
Stack({ alignContent: Alignment.Center }) {
if (this.isRequestError) {
if (this.netStatus !== undefined) {
EmptyComponent({
emptyType: 1, emptyButton: true, isBlack: true, retry: () => {
this.getDetail()
}
})
} else if (this.isOffLine) {
EmptyComponent({
emptyType: WDViewDefaultType.WDViewDefaultType_NoVideo,
retry: () => {
this.getRecCompInfo()
this.getDetail()
}
})
} else {
... ...
... ... @@ -10,13 +10,15 @@ import { window } from '@kit.ArkUI'
export struct PlayerFullScreenView {
private playerController?: WDPlayerController;
@Consume contentDetailData: ContentDetailDTO
@Consume progressVal: number;
@Consume @Watch("updateProgress") progressVal: number;
@Consume status: number
@Consume displayDirection: DisplayDirection
@Consume isDragging: boolean
@State videoDuration: number = this.contentDetailData?.videoInfo?.[0]?.videoDuration || 1
@State showOperator: boolean = true
private timer: number = -1
@State upProVal: string = ''
@State duration: string = DateTimeUtils.secondToTime(this.videoDuration)
getTitle() {
return this.contentDetailData?.newsTitle
... ... @@ -27,11 +29,17 @@ export struct PlayerFullScreenView {
WDShare.shareContent(this.contentDetailData)
}
updateProgress() {
this.upProVal = DateTimeUtils.secondToTime(Math.floor((this.progressVal / 100 * this.videoDuration)))
}
aboutToAppear(): void {
WindowModel.shared.setWindowSystemBarEnable([])
this.timer = setInterval(() => {
this.showOperator = false
}, 5000)
// 初始显示
this.updateProgress()
}
aboutToDisappear(): void {
... ... @@ -108,14 +116,15 @@ export struct PlayerFullScreenView {
})
}
@Builder
bottomBuilder() {
Column() {
Text() {
Span(DateTimeUtils.secondToTime(Math.floor(this.progressVal / 100 * this.videoDuration)))
Span(this.upProVal)
Span(' / ')
Span(DateTimeUtils.secondToTime(this.videoDuration))
Span(this.duration)
}
.fontSize(24)
.fontColor(Color.White)
... ... @@ -135,7 +144,7 @@ export struct PlayerFullScreenView {
this.playerController?.switchPlayOrPause()
})
Text(DateTimeUtils.secondToTime(Math.ceil((this.progressVal / 100 * this.videoDuration))))
Text(this.upProVal)
.fontSize(12)
.fontWeight(600)
.fontColor(Color.White)
... ... @@ -153,7 +162,7 @@ export struct PlayerFullScreenView {
}
})
Text(DateTimeUtils.secondToTime(this.videoDuration))
Text(this.duration)
.fontSize(12)
.fontWeight(600)
.fontColor(Color.White)
... ...
import { ContentDetailDTO } from 'wdBean/Index';
import { DateTimeUtils } from 'wdKit/Index';
import { DateTimeUtils, ToastUtils } from 'wdKit/Index';
import { PlayerConstants, WDPlayerController } from 'wdPlayer/Index';
@Reusable
@Component
export struct PlayerProgressView {
private playerController?: WDPlayerController;
... ... @@ -15,6 +16,8 @@ export struct PlayerProgressView {
@State loadingWidth: number | string = 1
@State showLoading: boolean = false
@Consume onlyWifiLoadVideo: boolean
timer: number = 0
aboutToAppear() {
if (this.playerController) {
this.playerController.onSeekDone = (status: number) => {
... ... @@ -27,7 +30,15 @@ export struct PlayerProgressView {
if (this.onlyWifiLoadVideo) {
this.showLoading = true
}
// console.log("PlayerProgressView11", this.timer)
if(this.timer) {
clearTimeout(this.timer)
}
this.timer = setTimeout(() => {
ToastUtils.shortToast('网络出小差了,请检查下网络')
}, 10000)
} else {
clearTimeout(this.timer)
this.loadingWidth = 1
this.showLoading = false
}
... ...
... ... @@ -161,7 +161,7 @@ export struct PlayerTitleView {
} else {
if(this.summary) {
Text() {
Span(this.clipText(this.summary, 14, 2, this.windowWidth - 150 - vp2px(50)))
Span(this.clipText(this.summary, 14, 3, this.windowWidth - 150 - vp2px(50)))
.fontSize(14)
.fontColor(Color.White)
.lineHeight(21)
... ...
... ... @@ -73,6 +73,7 @@ struct LoginProtocolWebview {
.height(44)
if(this.isConnectNetwork){
Web({ src: this.webUrl, controller: this.webviewController })
.backgroundColor(Color.White)
.domStorageAccess(true)
.databaseAccess(true)
.javaScriptAccess(true)
... ...
... ... @@ -156,7 +156,7 @@ export class WDPlayerController {
this.initProgress(time);
});
this.avPlayer?.on(Events.ERROR, (error) => {
this.playError(error.message);
// this.playError(error.message);
Logger.error(TAG, '播放错误' + JSON.stringify(error))
TrackingPlay.videoPlayError(error.message, this.pageName, this.pageName, this.pageParam)
})
... ... @@ -448,20 +448,20 @@ export class WDPlayerController {
Logger.debug(TAG, 'watchStatus ' + this.status)
if(this.status == PlayerConstants.STATUS_START){
Logger.debug(TAG, '播放视频')
Logger.debug(TAG, '播放视频prepareTime' + JSON.stringify(this.prepareTime))
Logger.debug(TAG, '播放视频pageName' + JSON.stringify(this.pageName))
Logger.debug(TAG, '播放视频pageParam' + JSON.stringify(this.pageParam))
// Logger.debug(TAG, '播放视频')
// Logger.debug(TAG, '播放视频prepareTime' + JSON.stringify(this.prepareTime))
// Logger.debug(TAG, '播放视频pageName' + JSON.stringify(this.pageName))
// Logger.debug(TAG, '播放视频pageParam' + JSON.stringify(this.pageParam))
// 播放埋点
TrackingPlay.videoPositivePlay(Number(this.prepareTime),this.pageName, this.pageName, this.pageParam)
}
if(this.status == PlayerConstants.STATUS_COMPLETION){
let initDuration = Math.floor(Number(this.duration)/1000)
Logger.debug(TAG, '播放结束')
Logger.debug(TAG, '播放结束currentPlayTime' + JSON.stringify(this.currentPlayTime))
Logger.debug(TAG, '播放结束initDuration' + JSON.stringify(initDuration))
Logger.debug(TAG, '播放结束pageName' + JSON.stringify(this.pageName))
Logger.debug(TAG, '播放结束pageParam' + JSON.stringify(this.pageParam))
// Logger.debug(TAG, '播放结束')
// Logger.debug(TAG, '播放结束currentPlayTime' + JSON.stringify(this.currentPlayTime))
// Logger.debug(TAG, '播放结束initDuration' + JSON.stringify(initDuration))
// Logger.debug(TAG, '播放结束pageName' + JSON.stringify(this.pageName))
// Logger.debug(TAG, '播放结束pageParam' + JSON.stringify(this.pageParam))
// 播放结束埋点
TrackingPlay.videoPlayEnd(this.currentPlayTime, initDuration, this.currentPlayTime, this.pageName, this.pageName, this.pageParam)
}
... ...
export { WDShare } from './src/main/ets/WDShare'
\ No newline at end of file
export { DeepLinkUtil } from "./src/main/ets/utils/DeepLinkUtil"
\ No newline at end of file
... ...
... ... @@ -2,7 +2,10 @@ import { ContentDetailDTO, ContentDTO, PageInfoDTO, ShareInfoDTO, TopicInfo } fr
import { SharePosterItemBean } from 'wdBean/src/main/ets/bean/detail/SharePosterItemBean';
import { ShareScene, ShareType, WDShareBase } from 'wdShareBase/Index';
import { ShareContentType } from 'wdShareBase/src/main/ets/Constant';
import { DeepLinkUtil } from './utils/DeepLinkUtil';
import { bundleManager } from '@kit.AbilityKit';
import { hilog } from '@kit.PerformanceAnalysisKit';
import { BusinessError } from '@kit.BasicServicesKit';
import { AppInnerLinkGenerator } from 'wdRouter';
export class WDShare {
... ... @@ -18,7 +21,7 @@ export class WDShare {
title: content.shareInfo.shareTitle,
desc: content.shareInfo.shareSummary,
link: content.shareInfo.shareUrl,
deeplink:DeepLinkUtil.generateDeepLinkWithConent(content),
deeplink:AppInnerLinkGenerator.generateDeepLinkWithConent(content),
}
})
}
... ... @@ -34,7 +37,7 @@ export class WDShare {
title: program.shareInfo.shareTitle,
desc: program.shareInfo.shareSummary,
link: program.shareInfo.shareUrl,
deeplink:DeepLinkUtil.generateDeepLinkWithProgram(program),
deeplink:AppInnerLinkGenerator.generateDeepLinkWithProgram(program),
}
})
}
... ...
import { CompInfoBean, ContentDTO, PageInfoBean } from 'wdBean/Index';
import { MorningEveningViewModel } from 'wdComponent/Index';
import { CrptoUtils, FileUtils, Logger } from 'wdKit/Index';
import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork/Index';
import { DeepLinkUtil } from 'wdShare/Index'
import { FormNewspaperPaperType, FormNewspaperPaperInfo, FormNewspaperPaperContent,
import { FormNewspaperPaperType, FormNewspaperPaperContent,
FormNewspaperData } from "../dailynewspaperwidget/common/NewspaperWidgetData"
import { http } from '@kit.NetworkKit';
import fs from '@ohos.file.fs';
import { BusinessError } from '@kit.BasicServicesKit';
import { JSON } from '@kit.ArkTS';
import { AppInnerLinkGenerator } from 'wdRouter';
const TAG = "NewspaperDataFetcher"
... ... @@ -38,7 +37,7 @@ export class NewspaperDataFetcher {
data.paperInfo.showLeftImage = true
data.paperInfo.leftImageUrl = page.topicInfo.frontLinkObject.coverUrl
data.paperInfo.leftTitle = page.topicInfo.frontLinkObject.title
data.paperInfo.leftDeepLink = DeepLinkUtil.generateDeepLinkWithFrontObjectLink(page.topicInfo.frontLinkObject)
data.paperInfo.leftDeepLink = AppInnerLinkGenerator.generateDeepLinkWithFrontObjectLink(page.topicInfo.frontLinkObject)
}
let contents: ContentDTO[] = compInfo.compList[0].operDataList as ContentDTO[]
... ... @@ -47,7 +46,7 @@ export class NewspaperDataFetcher {
let content : FormNewspaperPaperContent = {
title: contentDTO.newsTitle,
coverUrl: contentDTO.coverUrl,
deepLink: DeepLinkUtil.generateDeepLinkWithProgram(contentDTO)
deepLink: AppInnerLinkGenerator.generateDeepLinkWithProgram(contentDTO)
}
return content
})
... ...
... ... @@ -73,7 +73,7 @@ struct MainPage {
this.pageShow = Math.random()
// 升级检查
this.upgradeCheck()
// this.upgradeCheck()
Logger.debug('setBarBackgroundColor','Top onPageShow ')
}
... ...
... ... @@ -20,7 +20,7 @@ struct MorningEveningPaperPage {
pageTransition() {
// 定义页面进入时的效果,从底侧滑入
PageTransitionEnter({ type: RouteType.Push, duration: 300 })
PageTransitionEnter({ type: RouteType.Push, duration: 200 })
.slide(SlideEffect.Bottom).onEnter((type: RouteType, progress: number) => {
if (progress >= 0.99) {
// WindowModel.shared.setWindowLayoutFullScreen(true)
... ...
... ... @@ -161,11 +161,11 @@ struct LaunchInterestsHobbiesPage {
.backgroundColor('#ED2800')
.type(ButtonType.Normal)
.borderRadius(5)
.width(320)
.width('640lpx')
.height(44)
.margin({top:5})
Image('')
.width(320)
.width('640lpx')
.height(44)
.margin({top:5})
.backgroundColor(Color.White)
... ...
... ... @@ -4,7 +4,7 @@ import Router from '@system.router'
import router from '@ohos.router'
import common from '@ohos.app.ability.common'
import CustomDialogComponent from '../view/CustomDialogComponent'
import preferences from '@ohos.data.preferences'
import { preferences } from '@kit.ArkData';
import { GlobalContext } from '../../utils/GlobalContext'
import { WDRouterRule } from 'wdRouter';
import { WDRouterPage } from 'wdRouter';
... ...
... ... @@ -13,7 +13,7 @@ export struct UpgradeTipDialog {
maxWidth: number = 0
scroller: Scroller = new Scroller();
aboutToAppear(): void {
this.maxHeight = DisplayUtils.getDeviceHeight() * 0.6
this.maxHeight = DisplayUtils.getDeviceHeight() * 0.65
this.maxWidth = DisplayUtils.getDeviceWidth() * 0.76
// this.tipContent.content = "1、啊啊啊啊啊啊\n2、啊啊啊啊啊\n4、阿斯兰减肥的垃圾发电1、啊啊啊啊啊啊\n2、啊啊啊啊啊\n4、阿斯兰减肥的垃圾发电1、啊啊啊啊啊啊\n2、啊啊啊啊啊\n4、阿斯兰减肥的垃圾发电1、啊啊啊啊啊啊\n2、啊啊啊啊啊\n4、阿斯兰减肥的垃圾发电1、啊啊啊啊啊啊\n2、啊啊啊啊啊\n4、阿斯兰减肥的垃圾发电1、啊啊啊啊啊啊\n2、啊啊啊啊啊\n4、阿斯兰减肥的垃圾发电1、啊啊啊啊啊啊\n2、啊啊啊啊啊\n4、阿斯兰减肥的垃圾发电1、啊啊啊啊啊啊\n2、啊啊啊啊啊\n4、阿斯兰减肥的垃圾发电1、啊啊啊啊啊啊\n2、啊啊啊啊啊\n4、阿斯兰减肥的垃圾发电1、啊啊啊啊啊啊\n2、啊啊啊啊啊\n4、阿斯兰减肥的垃圾发电1、啊啊啊啊啊啊\n2、啊啊啊啊啊\n4、阿斯兰减肥的垃圾发电1、啊啊啊啊啊啊\n2、啊啊啊啊啊\n4、阿斯兰减肥的垃圾发电1、啊啊啊啊啊啊\n2、啊啊啊啊啊\n4、阿斯兰减肥的垃圾发电1、啊啊啊啊啊啊\n2、啊啊啊啊啊\n4、阿斯兰减肥的垃圾发电1、啊啊啊啊啊啊\n2、啊啊啊啊啊\n4、阿斯兰减肥的垃圾发电1、啊啊啊啊啊啊\n2、啊啊啊啊啊\n4、阿斯兰减肥的垃圾发电1、啊啊啊啊啊啊\n2、啊啊啊啊啊\n4、阿斯兰减肥的垃圾发电"
... ... @@ -54,14 +54,16 @@ export struct UpgradeTipDialog {
.fontColor("#222222")
.fontSize(18)
.textAlign(TextAlign.Center)
.fontFamily('PingFang SC-Medium')
Scroll(this.scroller) {
Column() {
Row() {
Text(this.tipContent.content)
.fontColor("#000000")
.fontColor("#222222")
.fontSize(14)
.textAlign(TextAlign.Start)
.lineHeight(24)
}
.alignItems(VerticalAlign.Top)
.width("100%")
... ... @@ -70,8 +72,8 @@ export struct UpgradeTipDialog {
.padding({left: 24, right: 24})
}
.width("100%")
.margin({top: 16, bottom: 2})
// .backgroundColor(Color.Brown)
.margin({top: 12, bottom: 2})
// .backgroundColor(Color.Pink)
.layoutWeight(1)
/// 灰色线
... ... @@ -100,7 +102,7 @@ export struct UpgradeTipDialog {
if (this.tipContent.forceUpgrade) {
Text("温馨提示:本次更新为必要更新,若您选择拒绝,将无法再使用app")
.fontColor("999999")
.fontColor("#999999")
.fontSize(12)
.fontWeight(400)
.lineHeight(17)
... ...
... ... @@ -49,7 +49,7 @@ export struct BottomNavigationComponent {
/**
* Component opacity value: 0.6.
*/
readonly SIXTY_OPACITY: number = 0.6;
readonly SIXTY_OPACITY: number = 0.8;
// 用于传参到顶导组件,【不用channelParam,主要是时序问题,需要先底导处理完,再延时触发顶导处理】
@State assignChannel: AssignChannelParam = new AssignChannelParam()
// 自动刷新触发(双击tab自动刷新)
... ... @@ -140,7 +140,7 @@ export struct BottomNavigationComponent {
.fontWeight(this.currentNavIndex === index ? FontWeight.Bold : FontWeight.Normal)
.textAlign(TextAlign.Center)
.fontSize($r('app.float.font_size_10'))// .fontColor(this.currentNavIndex === index ? Color.Red : Color.Gray)
.fontColor(this.currentNavIndex === index ? navItem.nameCColor : navItem.nameColor)
.fontColor(this.currentNavIndex === index ? this.setTabbarNameCColor(navItem) : this.setTabbarNameColor(navItem))
.opacity(this.currentNavIndex === index ? this.FULL_OPACITY : this.SIXTY_OPACITY)
}
.zIndex(10)
... ... @@ -167,10 +167,34 @@ export struct BottomNavigationComponent {
}
private setTabbarNameCColor(navItem:BottomNavDTO) {
if (this.isImmersive) {
return navItem.immersiveNameCColor
}
if (this.isNight) {
return navItem.nightNameCColor
}
return navItem.nameCColor
}
private setTabbarNameColor(navItem:BottomNavDTO) {
if (this.isImmersive) {
return navItem.immersiveNameColor
}
if (this.isNight) {
return navItem.nightNameColor
}
return navItem.nameColor
}
getBottomImageKnifeOption(navItem: BottomNavDTO, isSelect: boolean): ImageKnifeOption {
let defaultIcon = this.getBottomLocalIcon(navItem, isSelect)
let url = this.getBottomIcon(navItem, isSelect)
let imageKnifeOption: ImageKnifeOption = {
loadSrc: url,
// 占位图使用本地资源
... ... @@ -196,6 +220,9 @@ export struct BottomNavigationComponent {
if (this.isImmersive) {
// 获取沉浸式icon
icon = isSelect ? navItem.immersiveIconCUrl : navItem.immersiveIconUrl
} else if (this.isNight) {
// 获取暗黑模式 icon
icon = isSelect ? navItem.nightIconCUrl : navItem.nightIconUrl
} else {
// 获取常规icon
icon = isSelect ? navItem.iconC : navItem.icon
... ... @@ -259,7 +286,7 @@ export struct BottomNavigationComponent {
// 底导切换函数
async onBottomNavigationIndexChange(navItem: BottomNavDTO, index: number) {
Logger.info(TAG, `onBottomNavigationIndexChange this.currentNavIndex: ${this.currentNavIndex}`);
Logger.info(TAG, `onBottomNavigationIndexChange to Index:${index},this.currentNavIndex: ${this.currentNavIndex}`);
if (navItem.name === '我的') {
this.barBackgroundColor = Color.White
... ...
... ... @@ -60,6 +60,7 @@ export struct MultiPictureDetailPageComponent {
@State isEnableSwipe: boolean = true;
@State isScrollerTop: boolean = false;
@Provide duration: number = 0
@State executedStartTime: number = new Date().getTime()
//watch监听页码回调
onCurrentPageNumUpdated(): void {
... ... @@ -71,13 +72,9 @@ export struct MultiPictureDetailPageComponent {
this.listScroller.scrollEdge(Edge.Top)
}
async aboutToAppear() {
//注册字体
// font.registerFont({
// familyName: 'BebasNeueBold',
// familySrc: $rawfile('font/BebasNeueBold.otf')
// })
getDetail() {
// 注册监听网络连接
this.netStatus = undefined
let netStatus = NetworkUtil.isNetConnected()
if (netStatus) {
// 有网络
... ... @@ -86,6 +83,15 @@ export struct MultiPictureDetailPageComponent {
// 无网络
this.netStatus = 1
}
}
aboutToAppear() {
//注册字体
// font.registerFont({
// familyName: 'BebasNeueBold',
// familySrc: $rawfile('font/BebasNeueBold.otf')
// })
this.getDetail()
this.contentTrackingDict()
}
... ... @@ -100,7 +106,7 @@ export struct MultiPictureDetailPageComponent {
}
aboutToDisappear() {
this.viewBlogInsightIntentShare()
}
build() {
... ... @@ -315,7 +321,6 @@ export struct MultiPictureDetailPageComponent {
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.zIndex(1)
.onAnimationStart((index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => {
this.swiperIndex = targetIndex
this.scroller.scrollEdge(Edge.Top)
... ... @@ -502,7 +507,7 @@ export struct MultiPictureDetailPageComponent {
noNet() {
EmptyComponent({
emptyType: 1, emptyButton: true, isBlack: true, retry: () => {
this.getContentDetailData()
this.getDetail()
}
})
.id('e_empty_content')
... ... @@ -511,13 +516,14 @@ export struct MultiPictureDetailPageComponent {
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.backgroundColor(Color.Black)
.zIndex(10)
}
@Builder
offLine() {
EmptyComponent({
emptyType: 15, emptyButton: true, retry: () => {
this.getContentDetailData
this.getDetail()
}
})
.id('e_empty_content')
... ... @@ -526,6 +532,7 @@ export struct MultiPictureDetailPageComponent {
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.backgroundColor(Color.Black)
.zIndex(10)
}
getContentDetailData() {
... ... @@ -572,10 +579,9 @@ export struct MultiPictureDetailPageComponent {
this.getInteractBrowsOperate()
this.getBatchAttentionStatus()
}
this.viewBlogInsightIntentShare()
})
.catch((err: Error) => {
Logger.info(TAG, `fetchDetailData then,err: ${JSON.stringify(err)}`);
console.log(TAG, `fetchDetailData then,err: ${JSON.stringify(err)}`);
// 内容获取失败
this.netStatus = 9
this.operationButtonList = []
... ... @@ -658,6 +664,6 @@ export struct MultiPictureDetailPageComponent {
*/
private viewBlogInsightIntentShare() {
let context = getContext(this) as common.UIAbilityContext;
viewBlogItemInsightIntentShare(context, this.contentDetailData)
viewBlogItemInsightIntentShare(this.executedStartTime, context, this.contentDetailData)
}
}
\ No newline at end of file
... ...
... ... @@ -12,7 +12,7 @@ import { DeviceUtil,
UmengStats } from 'wdKit/Index'
import { LoginModule } from 'wdLogin/Index'
import { HostEnum, HostManager, WDHttp } from 'wdNetwork/Index'
import { AppInnerLink, registerRouter } from 'wdRouter/Index'
import { AppInnerLink, AppLinkingManager, registerRouter } from 'wdRouter/Index'
import { TrackingModule } from 'wdTracking/Index'
import { JSON } from '@kit.ArkTS'
import app from '@system.app'
... ... @@ -23,6 +23,7 @@ import { NewspaperWidgetCommon } from '../dailynewspaperwidget/common/NewspaperW
import { LiveRoomManager } from 'wdDetailPlayLive/Index'
import { initGlobalPlayerSettings } from 'wdPlayer/src/main/ets/utils/GlobalSetting'
import { BackgroundAudioController } from 'wdPlayer/Index'
import { SpConstants } from 'wdConstant'
const TAG = "[StartupManager]"
... ... @@ -78,6 +79,10 @@ export class StartupManager {
// 通知栏点击后启动
GetuiPush.sharedInstance().onWant(want)
// AppLinking拉起
AppLinkingManager.sharedInstance().onWant(want)
Logger.debug(TAG, "App onCreate: finised")
this.lastStartupWant = want
... ... @@ -86,6 +91,9 @@ export class StartupManager {
appOnNewWant(want: Want, launchParam: AbilityConstant.LaunchParam) {
GetuiPush.sharedInstance().onNewWant(want)
// AppLinking拉起
AppLinkingManager.sharedInstance().onNewWant(want)
this.dealWithDeepLink(want)
}
... ... @@ -134,6 +142,9 @@ export class StartupManager {
GetuiPush.sharedInstance().onReachMainPage()
// AppLinking拉起
AppLinkingManager.sharedInstance().onReachMainPage()
//TODO:
// 提前初始化webview
webview.WebviewController.initializeWebEngine()
... ... @@ -148,9 +159,12 @@ export class StartupManager {
}
// mPaaS 初始化,检测升级用
private initMpaas() {
private async initMpaas() {
Logger.debug(TAG, "App mPaaS初始化")
MpaasUtils.initApp(this.context!)
let utdid = await MpaasUtils.mpaasUtdid()
SPHelper.default.saveSync(SpConstants.USER_MPAASUTDID, utdid)
}
private initTingyun() {
... ...
... ... @@ -39,17 +39,117 @@
"com.test.pushaction",
"ohos.want.action.viewData"
],
// "uris": [{
// // 之前的 推送配置
"uris": [
// { // 之前的 推送配置
// "scheme": 'rmrbapp',
// "host": 'rmrb.app',
// 'port': '8080',
// "path": 'openwith'
// }]
// "path": 'openwith'}
{
"scheme": "https",
"host": "pd-people-uat.pdnews.cn",
"pathStartWith": "rmharticle"
},
{
"scheme": "https",
"host": "pd-people-uat.pdnews.cn",
"pathStartWith": "rmhphotos"
},
{
"scheme": "https",
"host": "pd-people-uat.pdnews.cn",
"pathStartWith": "rmhmoments"
},
{
"scheme": "https",
"host": "pd-people-uat.pdnews.cn",
"pathStartWith": "rmhvideo"
},
{
"scheme": "https",
"host": "pd-people-uat.pdnews.cn",
"pathStartWith": "author"
},
{
"scheme": "https",
"host": "pd-people-uat.pdnews.cn",
"pathStartWith": "column"
},
{
"scheme": "https",
"host": "pd-people-uat.pdnews.cn",
"pathStartWith": "votetopic"
},
{
"scheme": "https",
"host": "pd-people-uat.pdnews.cn",
"pathStartWith": "articletopic"
},
{
"scheme": "https",
"host": "pd-people-uat.pdnews.cn",
"pathStartWith": "livetopic"
},
{
"scheme": "https",
"host": "pd-people-uat.pdnews.cn",
"pathStartWith": "timelinetopic"
},
{
"scheme": "https",
"host": "www.peopleapp.com",
"pathStartWith": "rmharticle"
},
{
"scheme": "https",
"host": "www.peopleapp.com",
"pathStartWith": "rmhphotos"
},
{
"scheme": "https",
"host": "www.peopleapp.com",
"pathStartWith": "rmhmoments"
},
{
"scheme": "https",
"host": "www.peopleapp.com",
"pathStartWith": "rmhvideo"
},
{
"scheme": "https",
"host": "www.peopleapp.com",
"pathStartWith": "author"
},
{
"scheme": "https",
"host": "www.peopleapp.com",
"pathStartWith": "column"
},
{
"scheme": "https",
"host": "www.peopleapp.com",
"pathStartWith": "votetopic"
},
{
"scheme": "https",
"host": "www.peopleapp.com",
"pathStartWith": "articletopic"
},
{
"scheme": "https",
"host": "www.peopleapp.com",
"pathStartWith": "livetopic"
},
{
"scheme": "https",
"host": "www.peopleapp.com",
"pathStartWith": "timelinetopic"
}
]
},
{
"uris": [
{ // 配置 - (播控中心用)
{ // 推送配置 - (播控中心共用)
"scheme": 'rmrbapp',
"host": 'rmrb.app',
'port': '8080',
... ... @@ -60,16 +160,16 @@
"host": "rmrb.app",
"path": "openwith"
},
{ // 分享用 - 正式环境地址
"scheme": "https",
"host": "www.peopleapp.com",
"pathStartWith": "column"
},
{ // 分享用 - 测试环境地址
"scheme": "https",
"host": "pd-people-uat.pdnews.cn",
"pathStartWith": "column"
}
// { // 分享用 - 正式环境地址
// "scheme": "https",
// "host": "www.peopleapp.com",
// "pathStartWith": "column"
// },
// { // 分享用 - 测试环境地址
// "scheme": "https",
// "host": "pd-people-uat.pdnews.cn",
//// "pathStartWith": "column"
// }
],
"domainVerify": true
}
... ...