陈剑华

Merge remote-tracking branch 'origin/main'

import { EmitterUtils, EmitterEventId, Logger } from 'wdKit/Index'
import { EmitterUtils, EmitterEventId, Logger, NetworkUtil } from 'wdKit/Index'
import MinePageDatasModel from '../../../model/MinePageDatasModel'
import { FollowListItem } from '../../../viewmodel/FollowListItem'
import { CustomTitleUI } from '../../reusable/CustomTitleUI'
import { EmptyComponent } from '../../view/EmptyComponent'
import { FollowSecondTabsComponent } from './FollowSecondTabsComponent'
const TAG = "FollowFirstTabsComponent"
@Component
... ... @@ -12,8 +13,19 @@ export struct FollowFirstTabsComponent{
@State data:FollowListItem[] = []
fontColor: string = '#999999'
selectedFontColor: string = '#000000'
@State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
aboutToAppear(){
this.getFollowTabList()
EmitterUtils.receiveEvent(EmitterEventId.MY_FOLLOW_EMPTY, (() => {
if(this.controller != null && this.data.length>1 ){
this.jumpFollowNextPage()
}
}))
}
getFollowTabList(){
MinePageDatasModel.getFollowListData(getContext(this)).then((value)=>{
this.data.push(new FollowListItem("我的"))
value.forEach((element)=>{
... ... @@ -26,12 +38,6 @@ export struct FollowFirstTabsComponent{
}).catch((err:Error)=>{
console.log(TAG,JSON.stringify(err))
})
EmitterUtils.receiveEvent(EmitterEventId.MY_FOLLOW_EMPTY, (() => {
if(this.controller != null && this.data.length>1 ){
this.jumpFollowNextPage()
}
}))
}
jumpFollowNextPage(){
... ... @@ -75,6 +81,13 @@ export struct FollowFirstTabsComponent{
//标题栏目
CustomTitleUI({titleName:"关注列表"})
if(!this.isConnectNetwork){
EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
this.reloadNetWork()
},})
.layoutWeight(1)
.width('100%')
}else{
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
ForEach(this.data, (item: FollowListItem, index: number ) => {
TabContent(){
... ... @@ -93,6 +106,15 @@ export struct FollowFirstTabsComponent{
})
.width('100%')
.layoutWeight(1)
}
}.width('100%')
}
reloadNetWork(){
let c = NetworkUtil.isNetConnected()
if(c){
this.getFollowTabList()
this.isConnectNetwork = c
}
}
}
\ No newline at end of file
... ...
import { EmitterEventId, EmitterUtils, LazyDataSource, SPHelper, UserDataLocal } from 'wdKit';
import { EmitterEventId, EmitterUtils, LazyDataSource, NetworkUtil, SPHelper, UserDataLocal } from 'wdKit';
import MinePageDatasModel from '../../../model/MinePageDatasModel';
import SearcherAboutDataModel from '../../../model/SearcherAboutDataModel';
import { CreatorDetailRequestItem } from '../../../viewmodel/CreatorDetailRequestItem';
... ... @@ -70,7 +70,11 @@ export struct FollowListDetailUI {
Column() {
if (this.count === 0) {
if (this.isGetRequest == true) {
if(this.creatorDirectoryId === -1){
if(!NetworkUtil.isNetConnected()){
EmptyComponent({ emptyType: 1,emptyHeight:"100%" })
.layoutWeight(1)
.width('100%')
}else if(this.creatorDirectoryId === -1){
EmptyComponent({ emptyType: 14,emptyHeight:"100%" })
.layoutWeight(1)
.width('100%')
... ...
... ... @@ -129,7 +129,7 @@ struct ReserveMorePage {
Stack() {
Image(item.fullColumnImgUrls[0]?.url)
.width('100%')
.height(196)
.objectFit(ImageFit.Contain)
.borderRadius(4)
this.LiveImage()
... ... @@ -283,7 +283,7 @@ struct ReserveMorePage {
.fontWeight(400)
.fontColor(Color.White)
}
.backgroundColor('#4D000000')
.backgroundColor(Color.Transparent)
.margin({ right: 8, bottom: 8 })
}
... ...
... ... @@ -16,7 +16,7 @@ export struct SearchHistoryComponent{
confirm: () => {
this.onAccept()
},
title: "确认清空历史记录",
title: "确认清空历史记录",
tipShow:false,
leftTextColor:$r('app.color.color_648DF2')
}),
... ... @@ -51,7 +51,7 @@ export struct SearchHistoryComponent{
.height('31lpx')
.width('31lpx')
.interpolation(ImageInterpolation.High)
.objectFit(ImageFit.Cover)
.objectFit(ImageFit.Auto)
.onClick(()=>{
//弹框提示
this.dialogController.open()
... ...
... ... @@ -234,7 +234,9 @@ export struct AccountAndSecurityLayout {
RelativeContainer() {
Text('注销账号')
.fontColor('#FF333333')
.fontSize(18)
.fontSize("35lpx")
.fontWeight(400)
.lineHeight("50lpx")
.textAlign(TextAlign.Center)
.height(44)
.alignRules({
... ... @@ -265,51 +267,52 @@ export struct AccountAndSecurityLayout {
Text('为保证您的账号安全,在您提交的注销申请生效前,需同时满足以下几个条件:')
.fontColor('#FF222222')
.fontSize(16)
.fontWeight(600)
.padding({ top:17,left: 16, right: 16 })
.lineHeight("42lpx")
.fontSize("31lpx")
.padding({ top:17,left: "31lpx", right: "31lpx" })
.width('100%')
Text('1. 账号处于安全状态')
.fontColor('#FF222222')
.fontSize(16)
.fontWeight(600)
.padding({ top: 24, left: 16 })
.padding({ top: 24, left: "62lpx" })
.width('100%')
Text('账号处于正常使用状态,无被盗风险。')
.fontColor('#FF666666')
.fontSize(14)
.fontWeight(400)
.padding({ top: 8, left: 16 })
.padding({ top: 8, left: "62lpx" })
.width('100%')
Text('2. 账号权限解除')
.fontColor('#FF222222')
.fontSize(16)
.fontWeight(600)
.padding({ top: 24, left: 16 })
.padding({ top: 24, left: "62lpx" })
.width('100%')
Text('账号已解除与其他产品的授权登录或绑定关系。')
.fontColor('#FF666666')
.fontSize(14)
.fontWeight(400)
.padding({ top: 8, left: 16 })
.padding({ top: 8, left: "62lpx" })
.width('100%')
Text('3. 账号无任何纠纷,包括举报投诉')
.fontColor('#FF222222')
.fontSize(16)
.fontWeight(600)
.padding({ top: 24, left: 16 })
.padding({ top: 24, left: "62lpx" })
.width('100%')
Text('请注意:注销后7天内不能再次注册人民日报客户端,需要等到账号冷静期结束才能再次登录注册')
.fontColor('#FFED2800')
.fontSize(14)
.fontWeight(400)
.padding({ top: 32, left: 16, right: 16 })
.padding({ top: 32, left: "31lpx", right: "31lpx" })
.width('100%')
}.alignRules({
... ...
... ... @@ -54,11 +54,11 @@ export struct DetailPlayShortVideoPage {
/**
* 页面显示重查用户关注、点赞等信息
*/
pageShowChange() {
async pageShowChange() {
if (this.currentIndex === this.index) {
this.queryNewsInfoOfUser()
if (this.switchVideoStatus) {
this.playerController.play()
await this.playerController.play()
this.imageVisible = false
}
}
... ... @@ -68,10 +68,10 @@ export struct DetailPlayShortVideoPage {
* 频道切换视频暂停、播放
* 页面显隐视频暂停、播放
*/
videoStatusChange() {
async videoStatusChange() {
if (this.currentIndex === this.index) {
if (this.switchVideoStatus) {
this.playerController.play()
await this.playerController.play()
this.imageVisible = false
} else {
this.playerController.pause()
... ... @@ -82,7 +82,7 @@ export struct DetailPlayShortVideoPage {
/**
* 监听下标变化手动创建或销毁视频
*/
currentIndexChange() {
async currentIndexChange() {
if (this.currentIndex != this.index) {
this.playerController.pause()
if (this.index <= this.currentIndex - 2 && this.playerController.getPlayer()) {
... ... @@ -94,7 +94,7 @@ export struct DetailPlayShortVideoPage {
if (!this.playerController.getPlayer()) {
this.playerController.firstPlay(this.contentDetailData?.videoInfo[0]?.videoUrl || '');
} else {
this.playerController.play()
await this.playerController.play()
this.imageVisible = false
}
}
... ... @@ -153,10 +153,10 @@ export struct DetailPlayShortVideoPage {
this.videoLandScape = this.contentDetailData.videoInfo[0]?.videoLandScape
this.ratio = this.contentDetailData.videoInfo[0].resolutionWidth /
this.contentDetailData.videoInfo[0].resolutionHeight
this.playerController.onCanplay = () => {
this.playerController.onCanplay = async () => {
this.ratio = this.playerController.videoWidth / this.playerController.videoHeight
if ((this.index == 0 || this.currentIndex === this.index) && this.switchVideoStatus) {
this.playerController.play()
await this.playerController.play()
this.imageVisible = false
}
}
... ... @@ -186,7 +186,7 @@ export struct DetailPlayShortVideoPage {
Stack({ alignContent: Alignment.Top }) {
Column() {
Stack() {
// this.playerCoverBuilder()
this.playerViewBuilder()
PlayerBottomView({
... ... @@ -243,16 +243,14 @@ export struct DetailPlayShortVideoPage {
*/
@Builder
playerCoverBuilder() {
// 问题:画面会闪一下
Image(this.contentDetailData?.firstFrameImageUri)
.width('100%')
.padding({
bottom: this.videoLandScape === 1 ? 115 : 0,
})// .align(this.videoLandScape === 0 ? Alignment.Top : Alignment.Center)
.fitOriginalSize(true)
.autoResize(true)
.position({ x: 0, y: this.videoLandScape === 0 ? 0 : '50%' })
.markAnchor({ y: this.videoLandScape === 0 ? 0 : '50%' })
// .visibility(this.imageVisible ? Visibility.Visible : Visibility.None)
.height(this.windowWidth / this.ratio + 'px')
.opacity(this.imageVisible ? 1 : 0)
.animation({
duration: 500, curve: Curve.EaseInOut
})
}
@Builder
... ... @@ -269,6 +267,8 @@ export struct DetailPlayShortVideoPage {
.width('100%')
.height(this.windowWidth / this.ratio + 'px')
this.playerCoverBuilder()
// .height(this.displayDirection === DisplayDirection.VIDEO_HORIZONTAL ? '100%' :
// this.videoLandScape === 1 ? 210 : 'auto')// .height(this.videoLandScape === 1 ? 210 : '100%')
// .width(this.videoLandScape === 1 ?
... ...
... ... @@ -16,7 +16,7 @@ export struct PictureLoading {
build() {
Row() {
Image(this.imagePath)
.alt($r('app.media.picture_loading'))
.alt($r('app.media.datail_imageLoading_w'))
.width(this.imageWidth)
.aspectRatio(this.ratio)
.objectFit(ImageFit.Fill)
... ...
... ... @@ -254,7 +254,8 @@ export struct VideoChannelDetail {
})
} else {
PictureLoading().visibility(this.isMouted ? Visibility.None : Visibility.Visible)
PictureLoading()
.visibility(this.isMouted ? Visibility.None : Visibility.Visible)
Swiper(this.swiperController) {
ForEach(this.data, (item: ContentDetailDTO, index: number) => {
Column() {
... ...
... ... @@ -2,6 +2,7 @@ import { PageComponent } from 'wdComponent/Index';
import { HashMap } from '@kit.ArkTS';
import { router } from '@kit.ArkUI';
import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils';
import { CustomTitleUI } from 'wdComponent/src/main/ets/components/reusable/CustomTitleUI';
const TAG = 'ColumnPage';
... ... @@ -15,21 +16,26 @@ export struct ColumnPage {
@State param: AssignChannelParam = router.getParams() as AssignChannelParam
pageId: string = "";
channelId: string = "";
pageName: string = ''
aboutToAppear() {
this.pageId = this.param.pageId
this.channelId = this.param.channelId
this.pageName = this.param.pageName
}
build() {
Column() {
CustomTitleUI({ titleName: this.pageName })
PageComponent({
currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
navIndex: this.currentTopNavSelectedIndex,
pageId: this.pageId,
channelId: this.channelId,
});
}
}.height('100%')
.width('100%')
.backgroundColor($r('app.color.white'))
}
}
... ...