zhenghy

Merge remote-tracking branch 'origin/main'

Showing 19 changed files with 34 additions and 17 deletions
@@ -4,7 +4,7 @@ import tingyun, { LogLevel } from '@tingyun/harmonyos'; @@ -4,7 +4,7 @@ import tingyun, { LogLevel } from '@tingyun/harmonyos';
4 4
5 export class TingyunAPM { 5 export class TingyunAPM {
6 6
7 - private static TINGYUN_APP_KEY = "" //TODO: 7 + private static TINGYUN_APP_KEY = "ebe0ed7f09f54af681201b784858dde2"
8 private static TINGYUN_REDIRECT_HOST = "wkrt.tingyun.com" 8 private static TINGYUN_REDIRECT_HOST = "wkrt.tingyun.com"
9 9
10 private static logEnable() { 10 private static logEnable() {
@@ -459,7 +459,7 @@ export class HttpUrlUtils { @@ -459,7 +459,7 @@ export class HttpUrlUtils {
459 459
460 /*游客发布评论*/ 460 /*游客发布评论*/
461 static getNoUserPublishCommentUrl() { 461 static getNoUserPublishCommentUrl() {
462 - let url = HttpUrlUtils.getHost() + "/api/rmrb-comment/comment/zh/c/commentLike" 462 + let url = HttpUrlUtils.getHost() + "/api/rmrb-comment/comment/zh/c/visitorPublish"
463 return url 463 return url
464 } 464 }
465 465
@@ -20,14 +20,15 @@ export class HomeChannelUtils { @@ -20,14 +20,15 @@ export class HomeChannelUtils {
20 * @param channelId 频道id【顶导id】 20 * @param channelId 频道id【顶导id】
21 * @param pageId 目标页面id 21 * @param pageId 目标页面id
22 */ 22 */
23 - jumpChannelTab(channelId: string, pageId: string) { 23 + jumpChannelTab(channelId: string, pageId: string, pageName?: string) {
24 // 1、首页所有展示频道遍历,找到目标频道 24 // 1、首页所有展示频道遍历,找到目标频道
25 // 2、频道管理里的,非我的频道所有列表遍历,找到目标频道 【这步去掉,和this.bottomNavData重复了】 25 // 2、频道管理里的,非我的频道所有列表遍历,找到目标频道 【这步去掉,和this.bottomNavData重复了】
26 // 3、一级频道【1、2里找到目标】->【切换底导、切换频道/新增临时频道】 26 // 3、一级频道【1、2里找到目标】->【切换底导、切换频道/新增临时频道】
27 // 4、二级频道【1、2里都没有找到目标】->【跳转栏目页面-ColumnPageComponent】 27 // 4、二级频道【1、2里都没有找到目标】->【跳转栏目页面-ColumnPageComponent】
28 28
29 // 1. 遍历查找目标channel 29 // 1. 遍历查找目标channel
30 - if (this.bottomNavData == null || this.bottomNavData.bottomNavList == null || this.bottomNavData.bottomNavList.length <= 0) { 30 + if (this.bottomNavData == null || this.bottomNavData.bottomNavList == null ||
  31 + this.bottomNavData.bottomNavList.length <= 0) {
31 this.jumpColumn(channelId, pageId) 32 this.jumpColumn(channelId, pageId)
32 return 33 return
33 } 34 }
@@ -51,16 +52,17 @@ export class HomeChannelUtils { @@ -51,16 +52,17 @@ export class HomeChannelUtils {
51 } 52 }
52 } 53 }
53 if (StringUtils.isEmpty(bean.bottomNavId)) { 54 if (StringUtils.isEmpty(bean.bottomNavId)) {
54 - this.jumpColumn(channelId, pageId) 55 + this.jumpColumn(channelId, pageId, pageName)
55 } else { 56 } else {
56 this.jumpHomeChannel(bean) 57 this.jumpHomeChannel(bean)
57 } 58 }
58 } 59 }
59 60
60 - jumpColumn(channelId: string, pageId: string) { 61 + jumpColumn(channelId: string, pageId: string, pageName?: string) {
61 let params: AssignChannelParam = new AssignChannelParam() 62 let params: AssignChannelParam = new AssignChannelParam()
62 params.pageId = pageId 63 params.pageId = pageId
63 params.channelId = channelId 64 params.channelId = channelId
  65 + params.pageName = pageName || ''
64 WDRouterRule.jumpWithPage(WDRouterPage.columnPage, params) 66 WDRouterRule.jumpWithPage(WDRouterPage.columnPage, params)
65 } 67 }
66 68
@@ -77,6 +79,8 @@ export class AssignChannelParam { @@ -77,6 +79,8 @@ export class AssignChannelParam {
77 pageId: string = ''; 79 pageId: string = '';
78 channelId: string = ''; 80 channelId: string = '';
79 bottomNavId: string = ''; 81 bottomNavId: string = '';
  82 + // 跳转专题/二级栏目用到
  83 + pageName: string = ''
80 } 84 }
81 85
82 let homeChannelUtils = new HomeChannelUtils(); 86 let homeChannelUtils = new HomeChannelUtils();
@@ -433,8 +433,8 @@ export class ProcessUtils { @@ -433,8 +433,8 @@ export class ProcessUtils {
433 * 433 *
434 * @param channelId 频道id【顶导id】 434 * @param channelId 频道id【顶导id】
435 */ 435 */
436 - public static jumpChannelTab(channelId: string, pageId: string) {  
437 - HomeChannelUtils.jumpChannelTab(channelId, pageId) 436 + public static jumpChannelTab(channelId: string, pageId: string, pageName?: string) {
  437 + HomeChannelUtils.jumpChannelTab(channelId, pageId, pageName)
438 } 438 }
439 439
440 /** 440 /**
@@ -55,6 +55,7 @@ export struct ENewspaperPageComponent { @@ -55,6 +55,7 @@ export struct ENewspaperPageComponent {
55 alignment: DialogAlignment.Top, 55 alignment: DialogAlignment.Top,
56 offset: { dx: 0, dy: 80 }, 56 offset: { dx: 0, dy: 80 },
57 customStyle: true, 57 customStyle: true,
  58 + maskColor: $r('app.color.color_80000000'),
58 }) 59 })
59 //图片版选择弹框 60 //图片版选择弹框
60 pageDialogController: CustomDialogController = new CustomDialogController({ 61 pageDialogController: CustomDialogController = new CustomDialogController({
@@ -65,6 +66,7 @@ export struct ENewspaperPageComponent { @@ -65,6 +66,7 @@ export struct ENewspaperPageComponent {
65 alignment: DialogAlignment.BottomStart, 66 alignment: DialogAlignment.BottomStart,
66 offset: { dx: 0, dy: -90 }, 67 offset: { dx: 0, dy: -90 },
67 customStyle: true, 68 customStyle: true,
  69 + maskColor: $r('app.color.color_80000000'),
68 }) 70 })
69 //文字报纸弹框 71 //文字报纸弹框
70 @State isOpenListDialog: boolean = false 72 @State isOpenListDialog: boolean = false
@@ -70,7 +70,7 @@ export struct ZhGridLayout03 { @@ -70,7 +70,7 @@ export struct ZhGridLayout03 {
70 .width('100%') 70 .width('100%')
71 .onClick((event: ClickEvent) => { 71 .onClick((event: ClickEvent) => {
72 if (item.objectType === '11') { 72 if (item.objectType === '11') {
73 - ProcessUtils.jumpChannelTab(item.objectId, item.pageId) 73 + ProcessUtils.jumpChannelTab(item.objectId, item.pageId, item.newsTitle)
74 } else { 74 } else {
75 ProcessUtils.processPage(item) 75 ProcessUtils.processPage(item)
76 } 76 }
@@ -81,7 +81,7 @@ export struct ZhSingleRow02 { @@ -81,7 +81,7 @@ export struct ZhSingleRow02 {
81 .visibility(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '' ? Visibility.None : Visibility.Visible) 81 .visibility(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '' ? Visibility.None : Visibility.Visible)
82 .onClick(() => { 82 .onClick(() => {
83 if (this.compDTO?.objectType === '11') { 83 if (this.compDTO?.objectType === '11') {
84 - ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string) 84 + ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle)
85 } else if (this.compDTO?.objectType === '5') { 85 } else if (this.compDTO?.objectType === '5') {
86 ProcessUtils._gotoSpecialTopic(this.compDTO.linkUrl) 86 ProcessUtils._gotoSpecialTopic(this.compDTO.linkUrl)
87 } else if (this.compDTO?.objectType === '6') { 87 } else if (this.compDTO?.objectType === '6') {
@@ -39,7 +39,7 @@ export struct ZhSingleRow04 { @@ -39,7 +39,7 @@ export struct ZhSingleRow04 {
39 .visibility(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '' ? Visibility.None : Visibility.Visible) 39 .visibility(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '' ? Visibility.None : Visibility.Visible)
40 .onClick(() => { 40 .onClick(() => {
41 if (this.compDTO?.objectType === '11') { 41 if (this.compDTO?.objectType === '11') {
42 - ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string) 42 + ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle)
43 } else if (this.compDTO?.objectType === '5') { 43 } else if (this.compDTO?.objectType === '5') {
44 ProcessUtils._gotoSpecialTopic(this.compDTO.linkUrl) 44 ProcessUtils._gotoSpecialTopic(this.compDTO.linkUrl)
45 } else if (this.compDTO?.objectType === '6') { 45 } else if (this.compDTO?.objectType === '6') {
@@ -30,6 +30,7 @@ export struct ENewspaperListDialog { @@ -30,6 +30,7 @@ export struct ENewspaperListDialog {
30 alignment: DialogAlignment.TopStart, 30 alignment: DialogAlignment.TopStart,
31 offset: { dx: 0, dy: 224 }, 31 offset: { dx: 0, dy: 224 },
32 customStyle: true, 32 customStyle: true,
  33 + maskColor: $r('app.color.color_80000000'),
33 }) 34 })
34 //页面半屏弹窗(实现在上个组件)若尝试在CustomDialog中传入多个其他的Controller, 35 //页面半屏弹窗(实现在上个组件)若尝试在CustomDialog中传入多个其他的Controller,
35 // 以实现在CustomDialog中打开另一个或另一些CustomDialog, 36 // 以实现在CustomDialog中打开另一个或另一些CustomDialog,
@@ -9,7 +9,7 @@ const TAG = "HuaweiOneKeyAuth" @@ -9,7 +9,7 @@ const TAG = "HuaweiOneKeyAuth"
9 export default class HuaweiAuth { 9 export default class HuaweiAuth {
10 10
11 // 是否开启 11 // 是否开启
12 - static enable = false 12 + static enable = true
13 // 匿名手机号 13 // 匿名手机号
14 private _anonymousPhone?: string 14 private _anonymousPhone?: string
15 get anonymousPhone() { 15 get anonymousPhone() {
@@ -86,9 +86,19 @@ export default class HuaweiAuth { @@ -86,9 +86,19 @@ export default class HuaweiAuth {
86 // 返回结果为 Authorization Code 86 // 返回结果为 Authorization Code
87 oneKeyLogin() : Promise<string> { 87 oneKeyLogin() : Promise<string> {
88 88
89 - let loginRequest = new authentication.HuaweiIDProvider().createLoginWithHuaweiIDRequest();  
90 - // 当用户未登录华为帐号时,是否强制拉起华为帐号登录界面  
91 - loginRequest.forceLogin = true; 89 + // let loginRequest = new authentication.HuaweiIDProvider().createLoginWithHuaweiIDRequest();
  90 + // // 当用户未登录华为帐号时,是否强制拉起华为帐号登录界面
  91 + // loginRequest.forceLogin = true;
  92 + // loginRequest.state = util.generateRandomUUID();
  93 +
  94 + // 创建授权请求,并设置参数
  95 + let loginRequest = new authentication.HuaweiIDProvider().createAuthorizationWithHuaweiIDRequest();
  96 + // 获取头像昵称需要传如下scope
  97 + loginRequest.scopes = ['profile', 'phone'];
  98 + // 若开发者需要进行服务端开发,则需传如下permission获取authorizationCode
  99 + loginRequest.permissions = ['serviceauthcode'];
  100 + // 用户是否需要登录授权,该值为true且用户未登录或未授权时,会拉起用户登录或授权页面
  101 + loginRequest.forceAuthorization = true;
92 loginRequest.state = util.generateRandomUUID(); 102 loginRequest.state = util.generateRandomUUID();
93 103
94 return new Promise((resolve, fail) => { 104 return new Promise((resolve, fail) => {
@@ -107,8 +107,8 @@ export class StartupManager { @@ -107,8 +107,8 @@ export class StartupManager {
107 107
108 private initTingyun() { 108 private initTingyun() {
109 // 暂时不能用,不初始化 109 // 暂时不能用,不初始化
110 - // Logger.debug(TAG, "App tingyunAPM 初始化")  
111 - // TingyunAPM.initApp(this.context!, DeviceUtil.clientId()) 110 + Logger.debug(TAG, "App tingyunAPM 初始化")
  111 + TingyunAPM.initApp(this.context!, DeviceUtil.clientId())
112 } 112 }
113 113
114 private initSensorData() { 114 private initSensorData() {