Showing
12 changed files
with
184 additions
and
295 deletions
| @@ -31,10 +31,11 @@ export const enum CompStyle { | @@ -31,10 +31,11 @@ export const enum CompStyle { | ||
| 31 | Zh_Single_Column_02 = 'Zh_Single_Column-02', //10 头图卡 | 31 | Zh_Single_Column_02 = 'Zh_Single_Column-02', //10 头图卡 |
| 32 | Zh_Single_Column_03 = 'Zh_Single_Column-03', //9 直播大图卡 | 32 | Zh_Single_Column_03 = 'Zh_Single_Column-03', //9 直播大图卡 |
| 33 | Zh_Single_Column_04 = 'Zh_Single_Column-04', //17 人民号主题卡 | 33 | Zh_Single_Column_04 = 'Zh_Single_Column-04', //17 人民号主题卡 |
| 34 | - Zh_Single_Column_05 = 'Zh_Single_Column-05', //16 人民号入驻卡 | 34 | + Zh_Single_Column_05 = 'Zh_Single_Column-05', //16 人民号入驻卡 |
| 35 | Zh_Single_Column_06 = 'Zh_Single_Column-06', //12 本地问政卡 | 35 | Zh_Single_Column_06 = 'Zh_Single_Column-06', //12 本地问政卡 |
| 36 | Zh_Single_Column_07 = 'Zh_Single_Column-07', //14 热门留言卡 | 36 | Zh_Single_Column_07 = 'Zh_Single_Column-07', //14 热门留言卡 |
| 37 | Zh_Single_Column_08 = 'Zh_Single_Column-08', //12 问政提问卡 | 37 | Zh_Single_Column_08 = 'Zh_Single_Column-08', //12 问政提问卡 |
| 38 | + Zh_Single_Column_09 = 'Zh_Single_Column-09', //12 问政提问卡 | ||
| 38 | Zh_Single_Column_10 = 'Zh_Single_Column-10', //18 服务组合卡 | 39 | Zh_Single_Column_10 = 'Zh_Single_Column-10', //18 服务组合卡 |
| 39 | Zh_Single_Column_11 = 'Zh_Single_Column-11', //19 问政组合卡 | 40 | Zh_Single_Column_11 = 'Zh_Single_Column-11', //19 问政组合卡 |
| 40 | Zh_Grid_Layout_01 = 'Zh_Grid_Layout-01', //4 信息流组合卡 | 41 | Zh_Grid_Layout_01 = 'Zh_Grid_Layout-01', //4 信息流组合卡 |
| @@ -5,6 +5,7 @@ import { InteractDataDTO } from './InteractDataDTO'; | @@ -5,6 +5,7 @@ import { InteractDataDTO } from './InteractDataDTO'; | ||
| 5 | import { slideShows } from '../morningevening/slideShows'; | 5 | import { slideShows } from '../morningevening/slideShows'; |
| 6 | import { VoiceInfoDTO } from '../detail/VoiceInfoDTO'; | 6 | import { VoiceInfoDTO } from '../detail/VoiceInfoDTO'; |
| 7 | import { RmhInfoDTO } from '../detail/RmhInfoDTO' | 7 | import { RmhInfoDTO } from '../detail/RmhInfoDTO' |
| 8 | +import {commentInfo} from './commentInfo' | ||
| 8 | export interface ContentDTO { | 9 | export interface ContentDTO { |
| 9 | appStyle: string; | 10 | appStyle: string; |
| 10 | cityCode: string; | 11 | cityCode: string; |
| @@ -75,4 +76,5 @@ export interface ContentDTO { | @@ -75,4 +76,5 @@ export interface ContentDTO { | ||
| 75 | newTags: string; | 76 | newTags: string; |
| 76 | titleShow?: number; | 77 | titleShow?: number; |
| 77 | isSearch?: boolean; // 是否是搜索的结果,区分搜索和主页的数据 | 78 | isSearch?: boolean; // 是否是搜索的结果,区分搜索和主页的数据 |
| 79 | + commentInfo?: commentInfo | ||
| 78 | } | 80 | } |
| @@ -11,8 +11,10 @@ import { | @@ -11,8 +11,10 @@ import { | ||
| 11 | } from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent'; | 11 | } from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent'; |
| 12 | import { ZhSingleRow02 } from './compview/ZhSingleRow02'; | 12 | import { ZhSingleRow02 } from './compview/ZhSingleRow02'; |
| 13 | import { ZhSingleRow04 } from './compview/ZhSingleRow04'; | 13 | import { ZhSingleRow04 } from './compview/ZhSingleRow04'; |
| 14 | +import { ZhSingleRow06 } from './compview/ZhSingleRow06'; | ||
| 14 | import { ZhSingleColumn04 } from './compview/ZhSingleColumn04'; | 15 | import { ZhSingleColumn04 } from './compview/ZhSingleColumn04'; |
| 15 | import { ZhSingleColumn05 } from './compview/ZhSingleColumn05'; | 16 | import { ZhSingleColumn05 } from './compview/ZhSingleColumn05'; |
| 17 | +import { ZhSingleColumn09 } from './compview/ZhSingleColumn09'; | ||
| 16 | import { ZhGridLayout03 } from './compview/ZhGridLayout03'; | 18 | import { ZhGridLayout03 } from './compview/ZhGridLayout03'; |
| 17 | import { CardParser } from './CardParser'; | 19 | import { CardParser } from './CardParser'; |
| 18 | import { LiveHorizontalReservationComponent } from './view/LiveHorizontalReservationComponent'; | 20 | import { LiveHorizontalReservationComponent } from './view/LiveHorizontalReservationComponent'; |
| @@ -51,6 +53,8 @@ export struct CompParser { | @@ -51,6 +53,8 @@ export struct CompParser { | ||
| 51 | ZhSingleRow02({ compDTO }) | 53 | ZhSingleRow02({ compDTO }) |
| 52 | } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_03) { | 54 | } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_03) { |
| 53 | LiveHorizontalReservationComponent({ compDTO: compDTO }) | 55 | LiveHorizontalReservationComponent({ compDTO: compDTO }) |
| 56 | + } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_06) { | ||
| 57 | + ZhSingleRow06({ compDTO }) | ||
| 54 | } else if (compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { | 58 | } else if (compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { |
| 55 | ZhGridLayout02({ compDTO: compDTO }) | 59 | ZhGridLayout02({ compDTO: compDTO }) |
| 56 | } else if (compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) { | 60 | } else if (compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) { |
| @@ -64,6 +68,8 @@ export struct CompParser { | @@ -64,6 +68,8 @@ export struct CompParser { | ||
| 64 | ZhSingleColumn04({ compDTO: compDTO }) | 68 | ZhSingleColumn04({ compDTO: compDTO }) |
| 65 | } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_05) { | 69 | } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_05) { |
| 66 | ZhSingleColumn05({ compDTO: compDTO }) | 70 | ZhSingleColumn05({ compDTO: compDTO }) |
| 71 | + } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_09) { | ||
| 72 | + ZhSingleColumn09({ compDTO: compDTO }) | ||
| 67 | } else if (!Number.isNaN(Number(compDTO.compStyle))) { | 73 | } else if (!Number.isNaN(Number(compDTO.compStyle))) { |
| 68 | CardParser({ contentDTO: compDTO.operDataList[0] }); | 74 | CardParser({ contentDTO: compDTO.operDataList[0] }); |
| 69 | } | 75 | } |
| @@ -15,7 +15,7 @@ export struct CardSourceInfo { | @@ -15,7 +15,7 @@ export struct CardSourceInfo { | ||
| 15 | .margin({ right: 2 }) | 15 | .margin({ right: 2 }) |
| 16 | } | 16 | } |
| 17 | if (this.contentDTO.rmhPlatform === 1) { | 17 | if (this.contentDTO.rmhPlatform === 1) { |
| 18 | - Text(this.contentDTO.rmhInfo.rmhName) | 18 | + Text(this.contentDTO.rmhInfo?.rmhName) |
| 19 | .fontSize($r("app.float.font_size_12")) | 19 | .fontSize($r("app.float.font_size_12")) |
| 20 | .fontColor($r("app.color.color_B0B0B0")) | 20 | .fontColor($r("app.color.color_B0B0B0")) |
| 21 | .maxLines(1) | 21 | .maxLines(1) |
| @@ -2,18 +2,18 @@ import { CompDTO, ContentDTO, Params } from 'wdBean'; | @@ -2,18 +2,18 @@ import { CompDTO, ContentDTO, Params } from 'wdBean'; | ||
| 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 3 | import { HttpUrlUtils } from 'wdNetwork/Index'; | 3 | import { HttpUrlUtils } from 'wdNetwork/Index'; |
| 4 | import { postInteractAccentionOperateParams } from 'wdBean'; | 4 | import { postInteractAccentionOperateParams } from 'wdBean'; |
| 5 | -import { PageRepository } from '../repository/PageRepository'; | 5 | +import { PageRepository } from '../../repository/PageRepository'; |
| 6 | import { CommonConstants } from 'wdConstant/Index'; | 6 | import { CommonConstants } from 'wdConstant/Index'; |
| 7 | 7 | ||
| 8 | /** | 8 | /** |
| 9 | - * 精选评论卡 | ||
| 10 | - * Zh_Single_Row-06 | 9 | + * 兴趣卡 |
| 10 | + * Zh_Single_Column-09 | ||
| 11 | */ | 11 | */ |
| 12 | -const TAG = 'Zh_Single_Row-06' | 12 | +const TAG = 'Zh_Single_Column-09' |
| 13 | 13 | ||
| 14 | @Entry | 14 | @Entry |
| 15 | @Component | 15 | @Component |
| 16 | -export struct ZhSingleRow06 { | 16 | +export struct ZhSingleColumn09 { |
| 17 | @State compDTO: CompDTO = {} as CompDTO | 17 | @State compDTO: CompDTO = {} as CompDTO |
| 18 | @State list: Array<string> = ['社会', '三个字', '是四个字', '时事', '社会', '三个字', '是四个字', '时事'] | 18 | @State list: Array<string> = ['社会', '三个字', '是四个字', '时事', '社会', '三个字', '是四个字', '时事'] |
| 19 | @State activeIndexs: Array<number> = [] | 19 | @State activeIndexs: Array<number> = [] |
| @@ -31,14 +31,29 @@ export struct ZhSingleRow06 { | @@ -31,14 +31,29 @@ export struct ZhSingleRow06 { | ||
| 31 | //顶部 | 31 | //顶部 |
| 32 | this.CompHeader(this.compDTO) | 32 | this.CompHeader(this.compDTO) |
| 33 | Grid() { | 33 | Grid() { |
| 34 | - ForEach(this.list, (item: string, index: number) => { | 34 | + ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => { |
| 35 | GridItem() { | 35 | GridItem() { |
| 36 | - Text(item) | ||
| 37 | - .fontSize(14) | ||
| 38 | - .fontColor(this.activeIndexs.includes(index) ? 0x222222 : 0x666666) | ||
| 39 | - .fontWeight(this.activeIndexs.includes(index) ? 600 : 400) | ||
| 40 | - .textAlign(TextAlign.Center) | 36 | + Stack({alignContent: Alignment.TopEnd}) { |
| 37 | + Image(item.coverUrl) | ||
| 38 | + .width('100%') | ||
| 39 | + .height('100%') | ||
| 40 | + Text(item.newsTitle) | ||
| 41 | + .width('100%') | ||
| 42 | + .height('100%') | ||
| 43 | + .fontSize(14) | ||
| 44 | + .textAlign(TextAlign.Center) | ||
| 45 | + .fontColor(0xffffff) | ||
| 46 | + Image($r('app.media.icon_selected')) | ||
| 47 | + .width(19) | ||
| 48 | + .height(19) | ||
| 49 | + .opacity(this.activeIndexs.includes(index) ? 1 : 0) | ||
| 50 | + .objectFit(ImageFit.Contain) | ||
| 51 | + } | ||
| 52 | + .width('100%') | ||
| 53 | + .height('100%') | ||
| 54 | + .borderRadius(4) | ||
| 41 | } | 55 | } |
| 56 | + .margin({right: index % 4 === 3 ? 0 : 6, bottom: 6}) | ||
| 42 | .onClick(() => { | 57 | .onClick(() => { |
| 43 | if (this.activeIndexs.includes(index)) { | 58 | if (this.activeIndexs.includes(index)) { |
| 44 | const ind = this.activeIndexs.indexOf(index); | 59 | const ind = this.activeIndexs.indexOf(index); |
| @@ -49,29 +64,32 @@ export struct ZhSingleRow06 { | @@ -49,29 +64,32 @@ export struct ZhSingleRow06 { | ||
| 49 | }) | 64 | }) |
| 50 | }) | 65 | }) |
| 51 | } | 66 | } |
| 52 | - .height(70) | 67 | + .height(90) |
| 53 | .columnsTemplate('1fr 1fr 1fr 1fr') | 68 | .columnsTemplate('1fr 1fr 1fr 1fr') |
| 54 | .rowsTemplate('1fr 1fr') | 69 | .rowsTemplate('1fr 1fr') |
| 55 | .margin({bottom: 10}) | 70 | .margin({bottom: 10}) |
| 56 | 71 | ||
| 57 | - | ||
| 58 | - Text('选中标签,为您推荐更多您感兴趣的内容') | ||
| 59 | - .fontSize(12) | ||
| 60 | - .fontColor(0xB0B0B0) | ||
| 61 | - .textAlign(TextAlign.Center) | ||
| 62 | - .margin({bottom: 10}) | ||
| 63 | - | ||
| 64 | Row() { | 72 | Row() { |
| 65 | - Text('选好了') | ||
| 66 | - .fontSize(14) | ||
| 67 | - .fontColor(0x000000) | ||
| 68 | - .width('100%') | ||
| 69 | - .textAlign(TextAlign.Center) | 73 | + Row() { |
| 74 | + Text('换一换') | ||
| 75 | + .fontSize(14) | ||
| 76 | + .fontColor(0xed2800) | ||
| 77 | + .margin({right: 4}) | ||
| 78 | + Image($r('app.media.icon_refresh')) | ||
| 79 | + .width(14) | ||
| 80 | + .height(14) | ||
| 81 | + } | ||
| 82 | + | ||
| 83 | + Image($r("app.media.close_button")) | ||
| 84 | + .width(14) | ||
| 85 | + .height(14) | ||
| 86 | + .onClick(() => { | ||
| 87 | + }) | ||
| 70 | } | 88 | } |
| 71 | .height(40) | 89 | .height(40) |
| 72 | - .backgroundColor(0xf9f9f9) | ||
| 73 | .width('100%') | 90 | .width('100%') |
| 74 | .borderRadius(3) | 91 | .borderRadius(3) |
| 92 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 75 | } | 93 | } |
| 76 | .padding({ | 94 | .padding({ |
| 77 | left: $r('app.float.card_comp_pagePadding_lf'), | 95 | left: $r('app.float.card_comp_pagePadding_lf'), |
| @@ -87,30 +105,34 @@ export struct ZhSingleRow06 { | @@ -87,30 +105,34 @@ export struct ZhSingleRow06 { | ||
| 87 | @Builder | 105 | @Builder |
| 88 | CompHeader(item: CompDTO) { | 106 | CompHeader(item: CompDTO) { |
| 89 | Row() { | 107 | Row() { |
| 90 | - Row() { | ||
| 91 | - Image($r("app.media.icon_interest_ask")) | ||
| 92 | - .width(24) | ||
| 93 | - .height(24) | ||
| 94 | - .margin({ right: 4 }) | 108 | + Column() { |
| 95 | Text('以下是否有您感兴趣?') | 109 | Text('以下是否有您感兴趣?') |
| 96 | - .fontSize($r("app.float.font_size_17")) | 110 | + .fontSize(18) |
| 97 | .fontColor(0x000000) | 111 | .fontColor(0x000000) |
| 98 | .fontWeight(600) | 112 | .fontWeight(600) |
| 113 | + .width('70%') | ||
| 114 | + .margin({bottom: 4}) | ||
| 115 | + | ||
| 116 | + Text('选中标签,为您推荐更多您感兴趣的内容') | ||
| 117 | + .fontSize(12) | ||
| 118 | + .fontColor(0xB0B0B0) | ||
| 119 | + .margin({bottom: 10}) | ||
| 120 | + .width('70%') | ||
| 99 | } | 121 | } |
| 100 | 122 | ||
| 101 | - Row() { | ||
| 102 | - Image($r("app.media.close_button")) | ||
| 103 | - .width(14) | ||
| 104 | - .height(14) | ||
| 105 | - .onClick(() => { | ||
| 106 | - }) | ||
| 107 | - } | ||
| 108 | - .padding({ | ||
| 109 | - right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 110 | - }) | 123 | + Text('选好了') |
| 124 | + .fontColor(0xed2800) | ||
| 125 | + .fontSize(14) | ||
| 126 | + .width(62) | ||
| 127 | + .height(26) | ||
| 128 | + .backgroundColor(0xfdf0ed) | ||
| 129 | + .textAlign(TextAlign.Center) | ||
| 130 | + // .lineHeight(26) | ||
| 131 | + .borderRadius(4) | ||
| 132 | + .margin({top: -10}) | ||
| 133 | + | ||
| 111 | } | 134 | } |
| 112 | .justifyContent(FlexAlign.SpaceBetween) | 135 | .justifyContent(FlexAlign.SpaceBetween) |
| 113 | - .margin({ top: 8, bottom: 8 }) | ||
| 114 | .width('100%') | 136 | .width('100%') |
| 115 | } | 137 | } |
| 116 | } | 138 | } |
| @@ -119,107 +141,4 @@ export struct ZhSingleRow06 { | @@ -119,107 +141,4 @@ export struct ZhSingleRow06 { | ||
| 119 | function textOverflowStyle(maxLine: number) { | 141 | function textOverflowStyle(maxLine: number) { |
| 120 | .maxLines(maxLine) | 142 | .maxLines(maxLine) |
| 121 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 143 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 122 | -} | ||
| 123 | - | ||
| 124 | -@Component | ||
| 125 | -struct CreatorItem { | ||
| 126 | - @Prop item: ContentDTO | ||
| 127 | - @State rmhIsAttention: number = 0 | ||
| 128 | - build() { | ||
| 129 | - ListItem() { | ||
| 130 | - Column() { | ||
| 131 | - Flex({direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween}) { | ||
| 132 | - Column() { | ||
| 133 | - Row() { | ||
| 134 | - Image('') | ||
| 135 | - .width(20) | ||
| 136 | - .height(20) | ||
| 137 | - .margin({right: 4}) | ||
| 138 | - .border({width: 1, color: 0xcccccc, radius: 10}) | ||
| 139 | - Text('立志之间') | ||
| 140 | - .fontColor(0x212228) | ||
| 141 | - .fontSize(12) | ||
| 142 | - } | ||
| 143 | - } | ||
| 144 | - | ||
| 145 | - Column() { | ||
| 146 | - Row() { | ||
| 147 | - Image($r('app.media.icon_like_no')) | ||
| 148 | - .width(16) | ||
| 149 | - .height(16) | ||
| 150 | - .margin({right: 4}) | ||
| 151 | - Text('3835') | ||
| 152 | - .fontSize(14) | ||
| 153 | - .fontColor(0x999999) | ||
| 154 | - } | ||
| 155 | - } | ||
| 156 | - } | ||
| 157 | - .margin({top: 10, left: 10, right: 10, bottom: 8}) | ||
| 158 | - | ||
| 159 | - Text('就业不仅是民生问题,也是发展问题,就业不仅是民生问题,也是发展问题,就业不仅是民生问题,也是发展问题,') | ||
| 160 | - .maxLines(2) | ||
| 161 | - .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 162 | - .margin({left: 10, right: 10, bottom: 8}) | ||
| 163 | - .fontSize(17) | ||
| 164 | - .fontColor(0x212228) | ||
| 165 | - .lineHeight(25) | ||
| 166 | - | ||
| 167 | - Row() { | ||
| 168 | - Image('') | ||
| 169 | - .width(66) | ||
| 170 | - .height(44) | ||
| 171 | - .borderRadius({topLeft: 3, topRight: 0, bottomLeft: 3, bottomRight: 0}) | ||
| 172 | - Text('原文|强化就业优先政策 健全就业促进机制原文|强化就业优先政策 健全就业促进机制原文|强化就业优先政策 健全就业促进机制') | ||
| 173 | - .margin({left: 8}) | ||
| 174 | - .width(172) | ||
| 175 | - .maxLines(2) | ||
| 176 | - .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 177 | - } | ||
| 178 | - .linearGradient({ | ||
| 179 | - direction: GradientDirection.Right, | ||
| 180 | - colors: [[0xffffff, 0.0],[0xffffff, 0.8], [0xf9f9f9, 1.0]] | ||
| 181 | - }) | ||
| 182 | - } | ||
| 183 | - .width(276) | ||
| 184 | - .height(150) | ||
| 185 | - .margin({ right: 10 }) | ||
| 186 | - .borderWidth(1) | ||
| 187 | - .borderColor($r('app.color.color_EDEDED')) | ||
| 188 | - .borderRadius($r('app.float.image_border_radius')) | ||
| 189 | - .backgroundColor(0xf9f9f9) | ||
| 190 | - } | ||
| 191 | - .onClick(() => { | ||
| 192 | - console.log('跳转到rmh'); | ||
| 193 | - }) | ||
| 194 | - } | ||
| 195 | - | ||
| 196 | - /** | ||
| 197 | - * 关注号主 TODO 这里后面需要抽离 | ||
| 198 | - */ | ||
| 199 | - handleAccention(item: ContentDTO, status: number) { | ||
| 200 | - this.rmhIsAttention = this.rmhIsAttention ? 0 : 1 | ||
| 201 | - return | ||
| 202 | - // 未登录,跳转登录 | ||
| 203 | - if (!HttpUrlUtils.getUserId()) { | ||
| 204 | - WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 205 | - return | ||
| 206 | - } | ||
| 207 | - | ||
| 208 | - const params: postInteractAccentionOperateParams = { | ||
| 209 | - attentionUserType: item.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号) | ||
| 210 | - attentionUserId: item.rmhInfo?.userId || '', // 被关注用户号主id | ||
| 211 | - attentionCreatorId: item.rmhInfo?.rmhId || '', // 被关注用户号主id | ||
| 212 | - // userType: 1, | ||
| 213 | - // userId: '1', // TODO 用户id需要从本地获取 | ||
| 214 | - status: status, | ||
| 215 | - } | ||
| 216 | - PageRepository.postInteractAccentionOperate(params).then(res => { | ||
| 217 | - console.log(TAG, '关注号主==', JSON.stringify(res.data)) | ||
| 218 | - if (status === 1) { | ||
| 219 | - this.rmhIsAttention = 0 | ||
| 220 | - } else { | ||
| 221 | - this.rmhIsAttention = 1 | ||
| 222 | - } | ||
| 223 | - }) | ||
| 224 | - } | ||
| 225 | -} | 144 | +} |
| @@ -4,6 +4,7 @@ import { HttpUrlUtils } from 'wdNetwork/Index'; | @@ -4,6 +4,7 @@ import { HttpUrlUtils } from 'wdNetwork/Index'; | ||
| 4 | import { postInteractAccentionOperateParams } from 'wdBean'; | 4 | import { postInteractAccentionOperateParams } from 'wdBean'; |
| 5 | import { PageRepository } from '../../repository/PageRepository'; | 5 | import { PageRepository } from '../../repository/PageRepository'; |
| 6 | import { CommonConstants } from 'wdConstant/Index'; | 6 | import { CommonConstants } from 'wdConstant/Index'; |
| 7 | +import { ProcessUtils } from '../../utils/ProcessUtils'; | ||
| 7 | 8 | ||
| 8 | /** | 9 | /** |
| 9 | * 小视频横划卡 | 10 | * 小视频横划卡 |
| @@ -11,59 +12,9 @@ import { CommonConstants } from 'wdConstant/Index'; | @@ -11,59 +12,9 @@ import { CommonConstants } from 'wdConstant/Index'; | ||
| 11 | */ | 12 | */ |
| 12 | const TAG = 'Zh_Single_Row-02' | 13 | const TAG = 'Zh_Single_Row-02' |
| 13 | 14 | ||
| 14 | -@Entry | ||
| 15 | @Component | 15 | @Component |
| 16 | export struct ZhSingleRow02 { | 16 | export struct ZhSingleRow02 { |
| 17 | - @State compDTO: CompDTO = { | ||
| 18 | - objectTitle: '大标题', | ||
| 19 | - operDataList: [ | ||
| 20 | - { | ||
| 21 | - rmhInfo: { | ||
| 22 | - rmhId: '2489729', | ||
| 23 | - rmhName: '陕西青年职业学院', | ||
| 24 | - rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 25 | - rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 26 | - '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 27 | - } | ||
| 28 | - }, | ||
| 29 | - { | ||
| 30 | - rmhInfo: { | ||
| 31 | - rmhId: '2489729', | ||
| 32 | - rmhName: '陕西青年职业学院', | ||
| 33 | - rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 34 | - rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 35 | - '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 36 | - } | ||
| 37 | - }, | ||
| 38 | - { | ||
| 39 | - rmhInfo: { | ||
| 40 | - rmhId: '2489729', | ||
| 41 | - rmhName: '陕西青年职业学院', | ||
| 42 | - rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 43 | - rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 44 | - '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 45 | - } | ||
| 46 | - }, | ||
| 47 | - { | ||
| 48 | - rmhInfo: { | ||
| 49 | - rmhId: '2489729', | ||
| 50 | - rmhName: '陕西青年职业学院', | ||
| 51 | - rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 52 | - rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 53 | - '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 54 | - } | ||
| 55 | - }, | ||
| 56 | - { | ||
| 57 | - rmhInfo: { | ||
| 58 | - rmhId: '2489729', | ||
| 59 | - rmhName: '陕西青年职业学院', | ||
| 60 | - rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 61 | - rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 62 | - '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 63 | - } | ||
| 64 | - }, | ||
| 65 | - ] | ||
| 66 | - } as CompDTO | 17 | + @State compDTO: CompDTO = {} as CompDTO |
| 67 | 18 | ||
| 68 | build() { | 19 | build() { |
| 69 | Column() { | 20 | Column() { |
| @@ -127,6 +78,12 @@ export struct ZhSingleRow02 { | @@ -127,6 +78,12 @@ export struct ZhSingleRow02 { | ||
| 127 | .padding({ | 78 | .padding({ |
| 128 | right: $r('app.float.card_comp_pagePadding_lf'), | 79 | right: $r('app.float.card_comp_pagePadding_lf'), |
| 129 | }) | 80 | }) |
| 81 | + .onClick(() => { | ||
| 82 | + let params: Params = { | ||
| 83 | + pageID: "1" | ||
| 84 | + } | ||
| 85 | + WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params) | ||
| 86 | + }) | ||
| 130 | } | 87 | } |
| 131 | .justifyContent(FlexAlign.SpaceBetween) | 88 | .justifyContent(FlexAlign.SpaceBetween) |
| 132 | .margin({ top: 8, bottom: 8 }) | 89 | .margin({ top: 8, bottom: 8 }) |
| @@ -148,7 +105,7 @@ struct CreatorItem { | @@ -148,7 +105,7 @@ struct CreatorItem { | ||
| 148 | ListItem() { | 105 | ListItem() { |
| 149 | Column() { | 106 | Column() { |
| 150 | Stack({ alignContent: Alignment.Bottom }) { | 107 | Stack({ alignContent: Alignment.Bottom }) { |
| 151 | - Image('') | 108 | + Image(this.item.coverUrl) |
| 152 | .width(156) | 109 | .width(156) |
| 153 | .height(208) | 110 | .height(208) |
| 154 | Row() | 111 | Row() |
| @@ -156,29 +113,25 @@ struct CreatorItem { | @@ -156,29 +113,25 @@ struct CreatorItem { | ||
| 156 | .height(80) | 113 | .height(80) |
| 157 | .linearGradient({ | 114 | .linearGradient({ |
| 158 | direction: GradientDirection.Bottom, | 115 | direction: GradientDirection.Bottom, |
| 159 | - colors: [[0xffffff, 0.0], [0x000000, 1.0]] | 116 | + colors: [['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]] |
| 160 | }) | 117 | }) |
| 161 | - .opacity(0.3) | ||
| 162 | - Text('这里显示卡片标题这里显示卡片标题这里显示卡片标题这里显示卡片标题这里显示卡片标题') | 118 | + Text(this.item.newsTitle) |
| 163 | .fontColor(0xffffff) | 119 | .fontColor(0xffffff) |
| 164 | .fontSize(14) | 120 | .fontSize(14) |
| 165 | .maxLines(2) | 121 | .maxLines(2) |
| 166 | .textOverflow({overflow: TextOverflow.Ellipsis}) | 122 | .textOverflow({overflow: TextOverflow.Ellipsis}) |
| 167 | .width(140) | 123 | .width(140) |
| 168 | - .height(40) | ||
| 169 | .margin({bottom: 8}) | 124 | .margin({bottom: 8}) |
| 170 | } | 125 | } |
| 171 | - | ||
| 172 | } | 126 | } |
| 173 | .width(156) | 127 | .width(156) |
| 174 | .height(208) | 128 | .height(208) |
| 175 | .margin({ right: 11 }) | 129 | .margin({ right: 11 }) |
| 176 | - .borderWidth(1) | ||
| 177 | .borderColor($r('app.color.color_EDEDED')) | 130 | .borderColor($r('app.color.color_EDEDED')) |
| 178 | .borderRadius($r('app.float.image_border_radius')) | 131 | .borderRadius($r('app.float.image_border_radius')) |
| 179 | } | 132 | } |
| 180 | - .onClick(() => { | ||
| 181 | - console.log('跳转到rmh'); | 133 | + .onClick((event: ClickEvent) => { |
| 134 | + ProcessUtils.processPage(this.item) | ||
| 182 | }) | 135 | }) |
| 183 | } | 136 | } |
| 184 | 137 |
| @@ -3,7 +3,9 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | @@ -3,7 +3,9 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 3 | import { HttpUrlUtils } from 'wdNetwork/Index'; | 3 | import { HttpUrlUtils } from 'wdNetwork/Index'; |
| 4 | import { postInteractAccentionOperateParams } from 'wdBean'; | 4 | import { postInteractAccentionOperateParams } from 'wdBean'; |
| 5 | import { PageRepository } from '../../repository/PageRepository'; | 5 | import { PageRepository } from '../../repository/PageRepository'; |
| 6 | +import { DateTimeUtils } from 'wdKit/Index'; | ||
| 6 | import { CommonConstants } from 'wdConstant/Index'; | 7 | import { CommonConstants } from 'wdConstant/Index'; |
| 8 | +import { ProcessUtils } from '../../utils/ProcessUtils'; | ||
| 7 | 9 | ||
| 8 | /** | 10 | /** |
| 9 | * 精选评论卡 | 11 | * 精选评论卡 |
| @@ -11,125 +13,124 @@ import { CommonConstants } from 'wdConstant/Index'; | @@ -11,125 +13,124 @@ import { CommonConstants } from 'wdConstant/Index'; | ||
| 11 | */ | 13 | */ |
| 12 | const TAG = 'Zh_Single_Row-06' | 14 | const TAG = 'Zh_Single_Row-06' |
| 13 | 15 | ||
| 14 | -@Entry | 16 | +// interface commentInfo { |
| 17 | +// commentTitle: string, | ||
| 18 | +// newsTitle: string, | ||
| 19 | +// userName: string, | ||
| 20 | +// userHeaderUrl: string, | ||
| 21 | +// publishTime: number | ||
| 22 | +// } | ||
| 23 | +// interface operDataListItem { | ||
| 24 | +// commentInfo: commentInfo | ||
| 25 | +// } | ||
| 26 | +// interface CommentData{ | ||
| 27 | +// operDataList: Array<operDataListItem> | ||
| 28 | +// } | ||
| 29 | + | ||
| 15 | @Component | 30 | @Component |
| 16 | export struct ZhSingleRow06 { | 31 | export struct ZhSingleRow06 { |
| 17 | - @State compDTO: CompDTO = { | ||
| 18 | - objectTitle: '大标题', | ||
| 19 | - operDataList: [ | ||
| 20 | - { | ||
| 21 | - rmhInfo: { | ||
| 22 | - rmhId: '2489729', | ||
| 23 | - rmhName: '陕西青年职业学院', | ||
| 24 | - rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 25 | - rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 26 | - '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 27 | - } | ||
| 28 | - }, | ||
| 29 | - { | ||
| 30 | - rmhInfo: { | ||
| 31 | - rmhId: '2489729', | ||
| 32 | - rmhName: '陕西青年职业学院', | ||
| 33 | - rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 34 | - rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 35 | - '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 36 | - } | ||
| 37 | - }, | ||
| 38 | - { | ||
| 39 | - rmhInfo: { | ||
| 40 | - rmhId: '2489729', | ||
| 41 | - rmhName: '陕西青年职业学院', | ||
| 42 | - rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 43 | - rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 44 | - '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 45 | - } | ||
| 46 | - }, | ||
| 47 | - { | ||
| 48 | - rmhInfo: { | ||
| 49 | - rmhId: '2489729', | ||
| 50 | - rmhName: '陕西青年职业学院', | ||
| 51 | - rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 52 | - rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 53 | - '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 54 | - } | ||
| 55 | - }, | ||
| 56 | - { | ||
| 57 | - rmhInfo: { | ||
| 58 | - rmhId: '2489729', | ||
| 59 | - rmhName: '陕西青年职业学院', | ||
| 60 | - rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 61 | - rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 62 | - '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 63 | - } | ||
| 64 | - }, | ||
| 65 | - ] | ||
| 66 | - } as CompDTO | 32 | + @State compDTO: CompDTO = {} as CompDTO |
| 67 | 33 | ||
| 68 | build() { | 34 | build() { |
| 69 | Column() { | 35 | Column() { |
| 70 | //顶部 | 36 | //顶部 |
| 71 | - this.CompHeader(this.compDTO) | ||
| 72 | - Row(){ | ||
| 73 | - // 列表内容 | ||
| 74 | - List() { | ||
| 75 | - ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => { | ||
| 76 | - CreatorItem({ | ||
| 77 | - item | ||
| 78 | - }) | ||
| 79 | - .margin({right: index === this.compDTO.operDataList.length - 1 ? $r('app.float.card_comp_pagePadding_lf') : 0}) | ||
| 80 | - }) | 37 | + if (this.compDTO.operDataList?.length > 0) { |
| 38 | + this.CompHeader(this.compDTO) | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + Column(){ | ||
| 42 | + Text(this.compDTO.operDataList[0]?.commentInfo?.commentTitle) | ||
| 43 | + .maxLines(4) | ||
| 44 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 45 | + .lineHeight(23) | ||
| 46 | + .fontSize(16) | ||
| 47 | + .margin({bottom: 19}) | ||
| 48 | + .textAlign(TextAlign.Start) | ||
| 49 | + .width('100%') | ||
| 50 | + | ||
| 51 | + | ||
| 52 | + Row() { | ||
| 53 | + Image($r('app.media.icon_clip')) | ||
| 54 | + .width(16) | ||
| 55 | + .height(16) | ||
| 56 | + .margin({right: 5}) | ||
| 57 | + Text(this.compDTO.operDataList[0]?.commentInfo?.newsTitle) | ||
| 58 | + .maxLines(1) | ||
| 59 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 60 | + .fontSize(14) | ||
| 61 | + .fontColor(0x666666) | ||
| 81 | } | 62 | } |
| 82 | - .listDirection(Axis.Horizontal) | 63 | + .justifyContent(FlexAlign.Start) |
| 64 | + .width('100%') | ||
| 83 | } | 65 | } |
| 84 | - .width(CommonConstants.FULL_WIDTH) | ||
| 85 | - .height(208) | 66 | + .width("100%") |
| 67 | + .padding({top: 12, bottom: 12, left: 10, right: 10}) | ||
| 68 | + .backgroundColor(0xf9f9f9) | ||
| 69 | + .borderRadius(4) | ||
| 70 | + .margin({bottom: 12}) | ||
| 71 | + | ||
| 72 | + Row() { | ||
| 73 | + Text(DateTimeUtils.getCommentTime(this.compDTO.operDataList[0]?.commentInfo?.publishTime)) | ||
| 74 | + .fontSize(14) | ||
| 75 | + .fontColor(0x999999) | ||
| 76 | + | ||
| 77 | + Row(){ | ||
| 78 | + Image($r('app.media.icon_like_no')) | ||
| 79 | + .width(16) | ||
| 80 | + .height(16) | ||
| 81 | + .margin({right: 3}) | ||
| 82 | + | ||
| 83 | + Text('点赞') | ||
| 84 | + .fontSize(14) | ||
| 85 | + .fontColor(0x999999) | ||
| 86 | + } | ||
| 87 | + } | ||
| 88 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 89 | + .width('100%') | ||
| 86 | } | 90 | } |
| 87 | .padding({ | 91 | .padding({ |
| 88 | left: $r('app.float.card_comp_pagePadding_lf'), | 92 | left: $r('app.float.card_comp_pagePadding_lf'), |
| 89 | - // right: $r('app.float.card_comp_pagePadding_lf'), | 93 | + right: $r('app.float.card_comp_pagePadding_lf'), |
| 90 | top: $r('app.float.card_comp_pagePadding_tb'), | 94 | top: $r('app.float.card_comp_pagePadding_tb'), |
| 91 | bottom: $r('app.float.card_comp_pagePadding_tb') | 95 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 92 | }) | 96 | }) |
| 93 | .backgroundColor($r('app.color.white')) | 97 | .backgroundColor($r('app.color.white')) |
| 94 | .margin({ bottom: 8 }) | 98 | .margin({ bottom: 8 }) |
| 99 | + .height(251) | ||
| 100 | + .onClick(() => { | ||
| 101 | + ProcessUtils.processPage(this.compDTO.operDataList[0]) | ||
| 102 | + }) | ||
| 95 | } | 103 | } |
| 96 | 104 | ||
| 97 | @Builder | 105 | @Builder |
| 98 | CompHeader(item: CompDTO) { | 106 | CompHeader(item: CompDTO) { |
| 99 | Row() { | 107 | Row() { |
| 100 | Row() { | 108 | Row() { |
| 101 | - Image($r("app.media.icon_elite_comment")) | ||
| 102 | - .width(24) | ||
| 103 | - .height(24) | ||
| 104 | - .margin({ right: 4 }) | ||
| 105 | - Text('精选评论') | ||
| 106 | - .fontSize($r("app.float.font_size_17")) | ||
| 107 | - .fontColor($r("app.color.color_222222")) | ||
| 108 | - .fontWeight(600) | 109 | + Image(item.operDataList[0]?.commentInfo?.userHeaderUrl ? item.operDataList[0].commentInfo.userHeaderUrl : $r('app.media.default_head')) |
| 110 | + .width(32) | ||
| 111 | + .height(32) | ||
| 112 | + .borderRadius(16) | ||
| 113 | + .margin({right: 8}) | ||
| 114 | + Text(item.operDataList[0]?.commentInfo?.userName) | ||
| 115 | + .lineHeight(32) | ||
| 116 | + .fontSize(14) | ||
| 117 | + .fontColor(0x222222) | ||
| 118 | + .maxLines(1) | ||
| 119 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 109 | } | 120 | } |
| 110 | 121 | ||
| 111 | Row() { | 122 | Row() { |
| 112 | - Text("更多") | ||
| 113 | - .fontSize($r("app.float.font_size_14")) | ||
| 114 | - .fontColor($r("app.color.color_999999")) | 123 | + Image($r("app.media.icon_elite_comment")) |
| 124 | + .width(45) | ||
| 125 | + .height(22) | ||
| 115 | .margin({ right: 1 }) | 126 | .margin({ right: 1 }) |
| 116 | Image($r("app.media.more")) | 127 | Image($r("app.media.more")) |
| 117 | .width(14) | 128 | .width(14) |
| 118 | .height(14) | 129 | .height(14) |
| 119 | - .onClick(() => { | ||
| 120 | - // TODO 跳转的页面,定义的入参可能不合理。推荐id: 41 | ||
| 121 | - let params: Params = { | ||
| 122 | - pageID: "1" | ||
| 123 | - } | ||
| 124 | - WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params) | ||
| 125 | - }) | ||
| 126 | } | 130 | } |
| 127 | - .padding({ | ||
| 128 | - right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 129 | - }) | ||
| 130 | } | 131 | } |
| 132 | + .margin({bottom: 10}) | ||
| 131 | .justifyContent(FlexAlign.SpaceBetween) | 133 | .justifyContent(FlexAlign.SpaceBetween) |
| 132 | - .margin({ top: 8, bottom: 8 }) | ||
| 133 | .width('100%') | 134 | .width('100%') |
| 134 | } | 135 | } |
| 135 | } | 136 | } |
765 Bytes
-
Please register or login to post a comment