Showing
8 changed files
with
47 additions
and
45 deletions
| @@ -29,6 +29,8 @@ export struct WdWebComponent { | @@ -29,6 +29,8 @@ export struct WdWebComponent { | ||
| 29 | .mixedMode(MixedMode.All) | 29 | .mixedMode(MixedMode.All) |
| 30 | .onlineImageAccess(true) | 30 | .onlineImageAccess(true) |
| 31 | .enableNativeEmbedMode(true) | 31 | .enableNativeEmbedMode(true) |
| 32 | + .horizontalScrollBarAccess(false) | ||
| 33 | + .verticalScrollBarAccess(false) | ||
| 32 | .onPageBegin((event) => { | 34 | .onPageBegin((event) => { |
| 33 | this.onPageBegin(event?.url); | 35 | this.onPageBegin(event?.url); |
| 34 | }) | 36 | }) |
| 1 | import { Action, H5ReceiveDetailBean, ContentDetailDTO, InteractDataDTO } from 'wdBean'; | 1 | import { Action, H5ReceiveDetailBean, ContentDetailDTO, InteractDataDTO } from 'wdBean'; |
| 2 | import { WdWebComponent } from 'wdWebComponent'; | 2 | import { WdWebComponent } from 'wdWebComponent'; |
| 3 | -import router from '@ohos.router'; | ||
| 4 | import { CommonConstants } from 'wdConstant' | 3 | import { CommonConstants } from 'wdConstant' |
| 5 | import { BridgeWebViewControl } from 'wdJsBridge/Index'; | 4 | import { BridgeWebViewControl } from 'wdJsBridge/Index'; |
| 6 | -import { detailedSkeleton } from './skeleton/detailSkeleton' | ||
| 7 | import { NativeCallH5Type } from 'wdWebComponent/src/main/ets/pages/NativeCallH5Type'; | 5 | import { NativeCallH5Type } from 'wdWebComponent/src/main/ets/pages/NativeCallH5Type'; |
| 8 | import { OperRowListView } from './view/OperRowListView'; | 6 | import { OperRowListView } from './view/OperRowListView'; |
| 9 | import DetailViewModel from '../viewmodel/DetailViewModel'; | 7 | import DetailViewModel from '../viewmodel/DetailViewModel'; |
| @@ -15,6 +13,7 @@ import { common } from '@kit.AbilityKit'; | @@ -15,6 +13,7 @@ import { common } from '@kit.AbilityKit'; | ||
| 15 | import { PageRepository } from '../repository/PageRepository'; | 13 | import { PageRepository } from '../repository/PageRepository'; |
| 16 | import { CommentDialogView } from './CommentDialogView'; | 14 | import { CommentDialogView } from './CommentDialogView'; |
| 17 | import { faceDetector } from '@kit.CoreVisionKit'; | 15 | import { faceDetector } from '@kit.CoreVisionKit'; |
| 16 | +import { channelSkeleton } from './skeleton/channelSkeleton'; | ||
| 18 | 17 | ||
| 19 | const TAG: string = 'SpacialTopicPageComponent' | 18 | const TAG: string = 'SpacialTopicPageComponent' |
| 20 | 19 | ||
| @@ -117,7 +116,7 @@ export struct SpacialTopicPageComponent { | @@ -117,7 +116,7 @@ export struct SpacialTopicPageComponent { | ||
| 117 | let pageId = this.action.params.extra?.pageId | 116 | let pageId = this.action.params.extra?.pageId |
| 118 | console.log('pageIdpageId',pageId) | 117 | console.log('pageIdpageId',pageId) |
| 119 | if(pageId){ | 118 | if(pageId){ |
| 120 | - let pageInfoMsg = await PageRepository.fetchMorningEveningPageInfo(pageId) | 119 | + let pageInfoMsg = await PageRepository.fetchMorningEveningPageInfo(pageId,contentId) |
| 121 | let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType) | 120 | let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType) |
| 122 | if (detailBeans?.length > 0) { | 121 | if (detailBeans?.length > 0) { |
| 123 | this.contentDetailData = JSON.parse(JSON.stringify(detailBeans[0])); | 122 | this.contentDetailData = JSON.parse(JSON.stringify(detailBeans[0])); |
| @@ -192,7 +191,7 @@ export struct SpacialTopicPageComponent { | @@ -192,7 +191,7 @@ export struct SpacialTopicPageComponent { | ||
| 192 | }).padding({ bottom: 200 }) | 191 | }).padding({ bottom: 200 }) |
| 193 | } else { | 192 | } else { |
| 194 | if (!this.isPageEnd) { | 193 | if (!this.isPageEnd) { |
| 195 | - detailedSkeleton().padding({ top:`${this.topSafeHeight}px`,bottom: this.bottomSafeHeight }) | 194 | + channelSkeleton().padding({ top:`${this.topSafeHeight}px`,bottom: this.bottomSafeHeight }) |
| 196 | } | 195 | } |
| 197 | } | 196 | } |
| 198 | //底部交互区 | 197 | //底部交互区 |
| @@ -585,19 +585,14 @@ export struct TopNavigationComponentNew { | @@ -585,19 +585,14 @@ export struct TopNavigationComponentNew { | ||
| 585 | clickMorningEveningPaper() { | 585 | clickMorningEveningPaper() { |
| 586 | 586 | ||
| 587 | // 早晚报埋点 | 587 | // 早晚报埋点 |
| 588 | - const params: ParamType = { | ||
| 589 | - "pageName": this.pageName, | ||
| 590 | - "pageId": this.pageId, | ||
| 591 | - } | ||
| 592 | - Tracking.event("morning_evening_news_click", params) | 588 | + TrackingButton.click('morning_evening_news_click', TrackConstants.SummaryType.MorningAndEveningNews, |
| 589 | + TrackConstants.SummaryType.MorningAndEveningNews) | ||
| 593 | 590 | ||
| 594 | if (NetworkUtil.isNetConnected()) { | 591 | if (NetworkUtil.isNetConnected()) { |
| 595 | DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => { | 592 | DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => { |
| 596 | if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) { | 593 | if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) { |
| 597 | SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id); | 594 | SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id); |
| 598 | ProcessUtils.gotoMorningEveningPaper() | 595 | ProcessUtils.gotoMorningEveningPaper() |
| 599 | - TrackingButton.click('morning_evening_news_click', TrackConstants.SummaryType.MorningAndEveningNews, | ||
| 600 | - TrackConstants.SummaryType.MorningAndEveningNews) | ||
| 601 | } else { | 596 | } else { |
| 602 | ToastUtils.showToast('暂无早晚报信息', 1000) | 597 | ToastUtils.showToast('暂无早晚报信息', 1000) |
| 603 | } | 598 | } |
| @@ -192,9 +192,12 @@ export class PageRepository { | @@ -192,9 +192,12 @@ export class PageRepository { | ||
| 192 | /** | 192 | /** |
| 193 | * 早晚报pageInfo请求 | 193 | * 早晚报pageInfo请求 |
| 194 | * */ | 194 | * */ |
| 195 | - static getMorningEveningPageInfoUrl(pageId: string) { | 195 | + static getMorningEveningPageInfoUrl(pageId: string,topicId:string) { |
| 196 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.PAGE_INFO_PATH; | 196 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.PAGE_INFO_PATH; |
| 197 | url = url + "?pageId=" + pageId; | 197 | url = url + "?pageId=" + pageId; |
| 198 | + if(!StringUtils.isEmpty(topicId)){ | ||
| 199 | + url = url+ "&topicId=" + topicId; | ||
| 200 | + } | ||
| 198 | Logger.info(TAG, "getMorningEveningPageInfoUrl url = " + url) | 201 | Logger.info(TAG, "getMorningEveningPageInfoUrl url = " + url) |
| 199 | return url; | 202 | return url; |
| 200 | } | 203 | } |
| @@ -392,8 +395,8 @@ export class PageRepository { | @@ -392,8 +395,8 @@ export class PageRepository { | ||
| 392 | /** | 395 | /** |
| 393 | * 获取早晚报pageInfo | 396 | * 获取早晚报pageInfo |
| 394 | * */ | 397 | * */ |
| 395 | - static fetchMorningEveningPageInfo(pageId: string) { | ||
| 396 | - let url = PageRepository.getMorningEveningPageInfoUrl(pageId) | 398 | + static fetchMorningEveningPageInfo(pageId: string,topicId:string) { |
| 399 | + let url = PageRepository.getMorningEveningPageInfoUrl(pageId,topicId) | ||
| 397 | return WDHttp.get<ResponseDTO<PageInfoBean>>(url) | 400 | return WDHttp.get<ResponseDTO<PageInfoBean>>(url) |
| 398 | }; | 401 | }; |
| 399 | 402 | ||
| @@ -418,7 +421,7 @@ export class PageRepository { | @@ -418,7 +421,7 @@ export class PageRepository { | ||
| 418 | * 获取播报pageInfo | 421 | * 获取播报pageInfo |
| 419 | * */ | 422 | * */ |
| 420 | static fetchBroadcastPageInfo(pageId: string) { | 423 | static fetchBroadcastPageInfo(pageId: string) { |
| 421 | - let url = PageRepository.getMorningEveningPageInfoUrl(pageId) | 424 | + let url = PageRepository.getMorningEveningPageInfoUrl(pageId,'') |
| 422 | return WDHttp.get<ResponseDTO<PageInfoBean>>(url) | 425 | return WDHttp.get<ResponseDTO<PageInfoBean>>(url) |
| 423 | }; | 426 | }; |
| 424 | 427 |
| @@ -9,7 +9,7 @@ export class BroadcastViewModel { | @@ -9,7 +9,7 @@ export class BroadcastViewModel { | ||
| 9 | static async getBroadcastViewPageInfo(pageId: string): Promise<PageInfoBean> { | 9 | static async getBroadcastViewPageInfo(pageId: string): Promise<PageInfoBean> { |
| 10 | return new Promise<PageInfoBean>((success, error) => { | 10 | return new Promise<PageInfoBean>((success, error) => { |
| 11 | Logger.info(TAG, `getBroadcastViewPageInfo pageInfo start`); | 11 | Logger.info(TAG, `getBroadcastViewPageInfo pageInfo start`); |
| 12 | - PageRepository.fetchMorningEveningPageInfo(pageId).then((resDTO: ResponseDTO<PageInfoBean>) => { | 12 | + PageRepository.fetchMorningEveningPageInfo(pageId,'').then((resDTO: ResponseDTO<PageInfoBean>) => { |
| 13 | if (!resDTO || !resDTO.data) { | 13 | if (!resDTO || !resDTO.data) { |
| 14 | Logger.error(TAG, 'getBroadcastViewPageInfo then navResDTO is empty'); | 14 | Logger.error(TAG, 'getBroadcastViewPageInfo then navResDTO is empty'); |
| 15 | error('resDTO is empty'); | 15 | error('resDTO is empty'); |
| @@ -36,7 +36,7 @@ export class MorningEveningViewModel { | @@ -36,7 +36,7 @@ export class MorningEveningViewModel { | ||
| 36 | static async getMorningEveningPageInfo(pageId: string): Promise<PageInfoBean> { | 36 | static async getMorningEveningPageInfo(pageId: string): Promise<PageInfoBean> { |
| 37 | return new Promise<PageInfoBean>((success, error) => { | 37 | return new Promise<PageInfoBean>((success, error) => { |
| 38 | Logger.info(TAG, `getMorningEveningPageInfo pageInfo start`); | 38 | Logger.info(TAG, `getMorningEveningPageInfo pageInfo start`); |
| 39 | - PageRepository.fetchMorningEveningPageInfo(pageId).then((resDTO: ResponseDTO<PageInfoBean>) => { | 39 | + PageRepository.fetchMorningEveningPageInfo(pageId,'').then((resDTO: ResponseDTO<PageInfoBean>) => { |
| 40 | if (!resDTO || !resDTO.data) { | 40 | if (!resDTO || !resDTO.data) { |
| 41 | Logger.error(TAG, 'getMorningEveningPageInfo then navResDTO is empty'); | 41 | Logger.error(TAG, 'getMorningEveningPageInfo then navResDTO is empty'); |
| 42 | error('resDTO is empty'); | 42 | error('resDTO is empty'); |
| @@ -50,7 +50,7 @@ struct OneKeyLoginPage { | @@ -50,7 +50,7 @@ struct OneKeyLoginPage { | ||
| 50 | // 获取到Authorization Code | 50 | // 获取到Authorization Code |
| 51 | let authorizationCode = response.authorizationCode; | 51 | let authorizationCode = response.authorizationCode; |
| 52 | // hilog.info(0x0000, 'testTag', 'response: %{public}s', JSON.stringify(response)); | 52 | // hilog.info(0x0000, 'testTag', 'response: %{public}s', JSON.stringify(response)); |
| 53 | - TrackingButton.click("oneClickLoginPageLoginButton", this.pageName, this.pageName) | 53 | + TrackingButton.click("oneClickLoginPageLoginButton", TrackConstants.PageName.OneClick_Login, TrackConstants.PageName.OneClick_Login) |
| 54 | this.requestLogin() | 54 | this.requestLogin() |
| 55 | return; | 55 | return; |
| 56 | } | 56 | } |
| @@ -58,7 +58,6 @@ struct OneKeyLoginPage { | @@ -58,7 +58,6 @@ struct OneKeyLoginPage { | ||
| 58 | 58 | ||
| 59 | // 埋点计算页面浏览时长 | 59 | // 埋点计算页面浏览时长 |
| 60 | private pageStartDate: number = 0 | 60 | private pageStartDate: number = 0 |
| 61 | - private pageName = TrackConstants.PageName.OneClick_Login | ||
| 62 | 61 | ||
| 63 | aboutToAppear(): void { | 62 | aboutToAppear(): void { |
| 64 | this.anonymousPhone = HuaweiAuth.sharedInstance().anonymousPhone||"" | 63 | this.anonymousPhone = HuaweiAuth.sharedInstance().anonymousPhone||"" |
| @@ -70,7 +69,7 @@ struct OneKeyLoginPage { | @@ -70,7 +69,7 @@ struct OneKeyLoginPage { | ||
| 70 | 69 | ||
| 71 | onPageHide(): void { | 70 | onPageHide(): void { |
| 72 | const duration = Math.floor((Date.now() - this.pageStartDate!)/1000) | 71 | const duration = Math.floor((Date.now() - this.pageStartDate!)/1000) |
| 73 | - TrackingPageBrowse.trackCommonPageExposureEnd(this.pageName, this.pageName, duration) | 72 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.OneClick_Login, TrackConstants.PageName.OneClick_Login, duration) |
| 74 | } | 73 | } |
| 75 | 74 | ||
| 76 | // pageTransition() { | 75 | // pageTransition() { |
| @@ -161,7 +160,7 @@ struct OneKeyLoginPage { | @@ -161,7 +160,7 @@ struct OneKeyLoginPage { | ||
| 161 | Row() { | 160 | Row() { |
| 162 | Image($r("app.media.huawei_one_key_login_icon")) | 161 | Image($r("app.media.huawei_one_key_login_icon")) |
| 163 | .width(24).height(24) | 162 | .width(24).height(24) |
| 164 | - Text("华为账号一键登录") | 163 | + Text("华为账号快速登录") |
| 165 | .fontColor(Color.White) | 164 | .fontColor(Color.White) |
| 166 | .margin({left:5}) | 165 | .margin({left:5}) |
| 167 | } | 166 | } |
| @@ -171,30 +170,34 @@ struct OneKeyLoginPage { | @@ -171,30 +170,34 @@ struct OneKeyLoginPage { | ||
| 171 | .borderRadius(4) | 170 | .borderRadius(4) |
| 172 | .type(ButtonType.Normal) | 171 | .type(ButtonType.Normal) |
| 173 | .backgroundColor("#ED2800") | 172 | .backgroundColor("#ED2800") |
| 173 | + .onClick(() => { | ||
| 174 | 174 | ||
| 175 | - Stack(){ | ||
| 176 | - //目前不支持文字和图标同时展示,后面优化 | ||
| 177 | - LoginWithHuaweiIDButton({ | ||
| 178 | - params: { | ||
| 179 | - // LoginWithHuaweiIDButton支持的样式。 | ||
| 180 | - style: loginComponentManager.Style.BUTTON_CUSTOM, | ||
| 181 | - // LoginWithHuaweiIDButton的边框圆角半径。 | ||
| 182 | - // borderRadius: 4, | ||
| 183 | - // LoginWithHuaweiIDButton支持的登录类型。 | ||
| 184 | - loginType: loginComponentManager.LoginType.QUICK_LOGIN, | ||
| 185 | - // LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。 | ||
| 186 | - // supportDarkMode: true, | ||
| 187 | - customButtonParams: { | ||
| 188 | - fontColor: loginComponentManager.FontColor.WHITE, | ||
| 189 | - // backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800" | ||
| 190 | - backgroundColor:"#ED2800" | ||
| 191 | - } | ||
| 192 | - }, | ||
| 193 | - controller: this.controller | ||
| 194 | - }).opacity(0) | ||
| 195 | - } | ||
| 196 | - .width('100%') | ||
| 197 | - .height('100%') | 175 | + this.requestLogin() |
| 176 | + }) | ||
| 177 | + | ||
| 178 | + // Stack(){ | ||
| 179 | + // //目前不支持文字和图标同时展示,后面优化 | ||
| 180 | + // LoginWithHuaweiIDButton({ | ||
| 181 | + // params: { | ||
| 182 | + // // LoginWithHuaweiIDButton支持的样式。 | ||
| 183 | + // style: loginComponentManager.Style.BUTTON_CUSTOM, | ||
| 184 | + // // LoginWithHuaweiIDButton的边框圆角半径。 | ||
| 185 | + // // borderRadius: 4, | ||
| 186 | + // // LoginWithHuaweiIDButton支持的登录类型。 | ||
| 187 | + // loginType: loginComponentManager.LoginType.QUICK_LOGIN, | ||
| 188 | + // // LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。 | ||
| 189 | + // // supportDarkMode: true, | ||
| 190 | + // customButtonParams: { | ||
| 191 | + // fontColor: loginComponentManager.FontColor.WHITE, | ||
| 192 | + // // backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800" | ||
| 193 | + // backgroundColor:"#ED2800" | ||
| 194 | + // } | ||
| 195 | + // }, | ||
| 196 | + // controller: this.controller | ||
| 197 | + // }).opacity(0) | ||
| 198 | + // } | ||
| 199 | + // .width('100%') | ||
| 200 | + // .height('100%') | ||
| 198 | } | 201 | } |
| 199 | } | 202 | } |
| 200 | .height(48) | 203 | .height(48) |
| @@ -94,7 +94,7 @@ export default class HuaweiAuth { | @@ -94,7 +94,7 @@ export default class HuaweiAuth { | ||
| 94 | // 创建授权请求,并设置参数 | 94 | // 创建授权请求,并设置参数 |
| 95 | let loginRequest = new authentication.HuaweiIDProvider().createAuthorizationWithHuaweiIDRequest(); | 95 | let loginRequest = new authentication.HuaweiIDProvider().createAuthorizationWithHuaweiIDRequest(); |
| 96 | // 获取头像昵称需要传如下scope | 96 | // 获取头像昵称需要传如下scope |
| 97 | - loginRequest.scopes = ['profile']; //, 'phone' | 97 | + loginRequest.scopes = ['profile', 'phone']; //, 'phone' |
| 98 | // 若开发者需要进行服务端开发,则需传如下permission获取authorizationCode | 98 | // 若开发者需要进行服务端开发,则需传如下permission获取authorizationCode |
| 99 | loginRequest.permissions = ['serviceauthcode']; | 99 | loginRequest.permissions = ['serviceauthcode']; |
| 100 | // 用户是否需要登录授权,该值为true且用户未登录或未授权时,会拉起用户登录或授权页面 | 100 | // 用户是否需要登录授权,该值为true且用户未登录或未授权时,会拉起用户登录或授权页面 |
-
Please register or login to post a comment