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-04 20:56:59 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
ead4b48f6753e4cc1564e5d2c3572d66ce87fa97
ead4b48f
2 parents
964deadc
9144d7e9
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
220 additions
and
69 deletions
sight_harmony/commons/wdRouter/Index.ets
sight_harmony/commons/wdRouter/src/main/ets/common/ContentType.ets
sight_harmony/commons/wdShareBase/src/main/ets/Constant.ets
sight_harmony/commons/wdShareBase/src/main/ets/System/WDSystemShare.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/CardMediaInfo.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/QualityCommentsComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
sight_harmony/features/wdShare/src/main/ets/WDShare.ets
sight_harmony/features/wdShare/src/main/ets/utils/DeepLinkUtil.ets
sight_harmony/products/phone/src/main/ets/pages/detail/MultiPictureDetailPage.ets
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchInterestsHobbiesPage.ets
sight_harmony/products/phone/src/main/ets/pages/view/BottomNavigationComponent.ets
sight_harmony/products/phone/src/main/ets/pages/view/MultiPictureDetailPageComponent.ets
sight_harmony/products/phone/src/main/resources/base/media/app_icon_foreground.png
sight_harmony/commons/wdRouter/Index.ets
View file @
ead4b48
...
...
@@ -15,3 +15,5 @@ export { AssignChannelParam } from './src/main/ets/utils/HomeChannelUtils';
export { RouterJumpInterceptor, JumpInterceptorAction } from './src/main/ets/router/RouterJumpInterceptor'
export { AppInnerLink } from './src/main/ets/utils/AppInnerLink'
export { ContentType } from './src/main/ets/common/ContentType'
\ No newline at end of file
...
...
sight_harmony/commons/wdRouter/src/main/ets/common/ContentType.ets
0 → 100644
View file @
ead4b48
export enum ContentType {
/// 不跳转
Unknown = 0,
///点播
Video = 1,
///直播
Live = 2,
///活动
Activity = 3,
///信息流广告
InfoflowAD = 4,
///专题
Subject = 5,
///链接
Link = 6,
///榜单
RankList = 7,
/// 图文
ImageText = 8,
/// 组图
Pictures = 9,
/// H5新闻 (仅海外版存在,视界和中文端无此类型。中文端按照图文8类型+link)
H5News = 10,
/// 频道
Channel = 11,
///组件
Module = 12,
///音频
Audio = 13,
///动态图文
DynamicImageText = 14,
///动态视频
DynamicVideo = 15,
///问政留言
Ask = 16,
/// 金刚位
KeyPosition = 30,
/// 合集
Serials = 101,
}
\ No newline at end of file
...
...
sight_harmony/commons/wdShareBase/src/main/ets/Constant.ets
View file @
ead4b48
...
...
@@ -39,6 +39,8 @@ export interface ShareContentLink {
desc?: string
link: string
icon?: string
deeplink: string // 根据内容详情,生成的深度链接 如:rmrbapp://rmrb.app/openwith?type=article&subType=h5_template_article&contentId=30000762651&relId=500000038702&skipType=1&relType=1
}
export type ShareContent = ShareContentText | ShareContentImageAndText | ShareContentLink
...
...
sight_harmony/commons/wdShareBase/src/main/ets/System/WDSystemShare.ets
View file @
ead4b48
...
...
@@ -6,6 +6,9 @@ import { AsyncCallback } from '@kit.BasicServicesKit';
import { common } from '@kit.AbilityKit';
import { systemShare } from '@kit.ShareKit';
import { uniformTypeDescriptor as utd } from '@kit.ArkData';
import { JSON } from '@kit.ArkTS';
const TAG = "WDSystemShare"
export class WDSystemShare implements WDShareInterface {
...
...
@@ -14,7 +17,8 @@ export class WDSystemShare implements WDShareInterface {
return new Promise((resolve, fail) => {
try {
let controller: systemShare.ShareController = new systemShare.ShareController(this.getShareData(content, contentType));
let data = this.getShareData(content, contentType)
let controller: systemShare.ShareController = new systemShare.ShareController(data);
let context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext
controller.on('dismiss', () => {
...
...
@@ -53,7 +57,7 @@ export class WDSystemShare implements WDShareInterface {
});
data.addRecord({
utd: utd.UniformDataType.PNG,
uri: imageAndText.imgURI
uri: imageAndText.imgURI
// 这里必须为本地连接
});
return data
}
...
...
@@ -64,12 +68,26 @@ export class WDSystemShare implements WDShareInterface {
utd: utd.UniformDataType.PLAIN_TEXT,
content: link.title
});
let shareLink = this.generateShareLink(link)
console.log("分享 shareLink ==> " + shareLink)
data.addRecord({
utd: utd.UniformDataType.HYPERLINK,
uri: link.link
// uri: link.link // SDK 设计 不能传这里
content: link.link
});
return data
}
generateShareLink(shareContent: ShareContentLink) {
let link = "https://peopledailychinahosactivity.drcn.agconnect.link/?deeplink=" + encodeURI(shareContent.deeplink)
link += "&harmonyos_deeplink=" + encodeURI(shareContent.deeplink)
link += "&harmonyos_package_name=com.peopledailychina.hosactivity"
link += "&harmonyos_fallback_url=" + encodeURI(shareContent.link)
link += "&landing_page_type=1"
// link += "&social_desc=" + encodeURIComponent(shareContent.desc || " ")
// link += "&social_image=" + encodeURI(shareContent.icon || " ")
// link += "&social_title=" + encodeURIComponent(shareContent.title)
link += "®ion_id=0"
return link
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/CardMediaInfo.ets
View file @
ead4b48
...
...
@@ -93,7 +93,8 @@ export struct CardMediaInfo {
.fontFamily('BebasNeue')
}
} .margin({ left: 68,top: 135})
}
// .margin({ left: 68,top: 135})
} else if (this.contentDTO.objectType === '2') {
// liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
// 显示直播信息
...
...
@@ -191,7 +192,7 @@ export struct CardMediaInfo {
.mediaTextImgtype()
.fontFamily('BebasNeue')
}
.margin({ left: 80,top: 55})
//
.margin({ left: 80,top: 55})
} else if (this.contentDTO.objectType === '13') {
// 显示音频信息
...
...
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/QualityCommentsComponent.ets
View file @
ead4b48
...
...
@@ -112,13 +112,12 @@ export struct QualityCommentsComponent {
Image($r('app.media.comment_img_banner')).width('100%')
.height(283)
// .aspectRatio(375 / 283);
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
.onAreaChange((oldValue: Area, newValue: Area) => {
if (Number(oldValue.globalPosition.y) == 0 && Number(newValue.globalPosition.y) > 30) {
this.firstPositionY = Number(newValue.globalPosition.y)
return
}
// if (Number(oldValue.globalPosition.y) == 0 && Number(newValue.globalPosition.y) > 30) {
// this.firstPositionY = Number(newValue.globalPosition.y)
// return
// }
Logger.debug(TAG, "oldValue.globalPosition.y : " + oldValue.globalPosition.y)
Logger.debug(TAG,
"newValue.globalPosition.y : " + newValue.globalPosition.y + `,this.topSafeHeight : ` + this.topSafeHeight)
...
...
@@ -128,9 +127,16 @@ export struct QualityCommentsComponent {
persent = 1
}
this.tileOpacity = persent
this.topOpacityChange()
})
}
topOpacityChange(){
if(this.tileOpacity > 0.8){
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}else{
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
}
}
/*透明导航栏*/
@Builder
...
...
@@ -164,16 +170,20 @@ export struct QualityCommentsComponent {
@Builder
TabbarNormal() {
Stack({ alignContent: Alignment.Top }) {
//// 默认显示的白色返回按钮
Row() {
}
.width('100%')
.height(px2vp(this.topSafeHeight))
.backgroundColor($r('app.color.white'))
.opacity(this.tileOpacity)
.visibility(this.tileOpacity > 0 ? 0 : 1)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
Image($r('app.media.icon_arrow_left_white'))
.width(24).height(24)
.objectFit(ImageFit.Auto)
.margin({ left: 16, top: px2vp(this.topSafeHeight) + (44 - 24)/2})
.onClick(() => {
router.back()
})
}.width('100%').height(px2vp(this.topSafeHeight) + 44)
.opacity(1- this.tileOpacity)
Stack({ alignContent: Alignment.Start }) {
//// 上滑显示的黑色按钮和标题
Stack({ alignContent: Alignment.Top }) {
Row() {
Text('精选评论')// .height('42lpx')
.maxLines(1)
...
...
@@ -182,25 +192,25 @@ export struct QualityCommentsComponent {
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.lineHeight('42lpx')
.visibility(this.tileOpacity < 0.8 ? 1 : 0)
}
.height(44)
.width('100%')
.height(44).width('100%')
.justifyContent(FlexAlign.Center)
.alignItems(VerticalAlign.Center)
.opacity(this.tileOpacity)
.backgroundColor($r('app.color.white'))
Image(this.tileOpacity < 0.8 ? $r('app.media.icon_arrow_left_white') : $r('app.media.icon_arrow_left'))
.width(24)
.height(24)
.objectFit(ImageFit.Auto)
.margin({ left: 16 })
.onClick(() => {
router.back()
})
Row() {
Image($r('app.media.icon_arrow_left'))
.width(24).height(24)
.objectFit(ImageFit.Auto)
.margin({ left: 16, top: (44-24)/2})
.onClick(() => {
router.back()
})
}.height(44).width('100%')
}
.width('100%').height(px2vp(this.topSafeHeight) + 44)
.backgroundColor($r('app.color.white'))
.opacity(this.tileOpacity)
.padding({top:px2vp(this.topSafeHeight)})
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
View file @
ead4b48
...
...
@@ -113,9 +113,11 @@ export struct TopNavigationComponentNew {
'middle': { 'anchor': '__container__', 'align': HorizontalAlign.Center },
'bottom': { 'anchor': '__container__', 'align': VerticalAlign.Bottom }
})
.onChange((index) => {
Logger.info(TAG, `onChange index : ${index}`);
.onAnimationStart((curIndex: number, index: number)=>{
Logger.info(TAG, `onAnimationStart ${curIndex} ${index}`);
if (curIndex === index) {
return
}
if (this.isBroadcastByIndex(index)) {
// 跳转到播报页面
ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId)
...
...
@@ -133,7 +135,12 @@ export struct TopNavigationComponentNew {
this.currentTopNavSelectedIndex = index;
this.changePage(this.currentTopNavSelectedIndex)
}
})
// .onAnimationEnd((index: number)=>{
// Logger.info(TAG, `onAnimationEnd ${index}`);
// })
.onChange((index) => {
Logger.info(TAG, `onChange index : ${index}`);
})
}
.width('100%')
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
View file @
ead4b48
...
...
@@ -241,7 +241,7 @@ export struct OperRowListView {
.padding({
top: 10,
// bottom: 10
bottom:
`${this.bottomSafeHeight}px`
bottom:
px2vp(this.bottomSafeHeight)
// bottom: 50
})
}
...
...
sight_harmony/features/wdShare/src/main/ets/WDShare.ets
View file @
ead4b48
...
...
@@ -2,6 +2,7 @@ import { ContentDetailDTO, ContentDTO, PageInfoDTO, ShareInfoDTO, TopicInfo } fr
import { SharePosterItemBean } from 'wdBean/src/main/ets/bean/detail/SharePosterItemBean';
import { ShareScene, ShareType, WDShareBase } from 'wdShareBase/Index';
import { ShareContentType } from 'wdShareBase/src/main/ets/Constant';
import { DeepLinkUtil } from './utils/DeepLinkUtil';
export class WDShare {
...
...
@@ -17,6 +18,7 @@ export class WDShare {
title: content.shareInfo.shareTitle,
desc: content.shareInfo.shareSummary,
link: content.shareInfo.shareUrl,
deeplink:DeepLinkUtil.generateDeepLinkWithConent(content),
}
})
}
...
...
@@ -32,6 +34,7 @@ export class WDShare {
title: program.shareInfo.shareTitle,
desc: program.shareInfo.shareSummary,
link: program.shareInfo.shareUrl,
deeplink:DeepLinkUtil.generateDeepLinkWithProgram(program),
}
})
}
...
...
sight_harmony/features/wdShare/src/main/ets/utils/DeepLinkUtil.ets
0 → 100644
View file @
ead4b48
import { ContentDetailDTO, ContentDTO } from 'wdBean/Index';
import { BreakpointSystem } from 'wdKit/Index';
import { ContentType } from 'wdRouter/Index';
export class DeepLinkUtil {
private static DEEP_LINK_PREFIX = "rmrbapp:rmrb.app/openwith"
static generateDeepLinkWithConent(content: ContentDetailDTO): string {
return DeepLinkUtil.generate(content.newsType, content.newsId +'', content.reLInfo?.relId, content.newsLinkUrl)
}
static generateDeepLinkWithProgram(content: ContentDTO) {
return DeepLinkUtil.generate(Number(content.objectType), content.objectId +'', content.relId, content.linkUrl)
}
private static generate(contentType: number, contentId?: string, relId?: string, link?: string): string {
let deeplink = DeepLinkUtil.DEEP_LINK_PREFIX
let pubParam = `&contentId=${contentId}}&relId=${relId}&skipType=1`
let type: ContentType = Number(contentType)
switch (type) {
case ContentType.Video:
deeplink += "?type=video&subType=vod_video"
break
case ContentType.Live:
deeplink += "?type=live"
break
case ContentType.ImageText:
if (link && link.length) {
deeplink += "?type=article&subType=h5"
deeplink += "&url=" + encodeURIComponent(link)
} else {
deeplink += "type=article&subType=h5_template_article"
}
break
case ContentType.DynamicImageText:
deeplink += "?type=dynamic"
break
case ContentType.DynamicVideo:
deeplink += "?type=dynamic"
break
case ContentType.Pictures:
deeplink += "?type=picture"
break
case ContentType.Audio:
deeplink += "?type=audio"
break
case ContentType.Ask:
deeplink += "?type=ask"
break
default:
pubParam = ""
break;
}
deeplink += pubParam
return deeplink
}
}
\ No newline at end of file
...
...
sight_harmony/products/phone/src/main/ets/pages/detail/MultiPictureDetailPage.ets
View file @
ead4b48
...
...
@@ -32,7 +32,6 @@ struct MultiPictureDetailPage {
relType: this.relType
})
}
.padding({top: `${this.topSafeHeight}px`,bottom:`${this.bottomSafeHeight}px`})
}
.backgroundColor(Color.Black)
...
...
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchInterestsHobbiesPage.ets
View file @
ead4b48
...
...
@@ -5,7 +5,7 @@ import { SPHelper } from 'wdKit/Index';
import { SpConstants } from 'wdConstant/Index';
import { ButtonOptions, promptAction, window } from '@kit.ArkUI';
import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index';
import { ImageKnifeComponent } from '@ohos/imageknife';
import { ImageKnifeComponent
,ScaleType
} from '@ohos/imageknife';
@Entry
@Component
...
...
@@ -13,6 +13,8 @@ struct LaunchInterestsHobbiesPage {
@State message: string = 'Hello World'
@State selectCount: number = 0
@State interestsArray: InterestsList[] = []
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
aboutToAppear(){
//请求接口,获取兴趣偏好数据
...
...
@@ -39,6 +41,7 @@ struct LaunchInterestsHobbiesPage {
this.trackingLaunchJumpOver(false)
})
}
.margin({top:px2vp(this.topSafeHeight)})
.width('100%')
.justifyContent(FlexAlign.End)
...
...
@@ -62,7 +65,7 @@ struct LaunchInterestsHobbiesPage {
ForEach(this.interestsArray,(item:InterestsList,index:number)=>{
GridItem(){
Stack({alignContent:Alignment.TopStart}){
ImageKnifeComponent({imageKnifeOption:{loadSrc:item.pic}})
ImageKnifeComponent({imageKnifeOption:{loadSrc:item.pic
?item.pic:'',mainScaleType:ScaleType.FIT_XY
}})
.width('100%')
.height('100%')
.backgroundColor(Color.White)
...
...
@@ -98,7 +101,7 @@ struct LaunchInterestsHobbiesPage {
Image(item.choose ? $r('app.media.interestsSelected') : $r('app.media.interestsSelectNot'))
.height('32lpx')
.width('32lpx')
.margin({top:'80lpx',left:'1
1
0lpx'})
.margin({top:'80lpx',left:'1
2
0lpx'})
}.justifyContent(FlexAlign.Start)
}
...
...
@@ -118,8 +121,7 @@ struct LaunchInterestsHobbiesPage {
})
}
.width('90%')
// .height('70%')
.margin({top:'61lpx',bottom:'240lpx'})
.margin({top:'61lpx',bottom:'300lpx'})
.columnsTemplate('1fr 1fr 1fr')
.columnsGap('23lpx')
.rowsGap('23lpx')
...
...
@@ -129,7 +131,7 @@ struct LaunchInterestsHobbiesPage {
.height('100%')
}
.width('100%')
.height(`calc(100% - ${1
0
8 + 'lpx'})`)
.height(`calc(100% - ${1
5
8 + 'lpx'})`)
// .backgroundColor(Color.Red)
Stack({alignContent:Alignment.Center}){
...
...
sight_harmony/products/phone/src/main/ets/pages/view/BottomNavigationComponent.ets
View file @
ead4b48
...
...
@@ -123,30 +123,16 @@ export struct BottomNavigationComponent {
@Builder
tabBarBuilder(navItem: BottomNavDTO, index: number) {
Stack({ alignContent: Alignment.Bottom }) {
// Image(this.getBottomIcon(navItem, this.currentNavIndex === index))
// .height(CommonConstants.FULL_PARENT)
// .padding({
// bottom: 15,
// left: 10,
// right: 10,
// top: 2
// })
// .aspectRatio(this.ASPECT_RATIO_1_1)
// .alt(this.getBottomLocalIcon(navItem, this.currentNavIndex === index))
Column() {
ImageKnifeComponent({ imageKnifeOption: this.getBottomImageKnifeOption(navItem, this.currentNavIndex === index) })
.padding({
bottom: 15,
left: 10,
right: 10,
top: 2
})
.width('100%')
.height('100%')
.padding(1)
.margin({ top: 2 })
.width(32)
.height(32)
.enabled(false)
Text(navItem.name)
.margin({
bottom: $r('app.float.bottom_navigation_margin_bottom')
})
.margin({
top: 2
})
.fontWeight(this.currentNavIndex === index ? FontWeight.Bold : FontWeight.Normal)
.textAlign(TextAlign.Center)
.fontSize($r('app.float.font_size_10'))// .fontColor(this.currentNavIndex === index ? Color.Red : Color.Gray)
...
...
sight_harmony/products/phone/src/main/ets/pages/view/MultiPictureDetailPageComponent.ets
View file @
ead4b48
...
...
@@ -45,8 +45,8 @@ export struct MultiPictureDetailPageComponent {
@Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
@Provide windowWidth: number = AppStorage.get<number>('windowWidth') || 0
@Provide windowHeight: number = AppStorage.get<number>('windowHeight') || 0
@Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@Consume bottomSafeHeight: number
@Consume topSafeHeight: number
@Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01'
private swiperController: SwiperController = new SwiperController()
private swiperControllerItem: SwiperController = new SwiperController()
...
...
@@ -119,7 +119,7 @@ export struct MultiPictureDetailPageComponent {
currentIndex: $currentIndex,
showCommentList: $showCommentList,
publishCommentModel: $publishCommentModel,
interactData:
$
interactData
interactData:
this.
interactData
})
}
...
...
sight_harmony/products/phone/src/main/resources/base/media/app_icon_foreground.png
View file @
ead4b48
7.32 KB
|
W:
|
H:
6.35 KB
|
W:
|
H:
2-up
Swipe
Onion skin
Please
register
or
login
to post a comment