陈剑华

Merge remote-tracking branch 'origin/main'

@@ -9,7 +9,7 @@ import NoMoreLayout from './NoMoreLayout' @@ -9,7 +9,7 @@ import NoMoreLayout from './NoMoreLayout'
9 import { CustomSelectUI } from '../view/CustomSelectUI'; 9 import { CustomSelectUI } from '../view/CustomSelectUI';
10 import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI'; 10 import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI';
11 import { BigPicCardComponent } from '../view/BigPicCardComponent'; 11 import { BigPicCardComponent } from '../view/BigPicCardComponent';
12 -import { contentListItemParams } from '../../model/MyCollectionModel'; 12 +import { contentListItemParams, MyCollectionItem } from '../../model/MyCollectionModel';
13 import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; 13 import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh';
14 import { MyCustomDialog } from '../reusable/MyCustomDialog' 14 import { MyCustomDialog } from '../reusable/MyCustomDialog'
15 import { NetworkUtil } from 'wdKit/Index'; 15 import { NetworkUtil } from 'wdKit/Index';
@@ -180,18 +180,9 @@ struct MyCollectionListPage { @@ -180,18 +180,9 @@ struct MyCollectionListPage {
180 MyCollectionViewModel.fetchMyCollectList(1,'1',this.currentPage,getContext(this)).then(collectionItem => { 180 MyCollectionViewModel.fetchMyCollectList(1,'1',this.currentPage,getContext(this)).then(collectionItem => {
181 if(resolve) resolve('刷新成功') 181 if(resolve) resolve('刷新成功')
182 if (collectionItem && collectionItem.list && collectionItem.list.length > 0) { 182 if (collectionItem && collectionItem.list && collectionItem.list.length > 0) {
183 - if (this.currentPage === 1) {  
184 - this.allDatas = []  
185 - }  
186 183
187 - for (let index = 0; index < collectionItem.list.length; index++) {  
188 - const compDTO = collectionItem.list[index];  
189 - compDTO.isCollection = true ///用于时间展示  
190 - this.allDatas.push(compDTO)  
191 - }  
192 -  
193 - if (this.allDatas.length > 0){  
194 - this.getContentData() 184 + if (collectionItem.list.length > 0){
  185 + this.getContentData(collectionItem)
195 } 186 }
196 187
197 if (collectionItem.hasNext === 0) { 188 if (collectionItem.hasNext === 0) {
@@ -279,13 +270,13 @@ struct MyCollectionListPage { @@ -279,13 +270,13 @@ struct MyCollectionListPage {
279 } 270 }
280 } 271 }
281 272
282 - async getContentData(){ 273 + async getContentData(item:MyCollectionItem){
283 try { 274 try {
284 // 获取列表数据 275 // 获取列表数据
285 const params: contentListParams = { 276 const params: contentListParams = {
286 contentList: [] 277 contentList: []
287 } 278 }
288 - this.allDatas.forEach((item: ContentDTO) => { 279 + item.list.forEach((item: ContentDTO) => {
289 params.contentList.push({ 280 params.contentList.push({
290 contentId: item.objectId, 281 contentId: item.objectId,
291 contentType: Number(item.objectType ?? '1') 282 contentType: Number(item.objectType ?? '1')
@@ -293,15 +284,26 @@ struct MyCollectionListPage { @@ -293,15 +284,26 @@ struct MyCollectionListPage {
293 }) 284 })
294 this.commentList = await PeopleShipMainViewModel.getContentInteractInfo(params) 285 this.commentList = await PeopleShipMainViewModel.getContentInteractInfo(params)
295 286
296 - let datas: ContentDTO[] = [];  
297 - for (let index = 0; index < this.allDatas.length; index++) {  
298 - const compDTO = this.allDatas[index]; 287 + if (this.currentPage === 1) {
  288 + this.allDatas = []
  289 + }
  290 +
  291 + for (let index = 0; index < item.list.length; index++) {
  292 + const compDTO = item.list[index];
  293 + compDTO.isCollection = true ///用于时间展示
299 compDTO.interactData = this.commentList[index] 294 compDTO.interactData = this.commentList[index]
300 - datas.push(compDTO) 295 + this.allDatas.push(compDTO)
301 } 296 }
302 - this.allDatas = []  
303 - this.allDatas.push(...datas) 297 +
304 } catch (exception) { 298 } catch (exception) {
  299 + if (this.currentPage === 1) {
  300 + this.allDatas = []
  301 + }
  302 + for (let index = 0; index < item.list.length; index++) {
  303 + const compDTO = item.list[index];
  304 + compDTO.isCollection = true ///用于时间展示
  305 + this.allDatas.push(compDTO)
  306 + }
305 } 307 }
306 } 308 }
307 } 309 }
@@ -29,7 +29,7 @@ export struct PlayerBottomView { @@ -29,7 +29,7 @@ export struct PlayerBottomView {
29 .markAnchor({ y: '100%' }) 29 .markAnchor({ y: '100%' })
30 .linearGradient({ 30 .linearGradient({
31 colors: [ 31 colors: [
32 - ['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.4)', 1.0] 32 + ['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.5)', 1.0]
33 ] 33 ]
34 }) 34 })
35 .visibility(this.displayDirection === DisplayDirection.VERTICAL ? 35 .visibility(this.displayDirection === DisplayDirection.VERTICAL ?
@@ -94,8 +94,7 @@ export struct PlayerTitleView { @@ -94,8 +94,7 @@ export struct PlayerTitleView {
94 } 94 }
95 clipStr += strArr[i] 95 clipStr += strArr[i]
96 } 96 }
97 - clipStr += this.isOverLines ? '...' : '';  
98 - console.log(TAG, 'clipStr2:', clipStr) 97 + console.log(TAG, 'clipStr:', clipStr)
99 return clipStr 98 return clipStr
100 } 99 }
101 100
@@ -131,8 +130,7 @@ export struct PlayerTitleView { @@ -131,8 +130,7 @@ export struct PlayerTitleView {
131 } 130 }
132 clipStr += strArr[i] 131 clipStr += strArr[i]
133 } 132 }
134 - console.log(TAG, 'clipTitleText clipStr1:', clipStr)  
135 - clipStr += this.isTitleOverLines ? '...' : ''; 133 + console.log(TAG, 'clipTitleText clipStr:', clipStr)
136 return clipStr 134 return clipStr
137 } 135 }
138 136
@@ -219,54 +217,7 @@ export struct PlayerTitleView { @@ -219,54 +217,7 @@ export struct PlayerTitleView {
219 // }) 217 // })
220 // } 218 // }
221 // } else { 219 // } else {
222 - this.detailDesc()  
223 - // }  
224 - Text(DateTimeUtils.formatDate(new Date(this.contentDetailData?.publishTime).getTime(),  
225 - DateTimeUtils.PATTERN_DATE_TIME_HYPHEN_MM))  
226 - .fontSize(12)  
227 - .fontColor(Color.White)  
228 - .opacity(0.7)  
229 - .lineHeight(16)  
230 - .fontWeight(400)  
231 - .fontFamily('PingFang SC-Regular')  
232 - .margin({ top: 8, bottom: 8 })  
233 -  
234 - }  
235 - .width(this.windowWidth - 150 + 'px')  
236 - .padding({ left: 16, right: 22 })  
237 - .alignItems(HorizontalAlign.Start)  
238 - .visibility(this.isOpenDetail || this.isDragging ? Visibility.None : Visibility.Visible)  
239 - }  
240 -  
241 - @Builder  
242 - detailDesc() {  
243 - /**  
244 - * 标题大于三行或存在简介显示查看详情按钮  
245 - */  
246 - // if (this.rmhPlatform == 1) {  
247 - // if (this.titleHeight > 200 || this.summary) {  
248 - // Text('查看详情 > ')  
249 - // .padding({  
250 - // left: 6,  
251 - // right: 6,  
252 - // top: 4,  
253 - // bottom: 4  
254 - // })  
255 - // .borderRadius(2)  
256 - // .backgroundColor('#99636363')  
257 - // .fontFamily('PingFang SC-Regular')  
258 - // .fontColor(Color.White)  
259 - // .fontSize(12)  
260 - // .lineHeight(14)  
261 - // .fontWeight(400)  
262 - // .onClick(() => {  
263 - // this.isOpenDetail = true  
264 - // this.dialogController?.open()  
265 - // })  
266 - // }  
267 - // } else {  
268 - if (this.summary && this.titleLines < 4) {  
269 - Stack({ alignContent: Alignment.TopStart }) { 220 + if (this.summary && this.titleLines < 4) {
270 Text() { 221 Text() {
271 Span(this.clipText(this.summary, 14, this.summaryLines, this.windowWidth - 150 - vp2px(50))) 222 Span(this.clipText(this.summary, 14, this.summaryLines, this.windowWidth - 150 - vp2px(50)))
272 .fontSize(14) 223 .fontSize(14)
@@ -278,17 +229,8 @@ export struct PlayerTitleView { @@ -278,17 +229,8 @@ export struct PlayerTitleView {
278 this.isOpenDetail = true 229 this.isOpenDetail = true
279 this.dialogController?.open() 230 this.dialogController?.open()
280 }) 231 })
281 - }  
282 - // .position({ x: 0, y: 0 })  
283 - .padding({  
284 - left: 0,  
285 - right: 6,  
286 - top: 0,  
287 - bottom: 8  
288 - })  
289 - if (this.isOverLines) {  
290 - Text() {  
291 - Span('全文') 232 + if (this.isOverLines) {
  233 + Span('... 全文')
292 .fontColor('#99FFFFFF') 234 .fontColor('#99FFFFFF')
293 .fontWeight(400) 235 .fontWeight(400)
294 .fontFamily('PingFang SC-Regular') 236 .fontFamily('PingFang SC-Regular')
@@ -309,94 +251,80 @@ export struct PlayerTitleView { @@ -309,94 +251,80 @@ export struct PlayerTitleView {
309 this.isOpenDetail = true 251 this.isOpenDetail = true
310 this.dialogController?.open() 252 this.dialogController?.open()
311 }) 253 })
  254 +
312 } 255 }
313 - .textAlign(TextAlign.Center)  
314 - // .width('100%')  
315 - .position({ x: '100%', y: this.summaryLines*23 }) //行高+margin  
316 - .translate({ x: '-100%', y: '-100%' })  
317 - // .markAnchor({ x: '100%', y: '100%' })  
318 - .padding({  
319 - left: 0,  
320 - right: 6,  
321 - top: 0,  
322 - bottom: 6  
323 - })  
324 } 256 }
  257 + .padding({
  258 + left: 0, //6
  259 + right: 6,
  260 + top: 0, //4
  261 + bottom: 8
  262 + })
  263 +
325 } 264 }
326 - .width('100%') 265 + // }
  266 + Text(DateTimeUtils.formatDate(new Date(this.contentDetailData?.publishTime).getTime(),
  267 + DateTimeUtils.PATTERN_DATE_TIME_HYPHEN_MM))
  268 + .fontSize(12)
  269 + .fontColor(Color.White)
  270 + .opacity(0.7)
  271 + .lineHeight(16)
  272 + .fontWeight(400)
  273 + .fontFamily('PingFang SC-Regular')
  274 + .margin({ top: 8, bottom: 8 })
  275 +
327 } 276 }
  277 + .width(this.windowWidth - 150 + 'px')
  278 + .padding({ left: 16, right: 22 })
  279 + .alignItems(HorizontalAlign.Start)
  280 + .visibility(this.isOpenDetail || this.isDragging ? Visibility.None : Visibility.Visible)
328 } 281 }
329 282
330 - /**  
331 - * 标题  
332 - * */  
333 @Builder 283 @Builder
334 titleBuilder() { 284 titleBuilder() {
335 - // Stack({ alignContent: this.isTitleOverLines ? Alignment.BottomEnd : Alignment.Start }) {  
336 - Stack({ alignContent: Alignment.TopStart }) {  
337 - Text() {  
338 - Span(this.clipTitleText(this.getTitle(), 16, 4, this.windowWidth - 234 - vp2px(50)))  
339 - .fontSize(16)  
340 - .fontColor(Color.White)  
341 - .lineHeight(22) 285 + Text() {
  286 + Span(this.clipTitleText(this.getTitle(), 16, 4, this.windowWidth - 234 - vp2px(50)))
  287 + .fontSize(16)
  288 + .fontColor(Color.White)
  289 + .lineHeight(22)
  290 + .fontWeight(600)
  291 + .fontFamily('PingFang SC-Regular')
  292 + if (this.isTitleOverLines) {
  293 + Span('... 全文')
  294 + .fontColor('#99FFFFFF')
342 .fontWeight(600) 295 .fontWeight(600)
343 .fontFamily('PingFang SC-Regular') 296 .fontFamily('PingFang SC-Regular')
  297 + .fontSize(12)
  298 + .onClick(() => {
  299 + this.isOpenDetail = true
  300 + this.dialogController?.open()
  301 + })
  302 + ImageSpan($r('app.media.comment_unfold_svg'))
  303 + .width(14)
  304 + .height(14)
  305 + .objectFit(ImageFit.Fill)
  306 + .verticalAlign(ImageSpanAlignment.BOTTOM)
  307 + .margin({ bottom: 1 })// .padding({
  308 + // bottom: 4
  309 + // })
  310 + .onClick(() => {
  311 + this.isOpenDetail = true
  312 + this.dialogController?.open()
  313 + })
344 314
345 } 315 }
346 - // .position({ x: 0, y: 0 })  
347 - .onAreaChange((oldArea: Area, newArea: Area) => {  
348 - //console.info(`cj2024 titleLines = ${newArea.height as number} line = ${(newArea.height as number) / 20}`)  
349 - this.titleLines = Math.floor((newArea.height as number) / 22) // 22是行高  
350 - //console.info(`cj2024 titleLines = ${this.titleLines}`)  
351 - this.updateSummaryLines()  
352 - })  
353 - .maxLines(4)  
354 - .textOverflow({ overflow: TextOverflow.Ellipsis })  
355 - .padding({  
356 - left: 0, //6  
357 - right: 6,  
358 - top: 0, //4  
359 - bottom: 8  
360 - })  
361 -  
362 - Text() {  
363 - if (this.isTitleOverLines) {  
364 - Span('全文')  
365 - .fontColor('#99FFFFFF')  
366 - .fontWeight(600)  
367 - .fontFamily('PingFang SC-Regular')  
368 - .fontSize(12)  
369 - .onClick(() => {  
370 - this.isOpenDetail = true  
371 - this.dialogController?.open()  
372 - })  
373 - ImageSpan($r('app.media.comment_unfold_svg'))  
374 - .width(14)  
375 - .height(14)  
376 - .objectFit(ImageFit.Fill)  
377 - .verticalAlign(ImageSpanAlignment.BOTTOM)  
378 - .margin({ bottom: 1 })// .padding({  
379 - // bottom: 4  
380 - // })  
381 - .onClick(() => {  
382 - this.isOpenDetail = true  
383 - this.dialogController?.open()  
384 - })  
385 - }  
386 - }  
387 - .textAlign(TextAlign.Center)  
388 - // .width('100%')  
389 - .position({ x: '100%', y: this.titleLines*23 }) //行高+margin  
390 - .translate({ x: '-100%', y: '-100%' })  
391 - // .position({ x: '100%', y: '100%' })  
392 - // .markAnchor({ x: '100%', y: '100%' })  
393 - .padding({  
394 - left: 0, //6  
395 - right: 6,  
396 - top: 0, //4  
397 - bottom: 8  
398 - })  
399 } 316 }
400 - .width('100%') 317 + .onAreaChange((oldArea: Area, newArea: Area) => {
  318 + //console.info(`cj2024 titleLines = ${newArea.height as number} line = ${(newArea.height as number) / 20}`)
  319 + this.titleLines = Math.floor((newArea.height as number) / 22) // 22是行高
  320 + //console.info(`cj2024 titleLines = ${this.titleLines}`)
  321 + this.updateSummaryLines()
  322 + })
  323 + .padding({
  324 + left: 0, //6
  325 + right: 6,
  326 + top: 0, //4
  327 + bottom: 8
  328 + })
401 } 329 }
402 } 330 }
@@ -184,16 +184,6 @@ @@ -184,16 +184,6 @@
184 ], 184 ],
185 "requestPermissions": [ 185 "requestPermissions": [
186 { 186 {
187 - "name": "ohos.permission.CAMERA",  
188 - "reason": "$string:permission_camera_tip",  
189 - "usedScene": {  
190 - "abilities": [  
191 - "FormAbility"  
192 - ],  
193 - "when": "inuse"  
194 - }  
195 - },  
196 - {  
197 "name": "ohos.permission.READ_MEDIA", 187 "name": "ohos.permission.READ_MEDIA",
198 "reason": "$string:permission_photo_tip", 188 "reason": "$string:permission_photo_tip",
199 "usedScene": { 189 "usedScene": {