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
陈剑华
2024-06-14 14:36:08 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
606d2020be7311ac4cf4769f8cb34e66b1ba4772
606d2020
2 parents
d6b827d0
b22f0962
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
600 additions
and
475 deletions
sight_harmony/features/wdBean/src/main/ets/bean/navigation/TopNavDTO.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/appointment/AppointmentListUI.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/HomePageBottomFollowComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/OtherHomePageBottomFollowComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/CardView.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/ChannelSubscriptionLayout.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserInfoPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/EmptyComponent.ets
sight_harmony/features/wdComponent/src/main/ets/model/EditInfoModel.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/EditInfoViewModel.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailVideoListPage.ets
sight_harmony/features/wdHwAbility/src/main/module.json5
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginPage.ets
sight_harmony/features/wdLogin/src/main/module.json5
sight_harmony/products/phone/src/main/ets/pages/MainPage.ets
sight_harmony/products/phone/src/main/ets/pages/view/AudioComponent.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/features/wdBean/src/main/ets/bean/navigation/TopNavDTO.ets
View file @
606d202
...
...
@@ -2,26 +2,26 @@
* 顶导
*/
export class TopNavDTO {
channelId: number = 0;
channelStyle: number = 0;
channelId: number = 0; //频道id
channelStyle: number = 0; //频道样式;1-沉浸式;2-信息流
channelType: number = 0; // 频道样式;1-沉浸式;2-信息流;3-特殊频道(跳转指定页面的,如版面)
defaultPermitted: number = 0;
delPermitted: number = 0;
defaultPermitted: number = 0; //允许设置为默认首页 0:否, 1:是;【首页设置频道】
delPermitted: number = 0; //允许删除 0:否, 1:是;【撤销属性】
fontCColor: string = ''; // 频道展示样式颜色(选中状态)
fontColor: string = ''; // 频道展示样式颜色(未选中状态)
headlinesOn: number = 0;
homeChannel: string = '';
iconUrlSize: string = '';
iconCUrlSize: string = '';
headlinesOn: number = 0; //头条标识 0:否, 1:是;【是否头条=是的频道,固定排序在第一位,且不可移出/移动】
homeChannel: string = ''; //必须 是否首页设置;0否,1是
iconUrlSize: string = ''; // 选中图片的大小
iconCUrlSize: string = ''; // 未选中图片的大小
iconUrl: string = ''; // 频道图片展示样式图片相对地址(未选中状态)
iconCUrl: string = ''; //频道图片展示样式图片相对地址(选中状态
localChannel: string = '';
moreChannel: string = '';
movePermitted: number = 0;
myChannel: string = '';
name: string = '';
num: number = 0;
pageId: number = 0;
iconCUrl: string = ''; //频道图片展示样式图片相对地址(选中状态)
localChannel: string = ''; // 必须 是否地方频道栏目;0否,1是
moreChannel: string = ''; // 必须 是否更多栏目;0否,1是
movePermitted: number = 0; //允许移动 0:否, 1:是;【位置属性】
myChannel: string = '';// 必须 是否我的栏目;0否,1是
name: string = ''; //频道名称
num: number = 0; //首页设置根据这个排序20230828
pageId: number = 0; //频道关联页面id
pageType: string = '';
underlineCColor: string = ''; // 选中下划线颜色
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
View file @
606d202
...
...
@@ -91,14 +91,14 @@ export struct MorningEveningPaperComponent {
private AudioSuspension = new AudioSuspensionModel()
onCancel() {
Logger.info
(TAG, "cj2024 onCancel = ")
console.log
(TAG, "cj2024 onCancel = ")
}
/**
* 回调无用
**/
onConfirm() {
Logger.info
(TAG, "cj2024 onConfirm = ")
console.log
(TAG, "cj2024 onConfirm = ")
// if (this.playerController != undefined) {
//
// }
...
...
@@ -108,10 +108,10 @@ export struct MorningEveningPaperComponent {
// 续播判断
changeContinue() {
Logger.info
(TAG, "cj2024 changeContinue = 1")
console.log
(TAG, "cj2024 changeContinue = 1")
// if (this.nextContId) {
this.playerController.continue = () => {
Logger.info
(TAG, "cj2024 changeContinue = 2")
console.log
(TAG, "cj2024 changeContinue = 2")
this.playerController?.stop();
// this.playVM.playWithContentId(this.nextContId ?? '');
}
...
...
@@ -130,8 +130,8 @@ export struct MorningEveningPaperComponent {
const dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as String
console.info(TAG, `aboutToAppear = ` + dailyPaperTopicPageId)
const currentTime = new Date().getTime()
Logger.info(TAG, "currentTime = " + currentTime)
Logger.info(TAG, `currentTime = ${currentTime}`)
console.log(TAG, "currentTime = " + currentTime)
console.log(TAG, `currentTime = ${currentTime}`)
try {
// let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId)
...
...
@@ -145,13 +145,13 @@ export struct MorningEveningPaperComponent {
let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN)
const dateShow = new Date(dateTime)
this.subTitle = `${dateShow.getFullYear()}年\n${(dateShow.getMonth() + 1)}月${dateShow.getDate()}日`
Logger.info(TAG, "pageInfoBean topicDate = " + this.pageInfoBean?.topicInfo?.topicDate)
Logger.info(TAG, "pageInfoBean title = " + this.pageInfoBean?.topicInfo?.title)
console.log(TAG, "pageInfoBean topicDate = " + this.pageInfoBean?.topicInfo?.topicDate)
console.log(TAG, "pageInfoBean title = " + this.pageInfoBean?.topicInfo?.title)
Logger.info(TAG, "pageInfoBean dateTime = " + dateTime)
Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle)
console.log(TAG, "pageInfoBean dateTime = " + dateTime)
console.log(TAG, "pageInfoBean subTitle = " + this.subTitle)
Logger.info
(TAG, "this.pageInfoBean = " + JSON.stringify(this.pageInfoBean))
console.log
(TAG, "this.pageInfoBean = " + JSON.stringify(this.pageInfoBean))
this.isHasTopView = this.pageInfoBean?.topicInfo?.frontLinkObject?true:false
let coverUrl = this.isHasTopView?this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string :''
...
...
@@ -159,21 +159,22 @@ export struct MorningEveningPaperComponent {
let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId)
// this.compInfoBean = compInfoBean
Logger.info
(TAG, "compInfoBean = " + JSON.stringify(compInfoBean))
console.log
(TAG, "compInfoBean = " + JSON.stringify(compInfoBean))
if (compInfoBean?.compList[0]) {
this.compListItem = compInfoBean?.compList[0]
Logger.debu
g(TAG, '获取评论数据' + `${this.compListItem.operDataList.length}`)
console.lo
g(TAG, '获取评论数据' + `${this.compListItem.operDataList.length}`)
if (this.compListItem.operDataList && this.compListItem.operDataList.length > 0) {
this.getAllContentInteractData(this.compListItem.operDataList)
}
Logger.debu
g(TAG, 'compInfoBean?.compList[0].audioDataList', JSON.stringify(compInfoBean?.compList[0].audioDataList))
console.lo
g(TAG, 'compInfoBean?.compList[0].audioDataList', JSON.stringify(compInfoBean?.compList[0].audioDataList))
if (compInfoBean?.compList[0].audioDataList) {
this.audioPlayUrl = compInfoBean?.compList[0].audioDataList[0].audioUrl
this.audioTitle = compInfoBean?.compList[0].audioDataList[0].title
console.log(TAG, 'this.audioPlayUrl', this.audioPlayUrl)
}
}
Logger.info
(TAG, "compInfoBean compStyle = " + compInfoBean.compList[0].compStyle)
console.log
(TAG, "compInfoBean compStyle = " + compInfoBean.compList[0].compStyle)
this.playerController.onTimeUpdate = (position, duration) => {
this.currentTime = DateFormatUtil.secondToTime(position);
this.totalTime = DateFormatUtil.secondToTime(duration);
...
...
@@ -203,10 +204,10 @@ export struct MorningEveningPaperComponent {
contentType: Number(item.objectType ?? '1')
})
})
Logger.debu
g(TAG, '获取评论数据' + `${JSON.stringify(params)}`)
console.lo
g(TAG, '获取评论数据' + `${JSON.stringify(params)}`)
this.commentList = await PeopleShipMainViewModel.getContentInteractInfo(params)
Logger.debu
g(TAG, '获取评论数据' + `${JSON.stringify(this.commentList)}`)
console.lo
g(TAG, '获取评论数据' + `${JSON.stringify(this.commentList)}`)
} catch (exception) {
...
...
@@ -216,7 +217,7 @@ export struct MorningEveningPaperComponent {
async setComponentBgColor(imageUrl: string) {
// 图片转换为PixelMap对象
// const pixelMap: image.PixelMap = await image2PixelMap(item.icon);
Logger.debu
g(TAG, "compInfoBean compStyle = " + imageUrl)
console.lo
g(TAG, "compInfoBean compStyle = " + imageUrl)
if (imageUrl.length > 0 && this.pageInfoBean.topicInfo.frontFlag === 1) {
const imageSource: image.ImageSource | undefined = await getPicture(imageUrl)
...
...
@@ -237,11 +238,11 @@ export struct MorningEveningPaperComponent {
const pixelMap: image.PixelMap = await imageNet2PixelMap(imageSource);
effectKit.createColorPicker(pixelMap, (err, colorPicker) => {
let color = colorPicker.getLargestProportionColor();
Logger.debu
g(TAG, "compInfoBean compStyle = " + color)
console.lo
g(TAG, "compInfoBean compStyle = " + color)
// color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha})
// 将取色器选取的color示例转换为十六进制颜色代码
this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16);
Logger.debu
g(TAG, "compInfoBean compStyle = " + this.mixedBgColor)
console.lo
g(TAG, "compInfoBean compStyle = " + this.mixedBgColor)
});
}
...
...
@@ -267,11 +268,15 @@ export struct MorningEveningPaperComponent {
topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject })
}
if (this.audioPlayUrl !== ""){
ListItem() {
this.AudioBarView()
}
}
if (this.audioPlayUrl.length > 0){
ListItem() {
this.AudioBarView()
}
.margin({
top: this.isHasTopView ? 10 : 44+this.topSafeHeight
})
}
ListItem() {
...
...
@@ -282,7 +287,7 @@ export struct MorningEveningPaperComponent {
compListItem: this.compListItem,
})
.margin({
top: this.isHasTopView ? 10 : 44+this.topSafeHeight
top: this.isHasTopView
|| this.audioPlayUrl.length > 0
? 10 : 44+this.topSafeHeight
})
}
}
...
...
@@ -310,8 +315,11 @@ export struct MorningEveningPaperComponent {
@Builder
topPaperTitle(){
Column(){
PaperTitleComponent({topicInfo:this.pageInfoBean?.topicInfo}).margin({top:this.topSafeHeight})
}.height(44+this.topSafeHeight).backgroundColor(this.isHasTopView?(this.scrollOffset > 100?this.mixedBgColor:''):this.mixedBgColor)
PaperTitleComponent({topicInfo:this.pageInfoBean?.topicInfo})
.margin({top:this.topSafeHeight})
}
.height(44+this.topSafeHeight)
.backgroundColor(this.isHasTopView?(this.scrollOffset > 100?this.mixedBgColor:''):this.mixedBgColor)
}
@Builder
...
...
@@ -328,7 +336,7 @@ export struct MorningEveningPaperComponent {
.margin({ left: 10 })
.alignSelf(ItemAlign.Start)
Text(`${this.pageInfoBean.topicInfo
.topicPattern === 1 ? '早上好' : this.pageInfoBean.topicInfo
.topicPattern === 2 ? '中午好' : '晚上好'}, 请收听今日新闻播报`)
Text(`${this.pageInfoBean.topicInfo
?.topicPattern === 1 ? '早上好' : this.pageInfoBean.topicInfo?
.topicPattern === 2 ? '中午好' : '晚上好'}, 请收听今日新闻播报`)
.fontSize(14)
.margin({ left: 50 })
.fontColor(Color.Black)
...
...
@@ -350,27 +358,20 @@ export struct MorningEveningPaperComponent {
.margin({ left: 10 })// .alignSelf(ItemAlign.Center)
.objectFit(ImageFit.Contain)
.onClick(() => {
Logger.info
("TAG", "cj compInfoBean onClick1 = " + this.isAudioPlaying)
console.log
("TAG", "cj compInfoBean onClick1 = " + this.isAudioPlaying)
// dialog.open()
// this.playerController.firstPlay(this.audioPlayUrl, this.audioTitle)
this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle)
Logger.info(TAG, "this.audioPlayUrl = " + this.audioPlayUrl)
Logger.info("TAG", "cj compInfoBean onClick2 = " + this.isAudioPlaying)
console.log(TAG, "this.audioPlayUrl = " + this.audioPlayUrl)
console.log("TAG", "cj compInfoBean onClick2 = " + this.isAudioPlaying)
})
}
// .aspectRatio(7 / 4)
.height('100%')
// .justifyContent(FlexAlign.Center)
// .width(94)
// .width(140)
.width('20%')
// .height(56)
.onClick(() => {
// console.info(TAG, `onClick listen_right_bg`);
})
}
.margin({ left: 12, right: 12 })
// .width('100%')
.height(56)
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.SpaceBetween)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/appointment/AppointmentListUI.ets
View file @
606d202
...
...
@@ -66,6 +66,7 @@ export struct AppointmentListUI {
CustomPullToRefresh({
alldata:this.data,
scroller:this.scroller,
hasMore:this.hasMore,
customList:()=>{
this.ListLayout()
},
...
...
@@ -73,7 +74,6 @@ export struct AppointmentListUI {
this.curPageNum = 1;
this.hasMore = true
this.isGetRequest = false
this.data.clear()
if (!this.isLoading){
this.getNewPageData()
...
...
@@ -82,8 +82,10 @@ export struct AppointmentListUI {
},
onLoadMore:(resolve)=> {
if (!this.isLoading) {
this.curPageNum++
this.isLoading = true
this.getNewPageData()
if(resolve) resolve('刷新成功')
}
}
})
...
...
@@ -143,6 +145,8 @@ export struct AppointmentListUI {
this.isLoading = true
if (this.hasMore) {
MinePageDatasModel.getAppointmentListData("20", `${this.curPageNum}`, getContext(this)).then((value) => {
if (this.curPageNum) this.data.clear()
if (!this.data || value.list.length == 0) {
this.hasMore = false
} else {
...
...
@@ -156,10 +160,11 @@ export struct AppointmentListUI {
})
this.data.notifyDataReload()
this.count = this.data.totalCount()
if (this.data.totalCount() < value.totalCount) {
this.curPageNum++
if(this.count < 5){
this.getNewPageData()
if (20 < value.totalCount ) {
if (value.list.length === 20) {
this.hasMore = true
}else {
this.hasMore = false
}
} else {
this.hasMore = false
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/HomePageBottomFollowComponent.ets
View file @
606d202
...
...
@@ -116,7 +116,6 @@ export struct HomePageBottomFollowComponent {
this.curPageNum = 1;
this.hasMore = true
this.isGetRequest = false
this.data_follow.clear()
if (!this.isLoading){
this.getNewPageData()
...
...
@@ -201,6 +200,7 @@ export struct HomePageBottomFollowComponent {
let object = new FollowListDetailRequestItem(-1, 20, this.curPageNum)
MinePageDatasModel.getMineFollowListData(object, getContext(this)).then((value) => {
if (this.curPageNum === 1) this.data_follow.clear()
if (!this.data_follow || value.list.length == 0) {
this.hasMore = false
} else {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/OtherHomePageBottomFollowComponent.ets
View file @
606d202
...
...
@@ -77,7 +77,6 @@ export struct OtherHomePageBottomFollowComponent{
this.curPageNum = 1;
this.hasMore = true
this.isGetRequest = false
this.data_follow.clear()
if (!this.isLoading){
this.getNewPageData()
...
...
@@ -164,6 +163,9 @@ export struct OtherHomePageBottomFollowComponent{
let object = new UserFollowListRequestItem(Number(this.curUserId),20,this.curPageNum,"1")
MinePageDatasModel.getOtherUserFollowListData(object,getContext(this)).then((value)=>{
if (this.curPageNum === 1) this.data_follow.clear()
if (!this.data_follow || value.list.length == 0){
this.hasMore = false
}else{
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/CardView.ets
View file @
606d202
...
...
@@ -430,7 +430,7 @@ export struct PaperSingleColumn999CardView {
build() {
Column() {
Text(this.item?.newsTitle)
.fontColor('#222222')
.fontColor(
this.isRead ? 0x848484 :
'#222222')
.fontSize(16)
.fontWeight(FontWeight.Medium)
.alignSelf(ItemAlign.Start)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/ChannelSubscriptionLayout.ets
View file @
606d202
...
...
@@ -12,8 +12,7 @@ const MORE_CHANNEL: string = '更多频道'
const LOCAL_CHANNEL: string = '地方频道'
const TAG: string = 'ChannelSubscriptionLayout'
// @Entry
export { ChannelSubscriptionLayout }
@Component
struct ChannelSubscriptionLayout {
@State indexSettingArray: string [] = ['推荐', '热点']
...
...
@@ -41,7 +40,9 @@ struct ChannelSubscriptionLayout {
aboutToAppear() {
this.currentTopNavSelectedItem = this.myChannelList[this.currentTopNavSelectedIndex]
this.myChannelList.forEach(item => {
this.channelIds.push(item.channelId)
if(item != undefined && item.channelId != undefined){
this.channelIds.push(item.channelId)
}
})
}
...
...
@@ -222,7 +223,6 @@ struct ChannelSubscriptionLayout {
.padding({ bottom: 10 })
List() {
ListItem() {
Row() {
Text(INDEX_SETTING_TITLE)
...
...
@@ -515,4 +515,3 @@ struct ChannelSubscriptionLayout {
}
}
export { ChannelSubscriptionLayout }
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserInfoPage.ets
View file @
606d202
...
...
@@ -57,7 +57,8 @@ struct EditUserInfoPage {
sexDialogController: CustomDialogController = new CustomDialogController({
builder: EditUserSexCustomDialog({
confirmCallback:(index)=>{
this.currentUserInfo.userExtend.sex = index;
///1男 2女
this.currentUserInfo.userExtend.sex = index == 0?2:1;
this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_sex
this.updateEditModel()
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
View file @
606d202
...
...
@@ -11,6 +11,9 @@ import { channelSkeleton } from '../skeleton/channelSkeleton';
import { ParamType, TrackConstants, Tracking, TrackingButton } from 'wdTracking/Index';
import DailyPaperTopicModel from '../../model/DailyPaperTopicModel';
import { CompUtils } from '../../utils/CompUtils';
import ChannelViewModel from '../../viewmodel/ChannelViewModel';
import { JSON } from '@kit.ArkTS';
import text from '@ohos.graphics.text';
const TAG = 'TopNavigationComponent';
...
...
@@ -25,22 +28,28 @@ export struct TopNavigationComponentNew {
private topRectHeight: string = AppStorage.get<number>('topSafeHeight') + 'px';
private pageName: string = ''
private pageId: number = 0
readonly MAX_LINE: number = 1; // 顶部tab text最大行数
private swiperController: SwiperController = new SwiperController()
private listScroller: Scroller = new Scroller()
/**
* 首页 底导 某个tab 对象
*/
navItem: BottomNavDTO = {} as BottomNavDTO
// 背景色
@Consume barBackgroundColor: Color
// 首页当前正在哪个tab的索引值
@Link _currentNavIndex?: number;
// 记录首页底部tab 的索引值
@State bottomNavIndex: number = 0
// 顶导当前选中/焦点下标
@State @Watch('updateCurrentTopNavSelectedIndex') currentTopNavSelectedIndex: number = 0;
// 顶导数据
@State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = []
//
@State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002
//本地缓存频道id列表
@State storageChannelIds: string = AppStorage.get<string>('channelIds') || ''
// 首页设置的频道信息数组
@State homeChannelList: TopNavDTO[] = []
// 我的频道列表
@State myChannelList: TopNavDTO[] = []
...
...
@@ -48,18 +57,14 @@ export struct TopNavigationComponentNew {
@State moreChannelList: TopNavDTO[] = []
// 地方频道列表
@State localChannelList: TopNavDTO[] = []
readonly MAX_LINE: number = 1;
@ObjectLink @Watch('onAssignChannelChange') assignChannel: AssignChannelParam
// 底导传递过来的自动刷新通知
@Prop @Watch('onAutoRefresh') autoRefresh: number = 0
// 传递给page的自动刷新通知
@State autoRefresh2Page: number = 0
// 当前底导index
@State bottomNavIndex: number = 0
@State animationDuration: number = 0
@State indicatorLeftMargin: number = 0
@State indicatorWidth: number = 0
@State isClickMorningEveningPaper: boolean = false
build() {
...
...
@@ -70,7 +75,7 @@ export struct TopNavigationComponentNew {
Swiper(this.swiperController) {
ForEach(CompUtils.isNews(this.navItem) ? this.myChannelList : this.topNavList,
(navItem: TopNavDTO, index: number) => {
if (CompUtils.isRMH(this.navItem) &&
navItem.channelType === 3
) {
if (CompUtils.isRMH(this.navItem) &&
this.isSpecialChannel(navItem)
) {
// 人民号 -- 关注tab
PeopleShipMainComponent({
currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
...
...
@@ -79,7 +84,7 @@ export struct TopNavigationComponentNew {
channelId: navItem?.channelId + '',
autoRefresh: this.autoRefresh2Page
})
} else
} else
{
if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) {
PageComponent({
currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
...
...
@@ -89,7 +94,9 @@ export struct TopNavigationComponentNew {
autoRefresh: this.autoRefresh2Page
})
} else {
channelSkeleton()
channelSkeleton()
//Text('特殊频道').fontColor(Color.Red).fontSize(20).width('100%').height('100%')
}
}
})
}
...
...
@@ -109,29 +116,45 @@ export struct TopNavigationComponentNew {
if (curIndex === index) {
return
}
if (this.isBroadcastByIndex(index)) {
// 跳转到播报页面
ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId)
let nextIndex = this.currentTopNavSelectedIndex > index ? index - 1 : index + 1
if (nextIndex < this.myChannelList.length) {
this.changePage(nextIndex)
}
} else if (this.isLayoutByIndex(index)) {
// 跳转到电子报页面
ProcessUtils.gotoENewsPaper()
let nextIndex = this.currentTopNavSelectedIndex > index ? index - 1 : index + 1
if (nextIndex < this.myChannelList.length) {
this.changePage(nextIndex)
}
} else {
this.currentTopNavSelectedIndex = index;
this.changePage(this.currentTopNavSelectedIndex)
this.changePage(index)
}
})
// .onAnimationEnd((index: number)=>{
// Logger.info(TAG, `onAnimationEnd ${index}`);
// })
.onAnimationEnd((index: number) => {
Logger.info(TAG, `onAnimationEnd ${index}`);
})
.onChange((index) => {
Logger.info(TAG, `onChange index : ${index}`);
if (this.isLayoutByIndex(index) || this.isBroadcastByIndex(index)) {
let nextIndex = this.currentTopNavSelectedIndex > index ? index - 1 : index + 1
if (nextIndex < this.myChannelList.length) {
// 电子报和播报 相邻
if (this.isBroadcastByIndex(nextIndex) || this.isLayoutByIndex(nextIndex)) {
nextIndex = this.currentTopNavSelectedIndex > index ? nextIndex - 1 : nextIndex + 1
if (nextIndex < this.myChannelList.length) {
this.changePage(nextIndex)
} else {
this.changePage(this.currentTopNavSelectedIndex)
}
} else {
this.changePage(nextIndex)
}
} else {
// 极左极右有特殊频道,用旧值
this.changePage(this.currentTopNavSelectedIndex)
}
}
})
}
.width('100%')
...
...
@@ -141,10 +164,14 @@ export struct TopNavigationComponentNew {
.margin({ top: this.topRectHeight })
}
/**
* 新闻tab 头部
*/
@Builder
topBar() {
Column() {
Row() {
FirstTabTopSearchComponent()
Image($r('app.media.icon_ren_min_ri_bao'))
...
...
@@ -173,19 +200,12 @@ export struct TopNavigationComponentNew {
.width(124)
.onClick(() => {
//防止多次点击
if(!this.isClickMorningEveningPaper) {
if
(!this.isClickMorningEveningPaper) {
this.isClickMorningEveningPaper = true;
let c = setInterval(() => {
this.isClickMorningEveningPaper = false
}, 1000);
// 早晚报埋点
const params: ParamType = {
"pageName": this.pageName,
"pageId": this.pageId,
}
Tracking.event("morning_evening_news_click", params)
this.clickMorningEveningPaper()
}
})
...
...
@@ -282,6 +302,11 @@ export struct TopNavigationComponentNew {
}
}
/**
* 顶部导航栏
* @param item
* @param index
*/
@Builder
tabBarBuilder(item: TopNavDTO, index: number) {
Column() {
...
...
@@ -411,7 +436,8 @@ export struct TopNavigationComponentNew {
item.myChannel = '1'
}
//频道分类
if (item.name !== '播报') { //暂时隐藏播报
//TODO 暂时隐藏播报
if (item.name !== '播报') {
if (item.myChannel === '1') {
_myChannelList.push(item)
}
...
...
@@ -451,28 +477,46 @@ export struct TopNavigationComponentNew {
}
}
/**
* 频道是播报
* @param item
* @returns
*/
private isBroadcast(item?: TopNavDTO): boolean {
// TODO 用id channelId = '2066'
return item?.name === '播报'
return item?.channelId === 2066
}
/**
* 频道是电子报
* @param item
* @returns
*/
private isLayout(item?: TopNavDTO): boolean {
// TODO 用id channelId = '2006'
return item?.name === '版面'
return item?.channelId === 2006
}
/**
* 检测播报
* @param index
* @returns
*/
private isBroadcastByIndex(index: number): boolean {
let item = this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index]
return this.isBroadcast(item)
}
/**
* 检测电子报
* @param index
* @returns
*/
private isLayoutByIndex(index: number): boolean {
let item = this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index]
return this.isLayout(item)
}
private isSpecialChannel(item?: TopNavDTO) {
// 版面、播报,可以用这个判断
// 版面、播报
、关注
,可以用这个判断
return item?.channelType === 3
}
...
...
@@ -481,7 +525,8 @@ export struct TopNavigationComponentNew {
this.topNavListHandle()
this.changePage(this.currentTopNavSelectedIndex)
console.log('XY', '----TopNavigation-------aboutToAppear'+this.navItem.name)
console.log('XY', '----TopNavigation-------aboutToAppear' + this.navItem.name)
this.getTopNavList(this.navItem.id)
}
onTopNavigationDataUpdated() {
...
...
@@ -489,14 +534,16 @@ export struct TopNavigationComponentNew {
`onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`);
}
/**
*
*/
updateCurrentTopNavSelectedIndex() {
Logger.info(TAG, `this.navItem 埋点参数topStyle: ${this.navItem.topStyle}`);
// 顶部tab埋点
if (CompUtils.isNews(this.navItem)) {
const tab = this.myChannelList[this.currentTopNavSelectedIndex]
Logger.info(TAG, `新闻tab埋点: ${JSON.stringify(tab)}`);
//
Logger.info(TAG, `新闻tab埋点: ${JSON.stringify(tab)}`);
// 埋点
const params: ParamType = {
"pageName": tab.name,
"tabName": tab.name,
...
...
@@ -507,6 +554,7 @@ export struct TopNavigationComponentNew {
const tab = this.topNavList[this.currentTopNavSelectedIndex]
Logger.info(TAG, `人民号tab埋点: ${JSON.stringify(tab)}`);
// 埋点
const params: ParamType = {
"pageName": tab.name,
"tabName": tab.name,
...
...
@@ -516,12 +564,15 @@ export struct TopNavigationComponentNew {
}
}
/**
* 自动刷新方法
*/
onAutoRefresh() {
if (this.bottomNavIndex != this._currentNavIndex) {
return
}
// 通知page刷新
this.
autoRefresh2Page++
this.
doAutoRefresh()
}
private doAutoRefresh() {
...
...
@@ -616,49 +667,34 @@ export struct TopNavigationComponentNew {
return null
}
// private getTextInfo(index: number): Record<string, number> {
// let strJson = getInspectorByKey(index.toString())
// try {
// let obj: Record<string, string> = JSON.parse(strJson)
// let rectInfo: number[][] = JSON.parse('[' + obj.$rect + ']')
// return { 'left': px2vp(rectInfo[0][0]), 'width': px2vp(rectInfo[1][0] - rectInfo[0][0]) }
// } catch (error) {
// return { 'left': 0, 'width': 0 }
// }
//
// private startAnimateTo(duration: number, leftMargin: number, width: number) {
// animateTo({
// duration: duration, // 动画时长
// curve: Curve.Linear, // 动画曲线
// iterations: 1, // 播放次数
// playMode: PlayMode.Normal, // 动画模式
// onFinish: () => {
// console.info('play end')
// }
// }, () => {
// this.indicatorLeftMargin = leftMargin
// this.indicatorWidth = width
// })
// }
// private getCurrentIndicatorInfo(index: number, event: TabsAnimationEvent): Record<string, number> {
// let nextIndex = index
// if (index > 0 && event.currentOffset > 0) {
// nextIndex--
// } else if (index < 3 && event.currentOffset < 0) {
// nextIndex++
// }
// let indexInfo = this.getTextInfo(index)
// let nextIndexInfo = this.getTextInfo(nextIndex)
// let swipeRatio = Math.abs(event.currentOffset / this.tabsWidth)
// let currentIndex = swipeRatio > 0.5 ? nextIndex : index // 页面滑动超过一半,tabBar切换到下一页。
// let currentLeft = indexInfo.left + (nextIndexInfo.left - indexInfo.left) * swipeRatio
// let currentWidth = indexInfo.width + (nextIndexInfo.width - indexInfo.width) * swipeRatio
// return { 'index': currentIndex, 'left': currentLeft, 'width': currentWidth }
// }
/**
* 进入早晚报专题
*/
clickMorningEveningPaper() {
private startAnimateTo(duration: number, leftMargin: number, width: number) {
animateTo({
duration: duration, // 动画时长
curve: Curve.Linear, // 动画曲线
iterations: 1, // 播放次数
playMode: PlayMode.Normal, // 动画模式
onFinish: () => {
console.info('play end')
}
}, () => {
this.indicatorLeftMargin = leftMargin
this.indicatorWidth = width
})
}
// 早晚报埋点
const params: ParamType = {
"pageName": this.pageName,
"pageId": this.pageId,
}
Tracking.event("morning_evening_news_click", params)
clickMorningEveningPaper() {
if (NetworkUtil.isNetConnected()) {
DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => {
if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) {
...
...
@@ -676,4 +712,14 @@ export struct TopNavigationComponentNew {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
}
}
//请求顶导数据
async getTopNavList(id: number) {
let bottomNavDetail = await ChannelViewModel.getBottomNavDetailData(id)
let topNavList = bottomNavDetail?.topNavChannelList || []
for (let topNav of topNavList) {
console.debug(TAG, 'getTopNavList=>' + JSON.stringify(topNav))
}
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/EmptyComponent.ets
View file @
606d202
...
...
@@ -129,6 +129,7 @@ export struct EmptyComponent {
.fontWeight(FontWeight.Normal)
.opacity(this.TEXT_OPACITY)
.margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP })
.fontColor(this.emptyType !== 15 ? '#FFCCCCCC' : '#999999')
.onClick((event: ClickEvent) => {
Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`);
})
...
...
sight_harmony/features/wdComponent/src/main/ets/model/EditInfoModel.ets
View file @
606d202
...
...
@@ -40,7 +40,7 @@ export class EditInfoModel{
//生日
birthday:string = ''
//性别
sex:number =
1
0
sex:number = 0
airec:number = 0
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/EditInfoViewModel.ets
View file @
606d202
...
...
@@ -41,7 +41,7 @@ class EditInfoViewModel {
new EditListInfo('简介',item&&item.userExtend.introduction?item.userExtend.introduction:'待完善'),
new EditListInfo('地区',item&&item.userExtend.address?item.userExtend.address:'待完善'),
new EditListInfo('生日',item&&item.userExtend.birthday?item.userExtend.birthday:'待完善'),
new EditListInfo('性别',item?(item.userExtend.sex ===
1
0?'待完善':(item.userExtend.sex === 1?'男':'女')):'待完善'),]
new EditListInfo('性别',item?(item.userExtend.sex === 0?'待完善':(item.userExtend.sex === 1?'男':'女')):'待完善'),]
return this.editListData
}
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailVideoListPage.ets
View file @
606d202
...
...
@@ -36,6 +36,7 @@ export struct DetailVideoListPage {
@State data: ContentDetailDTO[] = []
@State currentIndex: number = 0
@State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
@State isOffLine: boolean = false // 存储视频下线状态用来展示缺省图
@State interactDataList: InteractDataDTO[] = []
pageShowTime:number = 0;
pageHideTime:number = 0;
...
...
@@ -140,6 +141,7 @@ export struct DetailVideoListPage {
relType: relType
}).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
this.isOffLine = resDTO.data == null ? true : false
if (resDTO.data) {
const params: contentListParams = {
contentList: [{
...
...
@@ -202,7 +204,7 @@ export struct DetailVideoListPage {
build() {
if (this.netStatus !== undefined) {
EmptyComponent({
emptyType:
this.netStatus
, emptyButton: true, retry: () => {
emptyType:
1
, emptyButton: true, retry: () => {
this.getContentDetail(this.contentId, this.relId, this.relType)
}
})
...
...
@@ -211,6 +213,18 @@ export struct DetailVideoListPage {
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
} else if (this.isOffLine) {
EmptyComponent({
emptyType: 15, emptyButton: true, retry: () => {
this.getContentDetail(this.contentId, this.relId, this.relType)
}
})
.id('e_empty_content')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.backgroundColor(Color.Black)
} else {
Column() {
Swiper(this.swiperController) {
...
...
sight_harmony/features/wdHwAbility/src/main/module.json5
View file @
606d202
...
...
@@ -11,17 +11,5 @@
"compressNativeLibs"
:
true
,
"deliveryWithInstall"
:
true
,
"pages"
:
"$profile:main_pages"
,
"requestPermissions"
:
[
{
"name"
:
"ohos.permission.APPROXIMATELY_LOCATION"
,
"reason"
:
"$string:location_reason"
,
"usedScene"
:
{
"abilities"
:
[
"FormAbility"
],
"when"
:
"inuse"
}
}
]
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginPage.ets
View file @
606d202
...
...
@@ -8,6 +8,9 @@ import { WDRouterRule } from 'wdRouter/src/main/ets/router/WDRouterRule';
import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/src/main/ets/bean/content/Params'
import {InterestsHobbiesModel} from '../../../../../../../products/phone/src/main/ets/pages/viewModel/InterestsHobbiesModel'
import { TrackingPageBrowse, TrackConstants, TrackingButton, ParamType, Tracking } from 'wdTracking/Index'
import { window } from '@kit.ArkUI';
import { BusinessError } from '@kit.BasicServicesKit';
import { common } from '@kit.AbilityKit'
@Extend(Row)
function otherStyle() {
...
...
@@ -45,6 +48,7 @@ struct LoginPage {
lastTime: number = 0
@State codeStateSuccess:boolean=false
@State toastText:string = ""
@State isPrivacyMode: boolean = true;
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
msg: this.toastText,
...
...
@@ -84,6 +88,29 @@ struct LoginPage {
this.currentChanged()
}
disableScreenCapture(){
let windowClass: window.Window|undefined = undefined;
let context = getContext(this) as common.UIAbilityContext
try {
window.getLastWindow(context, (err, data) => {
if (err.code) {
return
}
windowClass = data
windowClass.setWindowPrivacyMode(this.isPrivacyMode, (err: BusinessError) => {
const errCode: number = err.code;
if (errCode) {
console.error('Failed to set the window to privacy mode. Cause:' + JSON.stringify(err));
return;
}
console.info('Succeeded in setting the window to privacy mode.');
});
})
} catch (exception) {
console.error('Failed to set the window to privacy mode. Cause:' + JSON.stringify(exception));
}
}
aboutToDisappear(): void {
this.breakpointSystem.unregister();
}
...
...
@@ -91,6 +118,8 @@ struct LoginPage {
onPageShow() {
Logger.debug(TAG, "onPageShow:" + this.isCodeSend + " ")
this.pageShowTime = DateTimeUtils.getTimeStamp()
this.isPrivacyMode = true
this.disableScreenCapture()
}
onPageHide(): void {
...
...
@@ -103,6 +132,8 @@ struct LoginPage {
}else{
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page,duration)
}
this.isPrivacyMode = false
this.disableScreenCapture()
}
build() {
...
...
@@ -637,3 +668,5 @@ function trackTypeClick(typeValue: number,pageId: string){
Tracking.event("login_type_click", params)
}
...
...
sight_harmony/features/wdLogin/src/main/module.json5
View file @
606d202
...
...
@@ -8,6 +8,11 @@
//
"tablet"
,
//
"2in1"
],
"requestPermissions"
:
[
{
"name"
:
"ohos.permission.PRIVACY_WINDOW"
}
],
"compressNativeLibs"
:
true
,
"deliveryWithInstall"
:
true
,
"pages"
:
"$profile:main_pages"
...
...
sight_harmony/products/phone/src/main/ets/pages/MainPage.ets
View file @
606d202
import { LogoutViewModel
, PermissionDesComponent
} from 'wdComponent';
import { LogoutViewModel } from 'wdComponent';
import { BreakpointConstants } from 'wdConstant';
import { common } from '@kit.AbilityKit';
import { BreakpointSystem, EmitterEventId, EmitterUtils, Logger, MpaasUpgradeCheck, WindowModel } from 'wdKit';
import { promptAction, window } from '@kit.ArkUI';
import { UpgradeTipDialog } from "./upgradePage/UpgradeTipDialog"
...
...
@@ -20,7 +19,6 @@ struct MainPage {
private breakpointSystem: BreakpointSystem = new BreakpointSystem()
@StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string =
BreakpointConstants.BREAKPOINT_XS;
@State isPermission: boolean = false
upgradeDialogController?: CustomDialogController
watchCurrentBreakpoint() {
...
...
@@ -37,9 +35,6 @@ struct MainPage {
EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => {
LogoutViewModel.clearLoginInfo()
})
EmitterUtils.receiveEvent(EmitterEventId.LOCATION, () => {
this.isPermission = true
})
}
pageTransition() {
...
...
@@ -114,9 +109,6 @@ struct MainPage {
build() {
Stack({ alignContent: Alignment.Top }) {
BottomNavigationComponent()
if (this.isPermission) {
PermissionDesComponent()
}
}
}
}
...
...
sight_harmony/products/phone/src/main/ets/pages/view/AudioComponent.ets
View file @
606d202
...
...
@@ -151,7 +151,7 @@ struct Index {
TapGesture()
.onAction((event: GestureEvent) => {
if (this.AudioSuspension.playerController) {
this.AudioSuspension.playerController.get().
switchPlayOrP
ause()
this.AudioSuspension.playerController.get().
p
ause()
this.AudioSuspension.minimize()
}
}))
...
...
sight_harmony/products/phone/src/main/ets/pages/view/BottomNavigationComponent.ets
View file @
606d202
...
...
@@ -36,7 +36,7 @@ export struct BottomNavigationComponent {
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State @Watch('onBottomNavigationDataUpdated') bottomNavList: BottomNavDTO[] = [] // 底导/顶导全部数据
@State currentNavIndex: number = BottomNavi.NEWS; // 底导当前选中/焦点下标
@State topNavList: TopNavDTO[] = []
//
@State topNavList: TopNavDTO[] = []
// 底导TabsController
private navController: TabsController = new TabsController();
readonly ASPECT_RATIO_1_1: number = 1 / 1; // 底导图片宽高比
...
...
@@ -52,8 +52,7 @@ export struct BottomNavigationComponent {
@State assignChannel: AssignChannelParam = new AssignChannelParam()
// 自动刷新触发(双击tab自动刷新)
@State autoRefresh: number = 0
// 顶导数据,从接口获取 TODO 顶导业务逻辑没看懂,暂时不替换顶导list。频道管理数据待梳理
// @State topNavMap: Record<string, TopNavDTO[]> = {}
async aboutToAppear() {
Logger.info(TAG, `aboutToAppear currentNavIndex: ${this.currentNavIndex}`);
...
...
@@ -239,11 +238,7 @@ export struct BottomNavigationComponent {
// 请求顶导数据(参数):
}
//请求顶导数据
async getTopNavList(id: number) {
let bottomNavDetail = await ChannelViewModel.getBottomNavDetailData(id)
this.topNavList = bottomNavDetail?.topNavChannelList || []
}
onBottomNavigationDataUpdated() {
Logger.error('yyyy', 'onBottomNavigationDataUpdated ' + JSON.stringify(this.bottomNavList))
...
...
@@ -366,7 +361,8 @@ export struct BottomNavigationComponent {
item.pageName = 'MY';
break;
default:
item.pageName = 'NEWS'; break;
item.pageName = 'NEWS';
break;
}
})
this.bottomNavList = list
...
...
sight_harmony/products/phone/src/main/ets/pages/view/MultiPictureDetailPageComponent.ets
View file @
606d202
...
...
@@ -55,6 +55,7 @@ export struct MultiPictureDetailPageComponent {
@Provide showCommentList: boolean = false
private scroller: Scroller = new Scroller()
@State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
@State isOffLine: boolean = false // 存储视频下线状态用来展示缺省图
@State showDownload: Boolean = false // 控制是否显示下载默认隐藏
@State publishCommentModel: publishCommentModel = new publishCommentModel()
@State operationButtonList: string[] = ['comment', 'like', 'collect', 'share']
...
...
@@ -113,7 +114,32 @@ export struct MultiPictureDetailPageComponent {
build() {
RelativeContainer() {
this.init()
if (this.contentDetailData.rmhPlatform == 1) {
this.rmh()
}
if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) {
this.imgSwiper()
}
if (this.netStatus !== undefined) {
this.noNet()
}
if (this.isOffLine) {
this.offLine()
}
Column() {
if (!this.showDownload) {
this.NShowDownload()
}
if (this.showDownload) {
this.YShowDownload()
}
}
.zIndex(10)
.id('e_swiper_bottom')
.alignRules({
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
CommentDialogView({
index: $index,
currentIndex: $currentIndex,
...
...
@@ -130,310 +156,215 @@ export struct MultiPictureDetailPageComponent {
}
@Builder
init() {
if (this.contentDetailData.rmhPlatform == 1) {
if (!this.showDownload) {
Row() {
Row({ space: 8 }) {
if (this.getImgUrl()) {
Row() {
Stack() {
Image(this.getImgUrl())
.borderRadius(18)
.aspectRatio(1)
.border({ width: 1, color: Color.White, style: BorderStyle.Solid })
.width(36)
.height(36)
.objectFit(ImageFit.Fill)
.interpolation(ImageInterpolation.High)
if (!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)) {
Stack() {
Image(this.contentDetailData.rmhInfo?.authIcon)
.width($r('app.float.vp_13'))
.height($r('app.float.vp_13'))
.objectFit(ImageFit.Cover)
}
.width(36)
.height(36)
.alignContent(Alignment.BottomEnd)
rmh() {
if (!this.showDownload) {
Row() {
Row({ space: 8 }) {
if (this.getImgUrl()) {
Row() {
Stack() {
Image(this.getImgUrl())
.borderRadius(18)
.aspectRatio(1)
.border({ width: 1, color: Color.White, style: BorderStyle.Solid })
.width(36)
.height(36)
.objectFit(ImageFit.Fill)
.interpolation(ImageInterpolation.High)
if (!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)) {
Stack() {
Image(this.contentDetailData.rmhInfo?.authIcon)
.width($r('app.float.vp_13'))
.height($r('app.float.vp_13'))
.objectFit(ImageFit.Cover)
}
.width(36)
.height(36)
.alignContent(Alignment.BottomEnd)
}
.width(36)
.height(36)
.alignContent(Alignment.Center)
.onClick(() => {
if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
// 号主页
const params: Params = {
creatorId: this.contentDetailData.rmhInfo.rmhId,
pageID: ''
}
WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
}
})
}
.width('13%')
.height('100%')
}
.width(36)
.height(36)
.alignContent(Alignment.Center)
.onClick(() => {
if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
// 号主页
const params: Params = {
creatorId: this.contentDetailData.rmhInfo.rmhId,
pageID: ''
}
WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
}
Row() {
Flex({
direction: FlexDirection.Column,
justifyContent: FlexAlign.SpaceAround,
alignItems: ItemAlign.Start
}) {
Text(`${this.contentDetailData?.rmhInfo?.rmhName}`)
.fontColor(Color.White)
.fontSize(14)
.fontFamily('PingFang PingFang SC-Medium')
.fontWeight(500)
.lineHeight(17)
.margin(0)
.height(17)
Text(`${this.contentDetailData?.rmhInfo?.rmhDesc}`)
.fontColor(Color.White)
.fontSize(12)
.fontFamily('PingFang SC-Regular')
.fontWeight(400)
.lineHeight(14)
.height(14)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin(0)
.maxLines(1)
}
})
}
.width('
81
%')
.width('
13
%')
.height('100%')
}
.width('74.4%')
.height('100%')
.margin({
top: 0,
bottom: 0,
left: 16,
right: 0
})
.onClick(() => {
if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
// 号主页
const params: Params = {
creatorId: this.contentDetailData.rmhInfo.rmhId,
pageID: ''
}
WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
}
})
Row() {
if (this.followStatus == '0') {
Button({ type: ButtonType.Normal, stateEffect: true }) {
Row() {
Text('+关注').fontSize(12).fontColor(0xffffff)
}.alignItems(VerticalAlign.Center)
}
.borderRadius(4)
.backgroundColor('#ED2800')
.width(48)
.height(24)
.onClick(() => {
this.handleAccention()
})
} else {
Button({ type: ButtonType.Normal, stateEffect: true }) {
Row() {
Text('已关注').fontSize(12).fontColor(0xffffff)
}.alignItems(VerticalAlign.Center)
}
.borderRadius(4)
.backgroundColor('#333333')
.width(54)
.height(24)
.onClick(() => {
this.handleAccention()
})
Flex({
direction: FlexDirection.Column,
justifyContent: FlexAlign.SpaceAround,
alignItems: ItemAlign.Start
}) {
Text(`${this.contentDetailData?.rmhInfo?.rmhName}`)
.fontColor(Color.White)
.fontSize(14)
.fontFamily('PingFang PingFang SC-Medium')
.fontWeight(500)
.lineHeight(17)
.margin(0)
.height(17)
Text(`${this.contentDetailData?.rmhInfo?.rmhDesc}`)
.fontColor(Color.White)
.fontSize(12)
.fontFamily('PingFang SC-Regular')
.fontWeight(400)
.lineHeight(14)
.height(14)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin(0)
.maxLines(1)
}
}
.justifyContent(FlexAlign.Center)
.alignItems(VerticalAlign.Center)
.width('21.6%')
.width('81%')
.height('100%')
}
.width('100%')
.height(44)
.zIndex(10)
.margin({ top: `${this.topSafeHeight + 12}px` })
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
.width('74.4%')
.height('100%')
.margin({
top: 0,
bottom: 0,
left: 16,
right: 0
})
.id('e_attention')
.transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(
TransitionEffect.translate({ x: 0, y: `-${this.topSafeHeight + 12}px` })
))
}
}
if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) {
Swiper(this.swiperController) {
ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => {
Swiper(this.swiperControllerItem) {
MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })
.onClick(() => {
if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
// 号主页
const params: Params = {
creatorId: this.contentDetailData.rmhInfo.rmhId,
pageID: ''
}
WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
}
.width('100%')
.height('100%')
.vertical(true)
.autoPlay(false)
.cachedCount(1)
.indicator(false)
.displayCount(1)
.onGestureSwipe((index: number, extraInfo: SwiperAnimationEvent) => {
console.info("onGestureSwipe current offset: " + extraInfo.currentOffset)
this.currentOffset = Math.abs(extraInfo.currentOffset)
})
.onTouch((event: TouchEvent) => {
if (this.duration === 0) {
this.duration = 500
})
Row() {
if (this.followStatus == '0') {
Button({ type: ButtonType.Normal, stateEffect: true }) {
Row() {
Text('+关注').fontSize(12).fontColor(0xffffff)
}.alignItems(VerticalAlign.Center)
}
if (event.type === 1) {
// if(this.currentOffset > px2vp((this.windowHeight - item.height)/2 - 100)) {
if (this.currentOffset > 160) {
router.back()
}
.borderRadius(4)
.backgroundColor('#ED2800')
.width(48)
.height(24)
.onClick(() => {
this.handleAccention()
})
} else {
Button({ type: ButtonType.Normal, stateEffect: true }) {
Row() {
Text('已关注').fontSize(12).fontColor(0xffffff)
}.alignItems(VerticalAlign.Center)
}
})
})
.borderRadius(4)
.backgroundColor('#333333')
.width(54)
.height(24)
.onClick(() => {
this.handleAccention()
})
}
}
.justifyContent(FlexAlign.Center)
.alignItems(VerticalAlign.Center)
.width('21.6%')
.height('100%')
}
.index(this.swiperIndex)
.width('100%')
.height('100%')
.vertical(false)
.autoPlay(false)
.indicator(false)
.displayCount(1)
.loop(false)
.effectMode(EdgeEffect.None)
.id('e_swiper_content')
.height(44)
.zIndex(10)
.margin({ top: `${this.topSafeHeight + 12}px` })
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center
},
top: { anchor: "__container__", align: VerticalAlign.Top
},
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.zIndex(1)
.onAnimationStart((index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => {
this.swiperIndex = targetIndex
})
.onClick(() => {
this.showDownload = !this.showDownload
})
.id('e_attention')
.transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(
TransitionEffect.translate({ x: 0, y: `-${this.topSafeHeight + 12}px` })
))
}
if (this.netStatus !== undefined) {
EmptyComponent({
emptyType: this.netStatus, emptyButton: true, retry: () => {
this.getContentDetailData()
}
@Builder
imgSwiper() {
Swiper(this.swiperController) {
ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => {
Swiper(this.swiperControllerItem) {
MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })
}
})
.id('e_empty_content')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
.width('100%')
.height('100%')
.vertical(true)
.autoPlay(false)
.cachedCount(1)
.indicator(false)
.displayCount(1)
.loop(false)
.onGestureSwipe((index: number, extraInfo: SwiperAnimationEvent) => {
console.info("onGestureSwipe current offset: " + extraInfo.currentOffset)
this.currentOffset = Math.abs(extraInfo.currentOffset)
})
}
Column() {
if (!this.showDownload) {
Column() {
Row() {
Scroll(this.scroller) {
Row() {
Flex({
direction: FlexDirection.Column,
justifyContent: FlexAlign.Start
}) {
if (this.contentDetailData?.photoList?.length) {
Text() {
Span(`${this.swiperIndex + 1}`)
.fontSize(24)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(28)
Span(`/${this.contentDetailData?.photoList?.length}`)
.fontSize(14)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(19)
}
.fontColor(Color.White)
.margin({
top: 4,
left: 18,
bottom: 4,
right: 4
})
}
if (this.contentDetailData.newsTitle) {
Text(`${this.contentDetailData.newsTitle}`)
.fontColor(Color.White)
.fontSize(16)
.fontFamily('PingFang SC-Semibold')
.fontWeight(600)
.lineHeight(24)
.margin({
top: 4,
left: 18,
bottom: 4,
right: 18
})
}
if (this.contentDetailData.photoList?.[this.swiperIndex].picDesc) {
Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`)
.fontColor(Color.White)
.fontSize(14)
.fontFamily('PingFang SC-Regular')
.fontWeight(400)
.lineHeight(22)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({
top: 4,
left: 0,
bottom: 4,
right: 18
})
.maxLines(32)
}
}
}
.width('100%')
}
.scrollable(ScrollDirection.Vertical)
.scrollBarWidth(0)
.height(px2vp(this.titleHeight))
.align(Alignment.Bottom)
.onTouch((event: TouchEvent) => {
if (this.duration === 0) {
this.duration = 500
}
OperRowListView({
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
styleType: 2,
componentType: 5,
pageComponentType: 3,
onCommentIconClick: () => {
this.showCommentList = true
if (event.type === 1) {
// if(this.currentOffset > px2vp((this.windowHeight - item.height)/2 - 100)) {
if (this.currentOffset > 160) {
router.back()
}
})
}
})
})
}
.index(this.swiperIndex)
.width('100%')
.height('100%')
.vertical(false)
.autoPlay(false)
.indicator(false)
.displayCount(1)
.loop(false)
.effectMode(EdgeEffect.Spring)
.id('e_swiper_content')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.zIndex(1)
.onAnimationStart((index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => {
this.swiperIndex = targetIndex
})
.onClick(() => {
this.showDownload = !this.showDownload
})
}
}
.transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(
TransitionEffect.translate({ x: 0, y: `-${this.bottomSafeHeight}px` })
))
}
if (this.showDownload) {
Column() {
@Builder
NShowDownload() {
Column() {
Row() {
Scroll(this.scroller) {
Row() {
Flex({
direction: FlexDirection.Row,
justifyContent: FlexAlign.SpaceBetween
direction: FlexDirection.Column,
justifyContent: FlexAlign.Start
}) {
if (this.contentDetailData?.photoList?.length) {
Text() {
...
...
@@ -449,44 +380,155 @@ export struct MultiPictureDetailPageComponent {
.lineHeight(19)
}
.fontColor(Color.White)
.margin(4)
.margin({
top: 4,
left: 18,
bottom: 4,
right: 4
})
}
if (this.contentDetailData.photoList?.[this.swiperIndex].picPath) {
ImageDownloadComponent({ url: this.contentDetailData.photoList?.[this.swiperIndex].picPath })
if (this.contentDetailData.newsTitle) {
Text(`${this.contentDetailData.newsTitle}`)
.fontColor(Color.White)
.fontSize(16)
.fontFamily('PingFang SC-Semibold')
.fontWeight(600)
.lineHeight(24)
.margin({
top:
8
,
top:
4
,
left: 18,
bottom: 24,
bottom: 4,
right: 18
})
}
if (this.contentDetailData.photoList?.[this.swiperIndex].picDesc) {
Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`)
.fontColor(Color.White)
.fontSize(14)
.fontFamily('PingFang SC-Regular')
.fontWeight(400)
.lineHeight(22)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({
top: 4,
left: 0,
bottom: 4,
right: 18
})
.parallelGesture(
TapGesture()
.onAction((event: GestureEvent) => {
TrackingContent.download(1,TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,this.pageParam)
}))
.maxLines(32)
}
}
}
.width('100%')
}
.transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(
TransitionEffect.translate({ x: 0, y: `${this.bottomSafeHeight}px` })
))
.scrollable(ScrollDirection.Vertical)
.scrollBarWidth(0)
.constraintSize({
maxHeight: px2vp(this.titleHeight)
})
.align(Alignment.Bottom)
}
OperRowListView({
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
styleType: 2,
componentType: 5,
pageComponentType: 3,
onCommentIconClick: () => {
this.showCommentList = true
}
})
}
.zIndex(10)
.id('e_swiper_bottom')
.alignRules({
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
.transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(
TransitionEffect.translate({ x: 0, y: `-${this.bottomSafeHeight}px` })
))
}
@Builder
YShowDownload() {
Column() {
Row() {
Flex({
direction: FlexDirection.Row,
justifyContent: FlexAlign.SpaceBetween
}) {
if (this.contentDetailData?.photoList?.length) {
Text() {
Span(`${this.swiperIndex + 1}`)
.fontSize(24)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(28)
Span(`/${this.contentDetailData?.photoList?.length}`)
.fontSize(14)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(19)
}
.fontColor(Color.White)
.margin(4)
}
if (this.contentDetailData.photoList?.[this.swiperIndex].picPath) {
ImageDownloadComponent({ url: this.contentDetailData.photoList?.[this.swiperIndex].picPath })
.margin({
top: 8,
left: 18,
bottom: 24,
right: 18
})
.parallelGesture(
TapGesture()
.onAction((event: GestureEvent) => {
TrackingContent.download(1,TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,this.pageParam)
}))
}
}
}
.width('100%')
}
.transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(
TransitionEffect.translate({ x: 0, y: `${this.bottomSafeHeight}px` })
))
}
@Builder
noNet() {
EmptyComponent({
emptyType: 1, emptyButton: true, retry: () => {
this.getContentDetailData()
}
})
.id('e_empty_content')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
}
@Builder
offLine() {
EmptyComponent({
emptyType: 15, emptyButton: true, retry: () => {
this.getContentDetailData
}
})
.id('e_empty_content')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.backgroundColor(Color.Black)
}
getContentDetailData() {
try {
PageRepository.fetchDetailData(this.relId, this.contentId, this.relType)
.then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
this.isOffLine = resDTO.data == null ? true : false
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'fetchDetailData is empty');
return
...
...
Please
register
or
login
to post a comment