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-04-26 10:44:30 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
73e183750bc505237746ebb6af30816411d1221d
73e18375
2 parents
f7372886
434dcc6b
Merge remote-tracking branch 'origin/main'
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
122 additions
and
65 deletions
sight_harmony/commons/wdRouter/src/main/ets/router/WDRouterPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/MultiPictureDetailPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/pages/MineHomePage.ets
sight_harmony/features/wdComponent/src/main/ets/pages/ShowUserHeaderPage.ets
sight_harmony/features/wdComponent/src/main/resources/base/profile/main_pages.json
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/vertical/ChartItemCompereComponent.ets
sight_harmony/commons/wdRouter/src/main/ets/router/WDRouterPage.ets
View file @
73e1837
...
...
@@ -124,4 +124,6 @@ export class WDRouterPage {
static themeListPage = new WDRouterPage("wdComponent", "ets/components/page/ThemeListPage");
// 栏目页面、频道详情
static columnPage = new WDRouterPage("phone", "ets/pages/column/ColumnPage");
//展示头像
static showUserHeaderPage = new WDRouterPage("wdComponent", "ets/pages/ShowUserHeaderPage");
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
View file @
73e1837
...
...
@@ -44,9 +44,9 @@ export struct DynamicDetailComponent {
/**
* 关注状态:默认未关注 点击去关注
*/
@State followStatus: String = '
0
';
@State followStatus: String = '';
@State newsStatusOfUser: batchLikeAndCollectResult
| undefined = undefined
// 点赞、收藏状态
@State newsStatusOfUser: batchLikeAndCollectResult
= {} as batchLikeAndCollectResult
// 点赞、收藏状态
//跳转
private mJumpInfo: ContentDTO = {} as ContentDTO;
...
...
@@ -121,6 +121,7 @@ export struct DynamicDetailComponent {
}
.width('63%')
.margin({right: $r('app.float.margin_6')})
if(!StringUtils.isEmpty(this.followStatus)){
if (this.followStatus == '0') {
Text('关注')
.width($r('app.float.margin_54'))
...
...
@@ -148,6 +149,7 @@ export struct DynamicDetailComponent {
})
}
}
}
.width('100%')
.margin({ left: $r('app.float.margin_16')})
//内容
...
...
@@ -330,8 +332,8 @@ export struct DynamicDetailComponent {
Image(this.newsStatusOfUser?.likeStatus == '1'?
$r('app.media.icon_like_selected_redheart')
:$r('app.media.icon_like_unselect_grey_redheart'))
.width($r('app.float.margin_24'))
.height($r('app.float.margin_24'))
.width($r('app.float.margin_36'))
.height($r('app.float.margin_36'))
.objectFit(ImageFit.Cover)
if(this.interactDataDTO?.likeNum != 0){
Text(NumberFormatterUtils.formatNumberWithWan(this.interactDataDTO?.likeNum))
...
...
@@ -430,12 +432,18 @@ export struct DynamicDetailComponent {
// 已登录->查询用户对作品点赞、收藏状态
private async getInteractDataStatus() {
// 未登录,跳转登录
const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
if (!user_id) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
try {
const params: batchLikeAndCollectParams = {
contentList: [
{
contentId: this.contentDetailData[0]?.newsId + '',
contentType: this.contentDetailData[0]?.newsType + '',
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
}
]
}
...
...
@@ -453,6 +461,13 @@ export struct DynamicDetailComponent {
* 查询当前登录用户是否关注作品号主
* */
private async getBatchAttentionStatus() {
// 未登录,跳转登录
const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
if (!user_id) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
this.followStatus = '0';
return
}
try {
const params: postBatchAttentionStatusParams = {
creatorIds: [{ creatorId: this.contentDetailData?.rmhInfo?.rmhId ?? '' }]
...
...
@@ -461,7 +476,7 @@ export struct DynamicDetailComponent {
this.followStatus = data[0]?.status;
Logger.info(TAG, `followStatus:${JSON.stringify(this.followStatus)}`)
} catch (exception) {
this.followStatus = '0';
}
}
...
...
@@ -558,8 +573,6 @@ export struct DynamicDetailComponent {
contentType: this.contentDetailData?.newsType + '',
}
ContentDetailRequest.postExecuteLike(params).then(res => {
if (this.newsStatusOfUser) {
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1'
if (this.newsStatusOfUser.likeStatus === '1') {
this.interactDataDTO.likeNum = Number(this.interactDataDTO.likeNum) + 1
...
...
@@ -567,9 +580,6 @@ export struct DynamicDetailComponent {
this.interactDataDTO.likeNum = Number(this.interactDataDTO.likeNum) - 1
}
console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactDataDTO?.likeNum)
// this.queryContentInteractCount()
}
})
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/MultiPictureDetailPageComponent.ets
View file @
73e1837
import { NetworkUtil, Logger, NetworkType, SPHelper, } from 'wdKit';
import { NetworkUtil, Logger, NetworkType, SPHelper,
WindowModel
} from 'wdKit';
import { ResponseDTO } from 'wdNetwork';
import {
ContentDetailDTO,
...
...
@@ -78,42 +78,19 @@ export struct MultiPictureDetailPageComponent {
build() {
RelativeContainer() {
if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) {
Swiper(this.swiperController) {
ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => {
Swiper(this.swiperControllerItem) {
MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })
this.init()
}
.width('100%')
.height('100%')
.vertical(true)
.autoPlay(false)
.cachedCount(1)
.indicator(false)
.displayCount(1)
.onAnimationEnd(event => {
router.back()
})
})
.backgroundColor(Color.Black)
.id('e_picture_container')
// 设置顶部绘制延伸到状态栏
// 设置底部绘制延伸到导航条
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
}
.index(this.swiperIndex)
.width('100%')
.height(px2vp(this.picHeight) + 32)
.vertical(false)
.autoPlay(false)
.cachedCount(3)
.indicator(false)
.displayCount(1)
.loop(false)
.id('e_swiper_content')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.onChange((index: number) => {
this.swiperIndex = index
})
@Builder
init() {
if (this.contentDetailData.rmhPlatform == 1) {
Row() {
Row({ space: 8 }) {
...
...
@@ -154,6 +131,7 @@ export struct MultiPictureDetailPageComponent {
.height(14)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin(0)
.maxLines(1)
}
}
.width('81%')
...
...
@@ -192,11 +170,47 @@ export struct MultiPictureDetailPageComponent {
.width('100%')
.height(44)
.alignRules({
top: { anchor: "e_swiper_content", align: VerticalAlign.Top },
middle: { anchor: "e_swiper_content", align: HorizontalAlign.Center }
top: { anchor: "__container__", align: VerticalAlign.Top },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.id('e_attention')
}
if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) {
Swiper(this.swiperController) {
ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => {
Swiper(this.swiperControllerItem) {
MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })
}
.width('100%')
.height('100%')
.vertical(true)
.autoPlay(false)
.cachedCount(1)
.indicator(false)
.displayCount(1)
.onAnimationEnd(event => {
router.back()
})
})
}
.index(this.swiperIndex)
.width('100%')
.height(px2vp(this.picHeight) + 32)
.vertical(false)
.autoPlay(false)
.cachedCount(3)
.indicator(false)
.displayCount(1)
.loop(false)
.id('e_swiper_content')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.onChange((index: number) => {
this.swiperIndex = index
})
Row() {
Scroll(this.scroller) {
Row() {
...
...
@@ -295,14 +309,6 @@ export struct MultiPictureDetailPageComponent {
.border({ width: { top: 0.5 }, color: '#FFFFFF' })
.id('e_oper_row')
}
.width('100%')
.height('100%')
.backgroundColor(Color.Black)
.id('e_picture_container')
// 设置顶部绘制延伸到状态栏
// 设置底部绘制延伸到导航条
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
}
getContentDetailData() {
try {
...
...
@@ -318,6 +324,11 @@ export struct MultiPictureDetailPageComponent {
}
this.netStatus = undefined
this.contentDetailData = resDTO.data?.[0];
if (this.contentDetailData.rmhPlatform == 1) {
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#ffffff',
})
}
// this.contentDetailData.photoList = []
if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) {
// 暂无内容
...
...
sight_harmony/features/wdComponent/src/main/ets/pages/MineHomePage.ets
View file @
73e1837
...
...
@@ -29,13 +29,11 @@ struct MineHomePage {
registTime:number = 0//账号注册时间
@State registerTimeForDay:number = 0
aboutToAppear()
{
onPageShow(): void
{
this.getUserInfo()
this.getUserLevel()
}
build() {
Stack({ alignContent: Alignment.Top }){
Image($r('app.media.title_bg'))
...
...
@@ -65,9 +63,8 @@ struct MineHomePage {
.height('130lpx')
.objectFit(ImageFit.Cover)
}.onClick(()=>{
//TODO 显示头像
let params = {'userId': "531267787833221"} as Record<string, string>;
WDRouterRule.jumpWithPage(WDRouterPage.otherNormalUserHomePagePage,params)
let params = {'headPhotoUrl': this.headPhotoUrl} as Record<string, string>;
WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage,params)
}).width('135lpx')
.height('135lpx')
...
...
@@ -370,6 +367,9 @@ struct MineHomePage {
if(StringUtils.isNotEmpty(value.introduction)){
this.desc = value.introduction
this.isHasIntroduction = true
}else{
this.desc = "点击添加简介,让大家认识你"
this.isHasIntroduction = false
}
this.browseNum = value.browseNum
this.commentNum = value.commentNum
...
...
sight_harmony/features/wdComponent/src/main/ets/pages/ShowUserHeaderPage.ets
0 → 100644
View file @
73e1837
import { router } from '@kit.ArkUI';
@Entry
@Component
struct ShowUserHeaderPage {
@State headPhotoUrl: string = '';
@State params:Record<string, string> = router.getParams() as Record<string, string>;
onPageShow() {
this.headPhotoUrl = this.params?.['headPhotoUrl'];
}
build() {
Row() {
Image(this.headPhotoUrl)
.alt($r('app.media.default_head'))
.width('720lpx')
.height('720lpx')
.objectFit(ImageFit.Auto)
.clip(new Circle({ width: '720lpx', height: '720lpx' }))
}
.width('100%')
.height('100%')
.alignItems(VerticalAlign.Center)
.backgroundColor($r('app.color.color_000000'))
.onClick(()=>{
router.back()
})
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/resources/base/profile/main_pages.json
View file @
73e1837
...
...
@@ -21,6 +21,7 @@
"components/page/LiveMorePage"
,
"components/page/ReserveMorePage"
,
"pages/VideoPlayPage"
,
"components/page/ThemeListPage"
"components/page/ThemeListPage"
,
"pages/ShowUserHeaderPage"
]
}
\ No newline at end of file
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/vertical/ChartItemCompereComponent.ets
View file @
73e1837
...
...
@@ -11,7 +11,7 @@ export struct ChartItemCompereComponent {
ListItem() {
Column() {
Row() {
Image($r('app.media.
icon_live_status_running
'))
Image($r('app.media.
default_head
'))
.borderRadius(10)
.width(20)
.height(20)
...
...
@@ -24,13 +24,15 @@ export struct ChartItemCompereComponent {
Text(' 主持人 ')
.fontSize(11)
.backgroundColor('
808562
')
.backgroundColor('
#FFFFC63F
')
.fontColor('#FFFFFFFF')
.padding({ top: 2, bottom: 2, left: 4, right: 4 })
.borderRadius(4)
}.margin({ bottom: 8 })
}
.margin({ bottom: 8 })
.justifyContent(FlexAlign.Start)
Text(this.liveDetailsBean.newIntroduction).lineHeight(22)
Text(this.liveDetailsBean.newIntroduction).lineHeight(22)
.fontColor('#FFFFFFFF').fontSize(14)
}
.backgroundColor('#4D000000')
.borderRadius(3)
...
...
@@ -41,6 +43,7 @@ export struct ChartItemCompereComponent {
right: 8
})
.margin({ left: 16, bottom: 4 })
.alignItems(HorizontalAlign.Start)
}
}
...
...
Please
register
or
login
to post a comment