liyubing

Merge remote-tracking branch 'origin/main'

... ... @@ -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
... ...
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
... ...
... ... @@ -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
... ...
... ... @@ -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 += "&region_id=0"
return link
}
}
\ No newline at end of file
... ...
... ... @@ -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') {
// 显示音频信息
... ...
... ... @@ -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)})
}
}
... ...
... ... @@ -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%')
... ...
... ... @@ -241,7 +241,7 @@ export struct OperRowListView {
.padding({
top: 10,
// bottom: 10
bottom: `${this.bottomSafeHeight}px`
bottom: px2vp(this.bottomSafeHeight)
// bottom: 50
})
}
... ...
... ... @@ -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),
}
})
}
... ...
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
... ...
... ... @@ -32,7 +32,6 @@ struct MultiPictureDetailPage {
relType: this.relType
})
}
.padding({top: `${this.topSafeHeight}px`,bottom:`${this.bottomSafeHeight}px`})
}
.backgroundColor(Color.Black)
... ...
... ... @@ -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:'110lpx'})
.margin({top:'80lpx',left:'120lpx'})
}.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% - ${108 + 'lpx'})`)
.height(`calc(100% - ${158 + 'lpx'})`)
// .backgroundColor(Color.Red)
Stack({alignContent:Alignment.Center}){
... ...
... ... @@ -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)
... ...
... ... @@ -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
})
}
... ...