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