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';
export class TingyunAPM {
private static TINGYUN_APP_KEY = "" //TODO:
private static TINGYUN_APP_KEY = "ebe0ed7f09f54af681201b784858dde2"
private static TINGYUN_REDIRECT_HOST = "wkrt.tingyun.com"
private static logEnable() {
... ...
... ... @@ -459,7 +459,7 @@ export class HttpUrlUtils {
/*游客发布评论*/
static getNoUserPublishCommentUrl() {
let url = HttpUrlUtils.getHost() + "/api/rmrb-comment/comment/zh/c/commentLike"
let url = HttpUrlUtils.getHost() + "/api/rmrb-comment/comment/zh/c/visitorPublish"
return url
}
... ...
... ... @@ -20,14 +20,15 @@ export class HomeChannelUtils {
* @param channelId 频道id【顶导id】
* @param pageId 目标页面id
*/
jumpChannelTab(channelId: string, pageId: string) {
jumpChannelTab(channelId: string, pageId: string, pageName?: string) {
// 1、首页所有展示频道遍历,找到目标频道
// 2、频道管理里的,非我的频道所有列表遍历,找到目标频道 【这步去掉,和this.bottomNavData重复了】
// 3、一级频道【1、2里找到目标】->【切换底导、切换频道/新增临时频道】
// 4、二级频道【1、2里都没有找到目标】->【跳转栏目页面-ColumnPageComponent】
// 1. 遍历查找目标channel
if (this.bottomNavData == null || this.bottomNavData.bottomNavList == null || this.bottomNavData.bottomNavList.length <= 0) {
if (this.bottomNavData == null || this.bottomNavData.bottomNavList == null ||
this.bottomNavData.bottomNavList.length <= 0) {
this.jumpColumn(channelId, pageId)
return
}
... ... @@ -51,16 +52,17 @@ export class HomeChannelUtils {
}
}
if (StringUtils.isEmpty(bean.bottomNavId)) {
this.jumpColumn(channelId, pageId)
this.jumpColumn(channelId, pageId, pageName)
} else {
this.jumpHomeChannel(bean)
}
}
jumpColumn(channelId: string, pageId: string) {
jumpColumn(channelId: string, pageId: string, pageName?: string) {
let params: AssignChannelParam = new AssignChannelParam()
params.pageId = pageId
params.channelId = channelId
params.pageName = pageName || ''
WDRouterRule.jumpWithPage(WDRouterPage.columnPage, params)
}
... ... @@ -77,6 +79,8 @@ export class AssignChannelParam {
pageId: string = '';
channelId: string = '';
bottomNavId: string = '';
// 跳转专题/二级栏目用到
pageName: string = ''
}
let homeChannelUtils = new HomeChannelUtils();
... ...
... ... @@ -433,8 +433,8 @@ export class ProcessUtils {
*
* @param channelId 频道id【顶导id】
*/
public static jumpChannelTab(channelId: string, pageId: string) {
HomeChannelUtils.jumpChannelTab(channelId, pageId)
public static jumpChannelTab(channelId: string, pageId: string, pageName?: string) {
HomeChannelUtils.jumpChannelTab(channelId, pageId, pageName)
}
/**
... ...
... ... @@ -55,6 +55,7 @@ export struct ENewspaperPageComponent {
alignment: DialogAlignment.Top,
offset: { dx: 0, dy: 80 },
customStyle: true,
maskColor: $r('app.color.color_80000000'),
})
//图片版选择弹框
pageDialogController: CustomDialogController = new CustomDialogController({
... ... @@ -65,6 +66,7 @@ export struct ENewspaperPageComponent {
alignment: DialogAlignment.BottomStart,
offset: { dx: 0, dy: -90 },
customStyle: true,
maskColor: $r('app.color.color_80000000'),
})
//文字报纸弹框
@State isOpenListDialog: boolean = false
... ...
... ... @@ -70,7 +70,7 @@ export struct ZhGridLayout03 {
.width('100%')
.onClick((event: ClickEvent) => {
if (item.objectType === '11') {
ProcessUtils.jumpChannelTab(item.objectId, item.pageId)
ProcessUtils.jumpChannelTab(item.objectId, item.pageId, item.newsTitle)
} else {
ProcessUtils.processPage(item)
}
... ...
... ... @@ -81,7 +81,7 @@ export struct ZhSingleRow02 {
.visibility(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '' ? Visibility.None : Visibility.Visible)
.onClick(() => {
if (this.compDTO?.objectType === '11') {
ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string)
ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle)
} else if (this.compDTO?.objectType === '5') {
ProcessUtils._gotoSpecialTopic(this.compDTO.linkUrl)
} else if (this.compDTO?.objectType === '6') {
... ...
... ... @@ -39,7 +39,7 @@ export struct ZhSingleRow04 {
.visibility(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '' ? Visibility.None : Visibility.Visible)
.onClick(() => {
if (this.compDTO?.objectType === '11') {
ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string)
ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle)
} else if (this.compDTO?.objectType === '5') {
ProcessUtils._gotoSpecialTopic(this.compDTO.linkUrl)
} else if (this.compDTO?.objectType === '6') {
... ...
... ... @@ -30,6 +30,7 @@ export struct ENewspaperListDialog {
alignment: DialogAlignment.TopStart,
offset: { dx: 0, dy: 224 },
customStyle: true,
maskColor: $r('app.color.color_80000000'),
})
//页面半屏弹窗(实现在上个组件)若尝试在CustomDialog中传入多个其他的Controller,
// 以实现在CustomDialog中打开另一个或另一些CustomDialog,
... ...
... ... @@ -9,7 +9,7 @@ const TAG = "HuaweiOneKeyAuth"
export default class HuaweiAuth {
// 是否开启
static enable = false
static enable = true
// 匿名手机号
private _anonymousPhone?: string
get anonymousPhone() {
... ... @@ -86,9 +86,19 @@ export default class HuaweiAuth {
// 返回结果为 Authorization Code
oneKeyLogin() : Promise<string> {
let loginRequest = new authentication.HuaweiIDProvider().createLoginWithHuaweiIDRequest();
// 当用户未登录华为帐号时,是否强制拉起华为帐号登录界面
loginRequest.forceLogin = true;
// let loginRequest = new authentication.HuaweiIDProvider().createLoginWithHuaweiIDRequest();
// // 当用户未登录华为帐号时,是否强制拉起华为帐号登录界面
// loginRequest.forceLogin = true;
// loginRequest.state = util.generateRandomUUID();
// 创建授权请求,并设置参数
let loginRequest = new authentication.HuaweiIDProvider().createAuthorizationWithHuaweiIDRequest();
// 获取头像昵称需要传如下scope
loginRequest.scopes = ['profile', 'phone'];
// 若开发者需要进行服务端开发,则需传如下permission获取authorizationCode
loginRequest.permissions = ['serviceauthcode'];
// 用户是否需要登录授权,该值为true且用户未登录或未授权时,会拉起用户登录或授权页面
loginRequest.forceAuthorization = true;
loginRequest.state = util.generateRandomUUID();
return new Promise((resolve, fail) => {
... ...
... ... @@ -107,8 +107,8 @@ export class StartupManager {
private initTingyun() {
// 暂时不能用,不初始化
// Logger.debug(TAG, "App tingyunAPM 初始化")
// TingyunAPM.initApp(this.context!, DeviceUtil.clientId())
Logger.debug(TAG, "App tingyunAPM 初始化")
TingyunAPM.initApp(this.context!, DeviceUtil.clientId())
}
private initSensorData() {
... ...