wangliang_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  fix: 18829 【必现】搜索结果-展开更多样式卡,点击多次后客户端闪退
  fix: 18755 0评-搜索结果页中评论数为0的数据未能隐藏评论
  ref |> 解决定位权限弹框提示问题
  图集滑动优化
  频道列表点击已下线视频,未展示内容找不到了缺省页,而是推荐其它视频播放
... ... @@ -151,7 +151,7 @@ export struct CardSourceInfo {
.flexShrink(0)
.margin({right: 4})
}
if (this.getContentDtoBean()?.interactData?.commentNum && this.showCommentNum()) {
if (Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && this.showCommentNum()) {
Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`)
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_B0B0B0"))
... ...
... ... @@ -291,7 +291,7 @@ export struct SearchResultContentComponent {
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
}
} else {
if(this.data.get(index + 1).sameContentListSize > 0) {
if(this.data?.get(index + 1)?.sameContentListSize > 0) {
Divider()
.width('100%')
.color($r('app.color.color_F5F5F5'))
... ...
... ... @@ -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}`);
})
... ...
... ... @@ -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) {
... ...
... ... @@ -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
... ...
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()
}
}
}
}
... ...
... ... @@ -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,8 +156,7 @@ export struct MultiPictureDetailPageComponent {
}
@Builder
init() {
if (this.contentDetailData.rmhPlatform == 1) {
rmh() {
if (!this.showDownload) {
Row() {
Row({ space: 8 }) {
... ... @@ -274,9 +299,10 @@ export struct MultiPictureDetailPageComponent {
TransitionEffect.translate({ x: 0, y: `-${this.topSafeHeight + 12}px` })
))
}
}
if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) {
@Builder
imgSwiper() {
Swiper(this.swiperController) {
ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => {
Swiper(this.swiperControllerItem) {
... ... @@ -289,6 +315,7 @@ export struct MultiPictureDetailPageComponent {
.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)
... ... @@ -314,7 +341,7 @@ export struct MultiPictureDetailPageComponent {
.indicator(false)
.displayCount(1)
.loop(false)
.effectMode(EdgeEffect.None)
.effectMode(EdgeEffect.Spring)
.id('e_swiper_content')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
... ... @@ -328,20 +355,9 @@ export struct MultiPictureDetailPageComponent {
this.showDownload = !this.showDownload
})
}
if (this.netStatus !== undefined) {
EmptyComponent({
emptyType: this.netStatus, emptyButton: true, retry: () => {
this.getContentDetailData()
}
})
.id('e_empty_content')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
}
Column() {
if (!this.showDownload) {
@Builder
NShowDownload() {
Column() {
Row() {
Scroll(this.scroller) {
... ... @@ -407,7 +423,9 @@ export struct MultiPictureDetailPageComponent {
}
.scrollable(ScrollDirection.Vertical)
.scrollBarWidth(0)
.height(px2vp(this.titleHeight))
.constraintSize({
maxHeight: px2vp(this.titleHeight)
})
.align(Alignment.Bottom)
}
... ... @@ -428,7 +446,9 @@ export struct MultiPictureDetailPageComponent {
TransitionEffect.translate({ x: 0, y: `-${this.bottomSafeHeight}px` })
))
}
if (this.showDownload) {
@Builder
YShowDownload() {
Column() {
Row() {
Flex({
... ... @@ -474,19 +494,41 @@ export struct MultiPictureDetailPageComponent {
TransitionEffect.translate({ x: 0, y: `${this.bottomSafeHeight}px` })
))
}
@Builder
noNet() {
EmptyComponent({
emptyType: 1, emptyButton: true, retry: () => {
this.getContentDetailData()
}
.zIndex(10)
.id('e_swiper_bottom')
})
.id('e_empty_content')
.alignRules({
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
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
... ...