wangliang_wd

feat:增加互动消息UI

... ... @@ -83,6 +83,9 @@ export class WDRouterPage {
static browsingHistoryPage = new WDRouterPage("wdComponent", "ets/components/page/BrowsingHistoryPage");
//我的收藏
static myCollectionListPagePage = new WDRouterPage("wdComponent", "ets/components/page/MyCollectionListPage");
//互动消息
static interactMessagePage = new WDRouterPage("wdComponent", "ets/components/page/InteractMessagePage");
static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview");
//我的主页
static mineHomePage = new WDRouterPage("wdComponent", "ets/pages/MineHomePage");
... ...
@Component
export struct InteractMComponent {
build() {
Row(){
Image('')
.backgroundColor(Color.Red)
.width(36)
.height(36)
.borderRadius(18)
Column(){
Row(){
Text('用户名')
.fontSize('14fp').fontColor('#222222')
Text('回复了你的评论')
.fontSize('14fp').fontColor('#999999')
.margin({left:5})
}.width('100%')
Text('两天前')
.margin({top:2})
.fontSize('12fp').fontColor('#B0B0B0')
Text('评论内容')
.margin({top:8,bottom:10})
.fontSize('16fp').fontColor('#222222')
.width('100%')
.constraintSize({maxHeight:500})
Column(){
Text('[你的评论]乐事薯片,大家的最爱').fontSize('14fp').fontColor('#666666').constraintSize({maxHeight:500})
.margin({top:5,bottom:5})
.width('100%')
Divider()
.color('#f5f5f5')
.backgroundColor('#f5f5f5')
.width('100%')
.height(1)
Row(){
Text('乐事薯片,大家的最爱!!!!').fontSize('12fp').fontColor('#666666').constraintSize({maxHeight:500})
Blank()
Image($r('app.media.mine_user_edit'))
.width('12')
.height('12')
}.margin({top:5,bottom:5}).width('100%')
}.alignItems(HorizontalAlign.Start).backgroundColor('#f5f5f5').borderRadius(5)
}.padding({left:5}).alignItems(HorizontalAlign.Start)
}.padding({top:5,left:16,right:16}).width('100%').height(160).alignItems(VerticalAlign.Top).backgroundColor(Color.Red)
}
}
\ No newline at end of file
... ...
... ... @@ -12,6 +12,7 @@ import { BigPicCardComponent } from '../view/BigPicCardComponent';
import { CustomTitleUI } from '../reusable/CustomTitleUI';
import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh';
import { InteractMComponent } from '../InteractMessage/InteractMComponent';
@Entry
@Component
... ... @@ -30,30 +31,28 @@ struct InteractMessagePage {
build() {
Column(){
CustomTitleUI({titleName:'互动消息'})
if(this.browSingModel.viewType == ViewType.ERROR){
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NetworkFailed})
}else if(this.browSingModel.viewType == ViewType.EMPTY){
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoHistory})
}else {
CustomPullToRefresh({
alldata:this.allDatas,
scroller:this.scroller,
customList:()=>{
this.ListLayout()
},
onRefresh:(resolve)=>{
this.browSingModel.currentPage = 0
this.getData(resolve)
},
onLoadMore:(resolve)=> {
this.browSingModel.currentPage++
this.getData()
}
})
}
this.ListLayout()
// if(this.browSingModel.viewType == ViewType.ERROR){
// EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NetworkFailed})
// }else if(this.browSingModel.viewType == ViewType.EMPTY){
// EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoHistory})
// }else {
// CustomPullToRefresh({
// alldata:this.allDatas,
// scroller:this.scroller,
// customList:()=>{
// this.ListLayout()
// },
// onRefresh:(resolve)=>{
// this.browSingModel.currentPage = 0
// this.getData(resolve)
// },
// onLoadMore:(resolve)=> {
// this.browSingModel.currentPage++
// this.getData()
// }
// })
// }
}
.width(CommonConstants.FULL_WIDTH)
... ... @@ -69,7 +68,7 @@ struct InteractMessagePage {
// 下拉刷新
ForEach(this.allDatas, (compDTO: ContentDTO, compIndex: number) => {
ListItem() {
this.newCompParser(compDTO,compIndex)
InteractMComponent()
}
})
// 加载更多
... ... @@ -112,25 +111,6 @@ struct InteractMessagePage {
}
@Builder
newCompParser(compDTO: ContentDTO, compIndex: number){
Row(){
if (this.isEditState){
CustomSelectUI({
isOn:compDTO.isSelect,
selectCallback:(isOn)=>{
}
})
.margin({left:16})
}
Column() {
BigPicCardComponent({contentDTO:compDTO})
}
}
}
async getData(resolve?: (value: string | PromiseLike<string>) => void){
MyCollectionViewModel.fetchMyCollectList(2,'1',this.browSingModel.currentPage,getContext(this)).then(collectionItem => {
if(resolve) resolve('刷新成功')
... ...
... ... @@ -154,7 +154,7 @@ struct MineHomePage {
//用户简介区域
Column() {
Row() {
Text(this.isHasIntroduction?'简介:'+this.desc:this.desc)
Text(this.desc)
.fontSize('27lpx')
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis })
... ...
... ... @@ -23,6 +23,7 @@
"pages/VideoPlayPage",
"components/page/ThemeListPage",
"pages/ShowUserHeaderPage",
"pages/MineMessagePage"
"pages/MineMessagePage",
"components/page/InteractMessagePage"
]
}
\ No newline at end of file
... ...