张善主

Merge remote-tracking branch 'origin/main'

Showing 43 changed files with 360 additions and 264 deletions
... ... @@ -5,8 +5,8 @@
"description": "$string:shared_desc",
"deviceTypes": [
"phone",
"tablet",
"2in1"
// "tablet",
// "2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true
... ...
... ... @@ -5,8 +5,8 @@
"description": "$string:shared_desc",
"deviceTypes": [
"phone",
"tablet",
"2in1"
// "tablet",
// "2in1"
]
}
}
\ No newline at end of file
... ...
... ... @@ -5,8 +5,8 @@
"description": "$string:shared_desc",
"deviceTypes": [
"phone",
"tablet",
"2in1"
// "tablet",
// "2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
... ...
... ... @@ -5,8 +5,8 @@
"description": "$string:shared_desc",
"deviceTypes": [
"phone",
"tablet",
"2in1"
// "tablet",
// "2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
... ...
... ... @@ -5,8 +5,8 @@
"description": "$string:shared_desc",
"deviceTypes": [
"phone",
"tablet",
"2in1"
// "tablet",
// "2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true
... ...
... ... @@ -5,8 +5,8 @@
"description": "$string:shared_desc",
"deviceTypes": [
"phone",
"tablet",
"2in1"
// "tablet",
// "2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
... ...
... ... @@ -5,8 +5,8 @@
"description": "$string:shared_desc",
"deviceTypes": [
"phone",
"tablet",
"2in1"
// "tablet",
// "2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true
... ...
... ... @@ -5,8 +5,8 @@
"description": "$string:shared_desc",
"deviceTypes": [
"phone",
"tablet",
"2in1"
// "tablet",
// "2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true
... ...
... ... @@ -44,7 +44,7 @@ export struct CarderInteraction {
build() {
Row() {
if(this.contentDTO.shareFlag === '1'){
if(this.contentDetailData?.shareInfo?.shareOpen === 1){
Row() {
Image($r('app.media.CarderInteraction_share'))
.width(18)
... ... @@ -60,14 +60,9 @@ export struct CarderInteraction {
})
}
if(this.contentDTO.rmhInfo != null){
if(this.contentDTO.shareInfo != null && 1 == this.contentDTO.shareInfo.shareOpen && 1 == this.contentDTO.rmhInfo.cnShareControl){
this.commentLayout()
}
}else{
if(this.contentDetailData?.openComment == 1){
this.commentLayout()
}
this.builderLike()
}
.width('100%')
... ...
... ... @@ -45,7 +45,9 @@ export struct CompParser {
aboutToAppear(): void {
console.log('CompParser-compDTO', JSON.stringify(this.compDTO))
console.log('CompParser', JSON.stringify(this.compDTO))
this.pageName = this.pageModel.pageInfo.name
// 轮播图屏蔽音频类型稿件
if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
... ... @@ -79,11 +81,13 @@ export struct CompParser {
@Builder
componentBuilder() {
//CardParser({ contentDTO: this.compDTO.operDataList[0], compDTO:this.compDTO })
if (this.compDTO.operDataList[0]?.objectType !== '3' &&
this.compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口
if (this.compDTO.compStyle === CompStyle.Label_03) {
LabelComponent({ compDTO: this.compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
if (this.compDTO.operDataList.length > this.audioItems.length) {
ZhCarouselLayout01({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
... ... @@ -100,7 +104,7 @@ export struct CompParser {
} else {
HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
}
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_02) {
ZhSingleRow02({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
... ... @@ -117,27 +121,38 @@ export struct CompParser {
} else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) {
ZhGridLayout03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_04) {
ZhSingleRow04({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_05) {
// ZhSingleRow05({ compDTO })
// Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) {
ZhSingleRow06({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
//头图卡 和comStyle 2相同,
Card5Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0], titleShowPolicy: this.compDTO.titleShowPolicy, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 })
Card5Component({
compDTO: this.compDTO,
contentDTO: this.compDTO.operDataList[0],
titleShowPolicy: this.compDTO.titleShowPolicy,
pageId: this.pageId,
pageName: this.pageName
})
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) {
// 大图卡
Card2Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0], pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Card_09) {
//时间链卡
Card9Component({ compDTO: this.compDTO, contentDTO:this.compDTO.operDataList[0], pageId: this.pageId, pageName: this.pageName })
Card9Component({
compDTO: this.compDTO,
contentDTO:this.compDTO.operDataList[0],
pageId: this.pageId,
pageName: this.pageName
})
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if(this.compDTO.compStyle === CompStyle.Card_13){
Card6Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0], pageId: this.pageId, pageName: this.pageName })
... ... @@ -152,8 +167,6 @@ export struct CompParser {
// ZhSingleColumn05({ compDTO: compDTO })
// Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) {
// Divider().strokeWidth(3).color('#ffffff').padding({ left: 0, right: 0 }).margin({ top: -3 })
// Divider().strokeWidth(6).color('#f5f5f5')
ZhSingleColumn09({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告
... ...
... ... @@ -7,6 +7,7 @@ import { Notes } from './notes';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
import router from '@ohos.router'
/**
* 大专题卡--CompStyle: 10
... ... @@ -23,10 +24,19 @@ export struct Card10Component {
@ObjectLink compDTO: CompDTO
@State titleMarked: boolean = false;
@State textArr: textItem[] = []
@State hideDetail: boolean = false;
async aboutToAppear(): Promise<void> {
this.titleInit();
this.loadImg = await onlyWifiLoadImg();
this.initHideDetail();
}
initHideDetail() {
const curRouter = router.getState().name;
if (curRouter === 'MyCollectionListPage') {
this.hideDetail = true;
}
}
titleInit() {
... ... @@ -83,19 +93,21 @@ export struct Card10Component {
}.alignContent(Alignment.BottomStart)
// 专题列表--后端返回三个,
Column() {
ForEach(this.contentDTO.slideShows, (item: slideShows, index: number) => {
this.timelineItem(item, index)
if (index < this.contentDTO.slideShows.length - 1) {
// 在不是最后一个元素的情况下添加分隔符
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 });
}
})
if (!this.hideDetail) {
Column() {
ForEach(this.contentDTO.slideShows, (item: slideShows, index: number) => {
this.timelineItem(item, index)
if (index < this.contentDTO.slideShows.length - 1) {
// 在不是最后一个元素的情况下添加分隔符
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 });
}
})
}
}
// 底部-查看更多。根据接口返回的isMore判断是否显示查看更多
if (this.contentDTO.hasMore == 1) {
if (this.contentDTO.hasMore == 1 && !this.hideDetail) {
Row() {
Text("查看更多")
.fontSize($r("app.float.font_size_14"))
... ...
... ... @@ -233,7 +233,8 @@ struct createImg {
})
}
}
} else if (this.fullColumnImgUrls.length === 4) {
} else if (this.fullColumnImgUrls.length === 5) {
// 四图卡里面塞了一张补位卡
GridCol({
span: { xs: 4 }
}) {
... ...
... ... @@ -53,7 +53,7 @@ export struct Card5Component {
}
)
.aspectRatio(343 / 225)
if (!!this.titleShowPolicy) {
if (!!this.titleShowPolicy || this.titleShowPolicy === null ) {
Row()
.borderRadius(
{
... ...
... ... @@ -273,14 +273,14 @@ struct indicatorAnimations {
if (this.isAutoPlay) {
setTimeout(() => {
this.leftW = '100%'
this.centerFontSize = 11
this.centerFontSize = 10
}, 0)
setTimeout(() => {
this.rightW = '100%'
}, 1500)
} else {
this.leftW = '100%'
this.centerFontSize = 11
this.centerFontSize = 10
this.rightW = '100%'
}
... ... @@ -307,7 +307,7 @@ struct indicatorAnimations {
Text(this.index + 1 < 10 ? `0${this.index + 1}` : `${this.index + 1}`)
.fontSize(this.centerFontSize)
.fontColor($r('app.color.white'))
.width(16)
.width(11)
.textAlign(TextAlign.Center)
.margin({
bottom: -2
... ...
... ... @@ -153,8 +153,8 @@ export struct ZhSingleRow02 {
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
// right: $r('app.float.card_comp_pagePadding_lf'),
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
top: 8,
bottom: 8
})
.backgroundColor($r('app.color.white'))
.margin({ bottom: 8 })
... ...
... ... @@ -244,6 +244,7 @@ export struct ZhSingleRow03 {
.width(154)
.height(60)
.maxLines(3)
.fontSize(15)
.textOverflow({overflow: TextOverflow.Ellipsis})
}
.margin({bottom: 16})
... ... @@ -254,8 +255,10 @@ export struct ZhSingleRow03 {
Text(this.format(new Date(item.liveInfo.liveStartTime).getTime()))
.margin({right: 6})
.fontColor(0x000000)
.fontSize(13)
.fontSize(12)
.textAlign(TextAlign.Start)
.fontFamily('PingFang SC-Semibold')
.fontWeight(600)
Image($r('app.media.timeline_rect'))
.width(4)
.height(3)
... ... @@ -263,10 +266,13 @@ export struct ZhSingleRow03 {
Text(item.liveInfo.liveStartTime.split(' ')[1].slice(0, 5))
.margin({right: 6})
.fontColor(0x000000)
.fontSize(13)
.fontSize(12)
.fontFamily('PingFang SC-Semibold')
.fontWeight(600)
Text('开始直播')
.fontColor(0xC8C8C8)
.fontSize(13)
.fontSize(12)
.fontFamily('PingFang SC-Semibold')
}
Row() {
... ...
... ... @@ -14,15 +14,16 @@ export struct LottieView {
private politeChickyController: CanvasRenderingContext2D =
new CanvasRenderingContext2D(); // CanvasRenderingContext2D对象
private animateItem: AnimationItem | null = null; // 初始化loadAnimation接口的返回对象
@Prop title: string
// 页面隐藏销毁动画
onPageHide(): void {
this.animateItem?.destroy()
if (this.onComplete) {
this.animateItem?.removeEventListener('complete', this.onComplete)
}
}
// onPageHide(): void {
// this.animateItem?.destroy()
//
// if (this.onComplete) {
// this.animateItem?.removeEventListener('complete', this.onComplete)
// }
// }
/**
* 加载动画
... ... @@ -31,7 +32,7 @@ export struct LottieView {
loadAnimation() {
// 销毁动画,减少缓存
if (this.animateItem !== null) {
this.animateItem.destroy();
this.animateItem.destroy(this.name);
this.animateItem = null;
}
... ... @@ -54,6 +55,32 @@ export struct LottieView {
}
aboutToAppear(): void {
// console.error('XXXXZZZZ', '-------aboutToAppear-------' + this.title)
//lottie?.play()
// if(this.init){
// if(this.animateItem = null){
// this.loadAnimation();
// }
// }
}
aboutToDisappear(): void {
// console.error('XXXXZZZZ', '-------aboutToDisappear-------' + this.title)
// if(this.init){
// lottie?.destroy(this.name)
//
// if (this.onComplete) {
// this.animateItem?.removeEventListener('complete', this.onComplete)
// }
// this.animateItem = null;
// // }
}
build() {
Stack({ alignContent: Alignment.TopStart }) {
Canvas(this.politeChickyController)
... ... @@ -65,9 +92,13 @@ export struct LottieView {
this.onReady(this.animateItem)
}
})
.onClick(() => {
this.animateItem?.play()
})
.onDisAppear(() => {
lottie.destroy(this.name)
this.animateItem = null;
}).onAppear(()=>{
this.loadAnimation();
})
}
}
}
... ...
... ... @@ -57,7 +57,6 @@ export struct OtherHomePageBottomCommentComponent {
this.curPageNum = 1;
this.hasMore = true
this.isGetRequest = false
this.data_comment.clear()
if (!this.isLoading){
this.getNewPageData()
... ... @@ -134,6 +133,8 @@ export struct OtherHomePageBottomCommentComponent {
let object = new OtherUserCommentListRequestItem("", 20, this.curPageNum, time, "1", this.curUserId)
MinePageDatasModel.getOtherCommentListData(object, getContext(this)).then((value) => {
if (this.curPageNum === 1) this.data_comment.clear()
if (!this.data_comment || value.list.length == 0) {
this.hasMore = false
this.isLoading = false
... ...
... ... @@ -31,7 +31,8 @@ let preferenceTheme: dataPreferences.Preferences | null = null
@Component
struct LiveMorePage {
@State data: LazyDataSource<ContentDTO> = new LazyDataSource();
topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number;
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number;
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
type: number = 1;
pageSize: number = 20;
operDataList: ContentDTO[] = [];
... ... @@ -45,11 +46,9 @@ struct LiveMorePage {
@State liveRoomList: LiveRoomDataBean[] = []
// 点击过的数据
@State clickDatas: Array<string> = []
@State loadImg: boolean = false;
async aboutToAppear() : Promise<void>{
async aboutToAppear(): Promise<void> {
await this.getPreferencesFromStorage()
this.loadImg = await onlyWifiLoadImg();
this.getLivMoreClickPreference()
... ... @@ -59,16 +58,9 @@ struct LiveMorePage {
}
build() {
// Navigation() {
// //滑动区域
// this.ListLayout()
// }
// .titleMode(NavigationTitleMode.Mini)
// .title('直播列表')
Column() {
this.TabbarNormal()
if (this.viewType == ViewType.LOADING) {
this.LoadingLayout()
} else if (this.viewType == ViewType.ERROR) {
... ... @@ -95,14 +87,13 @@ struct LiveMorePage {
})
}
}
.height('100%')
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick(() => {
ProcessUtils.processPage(this.contentDTO)
top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)
})
}
@Builder
... ... @@ -131,7 +122,7 @@ struct LiveMorePage {
}
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.cachedCount(8)
.cachedCount(3)
.height('calc(100% - 44vp)')
.onReachEnd(() => {
Logger.debug(TAG, "触底了");
... ... @@ -158,9 +149,10 @@ struct LiveMorePage {
.margin({ top: 16, bottom: 8 })
.alignSelf(ItemAlign.Start)
.fontColor(this.isClicked(item.objectId) ? $r('app.color.color_848484') : $r('app.color.color_222222'))
Stack() {
if (item.fullColumnImgUrls && item.fullColumnImgUrls.length > 0) {
Image(this.loadImg?item.fullColumnImgUrls[0].url:'')
Image(this.loadImg ? item.fullColumnImgUrls[0].url : '')
.backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
.width('100%')
.aspectRatio(16 / 9)
... ... @@ -257,24 +249,25 @@ struct LiveMorePage {
lottieHeight: 14,
autoplay: true,
loop: true,
title: item.newsTitle
})
.margin({
right: '2vp'
})
Text('直播中')
.fontSize('12vp')
.fontWeight(400)
.fontColor(Color.White)
.textShadow({ radius: 2, color: 'rgba(0,0,0,0.3)', offsetX: 0, offsetY: 2 })
.textShadow({
radius: 2,
color: 'rgba(0,0,0,0.3)',
offsetX: 0,
offsetY: 2
})
.margin({
right: '5vp'
})
// Divider()
// .vertical(true)
// .strokeWidth(1)
// .height('12vp')
// .margin({ top: 2, bottom: 2 })
// .color(Color.White)
Image($r('app.media.icon_comp_line_live')).height('11vp').width('1.5vp')
... ... @@ -282,7 +275,12 @@ struct LiveMorePage {
Text(this.getLiveRoomNumber(item))
.fontSize('12vp')
.fontWeight(400)
.textShadow({ radius: 2, color: 'rgba(0,0,0,0.3)', offsetX: 0, offsetY: 2 })
.textShadow({
radius: 2,
color: 'rgba(0,0,0,0.3)',
offsetX: 0,
offsetY: 2
})
.fontColor(Color.White)
.margin({
left: '5vp'
... ... @@ -419,7 +417,7 @@ struct LiveMorePage {
const arr: Array<string> = []
arr.push(...this.clickDatas)
preferenceTheme.put('liveMorePage', arr).then(() => {
Logger.debug(TAG,"Succeeded in putting value of 'startup'.");
Logger.debug(TAG, "Succeeded in putting value of 'startup'.");
}).catch((err: BusinessError) => {
Logger.debug(TAG, "Failed to put value of 'startup'. code =" + err.code + ", message =" + err.message);
})
... ...
... ... @@ -31,7 +31,8 @@ const TAG: string = 'ReserveMorePage';
struct ReserveMorePage {
@State data: LazyDataSource<ContentDTO> = new LazyDataSource();
private reserveList: ReserveItemBean[] = []
topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number;
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number;
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
type: number = 2;
pageSize: number = 20;
title: string = '直播预告'
... ... @@ -78,10 +79,13 @@ struct ReserveMorePage {
this.currentPage = 1
this.getData(resolve)
},
})
}).backgroundColor($r('app.color.color_F5F5F5'))
}
}.backgroundColor($r('app.color.color_F5F5F5'))
}.height('100%').backgroundColor('#FFFFFF').padding({
top: px2vp(this.topSafeHeight),
bottom: px2vp(this.bottomSafeHeight)
})
}
... ... @@ -306,9 +310,9 @@ struct ReserveMorePage {
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
}
.backgroundColor('#FFFFFF')
.height(44)
.width('100%')
.width('100%').backgroundColor('#FFFFFF')
}
@Builder
... ... @@ -413,7 +417,9 @@ struct ReserveMorePage {
this.reservedIds = []
}
liveReviewDTO.list.forEach((content) => { content.pageId = this.pageId })
liveReviewDTO.list.forEach((content) => {
content.pageId = this.pageId
})
this.data.push(...liveReviewDTO.list)
//批量查询关注状态
this.getAppointmentInfo(liveReviewDTO.list)
... ... @@ -518,7 +524,7 @@ struct ReserveMorePage {
try {
// 埋点
Tracking.event(!reserveItem.subscribe ? "live_subscribe_click":"cancel_live_subscribe_click",
Tracking.event(!reserveItem.subscribe ? "live_subscribe_click" : "cancel_live_subscribe_click",
TrackParamConvert.program(item))
const res = await LiveModel.liveAppointment(reserveItem.relationId, reserveItem.liveId.toString(),
... ... @@ -555,6 +561,7 @@ struct ReserveMorePage {
}
}
}
getReserveDate(eventDateTimeString: string, type: number): string {
// 解析事件的日期和时间
const eventDateTime = new Date(eventDateTimeString);
... ... @@ -570,15 +577,16 @@ struct ReserveMorePage {
const currentDate = currentDateTime.setHours(0, 0, 0, 0);
if (eventDate === currentDate) {
return `今天`;
}else{
} else {
const month = eventDateTime.getMonth() + 1;
const date = eventDateTime.getDate();
return `${month}月${date}日`;
}
}else {
} else {
return `${eventTimeStr}`;
}
}
// getReserveDate(eventDateTimeString: string, type: number): string {
// // 解析事件的日期和时间
// const eventDateTime = new Date(eventDateTimeString);
... ...
... ... @@ -142,11 +142,11 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.textAlign(TextAlign.Start)
.margin({ top: 8 })
.width(150)
.width(this.compDTO.operDataList.length == 2 ? 210 : 150)
.lineHeight(19)
.height(42)
.lineHeight(21)
}
.height(134)
.padding({ right: 16 })
// .offset({x:16})
.onClick(() => {
... ...
... ... @@ -146,16 +146,18 @@ export struct LiveHorizontalCardComponent {
Column() {
Stack({ alignContent: Alignment.BottomEnd }) {
Image(this.loadImg ? item.coverUrl : '')
.backgroundColor(0xf5f5f5)
.backgroundColor(this.loadImg ? 0xffffff : 0xf5f5f5)
.aspectRatio(16 / 9)
.width(this.compDTO.operDataList.length == 2 ? 210 : 150)
.borderRadius(4)
.objectFit(ImageFit.Cover)
// .borderRadius(4)
.objectFit(ImageFit.Contain)
CardMediaInfo({
livePeopleNum:false,
contentDTO: item
})
}
.borderRadius(4)
.border({width: 1, color: 0xf5f5f5})
Text(item.newsTitle)
.fontSize($r("app.float.font_size_14"))
... ... @@ -166,9 +168,9 @@ export struct LiveHorizontalCardComponent {
.textAlign(TextAlign.Start)
.margin({ top: 8 })
.width(this.compDTO.operDataList.length == 2 ? 210 : 150)
.height(42)
.lineHeight(21)
}
.height(134)
.padding({ right: 16 })
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
... ...
... ... @@ -156,6 +156,7 @@ export struct OperRowListView {
this.likeBean['contentRelId'] = this.contentDetailData?.reLInfo?.relId + ''
}
console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData))
console.info(TAG, 'this.contentDetailData.shareInfo.shareOpen', JSON.stringify(this.contentDetailData.shareInfo.shareOpen))
console.info(TAG, 'likeBean----', JSON.stringify(this.likeBean))
console.info(TAG, 'this.operationButtonList', JSON.stringify(this.operationButtonList))
... ... @@ -384,22 +385,24 @@ export struct OperRowListView {
*/
@Builder
builderShare() {
Column() {
Image(this.styleType == 1 ? $r('app.media.iv_live_comment_share') :
$r('app.media.iv_live_comment_share_white'))
.width(24)
.height(24)
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
.onClick((event: ClickEvent) => {
this.share()
})
if(this.contentDetailData?.shareInfo?.shareOpen == 1) {
Column() {
Image(this.styleType == 1 ? $r('app.media.iv_live_comment_share') :
$r('app.media.iv_live_comment_share_white'))
.width(24)
.height(24)
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
.onClick((event: ClickEvent) => {
this.share()
})
}
.justifyContent(FlexAlign.Center)
.height(36)
.width(48)
.borderRadius(18)
.backgroundColor(this.pageComponentType === 2 ? '#4D000000' : Color.Transparent)
}
.justifyContent(FlexAlign.Center)
.height(36)
.width(48)
.borderRadius(18)
.backgroundColor(this.pageComponentType === 2 ? '#4D000000' : Color.Transparent)
}
handleStyle() {
... ...
... ... @@ -16,10 +16,10 @@ const TAG = "OtherNormalUserHomePage"
struct OtherNormalUserHomePage {
@State params:Record<string, string> = router.getParams() as Record<string, string>;
@Watch('change') @State curUserId: string = '-1';
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
pageShowTime:number = 0;
pageHideTime:number = 0;
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
onPageShow() {
this.curUserId = this.params?.['userId'];
... ... @@ -68,7 +68,7 @@ struct OtherNormalUserHomePage {
Stack({ alignContent: Alignment.Top }){
Image($r('app.media.title_bg'))
.width('100%')
.height('355lpx')
.height(`calc(${295 + this.topSafeHeight + 'lpx'})`)
.objectFit(ImageFit.Cover)
Row()
... ... @@ -83,7 +83,7 @@ struct OtherNormalUserHomePage {
Stack({ alignContent: Alignment.Top }){
this.MineHomeTitleTransparent()
this.MineHomeTitleWhite()
}
}.margin({top:px2vp(this.topSafeHeight)})
Scroll() {
Column() {
... ... @@ -175,7 +175,7 @@ struct OtherNormalUserHomePage {
this.tileOpacity = persent
}
})
.backgroundColor($r('app.color.color_transparent'))
// .backgroundColor($r('app.color.color_transparent'))
.height('184lpx')
.width('100%')
.padding({ left: '6lpx' })
... ... @@ -184,7 +184,7 @@ struct OtherNormalUserHomePage {
if(StringUtils.isNotEmpty(this.desc)){
Column() {
Row() {
Text(this.desc)
Text('简介:'+this.desc)
.fontSize('27lpx')
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis })
... ...
... ... @@ -26,6 +26,8 @@ struct SearchCreatorPage {
@State isLoading: boolean = false
@State hasMore: boolean = true
curPageNum: number = 1;
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
onPageShow() {
this.keyword = this.params?.pageID;
... ... @@ -154,51 +156,57 @@ struct SearchCreatorPage {
}
build() {
Column() {
CustomTitleUI({ titleName: "全部结果" })
Divider()
.width('100%')
.height('1lpx')
.color($r('app.color.color_F5F5F5'))
.strokeWidth('1lpx')
Column(){
if(this.count === 0){
ListHasNoMoreDataUI({style:2})
.height('100%')
}else{
List({ space: 3 }) {
LazyForEach(this.data, (item: FollowListDetailItem, index: number = 0) => {
ListItem() {
FollowChildComponent({data: item,type:1})
}
.onClick(() => {
})
}, (item: FollowListDetailItem, index: number) => index.toString())
Column(){
Column() {
CustomTitleUI({ titleName: "全部结果" })
Divider()
.width('100%')
.height('1lpx')
.color($r('app.color.color_F5F5F5'))
.strokeWidth('1lpx')
Column(){
if(this.count === 0){
ListHasNoMoreDataUI({style:2})
.height('100%')
}else{
List({ space: 3 }) {
LazyForEach(this.data, (item: FollowListDetailItem, index: number = 0) => {
ListItem() {
FollowChildComponent({data: item,type:1})
}
.onClick(() => {
})
}, (item: FollowListDetailItem, index: number) => index.toString())
//没有更多数据 显示提示
if(!this.hasMore){
ListItem(){
ListHasNoMoreDataUI()
//没有更多数据 显示提示
if(!this.hasMore){
ListItem(){
ListHasNoMoreDataUI()
}
}
}
}.cachedCount(5)
.padding({left:'31lpx',right:'31lpx'})
.layoutWeight(1)
.scrollBar(BarState.Off)
.onReachEnd(()=>{
console.log(TAG,"触底了");
if(!this.isLoading){
this.isLoading = true
//加载分页数据
this.getNewPageData()
}
})
}
}.layoutWeight(1)
}.cachedCount(5)
.padding({left:'31lpx',right:'31lpx'})
.layoutWeight(1)
.scrollBar(BarState.Off)
.onReachEnd(()=>{
console.log(TAG,"触底了");
if(!this.isLoading){
this.isLoading = true
//加载分页数据
this.getNewPageData()
}
})
}
}.layoutWeight(1)
.width('100%')
}
.width('100%')
}
.width('100%')
.height('100%')
.height('100%')
}.width("100%")
.height("100%")
.backgroundColor($r('app.color.color_transparent'))
.padding({top:px2vp(this.topSafeHeight)})
}
}
\ No newline at end of file
... ...
... ... @@ -2,12 +2,12 @@ import { CommentListItem } from './CommentListItem'
export class MineCommentListDetailItem{
list:CommentListItem[] = []
hasNext: number = 1
pageNum: number = 0
pageSize: number = 20
totalCount: number = 0
constructor(list?:CommentListItem[],pageNum?: number,pageSize?: number,totalCount?: number) {
constructor(list?:CommentListItem[],hasNext?: number,pageNum?: number,pageSize?: number,totalCount?: number) {
}
}
\ No newline at end of file
... ...
... ... @@ -5,8 +5,8 @@
"description": "$string:shared_desc",
"deviceTypes": [
"phone",
"tablet",
"2in1"
// "tablet",
// "2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
... ...
... ... @@ -5,8 +5,8 @@
"description": "$string:shared_desc",
"deviceTypes": [
"phone",
"tablet",
"2in1"
// "tablet",
// "2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
... ...
... ... @@ -5,8 +5,8 @@
"description": "$string:shared_desc",
"deviceTypes": [
"phone",
"tablet",
"2in1"
// "tablet",
// "2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
... ...
... ... @@ -208,12 +208,16 @@ export struct PlayerRightView {
build() {
Column() {
this.userBuilderView()
this.likeBuilderView()
if (this.contentDetailData?.openLikes == 1) {
this.likeBuilderView()
}
this.collectBuilderView()
if (this.contentDetailData.openComment == 1) {
if (this.contentDetailData?.openComment == 1) {
this.commentBuilderView()
}
this.shareBuilderView()
if(this.contentDetailData?.shareInfo?.shareOpen == 1) {
this.shareBuilderView()
}
}
// .backgroundColor(Color.Blue)
// .height('100%')
... ...
... ... @@ -5,8 +5,8 @@
"description": "$string:shared_desc",
"deviceTypes": [
"phone",
"tablet",
"2in1"
// "tablet",
// "2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
... ...
... ... @@ -5,8 +5,8 @@
"description": "$string:shared_desc",
"deviceTypes": [
"phone",
"tablet",
"2in1"
// "tablet",
// "2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
... ...
... ... @@ -5,8 +5,8 @@
"description": "$string:shared_desc",
"deviceTypes": [
"phone",
"tablet",
"2in1"
// "tablet",
// "2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
... ...
... ... @@ -5,8 +5,8 @@
"description": "$string:shared_desc",
"deviceTypes": [
"phone",
"tablet",
"2in1"
// "tablet",
// "2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true
... ...
... ... @@ -59,9 +59,12 @@ struct LoginProtocolWebview {
.width(24)
.aspectRatio(1)
.onClick(() => {
if(this.webviewController.accessBackward()){
this.webviewController.backward()
return
if (this.isConnectNetwork){
///无网络状态下 执行webviewController.accessBackward方法 会crash
if(this.webviewController.accessBackward()){
this.webviewController.backward()
return
}
}
router.back();
}).margin({ left: 16 })
... ...
... ... @@ -5,8 +5,8 @@
"description": "$string:shared_desc",
"deviceTypes": [
"phone",
"tablet",
"2in1"
// "tablet",
// "2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
... ...
... ... @@ -5,8 +5,8 @@
"description": "$string:shared_desc",
"deviceTypes": [
"phone",
"tablet",
"2in1"
// "tablet",
// "2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
... ...
... ... @@ -5,8 +5,8 @@
"description": "$string:shared_desc",
"deviceTypes": [
"phone",
"tablet",
"2in1"
// "tablet",
// "2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
... ...
... ... @@ -5,8 +5,8 @@
"description": "$string:shared_desc",
"deviceTypes": [
"phone",
"tablet",
"2in1"
// "tablet",
// "2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
... ...
import {InterestsHobbiesModel, InterestsList} from '../viewModel/InterestsHobbiesModel'
import { WDRouterRule } from 'wdRouter';
import { WDRouterPage } from 'wdRouter';
import { SPHelper } from 'wdKit/Index';
import { SpConstants } from 'wdConstant/Index';
import { NetworkUtil, SPHelper } from 'wdKit/Index';
import { SpConstants, ViewType } from 'wdConstant/Index';
import { CustomToast} from 'wdKit'
import { ButtonOptions, promptAction, window } from '@kit.ArkUI';
import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index';
import { ImageKnifeComponent,ScaleType } from '@ohos/imageknife';
import { EmptyComponent, WDViewDefaultType } from 'wdComponent/Index';
@Entry
@Component
... ... @@ -16,7 +17,7 @@ struct LaunchInterestsHobbiesPage {
@State interestsArray: InterestsList[] = []
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
msg: '请先选择您感兴趣的内容哦',
... ... @@ -72,71 +73,81 @@ struct LaunchInterestsHobbiesPage {
.height('35lpx')
.margin({top:'12lpx'})
Grid( ){
ForEach(this.interestsArray,(item:InterestsList,index:number)=>{
GridItem(){
Stack({alignContent:Alignment.TopStart}){
ImageKnifeComponent({imageKnifeOption:{loadSrc:item.pic?item.pic:'',mainScaleType:ScaleType.FIT_XY}})
.width('100%')
.height('100%')
.backgroundColor(Color.White)
.borderRadius(5)
// Image(item.pic)
// .width('100%')
// .height('100%')
// .backgroundColor(Color.White)
// .borderRadius(5)
Stack(){
Image('')
if(!this.isConnectNetwork){
EmptyComponent({ emptyType: 1,emptyHeight:"60%" ,retry: () => {
this.isConnectNetwork = NetworkUtil.isNetConnected()
}})
.layoutWeight(1)
.width('100%')
}else{
Grid( ){
ForEach(this.interestsArray,(item:InterestsList,index:number)=>{
GridItem(){
Stack({alignContent:Alignment.TopStart}){
ImageKnifeComponent({imageKnifeOption:{loadSrc:item.pic?item.pic:'',mainScaleType:ScaleType.FIT_XY}})
.width('100%')
.height('100%')
.backgroundColor(Color.Black)
.opacity(item.choose?0.5:0)
.backgroundColor(Color.White)
.borderRadius(5)
}
Stack(){
Column({}){
Text(item.name)
.fontSize(18)
.fontColor('#FFFFFF')
.margin({top:'21lpx',left:'19lpx'})
.width('100%')
.height('46lpx')
.fontWeight(FontWeight.Bold)
Text(item.title)
.fontSize('23lpx')
.fontColor('#FFFFFF')
.margin({top:'2lpx',left:'19lpx'})
// Image(item.pic)
// .width('100%')
// .height('100%')
// .backgroundColor(Color.White)
// .borderRadius(5)
Stack(){
Image('')
.width('100%')
.height('31lpx')
Image(item.choose ? $r('app.media.interestsSelected') : $r('app.media.interestsSelectNot'))
.height('32lpx')
.width('32lpx')
.margin({top:'80lpx',left:'120lpx'})
.height('100%')
.backgroundColor(Color.Black)
.opacity(item.choose?0.5:0)
.borderRadius(5)
}
Stack(){
Column({}){
Text(item.name)
.fontSize(18)
.fontColor('#FFFFFF')
.margin({top:'21lpx',left:'19lpx'})
.width('100%')
.height('46lpx')
.fontWeight(FontWeight.Bold)
Text(item.title)
.fontSize('23lpx')
.fontColor('#FFFFFF')
.margin({top:'2lpx',left:'19lpx'})
.width('100%')
.height('31lpx')
Image(item.choose ? $r('app.media.interestsSelected') : $r('app.media.interestsSelectNot'))
.height('32lpx')
.width('32lpx')
.margin({top:'80lpx',left:'120lpx'})
}.justifyContent(FlexAlign.Start)
}
}.justifyContent(FlexAlign.Start)
}
}
}
.width('192lpx')
.height('230lpx')
.borderRadius('8lpx')
.onClick(()=>{
//选择后改变已选择属性
item.choose = !item.choose
this.interestsArray.splice(index,1,item)
this.selectCount = this.interestsArray.filter(item => item.choose).length
})
.width('192lpx')
.height('230lpx')
.borderRadius('8lpx')
.onClick(()=>{
//选择后改变已选择属性
item.choose = !item.choose
this.interestsArray.splice(index,1,item)
this.selectCount = this.interestsArray.filter(item => item.choose).length
})
})
})
}
.width('90%')
.margin({top:'61lpx',bottom:'300lpx'})
.columnsTemplate('1fr 1fr 1fr')
.columnsGap('23lpx')
.rowsGap('23lpx')
.scrollBar(BarState.Off)
}
.width('90%')
.margin({top:'61lpx',bottom:'300lpx'})
.columnsTemplate('1fr 1fr 1fr')
.columnsGap('23lpx')
.rowsGap('23lpx')
.scrollBar(BarState.Off)
}
.width('100%')
.height('100%')
... ...
... ... @@ -110,7 +110,7 @@ export default struct CustomDialogComponent {
.margin({top: 1})
}
.width('528lpx')
.borderRadius('15')
.borderRadius('10')
.backgroundColor(Color.White)
.clip(true)
... ...
... ... @@ -321,8 +321,8 @@ export struct MultiPictureDetailPageComponent {
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.zIndex(1)
.onChange((index: number) => {
this.swiperIndex = index
.onAnimationStart((index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => {
this.swiperIndex = targetIndex
})
.onClick(() => {
this.showDownload = !this.showDownload
... ...
... ... @@ -6,8 +6,8 @@
"mainElement": "EntryAbility",
"deviceTypes": [
"phone",
"tablet",
"2in1"
// "tablet",
// "2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
... ...