Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
liyubing
2024-06-19 09:37:14 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
fc86424849d813af63ee132ee6831e6f6fd6ac01
fc864248
2 parents
88022f2d
fd2b47c3
Merge remote-tracking branch 'origin/main'
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
47 additions
and
45 deletions
sight_harmony/commons/wdWebComponent/src/main/ets/pages/WdWebComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/SpacialTopicPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
sight_harmony/features/wdComponent/src/main/ets/repository/PageRepository.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/BroadcastViewModel.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/MorningEveningViewModel.ets
sight_harmony/features/wdLogin/src/main/ets/pages/login/OneKeyLoginPage.ets
sight_harmony/features/wdLogin/src/main/ets/utils/HuaweiAuth.ets
sight_harmony/commons/wdWebComponent/src/main/ets/pages/WdWebComponent.ets
View file @
fc86424
...
...
@@ -29,6 +29,8 @@ export struct WdWebComponent {
.mixedMode(MixedMode.All)
.onlineImageAccess(true)
.enableNativeEmbedMode(true)
.horizontalScrollBarAccess(false)
.verticalScrollBarAccess(false)
.onPageBegin((event) => {
this.onPageBegin(event?.url);
})
...
...
sight_harmony/features/wdComponent/src/main/ets/components/SpacialTopicPageComponent.ets
View file @
fc86424
import { Action, H5ReceiveDetailBean, ContentDetailDTO, InteractDataDTO } from 'wdBean';
import { WdWebComponent } from 'wdWebComponent';
import router from '@ohos.router';
import { CommonConstants } from 'wdConstant'
import { BridgeWebViewControl } from 'wdJsBridge/Index';
import { detailedSkeleton } from './skeleton/detailSkeleton'
import { NativeCallH5Type } from 'wdWebComponent/src/main/ets/pages/NativeCallH5Type';
import { OperRowListView } from './view/OperRowListView';
import DetailViewModel from '../viewmodel/DetailViewModel';
...
...
@@ -15,6 +13,7 @@ import { common } from '@kit.AbilityKit';
import { PageRepository } from '../repository/PageRepository';
import { CommentDialogView } from './CommentDialogView';
import { faceDetector } from '@kit.CoreVisionKit';
import { channelSkeleton } from './skeleton/channelSkeleton';
const TAG: string = 'SpacialTopicPageComponent'
...
...
@@ -117,7 +116,7 @@ export struct SpacialTopicPageComponent {
let pageId = this.action.params.extra?.pageId
console.log('pageIdpageId',pageId)
if(pageId){
let pageInfoMsg = await PageRepository.fetchMorningEveningPageInfo(pageId)
let pageInfoMsg = await PageRepository.fetchMorningEveningPageInfo(pageId
,contentId
)
let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType)
if (detailBeans?.length > 0) {
this.contentDetailData = JSON.parse(JSON.stringify(detailBeans[0]));
...
...
@@ -192,7 +191,7 @@ export struct SpacialTopicPageComponent {
}).padding({ bottom: 200 })
} else {
if (!this.isPageEnd) {
detailed
Skeleton().padding({ top:`${this.topSafeHeight}px`,bottom: this.bottomSafeHeight })
channel
Skeleton().padding({ top:`${this.topSafeHeight}px`,bottom: this.bottomSafeHeight })
}
}
//底部交互区
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
View file @
fc86424
...
...
@@ -585,19 +585,14 @@ export struct TopNavigationComponentNew {
clickMorningEveningPaper() {
// 早晚报埋点
const params: ParamType = {
"pageName": this.pageName,
"pageId": this.pageId,
}
Tracking.event("morning_evening_news_click", params)
TrackingButton.click('morning_evening_news_click', TrackConstants.SummaryType.MorningAndEveningNews,
TrackConstants.SummaryType.MorningAndEveningNews)
if (NetworkUtil.isNetConnected()) {
DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => {
if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) {
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id);
ProcessUtils.gotoMorningEveningPaper()
TrackingButton.click('morning_evening_news_click', TrackConstants.SummaryType.MorningAndEveningNews,
TrackConstants.SummaryType.MorningAndEveningNews)
} else {
ToastUtils.showToast('暂无早晚报信息', 1000)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/repository/PageRepository.ets
View file @
fc86424
...
...
@@ -192,9 +192,12 @@ export class PageRepository {
/**
* 早晚报pageInfo请求
* */
static getMorningEveningPageInfoUrl(pageId: string) {
static getMorningEveningPageInfoUrl(pageId: string
,topicId:string
) {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.PAGE_INFO_PATH;
url = url + "?pageId=" + pageId;
if(!StringUtils.isEmpty(topicId)){
url = url+ "&topicId=" + topicId;
}
Logger.info(TAG, "getMorningEveningPageInfoUrl url = " + url)
return url;
}
...
...
@@ -392,8 +395,8 @@ export class PageRepository {
/**
* 获取早晚报pageInfo
* */
static fetchMorningEveningPageInfo(pageId: string) {
let url = PageRepository.getMorningEveningPageInfoUrl(pageId)
static fetchMorningEveningPageInfo(pageId: string,topicId:string) {
let url = PageRepository.getMorningEveningPageInfoUrl(pageId,topicId)
return WDHttp.get<ResponseDTO<PageInfoBean>>(url)
};
...
...
@@ -418,7 +421,7 @@ export class PageRepository {
* 获取播报pageInfo
* */
static fetchBroadcastPageInfo(pageId: string) {
let url = PageRepository.getMorningEveningPageInfoUrl(pageId)
let url = PageRepository.getMorningEveningPageInfoUrl(pageId
,''
)
return WDHttp.get<ResponseDTO<PageInfoBean>>(url)
};
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/BroadcastViewModel.ets
View file @
fc86424
...
...
@@ -9,7 +9,7 @@ export class BroadcastViewModel {
static async getBroadcastViewPageInfo(pageId: string): Promise<PageInfoBean> {
return new Promise<PageInfoBean>((success, error) => {
Logger.info(TAG, `getBroadcastViewPageInfo pageInfo start`);
PageRepository.fetchMorningEveningPageInfo(pageId).then((resDTO: ResponseDTO<PageInfoBean>) => {
PageRepository.fetchMorningEveningPageInfo(pageId
,''
).then((resDTO: ResponseDTO<PageInfoBean>) => {
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'getBroadcastViewPageInfo then navResDTO is empty');
error('resDTO is empty');
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/MorningEveningViewModel.ets
View file @
fc86424
...
...
@@ -36,7 +36,7 @@ export class MorningEveningViewModel {
static async getMorningEveningPageInfo(pageId: string): Promise<PageInfoBean> {
return new Promise<PageInfoBean>((success, error) => {
Logger.info(TAG, `getMorningEveningPageInfo pageInfo start`);
PageRepository.fetchMorningEveningPageInfo(pageId).then((resDTO: ResponseDTO<PageInfoBean>) => {
PageRepository.fetchMorningEveningPageInfo(pageId
,''
).then((resDTO: ResponseDTO<PageInfoBean>) => {
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'getMorningEveningPageInfo then navResDTO is empty');
error('resDTO is empty');
...
...
sight_harmony/features/wdLogin/src/main/ets/pages/login/OneKeyLoginPage.ets
View file @
fc86424
...
...
@@ -50,7 +50,7 @@ struct OneKeyLoginPage {
// 获取到Authorization Code
let authorizationCode = response.authorizationCode;
// hilog.info(0x0000, 'testTag', 'response: %{public}s', JSON.stringify(response));
TrackingButton.click("oneClickLoginPageLoginButton",
this.pageName, this.pageName
)
TrackingButton.click("oneClickLoginPageLoginButton",
TrackConstants.PageName.OneClick_Login, TrackConstants.PageName.OneClick_Login
)
this.requestLogin()
return;
}
...
...
@@ -58,7 +58,6 @@ struct OneKeyLoginPage {
// 埋点计算页面浏览时长
private pageStartDate: number = 0
private pageName = TrackConstants.PageName.OneClick_Login
aboutToAppear(): void {
this.anonymousPhone = HuaweiAuth.sharedInstance().anonymousPhone||""
...
...
@@ -70,7 +69,7 @@ struct OneKeyLoginPage {
onPageHide(): void {
const duration = Math.floor((Date.now() - this.pageStartDate!)/1000)
TrackingPageBrowse.trackCommonPageExposureEnd(
this.pageName, this.pageName
, duration)
TrackingPageBrowse.trackCommonPageExposureEnd(
TrackConstants.PageName.OneClick_Login, TrackConstants.PageName.OneClick_Login
, duration)
}
// pageTransition() {
...
...
@@ -161,7 +160,7 @@ struct OneKeyLoginPage {
Row() {
Image($r("app.media.huawei_one_key_login_icon"))
.width(24).height(24)
Text("华为账号
一键
登录")
Text("华为账号
快速
登录")
.fontColor(Color.White)
.margin({left:5})
}
...
...
@@ -171,30 +170,34 @@ struct OneKeyLoginPage {
.borderRadius(4)
.type(ButtonType.Normal)
.backgroundColor("#ED2800")
.onClick(() => {
Stack(){
//目前不支持文字和图标同时展示,后面优化
LoginWithHuaweiIDButton({
params: {
// LoginWithHuaweiIDButton支持的样式。
style: loginComponentManager.Style.BUTTON_CUSTOM,
// LoginWithHuaweiIDButton的边框圆角半径。
// borderRadius: 4,
// LoginWithHuaweiIDButton支持的登录类型。
loginType: loginComponentManager.LoginType.QUICK_LOGIN,
// LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。
// supportDarkMode: true,
customButtonParams: {
fontColor: loginComponentManager.FontColor.WHITE,
// backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800"
backgroundColor:"#ED2800"
}
},
controller: this.controller
}).opacity(0)
}
.width('100%')
.height('100%')
this.requestLogin()
})
// Stack(){
// //目前不支持文字和图标同时展示,后面优化
// LoginWithHuaweiIDButton({
// params: {
// // LoginWithHuaweiIDButton支持的样式。
// style: loginComponentManager.Style.BUTTON_CUSTOM,
// // LoginWithHuaweiIDButton的边框圆角半径。
// // borderRadius: 4,
// // LoginWithHuaweiIDButton支持的登录类型。
// loginType: loginComponentManager.LoginType.QUICK_LOGIN,
// // LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。
// // supportDarkMode: true,
// customButtonParams: {
// fontColor: loginComponentManager.FontColor.WHITE,
// // backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800"
// backgroundColor:"#ED2800"
// }
// },
// controller: this.controller
// }).opacity(0)
// }
// .width('100%')
// .height('100%')
}
}
.height(48)
...
...
sight_harmony/features/wdLogin/src/main/ets/utils/HuaweiAuth.ets
View file @
fc86424
...
...
@@ -94,7 +94,7 @@ export default class HuaweiAuth {
// 创建授权请求,并设置参数
let loginRequest = new authentication.HuaweiIDProvider().createAuthorizationWithHuaweiIDRequest();
// 获取头像昵称需要传如下scope
loginRequest.scopes = ['profile']; //, 'phone'
loginRequest.scopes = ['profile'
, 'phone'
]; //, 'phone'
// 若开发者需要进行服务端开发,则需传如下permission获取authorizationCode
loginRequest.permissions = ['serviceauthcode'];
// 用户是否需要登录授权,该值为true且用户未登录或未授权时,会拉起用户登录或授权页面
...
...
Please
register
or
login
to post a comment