王士厅
... ... @@ -88,7 +88,8 @@ export struct MorningEveningPaperComponent {
// .backgroundColor('#FFF1F3F5')
// .backgroundColor(Color.Blue)
.height('100%')
.margin({ left: 14, right: 14 })
// .margin({ left: 12, right: 12 })
PaperTitleComponent()// PaperTitleComponent({
// // title: this.morningEveningPaperDTO?.topicInfo?.title ?? "",
... ... @@ -100,6 +101,7 @@ export struct MorningEveningPaperComponent {
}
.width('100%')
// .backgroundColor('#000080')
.backgroundColor(Color.Black)
// .backgroundColor(Color.Black)
.backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black)
}
}
\ No newline at end of file
... ...
... ... @@ -61,6 +61,7 @@ export struct PaperTitleComponent {
// console.info(TAG, "img_close")
router.back()
})
.margin({ right: 16 })
Image($r('app.media.icon_share'))
.height($r('app.float.top_arrow_size'))
... ... @@ -69,9 +70,11 @@ export struct PaperTitleComponent {
right: { anchor: "img_close", align: HorizontalAlign.Start },
center: { anchor: "__container__", align: VerticalAlign.Center } })
.id('img_share')
.margin({ right: 13 })
}
// .margin({ left: 14, right: 14 })
.height($r('app.float.top_bar_height'))
.backgroundColor(Color.Black)
// .backgroundColor(Color.Black)
}
}
\ No newline at end of file
... ...
... ... @@ -3,7 +3,6 @@ import { CommonConstants, ConfigConstants, ScreenType } from 'wdConstant';
import { Logger } from 'wdKit';
import { CompUtils } from '../../utils/CompUtils';
import { WDRouterRule } from 'wdRouter';
import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO';
import { ProcessUtils } from '../../utils/ProcessUtils';
const TAG: string = 'CardView';
... ... @@ -400,7 +399,8 @@ export struct PaperSingleColumn999CardView {
.fontWeight(FontWeight.Bold)
.alignSelf(ItemAlign.Start)
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.margin({ left: 22, right: 22, top: 28 })
if (this.item?.coverUrl) {
Stack({ alignContent: Alignment.BottomEnd }) {
Image(this.item?.coverUrl)
... ... @@ -418,7 +418,7 @@ export struct PaperSingleColumn999CardView {
.fitOriginalSize(true)
}.width(CommonConstants.FULL_PARENT)
}
}
}.margin({ left: 22, right: 22 })
}
if (this.item?.newsSummary) {
Text(this.item?.newsSummary)
... ... @@ -426,23 +426,26 @@ export struct PaperSingleColumn999CardView {
.padding({ top: 10 })
.alignSelf(ItemAlign.Start)
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.margin({ left: 22, right: 22 })
}
if (this.item?.visitorComment) {
Row() {
Text(this.item?.visitorComment + "评")
.fontSize(12)
.fontColor(Color.Gray)
.margin({ left: 22 })
Image($r('app.media.icon_share'))
.width(16)
.height(16)
.margin(10)
.margin({ left: 10, right: 22, top: 10, bottom: 10 })
.backgroundColor(Color.Brown)
}.width(CommonConstants.FULL_PARENT)
.justifyContent(FlexAlign.SpaceBetween)
}
}
.backgroundColor(Color.White)
.margin({ bottom: 5 })
.margin({ bottom: 5, left: 12, right: 12 })
.borderRadius(4)
}
}
\ No newline at end of file
... ...
... ... @@ -4,9 +4,8 @@ import { HomePageBottomComponent } from '../components/mine/home/HomePageBottomC
@Entry
@Component
struct MineHomePage {
@State tileOpacity: number = 0;
@State isScroll: boolean = false
firstPositionY:number = 0;
@State isHasIntroduction: boolean = true
@State desc:string = "点击添加简介,让大家认识你" //text 搞两个样式,如果三行,就显示 另外一个text 没有显示高度的
fontColor: string = '#999999'
... ... @@ -16,161 +15,211 @@ struct MineHomePage {
isChangeToUserEdit = false;
aboutToAppear() {
}
build() {
Column() {
Stack() {
Image($r('app.media.title_bg'))
.width('100%')
.height('84lpx')
.objectFit(ImageFit.Cover)
this.MineHomeTitle(1)
this.MineHomeTitle(2)
}
Stack({ alignContent: Alignment.Top }){
Image($r('app.media.title_bg'))
.width('100%')
.height('355lpx')
.objectFit(ImageFit.Cover)
Scroll() {
Column() {
//用户信息区域
Stack() {
Image($r('app.media.title_bg'))
.width('100%')
.objectFit(ImageFit.Cover)
Row() {
Image($r('app.media.default_head'))
.width('115lpx')
.height('115lpx')
.objectFit(ImageFit.Cover)
.borderRadius(50)
Column() {
Row() {
Text("人民日报6G")
.fontColor($r('app.color.white'))
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.fontSize('38lpx')
.lineHeight('50lpx')
.fontWeight('500lpx')
Column(){
Stack({ alignContent: Alignment.Top }){
this.MineHomeTitleTransparent()
this.MineHomeTitleWhite()
}
Text("等级8")
.textAlign(TextAlign.Center)
.fontColor($r('app.color.color_ED2800'))
.backgroundColor($r('app.color.white'))
.fontSize('19lpx')
.width('96lpx')
.height('35lpx')
.margin({ left: '10lpx' })
Blank()
}.width('507lpx')
Scroll() {
Column() {
//用户信息区域
Row() {
Image($r('app.media.default_head'))
.width('115lpx')
.height('115lpx')
.objectFit(ImageFit.Cover)
.borderRadius(50)
Row() {
Column() {
Row() {
Text("3.6万")
.textStyle()
Text("阅读")
.textStyle2()
}
.margin({ right: '15lpx' })
Text("人民日报6G")
.fontColor($r('app.color.white'))
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.fontSize('38lpx')
.lineHeight('50lpx')
.fontWeight('500lpx')
Divider()
.height('19lpx')
.width('2lpx')
.color($r('app.color.white'))
.vertical(true)
.opacity(0.4)
Row() {
Text("6242")
.textStyle()
Text("评论")
.textStyle2()
}.margin({ right: '15lpx', left: '15lpx' })
Text("等级8")
.textAlign(TextAlign.Center)
.fontColor($r('app.color.color_ED2800'))
.backgroundColor($r('app.color.white'))
.fontSize('19lpx')
.width('96lpx')
.height('35lpx')
.margin({ left: '10lpx' })
Blank()
}.width('507lpx')
Divider()
.height('19lpx')
.width('2lpx')
.color($r('app.color.white'))
.vertical(true)
.opacity(0.4)
Row() {
Text("86")
.textStyle()
Text("关注")
.textStyle2()
}.margin({ left: '15lpx' })
}.margin({ top: '23lpx' })
}.alignItems(HorizontalAlign.Start)
.margin({ left: '32lpx' })
}
.height('184lpx')
.width('100%')
.padding({ left: '35lpx' })
}.height('184lpx')
Row() {
Text("3.6万")
.textStyle()
Text("阅读")
.textStyle2()
}
.margin({ right: '15lpx' })
//用户简介区域
Column() {
Row() {
Text(this.desc)
.fontSize('27lpx')
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.lineHeight('40lpx')
.fontWeight('400lpx')
.fontColor(this.isHasIntroduction?$r('app.color.color_222222'):$r('app.color.color_999999'))
.textAlign(TextAlign.Start)
Divider()
.height('19lpx')
.width('2lpx')
.color($r('app.color.white'))
.vertical(true)
.opacity(0.4)
Row() {
Text("6242")
.textStyle()
Text("评论")
.textStyle2()
}.margin({ right: '15lpx', left: '15lpx' })
if(!this.isHasIntroduction){
Image($r('app.media.user_info_edit_icon'))
.width('27lpx')
.height('27lpx')
.objectFit(ImageFit.Auto)
Divider()
.height('19lpx')
.width('2lpx')
.color($r('app.color.white'))
.vertical(true)
.opacity(0.4)
Row() {
Text("86")
.textStyle()
Text("关注")
.textStyle2()
}.margin({ left: '15lpx' })
}.margin({ top: '23lpx' })
}.alignItems(HorizontalAlign.Start)
.margin({ left: '32lpx' })
}
}
Text("来到人民日报365天")
.fontSize('23lpx')
.lineHeight('25lpx')
.fontWeight('400lpx')
.fontColor($r('app.color.color_999999'))
.textAlign(TextAlign.Start)
.margin({ top: '15lpx' })
.onAreaChange((oldValue: Area, newValue: Area) => {
if (this.firstPositionY === 0) {
this.firstPositionY = newValue.globalPosition.y as number
}else{
let persent = (this.firstPositionY - Number(newValue.globalPosition.y)) / (this.firstPositionY * 0.3)
if(persent > 1){
persent = 1
}
this.tileOpacity = persent
}
})
.backgroundColor($r('app.color.color_transparent'))
.height('184lpx')
.width('100%')
.padding({ left: '35lpx' })
//用户简介区域
Column() {
Row() {
Text(this.desc)
.fontSize('27lpx')
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.lineHeight('40lpx')
.fontWeight('400lpx')
.fontColor(this.isHasIntroduction?$r('app.color.color_222222'):$r('app.color.color_999999'))
.textAlign(TextAlign.Start)
}.padding({ left: '31lpx',right:'31lpx',top:'19lpx',bottom:'31lpx'})
.alignItems(HorizontalAlign.Start)
.justifyContent(FlexAlign.Center)
.width('100%')
//间隔符
if(!this.isHasIntroduction){
Image($r('app.media.user_info_edit_icon'))
.width('27lpx')
.height('27lpx')
.objectFit(ImageFit.Auto)
}
}
Text("来到人民日报365天")
.fontSize('23lpx')
.lineHeight('25lpx')
.fontWeight('400lpx')
.fontColor($r('app.color.color_999999'))
.textAlign(TextAlign.Start)
.margin({ top: '15lpx' })
}.padding({ left: '31lpx',right:'31lpx',top:'19lpx',bottom:'31lpx'})
.alignItems(HorizontalAlign.Start)
.justifyContent(FlexAlign.Center)
.width('100%')
.backgroundColor($r('app.color.white'))
//间隔符
Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx')
Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx')
//tab 页面
Tabs({controller: this.controller}) {
TabContent() {
HomePageBottomComponent({style:0})
}.tabBar(this.TabBuilder(0,"评论"))
TabContent() {
HomePageBottomComponent({style:1})
}.tabBar(this.TabBuilder(1,"关注"))
}
.animationDuration(0)
.onChange((index: number) => {
this.currentIndex = index
})
.vertical(false)
.height("100%")
}.width("100%")
//tab 页面
Tabs({controller: this.controller}) {
TabContent() {
HomePageBottomComponent({style:0})
}.tabBar(this.TabBuilder(0,"评论"))
TabContent() {
HomePageBottomComponent({style:1})
}.tabBar(this.TabBuilder(1,"关注"))
}
.backgroundColor($r('app.color.white'))
.animationDuration(0)
.onChange((index: number) => {
this.currentIndex = index
})
.vertical(false)
.height("100%")
}.width("100%")
}
.edgeEffect(EdgeEffect.None)
.scrollBar(BarState.Off)
.width('100%')
.height('100%')
}
.edgeEffect(EdgeEffect.None)
.scrollBar(BarState.Off)
.width('100%')
.height('100%')
}.height('100%')
}.width('100%')
.height('100%')
}
@Builder MineHomeTitleTransparent() {
RelativeContainer() {
//标题栏目
Image($r('app.media.icon_arrow_left_white') )
.width('46lpx')
.height('46lpx')
.objectFit(ImageFit.Auto)
.id("back_icon")
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.margin({ left: '31lpx' })
.onClick(() => {
router.back()
})
Text("编辑资料")
.height('42lpx')
.maxLines(1)
.id("rightText")
.fontSize('35lpx')
.fontWeight('400lpx')
.fontColor($r('app.color.white') )
.lineHeight('42lpx')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
right: { anchor: "__container__", align: HorizontalAlign.End }
})
.margin({ right: '31lpx' })
.onClick(()=>{
this.editUserInfo()
})
}
.visibility(this.tileOpacity > 0 ? 1 : 0)
.height('84lpx')
.width('100%')
.backgroundColor($r('app.color.color_transparent'))
}
@Builder MineHomeTitle(style: number) {
@Builder MineHomeTitleWhite() {
RelativeContainer() {
//标题栏目
Image(style === 1 ? $r('app.media.icon_arrow_left_white') : $r('app.media.back_icon'))
Image($r('app.media.back_icon'))
.width('46lpx')
.height('46lpx')
.objectFit(ImageFit.Auto)
... ... @@ -183,7 +232,6 @@ struct MineHomePage {
.onClick(() => {
router.back()
})
if (style === 2)
Image($r('app.media.default_head'))
.width('60lpx')
.height('60lpx')
... ... @@ -198,7 +246,6 @@ struct MineHomePage {
router.back()
})
if (style === 2)
Text("我的昵称")
.height('42lpx')
.maxLines(1)
... ... @@ -219,21 +266,23 @@ struct MineHomePage {
.id("rightText")
.fontSize('35lpx')
.fontWeight('400lpx')
.fontColor(style === 1 ? $r('app.color.white') : $r('app.color.color_222222'))
.fontColor($r('app.color.color_222222'))
.lineHeight('42lpx')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
right: { anchor: "__container__", align: HorizontalAlign.End }
})
.margin({ right: '31lpx' })
.onClick(()=>{
this.editUserInfo()
})
}
.visibility(this.tileOpacity > 0 ? 0 : 1)
.height('84lpx')
.width('100%')
.backgroundColor(style === 1 ? "" : $r('app.color.white'))
.opacity(style === 1 ? 1 : this.isScroll ? this.tileOpacity : 0)
.onClick(()=>{
this.editUserInfo()
})
.backgroundColor($r('app.color.white'))
.opacity(this.tileOpacity )
}
@Builder TabBuilder(index: number, title: string) {
... ... @@ -267,7 +316,6 @@ struct MineHomePage {
* 跳转编辑资料(防止二次点击)
*/
editUserInfo(){
console.log("ycg","a"+this.isChangeToUserEdit)
if(!this.isChangeToUserEdit){
this.isChangeToUserEdit = true;
let c = setInterval(() => {
... ... @@ -275,7 +323,6 @@ struct MineHomePage {
}, 1000);
//route 跳转写这里 TODO
}
}
... ...
... ... @@ -81,22 +81,23 @@
"value": "#994D00"
},
{
"name":"color_B15900",
"name": "color_B15900",
"value": "#B15900"
},
{
"name": "main_red",
"value": "#E84026"
}, {
"name":"color_4D000000",
},
{
"name": "color_4D000000",
"value": "#4D000000"
},
{
"name":"color_CCCCCC",
"name": "color_CCCCCC",
"value": "#CCCCCC"
},
{
"name":"color_EDEDED",
"name": "color_EDEDED",
"value": "#EDEDED"
},
{
... ... @@ -106,6 +107,16 @@
{
"name": "color_B2FFFFFF",
"value": "#B2FFFFFF"
},
{
"name": "color_00304c",
"value": "#00304c"
},
{
"name": "color_transparent",
"value": "#00000000"
}
]
}
\ No newline at end of file
... ...
... ... @@ -166,6 +166,129 @@
"targetType": 8,
"topicType": null,
"uuid": "f809d73f-a66c-4dd6-a4cf-99e3a9c9621e"
},
{
"avatarFrame": "",
"checkStatus": 0,
"commentContent": "你好",
"commentContentSensitive": "",
"commentLevel": 1,
"commentPics": "",
"commentSensitive": "",
"commentType": "2",
"createTime": "2024-03-14 17:55:55",
"fromCreatorId": "",
"fromDeviceId": "",
"fromUserHeader": "https://sitcontentjdcdn.aikan.pdnews.cn//img/user/2024031215/48d5bd53227d436b9faa937b3ac14600.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
"fromUserId": "567387477063621",
"fromUserName": "人民日报网友aPrtq5",
"fromUserType": 1,
"h5Url": "",
"id": 403447,
"keyArticle": 0,
"likeNum": 0,
"parentCommentVo": null,
"parentId": -1,
"rootCommentId": 403447,
"sensitiveExist": 0,
"sensitiveShow": 1,
"shareInfo": {
"shareCoverUrl": "http://sitcontentjdcdn.aikan.pdnews.cn/zhbj-20231103/image/content/046db0ef912f43dda639009e2b78a774.png",
"shareSummary": "复测-坐船观鸟,骑行散步,通州125处湿地邀您亲近自然-导读",
"shareTitle": "复测-坐船观鸟,骑行散步,通州125处湿",
"shareUrl": "https://pd-people-sit.pdnews.cn/column/30000637972-500000010900"
},
"targetId": "30000637972",
"targetRelId": "500000010900",
"targetRelObjectId": "2002",
"targetRelType": 1,
"targetStatus": 0,
"targetTitle": "复测-坐船观鸟,骑行散步,通州125处湿地邀您亲近自然",
"targetType": 8,
"topicType": null,
"uuid": "f809d73f-a66c-4dd6-a4cf-99e3a9c9621e"
},
{
"avatarFrame": "",
"checkStatus": 0,
"commentContent": "你好",
"commentContentSensitive": "",
"commentLevel": 1,
"commentPics": "",
"commentSensitive": "",
"commentType": "2",
"createTime": "2024-03-14 17:55:55",
"fromCreatorId": "",
"fromDeviceId": "",
"fromUserHeader": "https://sitcontentjdcdn.aikan.pdnews.cn//img/user/2024031215/48d5bd53227d436b9faa937b3ac14600.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
"fromUserId": "567387477063621",
"fromUserName": "人民日报网友aPrtq5",
"fromUserType": 1,
"h5Url": "",
"id": 403447,
"keyArticle": 0,
"likeNum": 0,
"parentCommentVo": null,
"parentId": -1,
"rootCommentId": 403447,
"sensitiveExist": 0,
"sensitiveShow": 1,
"shareInfo": {
"shareCoverUrl": "http://sitcontentjdcdn.aikan.pdnews.cn/zhbj-20231103/image/content/046db0ef912f43dda639009e2b78a774.png",
"shareSummary": "复测-坐船观鸟,骑行散步,通州125处湿地邀您亲近自然-导读",
"shareTitle": "复测-坐船观鸟,骑行散步,通州125处湿",
"shareUrl": "https://pd-people-sit.pdnews.cn/column/30000637972-500000010900"
},
"targetId": "30000637972",
"targetRelId": "500000010900",
"targetRelObjectId": "2002",
"targetRelType": 1,
"targetStatus": 0,
"targetTitle": "复测-坐船观鸟,骑行散步,通州125处湿地邀您亲近自然",
"targetType": 8,
"topicType": null,
"uuid": "f809d73f-a66c-4dd6-a4cf-99e3a9c9621e"
},
{
"avatarFrame": "",
"checkStatus": 0,
"commentContent": "你好",
"commentContentSensitive": "",
"commentLevel": 1,
"commentPics": "",
"commentSensitive": "",
"commentType": "2",
"createTime": "2024-03-14 17:55:55",
"fromCreatorId": "",
"fromDeviceId": "",
"fromUserHeader": "https://sitcontentjdcdn.aikan.pdnews.cn//img/user/2024031215/48d5bd53227d436b9faa937b3ac14600.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
"fromUserId": "567387477063621",
"fromUserName": "人民日报网友aPrtq5",
"fromUserType": 1,
"h5Url": "",
"id": 403447,
"keyArticle": 0,
"likeNum": 0,
"parentCommentVo": null,
"parentId": -1,
"rootCommentId": 403447,
"sensitiveExist": 0,
"sensitiveShow": 1,
"shareInfo": {
"shareCoverUrl": "http://sitcontentjdcdn.aikan.pdnews.cn/zhbj-20231103/image/content/046db0ef912f43dda639009e2b78a774.png",
"shareSummary": "复测-坐船观鸟,骑行散步,通州125处湿地邀您亲近自然-导读",
"shareTitle": "复测-坐船观鸟,骑行散步,通州125处湿",
"shareUrl": "https://pd-people-sit.pdnews.cn/column/30000637972-500000010900"
},
"targetId": "30000637972",
"targetRelId": "500000010900",
"targetRelObjectId": "2002",
"targetRelType": 1,
"targetStatus": 0,
"targetTitle": "复测-坐船观鸟,骑行散步,通州125处湿地邀您亲近自然",
"targetType": 8,
"topicType": null,
"uuid": "f809d73f-a66c-4dd6-a4cf-99e3a9c9621e"
}
],
"pageNum": 1,
... ...