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-05-08 10:04:58 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f707988629a35606c5e8359a81a7dde25add9831
f7079886
1 parent
98c03a1d
fix(详情页):动态详情页缺省页/骨架图
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
4 deletions
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
sight_harmony/features/wdComponent/src/main/ets/repository/PageRepository.ets
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
View file @
f707988
...
...
@@ -245,7 +245,6 @@ export class HttpUrlUtils {
* pageSize=20&pageNum=1&topicId=10000009445
* */
static readonly MORNING_EVENING_PAGE_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/pageInfo";
static readonly MORNING_EVENING_COMP_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/compInfo";
/**
* 直播回顾
* */
...
...
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
View file @
f707988
import { AccountManagerUtils, Logger, DateTimeUtils, SPHelper, NumberFormatterUtils, DisplayUtils } from 'wdKit';
import { AccountManagerUtils, Logger, DateTimeUtils, SPHelper, NumberFormatterUtils, DisplayUtils,
NetworkUtil } from 'wdKit';
import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
import { ContentDetailDTO,postBatchAttentionStatusParams,
PhotoListBean,
...
...
@@ -27,6 +28,8 @@ import { CardMediaInfo } from '../components/cardCommon/CardMediaInfo'
import router from '@ohos.router';
import { publishCommentModel } from './comment/model/PublishCommentModel';
import { CommentComponent } from './comment/view/CommentComponent';
import { EmptyComponent } from './view/EmptyComponent';
import { detailedSkeleton } from './skeleton/detailSkeleton';
const TAG = 'DynamicDetailComponent'
const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
...
...
@@ -55,6 +58,8 @@ export struct DynamicDetailComponent {
private mJumpInfo: ContentDTO = {} as ContentDTO;
@State publishTime: string = ''
@State isNetConnected: boolean = true
@State isPageEnd: boolean = false
async aboutToAppear() {
...
...
@@ -89,6 +94,18 @@ export struct DynamicDetailComponent {
.height($r('app.float.margin_7'))
.padding({left: $r('app.float.margin_16'), right: $r('app.float.margin_16')} )
Stack({ alignContent: Alignment.Bottom }) {
if (!this.isNetConnected) {
EmptyComponent({
emptyType: 1,
emptyButton: true,
retry: () => {
this.getContentDetailData()
}
}).padding({ bottom: 200 })
} else {
if (!this.isPageEnd) {
detailedSkeleton()
}else{
Scroll(this.scroller) {
Column() {
//号主信息
...
...
@@ -411,6 +428,8 @@ export struct DynamicDetailComponent {
.padding({ bottom: 76 })
.scrollBar(BarState.Off)
.alignSelf(ItemAlign.Start)
}
}
//底部交互区
OperRowListView({ contentDetailData: this.contentDetailData
,interactData:this.interactDataDTO
...
...
@@ -436,8 +455,10 @@ export struct DynamicDetailComponent {
* 请求(动态)详情页数据
* */
private async getContentDetailData() {
this.isNetConnected = NetworkUtil.isNetConnected()
try {
let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType)
this.isPageEnd = true;
this.contentDetailData = data[0];
let dateTime =
DateTimeUtils.parseDate(this.contentDetailData?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN);
...
...
@@ -446,6 +467,7 @@ export struct DynamicDetailComponent {
console.log('动态详情',JSON.stringify(this.contentDetailData))
} catch (exception) {
console.log('请求失败',JSON.stringify(exception))
this.isPageEnd = true;
}
this.getBatchAttentionStatus()
this.getInteractDataStatus()
...
...
sight_harmony/features/wdComponent/src/main/ets/repository/PageRepository.ets
View file @
f707988
...
...
@@ -200,7 +200,7 @@ export class PageRepository {
* topicId:专题id
* */
static getMorningEveningCompInfoUrl(pageId: number, groupId: number, refreshTime: string, topicId: string, pageNum: number, pageSize: number) {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.
MORNING_EVENING_COMP_INFO
_PATH;
let url = HttpUrlUtils.getHost() + HttpUrlUtils.
COMP
_PATH;
url = url + "?loadStrategy=first_load&pageNum=" + pageNum + "&refreshTime=" + refreshTime + "&pageId="
+ pageId + "&channelStrategy=2&groupId=" + groupId + "&topicId=" + topicId + "&pageSize=" + pageSize;
Logger.info(TAG, "getMorningEveningCompInfoUrl url = " + url)
...
...
@@ -391,7 +391,7 @@ export class PageRepository {
* */
static fetchBroadcastCompInfo(pageId: number, groupId: number, refreshTime: string, topicId:
string, channelId: string) {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.
MORNING_EVENING_COMP_INFO
_PATH;
let url = HttpUrlUtils.getHost() + HttpUrlUtils.
COMP
_PATH;
url = `${url}?topicId=${topicId}&channelStrategy=2&groupId=${groupId}&refreshTime=${refreshTime}&pageSize=50&recommend=0&pageId=${pageId}&loadStrategy=first_load&pageNum=1&channelId=${channelId}`
Logger.info(TAG, "getMorningEveningCompInfoUrl url = " + url)
return WDHttp.get<ResponseDTO<CompInfoBean>>(url)
...
...
Please
register
or
login
to post a comment