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-08-28 13:56:01 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
e7ba6ed926b72d7453cc0d730fe84a0be597b51e
e7ba6ed9
2 parents
5c329554
fe6a19fc
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
90 additions
and
170 deletions
sight_harmony/features/wdComponent/src/main/ets/components/page/MyCollectionListPage.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerBottomView.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerTitleView.ets
sight_harmony/products/phone/src/main/module.json5
sight_harmony/features/wdComponent/src/main/ets/components/page/MyCollectionListPage.ets
View file @
e7ba6ed
...
...
@@ -9,7 +9,7 @@ import NoMoreLayout from './NoMoreLayout'
import { CustomSelectUI } from '../view/CustomSelectUI';
import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI';
import { BigPicCardComponent } from '../view/BigPicCardComponent';
import { contentListItemParams } from '../../model/MyCollectionModel';
import { contentListItemParams
, MyCollectionItem
} from '../../model/MyCollectionModel';
import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh';
import { MyCustomDialog } from '../reusable/MyCustomDialog'
import { NetworkUtil } from 'wdKit/Index';
...
...
@@ -180,18 +180,9 @@ struct MyCollectionListPage {
MyCollectionViewModel.fetchMyCollectList(1,'1',this.currentPage,getContext(this)).then(collectionItem => {
if(resolve) resolve('刷新成功')
if (collectionItem && collectionItem.list && collectionItem.list.length > 0) {
if (this.currentPage === 1) {
this.allDatas = []
}
for (let index = 0; index < collectionItem.list.length; index++) {
const compDTO = collectionItem.list[index];
compDTO.isCollection = true ///用于时间展示
this.allDatas.push(compDTO)
}
if (this.allDatas.length > 0){
this.getContentData()
if (collectionItem.list.length > 0){
this.getContentData(collectionItem)
}
if (collectionItem.hasNext === 0) {
...
...
@@ -279,13 +270,13 @@ struct MyCollectionListPage {
}
}
async getContentData(){
async getContentData(
item:MyCollectionItem
){
try {
// 获取列表数据
const params: contentListParams = {
contentList: []
}
this.allDatas
.forEach((item: ContentDTO) => {
item.list
.forEach((item: ContentDTO) => {
params.contentList.push({
contentId: item.objectId,
contentType: Number(item.objectType ?? '1')
...
...
@@ -293,15 +284,26 @@ struct MyCollectionListPage {
})
this.commentList = await PeopleShipMainViewModel.getContentInteractInfo(params)
let datas: ContentDTO[] = [];
for (let index = 0; index < this.allDatas.length; index++) {
const compDTO = this.allDatas[index];
if (this.currentPage === 1) {
this.allDatas = []
}
for (let index = 0; index < item.list.length; index++) {
const compDTO = item.list[index];
compDTO.isCollection = true ///用于时间展示
compDTO.interactData = this.commentList[index]
d
atas.push(compDTO)
this.allD
atas.push(compDTO)
}
this.allDatas = []
this.allDatas.push(...datas)
} catch (exception) {
if (this.currentPage === 1) {
this.allDatas = []
}
for (let index = 0; index < item.list.length; index++) {
const compDTO = item.list[index];
compDTO.isCollection = true ///用于时间展示
this.allDatas.push(compDTO)
}
}
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerBottomView.ets
View file @
e7ba6ed
...
...
@@ -29,7 +29,7 @@ export struct PlayerBottomView {
.markAnchor({ y: '100%' })
.linearGradient({
colors: [
['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.
4
)', 1.0]
['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.
5
)', 1.0]
]
})
.visibility(this.displayDirection === DisplayDirection.VERTICAL ?
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerTitleView.ets
View file @
e7ba6ed
...
...
@@ -94,8 +94,7 @@ export struct PlayerTitleView {
}
clipStr += strArr[i]
}
clipStr += this.isOverLines ? '...' : '';
console.log(TAG, 'clipStr2:', clipStr)
console.log(TAG, 'clipStr:', clipStr)
return clipStr
}
...
...
@@ -131,8 +130,7 @@ export struct PlayerTitleView {
}
clipStr += strArr[i]
}
console.log(TAG, 'clipTitleText clipStr1:', clipStr)
clipStr += this.isTitleOverLines ? '...' : '';
console.log(TAG, 'clipTitleText clipStr:', clipStr)
return clipStr
}
...
...
@@ -219,54 +217,7 @@ export struct PlayerTitleView {
// })
// }
// } else {
this.detailDesc()
// }
Text(DateTimeUtils.formatDate(new Date(this.contentDetailData?.publishTime).getTime(),
DateTimeUtils.PATTERN_DATE_TIME_HYPHEN_MM))
.fontSize(12)
.fontColor(Color.White)
.opacity(0.7)
.lineHeight(16)
.fontWeight(400)
.fontFamily('PingFang SC-Regular')
.margin({ top: 8, bottom: 8 })
}
.width(this.windowWidth - 150 + 'px')
.padding({ left: 16, right: 22 })
.alignItems(HorizontalAlign.Start)
.visibility(this.isOpenDetail || this.isDragging ? Visibility.None : Visibility.Visible)
}
@Builder
detailDesc() {
/**
* 标题大于三行或存在简介显示查看详情按钮
*/
// if (this.rmhPlatform == 1) {
// if (this.titleHeight > 200 || this.summary) {
// Text('查看详情 > ')
// .padding({
// left: 6,
// right: 6,
// top: 4,
// bottom: 4
// })
// .borderRadius(2)
// .backgroundColor('#99636363')
// .fontFamily('PingFang SC-Regular')
// .fontColor(Color.White)
// .fontSize(12)
// .lineHeight(14)
// .fontWeight(400)
// .onClick(() => {
// this.isOpenDetail = true
// this.dialogController?.open()
// })
// }
// } else {
if (this.summary && this.titleLines < 4) {
Stack({ alignContent: Alignment.TopStart }) {
if (this.summary && this.titleLines < 4) {
Text() {
Span(this.clipText(this.summary, 14, this.summaryLines, this.windowWidth - 150 - vp2px(50)))
.fontSize(14)
...
...
@@ -278,17 +229,8 @@ export struct PlayerTitleView {
this.isOpenDetail = true
this.dialogController?.open()
})
}
// .position({ x: 0, y: 0 })
.padding({
left: 0,
right: 6,
top: 0,
bottom: 8
})
if (this.isOverLines) {
Text() {
Span('全文')
if (this.isOverLines) {
Span('... 全文')
.fontColor('#99FFFFFF')
.fontWeight(400)
.fontFamily('PingFang SC-Regular')
...
...
@@ -309,94 +251,80 @@ export struct PlayerTitleView {
this.isOpenDetail = true
this.dialogController?.open()
})
}
.textAlign(TextAlign.Center)
// .width('100%')
.position({ x: '100%', y: this.summaryLines*23 }) //行高+margin
.translate({ x: '-100%', y: '-100%' })
// .markAnchor({ x: '100%', y: '100%' })
.padding({
left: 0,
right: 6,
top: 0,
bottom: 6
})
}
.padding({
left: 0, //6
right: 6,
top: 0, //4
bottom: 8
})
}
.width('100%')
// }
Text(DateTimeUtils.formatDate(new Date(this.contentDetailData?.publishTime).getTime(),
DateTimeUtils.PATTERN_DATE_TIME_HYPHEN_MM))
.fontSize(12)
.fontColor(Color.White)
.opacity(0.7)
.lineHeight(16)
.fontWeight(400)
.fontFamily('PingFang SC-Regular')
.margin({ top: 8, bottom: 8 })
}
.width(this.windowWidth - 150 + 'px')
.padding({ left: 16, right: 22 })
.alignItems(HorizontalAlign.Start)
.visibility(this.isOpenDetail || this.isDragging ? Visibility.None : Visibility.Visible)
}
/**
* 标题
* */
@Builder
titleBuilder() {
// Stack({ alignContent: this.isTitleOverLines ? Alignment.BottomEnd : Alignment.Start }) {
Stack({ alignContent: Alignment.TopStart }) {
Text() {
Span(this.clipTitleText(this.getTitle(), 16, 4, this.windowWidth - 234 - vp2px(50)))
.fontSize(16)
.fontColor(Color.White)
.lineHeight(22)
Text() {
Span(this.clipTitleText(this.getTitle(), 16, 4, this.windowWidth - 234 - vp2px(50)))
.fontSize(16)
.fontColor(Color.White)
.lineHeight(22)
.fontWeight(600)
.fontFamily('PingFang SC-Regular')
if (this.isTitleOverLines) {
Span('... 全文')
.fontColor('#99FFFFFF')
.fontWeight(600)
.fontFamily('PingFang SC-Regular')
.fontSize(12)
.onClick(() => {
this.isOpenDetail = true
this.dialogController?.open()
})
ImageSpan($r('app.media.comment_unfold_svg'))
.width(14)
.height(14)
.objectFit(ImageFit.Fill)
.verticalAlign(ImageSpanAlignment.BOTTOM)
.margin({ bottom: 1 })// .padding({
// bottom: 4
// })
.onClick(() => {
this.isOpenDetail = true
this.dialogController?.open()
})
}
// .position({ x: 0, y: 0 })
.onAreaChange((oldArea: Area, newArea: Area) => {
//console.info(`cj2024 titleLines = ${newArea.height as number} line = ${(newArea.height as number) / 20}`)
this.titleLines = Math.floor((newArea.height as number) / 22) // 22是行高
//console.info(`cj2024 titleLines = ${this.titleLines}`)
this.updateSummaryLines()
})
.maxLines(4)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.padding({
left: 0, //6
right: 6,
top: 0, //4
bottom: 8
})
Text() {
if (this.isTitleOverLines) {
Span('全文')
.fontColor('#99FFFFFF')
.fontWeight(600)
.fontFamily('PingFang SC-Regular')
.fontSize(12)
.onClick(() => {
this.isOpenDetail = true
this.dialogController?.open()
})
ImageSpan($r('app.media.comment_unfold_svg'))
.width(14)
.height(14)
.objectFit(ImageFit.Fill)
.verticalAlign(ImageSpanAlignment.BOTTOM)
.margin({ bottom: 1 })// .padding({
// bottom: 4
// })
.onClick(() => {
this.isOpenDetail = true
this.dialogController?.open()
})
}
}
.textAlign(TextAlign.Center)
// .width('100%')
.position({ x: '100%', y: this.titleLines*23 }) //行高+margin
.translate({ x: '-100%', y: '-100%' })
// .position({ x: '100%', y: '100%' })
// .markAnchor({ x: '100%', y: '100%' })
.padding({
left: 0, //6
right: 6,
top: 0, //4
bottom: 8
})
}
.width('100%')
.onAreaChange((oldArea: Area, newArea: Area) => {
//console.info(`cj2024 titleLines = ${newArea.height as number} line = ${(newArea.height as number) / 20}`)
this.titleLines = Math.floor((newArea.height as number) / 22) // 22是行高
//console.info(`cj2024 titleLines = ${this.titleLines}`)
this.updateSummaryLines()
})
.padding({
left: 0, //6
right: 6,
top: 0, //4
bottom: 8
})
}
}
...
...
sight_harmony/products/phone/src/main/module.json5
View file @
e7ba6ed
...
...
@@ -184,16 +184,6 @@
],
"requestPermissions"
:
[
{
"name"
:
"ohos.permission.CAMERA"
,
"reason"
:
"$string:permission_camera_tip"
,
"usedScene"
:
{
"abilities"
:
[
"FormAbility"
],
"when"
:
"inuse"
}
},
{
"name"
:
"ohos.permission.READ_MEDIA"
,
"reason"
:
"$string:permission_photo_tip"
,
"usedScene"
:
{
...
...
Please
register
or
login
to post a comment