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-25 17:16:46 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
be2ab8c7e63eb3d5fde4dfc2c501ad2141d36bed
be2ab8c7
2 parents
e76e7e0a
9ce3b0cf
Merge remote-tracking branch 'origin/main'
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
281 additions
and
145 deletions
sight_harmony/commons/wdWebComponent/src/main/ets/pages/H5CallNativeType.ets
sight_harmony/features/wdBean/src/main/ets/bean/live/LiveDetailsBean.ets
sight_harmony/features/wdComponent/Index.ets
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/LiveFollowComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/BottomNavigationComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/PageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponent.ets
sight_harmony/features/wdComponent/src/main/ets/utils/PullDownRefresh.ets
sight_harmony/features/wdComponent/src/main/ets/utils/PullUpLoadMore.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/PlayUIComponent.ets
sight_harmony/commons/wdWebComponent/src/main/ets/pages/H5CallNativeType.ets
View file @
be2ab8c
...
...
@@ -11,6 +11,8 @@ export class H5CallNativeType {
static jsCall_appInnerLinkMethod = 'jsCall_appInnerLinkMethod'
static jsCall_receiveH5Data = 'jsCall_receiveH5Data'
static jsCall_getAppLoginAuthInfo = 'jsCall_getAppLoginAuthInfo'
static jsCall_appNotifyEvent = 'jsCall_appNotifyEvent'
// TODO 业务自行新增类型、自行在JsBridgeBiz#performJSCallNative里添加接收分支处理。
static {
...
...
@@ -21,7 +23,7 @@ export class H5CallNativeType {
H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_appInnerLinkMethod)
H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_receiveH5Data)
H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_getAppLoginAuthInfo)
H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_appNotifyEvent)
}
}
...
...
sight_harmony/features/wdBean/src/main/ets/bean/live/LiveDetailsBean.ets
View file @
be2ab8c
import { RmhInfoDTO } from '../detail/RmhInfoDTO'
export interface LiveDetailsBean {
/**
* {
...
...
@@ -164,14 +166,16 @@ export interface LiveDetailsBean {
//迁移id
oldNewsId: string
reLInfo: ReLInfo
rmhInfo: RmhInfo
rmhInfo: RmhInfo
DTO
}
export interface LiveInfo {
//直播新闻-直播状态 wait 待开播 running 直播中 end 已结束cancel已取消paused暂停
liveState: string
//2024-04-12 15:00:00 直播开始时间
planStartTime: string
//直播样式 0-正常模式 , 1-隐藏直播间,2-隐藏大家聊 【人民号发布是竖屏的,为空】
liveStyle: number;
vlive: Array<Vlive>
mlive: MLive
...
...
@@ -197,11 +201,3 @@ export interface Vlive {
export interface ReLInfo {
relId: string
}
export interface RmhInfo {
rmhName: string;
rmhHeadUrl: string;
rmhId: string;
userId: string;
userType: string;
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/Index.ets
View file @
be2ab8c
...
...
@@ -85,3 +85,5 @@ export { AudioRowComponent } from "./src/main/ets/components/live/AudioRowCompon
export { WDLiveViewDefaultType } from "./src/main/ets/components/view/LiveEmptyComponent"
export { LiveFollowComponent } from "./src/main/ets/components/cardCommon/LiveFollowComponent"
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
View file @
be2ab8c
...
...
@@ -13,7 +13,6 @@ import {
import DetailViewModel from '../viewmodel/DetailViewModel';
import { ImageAndTextWebComponent } from './ImageAndTextWebComponent';
import { OperRowListView } from './view/OperRowListView';
import router from '@ohos.router';
import { RecommendList } from '../components/view/RecommendList'
import { CommonConstants } from 'wdConstant';
import { HttpUrlUtils } from 'wdNetwork/Index';
...
...
@@ -75,6 +74,45 @@ export struct ImageAndTextPageComponent {
isPageEnd: $isPageEnd
})
Column() {
// 点赞
if (this.contentDetailData[0]?.openLikes) {
// 点赞
Row() {
Row() {
if (this.newsStatusOfUser?.likeStatus === '1') {
Image(this.contentDetailData[0]?.likesStyle === 1 ? $r('app.media.ic_like_check') : (this.contentDetailData[0]?.likesStyle === 2 ? $r('app.media.icon_prayer_active') : $r('app.media.icon_candle_active')))
.width(24)
.height(24)
.margin({ right: 5 })
} else {
Image(this.contentDetailData[0]?.likesStyle === 1 ? $r('app.media.icon_like') : (this.contentDetailData[0]?.likesStyle === 2 ? $r('app.media.icon_prayer') : $r('app.media.icon_candle')))
.width(24)
.height(24)
.margin({ right: 5 })
}
Text(`${this.interactData?.likeNum || 0}`)
.fontSize(16)
.fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999')
.fontWeight(500)
}
.width(140)
.height(36)
.justifyContent(FlexAlign.Center)
.alignItems(VerticalAlign.Center)
.borderRadius(20)
.border({
width: 1,
color: '#EDEDED',
})
.onClick(() => {
this.toggleLikeStatus()
})
}.width(CommonConstants.FULL_WIDTH).height(80)
.justifyContent(FlexAlign.Center)
Divider().strokeWidth(6).color('#f5f5f5')
}
if (this.recommendList.length > 0) {
RecommendList({ recommendList: this.recommendList })
}
...
...
@@ -92,43 +130,7 @@ export struct ImageAndTextPageComponent {
}
//底部交互区
OperRowListView({contentDetailData: this.contentDetailData[0]})
/* Row() {
Image($r('app.media.icon_arrow_left'))
.width(24)
.height(24)
.onClick((event: ClickEvent) => {
router.back()
})
Row() {
Image($r('app.media.icon_comment'))
.width(24)
.height(24)
.margin({ right: 24 })
.id('comment')
Image($r('app.media.icon_star'))
.width(24)
.height(24)
.margin({ right: 24 })
Image($r('app.media.icon_listen'))
.width(24)
.height(24)
.margin({ right: 24 })
Image($r('app.media.icon_forward'))
.width(24)
.height(24)
}
}
.width(CommonConstants.FULL_WIDTH)
.height(56)
.padding({ left: 15, right: 15, bottom: 50, top: 20 })
.justifyContent(FlexAlign.SpaceBetween)
.backgroundColor(Color.White)*/
OperRowListView({ contentDetailData: this.contentDetailData[0] })
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/LiveFollowComponent.ets
0 → 100644
View file @
be2ab8c
/**
* 直播详情 关注相关信息
*/
import {
ContentDetailRequest,
postInteractAccentionOperateParams
} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
import { postBatchAttentionStatusParams, RmhInfoDTO } from 'wdBean/Index';
import { SpConstants } from 'wdConstant/Index';
import { Logger, SPHelper } from 'wdKit/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel';
const TAG = 'LiveFollowComponent'
@Component
export struct LiveFollowComponent {
@Prop rmhInfo: RmhInfoDTO
aboutToAppear(): void {
this.getBatchAttentionStatus()
}
/**
* 默认未关注 点击去关注
*/
@State followStatus: String = '0';
build() {
Stack() {
Stack()
.height(22)
.width(130)
.backgroundColor('#000000')
.opacity(0.3)
.borderRadius({
topLeft: 90,
bottomLeft: 90
})
Row() {
Image(this.rmhInfo.rmhHeadUrl)
.width(24)
.height(24)
.borderRadius(90)
Text(this.rmhInfo.rmhName)
.fontColor(Color.White)
.maxLines(1)
.fontWeight(500)
.fontSize('12fp')
.layoutWeight(1)
.margin({
left: 4,
right: 6
})
Blank()
Text(this.followStatus === '0' ? '关注' : '已关注')
.fontColor(Color.White)
.fontWeight(500)
.fontSize('10fp')
.padding({
left: 8,
right: 8,
top: 3,
bottom: 3
})
.borderRadius(2)
.margin({ right: 2 })
.backgroundColor(this.followStatus === '0' ? $r('app.color.color_ED2800') : $r('app.color.color_CCCCCC'))
.onClick(() => {
this.handleAccention()
})
}
.height(22)
.width(130)
}
}
/**
* 查询当前登录用户是否关注作品号主
* */
private async getBatchAttentionStatus() {
try {
const params: postBatchAttentionStatusParams = {
creatorIds: [{ creatorId: this.rmhInfo?.rmhId ?? '' }]
}
let data = await MultiPictureDetailViewModel.getBatchAttentionStatus(params)
this.followStatus = data[0]?.status;
Logger.info(TAG, `followStatus:${JSON.stringify(this.followStatus)}`)
} catch (exception) {
}
}
/**
* 关注号主
*/
async handleAccention() {
// 未登录,跳转登录
const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
if (!user_id) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
const params2: postInteractAccentionOperateParams = {
attentionUserType: this.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号)
attentionUserId: this.rmhInfo?.userId || '', // 被关注用户号主id
attentionCreatorId: this.rmhInfo?.rmhId || '', // 被关注用户号主id
status: this.followStatus == '0' ? 1 : 0,
}
ContentDetailRequest.postInteractAccentionOperate(params2).then(res => {
console.log('关注号主==', JSON.stringify(res.data))
if (this.followStatus == '1') {
this.followStatus = '0'
} else {
this.followStatus = '1'
}
})
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/BottomNavigationComponent.ets
View file @
be2ab8c
import { BottomNavi, CommonConstants } from 'wdConstant';
import { BottomNavDTO } from 'wdBean';
import { EmitterEventId, EmitterUtils, Logger } from 'wdKit';
import {
DateTimeUtils,
EmitterEventId, EmitterUtils, Logger } from 'wdKit';
import { TopNavigationComponent } from './TopNavigationComponent';
import { MinePageComponent } from './MinePageComponent';
import { CompUtils } from '../../utils/CompUtils';
...
...
@@ -40,11 +40,10 @@ export struct BottomNavigationComponent {
* Component opacity value: 0.6.
*/
readonly SIXTY_OPACITY: number = 0.6;
// 接收指定频道跳转的参数
@State assignChannel: AssignChannelParam = new AssignChannelParam()
// 用于传参到顶导组件,【不用channelParam,主要是时序问题,需要先底导处理完,再延时触发顶导处理】
@State assignChannel1: AssignChannelParam = new AssignChannelParam()
@State assignChannel: AssignChannelParam = new AssignChannelParam()
// 自动刷新触发(双击tab自动刷新)
@State autoRefresh: number = 0
async aboutToAppear() {
Logger.info(TAG, `aboutToAppear currentNavIndex: ${this.currentNavIndex}`);
let bottomNav = await PageViewModel.getBottomNavData(getContext(this))
...
...
@@ -60,8 +59,8 @@ export struct BottomNavigationComponent {
Logger.debug(TAG, 'receiveEvent JUMP_HOME_CHANNEL: ' + str)
if (str) {
// 跳转指定频道场景,传参底导id、频道id
this.assignChannel = JSON.parse(str) as AssignChannelParam
this.changeBottomNav()
let assignChannel = JSON.parse(str) as AssignChannelParam
this.changeBottomNav(assignChannel)
}
})
}
...
...
@@ -83,9 +82,11 @@ export struct BottomNavigationComponent {
groupId: navItem.id,
topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073),
_currentNavIndex: $currentNavIndex,
navIndex: index,
currentBottomNavName: navItem.name,
barBackgroundColor: $barBackgroundColor,
assignChannel: this.assignChannel1
assignChannel: this.assignChannel,
autoRefresh: this.autoRefresh
})
}
...
...
@@ -100,11 +101,6 @@ export struct BottomNavigationComponent {
.barMode(BarMode.Fixed)
// TODO:更详细的判断是视频频道
.barBackgroundColor(this.barBackgroundColor)
.onChange((index: number) => {
Logger.info(TAG, `onChange, index: ${index}`);
this.currentNavIndex = index;
// this.onBottomNavigationIndexChange()
})
.backgroundColor(this.barBackgroundColor)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
...
...
@@ -141,6 +137,19 @@ export struct BottomNavigationComponent {
}
.height($r('app.float.bottom_navigation_barHeight'))
.hoverEffect(HoverEffect.Highlight)
.onClick(() => {
if (this.currentNavIndex === index) {
// 当前tab,双击事件
this.doubleClick(() => {
Logger.info(TAG, 'tab double click ')
this.autoRefresh++
})
} else {
// 切换tab
this.currentNavIndex = index;
Logger.info(TAG, `onChange, index: ${index}`);
}
})
// .justifyContent(FlexAlign.Center)
// .onClick(() => {
...
...
@@ -164,11 +173,11 @@ export struct BottomNavigationComponent {
/**
* 底导id变化,即指定频道跳转场景
*/
changeBottomNav() {
changeBottomNav(
assignChannel: AssignChannelParam
) {
let index = -1
for (let i = 0; i < this.bottomNavList.length; i++) {
let bottomNavDTO: BottomNavDTO = this.bottomNavList[i]
if (bottomNavDTO.id.toString() ===
this.
assignChannel.bottomNavId) {
if (bottomNavDTO.id.toString() === assignChannel.bottomNavId) {
index = i
break
}
...
...
@@ -180,10 +189,27 @@ export struct BottomNavigationComponent {
setTimeout(() => {
// 底导切换后,触发顶导切换
this.assignChannel1 = new AssignChannelParam()
this.assignChannel1.pageId = this.assignChannel.pageId
this.assignChannel1.channelId = this.assignChannel.channelId
this.assignChannel1.bottomNavId = this.assignChannel.bottomNavId
this.assignChannel = new AssignChannelParam()
this.assignChannel.pageId = assignChannel.pageId
this.assignChannel.channelId = assignChannel.channelId
this.assignChannel.bottomNavId = assignChannel.bottomNavId
}, 20)
}
/**
* 双击实现
*/
doubleClickTime: number = 0
/**
* 双击实现
*/
private doubleClick(fun: () => void) {
let now = DateTimeUtils.getTimeStamp()
if (now - this.doubleClickTime < 200) {
fun()
} else {
this.doubleClickTime = now
}
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/PageComponent.ets
View file @
be2ab8c
import { CommonConstants, ViewType } from 'wdConstant';
import { Logger } from 'wdKit';
import PageViewModel from '../../viewmodel/PageViewModel';
import { EmptyComponent, WDViewDefaultType } from '../view/EmptyComponent';
import { ErrorComponent } from '../view/ErrorComponent';
import { EmptyComponent } from '../view/EmptyComponent';
import PageModel from '../../viewmodel/PageModel';
import { listTouchEvent } from '../../utils/PullDownRefresh';
import {
autoRefresh,
listTouchEvent } from '../../utils/PullDownRefresh';
import RefreshLayout from './RefreshLayout';
import { RefreshLayoutBean } from './RefreshLayoutBean';
import NoMoreLayout from './NoMoreLayout';
import LoadMoreLayout from './LoadMoreLayout';
import CustomRefreshLoadLayout from './CustomRefreshLoadLayout';
import { CompParser } from '../CompParser';
import { CompDTO } from 'wdBean';
import PageHelper from '../../viewmodel/PageHelper';
...
...
@@ -29,6 +25,8 @@ export struct PageComponent {
pageId: string = "";
channelId: string = "";
@Link @Watch('onChange') currentTopNavSelectedIndex: number
// 自动刷新通知
@Prop @Watch('onAutoRefresh') autoRefresh: number = 0
build() {
Column() {
...
...
@@ -71,6 +69,7 @@ export struct PageComponent {
this.pageModel.pullDownRefreshText, this.pageModel.pullDownRefreshHeight)
})
}
LazyForEach(this.pageModel.compList, (compDTO: CompDTO, compIndex: number) => {
ListItem() {
Column() {
...
...
@@ -230,6 +229,15 @@ export struct PageComponent {
}
}
onAutoRefresh() {
if (this.navIndex != this.currentTopNavSelectedIndex) {
return
}
// 当前页面,自动刷新数据
Logger.debug(TAG, 'page onAutoRefresh ' + this.autoRefresh)
autoRefresh(this.pageModel, this.pageAdvModel)
}
async getData() {
Logger.info(TAG, `getData id: ${this.pageId} , ${this.channelId} , navIndex: ${this.currentTopNavSelectedIndex}`);
this.pageModel.pageId = this.pageId;
...
...
@@ -237,14 +245,6 @@ export struct PageComponent {
this.pageModel.channelId = this.channelId;
this.pageModel.currentPage = 1;
PageHelper.getInitData(this.pageModel, this.pageAdvModel)
// let pageInfo = await PageViewModel.getPageInfo(this.pageModel.pageId);
// if (pageInfo == null) {
// this.pageModel.viewType = ViewType.EMPTY;
// return;
// }
// this.pageModel.pageInfo = pageInfo;
// this.pageModel.loadStrategy = 1
// PageHelper.parseGroup(this.pageModel)
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponent.ets
View file @
be2ab8c
import { Action, CompDTO, Params, TopNavDTO } from 'wdBean';
import { LazyDataSource, Logger, StringUtils } from 'wdKit';
import { CompDTO, TopNavDTO } from 'wdBean';
import { LazyDataSource, Logger } from 'wdKit';
import { ProcessUtils } from 'wdRouter';
import { PageComponent } from './PageComponent';
import { ChannelSubscriptionLayout } from './ChannelSubscriptionLayout';
import { FirstTabTopSearchComponent } from '../search/FirstTabTopSearchComponent';
import window from '@ohos.window';
import { WindowModel } from 'wdKit';
import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index';
import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils';
...
...
@@ -51,6 +49,12 @@ export struct TopNavigationComponent {
@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 navIndex: number = 0
//处理新闻tab顶导频道数据
topNavListHandle() {
...
...
@@ -201,6 +205,7 @@ export struct TopNavigationComponent {
navIndex: index,
pageId: navItem.pageId + '',
channelId: navItem.channelId + '',
autoRefresh: this.autoRefresh2Page
})
}
}
...
...
@@ -311,6 +316,14 @@ export struct TopNavigationComponent {
Logger.info(TAG, `onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`);
}
onAutoRefresh() {
if (this.navIndex != this._currentNavIndex) {
return
}
// 通知page刷新
this.autoRefresh2Page++
}
/**
* 频道id变化,即指定频道跳转场景
*/
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/PullDownRefresh.ets
View file @
be2ab8c
import promptAction from '@ohos.promptAction';
import { RefreshConstants as Const, RefreshState } from './RefreshConstants';
import { touchMoveLoadMore, touchUpLoadMore } from './PullUpLoadMore';
import { PageDTO, CompDTO } from 'wdBean';
import PageModel from '../viewmodel/PageModel';
import PageViewModel from '../viewmodel/PageViewModel';
import { DateTimeUtils } from 'wdKit';
import PageHelper from '../viewmodel/PageHelper';
import PageAdModel from '../viewmodel/PageAdvModel';
export function listTouchEvent(pageModel: PageModel,
pageAdvModel:
PageAdModel, event: TouchEvent) {
export function listTouchEvent(pageModel: PageModel,
pageAdvModel:
PageAdModel, event: TouchEvent) {
switch (event.type) {
case TouchType.Down:
pageModel.downY = event.touches[0].y;
...
...
@@ -36,7 +32,7 @@ export function listTouchEvent(pageModel: PageModel,pageAdvModel:PageAdModel, ev
}
if ((pageModel.isPullRefreshOperation === true)) {
// Lift your finger and pull down to refresh.
touchUpPullRefresh(pageModel,pageAdvModel);
touchUpPullRefresh(pageModel,
pageAdvModel);
} else {
// Fingers up, handle loading more.
touchUpLoadMore(pageModel);
...
...
@@ -66,7 +62,7 @@ export function touchMovePullRefresh(pageModel: PageModel, event: TouchEvent) {
}
}
export function touchUpPullRefresh(pageModel: PageModel,
pageAdvModel:
PageAdModel) {
export function touchUpPullRefresh(pageModel: PageModel,
pageAdvModel:
PageAdModel) {
if (pageModel.isCanRefresh === true) {
pageModel.offsetY = vp2px(pageModel.pullDownRefreshHeight);
pullRefreshState(pageModel, RefreshState.Refreshing);
...
...
@@ -74,38 +70,26 @@ export function touchUpPullRefresh(pageModel: PageModel,pageAdvModel:PageAdModel
setTimeout(() => {
let self: PageModel = pageModel;
let advSelf: PageAdModel = pageAdvModel;
PageHelper.refreshUI(self,advSelf)
// PageViewModel.getPageData(self.bizCopy(2))
// .then((data: PageDTO) => {
// self.timestamp = DateTimeUtils.getTimeStamp().toString()
// if (data == null || data.compList == null || data.compList.length == 0) {
// self.hasMore = false;
// } else {
// if (data.compList.length == self.pageSize) {
// self.currentPage++;
// self.hasMore = true;
// } else {
// self.hasMore = false;
// }
// // 刷新,替换所有数据
// self.compList.replaceAll(...data.compList)
// PageViewModel.getInteractData(data.compList).then((data: CompDTO[]) => {
// // 刷新,替换所有数据
// self.compList.replaceAll(...data)
// self.timestamp = DateTimeUtils.getTimeStamp().toString()
// })
// }
// closeRefresh(self, true);
// }).catch((err: string | Resource) => {
// promptAction.showToast({ message: err });
// closeRefresh(self, false);
// });
PageHelper.refreshUI(self, advSelf)
}, Const.DELAY_TIME);
} else {
closeRefresh(pageModel, false);
}
}
/**
* 自动刷新接口,如首页底导,双击按钮自动刷新
* @param pageModel 页面数据
* @param pageAdvModel 广告数据
*/
export function autoRefresh(pageModel: PageModel, pageAdvModel: PageAdModel) {
pageModel.isVisiblePullDown = true;
pageModel.offsetY = vp2px(pageModel.pullDownRefreshHeight);
pullRefreshState(pageModel, RefreshState.Refreshing);
pageModel.currentPage = 1;
PageHelper.refreshUI(pageModel, pageAdvModel)
}
export function pullRefreshState(pageModel: PageModel, state: number) {
switch (state) {
case RefreshState.DropDown:
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/PullUpLoadMore.ets
View file @
be2ab8c
import promptAction from '@ohos.promptAction';
import PageModel from '../viewmodel/PageModel';
import { RefreshConstants as Const } from './RefreshConstants';
import PageViewModel from '../viewmodel/PageViewModel';
import { PageDTO, CompDTO } from 'wdBean';
import { DateTimeUtils } from 'wdKit';
import PageHelper from '../viewmodel/PageHelper';
export function touchMoveLoadMore(model: PageModel, event: TouchEvent) {
...
...
@@ -30,29 +26,6 @@ export function touchUpLoadMore(model: PageModel) {
setTimeout(() => {
closeLoadMore(model);
PageHelper.loadMore(self)
// PageViewModel.getPageData(self.bizCopy())
// .then((data: PageDTO) => {
// self.timestamp = DateTimeUtils.getTimeStamp().toString()
// if (data == null || data.compList == null || data.compList.length == 0) {
// self.hasMore = false;
// } else {
// if (data.compList.length == self.pageSize) {
// self.currentPage++;
// self.hasMore = true;
// } else {
// self.hasMore = false;
// }
// let sizeBefore: number = self.compList.size();
// self.compList.push(...data.compList)
// PageViewModel.getInteractData(data.compList).then((data: CompDTO[]) => {
// // 刷新,替换所有数据
// self.compList.updateItems(sizeBefore, data)
// self.timestamp = DateTimeUtils.getTimeStamp().toString()
// })
// }
// }).catch((err: string | Resource) => {
// promptAction.showToast({ message: err });
// })
}, Const.DELAY_TIME);
} else {
closeLoadMore(self);
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
View file @
be2ab8c
...
...
@@ -98,7 +98,14 @@ export struct DetailPlayLivePage {
(data) => {
if (data.length > 0) {
if (data[0].liveInfo?.liveState == 'wait') {
//直播样式 0-正常模式 , 1-隐藏直播间,2-隐藏大家聊 【人民号发布是竖屏的,为空】
if (data[0].liveInfo?.liveStyle == 1) {
this.tabs = ['简介', '大家聊']
} else if (data[0].liveInfo?.liveStyle == 2) {
this.tabs = ['简介', '直播间',]
} else {
this.tabs = ['简介', '直播间', '大家聊']
}
} else {
this.tabs = ['直播间', '大家聊']
}
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/PlayUIComponent.ets
View file @
be2ab8c
...
...
@@ -4,6 +4,7 @@ import { devicePLSensorManager } from 'wdDetailPlayApi/Index'
import { DateFormatUtil, WDPlayerController } from 'wdPlayer/Index'
import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'
import { DisplayDirection } from 'wdConstant/Index'
import { LiveFollowComponent } from 'wdComponent/Index'
@Component
export struct PlayUIComponent {
...
...
@@ -95,7 +96,17 @@ export struct PlayUIComponent {
bottom: 10
})
Row() {
if (this.liveDetailsBean?.rmhInfo) {
LiveFollowComponent({
rmhInfo: this.liveDetailsBean.rmhInfo
})
.margin({
right: 10
})
}
this.getLiveStatusView()
}
}.width('100%')
.padding({
top: 20,
...
...
Please
register
or
login
to post a comment