wangyong_wd

播报推荐列表弹窗添加

import { CompInfoBean, CompDTO } from 'wdBean'
import { CompInfoBean, CompDTO, CompList } from 'wdBean'
import { CommonConstants } from 'wdConstant';
import { ProcessUtils } from '../../utils/ProcessUtils';
/**
* 播报--今日推荐列表
*/
... ... @@ -9,6 +8,12 @@ import { ProcessUtils } from '../../utils/ProcessUtils';
@Component
export struct RecommendLists {
@Prop recommendCompInfoBean: CompInfoBean = {} as CompInfoBean // 推荐-组件信息
recommendDialog: CustomDialogController = new CustomDialogController({
builder: CustomDialogExample({
recommendLists: this.recommendCompInfoBean?.compList
}),
offset: { dx: 0, dy: 0 }
})
build() {
Column(){
... ... @@ -32,7 +37,7 @@ export struct RecommendLists {
.justifyContent(FlexAlign.Center)
.margin({top: 5})
.onClick(() => {
// console.log(1)
this.recommendDialog.open()
})
}
}
... ... @@ -62,9 +67,65 @@ export struct RecommendLists {
ProcessUtils.processPage(item.operDataList[0])
})
}
}
@Builder
recommendListItem() {
@CustomDialog
struct CustomDialogExample {
controller: CustomDialogController
@Prop recommendLists: CompList[]
build() {
Column(){
Text('推荐列表')
.fontSize($r('app.float.selected_text_size'))
.fontWeight(500)
.fontColor($r('app.color.color_323232'))
.height(57)
.width(CommonConstants.FULL_WIDTH)
.padding({left: 16})
Divider()
List(){
ForEach(this.recommendLists, (item: CompDTO, index: number) => {
ListItem(){
this.listItem(item, index)
}
.onClick(() => {
ProcessUtils.processPage(item.operDataList[0])
this.controller.close()
})
})
}.layoutWeight(1)
Divider()
Text('取消')
.fontSize($r('app.float.font_size_16'))
.fontColor($r('app.color.color_323232'))
.width(CommonConstants.FULL_WIDTH)
.height(57)
.textAlign(TextAlign.Center)
.onClick(() => {
this.controller.close()
})
}
.height('80%')
}
@Builder listItem(item: CompDTO,index: number) {
Row(){
Text(String(index+1))
.width(24)
.height(24)
.textAlign(TextAlign.Center)
.fontSize($r('app.float.font_size_14'))
.fontColor($r('app.color.color_48505A'))
Text(item.operDataList[0].newsTitle)
.layoutWeight(1)
.maxLines(1)
.textOverflow({overflow:TextOverflow.Ellipsis})
.margin({left: 16})
.fontSize($r('app.float.font_size_16'))
.fontColor($r('app.color.color_212228'))
}
.width(CommonConstants.FULL_WIDTH)
.height(54)
.padding({left: 16, right: 16})
}
}
\ No newline at end of file
... ...
... ... @@ -127,6 +127,14 @@
{
"name":"color_EEEEEE",
"value": "#EEEEEE"
},
{
"name": "color_323232",
"value": "#323232"
},
{
"name": "color_48505A",
"value": "#48505A"
}
]
}
\ No newline at end of file
... ...