Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main
* 'main' of http://192.168.1.42/developOne/harmonyPool: (41 commits) desc:依赖添加 fix:bug[17915] 评论消息后互动信息中显示的内容不一致 desc:埋点[个人主页(客态) - 页面浏览] desc:埋点[个人主页(主态) - 页面浏览] desc:埋点[搜索页 - 页面浏览] desc:埋点[关于页面 - 页面浏览] desc:埋点[修改密码 - 页面浏览] desc:埋点[登录页 - 页面浏览] desc:埋点[] desc:埋点[隐私设置页 - 页面浏览(浏览时长传空值)] desc:埋点[账号与安全页 - 页面浏览(浏览时长传空值)] desc:埋点[设置-页面浏览(浏览时长传空值)] desc:埋点[预约列表(我的)-页面浏览(浏览时长传空值)] desc:埋点[关注列表(我的)-页面浏览(浏览时长传空值)] desc:埋点[我的页 - 普通按钮 和 页面浏览] 删除无用代码 fix(意见反馈):更新参数值 替换header参数appcode,用鸿蒙自己的值 fix(版面):读报纸页脚不同步问题修改 首页,下拉刷新,md5判断拦截 ...
Showing
65 changed files
with
882 additions
and
310 deletions
| @@ -171,6 +171,24 @@ export class LazyDataSource<T> extends BasicDataSource<T> { | @@ -171,6 +171,24 @@ export class LazyDataSource<T> extends BasicDataSource<T> { | ||
| 171 | } | 171 | } |
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | + // 删除index指定索引位置的元素 | ||
| 175 | + public deleteItems(startIndex: number, count?: number): void { | ||
| 176 | + if (startIndex < 0) { | ||
| 177 | + return | ||
| 178 | + } | ||
| 179 | + this.dataArray.splice(startIndex, count || (this.dataArray.length - startIndex)); | ||
| 180 | + let to = 0 | ||
| 181 | + if (count == undefined) { | ||
| 182 | + to = this.dataArray.length - 1 | ||
| 183 | + } else { | ||
| 184 | + to = count + startIndex | ||
| 185 | + if (to >= this.dataArray.length) { | ||
| 186 | + to = this.dataArray.length - 1; | ||
| 187 | + } | ||
| 188 | + } | ||
| 189 | + this.notifyDataMove(startIndex, to); | ||
| 190 | + } | ||
| 191 | + | ||
| 174 | // 删除最后1个元素 | 192 | // 删除最后1个元素 |
| 175 | public pop(): void { | 193 | public pop(): void { |
| 176 | this.deleteItem() | 194 | this.deleteItem() |
| @@ -42,23 +42,23 @@ export class HttpParams { | @@ -42,23 +42,23 @@ export class HttpParams { | ||
| 42 | switch (HostManager.getHost()) { | 42 | switch (HostManager.getHost()) { |
| 43 | case HostEnum.HOST_UAT: | 43 | case HostEnum.HOST_UAT: |
| 44 | headers['X-Ca-Stage'] = 'PRE' | 44 | headers['X-Ca-Stage'] = 'PRE' |
| 45 | - headers['Authorization'] = 'APPCODE 83092caa603a421aa0222308b3f6b27a' | ||
| 46 | - headers['appCode'] = '83092caa603a421aa0222308b3f6b27a' | 45 | + headers['Authorization'] = 'APPCODE 5e1b07c336ac48ae90794fc4d69beaf9' |
| 46 | + headers['appCode'] = '5e1b07c336ac48ae90794fc4d69beaf9' | ||
| 47 | break | 47 | break |
| 48 | case HostEnum.HOST_SIT: | 48 | case HostEnum.HOST_SIT: |
| 49 | headers['X-Ca-Stage'] = 'TEST' | 49 | headers['X-Ca-Stage'] = 'TEST' |
| 50 | - headers['Authorization'] = 'APPCODE 0af1f9085e484c97b2a44704bae72c07' | ||
| 51 | - headers['appCode'] = '0af1f9085e484c97b2a44704bae72c07' | 50 | + headers['Authorization'] = 'APPCODE b7d32f50747d456d8c84ae51f3baaf56' |
| 51 | + headers['appCode'] = 'b7d32f50747d456d8c84ae51f3baaf56' | ||
| 52 | break | 52 | break |
| 53 | case HostEnum.HOST_PRODUCT: | 53 | case HostEnum.HOST_PRODUCT: |
| 54 | headers['X-Ca-Stage'] = 'RELEASE' | 54 | headers['X-Ca-Stage'] = 'RELEASE' |
| 55 | - headers['Authorization'] = 'APPCODE 3d4181bceeb94d9780e10dbb6c67bbf6' | ||
| 56 | - headers['appCode'] = '3d4181bceeb94d9780e10dbb6c67bbf6' | 55 | + headers['Authorization'] = 'APPCODE c148017260324c3ba7e612757e8146c1' |
| 56 | + headers['appCode'] = 'c148017260324c3ba7e612757e8146c1' | ||
| 57 | break | 57 | break |
| 58 | case HostEnum.HOST_DEV: | 58 | case HostEnum.HOST_DEV: |
| 59 | headers['X-Ca-Stage'] = 'TEST' | 59 | headers['X-Ca-Stage'] = 'TEST' |
| 60 | - headers['Authorization'] = 'APPCODE ff33172859e14f9a8299e3bd769e79f9' | ||
| 61 | - headers['appCode'] = 'ff33172859e14f9a8299e3bd769e79f9' | 60 | + headers['Authorization'] = 'APPCODE 9272b6a5ad0549a0ab399d0011109793' |
| 61 | + headers['appCode'] = '9272b6a5ad0549a0ab399d0011109793' | ||
| 62 | break | 62 | break |
| 63 | default: | 63 | default: |
| 64 | break | 64 | break |
| @@ -82,26 +82,7 @@ export class HttpParams { | @@ -82,26 +82,7 @@ export class HttpParams { | ||
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | private static getVersion() { | 84 | private static getVersion() { |
| 85 | - // TODO | 85 | + // TODO build时间,待对接build生成属性 |
| 86 | return '202401242103'; | 86 | return '202401242103'; |
| 87 | } | 87 | } |
| 88 | - | ||
| 89 | - private static getVersionCode() { | ||
| 90 | - // TODO | ||
| 91 | - return '10000'; | ||
| 92 | - } | ||
| 93 | - | ||
| 94 | - public static getVersionName() { | ||
| 95 | - // TODO 读取配置 | ||
| 96 | - return '1.0.0'; | ||
| 97 | - } | ||
| 98 | - | ||
| 99 | - //获取机型 | ||
| 100 | - static getPhoneModel() { | ||
| 101 | - return 'getPhoneModel' | ||
| 102 | - } | ||
| 103 | - //获取当前手机系统版本号 | ||
| 104 | - static getSystemVersion() { | ||
| 105 | - return 'getSystemVersion' | ||
| 106 | - } | ||
| 107 | } | 88 | } |
| @@ -114,7 +114,7 @@ export { ShareInfo } from './src/main/ets/bean/morningevening/ShareInfo'; | @@ -114,7 +114,7 @@ export { ShareInfo } from './src/main/ets/bean/morningevening/ShareInfo'; | ||
| 114 | 114 | ||
| 115 | export { slideShows } from './src/main/ets/bean/morningevening/slideShows'; | 115 | export { slideShows } from './src/main/ets/bean/morningevening/slideShows'; |
| 116 | 116 | ||
| 117 | -export { LiveDetailsBean } from './src/main/ets/bean/live/LiveDetailsBean'; | 117 | +export { LiveDetailsBean, joinPeopleNum } from './src/main/ets/bean/live/LiveDetailsBean'; |
| 118 | 118 | ||
| 119 | export { ArticleListDTO } from './src/main/ets/bean/component/ArticleListDTO'; | 119 | export { ArticleListDTO } from './src/main/ets/bean/component/ArticleListDTO'; |
| 120 | 120 |
| @@ -208,3 +208,11 @@ export interface Vlive { | @@ -208,3 +208,11 @@ export interface Vlive { | ||
| 208 | export interface ReLInfo { | 208 | export interface ReLInfo { |
| 209 | relId: string | 209 | relId: string |
| 210 | } | 210 | } |
| 211 | + | ||
| 212 | +export interface joinPeopleNum { | ||
| 213 | + barrageNum: number, | ||
| 214 | + likeNum: number, | ||
| 215 | + liveId: number, | ||
| 216 | + pv: number, | ||
| 217 | + subscribeNum: number | ||
| 218 | +} |
| @@ -20,6 +20,7 @@ | @@ -20,6 +20,7 @@ | ||
| 20 | "wdJsBridge": "file:../../commons/wdJsBridge", | 20 | "wdJsBridge": "file:../../commons/wdJsBridge", |
| 21 | "wdDetailPlayApi": "file:../../features/wdDetailPlayApi", | 21 | "wdDetailPlayApi": "file:../../features/wdDetailPlayApi", |
| 22 | "wdHwAbility": "file:../../features/wdHwAbility", | 22 | "wdHwAbility": "file:../../features/wdHwAbility", |
| 23 | - "wdShare": "file:../../features/wdShare" | 23 | + "wdShare": "file:../../features/wdShare", |
| 24 | + "wdTracking": "file:../../features/wdTracking" | ||
| 24 | } | 25 | } |
| 25 | } | 26 | } |
| @@ -321,6 +321,7 @@ export struct ENewspaperPageComponent { | @@ -321,6 +321,7 @@ export struct ENewspaperPageComponent { | ||
| 321 | if (this.isOpenListDialog) { | 321 | if (this.isOpenListDialog) { |
| 322 | ENewspaperListDialog({ | 322 | ENewspaperListDialog({ |
| 323 | newspaperListBean: this.newspaperListBean, | 323 | newspaperListBean: this.newspaperListBean, |
| 324 | + scrollIndex: this.swiperIndex, | ||
| 324 | closeDialog: () => { | 325 | closeDialog: () => { |
| 325 | this.isOpenListDialog = false | 326 | this.isOpenListDialog = false |
| 326 | } | 327 | } |
| 1 | import { FeedbackTypeBean, PhotoListBean } from 'wdBean/Index'; | 1 | import { FeedbackTypeBean, PhotoListBean } from 'wdBean/Index'; |
| 2 | -import { FastClickUtil, Logger, NetworkUtil, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index'; | 2 | +import { AppUtils, |
| 3 | + DeviceUtil, | ||
| 4 | + FastClickUtil, Logger, NetworkUtil, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index'; | ||
| 3 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; | 5 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; |
| 4 | import { CustomTitleUI } from './reusable/CustomTitleUI' | 6 | import { CustomTitleUI } from './reusable/CustomTitleUI' |
| 5 | import { picker } from '@kit.CoreFileKit'; | 7 | import { picker } from '@kit.CoreFileKit'; |
| @@ -8,7 +10,6 @@ import { router } from '@kit.ArkUI'; | @@ -8,7 +10,6 @@ import { router } from '@kit.ArkUI'; | ||
| 8 | import { CommonConstants } from 'wdConstant/Index'; | 10 | import { CommonConstants } from 'wdConstant/Index'; |
| 9 | import { ProcessUtils } from 'wdRouter/Index'; | 11 | import { ProcessUtils } from 'wdRouter/Index'; |
| 10 | import { HashMap } from '@kit.ArkTS'; | 12 | import { HashMap } from '@kit.ArkTS'; |
| 11 | -import { HttpParams } from 'wdNetwork/src/main/ets/http/HttpCommonParams'; | ||
| 12 | 13 | ||
| 13 | const TAG = 'FeedBackActivity' | 14 | const TAG = 'FeedBackActivity' |
| 14 | 15 | ||
| @@ -355,8 +356,8 @@ export struct FeedBackActivity { | @@ -355,8 +356,8 @@ export struct FeedBackActivity { | ||
| 355 | map.set("userName", UserDataLocal.getUserName()); | 356 | map.set("userName", UserDataLocal.getUserName()); |
| 356 | } | 357 | } |
| 357 | //设备 | 358 | //设备 |
| 358 | - map.set("appVersion", "V" + HttpParams.getVersionName()); | ||
| 359 | - map.set("appDevice", "harmony" + HttpParams.getSystemVersion() + " " + HttpParams.getPhoneModel()); | 359 | + map.set("appVersion", "V" + AppUtils.getAppVersionName()); |
| 360 | + map.set("appDevice", "harmony" + DeviceUtil.getDisplayVersion() + " " + DeviceUtil.getProductModel()); | ||
| 360 | // //投诉图片 | 361 | // //投诉图片 |
| 361 | // if (imageUrl.size() > 0) { | 362 | // if (imageUrl.size() > 0) { |
| 362 | // String[] str = imageUrl.toArray(new String[imageUrl.size()]); | 363 | // String[] str = imageUrl.toArray(new String[imageUrl.size()]); |
| @@ -18,7 +18,8 @@ export struct MultiPictureDetailItemComponent { | @@ -18,7 +18,8 @@ export struct MultiPictureDetailItemComponent { | ||
| 18 | build() { | 18 | build() { |
| 19 | Row() { | 19 | Row() { |
| 20 | Image(this.MultiPictureDetailItem.picPath) | 20 | Image(this.MultiPictureDetailItem.picPath) |
| 21 | - .alt($r('app.media.picture_loading')) | 21 | + .alt($r('app.media.datail_imageLoading_w')) |
| 22 | + | ||
| 22 | .width(this.imageWidth) | 23 | .width(this.imageWidth) |
| 23 | .objectFit(ImageFit.Contain) | 24 | .objectFit(ImageFit.Contain) |
| 24 | .interpolation(ImageInterpolation.High) | 25 | .interpolation(ImageInterpolation.High) |
| @@ -90,9 +90,6 @@ export struct SpacialTopicPageComponent { | @@ -90,9 +90,6 @@ export struct SpacialTopicPageComponent { | ||
| 90 | this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '') | 90 | this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '') |
| 91 | this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '') | 91 | this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '') |
| 92 | // } | 92 | // } |
| 93 | - if (this.contentDetailData[0]?.openComment) { | ||
| 94 | - this.operationButtonList = ['collect', 'share'] | ||
| 95 | - } | ||
| 96 | this.trySendData2H5() | 93 | this.trySendData2H5() |
| 97 | } | 94 | } |
| 98 | } | 95 | } |
| 1 | -import { ContentDTO } from 'wdBean/Index' | 1 | +import { ContentDTO, joinPeopleNum } from 'wdBean/Index' |
| 2 | import { DateTimeUtils } from 'wdKit/Index' | 2 | import { DateTimeUtils } from 'wdKit/Index' |
| 3 | +import { LottieView } from '../../components/lottie/LottieView'; | ||
| 4 | +import { LiveModel } from '../../viewmodel/LiveModel' | ||
| 5 | +import font from '@ohos.font'; | ||
| 3 | 6 | ||
| 4 | /** | 7 | /** |
| 5 | * 这里是样式卡中,右下角显示的音视频信息 | 8 | * 这里是样式卡中,右下角显示的音视频信息 |
| @@ -10,10 +13,55 @@ import { DateTimeUtils } from 'wdKit/Index' | @@ -10,10 +13,55 @@ import { DateTimeUtils } from 'wdKit/Index' | ||
| 10 | @Component | 13 | @Component |
| 11 | export struct CardMediaInfo { | 14 | export struct CardMediaInfo { |
| 12 | @State contentDTO: ContentDTO = new ContentDTO() // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中 | 15 | @State contentDTO: ContentDTO = new ContentDTO() // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中 |
| 13 | - | 16 | + @State joinPeopleNum: number = 0; |
| 14 | // objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频, | 17 | // objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频, |
| 15 | // 14动态图文,15动态视频16问政;100人民号,101标签 | 18 | // 14动态图文,15动态视频16问政;100人民号,101标签 |
| 16 | 19 | ||
| 20 | + aboutToAppear(): void { | ||
| 21 | + this.getJoinPeopleNum(); | ||
| 22 | + | ||
| 23 | + font.registerFont({ | ||
| 24 | + familyName: 'BebasNeue', | ||
| 25 | + familySrc: $rawfile('font/BebasNeue.ttf') | ||
| 26 | + }) | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * 全域数字显示规则 | ||
| 31 | + * 1、当数量为千位以內时,显示数字,不保留小数点,比如 4585 | ||
| 32 | + * 2、当数量为万位~1亿时,显示xx 万,保留小数点后一位,比如1517.9w、2.9w | ||
| 33 | + * 3、当数量为1亿~千亿时,显示XX 亿,保留小数点后一位,比如1517.9亿、2.9亿 | ||
| 34 | + * 4、不进行四舍五入 | ||
| 35 | + * 5、0 和空 不显示 | ||
| 36 | + */ | ||
| 37 | + handlerNum(number: string) { | ||
| 38 | + const num = number??'0'; | ||
| 39 | + if (Number.parseInt(num) <= 9999) { | ||
| 40 | + return Number.parseInt(num).toString() | ||
| 41 | + } else if (Number.parseInt(num) > 9999 && Number.parseInt(num) <= 99999999) { | ||
| 42 | + const num1: string = num.slice(0, -4); // 万 | ||
| 43 | + const num2: string = num.slice(-4, -3); // 千 | ||
| 44 | + return num2 === '0' ? num1 +'万' : num1 + '.' + num2 + '万' | ||
| 45 | + } else if (Number.parseInt(num) > 99999999) { | ||
| 46 | + const num1: string = num.slice(0, -8); // 亿 | ||
| 47 | + const num2: string = num.slice(-8, -7); | ||
| 48 | + return num2 === '0' ? num1 +'亿' : num1 + '.' + num2 + '亿' | ||
| 49 | + } | ||
| 50 | + return num | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + // | ||
| 54 | + /** | ||
| 55 | + * 获取直播节目参与人数 | ||
| 56 | + */ | ||
| 57 | + async getJoinPeopleNum() { | ||
| 58 | + if (this.contentDTO.objectType !== '2') return; | ||
| 59 | + console.log('getJoinPeopleNum-ContentDTO', JSON.stringify(this.contentDTO.objectId)) | ||
| 60 | + let liveIdList: string = this.contentDTO.objectId | ||
| 61 | + let data: joinPeopleNum[] = await LiveModel.getJoinPeopleNum(liveIdList) | ||
| 62 | + this.joinPeopleNum = data[0].pv; | ||
| 63 | + } | ||
| 64 | + | ||
| 17 | build() { | 65 | build() { |
| 18 | Row() { | 66 | Row() { |
| 19 | if (this.contentDTO?.objectType === '1' || this.contentDTO?.objectType === '15') { | 67 | if (this.contentDTO?.objectType === '1' || this.contentDTO?.objectType === '15') { |
| @@ -24,6 +72,7 @@ export struct CardMediaInfo { | @@ -24,6 +72,7 @@ export struct CardMediaInfo { | ||
| 24 | if (this.contentDTO.videoInfo != null) { | 72 | if (this.contentDTO.videoInfo != null) { |
| 25 | Text(DateTimeUtils.getFormattedDuration(this.contentDTO.videoInfo.videoDuration * 1000)) | 73 | Text(DateTimeUtils.getFormattedDuration(this.contentDTO.videoInfo.videoDuration * 1000)) |
| 26 | .mediaText() | 74 | .mediaText() |
| 75 | + .fontFamily('BebasNeue') | ||
| 27 | } | 76 | } |
| 28 | } | 77 | } |
| 29 | } else if (this.contentDTO.objectType === '2') { | 78 | } else if (this.contentDTO.objectType === '2') { |
| @@ -36,8 +85,19 @@ export struct CardMediaInfo { | @@ -36,8 +85,19 @@ export struct CardMediaInfo { | ||
| 36 | Text('预约') | 85 | Text('预约') |
| 37 | .mediaText() | 86 | .mediaText() |
| 38 | } else if (this.contentDTO?.liveInfo?.liveState === 'running') { | 87 | } else if (this.contentDTO?.liveInfo?.liveState === 'running') { |
| 39 | - Image($r('app.media.card_live')) | ||
| 40 | - .mediaLogo() | 88 | + LottieView({ |
| 89 | + name: 'live_status_wait', | ||
| 90 | + path: "lottie/live_detail_living.json", | ||
| 91 | + lottieWidth: 14, | ||
| 92 | + lottieHeight: 14, | ||
| 93 | + autoplay: true, | ||
| 94 | + loop: true, | ||
| 95 | + }) | ||
| 96 | + .margin({ | ||
| 97 | + right: '2vp' | ||
| 98 | + }) | ||
| 99 | + // Image($r('app.media.card_live')) | ||
| 100 | + // .mediaLogo() | ||
| 41 | Text('直播中') | 101 | Text('直播中') |
| 42 | .mediaText() | 102 | .mediaText() |
| 43 | } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo?.replayUri) { | 103 | } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo?.replayUri) { |
| @@ -50,6 +110,12 @@ export struct CardMediaInfo { | @@ -50,6 +110,12 @@ export struct CardMediaInfo { | ||
| 50 | Text('已结束') | 110 | Text('已结束') |
| 51 | .mediaText() | 111 | .mediaText() |
| 52 | } | 112 | } |
| 113 | + if (!!this.joinPeopleNum) { | ||
| 114 | + Text(' | ') | ||
| 115 | + .mediaText() | ||
| 116 | + Text(`${this.handlerNum(this.joinPeopleNum.toString())}人参加`) | ||
| 117 | + .mediaText() | ||
| 118 | + } | ||
| 53 | // } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo | 119 | // } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo |
| 54 | // ?.replayUri) { | 120 | // ?.replayUri) { |
| 55 | // // Image($r('app.media.card_live')) | 121 | // // Image($r('app.media.card_live')) |
| @@ -73,6 +139,7 @@ export struct CardMediaInfo { | @@ -73,6 +139,7 @@ export struct CardMediaInfo { | ||
| 73 | .mediaLogo() | 139 | .mediaLogo() |
| 74 | Text(DateTimeUtils.getFormattedDuration(this.contentDTO.voiceInfo.voiceDuration * 1000)) | 140 | Text(DateTimeUtils.getFormattedDuration(this.contentDTO.voiceInfo.voiceDuration * 1000)) |
| 75 | .mediaText() | 141 | .mediaText() |
| 142 | + .fontFamily('BebasNeue') | ||
| 76 | } | 143 | } |
| 77 | } else if (this.contentDTO.objectType === '4') {//广告标签 | 144 | } else if (this.contentDTO.objectType === '4') {//广告标签 |
| 78 | Text($r('app.string.comp_advertisement')) | 145 | Text($r('app.string.comp_advertisement')) |
| @@ -155,7 +155,7 @@ export struct RmhTitle { | @@ -155,7 +155,7 @@ export struct RmhTitle { | ||
| 155 | 155 | ||
| 156 | Text(Number(this.followStatus) === 0 ? '关注' : '已关注') | 156 | Text(Number(this.followStatus) === 0 ? '关注' : '已关注') |
| 157 | .fontSize($r('app.float.font_size_13')) | 157 | .fontSize($r('app.float.font_size_13')) |
| 158 | - .fontColor($r('app.color.color_ED2800')) | 158 | + .fontColor(Number(this.followStatus) === 0 ? $r('app.color.color_ED2800') : 0xc6c6c6) |
| 159 | } | 159 | } |
| 160 | .flexShrink(0) | 160 | .flexShrink(0) |
| 161 | .alignSelf(ItemAlign.Center) | 161 | .alignSelf(ItemAlign.Center) |
| 1 | import { CompDTO } from 'wdBean/Index'; | 1 | import { CompDTO } from 'wdBean/Index'; |
| 2 | import { DateTimeUtils, Logger } from 'wdKit/Index'; | 2 | import { DateTimeUtils, Logger } from 'wdKit/Index'; |
| 3 | +import { PageHelper } from '../../viewmodel/PageHelper'; | ||
| 3 | import PageModel from '../../viewmodel/PageModel'; | 4 | import PageModel from '../../viewmodel/PageModel'; |
| 4 | 5 | ||
| 5 | /** | 6 | /** |
| @@ -61,6 +62,7 @@ export struct CardAdvBottom { | @@ -61,6 +62,7 @@ export struct CardAdvBottom { | ||
| 61 | } | 62 | } |
| 62 | if (currentIndex >= 0) { | 63 | if (currentIndex >= 0) { |
| 63 | this.pageModel.compList.deleteItem(currentIndex) | 64 | this.pageModel.compList.deleteItem(currentIndex) |
| 65 | + PageHelper.updateFirstPageEndIndex(this.pageModel, true, currentIndex) | ||
| 64 | } | 66 | } |
| 65 | } | 67 | } |
| 66 | } | 68 | } |
| 1 | import { CompDTO } from 'wdBean/Index'; | 1 | import { CompDTO } from 'wdBean/Index'; |
| 2 | import { DateTimeUtils, Logger } from 'wdKit/Index'; | 2 | import { DateTimeUtils, Logger } from 'wdKit/Index'; |
| 3 | +import {PageHelper} from '../../viewmodel/PageHelper'; | ||
| 3 | import PageModel from '../../viewmodel/PageModel'; | 4 | import PageModel from '../../viewmodel/PageModel'; |
| 4 | 5 | ||
| 5 | /** | 6 | /** |
| @@ -73,6 +74,7 @@ export struct CardAdvTop { | @@ -73,6 +74,7 @@ export struct CardAdvTop { | ||
| 73 | } | 74 | } |
| 74 | if (currentIndex >= 0) { | 75 | if (currentIndex >= 0) { |
| 75 | this.pageModel.compList.deleteItem(currentIndex) | 76 | this.pageModel.compList.deleteItem(currentIndex) |
| 77 | + PageHelper.updateFirstPageEndIndex(this.pageModel, true, currentIndex) | ||
| 76 | } | 78 | } |
| 77 | } | 79 | } |
| 78 | } | 80 | } |
| @@ -67,6 +67,7 @@ export struct Card2Component { | @@ -67,6 +67,7 @@ export struct Card2Component { | ||
| 67 | .fontSize($r('app.float.font_size_18')) | 67 | .fontSize($r('app.float.font_size_18')) |
| 68 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 68 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 69 | .maxLines(2) | 69 | .maxLines(2) |
| 70 | + .lineHeight(27) | ||
| 70 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | 71 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 |
| 71 | .align(Alignment.Start) | 72 | .align(Alignment.Start) |
| 72 | .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 : | 73 | .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 : |
| @@ -85,13 +85,14 @@ export struct Card6Component { | @@ -85,13 +85,14 @@ export struct Card6Component { | ||
| 85 | } | 85 | } |
| 86 | .justifyContent(FlexAlign.Start) | 86 | .justifyContent(FlexAlign.Start) |
| 87 | 87 | ||
| 88 | - | 88 | + Blank() |
| 89 | //bottom 评论等信息 | 89 | //bottom 评论等信息 |
| 90 | CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO }) | 90 | CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO }) |
| 91 | } | 91 | } |
| 92 | .alignItems(HorizontalAlign.Start) | 92 | .alignItems(HorizontalAlign.Start) |
| 93 | .justifyContent(FlexAlign.Start) | 93 | .justifyContent(FlexAlign.Start) |
| 94 | .width('64%') | 94 | .width('64%') |
| 95 | + .height(this.contentDTO.appStyle === CompStyle.Card_13 ? '' : 156) | ||
| 95 | 96 | ||
| 96 | Stack() { | 97 | Stack() { |
| 97 | Image(this.loadImg ? this.contentDTO.coverUrl : '') | 98 | Image(this.loadImg ? this.contentDTO.coverUrl : '') |
| @@ -101,7 +102,6 @@ export struct Card6Component { | @@ -101,7 +102,6 @@ export struct Card6Component { | ||
| 101 | .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156) | 102 | .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156) |
| 102 | CardMediaInfo({ contentDTO: this.contentDTO }) | 103 | CardMediaInfo({ contentDTO: this.contentDTO }) |
| 103 | } | 104 | } |
| 104 | - .alignContent(Alignment.BottomEnd) | ||
| 105 | } | 105 | } |
| 106 | .onClick((event: ClickEvent) => { | 106 | .onClick((event: ClickEvent) => { |
| 107 | this.clicked = true; | 107 | this.clicked = true; |
| @@ -117,5 +117,6 @@ export struct Card6Component { | @@ -117,5 +117,6 @@ export struct Card6Component { | ||
| 117 | .width(CommonConstants.FULL_WIDTH) | 117 | .width(CommonConstants.FULL_WIDTH) |
| 118 | // .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 107 : 217) | 118 | // .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 107 : 217) |
| 119 | .justifyContent(FlexAlign.SpaceBetween) | 119 | .justifyContent(FlexAlign.SpaceBetween) |
| 120 | + .alignItems(VerticalAlign.Top) | ||
| 120 | } | 121 | } |
| 121 | } | 122 | } |
| @@ -99,6 +99,7 @@ export struct CommentTabComponent { | @@ -99,6 +99,7 @@ export struct CommentTabComponent { | ||
| 99 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, | 99 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, |
| 100 | }) | 100 | }) |
| 101 | .id("Image") | 101 | .id("Image") |
| 102 | + .visibility(this.contentDetail.appstyle !== 9 ? Visibility.Visible : Visibility.Hidden) | ||
| 102 | } | 103 | } |
| 103 | Text(this.placeHolder) | 104 | Text(this.placeHolder) |
| 104 | .fontSize(12) | 105 | .fontSize(12) |
| @@ -110,6 +111,7 @@ export struct CommentTabComponent { | @@ -110,6 +111,7 @@ export struct CommentTabComponent { | ||
| 110 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, | 111 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, |
| 111 | }) | 112 | }) |
| 112 | .id("Text") | 113 | .id("Text") |
| 114 | + .visibility(this.contentDetail.appstyle !== 9 ? Visibility.Visible : Visibility.Hidden) | ||
| 113 | } | 115 | } |
| 114 | } | 116 | } |
| 115 | } | 117 | } |
| @@ -134,6 +136,7 @@ export struct CommentIconComponent { | @@ -134,6 +136,7 @@ export struct CommentIconComponent { | ||
| 134 | @ObjectLink publishCommentModel: publishCommentModel | 136 | @ObjectLink publishCommentModel: publishCommentModel |
| 135 | /*展示类型*/ | 137 | /*展示类型*/ |
| 136 | @State type: number = 1 | 138 | @State type: number = 1 |
| 139 | + @Prop contentDetail: ContentDetailDTO | ||
| 137 | styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) | 140 | styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) |
| 138 | // aboutToAppear(): void { | 141 | // aboutToAppear(): void { |
| 139 | // setTimeout(() => { | 142 | // setTimeout(() => { |
| @@ -206,7 +209,10 @@ export struct CommentIconComponent { | @@ -206,7 +209,10 @@ export struct CommentIconComponent { | ||
| 206 | 209 | ||
| 207 | } | 210 | } |
| 208 | } | 211 | } |
| 209 | - }.width(24).height(24) | 212 | + } |
| 213 | + .width(24) | ||
| 214 | + .height(24) | ||
| 215 | + .visibility(this.contentDetail.appstyle !== 9 ? Visibility.Visible : Visibility.Hidden) | ||
| 210 | 216 | ||
| 211 | // .backgroundColor(Color.Blue) | 217 | // .backgroundColor(Color.Blue) |
| 212 | } | 218 | } |
| @@ -2,6 +2,7 @@ import MinePageMoreFunctionModel from '../../viewmodel/MinePageMoreFunctionModel | @@ -2,6 +2,7 @@ import MinePageMoreFunctionModel from '../../viewmodel/MinePageMoreFunctionModel | ||
| 2 | import { WDRouterRule, WDRouterPage, ProcessUtils } from 'wdRouter' | 2 | import { WDRouterRule, WDRouterPage, ProcessUtils } from 'wdRouter' |
| 3 | import { Params } from 'wdBean'; | 3 | import { Params } from 'wdBean'; |
| 4 | import { ToastUtils } from 'wdKit/Index'; | 4 | import { ToastUtils } from 'wdKit/Index'; |
| 5 | +import { TrackingButton, TrackConstants } from 'wdTracking/Index'; | ||
| 5 | 6 | ||
| 6 | @Component | 7 | @Component |
| 7 | export default struct MinePageMoreFunctionUI { | 8 | export default struct MinePageMoreFunctionUI { |
| @@ -70,13 +71,16 @@ export default struct MinePageMoreFunctionUI { | @@ -70,13 +71,16 @@ export default struct MinePageMoreFunctionUI { | ||
| 70 | .onClick(() => { | 71 | .onClick(() => { |
| 71 | console.log(index + "") | 72 | console.log(index + "") |
| 72 | if (item.msg == "设置") { //设置 | 73 | if (item.msg == "设置") { //设置 |
| 74 | + trackButtonClick("myPageUserSetting") | ||
| 73 | let params: Params = { | 75 | let params: Params = { |
| 74 | pageID: 'mainSetting' | 76 | pageID: 'mainSetting' |
| 75 | } | 77 | } |
| 76 | WDRouterRule.jumpWithPage(WDRouterPage.settingPage, params) | 78 | WDRouterRule.jumpWithPage(WDRouterPage.settingPage, params) |
| 77 | }else if (item.msg == "关于") { // 关于 | 79 | }else if (item.msg == "关于") { // 关于 |
| 80 | + trackButtonClick("myPageUserAbout") | ||
| 78 | WDRouterRule.jumpWithPage(WDRouterPage.aboutPage) | 81 | WDRouterRule.jumpWithPage(WDRouterPage.aboutPage) |
| 79 | }else if (item.msg == "意见反馈") { // 关于 | 82 | }else if (item.msg == "意见反馈") { // 关于 |
| 83 | + trackButtonClick("myPageUserFeedBack") | ||
| 80 | ProcessUtils.gotoFeedBackActivity() | 84 | ProcessUtils.gotoFeedBackActivity() |
| 81 | } | 85 | } |
| 82 | }) | 86 | }) |
| @@ -90,4 +94,8 @@ export default struct MinePageMoreFunctionUI { | @@ -90,4 +94,8 @@ export default struct MinePageMoreFunctionUI { | ||
| 90 | .borderRadius(8) | 94 | .borderRadius(8) |
| 91 | .margin({ left: '23lpx', right: '23lpx', top: "19lpx" }) | 95 | .margin({ left: '23lpx', right: '23lpx', top: "19lpx" }) |
| 92 | } | 96 | } |
| 97 | +} | ||
| 98 | + | ||
| 99 | +function trackButtonClick(buttonName: string){ | ||
| 100 | + TrackingButton.click(buttonName, TrackConstants.PageName.My, TrackConstants.PageName.My) | ||
| 93 | } | 101 | } |
| 1 | import { WDRouterRule, WDRouterPage } from 'wdRouter' | 1 | import { WDRouterRule, WDRouterPage } from 'wdRouter' |
| 2 | +import { TrackConstants } from 'wdTracking/src/main/ets/common/TrackConstants' | ||
| 3 | +import { TrackingButton } from 'wdTracking/src/main/ets/tracking/TrackingButton' | ||
| 2 | import MinePageDatasModel from '../../model/MinePageDatasModel' | 4 | import MinePageDatasModel from '../../model/MinePageDatasModel' |
| 3 | import MinePagePersonalFunctionsItem from '../../viewmodel/MinePagePersonalFunctionsItem' | 5 | import MinePagePersonalFunctionsItem from '../../viewmodel/MinePagePersonalFunctionsItem' |
| 4 | import { PagePersonFunction } from './PagePersonFunction' | 6 | import { PagePersonFunction } from './PagePersonFunction' |
| @@ -25,6 +27,7 @@ export default struct MinePagePersonFunctionUI { | @@ -25,6 +27,7 @@ export default struct MinePagePersonFunctionUI { | ||
| 25 | }else { | 27 | }else { |
| 26 | let params: Record<string, string> = {'comment': "1"}; | 28 | let params: Record<string, string> = {'comment': "1"}; |
| 27 | WDRouterRule.jumpWithPage(WDRouterPage.mineHomePage,params) | 29 | WDRouterRule.jumpWithPage(WDRouterPage.mineHomePage,params) |
| 30 | + trackButtonClick("myPageUserComment") | ||
| 28 | } | 31 | } |
| 29 | break; | 32 | break; |
| 30 | } | 33 | } |
| @@ -33,6 +36,7 @@ export default struct MinePagePersonFunctionUI { | @@ -33,6 +36,7 @@ export default struct MinePagePersonFunctionUI { | ||
| 33 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | 36 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) |
| 34 | return | 37 | return |
| 35 | } | 38 | } |
| 39 | + trackButtonClick("myPageUserSubscribe") | ||
| 36 | WDRouterRule.jumpWithPage(WDRouterPage.appointmentListPage) | 40 | WDRouterRule.jumpWithPage(WDRouterPage.appointmentListPage) |
| 37 | break; | 41 | break; |
| 38 | } | 42 | } |
| @@ -42,6 +46,7 @@ export default struct MinePagePersonFunctionUI { | @@ -42,6 +46,7 @@ export default struct MinePagePersonFunctionUI { | ||
| 42 | return | 46 | return |
| 43 | } | 47 | } |
| 44 | WDRouterRule.jumpWithPage(WDRouterPage.followListPage) | 48 | WDRouterRule.jumpWithPage(WDRouterPage.followListPage) |
| 49 | + trackButtonClick("myPageUserFollow") | ||
| 45 | break; | 50 | break; |
| 46 | } | 51 | } |
| 47 | case "收藏":{ | 52 | case "收藏":{ |
| @@ -50,6 +55,7 @@ export default struct MinePagePersonFunctionUI { | @@ -50,6 +55,7 @@ export default struct MinePagePersonFunctionUI { | ||
| 50 | return | 55 | return |
| 51 | } | 56 | } |
| 52 | WDRouterRule.jumpWithPage(WDRouterPage.myCollectionListPagePage) | 57 | WDRouterRule.jumpWithPage(WDRouterPage.myCollectionListPagePage) |
| 58 | + trackButtonClick("myPageUserCollection") | ||
| 53 | break; | 59 | break; |
| 54 | } | 60 | } |
| 55 | case "历史":{ | 61 | case "历史":{ |
| @@ -66,6 +72,7 @@ export default struct MinePagePersonFunctionUI { | @@ -66,6 +72,7 @@ export default struct MinePagePersonFunctionUI { | ||
| 66 | return | 72 | return |
| 67 | } | 73 | } |
| 68 | this.messageClick() | 74 | this.messageClick() |
| 75 | + trackButtonClick("myPageUserNotice") | ||
| 69 | WDRouterRule.jumpWithPage(WDRouterPage.mineMessagePage) | 76 | WDRouterRule.jumpWithPage(WDRouterPage.mineMessagePage) |
| 70 | break; | 77 | break; |
| 71 | } | 78 | } |
| @@ -89,3 +96,7 @@ export default struct MinePagePersonFunctionUI { | @@ -89,3 +96,7 @@ export default struct MinePagePersonFunctionUI { | ||
| 89 | } | 96 | } |
| 90 | } | 97 | } |
| 91 | 98 | ||
| 99 | +function trackButtonClick(buttonName: string){ | ||
| 100 | + TrackingButton.click(buttonName, TrackConstants.PageName.My, TrackConstants.PageName.My) | ||
| 101 | +} | ||
| 102 | + |
| 1 | import { StringUtils, UserDataLocal } from 'wdKit' | 1 | import { StringUtils, UserDataLocal } from 'wdKit' |
| 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter' | 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter' |
| 3 | +import { TrackingButton, TrackConstants } from 'wdTracking/Index' | ||
| 3 | import MinePageDatasModel from '../../model/MinePageDatasModel' | 4 | import MinePageDatasModel from '../../model/MinePageDatasModel' |
| 4 | const TAG = "MinePageUserSimpleInfoUI" | 5 | const TAG = "MinePageUserSimpleInfoUI" |
| 5 | 6 | ||
| @@ -45,6 +46,7 @@ export default struct MinePageUserSimpleInfoUI { | @@ -45,6 +46,7 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 45 | .alignContent(Alignment.Center) | 46 | .alignContent(Alignment.Center) |
| 46 | .onClick(()=>{ | 47 | .onClick(()=>{ |
| 47 | this.jumpLogin() | 48 | this.jumpLogin() |
| 49 | + trackButtonClick("myPageUserHead") | ||
| 48 | }) | 50 | }) |
| 49 | 51 | ||
| 50 | if(this.isLogin){ | 52 | if(this.isLogin){ |
| @@ -68,6 +70,7 @@ export default struct MinePageUserSimpleInfoUI { | @@ -68,6 +70,7 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 68 | }.width('100%') | 70 | }.width('100%') |
| 69 | .onClick(()=>{ | 71 | .onClick(()=>{ |
| 70 | this.jumpLogin() | 72 | this.jumpLogin() |
| 73 | + trackButtonClick("myPageUserName") | ||
| 71 | }) | 74 | }) |
| 72 | 75 | ||
| 73 | Stack(){ | 76 | Stack(){ |
| @@ -101,6 +104,7 @@ export default struct MinePageUserSimpleInfoUI { | @@ -101,6 +104,7 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 101 | Blank() | 104 | Blank() |
| 102 | }.onClick(()=>{ | 105 | }.onClick(()=>{ |
| 103 | this.jumpLogin() | 106 | this.jumpLogin() |
| 107 | + trackButtonClick("myPageUserLogin") | ||
| 104 | }) | 108 | }) |
| 105 | .margin({top:'11lpx',left:'23lpx'}) | 109 | .margin({top:'11lpx',left:'23lpx'}) |
| 106 | .width('352lpx') | 110 | .width('352lpx') |
| @@ -198,3 +202,7 @@ export default struct MinePageUserSimpleInfoUI { | @@ -198,3 +202,7 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 198 | } | 202 | } |
| 199 | } | 203 | } |
| 200 | } | 204 | } |
| 205 | + | ||
| 206 | +function trackButtonClick(buttonName: string){ | ||
| 207 | + TrackingButton.click(buttonName, TrackConstants.PageName.My, TrackConstants.PageName.My) | ||
| 208 | +} |
| 1 | import MinePageDatasModel from '../../../model/MinePageDatasModel' | 1 | import MinePageDatasModel from '../../../model/MinePageDatasModel' |
| 2 | +import { onlyWifiLoadImg } from '../../../utils/lazyloadImg' | ||
| 2 | import { AppointmentOperationRequestItem } from '../../../viewmodel/AppointmentOperationRequestItem' | 3 | import { AppointmentOperationRequestItem } from '../../../viewmodel/AppointmentOperationRequestItem' |
| 3 | import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem' | 4 | import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem' |
| 4 | import { MyCustomDialog } from '../../reusable/MyCustomDialog' | 5 | import { MyCustomDialog } from '../../reusable/MyCustomDialog' |
| 5 | 6 | ||
| 6 | @Component | 7 | @Component |
| 7 | -export struct AppointmentListChildComponent{ | 8 | +export struct AppointmentListChildComponent { |
| 8 | @ObjectLink item: MineAppointmentItem | 9 | @ObjectLink item: MineAppointmentItem |
| 10 | + @State loadImg: boolean = false; | ||
| 11 | + | ||
| 12 | + async aboutToAppear(): Promise<void> { | ||
| 13 | + this.loadImg = await onlyWifiLoadImg(); | ||
| 14 | + } | ||
| 15 | + | ||
| 9 | dialogController: CustomDialogController = new CustomDialogController({ | 16 | dialogController: CustomDialogController = new CustomDialogController({ |
| 10 | builder: MyCustomDialog({ | 17 | builder: MyCustomDialog({ |
| 11 | cancel: this.onCancel, | 18 | cancel: this.onCancel, |
| @@ -20,18 +27,20 @@ export struct AppointmentListChildComponent{ | @@ -20,18 +27,20 @@ export struct AppointmentListChildComponent{ | ||
| 20 | customStyle: true | 27 | customStyle: true |
| 21 | }) | 28 | }) |
| 22 | 29 | ||
| 23 | - | ||
| 24 | build() { | 30 | build() { |
| 25 | - Column(){ | ||
| 26 | - Stack(){ | ||
| 27 | - Image(this.item?.imageUrl[0]) | 31 | + Column() { |
| 32 | + Stack() { | ||
| 33 | + Image(this.loadImg ? this.item?.imageUrl[0] : '') | ||
| 34 | + .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5) | ||
| 35 | + .width('100%') | ||
| 36 | + .aspectRatio(16 / 9) | ||
| 28 | .objectFit(ImageFit.Auto) | 37 | .objectFit(ImageFit.Auto) |
| 29 | .interpolation(ImageInterpolation.High) | 38 | .interpolation(ImageInterpolation.High) |
| 30 | 39 | ||
| 31 | 40 | ||
| 32 | - if(this.item.relType === 1){ | ||
| 33 | - Row(){ | ||
| 34 | - Row(){ | 41 | + if (this.item.relType === 1) { |
| 42 | + Row() { | ||
| 43 | + Row() { | ||
| 35 | Image($r('app.media.reserve_icon')) | 44 | Image($r('app.media.reserve_icon')) |
| 36 | .width('42lpx') | 45 | .width('42lpx') |
| 37 | .height('35lpx') | 46 | .height('35lpx') |
| @@ -47,7 +56,7 @@ export struct AppointmentListChildComponent{ | @@ -47,7 +56,7 @@ export struct AppointmentListChildComponent{ | ||
| 47 | .layoutWeight(1) | 56 | .layoutWeight(1) |
| 48 | .textAlign(TextAlign.Center) | 57 | .textAlign(TextAlign.Center) |
| 49 | }.width('94lpx') | 58 | }.width('94lpx') |
| 50 | - .margin({bottom:'15lpx',right:'15lpx'}) | 59 | + .margin({ bottom: '15lpx', right: '15lpx' }) |
| 51 | }.width('100%') | 60 | }.width('100%') |
| 52 | .height('100%') | 61 | .height('100%') |
| 53 | .alignItems(VerticalAlign.Bottom) | 62 | .alignItems(VerticalAlign.Bottom) |
| @@ -56,7 +65,7 @@ export struct AppointmentListChildComponent{ | @@ -56,7 +65,7 @@ export struct AppointmentListChildComponent{ | ||
| 56 | }.width('100%') | 65 | }.width('100%') |
| 57 | .height('376lpx') | 66 | .height('376lpx') |
| 58 | 67 | ||
| 59 | - Column(){ | 68 | + Column() { |
| 60 | Text(this.item.title) | 69 | Text(this.item.title) |
| 61 | .fontWeight('400lpx') | 70 | .fontWeight('400lpx') |
| 62 | .fontSize('33lpx') | 71 | .fontSize('33lpx') |
| @@ -64,28 +73,28 @@ export struct AppointmentListChildComponent{ | @@ -64,28 +73,28 @@ export struct AppointmentListChildComponent{ | ||
| 64 | .lineHeight('48lpx') | 73 | .lineHeight('48lpx') |
| 65 | .maxLines(2) | 74 | .maxLines(2) |
| 66 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 75 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 67 | - .margin({bottom:'23lpx'}) | 76 | + .margin({ bottom: '23lpx' }) |
| 68 | .textAlign(TextAlign.Start) | 77 | .textAlign(TextAlign.Start) |
| 69 | .width('100%') | 78 | .width('100%') |
| 70 | - Row(){ | ||
| 71 | - Row(){ | ||
| 72 | - if(this.item.relType === 2){ | 79 | + Row() { |
| 80 | + Row() { | ||
| 81 | + if (this.item.relType === 2) { | ||
| 73 | Image($r('app.media.play_status_history_icon')) | 82 | Image($r('app.media.play_status_history_icon')) |
| 74 | .objectFit(ImageFit.Auto) | 83 | .objectFit(ImageFit.Auto) |
| 75 | .interpolation(ImageInterpolation.High) | 84 | .interpolation(ImageInterpolation.High) |
| 76 | .width('38lpx') | 85 | .width('38lpx') |
| 77 | .height('38lpx') | 86 | .height('38lpx') |
| 78 | - .margin({right:'12lpx'}) | 87 | + .margin({ right: '12lpx' }) |
| 79 | Text('已结束').fontColor($r('app.color.color_999999')) | 88 | Text('已结束').fontColor($r('app.color.color_999999')) |
| 80 | .fontWeight('500lpx') | 89 | .fontWeight('500lpx') |
| 81 | .fontSize('23lpx') | 90 | .fontSize('23lpx') |
| 82 | - }else { | 91 | + } else { |
| 83 | Image($r('app.media.play_status_icon')) | 92 | Image($r('app.media.play_status_icon')) |
| 84 | .objectFit(ImageFit.Auto) | 93 | .objectFit(ImageFit.Auto) |
| 85 | .interpolation(ImageInterpolation.High) | 94 | .interpolation(ImageInterpolation.High) |
| 86 | .width('38lpx') | 95 | .width('38lpx') |
| 87 | .height('38lpx') | 96 | .height('38lpx') |
| 88 | - .margin({right:'12lpx'}) | 97 | + .margin({ right: '12lpx' }) |
| 89 | Text(this.item.timePre).fontColor($r('app.color.color_ED2800')) | 98 | Text(this.item.timePre).fontColor($r('app.color.color_ED2800')) |
| 90 | .fontWeight('500lpx') | 99 | .fontWeight('500lpx') |
| 91 | .fontSize('23lpx') | 100 | .fontSize('23lpx') |
| @@ -94,35 +103,37 @@ export struct AppointmentListChildComponent{ | @@ -94,35 +103,37 @@ export struct AppointmentListChildComponent{ | ||
| 94 | .interpolation(ImageInterpolation.High) | 103 | .interpolation(ImageInterpolation.High) |
| 95 | .width('12lpx') | 104 | .width('12lpx') |
| 96 | .height('31lpx') | 105 | .height('31lpx') |
| 97 | - .margin({right:'4lpx'}) | 106 | + .margin({ right: '4lpx' }) |
| 98 | Text(`${this.item.timeBack}开始`).fontColor($r('app.color.color_ED2800')) | 107 | Text(`${this.item.timeBack}开始`).fontColor($r('app.color.color_ED2800')) |
| 99 | .fontWeight('500lpx') | 108 | .fontWeight('500lpx') |
| 100 | .fontSize('23lpx') | 109 | .fontSize('23lpx') |
| 101 | .lineHeight('31lpx') | 110 | .lineHeight('31lpx') |
| 102 | } | 111 | } |
| 103 | - }.padding({left:'19lpx',right:'19lpx'}) | 112 | + } |
| 113 | + .padding({ left: '19lpx', right: '19lpx' }) | ||
| 104 | .height('46lpx') | 114 | .height('46lpx') |
| 105 | .alignItems(VerticalAlign.Center) | 115 | .alignItems(VerticalAlign.Center) |
| 106 | .backgroundColor($r('app.color.color_F5F5F5')) | 116 | .backgroundColor($r('app.color.color_F5F5F5')) |
| 107 | .borderRadius('4lpx') | 117 | .borderRadius('4lpx') |
| 118 | + | ||
| 108 | Blank() | 119 | Blank() |
| 109 | - .layoutWeight(1) | ||
| 110 | - if(this.item.relType === 1){ | ||
| 111 | - Text(this.item.isAppointment?"已预约":"预约") | ||
| 112 | - .fontWeight(400) | ||
| 113 | - .fontSize('23lpx') | ||
| 114 | - .backgroundColor(this.item.isAppointment?$r('app.color.color_F5F5F5'):$r('app.color.color_ED2800')) | ||
| 115 | - .fontColor(this.item.isAppointment?$r('app.color.color_CCCCCC'):$r('app.color.white')) | ||
| 116 | - .lineHeight('31lpx') | ||
| 117 | - .textAlign(TextAlign.Center) | ||
| 118 | - .width('100lpx') | ||
| 119 | - .height('46lpx') | ||
| 120 | - .borderRadius('6lpx') | ||
| 121 | - .onClick(()=>{ | ||
| 122 | - this.dialogController.open() | ||
| 123 | - }) | ||
| 124 | - }else { | ||
| 125 | - Text(this.item.relType === 2?"去观看":"看回放") | 120 | + .layoutWeight(1) |
| 121 | + if (this.item.relType === 1) { | ||
| 122 | + Text(this.item.isAppointment ? "已预约" : "预约") | ||
| 123 | + .fontWeight(400) | ||
| 124 | + .fontSize('23lpx') | ||
| 125 | + .backgroundColor(this.item.isAppointment ? $r('app.color.color_F5F5F5') : $r('app.color.color_ED2800')) | ||
| 126 | + .fontColor(this.item.isAppointment ? $r('app.color.color_CCCCCC') : $r('app.color.white')) | ||
| 127 | + .lineHeight('31lpx') | ||
| 128 | + .textAlign(TextAlign.Center) | ||
| 129 | + .width('100lpx') | ||
| 130 | + .height('46lpx') | ||
| 131 | + .borderRadius('6lpx') | ||
| 132 | + .onClick(() => { | ||
| 133 | + this.dialogController.open() | ||
| 134 | + }) | ||
| 135 | + } else { | ||
| 136 | + Text(this.item.relType === 2 ? "去观看" : "看回放") | ||
| 126 | .fontWeight(400) | 137 | .fontWeight(400) |
| 127 | .fontSize('23lpx') | 138 | .fontSize('23lpx') |
| 128 | .backgroundColor($r('app.color.color_ED2800')) | 139 | .backgroundColor($r('app.color.color_ED2800')) |
| @@ -135,7 +146,12 @@ export struct AppointmentListChildComponent{ | @@ -135,7 +146,12 @@ export struct AppointmentListChildComponent{ | ||
| 135 | } | 146 | } |
| 136 | } | 147 | } |
| 137 | } | 148 | } |
| 138 | - .padding({left:'23lpx',right:'23lpx',top:'15lpx',bottom:'23lpx'}) | 149 | + .padding({ |
| 150 | + left: '23lpx', | ||
| 151 | + right: '23lpx', | ||
| 152 | + top: '15lpx', | ||
| 153 | + bottom: '23lpx' | ||
| 154 | + }) | ||
| 139 | }.margin({ left: 10, right: 10 }) | 155 | }.margin({ left: 10, right: 10 }) |
| 140 | .backgroundColor($r('app.color.white')) | 156 | .backgroundColor($r('app.color.white')) |
| 141 | .borderRadius('8lpx') | 157 | .borderRadius('8lpx') |
| @@ -145,20 +161,19 @@ export struct AppointmentListChildComponent{ | @@ -145,20 +161,19 @@ export struct AppointmentListChildComponent{ | ||
| 145 | console.info('Callback when the first button is clicked') | 161 | console.info('Callback when the first button is clicked') |
| 146 | } | 162 | } |
| 147 | 163 | ||
| 148 | - onAccept(){ | 164 | + onAccept() { |
| 149 | console.info('Callback when the second button is clicked') | 165 | console.info('Callback when the second button is clicked') |
| 150 | this.appointmentOperation() | 166 | this.appointmentOperation() |
| 151 | } | 167 | } |
| 152 | 168 | ||
| 153 | - appointmentOperation(){ | ||
| 154 | - let item = new AppointmentOperationRequestItem(this.item.relId,this.item.liveId+"",!this.item.isAppointment) | ||
| 155 | - MinePageDatasModel.getAppointmentOperation(item,getContext(this)).then((value)=>{ | ||
| 156 | - if(value!=null){ | 169 | + appointmentOperation() { |
| 170 | + let item = new AppointmentOperationRequestItem(this.item.relId, this.item.liveId + "", !this.item.isAppointment) | ||
| 171 | + MinePageDatasModel.getAppointmentOperation(item, getContext(this)).then((value) => { | ||
| 172 | + if (value != null) { | ||
| 157 | if (value.code === 0 || value.code.toString() === "0") { | 173 | if (value.code === 0 || value.code.toString() === "0") { |
| 158 | this.item.isAppointment = !this.item.isAppointment | 174 | this.item.isAppointment = !this.item.isAppointment |
| 159 | } | 175 | } |
| 160 | } | 176 | } |
| 161 | }) | 177 | }) |
| 162 | } | 178 | } |
| 163 | - | ||
| 164 | } | 179 | } |
| 1 | import { DateTimeUtils, StringUtils, ToastUtils } from 'wdKit/Index' | 1 | import { DateTimeUtils, StringUtils, ToastUtils } from 'wdKit/Index' |
| 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' |
| 3 | -import { WDMessageCenterMessageType } from '../../../model/InteractMessageModel' | 3 | +import { Remark, WDMessageCenterMessageType } from '../../../model/InteractMessageModel' |
| 4 | import MinePageDatasModel from '../../../model/MinePageDatasModel' | 4 | import MinePageDatasModel from '../../../model/MinePageDatasModel' |
| 5 | import { MessageItem } from '../../../viewmodel/MessageItem' | 5 | import { MessageItem } from '../../../viewmodel/MessageItem' |
| 6 | import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh' | 6 | import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh' |
| @@ -66,6 +66,24 @@ export struct MessageListUI { | @@ -66,6 +66,24 @@ export struct MessageListUI { | ||
| 66 | if (value.activeInfo.title) { | 66 | if (value.activeInfo.title) { |
| 67 | item.desc = value.activeInfo.title.replace("null","") | 67 | item.desc = value.activeInfo.title.replace("null","") |
| 68 | } | 68 | } |
| 69 | + let remark = JSON.parse(value.activeInfo.remark) as Remark | ||
| 70 | + switch (value.activeInfo.contentType){ | ||
| 71 | + case "204": | ||
| 72 | + item.desc = remark.userName + "关注了你" | ||
| 73 | + break; | ||
| 74 | + case "206": | ||
| 75 | + item.desc = remark.userName +"赞了你的作品" | ||
| 76 | + break; | ||
| 77 | + case "207": | ||
| 78 | + item.desc = remark.userName + "赞了你的评论" | ||
| 79 | + break; | ||
| 80 | + case "208": | ||
| 81 | + item.desc = remark.userName + "评论了你的作品" | ||
| 82 | + break; | ||
| 83 | + case "209": | ||
| 84 | + item.desc = remark.userName + "回复了你的评论" | ||
| 85 | + break; | ||
| 86 | + } | ||
| 69 | if (value.activeInfo.time) { | 87 | if (value.activeInfo.time) { |
| 70 | item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.activeInfo.time) + "") | 88 | item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.activeInfo.time) + "") |
| 71 | } | 89 | } |
| 1 | +import { DateTimeUtils } from 'wdKit/Index'; | ||
| 2 | +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; | ||
| 1 | import { AppointmentListUI } from '../mine/appointment/AppointmentListUI' | 3 | import { AppointmentListUI } from '../mine/appointment/AppointmentListUI' |
| 2 | 4 | ||
| 3 | const TAG = "AppointmentListPage" | 5 | const TAG = "AppointmentListPage" |
| @@ -5,6 +7,19 @@ const TAG = "AppointmentListPage" | @@ -5,6 +7,19 @@ const TAG = "AppointmentListPage" | ||
| 5 | @Entry | 7 | @Entry |
| 6 | @Component | 8 | @Component |
| 7 | struct AppointmentListPage { | 9 | struct AppointmentListPage { |
| 10 | + pageShowTime:number = 0; | ||
| 11 | + pageHideTime:number = 0; | ||
| 12 | + | ||
| 13 | + onPageShow() { | ||
| 14 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + onPageHide(): void { | ||
| 18 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 19 | + let duration = 0 | ||
| 20 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 21 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.My_Saved_Live,TrackConstants.PageName.My_Saved_Live,duration) | ||
| 22 | + } | ||
| 8 | 23 | ||
| 9 | build() { | 24 | build() { |
| 10 | Column(){ | 25 | Column(){ |
| @@ -73,7 +73,7 @@ export struct BottomNavigationComponent { | @@ -73,7 +73,7 @@ export struct BottomNavigationComponent { | ||
| 73 | TabContent() { | 73 | TabContent() { |
| 74 | if (CompUtils.isMine(navItem)) { | 74 | if (CompUtils.isMine(navItem)) { |
| 75 | // 我的页面组件数据列表 | 75 | // 我的页面组件数据列表 |
| 76 | - MinePageComponent() | 76 | + MinePageComponent({isMinePage: this.currentNavIndex === this.bottomNavList.length-1}) |
| 77 | } else if (navItem.name === '视频') { | 77 | } else if (navItem.name === '视频') { |
| 78 | // 视频频道,包含视频和直播 | 78 | // 视频频道,包含视频和直播 |
| 79 | VideoChannelPage({ | 79 | VideoChannelPage({ |
| 1 | import { Params } from 'wdBean'; | 1 | import { Params } from 'wdBean'; |
| 2 | import { FollowFirstTabsComponent } from '../mine/follow/FollowFirstTabsComponent' | 2 | import { FollowFirstTabsComponent } from '../mine/follow/FollowFirstTabsComponent' |
| 3 | import router from '@ohos.router'; | 3 | import router from '@ohos.router'; |
| 4 | +import { DateTimeUtils } from 'wdKit/Index'; | ||
| 5 | +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; | ||
| 4 | 6 | ||
| 5 | @Entry | 7 | @Entry |
| 6 | @Component | 8 | @Component |
| 7 | struct FollowListPage { | 9 | struct FollowListPage { |
| 8 | @State params:Record<string, string> = router.getParams() as Record<string, string>; | 10 | @State params:Record<string, string> = router.getParams() as Record<string, string>; |
| 9 | @State curIndex: string = '0'; | 11 | @State curIndex: string = '0'; |
| 12 | + pageShowTime:number = 0; | ||
| 13 | + pageHideTime:number = 0; | ||
| 10 | 14 | ||
| 11 | onPageShow() { | 15 | onPageShow() { |
| 12 | this.curIndex = this.params?.['index']; | 16 | this.curIndex = this.params?.['index']; |
| 17 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | + onPageHide(): void { | ||
| 21 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 22 | + let duration = 0 | ||
| 23 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 24 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.My_Follow,TrackConstants.PageName.My_Follow,duration) | ||
| 13 | } | 25 | } |
| 14 | 26 | ||
| 15 | build() { | 27 | build() { |
| @@ -12,6 +12,7 @@ import LoadMoreLayout from '../page/LoadMoreLayout'; | @@ -12,6 +12,7 @@ import LoadMoreLayout from '../page/LoadMoreLayout'; | ||
| 12 | import { LottieView } from '../../components/lottie/LottieView'; | 12 | import { LottieView } from '../../components/lottie/LottieView'; |
| 13 | import dataPreferences from '@ohos.data.preferences'; | 13 | import dataPreferences from '@ohos.data.preferences'; |
| 14 | import { BusinessError } from '@ohos.base'; | 14 | import { BusinessError } from '@ohos.base'; |
| 15 | +import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | ||
| 15 | 16 | ||
| 16 | const TAG: string = 'LiveMorePage'; | 17 | const TAG: string = 'LiveMorePage'; |
| 17 | 18 | ||
| @@ -45,8 +46,12 @@ struct LiveMorePage { | @@ -45,8 +46,12 @@ struct LiveMorePage { | ||
| 45 | // 点击过的数据 | 46 | // 点击过的数据 |
| 46 | @State clickDatas: Array<string> = [] | 47 | @State clickDatas: Array<string> = [] |
| 47 | 48 | ||
| 48 | - async aboutToAppear() { | 49 | + @State loadImg: boolean = false; |
| 50 | + | ||
| 51 | + | ||
| 52 | + async aboutToAppear() : Promise<void>{ | ||
| 49 | await this.getPreferencesFromStorage() | 53 | await this.getPreferencesFromStorage() |
| 54 | + this.loadImg = await onlyWifiLoadImg(); | ||
| 50 | this.getLivMoreClickPreference() | 55 | this.getLivMoreClickPreference() |
| 51 | Logger.debug(TAG, '数据:' + JSON.stringify(this.clickDatas)) | 56 | Logger.debug(TAG, '数据:' + JSON.stringify(this.clickDatas)) |
| 52 | this.currentPage = 1 | 57 | this.currentPage = 1 |
| @@ -155,9 +160,10 @@ struct LiveMorePage { | @@ -155,9 +160,10 @@ struct LiveMorePage { | ||
| 155 | .fontColor(this.isClicked(item.objectId) ? $r('app.color.color_848484') : $r('app.color.color_222222')) | 160 | .fontColor(this.isClicked(item.objectId) ? $r('app.color.color_848484') : $r('app.color.color_222222')) |
| 156 | Stack() { | 161 | Stack() { |
| 157 | if (item.fullColumnImgUrls && item.fullColumnImgUrls.length > 0) { | 162 | if (item.fullColumnImgUrls && item.fullColumnImgUrls.length > 0) { |
| 158 | - Image(item.fullColumnImgUrls[0].url) | 163 | + Image(this.loadImg?item.fullColumnImgUrls[0].url:'') |
| 164 | + .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5) | ||
| 159 | .width('100%') | 165 | .width('100%') |
| 160 | - .height(196) | 166 | + .aspectRatio(16 / 9) |
| 161 | .borderRadius(4) | 167 | .borderRadius(4) |
| 162 | } | 168 | } |
| 163 | this.LiveImage(item) | 169 | this.LiveImage(item) |
| @@ -5,10 +5,12 @@ import MinePageDatasModel from '../../model/MinePageDatasModel' | @@ -5,10 +5,12 @@ import MinePageDatasModel from '../../model/MinePageDatasModel' | ||
| 5 | import MinePageUserSimpleInfoUI from '../mine/MinePageUserSimpleInfoUI' | 5 | import MinePageUserSimpleInfoUI from '../mine/MinePageUserSimpleInfoUI' |
| 6 | import MinePagePersonFunctionUI from '../mine/MinePagePersonFunctionUI' | 6 | import MinePagePersonFunctionUI from '../mine/MinePagePersonFunctionUI' |
| 7 | import MinePageMoreFunctionUI from '../mine/MinePageMoreFunctionUI' | 7 | import MinePageMoreFunctionUI from '../mine/MinePageMoreFunctionUI' |
| 8 | -import { SPHelper, StringUtils } from 'wdKit' | 8 | +import { DateTimeUtils, SPHelper, StringUtils } from 'wdKit' |
| 9 | import { SpConstants } from 'wdConstant' | 9 | import { SpConstants } from 'wdConstant' |
| 10 | import dataPreferences from '@ohos.data.preferences'; | 10 | import dataPreferences from '@ohos.data.preferences'; |
| 11 | import { MergeRecordDialog } from '../../dialog/MergeRecordDialog' | 11 | import { MergeRecordDialog } from '../../dialog/MergeRecordDialog' |
| 12 | +import { TrackingPageBrowse } from 'wdTracking/src/main/ets/tracking/TrackingPageBrowse' | ||
| 13 | +import { TrackConstants } from 'wdTracking/src/main/ets/common/TrackConstants' | ||
| 12 | 14 | ||
| 13 | const TAG = 'MinePageComponent'; | 15 | const TAG = 'MinePageComponent'; |
| 14 | 16 | ||
| @@ -51,13 +53,36 @@ export struct MinePageComponent { | @@ -51,13 +53,36 @@ export struct MinePageComponent { | ||
| 51 | alignment: DialogAlignment.Center, | 53 | alignment: DialogAlignment.Center, |
| 52 | autoCancel: false | 54 | autoCancel: false |
| 53 | }) | 55 | }) |
| 54 | - @Consume @Watch('pageShowForUpdateData') pageShow :number | ||
| 55 | - | 56 | + @Consume @Watch('pageShowForUpdateData') pageShow :number |
| 57 | + @Consume @Watch('pageHideForUpdateData') pageHide :number | ||
| 58 | + pageShowTime:number = 0; | ||
| 59 | + pageHideTime:number = 0; | ||
| 60 | + pageFirstCreateTime:number = 0; | ||
| 61 | + @Prop isMinePage:boolean = false; | ||
| 62 | + | ||
| 63 | + //第一次还没创建时候 pageShow 接收不到监听 | ||
| 56 | pageShowForUpdateData(): void { | 64 | pageShowForUpdateData(): void { |
| 57 | - this.getMessageData() | 65 | + if(this.isMinePage){ |
| 66 | + this.getMessageData() | ||
| 67 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 68 | + } | ||
| 69 | + } | ||
| 70 | + pageHideForUpdateData(): void { | ||
| 71 | + if(this.isMinePage){ | ||
| 72 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 73 | + let duration = 0 | ||
| 74 | + if(this.pageShowTime != 0){ | ||
| 75 | + duration = (this.pageHideTime - this.pageShowTime)/1000 | ||
| 76 | + }else{ | ||
| 77 | + duration = (this.pageHideTime - this.pageFirstCreateTime)/1000 | ||
| 78 | + } | ||
| 79 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.My,TrackConstants.PageName.My,Math.floor(duration)) | ||
| 80 | + } | ||
| 58 | } | 81 | } |
| 59 | 82 | ||
| 60 | aboutToAppear(){ | 83 | aboutToAppear(){ |
| 84 | + this.pageFirstCreateTime = DateTimeUtils.getTimeStamp() | ||
| 85 | + | ||
| 61 | this.getUserLogin() | 86 | this.getUserLogin() |
| 62 | this.getFunctionData() | 87 | this.getFunctionData() |
| 63 | this.addLoginStatusObserver() | 88 | this.addLoginStatusObserver() |
| 1 | -import { PermissionUtil } from 'wdKit' | 1 | +import { DateTimeUtils, PermissionUtil } from 'wdKit' |
| 2 | import { PrivacySettingModel } from '../../model/PrivacySettingModel' | 2 | import { PrivacySettingModel } from '../../model/PrivacySettingModel' |
| 3 | import { Params } from 'wdBean'; | 3 | import { Params } from 'wdBean'; |
| 4 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 4 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 5 | import { HttpUtils } from 'wdNetwork/Index'; | 5 | import { HttpUtils } from 'wdNetwork/Index'; |
| 6 | +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; | ||
| 6 | 7 | ||
| 7 | const TAG = 'PrivacySettingPage'; | 8 | const TAG = 'PrivacySettingPage'; |
| 8 | const DiyString = '开启个性化推荐' | 9 | const DiyString = '开启个性化推荐' |
| @@ -15,9 +16,19 @@ export struct PrivacySettingPage { | @@ -15,9 +16,19 @@ export struct PrivacySettingPage { | ||
| 15 | tips: string = '设置前可查阅' | 16 | tips: string = '设置前可查阅' |
| 16 | privacyTips: string = '《隐私政策》' | 17 | privacyTips: string = '《隐私政策》' |
| 17 | tipsEnd = '中相应权限使用规则' | 18 | tipsEnd = '中相应权限使用规则' |
| 19 | + pageShowTime:number = 0; | ||
| 20 | + pageHideTime:number = 0; | ||
| 18 | 21 | ||
| 19 | onPageShow(): void { | 22 | onPageShow(): void { |
| 20 | this.getPermissionStatus(); | 23 | this.getPermissionStatus(); |
| 24 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + onPageHide(): void { | ||
| 28 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 29 | + let duration = 0 | ||
| 30 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 31 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Privacy_Setting,TrackConstants.PageName.Privacy_Setting,duration) | ||
| 21 | } | 32 | } |
| 22 | 33 | ||
| 23 | aboutToAppear() { | 34 | aboutToAppear() { |
| 1 | +import { DateTimeUtils } from 'wdKit/Index'; | ||
| 2 | +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; | ||
| 1 | import { AboutPageUI } from '../setting/AboutPageUI'; | 3 | import { AboutPageUI } from '../setting/AboutPageUI'; |
| 2 | 4 | ||
| 3 | @Entry | 5 | @Entry |
| 4 | @Component | 6 | @Component |
| 5 | struct SettingAboutPage { | 7 | struct SettingAboutPage { |
| 8 | + pageShowTime:number = 0; | ||
| 9 | + pageHideTime:number = 0; | ||
| 10 | + | ||
| 11 | + onPageShow() { | ||
| 12 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 13 | + } | ||
| 14 | + | ||
| 15 | + onPageHide(): void { | ||
| 16 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 17 | + let duration = 0 | ||
| 18 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 19 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.About,TrackConstants.PageName.About,duration) | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + | ||
| 6 | build() { | 23 | build() { |
| 7 | Column(){ | 24 | Column(){ |
| 8 | AboutPageUI() | 25 | AboutPageUI() |
| @@ -4,6 +4,7 @@ import { AccountAndSecurityLayout } from '../setting/AccountAndSecurityLayout'; | @@ -4,6 +4,7 @@ import { AccountAndSecurityLayout } from '../setting/AccountAndSecurityLayout'; | ||
| 4 | import router from '@ohos.router'; | 4 | import router from '@ohos.router'; |
| 5 | import { Action, Params } from 'wdBean'; | 5 | import { Action, Params } from 'wdBean'; |
| 6 | import { DateTimeUtils } from 'wdKit/Index'; | 6 | import { DateTimeUtils } from 'wdKit/Index'; |
| 7 | +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; | ||
| 7 | 8 | ||
| 8 | @Entry | 9 | @Entry |
| 9 | @Component | 10 | @Component |
| @@ -13,10 +14,39 @@ struct SettingPage { | @@ -13,10 +14,39 @@ struct SettingPage { | ||
| 13 | @State params:Params = router.getParams() as Params; | 14 | @State params:Params = router.getParams() as Params; |
| 14 | @State enterActivityTime:number = 0; | 15 | @State enterActivityTime:number = 0; |
| 15 | 16 | ||
| 17 | + pageShowSettingTime:number = 0; | ||
| 18 | + pageHideSettingTime:number = 0; | ||
| 19 | + pageShowAccountTime:number = 0; | ||
| 20 | + pageHideAccountTime:number = 0; | ||
| 21 | + | ||
| 16 | onPageShow() { | 22 | onPageShow() { |
| 23 | + this.pageType = this.params.pageID; | ||
| 24 | + this.enterActivityTime = DateTimeUtils.getTimeStamp() | ||
| 25 | + if (this.pageType == 'mainSetting'){ | ||
| 26 | + this.pageShowSettingTime = DateTimeUtils.getTimeStamp() | ||
| 27 | + }else{ | ||
| 28 | + this.pageShowAccountTime = DateTimeUtils.getTimeStamp() | ||
| 29 | + } | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + onPageHide(): void { | ||
| 33 | + if (this.pageType == 'mainSetting'){ | ||
| 34 | + this.pageHideSettingTime = DateTimeUtils.getTimeStamp() | ||
| 35 | + }else{ | ||
| 36 | + this.pageHideAccountTime = DateTimeUtils.getTimeStamp() | ||
| 37 | + } | ||
| 17 | 38 | ||
| 18 | - this.pageType = this.params.pageID; | ||
| 19 | - this.enterActivityTime = DateTimeUtils.getTimeStamp() | 39 | + let duration = 0 |
| 40 | + if(this.pageType == 'mainSetting'){ | ||
| 41 | + duration = Math.floor((this.pageHideSettingTime - this.pageShowSettingTime)/1000) | ||
| 42 | + }else{ | ||
| 43 | + duration = Math.floor((this.pageHideAccountTime - this.pageShowAccountTime)/1000) | ||
| 44 | + } | ||
| 45 | + if(this.pageType == 'mainSetting'){ | ||
| 46 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Setting,TrackConstants.PageName.Setting,duration) | ||
| 47 | + }else{ | ||
| 48 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Account_Management,TrackConstants.PageName.Account_Management,duration) | ||
| 49 | + } | ||
| 20 | } | 50 | } |
| 21 | 51 | ||
| 22 | build() { | 52 | build() { |
| 1 | import { ContentDTO, ReserveBean, ReserveItemBean } from 'wdBean/Index'; | 1 | import { ContentDTO, ReserveBean, ReserveItemBean } from 'wdBean/Index'; |
| 2 | import { ProcessUtils } from 'wdRouter/Index'; | 2 | import { ProcessUtils } from 'wdRouter/Index'; |
| 3 | import PageViewModel from '../../viewmodel/PageViewModel'; | 3 | import PageViewModel from '../../viewmodel/PageViewModel'; |
| 4 | -import { Logger, EmitterEventId, EmitterUtils, ToastUtils } from 'wdKit/Index'; | 4 | +import { Logger, EmitterEventId, EmitterUtils, ToastUtils } from 'wdKit/Index'; |
| 5 | import { router } from '@kit.ArkUI'; | 5 | import { router } from '@kit.ArkUI'; |
| 6 | import { LiveModel } from '../../viewmodel/LiveModel'; | 6 | import { LiveModel } from '../../viewmodel/LiveModel'; |
| 7 | import { ViewType } from 'wdConstant/src/main/ets/enum/ViewType'; | 7 | import { ViewType } from 'wdConstant/src/main/ets/enum/ViewType'; |
| @@ -9,10 +9,11 @@ import { EmptyComponent } from '../view/EmptyComponent'; | @@ -9,10 +9,11 @@ import { EmptyComponent } from '../view/EmptyComponent'; | ||
| 9 | import { ErrorComponent } from '../view/ErrorComponent'; | 9 | import { ErrorComponent } from '../view/ErrorComponent'; |
| 10 | import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; | 10 | import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; |
| 11 | import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData'; | 11 | import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData'; |
| 12 | -import { HttpUtils } from 'wdNetwork/Index'; | 12 | +import { HttpUtils } from 'wdNetwork/Index'; |
| 13 | import { WDRouterPage, WDRouterRule } from 'wdRouter' | 13 | import { WDRouterPage, WDRouterRule } from 'wdRouter' |
| 14 | -import { LazyDataSource } from 'wdKit/Index'; | 14 | +import { LazyDataSource } from 'wdKit/Index'; |
| 15 | import LoadMoreLayout from '../page/LoadMoreLayout' | 15 | import LoadMoreLayout from '../page/LoadMoreLayout' |
| 16 | +import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | ||
| 16 | 17 | ||
| 17 | const TAG: string = 'ReserveMorePage'; | 18 | const TAG: string = 'ReserveMorePage'; |
| 18 | 19 | ||
| @@ -43,11 +44,12 @@ struct ReserveMorePage { | @@ -43,11 +44,12 @@ struct ReserveMorePage { | ||
| 43 | private scroller: Scroller = new Scroller() | 44 | private scroller: Scroller = new Scroller() |
| 44 | @State reservedIds: string[] = [] | 45 | @State reservedIds: string[] = [] |
| 45 | @State isShow: boolean = false | 46 | @State isShow: boolean = false |
| 46 | - @State private liveId: string = '' | 47 | + @State private liveId: string = '' |
| 47 | @State isLoadingAttention: boolean = false | 48 | @State isLoadingAttention: boolean = false |
| 49 | + @State loadImg: boolean = false; | ||
| 48 | 50 | ||
| 49 | build() { | 51 | build() { |
| 50 | - Column(){ | 52 | + Column() { |
| 51 | this.TabbarNormal() | 53 | this.TabbarNormal() |
| 52 | if (this.viewType == ViewType.LOADING) { | 54 | if (this.viewType == ViewType.LOADING) { |
| 53 | this.LoadingLayout() | 55 | this.LoadingLayout() |
| @@ -85,7 +87,7 @@ struct ReserveMorePage { | @@ -85,7 +87,7 @@ struct ReserveMorePage { | ||
| 85 | 87 | ||
| 86 | @Builder | 88 | @Builder |
| 87 | ListLayout() { | 89 | ListLayout() { |
| 88 | - List({scroller: this.scroller}) { | 90 | + List({ scroller: this.scroller }) { |
| 89 | // 下拉刷新 | 91 | // 下拉刷新 |
| 90 | LazyForEach(this.data, (contentDTO: ContentDTO, index: number) => { | 92 | LazyForEach(this.data, (contentDTO: ContentDTO, index: number) => { |
| 91 | ListItem() { | 93 | ListItem() { |
| @@ -110,7 +112,7 @@ struct ReserveMorePage { | @@ -110,7 +112,7 @@ struct ReserveMorePage { | ||
| 110 | .height('calc(100% - 44vp)') | 112 | .height('calc(100% - 44vp)') |
| 111 | .onReachEnd(() => { | 113 | .onReachEnd(() => { |
| 112 | Logger.debug(TAG, "触底了"); | 114 | Logger.debug(TAG, "触底了"); |
| 113 | - if(!this.isLoading && this.hasMore){ | 115 | + if (!this.isLoading && this.hasMore) { |
| 114 | //加载分页数据 | 116 | //加载分页数据 |
| 115 | this.currentPage++; | 117 | this.currentPage++; |
| 116 | this.getData() | 118 | this.getData() |
| @@ -127,9 +129,13 @@ struct ReserveMorePage { | @@ -127,9 +129,13 @@ struct ReserveMorePage { | ||
| 127 | buildItem(item: ContentDTO, index: number) { | 129 | buildItem(item: ContentDTO, index: number) { |
| 128 | Column() { | 130 | Column() { |
| 129 | Stack() { | 131 | Stack() { |
| 130 | - Image(item.fullColumnImgUrls[0]?.url) | 132 | + Image(this.loadImg ? item.fullColumnImgUrls[0]?.url : '') |
| 131 | .width('100%') | 133 | .width('100%') |
| 134 | + .aspectRatio(16 / 9) | ||
| 135 | + .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : $r('app.color.color_33A3A3A3')) | ||
| 132 | .objectFit(ImageFit.Contain) | 136 | .objectFit(ImageFit.Contain) |
| 137 | + .borderWidth(0.5) | ||
| 138 | + .borderColor($r('app.color.color_0D000000')) | ||
| 133 | .borderRadius({ | 139 | .borderRadius({ |
| 134 | topLeft: '4vp', | 140 | topLeft: '4vp', |
| 135 | topRight: '4vp' | 141 | topRight: '4vp' |
| @@ -152,7 +158,12 @@ struct ReserveMorePage { | @@ -152,7 +158,12 @@ struct ReserveMorePage { | ||
| 152 | Image($r('app.media.reserve_play_icon')) | 158 | Image($r('app.media.reserve_play_icon')) |
| 153 | .width(20) | 159 | .width(20) |
| 154 | .height(20) | 160 | .height(20) |
| 155 | - .margin({ left: 10, top: 2, bottom: 2, right: 6 }) | 161 | + .margin({ |
| 162 | + left: 10, | ||
| 163 | + top: 2, | ||
| 164 | + bottom: 2, | ||
| 165 | + right: 6 | ||
| 166 | + }) | ||
| 156 | 167 | ||
| 157 | Text(this.getReserveDate(item.liveInfo.liveStartTime, 1)) | 168 | Text(this.getReserveDate(item.liveInfo.liveStartTime, 1)) |
| 158 | .fontSize(12) | 169 | .fontSize(12) |
| @@ -190,7 +201,8 @@ struct ReserveMorePage { | @@ -190,7 +201,8 @@ struct ReserveMorePage { | ||
| 190 | .width(20) | 201 | .width(20) |
| 191 | .height(20) | 202 | .height(20) |
| 192 | .color(!this.isReserved(item) ? $r('app.color.color_fff') : $r('app.color.color_CCCCCC')) | 203 | .color(!this.isReserved(item) ? $r('app.color.color_fff') : $r('app.color.color_CCCCCC')) |
| 193 | - .visibility((this.isLoadingAttention && this.liveId == item.objectId) ? Visibility.Visible : Visibility.None) | 204 | + .visibility((this.isLoadingAttention && this.liveId == item.objectId) ? Visibility.Visible : |
| 205 | + Visibility.None) | ||
| 194 | 206 | ||
| 195 | Text(!this.isReserved(item) ? '预约' : '已预约') | 207 | Text(!this.isReserved(item) ? '预约' : '已预约') |
| 196 | .fontSize($r('app.float.vp_12')) | 208 | .fontSize($r('app.float.vp_12')) |
| @@ -199,14 +211,21 @@ struct ReserveMorePage { | @@ -199,14 +211,21 @@ struct ReserveMorePage { | ||
| 199 | .width('100%') | 211 | .width('100%') |
| 200 | .height('100%') | 212 | .height('100%') |
| 201 | .textAlign(TextAlign.Center) | 213 | .textAlign(TextAlign.Center) |
| 202 | - .visibility((this.isLoadingAttention && this.liveId == item.objectId) ? Visibility.None : Visibility.Visible) | 214 | + .visibility((this.isLoadingAttention && this.liveId == item.objectId) ? Visibility.None : |
| 215 | + Visibility.Visible) | ||
| 203 | .margin({ | 216 | .margin({ |
| 204 | right: '10vp' | 217 | right: '10vp' |
| 205 | }) | 218 | }) |
| 219 | + .textShadow({ | ||
| 220 | + radius: 2, | ||
| 221 | + color: 'rgba(0,0,0,0.3)', | ||
| 222 | + offsetY: 2 | ||
| 223 | + }) | ||
| 206 | .backgroundColor(!this.isReserved(item) ? $r('app.color.color_ED2800') : $r('app.color.color_F5F5F5')) | 224 | .backgroundColor(!this.isReserved(item) ? $r('app.color.color_ED2800') : $r('app.color.color_F5F5F5')) |
| 207 | .borderRadius(3) | 225 | .borderRadius(3) |
| 208 | 226 | ||
| 209 | - }.onClick(() => { | 227 | + } |
| 228 | + .onClick(() => { | ||
| 210 | this.bookAndCancel(item) | 229 | this.bookAndCancel(item) |
| 211 | }) | 230 | }) |
| 212 | .justifyContent(FlexAlign.Center) | 231 | .justifyContent(FlexAlign.Center) |
| @@ -214,7 +233,7 @@ struct ReserveMorePage { | @@ -214,7 +233,7 @@ struct ReserveMorePage { | ||
| 214 | .borderRadius(3) | 233 | .borderRadius(3) |
| 215 | .width('52vp') | 234 | .width('52vp') |
| 216 | .height('24vp') | 235 | .height('24vp') |
| 217 | - .margin({right: 12}) | 236 | + .margin({ right: 12 }) |
| 218 | 237 | ||
| 219 | } | 238 | } |
| 220 | .width('100%') | 239 | .width('100%') |
| @@ -285,12 +304,18 @@ struct ReserveMorePage { | @@ -285,12 +304,18 @@ struct ReserveMorePage { | ||
| 285 | .fontSize('12vp') | 304 | .fontSize('12vp') |
| 286 | .fontWeight(400) | 305 | .fontWeight(400) |
| 287 | .fontColor(Color.White) | 306 | .fontColor(Color.White) |
| 307 | + .textShadow({ | ||
| 308 | + radius: 2, | ||
| 309 | + color: 'rgba(0,0,0,0.3)', | ||
| 310 | + offsetY: 2 | ||
| 311 | + }) | ||
| 288 | } | 312 | } |
| 289 | .backgroundColor(Color.Transparent) | 313 | .backgroundColor(Color.Transparent) |
| 290 | .margin({ right: 8, bottom: 8 }) | 314 | .margin({ right: 8, bottom: 8 }) |
| 291 | } | 315 | } |
| 292 | 316 | ||
| 293 | async aboutToAppear(): Promise<void> { | 317 | async aboutToAppear(): Promise<void> { |
| 318 | + this.loadImg = await onlyWifiLoadImg(); | ||
| 294 | // PageViewModel.get | 319 | // PageViewModel.get |
| 295 | this.currentPage = 1 | 320 | this.currentPage = 1 |
| 296 | this.getData() | 321 | this.getData() |
| @@ -301,24 +326,24 @@ struct ReserveMorePage { | @@ -301,24 +326,24 @@ struct ReserveMorePage { | ||
| 301 | }) | 326 | }) |
| 302 | 327 | ||
| 303 | // 获取预约 | 328 | // 获取预约 |
| 304 | - EmitterUtils.receiveEvent(EmitterEventId.LIVE_ROOM_SUBSCRIBE, (str?: string) => { | 329 | + EmitterUtils.receiveEvent(EmitterEventId.LIVE_ROOM_SUBSCRIBE, (str?: string) => { |
| 305 | Logger.debug(TAG, 'receiveEvent LIVE_ROOM_SUBSCRIBE: ' + str) | 330 | Logger.debug(TAG, 'receiveEvent LIVE_ROOM_SUBSCRIBE: ' + str) |
| 306 | if (str) { | 331 | if (str) { |
| 307 | // 跳转指定频道场景,传参底导id、频道id | 332 | // 跳转指定频道场景,传参底导id、频道id |
| 308 | const model: ReserveItemBean = JSON.parse(str) | 333 | const model: ReserveItemBean = JSON.parse(str) |
| 309 | - Logger.debug(TAG,'是否关注元数据0:' +` ${model.liveId}`) | ||
| 310 | - if (model && model.liveId && this.reserveList) { | 334 | + Logger.debug(TAG, '是否关注元数据0:' + ` ${model.liveId}`) |
| 335 | + if (model && model.liveId && this.reserveList) { | ||
| 311 | // 修改源数据 | 336 | // 修改源数据 |
| 312 | this.reserveList.forEach((element) => { | 337 | this.reserveList.forEach((element) => { |
| 313 | if (element.liveId == model.liveId) { | 338 | if (element.liveId == model.liveId) { |
| 314 | if (element && element.subscribe != model.subscribe) { | 339 | if (element && element.subscribe != model.subscribe) { |
| 315 | - Logger.debug(TAG,'是否关注元数据2:' +` ${JSON.stringify(element.subscribe)}`) | 340 | + Logger.debug(TAG, '是否关注元数据2:' + ` ${JSON.stringify(element.subscribe)}`) |
| 316 | element.subscribe = !element.subscribe | 341 | element.subscribe = !element.subscribe |
| 317 | - Logger.debug(TAG,'是否关注元数据3:' +` ${JSON.stringify(element.subscribe)}`) | 342 | + Logger.debug(TAG, '是否关注元数据3:' + ` ${JSON.stringify(element.subscribe)}`) |
| 318 | this.isShow = true | 343 | this.isShow = true |
| 319 | if (element.subscribe) { | 344 | if (element.subscribe) { |
| 320 | this.reservedIds.push(element.liveId.toString()) | 345 | this.reservedIds.push(element.liveId.toString()) |
| 321 | - }else { | 346 | + } else { |
| 322 | const num = this.reservedIds.indexOf(element.liveId.toString()) | 347 | const num = this.reservedIds.indexOf(element.liveId.toString()) |
| 323 | if (num >= 0 && num < this.reservedIds.length) { | 348 | if (num >= 0 && num < this.reservedIds.length) { |
| 324 | this.reservedIds.splice(num, 1) | 349 | this.reservedIds.splice(num, 1) |
| @@ -364,14 +389,14 @@ struct ReserveMorePage { | @@ -364,14 +389,14 @@ struct ReserveMorePage { | ||
| 364 | this.data.push(...liveReviewDTO.list) | 389 | this.data.push(...liveReviewDTO.list) |
| 365 | //批量查询关注状态 | 390 | //批量查询关注状态 |
| 366 | this.getAppointmentInfo(liveReviewDTO.list) | 391 | this.getAppointmentInfo(liveReviewDTO.list) |
| 367 | - } else { | 392 | + } else { |
| 368 | this.hasMore = false; | 393 | this.hasMore = false; |
| 369 | } | 394 | } |
| 370 | this.resolveEnd(true, resolve) | 395 | this.resolveEnd(true, resolve) |
| 371 | if (liveReviewDTO.list.length == 0 && this.currentPage == 1) { | 396 | if (liveReviewDTO.list.length == 0 && this.currentPage == 1) { |
| 372 | this.viewType = ViewType.EMPTY | 397 | this.viewType = ViewType.EMPTY |
| 373 | } | 398 | } |
| 374 | - }catch (exception) { | 399 | + } catch (exception) { |
| 375 | this.resolveEnd(false, resolve) | 400 | this.resolveEnd(false, resolve) |
| 376 | } | 401 | } |
| 377 | // PageViewModel.getLiveMoreUrl(this.type, this.currentPage, this.pageSize).then(async (liveReviewDTO) => { | 402 | // PageViewModel.getLiveMoreUrl(this.type, this.currentPage, this.pageSize).then(async (liveReviewDTO) => { |
| @@ -387,7 +412,7 @@ struct ReserveMorePage { | @@ -387,7 +412,7 @@ struct ReserveMorePage { | ||
| 387 | if (resolve) { | 412 | if (resolve) { |
| 388 | if (this.currentPage == 1 && isTop) { | 413 | if (this.currentPage == 1 && isTop) { |
| 389 | resolve('已更新至最新') | 414 | resolve('已更新至最新') |
| 390 | - }else { | 415 | + } else { |
| 391 | resolve('') | 416 | resolve('') |
| 392 | } | 417 | } |
| 393 | } | 418 | } |
| @@ -402,9 +427,9 @@ struct ReserveMorePage { | @@ -402,9 +427,9 @@ struct ReserveMorePage { | ||
| 402 | async getAppointmentInfo(list: ContentDTO[]) { | 427 | async getAppointmentInfo(list: ContentDTO[]) { |
| 403 | if (HttpUtils.getUserId()) { | 428 | if (HttpUtils.getUserId()) { |
| 404 | const reserveBean = this.transformToLiveDetailsBeans(list) | 429 | const reserveBean = this.transformToLiveDetailsBeans(list) |
| 405 | - Logger.debug(TAG,'是否预约数据:' +` ${JSON.stringify(reserveBean)}`) | 430 | + Logger.debug(TAG, '是否预约数据:' + ` ${JSON.stringify(reserveBean)}`) |
| 406 | LiveModel.getAppointmentStatus(reserveBean).then((result) => { | 431 | LiveModel.getAppointmentStatus(reserveBean).then((result) => { |
| 407 | - Logger.debug(TAG,'是否预约数据:' +` ${JSON.stringify(result)}`) | 432 | + Logger.debug(TAG, '是否预约数据:' + ` ${JSON.stringify(result)}`) |
| 408 | if (result && result.length > 0) { | 433 | if (result && result.length > 0) { |
| 409 | this.reserveList.push(...result) | 434 | this.reserveList.push(...result) |
| 410 | // this.reserveStatus = res; | 435 | // this.reserveStatus = res; |
| @@ -414,10 +439,10 @@ struct ReserveMorePage { | @@ -414,10 +439,10 @@ struct ReserveMorePage { | ||
| 414 | } | 439 | } |
| 415 | }) | 440 | }) |
| 416 | } | 441 | } |
| 417 | - }).catch(() =>{ | 442 | + }).catch(() => { |
| 418 | // this.data.push(...list) | 443 | // this.data.push(...list) |
| 419 | }) | 444 | }) |
| 420 | - }else { | 445 | + } else { |
| 421 | // this.data.push(...list) | 446 | // this.data.push(...list) |
| 422 | 447 | ||
| 423 | } | 448 | } |
| @@ -463,18 +488,19 @@ struct ReserveMorePage { | @@ -463,18 +488,19 @@ struct ReserveMorePage { | ||
| 463 | this.isLoadingAttention = true | 488 | this.isLoadingAttention = true |
| 464 | this.liveId = reserveItem.liveId.toString() | 489 | this.liveId = reserveItem.liveId.toString() |
| 465 | try { | 490 | try { |
| 466 | - const res = await LiveModel.liveAppointment(reserveItem.relationId, reserveItem.liveId.toString(), !reserveItem.subscribe); | 491 | + const res = await LiveModel.liveAppointment(reserveItem.relationId, reserveItem.liveId.toString(), |
| 492 | + !reserveItem.subscribe); | ||
| 467 | if (res.code == 0) { | 493 | if (res.code == 0) { |
| 468 | ToastUtils.shortToast(!reserveItem.subscribe ? '预约成功' : '取消预约成功') | 494 | ToastUtils.shortToast(!reserveItem.subscribe ? '预约成功' : '取消预约成功') |
| 469 | // 修改源数据 | 495 | // 修改源数据 |
| 470 | this.reserveList.forEach((element) => { | 496 | this.reserveList.forEach((element) => { |
| 471 | if (element.liveId.toString() == item.objectId) { | 497 | if (element.liveId.toString() == item.objectId) { |
| 472 | - Logger.debug(TAG,'是否关注元数据:' +` ${JSON.stringify(element.subscribe)}`) | 498 | + Logger.debug(TAG, '是否关注元数据:' + ` ${JSON.stringify(element.subscribe)}`) |
| 473 | element.subscribe = !element.subscribe | 499 | element.subscribe = !element.subscribe |
| 474 | - Logger.debug(TAG,'是否关注元数据1:' +` ${JSON.stringify(element.subscribe)}`) | 500 | + Logger.debug(TAG, '是否关注元数据1:' + ` ${JSON.stringify(element.subscribe)}`) |
| 475 | if (element.subscribe) { | 501 | if (element.subscribe) { |
| 476 | this.reservedIds.push(element.liveId.toString()) | 502 | this.reservedIds.push(element.liveId.toString()) |
| 477 | - }else { | 503 | + } else { |
| 478 | const num = this.reservedIds.indexOf(element.liveId.toString()) | 504 | const num = this.reservedIds.indexOf(element.liveId.toString()) |
| 479 | if (num >= 0 && num < this.reservedIds.length) { | 505 | if (num >= 0 && num < this.reservedIds.length) { |
| 480 | this.reservedIds.splice(num, 1) | 506 | this.reservedIds.splice(num, 1) |
| @@ -490,13 +516,12 @@ struct ReserveMorePage { | @@ -490,13 +516,12 @@ struct ReserveMorePage { | ||
| 490 | this.liveId = '' | 516 | this.liveId = '' |
| 491 | this.isLoadingAttention = false | 517 | this.isLoadingAttention = false |
| 492 | } | 518 | } |
| 493 | - }else { | 519 | + } else { |
| 494 | this.liveId = '' | 520 | this.liveId = '' |
| 495 | this.isLoadingAttention = false | 521 | this.isLoadingAttention = false |
| 496 | } | 522 | } |
| 497 | } | 523 | } |
| 498 | } | 524 | } |
| 499 | - | ||
| 500 | getReserveDate(eventDateTimeString: string, type: number): string { | 525 | getReserveDate(eventDateTimeString: string, type: number): string { |
| 501 | // 解析事件的日期和时间 | 526 | // 解析事件的日期和时间 |
| 502 | const eventDateTime = new Date(eventDateTimeString); | 527 | const eventDateTime = new Date(eventDateTimeString); |
| @@ -506,21 +531,43 @@ struct ReserveMorePage { | @@ -506,21 +531,43 @@ struct ReserveMorePage { | ||
| 506 | const eventHour = eventDateTime.getHours(); | 531 | const eventHour = eventDateTime.getHours(); |
| 507 | const eventMinutes = eventDateTime.getMinutes(); | 532 | const eventMinutes = eventDateTime.getMinutes(); |
| 508 | const eventTimeStr = `${eventHour}:${eventMinutes.toString().padStart(2, '0')}开始`; // 格式化时间,确保分钟是两位数 | 533 | const eventTimeStr = `${eventHour}:${eventMinutes.toString().padStart(2, '0')}开始`; // 格式化时间,确保分钟是两位数 |
| 509 | - | ||
| 510 | if (type === 1) { | 534 | if (type === 1) { |
| 511 | - // 如果是今天 | ||
| 512 | - if (eventDateTime.setHours(0,0,0,0) === currentDateTime.setHours(0,0,0,0)) { | 535 | + // 判断是否是今天 |
| 536 | + const eventDate = eventDateTime.setHours(0, 0, 0, 0); | ||
| 537 | + const currentDate = currentDateTime.setHours(0, 0, 0, 0); | ||
| 538 | + if (eventDate === currentDate) { | ||
| 513 | return `今天`; | 539 | return `今天`; |
| 514 | - } else { | ||
| 515 | - // 如果事件不在今天 | ||
| 516 | - const month = eventDateTime.getMonth() + 1; // 月份从0开始 | 540 | + }else{ |
| 541 | + const month = eventDateTime.getMonth() + 1; | ||
| 517 | const date = eventDateTime.getDate(); | 542 | const date = eventDateTime.getDate(); |
| 518 | return `${month}月${date}日`; | 543 | return `${month}月${date}日`; |
| 519 | } | 544 | } |
| 520 | - } else { | 545 | + }else { |
| 521 | return `${eventTimeStr}`; | 546 | return `${eventTimeStr}`; |
| 522 | } | 547 | } |
| 523 | } | 548 | } |
| 524 | - | ||
| 525 | - | 549 | + // getReserveDate(eventDateTimeString: string, type: number): string { |
| 550 | + // // 解析事件的日期和时间 | ||
| 551 | + // const eventDateTime = new Date(eventDateTimeString); | ||
| 552 | + // const currentDateTime = new Date(); | ||
| 553 | + // | ||
| 554 | + // // 截取事件时间的小时和分钟(假设事件时间是按照24小时制) | ||
| 555 | + // const eventHour = eventDateTime.getHours(); | ||
| 556 | + // const eventMinutes = eventDateTime.getMinutes(); | ||
| 557 | + // const eventTimeStr = `${eventHour}:${eventMinutes.toString().padStart(2, '0')}开始`; // 格式化时间,确保分钟是两位数 | ||
| 558 | + // | ||
| 559 | + // if (type === 1) { | ||
| 560 | + // // 如果是今天 | ||
| 561 | + // if (eventDateTime.setHours(0,0,0,0) === currentDateTime.setHours(0,0,0,0)) { | ||
| 562 | + // return `今天`; | ||
| 563 | + // } else { | ||
| 564 | + // // 如果事件不在今天 | ||
| 565 | + // const month = eventDateTime.getMonth() + 1; // 月份从0开始 | ||
| 566 | + // const date = eventDateTime.getDate(); | ||
| 567 | + // return `${month}月${date}日`; | ||
| 568 | + // } | ||
| 569 | + // } else { | ||
| 570 | + // return `${eventTimeStr}`; | ||
| 571 | + // } | ||
| 572 | + // } | ||
| 526 | } | 573 | } |
| @@ -24,11 +24,7 @@ export struct AboutPageUI { | @@ -24,11 +24,7 @@ export struct AboutPageUI { | ||
| 24 | }) | 24 | }) |
| 25 | 25 | ||
| 26 | build() { | 26 | build() { |
| 27 | - // Navigation() { | ||
| 28 | - //滑动区域 | ||
| 29 | this.aboutUi() | 27 | this.aboutUi() |
| 30 | - // }.titleMode(NavigationTitleMode.Mini) | ||
| 31 | - // .title('关于') | ||
| 32 | } | 28 | } |
| 33 | 29 | ||
| 34 | aboutToAppear() { | 30 | aboutToAppear() { |
| @@ -55,18 +51,6 @@ export struct AboutPageUI { | @@ -55,18 +51,6 @@ export struct AboutPageUI { | ||
| 55 | this.dialogController.open() | 51 | this.dialogController.open() |
| 56 | }) | 52 | }) |
| 57 | ) | 53 | ) |
| 58 | - // Row(){ | ||
| 59 | - // | ||
| 60 | - // }.backgroundColor(Color.Yellow) | ||
| 61 | - // .width('100%') | ||
| 62 | - // .height('97lpx') | ||
| 63 | - | ||
| 64 | - // Row(){ | ||
| 65 | - // | ||
| 66 | - // }.backgroundColor(Color.Yellow) | ||
| 67 | - // .width('100%') | ||
| 68 | - // .height('97lpx') | ||
| 69 | - | ||
| 70 | 54 | ||
| 71 | List() { | 55 | List() { |
| 72 | ForEach(this.listData, (item: string, index: number) => { | 56 | ForEach(this.listData, (item: string, index: number) => { |
| @@ -85,69 +85,6 @@ export struct MineSettingComponent { | @@ -85,69 +85,6 @@ export struct MineSettingComponent { | ||
| 85 | } | 85 | } |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | - // // 页面布局 | ||
| 89 | - // @Builder settingList() { | ||
| 90 | - // Column() { | ||
| 91 | - // List() { | ||
| 92 | - // // 循环渲染ListItemGroup,contactsGroups为多个分组联系人contacts和标题title的数据集合 | ||
| 93 | - // ForEach(this.listData, (item: Array<string>, index: number) => { | ||
| 94 | - // ListItemGroup({ header: index === 0 ? this.itemHead("") : this.itemHead("1") }) { | ||
| 95 | - // // 循环渲染ListItem | ||
| 96 | - // ForEach(item, (subItem: string, subIndex: number) => { | ||
| 97 | - // ListItem() { | ||
| 98 | - // if (subIndex == 6) { | ||
| 99 | - // this.getArrowCell(subItem, subIndex, index) | ||
| 100 | - // } else if (subIndex == 1 || subIndex == 3 || subIndex == 4 || subIndex == 5) { | ||
| 101 | - // if (subIndex == 1 && index == 1) { | ||
| 102 | - // this.getArrowCell(subItem, subIndex, index) | ||
| 103 | - // } else { | ||
| 104 | - // this.getSwitchCell(subItem, subIndex) | ||
| 105 | - // } | ||
| 106 | - // | ||
| 107 | - // } else { | ||
| 108 | - // this.getArrowCell(subItem, subIndex, index) | ||
| 109 | - // } | ||
| 110 | - // | ||
| 111 | - // }.padding({ left: '27lpx' }) | ||
| 112 | - // .onClick(() => { | ||
| 113 | - // | ||
| 114 | - // // // 在Home页面中 | ||
| 115 | - // // let paramsInfo: object = { | ||
| 116 | - // // pageId: 123, | ||
| 117 | - // // pageType:'AccountAndSecurityLayout' | ||
| 118 | - // // }; | ||
| 119 | - // console.log(subIndex + "") | ||
| 120 | - // if (subIndex == 0 && index == 0) { | ||
| 121 | - // | ||
| 122 | - // let params: Params = { | ||
| 123 | - // pageID: 'AccountAndSecurityLayout' | ||
| 124 | - // } | ||
| 125 | - // WDRouterRule.jumpWithPage(WDRouterPage.settingPage, params) | ||
| 126 | - // }else if (subIndex == 2 && index == 0) { | ||
| 127 | - // WDRouterRule.jumpWithPage(WDRouterPage.privacySettingPage) | ||
| 128 | - // }else if (subIndex == 0 && index == 1) { | ||
| 129 | - // this.dialogController.open() | ||
| 130 | - // } | ||
| 131 | - // | ||
| 132 | - // }) | ||
| 133 | - // .height('117lpx') | ||
| 134 | - // }) | ||
| 135 | - // } | ||
| 136 | - // .divider({ | ||
| 137 | - // strokeWidth: 1, | ||
| 138 | - // startMargin: 15, | ||
| 139 | - // endMargin: 10, | ||
| 140 | - // color: '#f0f0f0' | ||
| 141 | - // }) | ||
| 142 | - // }) | ||
| 143 | - // }.onScrollFrameBegin((offset, state) => { | ||
| 144 | - // return { offsetRemain: 0 } | ||
| 145 | - // }) | ||
| 146 | - // } | ||
| 147 | - // .backgroundColor(Color.White) | ||
| 148 | - // .borderRadius(8) | ||
| 149 | - // } | ||
| 150 | - | ||
| 151 | // 页面布局 | 88 | // 页面布局 |
| 152 | @Builder settingList() { | 89 | @Builder settingList() { |
| 153 | Column() { | 90 | Column() { |
| @@ -247,12 +184,6 @@ export struct MineSettingComponent { | @@ -247,12 +184,6 @@ export struct MineSettingComponent { | ||
| 247 | Row() { | 184 | Row() { |
| 248 | // 左侧logo和标题 | 185 | // 左侧logo和标题 |
| 249 | Row() { | 186 | Row() { |
| 250 | - // 判断有没有图片 | ||
| 251 | - // if (this.privacySwitch) { | ||
| 252 | - // Image('https://pic.rmb.bdstatic.com/e182cf67c341d1128d2a6cc05886bf62.jpeg@s_0,h_2000') | ||
| 253 | - // .height('38lpx') | ||
| 254 | - // .margin({ right: '5lpx' }) | ||
| 255 | - // } | ||
| 256 | Text(`${item.title}`) | 187 | Text(`${item.title}`) |
| 257 | .margin({ top: '8lpx' }) | 188 | .margin({ top: '8lpx' }) |
| 258 | .height('38lpx') | 189 | .height('38lpx') |
| @@ -90,11 +90,20 @@ export struct OperRowListView { | @@ -90,11 +90,20 @@ export struct OperRowListView { | ||
| 90 | console.info(TAG, '22222----', this.styleType) | 90 | console.info(TAG, '22222----', this.styleType) |
| 91 | console.info(TAG, '3333----', this.needLike) | 91 | console.info(TAG, '3333----', this.needLike) |
| 92 | this.handleStyle() | 92 | this.handleStyle() |
| 93 | + this.onDetailUpdated() | ||
| 93 | EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_STATUS, (val: number | string | undefined) => { | 94 | EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_STATUS, (val: number | string | undefined) => { |
| 94 | console.log(TAG, 'this.currentStatus', val) | 95 | console.log(TAG, 'this.currentStatus', val) |
| 95 | this.currentStatus = val | 96 | this.currentStatus = val |
| 96 | }) | 97 | }) |
| 97 | - this.onDetailUpdated() | 98 | + //注册通知,来自别的组件的评论成功通知 |
| 99 | + EmitterUtils.receiveEvent(EmitterEventId.COMMENT_PUBLISH, (targetId?: string) => { | ||
| 100 | + if (targetId) { | ||
| 101 | + if (targetId == this.publishCommentModel.targetId) { | ||
| 102 | + //新增评论 | ||
| 103 | + this.queryContentInteractCount() | ||
| 104 | + } | ||
| 105 | + } | ||
| 106 | + }) | ||
| 98 | } | 107 | } |
| 99 | 108 | ||
| 100 | async onDetailUpdated() { | 109 | async onDetailUpdated() { |
| @@ -224,7 +233,11 @@ export struct OperRowListView { | @@ -224,7 +233,11 @@ export struct OperRowListView { | ||
| 224 | if (this.showCommentIcon) { | 233 | if (this.showCommentIcon) { |
| 225 | Column() { | 234 | Column() { |
| 226 | if (this.publishCommentModel?.targetId) { | 235 | if (this.publishCommentModel?.targetId) { |
| 227 | - CommentIconComponent({ publishCommentModel: this.publishCommentModel, styleType: this.styleType }) | 236 | + CommentIconComponent({ |
| 237 | + publishCommentModel: this.publishCommentModel, | ||
| 238 | + styleType: this.styleType, | ||
| 239 | + contentDetail: this.contentDetailData | ||
| 240 | + }) | ||
| 228 | .onClick(() => { | 241 | .onClick(() => { |
| 229 | this.onCommentIconClick() | 242 | this.onCommentIconClick() |
| 230 | 243 |
| 1 | import router from '@ohos.router' | 1 | import router from '@ohos.router' |
| 2 | -import { NetworkUtil, StringUtils } from 'wdKit'; | 2 | +import { DateTimeUtils, NetworkUtil, StringUtils } from 'wdKit'; |
| 3 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 3 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 4 | import { editModelParams } from '../model/EditInfoModel'; | 4 | import { editModelParams } from '../model/EditInfoModel'; |
| 5 | import { HomePageBottomCommentComponent } from '../components/mine/home/HomePageBottomCommentComponent'; | 5 | import { HomePageBottomCommentComponent } from '../components/mine/home/HomePageBottomCommentComponent'; |
| @@ -7,6 +7,7 @@ import { HomePageBottomFollowComponent } from '../components/mine/home/HomePageB | @@ -7,6 +7,7 @@ import { HomePageBottomFollowComponent } from '../components/mine/home/HomePageB | ||
| 7 | import MinePageDatasModel from '../model/MinePageDatasModel'; | 7 | import MinePageDatasModel from '../model/MinePageDatasModel'; |
| 8 | import { EmptyComponent } from '../components/view/EmptyComponent'; | 8 | import { EmptyComponent } from '../components/view/EmptyComponent'; |
| 9 | import { CustomTitleUI } from '../components/reusable/CustomTitleUI'; | 9 | import { CustomTitleUI } from '../components/reusable/CustomTitleUI'; |
| 10 | +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; | ||
| 10 | 11 | ||
| 11 | const TAG = "MineHomePage" | 12 | const TAG = "MineHomePage" |
| 12 | 13 | ||
| @@ -37,8 +38,11 @@ struct MineHomePage { | @@ -37,8 +38,11 @@ struct MineHomePage { | ||
| 37 | @State isCommentEnter:string = ""; | 38 | @State isCommentEnter:string = ""; |
| 38 | @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() | 39 | @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() |
| 39 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 40 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 41 | + pageShowTime:number = 0; | ||
| 42 | + pageHideTime:number = 0; | ||
| 40 | 43 | ||
| 41 | onPageShow(): void { | 44 | onPageShow(): void { |
| 45 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 42 | this.getUserInfo() | 46 | this.getUserInfo() |
| 43 | 47 | ||
| 44 | let intervalID = setInterval(() => { | 48 | let intervalID = setInterval(() => { |
| @@ -50,6 +54,13 @@ struct MineHomePage { | @@ -50,6 +54,13 @@ struct MineHomePage { | ||
| 50 | }, 200); | 54 | }, 200); |
| 51 | } | 55 | } |
| 52 | 56 | ||
| 57 | + onPageHide(): void { | ||
| 58 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 59 | + let duration = 0 | ||
| 60 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 61 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal,duration) | ||
| 62 | + } | ||
| 63 | + | ||
| 53 | build() { | 64 | build() { |
| 54 | if(this.isConnectNetwork){ | 65 | if(this.isConnectNetwork){ |
| 55 | Stack({ alignContent: Alignment.Top }){ | 66 | Stack({ alignContent: Alignment.Top }){ |
| 1 | import router from '@ohos.router' | 1 | import router from '@ohos.router' |
| 2 | import { Params } from 'wdBean'; | 2 | import { Params } from 'wdBean'; |
| 3 | -import { NetworkUtil, StringUtils } from 'wdKit'; | 3 | +import { DateTimeUtils, NetworkUtil, StringUtils } from 'wdKit'; |
| 4 | +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; | ||
| 4 | import { OtherHomePageBottomCommentComponent } from '../components/mine/home/OtherHomePageBottomCommentComponent'; | 5 | import { OtherHomePageBottomCommentComponent } from '../components/mine/home/OtherHomePageBottomCommentComponent'; |
| 5 | import { OtherHomePageBottomFollowComponent } from '../components/mine/home/OtherHomePageBottomFollowComponent'; | 6 | import { OtherHomePageBottomFollowComponent } from '../components/mine/home/OtherHomePageBottomFollowComponent'; |
| 6 | import { CustomTitleUI } from '../components/reusable/CustomTitleUI'; | 7 | import { CustomTitleUI } from '../components/reusable/CustomTitleUI'; |
| @@ -16,9 +17,20 @@ struct OtherNormalUserHomePage { | @@ -16,9 +17,20 @@ struct OtherNormalUserHomePage { | ||
| 16 | @State params:Record<string, string> = router.getParams() as Record<string, string>; | 17 | @State params:Record<string, string> = router.getParams() as Record<string, string>; |
| 17 | @Watch('change') @State curUserId: string = '-1'; | 18 | @Watch('change') @State curUserId: string = '-1'; |
| 18 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 19 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 20 | + pageShowTime:number = 0; | ||
| 21 | + pageHideTime:number = 0; | ||
| 22 | + | ||
| 19 | 23 | ||
| 20 | onPageShow() { | 24 | onPageShow() { |
| 21 | this.curUserId = this.params?.['userId']; | 25 | this.curUserId = this.params?.['userId']; |
| 26 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + onPageHide(): void { | ||
| 30 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 31 | + let duration = 0 | ||
| 32 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 33 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,duration) | ||
| 22 | } | 34 | } |
| 23 | 35 | ||
| 24 | change(){ | 36 | change(){ |
| 1 | +import { DateTimeUtils } from 'wdKit/Index'; | ||
| 2 | +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; | ||
| 1 | import { SearchComponent } from '../components/search/SearchComponent' | 3 | import { SearchComponent } from '../components/search/SearchComponent' |
| 2 | 4 | ||
| 3 | @Entry | 5 | @Entry |
| 4 | @Component | 6 | @Component |
| 5 | struct SearchPage { | 7 | struct SearchPage { |
| 8 | + pageShowTime:number = 0; | ||
| 9 | + pageHideTime:number = 0; | ||
| 10 | + | ||
| 11 | + onPageShow() { | ||
| 12 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 13 | + } | ||
| 14 | + | ||
| 15 | + onPageHide(): void { | ||
| 16 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 17 | + let duration = 0 | ||
| 18 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 19 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Search,TrackConstants.PageName.Search,duration) | ||
| 20 | + } | ||
| 21 | + | ||
| 6 | build() { | 22 | build() { |
| 7 | Column(){ | 23 | Column(){ |
| 8 | SearchComponent() | 24 | SearchComponent() |
| 1 | -import { DateFormatUtil, WDPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index'; | 1 | +import { DateFormatUtil, WDAliPlayerController, WDPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index'; |
| 2 | import router from '@ohos.router'; | 2 | import router from '@ohos.router'; |
| 3 | import { StringUtils } from 'wdKit/Index'; | 3 | import { StringUtils } from 'wdKit/Index'; |
| 4 | import { Action } from 'wdBean'; | 4 | import { Action } from 'wdBean'; |
| @@ -10,7 +10,7 @@ const TAG = 'VideoPlayPage'; | @@ -10,7 +10,7 @@ const TAG = 'VideoPlayPage'; | ||
| 10 | export struct VideoPlayPage { | 10 | export struct VideoPlayPage { |
| 11 | //是否处于播放状态中 | 11 | //是否处于播放状态中 |
| 12 | @State isPlayStatus: boolean = true | 12 | @State isPlayStatus: boolean = true |
| 13 | - playerController: WDPlayerController = new WDPlayerController(); | 13 | + playerController: WDAliPlayerController = new WDAliPlayerController(); |
| 14 | //视频地址 | 14 | //视频地址 |
| 15 | @State videoUrl: string = '' | 15 | @State videoUrl: string = '' |
| 16 | //封面图 | 16 | //封面图 |
| 1 | import { HttpUrlUtils, ResponseDTO } from 'wdNetwork'; | 1 | import { HttpUrlUtils, ResponseDTO } from 'wdNetwork'; |
| 2 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; | 2 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; |
| 3 | import { Logger, ToastUtils, EmitterEventId, EmitterUtils } from 'wdKit'; | 3 | import { Logger, ToastUtils, EmitterEventId, EmitterUtils } from 'wdKit'; |
| 4 | -import { LiveDetailsBean, ReserveBean, ReserveItemBean } from 'wdBean/Index'; | 4 | +import { LiveDetailsBean, ReserveBean, ReserveItemBean, joinPeopleNum } from 'wdBean/Index'; |
| 5 | 5 | ||
| 6 | const TAG = 'LiveModel' | 6 | const TAG = 'LiveModel' |
| 7 | 7 | ||
| @@ -105,5 +105,34 @@ export class LiveModel { | @@ -105,5 +105,34 @@ export class LiveModel { | ||
| 105 | }) | 105 | }) |
| 106 | }) | 106 | }) |
| 107 | } | 107 | } |
| 108 | + | ||
| 109 | + /** | ||
| 110 | + * 查询直播参与人数 | ||
| 111 | + */ | ||
| 112 | + static getJoinPeopleNum(liveIdList: string) { | ||
| 113 | + return new Promise<Array<joinPeopleNum>>((success, fail) => { | ||
| 114 | + HttpRequest.get<ResponseDTO<Array<joinPeopleNum>>>( | ||
| 115 | + HttpUrlUtils.getJoinPeopleNum() + `?liveIdList=${liveIdList}`, | ||
| 116 | + ).then((data: ResponseDTO<Array<joinPeopleNum>>) => { | ||
| 117 | + Logger.debug(TAG, 'getJoinPeopleNum:' + `${JSON.stringify(data)}`) | ||
| 118 | + Logger.debug(TAG, 'liveIdList:' + liveIdList) | ||
| 119 | + if (!data || !data.data) { | ||
| 120 | + fail("数据为空") | ||
| 121 | + return | ||
| 122 | + } | ||
| 123 | + if (data.code != 0) { | ||
| 124 | + fail(data.message) | ||
| 125 | + ToastUtils.shortToast(data.message) | ||
| 126 | + return | ||
| 127 | + } | ||
| 128 | + success(data.data) | ||
| 129 | + Logger.info('getJoinPeopleNum', JSON.stringify(data.data)) | ||
| 130 | + }, (error: Error) => { | ||
| 131 | + fail(error.message) | ||
| 132 | + Logger.debug(TAG + ":error ", JSON.stringify(error)) | ||
| 133 | + }) | ||
| 134 | + }) | ||
| 135 | + } | ||
| 136 | + | ||
| 108 | } | 137 | } |
| 109 | 138 |
| @@ -41,11 +41,23 @@ class SystemInfo{ | @@ -41,11 +41,23 @@ class SystemInfo{ | ||
| 41 | time: string = "" | 41 | time: string = "" |
| 42 | title: string = "" | 42 | title: string = "" |
| 43 | userId: number = -1 | 43 | userId: number = -1 |
| 44 | + remark: string = "" | ||
| 44 | } | 45 | } |
| 45 | 46 | ||
| 46 | class ActiveInfo{ | 47 | class ActiveInfo{ |
| 47 | - id:string = "" | 48 | + classify: string = "" |
| 49 | + contentId: string = "" | ||
| 50 | + contentType: string = "" | ||
| 51 | + id: number = -1 | ||
| 48 | message: string = "" | 52 | message: string = "" |
| 53 | + platform: string = "" | ||
| 54 | + privateMailId: number = -1 | ||
| 55 | + privateMailIds: string = "" | ||
| 56 | + privateMailNum: number = -1 | ||
| 57 | + read: boolean = false | ||
| 58 | + source: string = "" | ||
| 49 | time: string = "" | 59 | time: string = "" |
| 50 | title: string = "" | 60 | title: string = "" |
| 61 | + userId: number = -1 | ||
| 62 | + remark: string = "" | ||
| 51 | } | 63 | } |
| @@ -80,7 +80,7 @@ export class PageHelper { | @@ -80,7 +80,7 @@ export class PageHelper { | ||
| 80 | return; | 80 | return; |
| 81 | } | 81 | } |
| 82 | pageModel.pageInfo = pageInfo; | 82 | pageModel.pageInfo = pageInfo; |
| 83 | - pageModel.cachePageInfoMd5 = pageInfo.md5 | 83 | + pageModel.displayPageInfoMd5 = pageInfo.md5 |
| 84 | //解析页面挂角广告资源 | 84 | //解析页面挂角广告资源 |
| 85 | pageAdvModel.analysisAdvSource(pageInfo); | 85 | pageAdvModel.analysisAdvSource(pageInfo); |
| 86 | this.parseGroup(pageModel, true) | 86 | this.parseGroup(pageModel, true) |
| @@ -129,7 +129,7 @@ export class PageHelper { | @@ -129,7 +129,7 @@ export class PageHelper { | ||
| 129 | return; | 129 | return; |
| 130 | } | 130 | } |
| 131 | pageModel.pageInfo = pageInfo; | 131 | pageModel.pageInfo = pageInfo; |
| 132 | - if (pageInfo.md5 == pageModel.cachePageInfoMd5) { | 132 | + if (pageInfo.md5 == pageModel.displayPageInfoMd5) { |
| 133 | // 缓存一致,不解析 | 133 | // 缓存一致,不解析 |
| 134 | Logger.debug(TAG, 'getPageInfo 与缓存一致,不解析广告。。。') | 134 | Logger.debug(TAG, 'getPageInfo 与缓存一致,不解析广告。。。') |
| 135 | } else { | 135 | } else { |
| @@ -138,6 +138,7 @@ export class PageHelper { | @@ -138,6 +138,7 @@ export class PageHelper { | ||
| 138 | // 保存缓存 | 138 | // 保存缓存 |
| 139 | CacheData.saveCacheData(CacheData.comPageInfoCacheKey + pageModel.pageId, pageInfo, pageInfo.md5) | 139 | CacheData.saveCacheData(CacheData.comPageInfoCacheKey + pageModel.pageId, pageInfo, pageInfo.md5) |
| 140 | } | 140 | } |
| 141 | + pageModel.displayPageInfoMd5 = pageInfo.md5 | ||
| 141 | //解析页面挂角广告资源 | 142 | //解析页面挂角广告资源 |
| 142 | pageAdvModel.analysisAdvSource(pageInfo); | 143 | pageAdvModel.analysisAdvSource(pageInfo); |
| 143 | } | 144 | } |
| @@ -185,15 +186,25 @@ export class PageHelper { | @@ -185,15 +186,25 @@ export class PageHelper { | ||
| 185 | Logger.debug(TAG, 'parseGroup isCache: ' + isCache) | 186 | Logger.debug(TAG, 'parseGroup isCache: ' + isCache) |
| 186 | if (isCache) { | 187 | if (isCache) { |
| 187 | pageDto = await PageViewModel.getPageGroupCacheData(pageModel.bizCopy()) as PageDTO | 188 | pageDto = await PageViewModel.getPageGroupCacheData(pageModel.bizCopy()) as PageDTO |
| 188 | - pageModel.cacheGroupInfoMd5 = pageDto.md5 | 189 | + pageModel.displayGroupInfoMd5 = pageDto.md5 |
| 189 | } else { | 190 | } else { |
| 190 | pageDto = await PageViewModel.getPageGroupCompData(pageModel.bizCopy()) as PageDTO | 191 | pageDto = await PageViewModel.getPageGroupCompData(pageModel.bizCopy()) as PageDTO |
| 191 | - if (pageDto.md5 == pageModel.cacheGroupInfoMd5) { | 192 | + if (pageDto.md5 == pageModel.displayGroupInfoMd5) { |
| 192 | Logger.debug(TAG, 'parseGroup cache load, return: ' + pageDto.md5) | 193 | Logger.debug(TAG, 'parseGroup cache load, return: ' + pageDto.md5) |
| 193 | - // 缓存数据一致,不再刷新 | 194 | + // 下拉刷新场景,数据没变,拦截刷新UI,重置相关参数 |
| 195 | + if (pageModel.loadStrategy === 2) { | ||
| 196 | + // 缓存数据一致,不再刷新 | ||
| 197 | + this.refreshUIEnd(pageModel, true) | ||
| 198 | + // 第一页不刷新,分页数据清除 | ||
| 199 | + pageModel.hasMore = true | ||
| 200 | + this.deleteMorePage(pageModel) | ||
| 201 | + pageModel.pageTotalCompSize = pageModel.compList.size() | ||
| 202 | + } | ||
| 203 | + pageModel.currentPage++ | ||
| 194 | return | 204 | return |
| 195 | } | 205 | } |
| 196 | - Logger.debug(TAG, 'parseGroup cache load, save: ') | 206 | + pageModel.displayGroupInfoMd5 = pageDto.md5 |
| 207 | + Logger.debug(TAG, 'parseGroup cache load, save: ' + pageDto.md5) | ||
| 197 | // 保存缓存 | 208 | // 保存缓存 |
| 198 | CacheData.saveCacheData(CacheData.compGroupInfoDataCacheKey + pageModel.pageId + pageModel.groupId, pageDto, | 209 | CacheData.saveCacheData(CacheData.compGroupInfoDataCacheKey + pageModel.pageId + pageModel.groupId, pageDto, |
| 199 | pageDto.md5) | 210 | pageDto.md5) |
| @@ -238,9 +249,11 @@ export class PageHelper { | @@ -238,9 +249,11 @@ export class PageHelper { | ||
| 238 | 249 | ||
| 239 | // 批查互动数据 | 250 | // 批查互动数据 |
| 240 | this.allCompBatchRequest(pageInfo.oneRequestPageGroupCompList.convertToArray(), pageModel) | 251 | this.allCompBatchRequest(pageInfo.oneRequestPageGroupCompList.convertToArray(), pageModel) |
| 241 | - | ||
| 242 | - // | ||
| 243 | - pageModel.currentPage++ | 252 | + // 记录第一页数量 |
| 253 | + this.saveFirstPageEndIndex(pageModel) | ||
| 254 | + if (!isCache) { | ||
| 255 | + pageModel.currentPage++ | ||
| 256 | + } | ||
| 244 | pageModel.viewType = ViewType.LOADED | 257 | pageModel.viewType = ViewType.LOADED |
| 245 | this.refreshUIEnd(pageModel, true) | 258 | this.refreshUIEnd(pageModel, true) |
| 246 | 259 | ||
| @@ -409,6 +422,8 @@ export class PageHelper { | @@ -409,6 +422,8 @@ export class PageHelper { | ||
| 409 | // 批查直播观看人数 | 422 | // 批查直播观看人数 |
| 410 | this.getLiveRoomDataInfo(compList) | 423 | this.getLiveRoomDataInfo(compList) |
| 411 | 424 | ||
| 425 | + // | ||
| 426 | + | ||
| 412 | 427 | ||
| 413 | // 测试数据 | 428 | // 测试数据 |
| 414 | // setTimeout(() => { | 429 | // setTimeout(() => { |
| @@ -752,6 +767,40 @@ export class PageHelper { | @@ -752,6 +767,40 @@ export class PageHelper { | ||
| 752 | } | 767 | } |
| 753 | 768 | ||
| 754 | } | 769 | } |
| 770 | + | ||
| 771 | + saveFirstPageEndIndex(pageModel: PageModel) { | ||
| 772 | + pageModel.firstPageEndIndex = pageModel.compList.size() - 1 | ||
| 773 | + } | ||
| 774 | + | ||
| 775 | + static updateFirstPageEndIndex(pageModel: PageModel, isDel: boolean, index: number) { | ||
| 776 | + if (index > pageModel.firstPageEndIndex) { | ||
| 777 | + return | ||
| 778 | + } | ||
| 779 | + // 这里默认删除、添加都是一条一条处理 | ||
| 780 | + let count = 1 | ||
| 781 | + let endIndex = pageModel.firstPageEndIndex | ||
| 782 | + if (isDel) { | ||
| 783 | + // 第一页里删除 | ||
| 784 | + let offset = Math.min(endIndex - index, count) | ||
| 785 | + endIndex = endIndex - offset | ||
| 786 | + } else { | ||
| 787 | + // 第一页里添加 | ||
| 788 | + endIndex = endIndex + count | ||
| 789 | + } | ||
| 790 | + pageModel.firstPageEndIndex = endIndex | ||
| 791 | + } | ||
| 792 | + | ||
| 793 | + /** | ||
| 794 | + * 删除分页数据,保留第一页的数据。(下拉刷新场景用到) | ||
| 795 | + */ | ||
| 796 | + deleteMorePage(pageModel: PageModel) { | ||
| 797 | + Logger.debug(TAG, 'deleteMorePage endindex: ' + pageModel.firstPageEndIndex) | ||
| 798 | + if (pageModel.firstPageEndIndex < 0) { | ||
| 799 | + return | ||
| 800 | + } | ||
| 801 | + // 从第二页开始删 | ||
| 802 | + pageModel.compList.deleteItems(pageModel.firstPageEndIndex + 1) | ||
| 803 | + } | ||
| 755 | } | 804 | } |
| 756 | 805 | ||
| 757 | 806 |
| @@ -63,9 +63,11 @@ export default class PageModel { | @@ -63,9 +63,11 @@ export default class PageModel { | ||
| 63 | pageType: number = 0; | 63 | pageType: number = 0; |
| 64 | 64 | ||
| 65 | extra: string = '' | 65 | extra: string = '' |
| 66 | - // 缓存数据相关 | ||
| 67 | - cachePageInfoMd5: string = '' | ||
| 68 | - cacheGroupInfoMd5: string = '' | 66 | + // 页面加载,md5数据相关(初始缓存、下拉刷新用到) |
| 67 | + displayPageInfoMd5: string = '' | ||
| 68 | + displayGroupInfoMd5: string = '' | ||
| 69 | + // 第一页,最后一个comp下标,用于区分分页加载(下拉刷新,清除分页数据) | ||
| 70 | + firstPageEndIndex = -1 | ||
| 69 | 71 | ||
| 70 | /** | 72 | /** |
| 71 | * 简单复制业务数据 | 73 | * 简单复制业务数据 |
sight_harmony/features/wdComponent/src/main/resources/base/media/datail_imageLoading_w.gif
0 → 100644
191 KB
| @@ -8,7 +8,7 @@ import { Logger, WindowModel } from 'wdKit/Index'; | @@ -8,7 +8,7 @@ import { Logger, WindowModel } from 'wdKit/Index'; | ||
| 8 | import { router, window } from '@kit.ArkUI'; | 8 | import { router, window } from '@kit.ArkUI'; |
| 9 | import { devicePLSensorManager } from 'wdDetailPlayApi/Index'; | 9 | import { devicePLSensorManager } from 'wdDetailPlayApi/Index'; |
| 10 | import { LiveCommentComponent } from 'wdComponent/Index'; | 10 | import { LiveCommentComponent } from 'wdComponent/Index'; |
| 11 | -import { WDPlayerController } from 'wdPlayer/Index'; | 11 | +import { WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index'; |
| 12 | import { OperRowListView } from 'wdComponent/src/main/ets/components/view/OperRowListView'; | 12 | import { OperRowListView } from 'wdComponent/src/main/ets/components/view/OperRowListView'; |
| 13 | import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; | 13 | import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; |
| 14 | import { ResponseDTO } from 'wdNetwork/Index'; | 14 | import { ResponseDTO } from 'wdNetwork/Index'; |
| @@ -19,7 +19,7 @@ let TAG: string = 'DetailPlayLivePage'; | @@ -19,7 +19,7 @@ let TAG: string = 'DetailPlayLivePage'; | ||
| 19 | export struct DetailPlayLivePage { | 19 | export struct DetailPlayLivePage { |
| 20 | //横竖屏,默认竖屏 | 20 | //横竖屏,默认竖屏 |
| 21 | @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL | 21 | @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL |
| 22 | - playerController: WDPlayerController = new WDPlayerController(); | 22 | + playerController: WDAliPlayerController = new WDAliPlayerController(); |
| 23 | liveViewModel: LiveViewModel = new LiveViewModel() | 23 | liveViewModel: LiveViewModel = new LiveViewModel() |
| 24 | @State relId: string = '' | 24 | @State relId: string = '' |
| 25 | @State contentId: string = '' | 25 | @State contentId: string = '' |
| @@ -4,7 +4,7 @@ import router from '@ohos.router'; | @@ -4,7 +4,7 @@ import router from '@ohos.router'; | ||
| 4 | import { WindowModel } from 'wdKit/Index'; | 4 | import { WindowModel } from 'wdKit/Index'; |
| 5 | import { PlayerComponent } from '../widgets/vertical/PlayerComponent'; | 5 | import { PlayerComponent } from '../widgets/vertical/PlayerComponent'; |
| 6 | import { PlayerInfoComponent } from '../widgets/vertical/PlayerInfoComponent'; | 6 | import { PlayerInfoComponent } from '../widgets/vertical/PlayerInfoComponent'; |
| 7 | -import { WDPlayerController } from 'wdPlayer/Index'; | 7 | +import { WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index'; |
| 8 | import { DisplayDirection } from 'wdConstant/Index'; | 8 | import { DisplayDirection } from 'wdConstant/Index'; |
| 9 | import { LiveEmptyComponent, WDLiveViewDefaultType } from 'wdComponent/Index'; | 9 | import { LiveEmptyComponent, WDLiveViewDefaultType } from 'wdComponent/Index'; |
| 10 | import { PlayerEndView } from '../widgets/vertical/PlayerEndView'; | 10 | import { PlayerEndView } from '../widgets/vertical/PlayerEndView'; |
| @@ -16,7 +16,7 @@ const TAG = 'DetailPlayVLivePage' | @@ -16,7 +16,7 @@ const TAG = 'DetailPlayVLivePage' | ||
| 16 | @Component | 16 | @Component |
| 17 | export struct DetailPlayVLivePage { | 17 | export struct DetailPlayVLivePage { |
| 18 | private liveViewModel: LiveViewModel = new LiveViewModel() | 18 | private liveViewModel: LiveViewModel = new LiveViewModel() |
| 19 | - private playerController: WDPlayerController = new WDPlayerController(); | 19 | + private playerController: WDAliPlayerController = new WDAliPlayerController(); |
| 20 | private swiperController: SwiperController = new SwiperController() | 20 | private swiperController: SwiperController = new SwiperController() |
| 21 | @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 21 | @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 22 | @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 22 | @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| @@ -2,14 +2,14 @@ import { window } from '@kit.ArkUI' | @@ -2,14 +2,14 @@ import { window } from '@kit.ArkUI' | ||
| 2 | import lottie from '@ohos/lottie'; | 2 | import lottie from '@ohos/lottie'; |
| 3 | 3 | ||
| 4 | import { NumberFormatterUtils, StringUtils, WindowModel } from 'wdKit/Index' | 4 | import { NumberFormatterUtils, StringUtils, WindowModel } from 'wdKit/Index' |
| 5 | -import { DateFormatUtil, WDPlayerController } from 'wdPlayer/Index' | 5 | +import { DateFormatUtil, WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index' |
| 6 | import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index' | 6 | import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index' |
| 7 | import { DisplayDirection } from 'wdConstant/Index' | 7 | import { DisplayDirection } from 'wdConstant/Index' |
| 8 | import { LiveFollowComponent, LottieView } from 'wdComponent/Index' | 8 | import { LiveFollowComponent, LottieView } from 'wdComponent/Index' |
| 9 | 9 | ||
| 10 | @Component | 10 | @Component |
| 11 | export struct PlayUIComponent { | 11 | export struct PlayUIComponent { |
| 12 | - playerController: WDPlayerController = new WDPlayerController(); | 12 | + playerController?: WDAliPlayerController; |
| 13 | //菜单键是否可见 | 13 | //菜单键是否可见 |
| 14 | @State @Watch('onChangeMenuVisible') isMenuVisible: boolean = true | 14 | @State @Watch('onChangeMenuVisible') isMenuVisible: boolean = true |
| 15 | @Consume liveDetailsBean: LiveDetailsBean | 15 | @Consume liveDetailsBean: LiveDetailsBean |
| @@ -39,10 +39,12 @@ export struct PlayUIComponent { | @@ -39,10 +39,12 @@ export struct PlayUIComponent { | ||
| 39 | aboutToAppear(): void { | 39 | aboutToAppear(): void { |
| 40 | this.onChangeMenuVisible() | 40 | this.onChangeMenuVisible() |
| 41 | //播放进度监听 | 41 | //播放进度监听 |
| 42 | - this.playerController.onTimeUpdate = (position: number, duration: number) => { | ||
| 43 | - this.currentTime = DateFormatUtil.secondToTime(Math.floor(position / 1000)); | ||
| 44 | - this.totalTime = DateFormatUtil.secondToTime(Math.floor(duration / 1000)); | ||
| 45 | - this.progressVal = Math.floor(position * 100 / duration); | 42 | + if (this.playerController) { |
| 43 | + this.playerController.onTimeUpdate = (position: number, duration: number) => { | ||
| 44 | + this.currentTime = DateFormatUtil.secondToTime(Math.floor(position / 1000)); | ||
| 45 | + this.totalTime = DateFormatUtil.secondToTime(Math.floor(duration / 1000)); | ||
| 46 | + this.progressVal = Math.floor(position * 100 / duration); | ||
| 47 | + } | ||
| 46 | } | 48 | } |
| 47 | } | 49 | } |
| 48 | 50 | ||
| @@ -312,10 +314,10 @@ export struct PlayUIComponent { | @@ -312,10 +314,10 @@ export struct PlayUIComponent { | ||
| 312 | .onClick(() => { | 314 | .onClick(() => { |
| 313 | if (this.isPlayStatus) { | 315 | if (this.isPlayStatus) { |
| 314 | this.isPlayStatus = false | 316 | this.isPlayStatus = false |
| 315 | - this.playerController.pause() | 317 | + this.playerController?.pause() |
| 316 | } else { | 318 | } else { |
| 317 | this.isPlayStatus = true | 319 | this.isPlayStatus = true |
| 318 | - this.playerController.play() | 320 | + this.playerController?.play() |
| 319 | } | 321 | } |
| 320 | }) | 322 | }) |
| 321 | } | 323 | } |
| 1 | import { LiveDetailsBean } from 'wdBean/Index'; | 1 | import { LiveDetailsBean } from 'wdBean/Index'; |
| 2 | import { StringUtils } from 'wdKit/Index'; | 2 | import { StringUtils } from 'wdKit/Index'; |
| 3 | -import { WDPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index'; | 3 | +import { WDAliPlayerController, WDPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index'; |
| 4 | import { PlayUIComponent } from './PlayUIComponent'; | 4 | import { PlayUIComponent } from './PlayUIComponent'; |
| 5 | import { Logger } from 'wdKit/Index'; | 5 | import { Logger } from 'wdKit/Index'; |
| 6 | 6 | ||
| @@ -10,12 +10,14 @@ const TAG: string = 'TopPlayComponent' | @@ -10,12 +10,14 @@ const TAG: string = 'TopPlayComponent' | ||
| 10 | @Component | 10 | @Component |
| 11 | export struct TopPlayComponent { | 11 | export struct TopPlayComponent { |
| 12 | @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean | 12 | @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean |
| 13 | - playerController?: WDPlayerController | 13 | + playerController?: WDAliPlayerController |
| 14 | @State imgUrl: string = '' | 14 | @State imgUrl: string = '' |
| 15 | //未开始 | 15 | //未开始 |
| 16 | @State isWait: boolean = false | 16 | @State isWait: boolean = false |
| 17 | //已结束直播 | 17 | //已结束直播 |
| 18 | @State isEnd: boolean = false | 18 | @State isEnd: boolean = false |
| 19 | + private playUrl: string = "" | ||
| 20 | + private xComponentIsLoaded: boolean = false | ||
| 19 | 21 | ||
| 20 | aboutToAppear(): void { | 22 | aboutToAppear(): void { |
| 21 | if (this.playerController) { | 23 | if (this.playerController) { |
| @@ -49,16 +51,31 @@ export struct TopPlayComponent { | @@ -49,16 +51,31 @@ export struct TopPlayComponent { | ||
| 49 | // this.playerController?.firstPlay('https://rmrbcmsonline.peopleapp.com/upload/rmh/video/mp4/202404/1713752415708fb81d0b8f137b.mp4'); | 51 | // this.playerController?.firstPlay('https://rmrbcmsonline.peopleapp.com/upload/rmh/video/mp4/202404/1713752415708fb81d0b8f137b.mp4'); |
| 50 | if (StringUtils.isNotEmpty(playUrl)) { | 52 | if (StringUtils.isNotEmpty(playUrl)) { |
| 51 | Logger.debug(TAG, `${playUrl}`) | 53 | Logger.debug(TAG, `${playUrl}`) |
| 52 | - this.playerController?.firstPlay(playUrl); | 54 | + this.playUrl = playUrl |
| 55 | + this.tryToPlay() | ||
| 53 | } | 56 | } |
| 54 | } | 57 | } |
| 55 | } | 58 | } |
| 56 | 59 | ||
| 60 | + tryToPlay() { | ||
| 61 | + if (!this.xComponentIsLoaded) { | ||
| 62 | + Logger.debug(TAG, "需要xComponent加载完成") | ||
| 63 | + return | ||
| 64 | + } | ||
| 65 | + if (this.playUrl.length == 0) { | ||
| 66 | + Logger.debug(TAG, "播放地址为空") | ||
| 67 | + return | ||
| 68 | + } | ||
| 69 | + this.playerController?.firstPlay(this.playUrl); | ||
| 70 | + } | ||
| 71 | + | ||
| 57 | build() { | 72 | build() { |
| 58 | Stack() { | 73 | Stack() { |
| 59 | WDPlayerRenderLiveView({ | 74 | WDPlayerRenderLiveView({ |
| 60 | playerController: this.playerController, | 75 | playerController: this.playerController, |
| 61 | onLoad: async () => { | 76 | onLoad: async () => { |
| 77 | + this.xComponentIsLoaded = true | ||
| 78 | + this.tryToPlay() | ||
| 62 | } | 79 | } |
| 63 | }) | 80 | }) |
| 64 | .height('100%') | 81 | .height('100%') |
| 1 | import { LiveDetailsBean } from 'wdBean/Index'; | 1 | import { LiveDetailsBean } from 'wdBean/Index'; |
| 2 | -import { WDPlayerController, WDPlayerRenderVLiveView, WDPlayerRenderView } from 'wdPlayer/Index'; | 2 | +import { WDPlayerController, WDPlayerRenderVLiveView, WDPlayerRenderView, WDAliPlayerController, |
| 3 | + AliPlayerRenderView } from 'wdPlayer/Index'; | ||
| 3 | import { PictureLoading } from './PictureLoading'; | 4 | import { PictureLoading } from './PictureLoading'; |
| 4 | 5 | ||
| 5 | const TAG = 'PlayerComponent' | 6 | const TAG = 'PlayerComponent' |
| 6 | 7 | ||
| 7 | @Component | 8 | @Component |
| 8 | export struct PlayerComponent { | 9 | export struct PlayerComponent { |
| 9 | - @Prop playerController: WDPlayerController; | 10 | + @Prop playerController: WDAliPlayerController; |
| 10 | @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean | 11 | @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean |
| 11 | @Consume @Watch('pageShowChange') pageShow: number | 12 | @Consume @Watch('pageShowChange') pageShow: number |
| 12 | @Consume @Watch('pageHideChange') pageHide: number | 13 | @Consume @Watch('pageHideChange') pageHide: number |
| @@ -78,7 +79,7 @@ export struct PlayerComponent { | @@ -78,7 +79,7 @@ export struct PlayerComponent { | ||
| 78 | } | 79 | } |
| 79 | }) | 80 | }) |
| 80 | } else if (this.liveStreamType == 0) { | 81 | } else if (this.liveStreamType == 0) { |
| 81 | - WDPlayerRenderView({ | 82 | + AliPlayerRenderView({ |
| 82 | playerController: this.playerController, | 83 | playerController: this.playerController, |
| 83 | onLoad: () => { | 84 | onLoad: () => { |
| 84 | this.playerController?.firstPlay(this.playUrl); | 85 | this.playerController?.firstPlay(this.playUrl); |
| 1 | -import { WDPlayerController } from 'wdPlayer/Index' | 1 | +import { WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index' |
| 2 | import { PlayerUIComponent } from './PlayerUIComponent' | 2 | import { PlayerUIComponent } from './PlayerUIComponent' |
| 3 | 3 | ||
| 4 | @Component | 4 | @Component |
| 5 | export struct PlayerInfoComponent { | 5 | export struct PlayerInfoComponent { |
| 6 | swiperController?: SwiperController | 6 | swiperController?: SwiperController |
| 7 | - private playerController?: WDPlayerController | 7 | + private playerController?: WDAliPlayerController |
| 8 | @Consume bottomSafeHeight: number | 8 | @Consume bottomSafeHeight: number |
| 9 | @Consume topSafeHeight: number | 9 | @Consume topSafeHeight: number |
| 10 | @Consume liveState: string | 10 | @Consume liveState: string |
| 1 | import { ContentDetailDTO } from 'wdBean/Index'; | 1 | import { ContentDetailDTO } from 'wdBean/Index'; |
| 2 | -import { WDPlayerController } from 'wdPlayer/Index'; | 2 | +import { WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index'; |
| 3 | import { PlayerCommentComponent } from './PlayerCommentComponent'; | 3 | import { PlayerCommentComponent } from './PlayerCommentComponent'; |
| 4 | import { PlayerTitleComponent } from './PlayerTitleComponent'; | 4 | import { PlayerTitleComponent } from './PlayerTitleComponent'; |
| 5 | import { PlayerVideoControlComponent } from './PlayerVideoControlComponent'; | 5 | import { PlayerVideoControlComponent } from './PlayerVideoControlComponent'; |
| 6 | 6 | ||
| 7 | @Component | 7 | @Component |
| 8 | export struct PlayerUIComponent { | 8 | export struct PlayerUIComponent { |
| 9 | - private playerController?: WDPlayerController | 9 | + private playerController?: WDAliPlayerController |
| 10 | @Consume isShowControl: boolean | 10 | @Consume isShowControl: boolean |
| 11 | 11 | ||
| 12 | build() { | 12 | build() { |
| @@ -2,13 +2,13 @@ import { window } from '@kit.ArkUI' | @@ -2,13 +2,13 @@ import { window } from '@kit.ArkUI' | ||
| 2 | import { NumberFormatterUtils, WindowModel } from 'wdKit/Index' | 2 | import { NumberFormatterUtils, WindowModel } from 'wdKit/Index' |
| 3 | 3 | ||
| 4 | import { devicePLSensorManager } from 'wdDetailPlayApi/Index' | 4 | import { devicePLSensorManager } from 'wdDetailPlayApi/Index' |
| 5 | -import { DateFormatUtil, WDPlayerController } from 'wdPlayer/Index' | 5 | +import { DateFormatUtil, WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index' |
| 6 | import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index' | 6 | import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index' |
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | @Component | 9 | @Component |
| 10 | export struct PlayerVideoControlComponent { | 10 | export struct PlayerVideoControlComponent { |
| 11 | - private playerController?: WDPlayerController | 11 | + private playerController?: WDAliPlayerController |
| 12 | @Consume liveDetailsBean: LiveDetailsBean | 12 | @Consume liveDetailsBean: LiveDetailsBean |
| 13 | @Consume liveRoomDataBean: LiveRoomDataBean | 13 | @Consume liveRoomDataBean: LiveRoomDataBean |
| 14 | @State currentTime: string = '' | 14 | @State currentTime: string = '' |
| @@ -12,6 +12,7 @@ | @@ -12,6 +12,7 @@ | ||
| 12 | "wdWebComponent": "file:../../commons/wdWebComponent", | 12 | "wdWebComponent": "file:../../commons/wdWebComponent", |
| 13 | "wdBean": "file:../../features/wdBean", | 13 | "wdBean": "file:../../features/wdBean", |
| 14 | "wdRouter": "file:../../commons/wdRouter", | 14 | "wdRouter": "file:../../commons/wdRouter", |
| 15 | - "wdNetwork": "file:../../commons/wdNetwork" | 15 | + "wdNetwork": "file:../../commons/wdNetwork", |
| 16 | + "wdTracking": "file:../../features/wdTracking" | ||
| 16 | } | 17 | } |
| 17 | } | 18 | } |
| @@ -10,6 +10,7 @@ import {InterestsHobbiesModel} from '../../../../../../../products/phone/src/mai | @@ -10,6 +10,7 @@ import {InterestsHobbiesModel} from '../../../../../../../products/phone/src/mai | ||
| 10 | import HuaweiAuth from '../../utils/HuaweiAuth' | 10 | import HuaweiAuth from '../../utils/HuaweiAuth' |
| 11 | import { loginComponentManager, LoginWithHuaweiIDButton } from '@hms.core.account.LoginComponent' | 11 | import { loginComponentManager, LoginWithHuaweiIDButton } from '@hms.core.account.LoginComponent' |
| 12 | import { BusinessError } from '@ohos.base' | 12 | import { BusinessError } from '@ohos.base' |
| 13 | +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index' | ||
| 13 | 14 | ||
| 14 | @Extend(Row) | 15 | @Extend(Row) |
| 15 | function otherStyle() { | 16 | function otherStyle() { |
| @@ -55,6 +56,8 @@ struct LoginPage { | @@ -55,6 +56,8 @@ struct LoginPage { | ||
| 55 | customStyle: true, | 56 | customStyle: true, |
| 56 | maskColor:"#00000000" | 57 | maskColor:"#00000000" |
| 57 | }) | 58 | }) |
| 59 | + pageShowTime:number = 0; | ||
| 60 | + pageHideTime:number = 0; | ||
| 58 | 61 | ||
| 59 | loginViewModel = new LoginViewModel() | 62 | loginViewModel = new LoginViewModel() |
| 60 | @State isProtocol:boolean=false | 63 | @State isProtocol:boolean=false |
| @@ -70,7 +73,15 @@ struct LoginPage { | @@ -70,7 +73,15 @@ struct LoginPage { | ||
| 70 | } | 73 | } |
| 71 | 74 | ||
| 72 | onPageShow() { | 75 | onPageShow() { |
| 73 | - Logger.debug(TAG, "onPageShow:" + this.isCodeSend + "") | 76 | + Logger.debug(TAG, "onPageShow:" + this.isCodeSend + " ") |
| 77 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + onPageHide(): void { | ||
| 81 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 82 | + let duration = 0 | ||
| 83 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 84 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page,duration) | ||
| 74 | } | 85 | } |
| 75 | 86 | ||
| 76 | build() { | 87 | build() { |
| 1 | -import { CustomToast} from 'wdKit/Index'; | 1 | +import { CustomToast, DateTimeUtils} from 'wdKit/Index'; |
| 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 3 | import { LoginModel } from './LoginModel'; | 3 | import { LoginModel } from './LoginModel'; |
| 4 | import { ModifyPasswordRequestItem } from './ModifyPasswordRequestItem'; | 4 | import { ModifyPasswordRequestItem } from './ModifyPasswordRequestItem'; |
| 5 | import { router } from '@kit.ArkUI'; | 5 | import { router } from '@kit.ArkUI'; |
| 6 | import { encryptMessage } from '../../utils/cryptoUtil'; | 6 | import { encryptMessage } from '../../utils/cryptoUtil'; |
| 7 | +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; | ||
| 7 | 8 | ||
| 8 | /** | 9 | /** |
| 9 | * 修改密码页面 | 10 | * 修改密码页面 |
| @@ -26,7 +27,19 @@ struct ModifyPasswordPage { | @@ -26,7 +27,19 @@ struct ModifyPasswordPage { | ||
| 26 | customStyle: true, | 27 | customStyle: true, |
| 27 | maskColor:"#00000000" | 28 | maskColor:"#00000000" |
| 28 | }) | 29 | }) |
| 30 | + pageShowTime:number = 0; | ||
| 31 | + pageHideTime:number = 0; | ||
| 29 | 32 | ||
| 33 | + onPageShow() { | ||
| 34 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + onPageHide(): void { | ||
| 38 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 39 | + let duration = 0 | ||
| 40 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 41 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Change_Passwd,TrackConstants.PageName.Change_Passwd,duration) | ||
| 42 | + } | ||
| 30 | 43 | ||
| 31 | build() { | 44 | build() { |
| 32 | Row() { | 45 | Row() { |
| @@ -14,4 +14,6 @@ export { DateFormatUtil } from "./src/main/ets/utils/DateFormatUtil" | @@ -14,4 +14,6 @@ export { DateFormatUtil } from "./src/main/ets/utils/DateFormatUtil" | ||
| 14 | 14 | ||
| 15 | export { WDAliPlayerController } from "./src/main/ets/controller/WDAliPlayerController" | 15 | export { WDAliPlayerController } from "./src/main/ets/controller/WDAliPlayerController" |
| 16 | 16 | ||
| 17 | -export { WDListPlayerData, WDAliListPlayerController } from "./src/main/ets/controller/WDAliListPlayerController" | ||
| 17 | +export { WDListPlayerData, WDAliListPlayerController } from "./src/main/ets/controller/WDAliListPlayerController" | ||
| 18 | + | ||
| 19 | +export { AliPlayerRenderView } from "./src/main/ets/pages/AliPlayerRenderView" |
| @@ -11,8 +11,10 @@ import { | @@ -11,8 +11,10 @@ import { | ||
| 11 | 11 | ||
| 12 | import { initGlobalPlayerSettings, setupPlayerConfig } from '../utils/GlobalSetting'; | 12 | import { initGlobalPlayerSettings, setupPlayerConfig } from '../utils/GlobalSetting'; |
| 13 | import prompt from '@ohos.promptAction'; | 13 | import prompt from '@ohos.promptAction'; |
| 14 | -import { Logger } from '../utils/Logger'; | ||
| 15 | import { PlayerConstants, AVPlayerStatus, Events } from '../constants/PlayerConstants'; | 14 | import { PlayerConstants, AVPlayerStatus, Events } from '../constants/PlayerConstants'; |
| 15 | +import { Logger } from 'wdKit/Index'; | ||
| 16 | + | ||
| 17 | +const TAG = "WDAliPlayerController" | ||
| 16 | 18 | ||
| 17 | /* | 19 | /* |
| 18 | * 此播放器为阿里播放器鸿蒙版本封装,可播放单个视频、或直播 | 20 | * 此播放器为阿里播放器鸿蒙版本封装,可播放单个视频、或直播 |
| @@ -54,7 +56,7 @@ export class WDAliPlayerController { | @@ -54,7 +56,7 @@ export class WDAliPlayerController { | ||
| 54 | public onFirstFrameDisplay?: () => void | 56 | public onFirstFrameDisplay?: () => void |
| 55 | 57 | ||
| 56 | constructor() { | 58 | constructor() { |
| 57 | - Logger.info("初始化") | 59 | + Logger.info(TAG, "初始化") |
| 58 | initGlobalPlayerSettings() | 60 | initGlobalPlayerSettings() |
| 59 | this.initPromise = this.createAVPlayer(); | 61 | this.initPromise = this.createAVPlayer(); |
| 60 | } | 62 | } |
| @@ -64,24 +66,24 @@ export class WDAliPlayerController { | @@ -64,24 +66,24 @@ export class WDAliPlayerController { | ||
| 64 | */ | 66 | */ |
| 65 | private createAVPlayer(): Promise<void> { | 67 | private createAVPlayer(): Promise<void> { |
| 66 | return new Promise((resolve, reject) => { | 68 | return new Promise((resolve, reject) => { |
| 67 | - Logger.debug("开始创建") | 69 | + Logger.debug(TAG, "开始创建") |
| 68 | let traceId = '' | 70 | let traceId = '' |
| 69 | this.avPlayer = AliPlayerFactory.createAliPlayer(getContext(), traceId) | 71 | this.avPlayer = AliPlayerFactory.createAliPlayer(getContext(), traceId) |
| 70 | if (this.avPlayer) { | 72 | if (this.avPlayer) { |
| 71 | - Logger.debug("创建完成1") | 73 | + Logger.debug(TAG, "创建完成1") |
| 72 | setupPlayerConfig(this.avPlayer!) | 74 | setupPlayerConfig(this.avPlayer!) |
| 73 | this.bindState(); | 75 | this.bindState(); |
| 74 | resolve(); | 76 | resolve(); |
| 75 | } else { | 77 | } else { |
| 76 | - Logger.error("创建完成0") | ||
| 77 | - Logger.error('[WDPlayerController] createAvPlayer fail!'); | 78 | + Logger.error(TAG, "创建完成0") |
| 79 | + Logger.error(TAG, '[WDPlayerController] createAvPlayer fail!'); | ||
| 78 | reject(); | 80 | reject(); |
| 79 | } | 81 | } |
| 80 | }); | 82 | }); |
| 81 | } | 83 | } |
| 82 | 84 | ||
| 83 | public destory() { | 85 | public destory() { |
| 84 | - Logger.debug("播放器销毁") | 86 | + Logger.debug(TAG, "播放器销毁") |
| 85 | this.avPlayer?.stop() | 87 | this.avPlayer?.stop() |
| 86 | this.avPlayer?.release() | 88 | this.avPlayer?.release() |
| 87 | } | 89 | } |
| @@ -94,13 +96,13 @@ export class WDAliPlayerController { | @@ -94,13 +96,13 @@ export class WDAliPlayerController { | ||
| 94 | // 当调用play()方法后,会调用 | 96 | // 当调用play()方法后,会调用 |
| 95 | onPrepared: () => { | 97 | onPrepared: () => { |
| 96 | this.duration = this.avPlayer?.getDuration(); | 98 | this.duration = this.avPlayer?.getDuration(); |
| 97 | - Logger.debug("已准备好", `${this.duration}`) | 99 | + Logger.debug(TAG, "已准备好", `${this.duration}`) |
| 98 | } | 100 | } |
| 99 | } | 101 | } |
| 100 | ); | 102 | ); |
| 101 | this.avPlayer?.setOnRenderingStartListener({ | 103 | this.avPlayer?.setOnRenderingStartListener({ |
| 102 | onRenderingStart: () => { | 104 | onRenderingStart: () => { |
| 103 | - Logger.debug("首帧开始显示") | 105 | + Logger.debug(TAG, "首帧开始显示") |
| 104 | if (this.onFirstFrameDisplay) { | 106 | if (this.onFirstFrameDisplay) { |
| 105 | this.onFirstFrameDisplay() | 107 | this.onFirstFrameDisplay() |
| 106 | } | 108 | } |
| @@ -108,7 +110,7 @@ export class WDAliPlayerController { | @@ -108,7 +110,7 @@ export class WDAliPlayerController { | ||
| 108 | }); | 110 | }); |
| 109 | this.avPlayer?.setOnCompletionListener({ | 111 | this.avPlayer?.setOnCompletionListener({ |
| 110 | onCompletion: () => { | 112 | onCompletion: () => { |
| 111 | - Logger.debug("播放完成") | 113 | + Logger.debug(TAG, "播放完成") |
| 112 | } | 114 | } |
| 113 | }); | 115 | }); |
| 114 | this.avPlayer?.setOnInfoListener({ | 116 | this.avPlayer?.setOnInfoListener({ |
| @@ -116,7 +118,7 @@ export class WDAliPlayerController { | @@ -116,7 +118,7 @@ export class WDAliPlayerController { | ||
| 116 | 118 | ||
| 117 | if (bean.getCode() === InfoCode.CurrentPosition) { | 119 | if (bean.getCode() === InfoCode.CurrentPosition) { |
| 118 | let position : number = bean.getExtraValue() | 120 | let position : number = bean.getExtraValue() |
| 119 | - Logger.debug(`播放进度条:${position}/ ${this.duration}`) | 121 | + Logger.debug(TAG, `播放进度条:${position}/ ${this.duration}`) |
| 120 | this.initProgress(position); | 122 | this.initProgress(position); |
| 121 | 123 | ||
| 122 | } else if (bean.getCode() === InfoCode.BufferedPosition) { | 124 | } else if (bean.getCode() === InfoCode.BufferedPosition) { |
| @@ -126,7 +128,7 @@ export class WDAliPlayerController { | @@ -126,7 +128,7 @@ export class WDAliPlayerController { | ||
| 126 | } | 128 | } |
| 127 | 129 | ||
| 128 | } else if (bean.getCode() === InfoCode.SwitchToSoftwareVideoDecoder) { | 130 | } else if (bean.getCode() === InfoCode.SwitchToSoftwareVideoDecoder) { |
| 129 | - Logger.debug(`DOWNGRADE TO SOFTWARE DECODE`) | 131 | + Logger.debug(TAG, `DOWNGRADE TO SOFTWARE DECODE`) |
| 130 | // this.mSwitchedToSoftListener?.onSwitched(); | 132 | // this.mSwitchedToSoftListener?.onSwitched(); |
| 131 | } | 133 | } |
| 132 | } | 134 | } |
| @@ -134,7 +136,7 @@ export class WDAliPlayerController { | @@ -134,7 +136,7 @@ export class WDAliPlayerController { | ||
| 134 | this.avPlayer?.setOnStateChangedListener({ | 136 | this.avPlayer?.setOnStateChangedListener({ |
| 135 | onStateChanged: (status: number) => { | 137 | onStateChanged: (status: number) => { |
| 136 | this.avPlayerStatus = status | 138 | this.avPlayerStatus = status |
| 137 | - Logger.debug("status update:" + `${this.getStatusStringWith(status)}`) | 139 | + Logger.debug(TAG, "status update:" + `${this.getStatusStringWith(status)}`) |
| 138 | 140 | ||
| 139 | switch (status) { | 141 | switch (status) { |
| 140 | case initalized: { | 142 | case initalized: { |
| @@ -189,7 +191,7 @@ export class WDAliPlayerController { | @@ -189,7 +191,7 @@ export class WDAliPlayerController { | ||
| 189 | }); | 191 | }); |
| 190 | this.avPlayer?.setOnErrorListener({ | 192 | this.avPlayer?.setOnErrorListener({ |
| 191 | onError:(errorInfo) => { | 193 | onError:(errorInfo) => { |
| 192 | - Logger.error("播放错误", JSON.stringify(errorInfo)) | 194 | + Logger.error(TAG, "播放错误", JSON.stringify(errorInfo)) |
| 193 | this.errorCode = errorInfo.getCode() | 195 | this.errorCode = errorInfo.getCode() |
| 194 | this.errorMesage = errorInfo.getMsg() | 196 | this.errorMesage = errorInfo.getMsg() |
| 195 | this.status = PlayerConstants.STATUS_ERROR; | 197 | this.status = PlayerConstants.STATUS_ERROR; |
| @@ -240,16 +242,24 @@ export class WDAliPlayerController { | @@ -240,16 +242,24 @@ export class WDAliPlayerController { | ||
| 240 | 242 | ||
| 241 | setXComponentController(controller: XComponentController) { | 243 | setXComponentController(controller: XComponentController) { |
| 242 | this.setSurfaceId(controller.getXComponentSurfaceId()) | 244 | this.setSurfaceId(controller.getXComponentSurfaceId()) |
| 245 | + if (this.avPlayerStatus > PlayerConstants.STATUS_IDLE) { | ||
| 246 | + Logger.info(TAG, "设置SurfaceId: " + this.surfaceId) | ||
| 247 | + this.avPlayer?.setSurfaceId(this.surfaceId) | ||
| 248 | + } | ||
| 243 | } | 249 | } |
| 244 | 250 | ||
| 245 | setSurfaceId(surfaceId: string) { | 251 | setSurfaceId(surfaceId: string) { |
| 246 | this.surfaceId = surfaceId | 252 | this.surfaceId = surfaceId |
| 253 | + if (this.avPlayerStatus > PlayerConstants.STATUS_IDLE) { | ||
| 254 | + Logger.info(TAG, "设置SurfaceId: " + this.surfaceId) | ||
| 255 | + this.avPlayer?.setSurfaceId(this.surfaceId) | ||
| 256 | + } | ||
| 247 | } | 257 | } |
| 248 | 258 | ||
| 249 | async firstPlay(url: string) { | 259 | async firstPlay(url: string) { |
| 250 | this.url = url; | 260 | this.url = url; |
| 251 | if (this.avPlayer == null) { | 261 | if (this.avPlayer == null) { |
| 252 | - Logger.info("等待播放器初始化") | 262 | + Logger.info(TAG, "等待播放器初始化") |
| 253 | await this.initPromise; | 263 | await this.initPromise; |
| 254 | } else { | 264 | } else { |
| 255 | if (this.avPlayerStatus != idle) { | 265 | if (this.avPlayerStatus != idle) { |
| @@ -269,10 +279,10 @@ export class WDAliPlayerController { | @@ -269,10 +279,10 @@ export class WDAliPlayerController { | ||
| 269 | 279 | ||
| 270 | this.avPlayer?.setAutoPlay(false) | 280 | this.avPlayer?.setAutoPlay(false) |
| 271 | 281 | ||
| 272 | - Logger.debug("开始播放", this.url) | 282 | + Logger.debug(TAG, "开始播放", this.url) |
| 273 | this.setAliPlayerURL(this.url); | 283 | this.setAliPlayerURL(this.url); |
| 274 | 284 | ||
| 275 | - Logger.info("设置SurfaceId" + this.surfaceId) | 285 | + Logger.info(TAG, "设置SurfaceId: " + this.surfaceId) |
| 276 | this.avPlayer?.setSurfaceId(this.surfaceId) | 286 | this.avPlayer?.setSurfaceId(this.surfaceId) |
| 277 | 287 | ||
| 278 | this.avPlayer?.prepare() | 288 | this.avPlayer?.prepare() |
| @@ -287,17 +297,17 @@ export class WDAliPlayerController { | @@ -287,17 +297,17 @@ export class WDAliPlayerController { | ||
| 287 | } | 297 | } |
| 288 | 298 | ||
| 289 | pause() { | 299 | pause() { |
| 290 | - Logger.debug("暂停", this.url) | 300 | + Logger.debug(TAG, "暂停", this.url) |
| 291 | this.avPlayer?.pause(); | 301 | this.avPlayer?.pause(); |
| 292 | } | 302 | } |
| 293 | 303 | ||
| 294 | play() { | 304 | play() { |
| 295 | - Logger.debug("播放", this.url) | 305 | + Logger.debug(TAG, "播放", this.url) |
| 296 | this.avPlayer?.start(); | 306 | this.avPlayer?.start(); |
| 297 | } | 307 | } |
| 298 | 308 | ||
| 299 | stop() { | 309 | stop() { |
| 300 | - Logger.debug("停止", this.url) | 310 | + Logger.debug(TAG, "停止", this.url) |
| 301 | this.avPlayer?.stop(); | 311 | this.avPlayer?.stop(); |
| 302 | } | 312 | } |
| 303 | 313 | ||
| @@ -405,7 +415,7 @@ export class WDAliPlayerController { | @@ -405,7 +415,7 @@ export class WDAliPlayerController { | ||
| 405 | if (this.onVolumeUpdate) { | 415 | if (this.onVolumeUpdate) { |
| 406 | this.onVolumeUpdate(this.volume); | 416 | this.onVolumeUpdate(this.volume); |
| 407 | } | 417 | } |
| 408 | - console.log("volume : " + this.volume) | 418 | + Logger.debug(TAG, "volume : " + this.volume) |
| 409 | } | 419 | } |
| 410 | 420 | ||
| 411 | onBrightActionUpdate(event: GestureEvent) { | 421 | onBrightActionUpdate(event: GestureEvent) { |
| @@ -429,7 +439,7 @@ export class WDAliPlayerController { | @@ -429,7 +439,7 @@ export class WDAliPlayerController { | ||
| 429 | } | 439 | } |
| 430 | 440 | ||
| 431 | watchStatus() { | 441 | watchStatus() { |
| 432 | - console.log('watchStatus', this.status) | 442 | + Logger.debug(TAG, 'watchStatus: ' + this.status) |
| 433 | if (this.onStatusChange) { | 443 | if (this.onStatusChange) { |
| 434 | this.onStatusChange(this.status) | 444 | this.onStatusChange(this.status) |
| 435 | } | 445 | } |
| 1 | +import componentUtils from '@ohos.arkui.componentUtils'; | ||
| 2 | +import { WDPlayerController } from '../controller/WDPlayerController' | ||
| 3 | +import { WindowModel } from 'wdKit'; | ||
| 4 | +import { Logger } from '../utils/Logger'; | ||
| 5 | +import { enableAliPlayer } from '../utils/GlobalSetting'; | ||
| 6 | +import { WDAliPlayerController } from '../controller/WDAliPlayerController'; | ||
| 7 | + | ||
| 8 | +class Size { | ||
| 9 | + width: Length = "100%"; | ||
| 10 | + height: Length = "100%"; | ||
| 11 | + | ||
| 12 | + constructor(width: Length, height: Length) { | ||
| 13 | + this.width = width; | ||
| 14 | + this.height = height; | ||
| 15 | + } | ||
| 16 | +} | ||
| 17 | + | ||
| 18 | +let insIndex: number = 0; | ||
| 19 | +const TAG = 'AliPlayerRenderView' | ||
| 20 | + | ||
| 21 | +class MGPlayRenderViewIns { | ||
| 22 | + static intCount: number = 0; | ||
| 23 | + | ||
| 24 | + static add() { | ||
| 25 | + MGPlayRenderViewIns.intCount++; | ||
| 26 | + WindowModel.shared.setWindowKeepScreenOn(true); | ||
| 27 | + console.log("add-- +1") | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + static del() { | ||
| 31 | + console.log("del-- -1") | ||
| 32 | + MGPlayRenderViewIns.intCount--; | ||
| 33 | + if (MGPlayRenderViewIns.intCount <= 0) { | ||
| 34 | + WindowModel.shared.setWindowKeepScreenOn(false); | ||
| 35 | + } | ||
| 36 | + } | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | +/** | ||
| 40 | + * 播放窗口组件,对接阿里播放器的RenderView | ||
| 41 | + */ | ||
| 42 | +@Component | ||
| 43 | +export struct AliPlayerRenderView { | ||
| 44 | + private playerController?: WDAliPlayerController; | ||
| 45 | + private xComponentController: XComponentController = new XComponentController(); | ||
| 46 | + private insId: string = "AliPlayerRenderView" + insIndex; | ||
| 47 | + onLoad?: ((event?: object) => void); | ||
| 48 | + @State videoWidth: number = 16 | ||
| 49 | + @State videoHeight: number = 9 | ||
| 50 | + @State videoRatio: number = 16 / 9 | ||
| 51 | + @State selfSize: Size = new Size('100%', '100%'); | ||
| 52 | + private enableAliPlayer = true | ||
| 53 | + | ||
| 54 | + aboutToAppear() { | ||
| 55 | + MGPlayRenderViewIns.add(); | ||
| 56 | + | ||
| 57 | + insIndex++; | ||
| 58 | + if (!this.playerController) { | ||
| 59 | + return | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + this.playerController.onVideoSizeChange = (width: number, height: number) => { | ||
| 63 | + // console.log(`WDPlayerRenderView onVideoSizeChange width:${width} videoTop:${height}`) | ||
| 64 | + Logger.info(TAG, ` onVideoSizeChange width:${width} videoTop:${height}`) | ||
| 65 | + this.videoWidth = width; | ||
| 66 | + this.videoHeight = height; | ||
| 67 | + this.videoRatio = width / height | ||
| 68 | + this.updateLayout() | ||
| 69 | + } | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + aboutToDisappear() { | ||
| 73 | + Logger.info(TAG, `aboutToDisappear`) | ||
| 74 | + MGPlayRenderViewIns.del(); | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + build() { | ||
| 78 | + Row() { | ||
| 79 | + // 设置为“surface“类型时XComponent组件可以和其他组件一起进行布局和渲染。 | ||
| 80 | + XComponent({ | ||
| 81 | + id: this.insId, | ||
| 82 | + type: XComponentType.SURFACE, | ||
| 83 | + libraryname: enableAliPlayer && this.enableAliPlayer ? "premierlibrary" : undefined, | ||
| 84 | + controller: this.xComponentController | ||
| 85 | + }) | ||
| 86 | + .onLoad(async (event) => { | ||
| 87 | + Logger.info(TAG, 'onLoad') | ||
| 88 | + this.xComponentController.setXComponentSurfaceSize({ | ||
| 89 | + surfaceWidth: 1920, | ||
| 90 | + surfaceHeight: 1080 | ||
| 91 | + }); | ||
| 92 | + if (enableAliPlayer && this.enableAliPlayer) { | ||
| 93 | + this.playerController?.setSurfaceId(this.insId) | ||
| 94 | + } else { | ||
| 95 | + this.playerController?.setXComponentController(this.xComponentController) | ||
| 96 | + } | ||
| 97 | + if (this.onLoad) { | ||
| 98 | + this.onLoad(event) | ||
| 99 | + } | ||
| 100 | + }) | ||
| 101 | + .zIndex(1000) | ||
| 102 | + .width(this.selfSize.width) | ||
| 103 | + .height(this.selfSize.height) | ||
| 104 | + } | ||
| 105 | + .onAreaChange(() => { | ||
| 106 | + this.updateLayout() | ||
| 107 | + }) | ||
| 108 | + .backgroundColor("#000000") | ||
| 109 | + .justifyContent(FlexAlign.Center) | ||
| 110 | + .height('100%') | ||
| 111 | + .width('100%') | ||
| 112 | + .align(this.videoWidth > this.videoHeight ? Alignment.Top : Alignment.Center) | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + updateLayout() { | ||
| 116 | + let info = componentUtils.getRectangleById(this.insId); | ||
| 117 | + if (info.size.width > 0 && info.size.height > 0 && this.videoHeight > 0 && this.videoWidth > 0) { | ||
| 118 | + if (info.size.width / info.size.height > this.videoWidth / this.videoHeight) { | ||
| 119 | + let scale = info.size.height / this.videoHeight; | ||
| 120 | + this.selfSize = new Size((this.videoWidth * scale / info.size.width) * 100 + "%", '100%'); | ||
| 121 | + } else { | ||
| 122 | + let scale = info.size.width / this.videoWidth; | ||
| 123 | + this.selfSize = new Size('100%', (this.videoHeight * scale / info.size.height) * 100 + "%"); | ||
| 124 | + } | ||
| 125 | + } | ||
| 126 | + } | ||
| 127 | +} |
| @@ -3,6 +3,7 @@ import { WDPlayerController } from '../controller/WDPlayerController' | @@ -3,6 +3,7 @@ import { WDPlayerController } from '../controller/WDPlayerController' | ||
| 3 | import { WindowModel } from 'wdKit'; | 3 | import { WindowModel } from 'wdKit'; |
| 4 | import { Logger } from '../utils/Logger'; | 4 | import { Logger } from '../utils/Logger'; |
| 5 | import { enableAliPlayer } from '../utils/GlobalSetting'; | 5 | import { enableAliPlayer } from '../utils/GlobalSetting'; |
| 6 | +import { WDAliPlayerController } from '../controller/WDAliPlayerController'; | ||
| 6 | 7 | ||
| 7 | class Size { | 8 | class Size { |
| 8 | width: Length = "100%"; | 9 | width: Length = "100%"; |
| @@ -40,7 +41,7 @@ class MGPlayRenderViewIns { | @@ -40,7 +41,7 @@ class MGPlayRenderViewIns { | ||
| 40 | */ | 41 | */ |
| 41 | @Component | 42 | @Component |
| 42 | export struct WDPlayerRenderLiveView { | 43 | export struct WDPlayerRenderLiveView { |
| 43 | - private playerController?: WDPlayerController; | 44 | + private playerController?: WDAliPlayerController; |
| 44 | private xComponentController: XComponentController = new XComponentController(); | 45 | private xComponentController: XComponentController = new XComponentController(); |
| 45 | onLoad?: ((event?: object) => void); | 46 | onLoad?: ((event?: object) => void); |
| 46 | videoWidth: number = 0 | 47 | videoWidth: number = 0 |
| @@ -3,6 +3,7 @@ import { WDPlayerController } from '../controller/WDPlayerController' | @@ -3,6 +3,7 @@ import { WDPlayerController } from '../controller/WDPlayerController' | ||
| 3 | import { WindowModel } from 'wdKit'; | 3 | import { WindowModel } from 'wdKit'; |
| 4 | import { Logger } from '../utils/Logger'; | 4 | import { Logger } from '../utils/Logger'; |
| 5 | import { enableAliPlayer } from '../utils/GlobalSetting'; | 5 | import { enableAliPlayer } from '../utils/GlobalSetting'; |
| 6 | +import { WDAliPlayerController } from '../controller/WDAliPlayerController'; | ||
| 6 | 7 | ||
| 7 | class Size { | 8 | class Size { |
| 8 | width: Length = "100%"; | 9 | width: Length = "100%"; |
| @@ -40,7 +41,7 @@ class MGPlayRenderViewIns { | @@ -40,7 +41,7 @@ class MGPlayRenderViewIns { | ||
| 40 | */ | 41 | */ |
| 41 | @Component | 42 | @Component |
| 42 | export struct WDPlayerRenderVLiveView { | 43 | export struct WDPlayerRenderVLiveView { |
| 43 | - private playerController?: WDPlayerController; | 44 | + private playerController?: WDAliPlayerController; |
| 44 | private xComponentController: XComponentController = new XComponentController(); | 45 | private xComponentController: XComponentController = new XComponentController(); |
| 45 | private insId: string = "WDPlayRenderView" + insIndex; | 46 | private insId: string = "WDPlayRenderView" + insIndex; |
| 46 | onLoad?: ((event?: object) => void); | 47 | onLoad?: ((event?: object) => void); |
| @@ -48,6 +48,7 @@ export struct WDPlayerRenderView { | @@ -48,6 +48,7 @@ export struct WDPlayerRenderView { | ||
| 48 | @State videoHeight: number = 9 | 48 | @State videoHeight: number = 9 |
| 49 | @State videoRatio: number = 16 / 9 | 49 | @State videoRatio: number = 16 / 9 |
| 50 | @State selfSize: Size = new Size('100%', '100%'); | 50 | @State selfSize: Size = new Size('100%', '100%'); |
| 51 | + private enableAliPlayer = false | ||
| 51 | 52 | ||
| 52 | aboutToAppear() { | 53 | aboutToAppear() { |
| 53 | MGPlayRenderViewIns.add(); | 54 | MGPlayRenderViewIns.add(); |
| @@ -78,7 +79,7 @@ export struct WDPlayerRenderView { | @@ -78,7 +79,7 @@ export struct WDPlayerRenderView { | ||
| 78 | XComponent({ | 79 | XComponent({ |
| 79 | id: this.insId, | 80 | id: this.insId, |
| 80 | type: XComponentType.SURFACE, | 81 | type: XComponentType.SURFACE, |
| 81 | - libraryname: enableAliPlayer ? "premierlibrary" : undefined, | 82 | + libraryname: enableAliPlayer && this.enableAliPlayer ? "premierlibrary" : undefined, |
| 82 | controller: this.xComponentController | 83 | controller: this.xComponentController |
| 83 | }) | 84 | }) |
| 84 | .onLoad(async (event) => { | 85 | .onLoad(async (event) => { |
| @@ -87,7 +88,7 @@ export struct WDPlayerRenderView { | @@ -87,7 +88,7 @@ export struct WDPlayerRenderView { | ||
| 87 | surfaceWidth: 1920, | 88 | surfaceWidth: 1920, |
| 88 | surfaceHeight: 1080 | 89 | surfaceHeight: 1080 |
| 89 | }); | 90 | }); |
| 90 | - if (enableAliPlayer) { | 91 | + if (enableAliPlayer && this.enableAliPlayer) { |
| 91 | this.playerController?.setSurfaceId(this.insId) | 92 | this.playerController?.setSurfaceId(this.insId) |
| 92 | } else { | 93 | } else { |
| 93 | this.playerController?.setXComponentController(this.xComponentController) | 94 | this.playerController?.setXComponentController(this.xComponentController) |
| @@ -43,4 +43,4 @@ export function setupPlayerConfig(player: AliPlayer) { | @@ -43,4 +43,4 @@ export function setupPlayerConfig(player: AliPlayer) { | ||
| 43 | * 3、WDAliListPlayerController 暂时由于SDK问题,不能使用 | 43 | * 3、WDAliListPlayerController 暂时由于SDK问题,不能使用 |
| 44 | * 4、 | 44 | * 4、 |
| 45 | * */ | 45 | * */ |
| 46 | -export const enableAliPlayer = false | ||
| 46 | +export const enableAliPlayer = true |
| @@ -97,7 +97,7 @@ export namespace TrackConstants { | @@ -97,7 +97,7 @@ export namespace TrackConstants { | ||
| 97 | 97 | ||
| 98 | /// 设置页 | 98 | /// 设置页 |
| 99 | Setting = "settingPage", | 99 | Setting = "settingPage", |
| 100 | - /// 账号管理 | 100 | + /// 账号管理//账户与安全 |
| 101 | Account_Management = "accountManagementPage", | 101 | Account_Management = "accountManagementPage", |
| 102 | /// 注销账户 | 102 | /// 注销账户 |
| 103 | Cancel_Account = "cancelAccountPage", | 103 | Cancel_Account = "cancelAccountPage", |
| @@ -29,12 +29,15 @@ struct MultiPictureDetailPage { | @@ -29,12 +29,15 @@ struct MultiPictureDetailPage { | ||
| 29 | .backgroundColor(Color.Black) | 29 | .backgroundColor(Color.Black) |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | - pageTransition(){ | ||
| 33 | - // 定义页面进入时的效果,从右边侧滑入 | ||
| 34 | - PageTransitionEnter({ type: RouteType.None, duration: 300 }) | 32 | + pageTransition() { |
| 33 | + // 为目标页面时,进入:从右边侧滑入,退出:是右侧划出;跳转别的页面:左侧划出,返回:左侧划入。 | ||
| 34 | + PageTransitionEnter({ type: RouteType.Push, duration: 300 }) | ||
| 35 | .slide(SlideEffect.Right) | 35 | .slide(SlideEffect.Right) |
| 36 | - // 定义页面退出时的效果,向右边侧滑出 | ||
| 37 | - PageTransitionExit({ type: RouteType.None, duration: 300 }) | 36 | + PageTransitionEnter({ type: RouteType.Pop, duration: 300 }) |
| 37 | + .slide(SlideEffect.Left) | ||
| 38 | + PageTransitionExit({ type: RouteType.Push, duration: 300 }) | ||
| 39 | + .slide(SlideEffect.Left) | ||
| 40 | + PageTransitionExit({ type: RouteType.Pop, duration: 300 }) | ||
| 38 | .slide(SlideEffect.Right) | 41 | .slide(SlideEffect.Right) |
| 39 | } | 42 | } |
| 40 | 43 | ||
| @@ -62,6 +65,17 @@ struct MultiPictureDetailPage { | @@ -62,6 +65,17 @@ struct MultiPictureDetailPage { | ||
| 62 | this.closeFullScreen() | 65 | this.closeFullScreen() |
| 63 | } | 66 | } |
| 64 | 67 | ||
| 68 | + onPageShow(): void { | ||
| 69 | + console.log(TAG, 'onPageShow') | ||
| 70 | + this.openFullScreen() | ||
| 71 | + | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + onPageHide(): void { | ||
| 75 | + console.log(TAG, 'onPageHide') | ||
| 76 | + this.closeFullScreen() | ||
| 77 | + } | ||
| 78 | + | ||
| 65 | /** | 79 | /** |
| 66 | * 开启沉浸式 | 80 | * 开启沉浸式 |
| 67 | * TODO:颜色待根据业务接口修改 | 81 | * TODO:颜色待根据业务接口修改 |
-
Please register or login to post a comment