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
yangchenggong1_wd
2024-05-10 19:59:49 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9bc2b1f2fac816c91fd07ec3938a559da1f6895b
9bc2b1f2
1 parent
312532cb
desc:增加 我的 消息 入口
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
164 additions
and
2 deletions
sight_harmony/commons/wdRouter/src/main/ets/router/WDRouterPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/MinePagePersonFunctionUI.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/message/MessageListUI.ets
sight_harmony/features/wdComponent/src/main/ets/model/MinePageDatasModel.ets
sight_harmony/features/wdComponent/src/main/ets/pages/MineMessagePage.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/MessageItem.ets
sight_harmony/features/wdComponent/src/main/resources/base/media/mine_msg_icon.png
sight_harmony/features/wdComponent/src/main/resources/base/media/msg_history.png
sight_harmony/features/wdComponent/src/main/resources/base/media/msg_interact.png
sight_harmony/features/wdComponent/src/main/resources/base/media/msg_reserve.png
sight_harmony/features/wdComponent/src/main/resources/base/media/msg_system.png
sight_harmony/features/wdComponent/src/main/resources/base/profile/main_pages.json
sight_harmony/commons/wdRouter/src/main/ets/router/WDRouterPage.ets
View file @
9bc2b1f
...
...
@@ -114,6 +114,8 @@ export class WDRouterPage {
static broadcastPage = new WDRouterPage("phone", "ets/pages/broadcast/BroadcastPage");
//搜索主页
static searchPage = new WDRouterPage("wdComponent", "ets/pages/SearchPage");
//消息主页
static mineMessagePage = new WDRouterPage("wdComponent", "ets/pages/MineMessagePage");
//搜索人民号主页
static searchCreatorPage = new WDRouterPage("wdComponent", "ets/pages/SearchCreatorPage");
//人民号主页
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/MinePagePersonFunctionUI.ets
View file @
9bc2b1f
...
...
@@ -78,6 +78,14 @@ export default struct MinePagePersonFunctionUI {
WDRouterRule.jumpWithPage(WDRouterPage.browsingHistoryPage)
break;
}
case "消息":{
if(!this.isLogin){
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
WDRouterRule.jumpWithPage(WDRouterPage.mineMessagePage)
break;
}
}
}).width('169lpx')
.height('117lpx')
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/message/MessageListUI.ets
0 → 100644
View file @
9bc2b1f
import { StringUtils, ToastUtils } from 'wdKit/Index'
import MinePageDatasModel from '../../../model/MinePageDatasModel'
import { MessageItem } from '../../../viewmodel/MessageItem'
import { CustomTitleUI } from '../../reusable/CustomTitleUI'
const TAG = "MessageListUI"
@Component
export struct MessageListUI {
@State msgData: MessageItem[] = []
aboutToAppear() {
this.msgData = MinePageDatasModel.getMessageData()
}
build() {
Column() {
//标题栏目
CustomTitleUI({ titleName: "消息" })
List() {
ForEach(this.msgData, (item: MessageItem, index: number) => {
ListItem() {
Column(){
Column() {
Row() {
Row() {
Image(item.imgSrc)
.objectFit(ImageFit.Auto)
.width('92lpx')
.height('92lpx')
.margin({ right: '15lpx' })
Column() {
Text(item.title)
.fontWeight(500)
.fontSize('31lpx')
.lineHeight('42lpx')
.fontColor($r('app.color.color_222222'))
.maxLines(1)
.margin({ bottom: StringUtils.isNotEmpty(item.desc)?'8lpx':0 })
if(StringUtils.isNotEmpty(item.desc)){
Text(`${item.desc}`)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize('23lpx')
.lineHeight('38lpx')
.fontWeight(400)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}
}
.height('92lpx')
.layoutWeight(1)
.alignItems(HorizontalAlign.Start)
.justifyContent(StringUtils.isNotEmpty(item.desc)?FlexAlign.Start:FlexAlign.Center)
}.layoutWeight(1)
Row() {
Text(`${item.time}`)
.fontColor($r('app.color.color_999999'))
.fontSize('23lpx')
.fontWeight(500)
.lineHeight('35lpx')
}
.justifyContent(FlexAlign.Start)
.alignItems(VerticalAlign.Top)
.height('92lpx')
}
.width('100%')
.height('92lpx')
.justifyContent(FlexAlign.SpaceBetween)
}.height('154lpx')
.width("100%")
.justifyContent(FlexAlign.Center)
Text().backgroundColor($r('app.color.color_EDEDED'))
.width('100%')
.height('1lpx')
.visibility(index != 3 ?Visibility.Visible:Visibility.None)
}
}
.padding({left:"31lpx",right:"31lpx"})
.onClick(() => {
ToastUtils.shortToast(index+"")
switch (index) {
case 0: //互动消息
break;
case 1: //预约消息
break;
case 2: //历史推送
break;
case 3: //系统消息
break;
}
})
.height('154lpx')
.width("100%")
})
}
}
.backgroundColor($r('app.color.white'))
.height('100%')
.width('100%')
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/model/MinePageDatasModel.ets
View file @
9bc2b1f
...
...
@@ -23,6 +23,7 @@ import { AppointmentOperationRequestItem } from '../viewmodel/AppointmentOperati
import { CommentLikeOperationRequestItem } from '../viewmodel/CommentLikeOperationRequestItem';
import { FollowOperationRequestItem } from '../viewmodel/FollowOperationRequestItem';
import { SpConstants } from 'wdConstant/Index';
import { MessageItem } from '../viewmodel/MessageItem';
const TAG = "MinePageDatasModel"
...
...
@@ -34,6 +35,7 @@ class MinePageDatasModel{
personalData:MinePagePersonalFunctionsItem[] = []
creatorData:MinePageCreatorFunctionsItem[] = []
moreData:MinePageMoreFunctionModel[] = []
messageData:MessageItem[] = []
private constructor() { }
...
...
@@ -63,7 +65,7 @@ class MinePageDatasModel{
this.personalData.push(new MinePagePersonalFunctionsItem("关注",$r('app.media.mine_follow_icon')))
this.personalData.push(new MinePagePersonalFunctionsItem("收藏",$r('app.media.mine_collect_icon')))
// this.personalData.push(new MinePagePersonalFunctionsItem("历史",$r('app.media.mine_history_icon')))
//
this.personalData.push(new MinePagePersonalFunctionsItem("消息",$r('app.media.mine_msg_icon')))
this.personalData.push(new MinePagePersonalFunctionsItem("消息",$r('app.media.mine_msg_icon')))
// this.personalData.push(new MinePagePersonalFunctionsItem("留言板",$r('app.media.mine_msgboard_icon')))
// this.personalData.push(new MinePagePersonalFunctionsItem("预约",$r('app.media.mine_order_icon')))
return this.personalData
...
...
@@ -102,6 +104,21 @@ class MinePageDatasModel{
}
/**
* 消息 5 个数据
* 包含名字和图标
*/
getMessageData():MessageItem[]{
if(this.messageData.length === 4){
return this.messageData
}
this.messageData.push(new MessageItem($r('app.media.msg_interact'),"互动消息","",""))
this.messageData.push(new MessageItem($r('app.media.msg_reserve'),"预约消息","",""))
this.messageData.push(new MessageItem($r('app.media.msg_history'),"历史推送","",""))
this.messageData.push(new MessageItem($r('app.media.msg_system'),"系统消息","",""))
return this.messageData
}
/**
* 预约
* @param pageSize
* @param pageNum
...
...
sight_harmony/features/wdComponent/src/main/ets/pages/MineMessagePage.ets
0 → 100644
View file @
9bc2b1f
import { MessageListUI } from '../components/mine/message/MessageListUI';
@Entry
@Component
struct MineMessagePage {
build() {
Column(){
MessageListUI()
}
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/MessageItem.ets
0 → 100644
View file @
9bc2b1f
export class MessageItem{
imgSrc:Resource = $r("app.media.xxhdpi_pic_wb")
title:string = ""
desc:string = ""
time:string = ""
constructor(imgSrc:Resource,title:string,desc:string,time:string){
this.imgSrc = imgSrc
this.title = title
this.desc = desc
this.time = time
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/resources/base/media/mine_msg_icon.png
View file @
9bc2b1f
564 Bytes
|
W:
|
H:
989 Bytes
|
W:
|
H:
2-up
Swipe
Onion skin
sight_harmony/features/wdComponent/src/main/resources/base/media/msg_history.png
0 → 100644
View file @
9bc2b1f
2.52 KB
sight_harmony/features/wdComponent/src/main/resources/base/media/msg_interact.png
0 → 100644
View file @
9bc2b1f
2.3 KB
sight_harmony/features/wdComponent/src/main/resources/base/media/msg_reserve.png
0 → 100644
View file @
9bc2b1f
2.15 KB
sight_harmony/features/wdComponent/src/main/resources/base/media/msg_system.png
0 → 100644
View file @
9bc2b1f
2.64 KB
sight_harmony/features/wdComponent/src/main/resources/base/profile/main_pages.json
View file @
9bc2b1f
...
...
@@ -22,6 +22,7 @@
"components/page/ReserveMorePage"
,
"pages/VideoPlayPage"
,
"components/page/ThemeListPage"
,
"pages/ShowUserHeaderPage"
"pages/ShowUserHeaderPage"
,
"pages/MineMessagePage"
]
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment