zhenghy

Merge remote-tracking branch 'origin/main'

Showing 33 changed files with 476 additions and 389 deletions
@@ -2,4 +2,5 @@ export default class BuildProfile { @@ -2,4 +2,5 @@ export default class BuildProfile {
2 static readonly HAR_VERSION = '1.0.0'; 2 static readonly HAR_VERSION = '1.0.0';
3 static readonly BUILD_MODE_NAME = 'debug'; 3 static readonly BUILD_MODE_NAME = 'debug';
4 static readonly DEBUG = true; 4 static readonly DEBUG = true;
  5 + static readonly TARGET_NAME = 'default';
5 } 6 }
  1 +import { ToastUtils } from 'wdKit';
  2 +
  3 +/**
  4 + * 卡片 分享、评论、点赞公用组件
  5 + */
  6 +@Component
  7 +export struct CarderInteraction {
  8 + build() {
  9 + Row(){
  10 + Row(){
  11 + Image($r('app.media.CarderInteraction_share'))
  12 + .width(18)
  13 + .height(18)
  14 + Text('分享')
  15 + .margin({left:4})
  16 + .fontSize(14)
  17 + .fontColor('#666666')
  18 + }
  19 + .justifyContent(FlexAlign.Center)
  20 + .onClick(()=>{
  21 + ToastUtils.showToast('分享为公共方法,待开发', 1000)
  22 + })
  23 + Row(){
  24 + Image($r('app.media.CarderInteraction_comment'))
  25 + .width(18)
  26 + .height(18)
  27 + Text('评论')
  28 + .margin({left:4})
  29 + .fontSize(14)
  30 + .fontColor('#666666')
  31 + }
  32 + .justifyContent(FlexAlign.Center)
  33 + .onClick(()=>{
  34 + ToastUtils.showToast('分享为公共方法,待开发', 1000)
  35 + })
  36 + Row(){
  37 + Image($r('app.media.CarderInteraction_like'))
  38 + .width(18)
  39 + .height(18)
  40 + Text('点赞')
  41 + .margin({left:4})
  42 + .fontSize(14)
  43 + .fontColor('#666666')
  44 + }
  45 + .justifyContent(FlexAlign.Center)
  46 + .onClick(()=>{
  47 + ToastUtils.showToast('分享为公共方法,待开发', 1000)
  48 + })
  49 + }
  50 + .width('100%')
  51 + .margin({top:11})
  52 + .padding({
  53 + left:21,
  54 + right:21
  55 + })
  56 + .justifyContent(FlexAlign.SpaceBetween)
  57 + .alignItems(VerticalAlign.Center)
  58 + }
  59 +}
@@ -27,35 +27,51 @@ export struct PaperTitleComponent { @@ -27,35 +27,51 @@ export struct PaperTitleComponent {
27 27
28 Row() { 28 Row() {
29 // 在 29 * 18 的矩形框中绘制一个三角形,起点(0, 0),经过(0, 18),经过(20, 18),终点(29, 0) 29 // 在 29 * 18 的矩形框中绘制一个三角形,起点(0, 0),经过(0, 18),经过(20, 18),终点(29, 0)
30 - Polygon({ width: 29, height: 18 })  
31 - .points([[0, 0], [0, 18], [20, 18], [29, 0]])// .fill(Color.White)  
32 - .fillOpacity(0.2)  
33 - .fill(Color.White) 30 + // Polygon({ width: 29, height: 18 })
  31 + // .points([[0, 0], [0, 18], [20, 18], [29, 0]])// .fill(Color.White)
  32 + // .fillOpacity(0.2)
  33 + // .fill(Color.White)
34 // .linearGradient({ 34 // .linearGradient({
35 // direction: GradientDirection.Right, 35 // direction: GradientDirection.Right,
36 // colors: [[0xffffff, 1.0], [0xffffff, 0.75], [0xffffff, 0.5], [0xffffff, 0.0], [0xffffff, 0.0]] 36 // colors: [[0xffffff, 1.0], [0xffffff, 0.75], [0xffffff, 0.5], [0xffffff, 0.0], [0xffffff, 0.0]]
37 // }) 37 // })
  38 + Row()
  39 + .width('29vp')
  40 + .height('18vp')
  41 + .clip(new Path({
  42 + commands: `M0 0 H${vp2px(29)} L${vp2px(20)} ${vp2px(18)} L0 ${vp2px(18)} Z`
  43 + }))
  44 + .linearGradient({
  45 + direction: GradientDirection.Right, // 渐变方向
  46 + repeating: false, // 渐变颜色是否重复
  47 + colors: [[0x1affffff, 0.0],[0x1affffff, 0.3], [0x33ffffff, 0.6], [0x4dffffff,1]] // 数组末尾元素占比小于1时满足重复着色效果
  48 + })
  49 +
38 Text(this.title ?? "") 50 Text(this.title ?? "")
39 - .margin({ left: 5 })  
40 - .fontSize(20) 51 + .margin({ left: 10 })
  52 + .fontSize(22)
41 .fontColor($r('app.color.white')) 53 .fontColor($r('app.color.white'))
  54 + .fontWeight(900)
42 .maxLines(1) 55 .maxLines(1)
43 56
  57 +
44 Text(this.subTitle ?? '')// Text('2024年\n1月16日') 58 Text(this.subTitle ?? '')// Text('2024年\n1月16日')
45 // .width(50) 59 // .width(50)
46 - .margin({ left: 5 })  
47 - .fontSize(8) 60 + .margin({ left: 6 })
  61 + .fontSize(10)
48 .fontColor($r('app.color.white')) 62 .fontColor($r('app.color.white'))
49 .maxLines(2) 63 .maxLines(2)
  64 + .textAlign(TextAlign.End)
50 this.rightDecorateBuilder() 65 this.rightDecorateBuilder()
51 // .linearGradient({ 66 // .linearGradient({
52 // direction: GradientDirection.Right, 67 // direction: GradientDirection.Right,
53 // colors: [[0x4Dffffff, 1.0], [0x4Dffffff, 0.75], [0x4Dffffff, 0.5], [0x4Dffffff, 0.75], [0x1ffffff, 0.0]] 68 // colors: [[0x4Dffffff, 1.0], [0x4Dffffff, 0.75], [0x4Dffffff, 0.5], [0x4Dffffff, 0.75], [0x1ffffff, 0.0]]
54 // }) 69 // })
55 - Image($r('app.media.bg_event_status_end'))  
56 - .height($r('app.float.top_arrow_size'))  
57 - .width(100)  
58 - .visibility(Visibility.None) 70 + // Image($r('app.media.bg_event_status_end'))
  71 + // .height($r('app.float.top_arrow_size'))
  72 + // .width(100)
  73 + // .visibility(Visibility.None)
  74 +
59 } 75 }
60 .height('100%') 76 .height('100%')
61 .alignItems(VerticalAlign.Center) 77 .alignItems(VerticalAlign.Center)
@@ -87,7 +103,7 @@ export struct PaperTitleComponent { @@ -87,7 +103,7 @@ export struct PaperTitleComponent {
87 center: { anchor: "__container__", align: VerticalAlign.Center } 103 center: { anchor: "__container__", align: VerticalAlign.Center }
88 }) 104 })
89 .id('img_share') 105 .id('img_share')
90 - .margin({ right: 13 }) 106 + .margin({ right: 16 })
91 .onClick(() => { 107 .onClick(() => {
92 ToastUtils.showToast('分享为公共方法,待开发', 1000) 108 ToastUtils.showToast('分享为公共方法,待开发', 1000)
93 }) 109 })
@@ -105,19 +121,32 @@ export struct PaperTitleComponent { @@ -105,19 +121,32 @@ export struct PaperTitleComponent {
105 121
106 @Builder 122 @Builder
107 rightDecorateBuilder() { 123 rightDecorateBuilder() {
108 - Row() {  
109 - Polygon({ width: 20, height: 18 })  
110 - .points([[8, 0], [0, 18], [20, 18], [20, 0]])// .fill(Color.White)  
111 - .fillOpacity(0.3)  
112 - .fill(Color.White)  
113 - Rect({ width: 80, height: 18 })// .fillOpacity(0.3)  
114 - .fill(Color.White)  
115 - .fillOpacity(0.01) 124 + Row()
  125 + .width('100vp')
  126 + .height('18vp')
  127 + .clip(new Path({
  128 + commands: `M${vp2px(9)} 0 H${vp2px(91)} V${vp2px(18)} L0 ${vp2px(18)} Z`
  129 + }))
116 .linearGradient({ 130 .linearGradient({
117 - direction: GradientDirection.Right,  
118 - colors: [[0x4Dffffff, 1.0], [0x4Dffffff, 0.75], [0x4Dffffff, 0.5], [0x40ffffff, 0.25], [0x1ffffff, 0.0]] 131 + direction: GradientDirection.Right, // 渐变方向
  132 + repeating: false, // 渐变颜色是否重复
  133 + colors: [[0x4dffffff, 0.0], [0x33ffffff, 0.3], [0x1affffff,0.6], [0x03ffffff,1]] // 数组末尾元素占比小于1时满足重复着色效果
119 }) 134 })
120 - }  
121 - .margin({ left: 6 }) 135 + .margin({ left:8, right: 0})
  136 +
  137 + // Row() {
  138 + // Polygon({ width: 20, height: 18 })
  139 + // .points([[8, 0], [0, 18], [20, 18], [20, 0]])// .fill(Color.White)
  140 + // .fillOpacity(0.3)
  141 + // .fill(Color.White)
  142 + // Rect({ width: 80, height: 18 })// .fillOpacity(0.3)
  143 + // .fill(Color.White)
  144 + // .fillOpacity(0.01)
  145 + // .linearGradient({
  146 + // direction: GradientDirection.Right,
  147 + // colors: [[0x4Dffffff, 1.0], [0x4Dffffff, 0.75], [0x4Dffffff, 0.5], [0x40ffffff, 0.25], [0x1ffffff, 0.0]]
  148 + // })
  149 + // }
  150 + // .margin({ left: 6 })
122 } 151 }
123 } 152 }
@@ -3,6 +3,8 @@ import { CommonConstants } from 'wdConstant'; @@ -3,6 +3,8 @@ import { CommonConstants } from 'wdConstant';
3 import { ProcessUtils } from 'wdRouter'; 3 import { ProcessUtils } from 'wdRouter';
4 import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; 4 import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
5 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; 5 import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
  6 +import { Notes } from './notes';
  7 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
6 8
7 /** 9 /**
8 * 大专题卡--CompStyle: 10 10 * 大专题卡--CompStyle: 10
@@ -13,6 +15,11 @@ const TAG: string = 'Card10Component'; @@ -13,6 +15,11 @@ const TAG: string = 'Card10Component';
13 @Component 15 @Component
14 export struct Card10Component { 16 export struct Card10Component {
15 @State contentDTO: ContentDTO = {} as ContentDTO; 17 @State contentDTO: ContentDTO = {} as ContentDTO;
  18 + @State loadImg: boolean = false;
  19 +
  20 + async aboutToAppear(): Promise<void> {
  21 + this.loadImg = await onlyWifiLoadImg();
  22 + }
16 23
17 build() { 24 build() {
18 Column() { 25 Column() {
@@ -31,7 +38,8 @@ export struct Card10Component { @@ -31,7 +38,8 @@ export struct Card10Component {
31 } 38 }
32 // 大图 39 // 大图
33 Stack() { 40 Stack() {
34 - Image(this.contentDTO && this.contentDTO.coverUrl) 41 + Image(this.loadImg ? this.contentDTO?.coverUrl : '')
  42 + .backgroundColor(0xf5f5f5)
35 .width('100%') 43 .width('100%')
36 .borderRadius({ 44 .borderRadius({
37 topLeft: $r('app.float.image_border_radius'), 45 topLeft: $r('app.float.image_border_radius'),
@@ -40,19 +48,8 @@ export struct Card10Component { @@ -40,19 +48,8 @@ export struct Card10Component {
40 .onClick((event: ClickEvent) => { 48 .onClick((event: ClickEvent) => {
41 ProcessUtils.processPage(this.contentDTO) 49 ProcessUtils.processPage(this.contentDTO)
42 }) 50 })
43 - // Text('专题')  
44 - // .fontSize($r('app.float.font_size_12'))  
45 - // .padding({ left: 8, right: 8, top: 3, bottom: 3 })  
46 - // .backgroundColor(Color.Red)  
47 - // .fontColor(Color.White)  
48 - // .borderRadius($r('app.float.button_border_radius'))  
49 - // .margin({ left: 5, bottom: 5 })  
50 51
51 - ImageSpan($r('app.media.special'))  
52 - .width($r('app.float.font_size_36'))  
53 - .objectFit(ImageFit.Fill)  
54 - .verticalAlign(ImageSpanAlignment.CENTER)  
55 - .margin({ left: 5, bottom: 5 }) 52 + Notes({ objectType: 5 }).margin({ left: 5, bottom: 5 })
56 }.alignContent(Alignment.BottomStart) 53 }.alignContent(Alignment.BottomStart)
57 54
58 // 专题列表--后端返回三个, 55 // 专题列表--后端返回三个,
@@ -99,31 +96,18 @@ export struct Card10Component { @@ -99,31 +96,18 @@ export struct Card10Component {
99 timelineItem(item: slideShows, index: number) { 96 timelineItem(item: slideShows, index: number) {
100 Row() { 97 Row() {
101 Column() { 98 Column() {
102 -  
103 - Text(item.newsTitle) { 99 + Stack() {
104 if (item.objectType == '5') { 100 if (item.objectType == '5') {
105 - // Text('专题')  
106 - // .fontSize($r('app.float.font_size_12'))  
107 - // .padding({ left: 8, right: 8, top: 3, bottom: 3 })  
108 - // .backgroundColor(Color.Red)  
109 - // .fontColor(Color.White)  
110 - // .borderRadius($r('app.float.button_border_radius'))  
111 - // .margin({ right: 5 })  
112 - ImageSpan($r('app.media.special'))  
113 - .width($r('app.float.font_size_36'))  
114 - .objectFit(ImageFit.Fill)  
115 - .verticalAlign(ImageSpanAlignment.CENTER)  
116 - .margin({ right: 5 }) 101 + Notes({ objectType: 5 })
117 } 102 }
118 -  
119 - Span(item.newsTitle)  
120 - }  
121 - .fontSize($r('app.float.font_size_17'))  
122 - .fontWeight(400)  
123 - .fontColor($r('app.color.color_222222'))  
124 - .maxLines(2)  
125 - .textOverflow({ overflow: TextOverflow.Ellipsis })  
126 - 103 + Text(item.newsTitle)
  104 + .fontSize($r('app.float.font_size_17'))
  105 + .fontWeight(400)
  106 + .fontColor($r('app.color.color_222222'))
  107 + .maxLines(2)
  108 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  109 + .textIndent(item.objectType == '5' ? 40 : 0)
  110 + }.alignContent(Alignment.TopStart)
127 111
128 CardSourceInfo( 112 CardSourceInfo(
129 { 113 {
@@ -140,7 +124,8 @@ export struct Card10Component { @@ -140,7 +124,8 @@ export struct Card10Component {
140 // 右侧图片 124 // 右侧图片
141 if (item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) { 125 if (item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) {
142 Stack() { 126 Stack() {
143 - Image(item.fullColumnImgUrls[0].url) 127 + Image(this.loadImg ? item.fullColumnImgUrls[0].url : '')
  128 + .backgroundColor(0xf5f5f5)
144 .width(117) 129 .width(117)
145 .height(78) 130 .height(78)
146 .objectFit(ImageFit.Cover) 131 .objectFit(ImageFit.Cover)
@@ -3,6 +3,7 @@ import { RmhTitle } from '../cardCommon/RmhTitle' @@ -3,6 +3,7 @@ import { RmhTitle } from '../cardCommon/RmhTitle'
3 import { CardMediaInfo } from '../cardCommon/CardMediaInfo' 3 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
4 import { CommonConstants } from 'wdConstant/Index'; 4 import { CommonConstants } from 'wdConstant/Index';
5 import { ProcessUtils } from 'wdRouter'; 5 import { ProcessUtils } from 'wdRouter';
  6 +import {CarderInteraction} from '../CarderInteraction'
6 7
7 const TAG = 'Card12Component'; 8 const TAG = 'Card12Component';
8 9
@@ -34,7 +35,7 @@ export struct Card12Component { @@ -34,7 +35,7 @@ export struct Card12Component {
34 .lineHeight(25) 35 .lineHeight(25)
35 .fontFamily('PingFang SC-Regular') 36 .fontFamily('PingFang SC-Regular')
36 } 37 }
37 - 38 + CarderInteraction()
38 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 39 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
39 } 40 }
40 .padding({ 41 .padding({
@@ -3,6 +3,8 @@ import { RmhTitle } from '../cardCommon/RmhTitle' @@ -3,6 +3,8 @@ import { RmhTitle } from '../cardCommon/RmhTitle'
3 import { CardMediaInfo } from '../cardCommon/CardMediaInfo' 3 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
4 import { CommonConstants } from 'wdConstant/Index'; 4 import { CommonConstants } from 'wdConstant/Index';
5 import { ProcessUtils } from 'wdRouter'; 5 import { ProcessUtils } from 'wdRouter';
  6 +import {CarderInteraction} from '../CarderInteraction'
  7 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
6 8
7 const TAG = 'Card14Component'; 9 const TAG = 'Card14Component';
8 10
@@ -11,41 +13,11 @@ const TAG = 'Card14Component'; @@ -11,41 +13,11 @@ const TAG = 'Card14Component';
11 */ 13 */
12 @Component 14 @Component
13 export struct Card14Component { 15 export struct Card14Component {
14 - @State contentDTO: ContentDTO = {  
15 - appStyle: '20',  
16 - coverType: 1,  
17 - coverUrl: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90',  
18 - fullColumnImgUrls: [  
19 - {  
20 - landscape: 1,  
21 - size: 1,  
22 - url: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90',  
23 - weight: 1600  
24 - }  
25 - ],  
26 - newsTitle: '好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》',  
27 - rmhInfo: {  
28 - authIcon:  
29 - 'https://cdnjdphoto.aikan.pdnews.cn/creator-category/icon/auth/yellow.png',  
30 - authTitle: '10后音乐人王烁然个人人民号',  
31 - authTitle2: '10后音乐人王烁然个人人民号',  
32 - banControl: 0,  
33 - cnIsAttention: 1,  
34 - rmhDesc: '10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人',  
35 - rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn/image/creator/rmh/20221031/3d3419e86a.jpeg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg',  
36 - rmhName: '王烁然',  
37 - userId: '522435359667845',  
38 - userType: '2'  
39 - },  
40 - objectType: '1',  
41 - videoInfo: {  
42 - firstFrameImageUri: '',  
43 - videoDuration: 37,  
44 - videoUrl: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/mp4/202105/rmrb_GSNARt6P1622451310.mp4'  
45 - }  
46 - } as ContentDTO; 16 + @State contentDTO: ContentDTO = {} as ContentDTO;
  17 + @State loadImg: boolean = false;
47 18
48 - aboutToAppear(): void { 19 + async aboutToAppear(): Promise<void> {
  20 + this.loadImg = await onlyWifiLoadImg();
49 } 21 }
50 22
51 build() { 23 build() {
@@ -68,7 +40,8 @@ export struct Card14Component { @@ -68,7 +40,8 @@ export struct Card14Component {
68 .margin({right: 12}) 40 .margin({right: 12})
69 .flexBasis(214) 41 .flexBasis(214)
70 42
71 - Image(this.contentDTO.coverUrl) 43 + Image(this.loadImg ? this.contentDTO.coverUrl : '')
  44 + .backgroundColor(0xf5f5f5)
72 .flexBasis(117) 45 .flexBasis(117)
73 .height(78) 46 .height(78)
74 .borderRadius($r('app.float.image_border_radius')) 47 .borderRadius($r('app.float.image_border_radius'))
@@ -79,7 +52,7 @@ export struct Card14Component { @@ -79,7 +52,7 @@ export struct Card14Component {
79 .width(CommonConstants.FULL_WIDTH) 52 .width(CommonConstants.FULL_WIDTH)
80 .margin({ bottom: 8 }) 53 .margin({ bottom: 8 })
81 .height(75) 54 .height(75)
82 - 55 + CarderInteraction()
83 56
84 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 57 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
85 } 58 }
@@ -3,6 +3,8 @@ import { ProcessUtils } from 'wdRouter'; @@ -3,6 +3,8 @@ import { ProcessUtils } from 'wdRouter';
3 import { RmhTitle } from '../cardCommon/RmhTitle' 3 import { RmhTitle } from '../cardCommon/RmhTitle'
4 import { CardMediaInfo } from '../cardCommon/CardMediaInfo' 4 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
5 import { CommonConstants } from 'wdConstant/Index'; 5 import { CommonConstants } from 'wdConstant/Index';
  6 +import {CarderInteraction} from '../CarderInteraction'
  7 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
6 8
7 const TAG: string = 'Card15Component'; 9 const TAG: string = 'Card15Component';
8 10
@@ -15,45 +17,13 @@ const TAG: string = 'Card15Component'; @@ -15,45 +17,13 @@ const TAG: string = 'Card15Component';
15 */ 17 */
16 @Component 18 @Component
17 export struct Card15Component { 19 export struct Card15Component {
18 - @State contentDTO: ContentDTO = {  
19 - // appStyle: '15',  
20 - // coverType: 1,  
21 - // objectType: '9',  
22 - // coverUrl: 'https://rmrbcmsonline.peopleapp.com/rb_recsys/img/2024/0413/VL20Z09ISBEKXZU_963672030241091584.jpeg?x-oss-process=image/resize,m_fill,h_450,w_800/quality,q_90',  
23 - // fullColumnImgUrls: [  
24 - // {  
25 - // landscape: 2,  
26 - // size: 1,  
27 - // url: 'https://rmrbcmsonline.peopleapp.com/rb_recsys/img/2024/0413/VL20Z09ISBEKXZU_963672030241091584.jpeg?x-oss-process=image/resize,m_fill,h_450,w_800/quality,q_90',  
28 - // weight: 1170  
29 - // }  
30 - // ],  
31 - // newsTitle: '押解画面公开!被湖北民警从柬埔寨押解回国被湖北民警从柬埔寨押解回国的130名涉赌诈嫌疑人是他们被湖北民警从柬埔寨押解回国的130名涉赌诈嫌疑人是他们的130名涉赌诈嫌疑人是他们',  
32 - // publishTime: '1712993333000',  
33 - // rmhInfo: {  
34 - // authIcon: '',  
35 - // authTitle: '',  
36 - // authTitle2: '',  
37 - // banControl: 0,  
38 - // cnIsAttention: 1,  
39 - // rmhDesc: '中共武汉市委机关报长江日报官方人民号',  
40 - // rmhHeadUrl: 'https://uatjdcdnphoto.aikan.pdnews.cn/vod/content/202302/202302Sa121448724/TUw.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg',  
41 - // rmhId: '4255270',  
42 - // rmhName: '长江日报',  
43 - // userId: '513696944662469',  
44 - // userType: '3'  
45 - // },  
46 - // videoInfo: {  
47 - // firstFrameImageUri: '',  
48 - // videoDuration: 12,  
49 - // // videoLandscape: 2,  
50 - // videoUrl: 'https://rmrbcmsonline.peopleapp.com/rb_recsys/video/2024/0413/VL20Z09ISBEKXZU_963672027208609792.mp4'  
51 - // },  
52 - // photoNum: '9',  
53 - // voiceInfo: {  
54 - // voiceDuration: 12  
55 - // }  
56 - } as ContentDTO; 20 + @State contentDTO: ContentDTO = {} as ContentDTO;
  21 + @State loadImg: boolean = false;
  22 +
  23 + async aboutToAppear(): Promise<void> {
  24 + this.loadImg = await onlyWifiLoadImg();
  25 + }
  26 +
57 27
58 build() { 28 build() {
59 Column() { 29 Column() {
@@ -70,7 +40,8 @@ export struct Card15Component { @@ -70,7 +40,8 @@ export struct Card15Component {
70 } 40 }
71 //大图 41 //大图
72 Stack() { 42 Stack() {
73 - Image(this.contentDTO.coverUrl) 43 + Image(this.loadImg ? this.contentDTO.coverUrl : '')
  44 + .backgroundColor(0xf5f5f5)
74 .borderRadius($r('app.float.image_border_radius')) 45 .borderRadius($r('app.float.image_border_radius'))
75 //播放状态+时长 46 //播放状态+时长
76 CardMediaInfo({ 47 CardMediaInfo({
@@ -80,7 +51,7 @@ export struct Card15Component { @@ -80,7 +51,7 @@ export struct Card15Component {
80 .width(CommonConstants.FULL_WIDTH) 51 .width(CommonConstants.FULL_WIDTH)
81 .aspectRatio(16 / 9) 52 .aspectRatio(16 / 9)
82 .alignContent(Alignment.BottomEnd) 53 .alignContent(Alignment.BottomEnd)
83 - 54 + CarderInteraction()
84 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 55 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
85 } 56 }
86 .padding({ 57 .padding({
@@ -3,6 +3,8 @@ import { RmhTitle } from '../cardCommon/RmhTitle' @@ -3,6 +3,8 @@ import { RmhTitle } from '../cardCommon/RmhTitle'
3 import { CardMediaInfo } from '../cardCommon/CardMediaInfo' 3 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
4 import { CommonConstants } from 'wdConstant/Index'; 4 import { CommonConstants } from 'wdConstant/Index';
5 import { ProcessUtils } from 'wdRouter'; 5 import { ProcessUtils } from 'wdRouter';
  6 +import {CarderInteraction} from '../CarderInteraction'
  7 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
6 8
7 const TAG = 'Card16Component'; 9 const TAG = 'Card16Component';
8 10
@@ -17,8 +19,10 @@ interface fullColumnImgUrlItem { @@ -17,8 +19,10 @@ interface fullColumnImgUrlItem {
17 @Component 19 @Component
18 export struct Card16Component { 20 export struct Card16Component {
19 @State contentDTO: ContentDTO = {} as ContentDTO; 21 @State contentDTO: ContentDTO = {} as ContentDTO;
  22 + @State loadImg: boolean = false;
20 23
21 - aboutToAppear(): void { 24 + async aboutToAppear(): Promise<void> {
  25 + this.loadImg = await onlyWifiLoadImg();
22 } 26 }
23 27
24 build() { 28 build() {
@@ -40,10 +44,15 @@ export struct Card16Component { @@ -40,10 +44,15 @@ export struct Card16Component {
40 if (this.contentDTO.fullColumnImgUrls?.length > 0) { 44 if (this.contentDTO.fullColumnImgUrls?.length > 0) {
41 Flex() { 45 Flex() {
42 ForEach(this.contentDTO.fullColumnImgUrls.slice(0, 3), (item: fullColumnImgUrlItem, index: number) => { 46 ForEach(this.contentDTO.fullColumnImgUrls.slice(0, 3), (item: fullColumnImgUrlItem, index: number) => {
43 - Image(item.url).flexBasis(113).height(75).margin({ right: index > 1 ? 0 : 2 }) 47 + Image(this.loadImg ? item.url : '')
  48 + .backgroundColor(0xf5f5f5)
  49 + .flexBasis(113)
  50 + .height(75)
  51 + .margin({ right: index > 1 ? 0 : 2 })
44 }) 52 })
45 } 53 }
46 } 54 }
  55 + CarderInteraction()
47 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 56 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
48 } 57 }
49 .padding({ 58 .padding({
@@ -68,6 +77,11 @@ interface radiusType { @@ -68,6 +77,11 @@ interface radiusType {
68 @Component 77 @Component
69 struct createImg { 78 struct createImg {
70 @Prop contentDTO: ContentDTO 79 @Prop contentDTO: ContentDTO
  80 + @State loadImg: boolean = false;
  81 +
  82 + async aboutToAppear(): Promise<void> {
  83 + this.loadImg = await onlyWifiLoadImg();
  84 + }
71 85
72 build() { 86 build() {
73 GridRow() { 87 GridRow() {
@@ -77,7 +91,8 @@ struct createImg { @@ -77,7 +91,8 @@ struct createImg {
77 span: { xs: 12 } 91 span: { xs: 12 }
78 }) { 92 }) {
79 Stack() { 93 Stack() {
80 - Image(this.contentDTO.coverUrl) 94 + Image(this.loadImg ? this.contentDTO.coverUrl : '')
  95 + .backgroundColor(0xf5f5f5)
81 .width(CommonConstants.FULL_WIDTH) 96 .width(CommonConstants.FULL_WIDTH)
82 .aspectRatio(16 / 9) 97 .aspectRatio(16 / 9)
83 .borderRadius($r('app.float.image_border_radius')) 98 .borderRadius($r('app.float.image_border_radius'))
@@ -91,7 +106,8 @@ struct createImg { @@ -91,7 +106,8 @@ struct createImg {
91 span: { xs: 6 } 106 span: { xs: 6 }
92 }) { 107 }) {
93 Stack() { 108 Stack() {
94 - Image(this.contentDTO.coverUrl) 109 + Image(this.loadImg ? this.contentDTO.coverUrl : '')
  110 + .backgroundColor(0xf5f5f5)
95 .width(CommonConstants.FULL_WIDTH) 111 .width(CommonConstants.FULL_WIDTH)
96 .borderRadius($r('app.float.image_border_radius')) 112 .borderRadius($r('app.float.image_border_radius'))
97 CardMediaInfo({ contentDTO: this.contentDTO }) 113 CardMediaInfo({ contentDTO: this.contentDTO })
@@ -5,6 +5,8 @@ import { DateTimeUtils } from 'wdKit'; @@ -5,6 +5,8 @@ import { DateTimeUtils } from 'wdKit';
5 import { WDRouterRule } from 'wdRouter'; 5 import { WDRouterRule } from 'wdRouter';
6 import { CardMediaInfo } from '../cardCommon/CardMediaInfo' 6 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
7 import { CardSourceInfo } from '../cardCommon/CardSourceInfo' 7 import { CardSourceInfo } from '../cardCommon/CardSourceInfo'
  8 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
  9 +
8 const TAG = 'Card17Component'; 10 const TAG = 'Card17Component';
9 11
10 /** 12 /**
@@ -14,6 +16,12 @@ const TAG = 'Card17Component'; @@ -14,6 +16,12 @@ const TAG = 'Card17Component';
14 export struct Card17Component { 16 export struct Card17Component {
15 @State compDTO: CompDTO = {} as CompDTO 17 @State compDTO: CompDTO = {} as CompDTO
16 @State contentDTO: ContentDTO = {} as ContentDTO; 18 @State contentDTO: ContentDTO = {} as ContentDTO;
  19 + @State loadImg: boolean = false;
  20 +
  21 + async aboutToAppear(): Promise<void> {
  22 + this.loadImg = await onlyWifiLoadImg();
  23 + }
  24 +
17 25
18 build() { 26 build() {
19 Column({ space: 8 }) { 27 Column({ space: 8 }) {
@@ -29,8 +37,8 @@ export struct Card17Component { @@ -29,8 +37,8 @@ export struct Card17Component {
29 // 三个图, 37 // 三个图,
30 GridRow({ gutter: 2 }) { 38 GridRow({ gutter: 2 }) {
31 GridCol({ span: { xs: 8 } }) { 39 GridCol({ span: { xs: 8 } }) {
32 - Image(this.contentDTO.fullColumnImgUrls.length > 0 ?this.contentDTO.fullColumnImgUrls[0].url:'')  
33 - .backgroundColor('#f5f5f5') 40 + Image(this.loadImg ? this.contentDTO.fullColumnImgUrls.length > 0 ?this.contentDTO.fullColumnImgUrls[0].url:'' : '')
  41 + .backgroundColor(this.loadImg ? '#f5f5f5' : 0xf5f5f5)
34 .width(CommonConstants.FULL_WIDTH) 42 .width(CommonConstants.FULL_WIDTH)
35 .aspectRatio(16 / 9) 43 .aspectRatio(16 / 9)
36 .borderRadius({ 44 .borderRadius({
@@ -40,8 +48,8 @@ export struct Card17Component { @@ -40,8 +48,8 @@ export struct Card17Component {
40 } 48 }
41 49
42 GridCol({ span: { xs: 4 } }) { 50 GridCol({ span: { xs: 4 } }) {
43 - Image(this.contentDTO.fullColumnImgUrls.length > 1? this.contentDTO.fullColumnImgUrls[1].url:'')  
44 - .backgroundColor('#f5f5f5') 51 + Image(this.loadImg ? this.contentDTO.fullColumnImgUrls.length > 1? this.contentDTO.fullColumnImgUrls[1].url:'' : '')
  52 + .backgroundColor(this.loadImg ? '#f5f5f5' : 0xf5f5f5)
45 .width(CommonConstants.FULL_WIDTH) 53 .width(CommonConstants.FULL_WIDTH)
46 .aspectRatio(16 / 9) 54 .aspectRatio(16 / 9)
47 .margin({ bottom: 1 }) 55 .margin({ bottom: 1 })
@@ -56,8 +64,8 @@ export struct Card17Component { @@ -56,8 +64,8 @@ export struct Card17Component {
56 } 64 }
57 65
58 GridCol({ span: { xs: 4 } }) { 66 GridCol({ span: { xs: 4 } }) {
59 - Image(this.contentDTO.fullColumnImgUrls.length > 2? this.contentDTO.fullColumnImgUrls[2].url:'')  
60 - .backgroundColor('#f5f5f5') 67 + Image(this.loadImg ? this.contentDTO.fullColumnImgUrls.length > 2? this.contentDTO.fullColumnImgUrls[2].url:'' : '')
  68 + .backgroundColor(this.loadImg ? '#f5f5f5' : 0xf5f5f5)
61 .width(CommonConstants.FULL_WIDTH) 69 .width(CommonConstants.FULL_WIDTH)
62 .aspectRatio(16 / 9) 70 .aspectRatio(16 / 9)
63 .margin({ top: 1 }) 71 .margin({ top: 1 })
@@ -2,6 +2,8 @@ import { ContentDTO, FullColumnImgUrlDTO, PhotoListBean } from 'wdBean'; @@ -2,6 +2,8 @@ import { ContentDTO, FullColumnImgUrlDTO, PhotoListBean } from 'wdBean';
2 import { RmhTitle } from '../cardCommon/RmhTitle' 2 import { RmhTitle } from '../cardCommon/RmhTitle'
3 import { ProcessUtils } from 'wdRouter'; 3 import { ProcessUtils } from 'wdRouter';
4 import { CommonConstants } from 'wdConstant/Index'; 4 import { CommonConstants } from 'wdConstant/Index';
  5 +import {CarderInteraction} from '../CarderInteraction'
  6 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
5 7
6 const TAG = 'Card19Component'; 8 const TAG = 'Card19Component';
7 9
@@ -11,69 +13,8 @@ const TAG = 'Card19Component'; @@ -11,69 +13,8 @@ const TAG = 'Card19Component';
11 @Component 13 @Component
12 export struct Card19Component { 14 export struct Card19Component {
13 @State contentDTO: ContentDTO = { 15 @State contentDTO: ContentDTO = {
14 - // appStyle: '19',  
15 - // coverUrl: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994160362418176.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg',  
16 - // fullColumnImgUrls: [  
17 - // {  
18 - // fullUrl: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994155727712256.png?x-oss-process=image/quality,q_90/auto-orient,1',  
19 - // height: 1500,  
20 - // landscape: 1,  
21 - // size: 1,  
22 - // url: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994160362418176.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg',  
23 - // weight: 2000  
24 - // },  
25 - // {  
26 - // fullUrl: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994155727712256.png?x-oss-process=image/quality,q_90/auto-orient,1',  
27 - // height: 1500,  
28 - // landscape: 1,  
29 - // size: 1,  
30 - // url: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994155727712256.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg',  
31 - // weight: 2000  
32 - // },  
33 - // {  
34 - // fullUrl: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994132109586432.png?x-oss-process=image/quality,q_90/auto-orient,1',  
35 - // height: 1280,  
36 - // landscape: 1,  
37 - // size: 1,  
38 - // url: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994132109586432.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg',  
39 - // weight: 1707  
40 - // },  
41 - // {  
42 - // fullUrl: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994132109586432.png?x-oss-process=image/quality,q_90/auto-orient,1',  
43 - // height: 1280,  
44 - // landscape: 1,  
45 - // size: 1,  
46 - // url: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994132109586432.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg',  
47 - // weight: 1707  
48 - // }  
49 - // ],  
50 - // newsSummary: '#平安建设双提升#【进工地,送安全】3月21日下午,@合肥交警 包河大队走进辖区建筑工地为驾驶员、安全员们开展春季交通安全主题宣传活动。活动中,交警结合涉工程运输车、渣土车交通事故案例,详细讲解行驶注意事项,并普及了“一盔一带”“右转必停”等安全常识,要求驾驶员牢固树立交通安全意识,自觉遵守交通法律法规,确保出行安全。',  
51 - // newsTitle: '#平安建设双提升#【进工地,送安全】3月21日下午,@合肥交警 包河大队走进辖区建筑工地为驾驶员、安全员们开展春季交通安全主题宣传活动。活动中,交警结合涉工程运输车、渣土车交通事故案例,详细讲解行驶注意事项,并普及了“一盔一带”“右转必停”等安全常识,要求驾驶员牢固树立交通安全意识,自觉遵守交通法律法规,确保出行安全。',  
52 - // publishTime: '1711185754000',  
53 - // relType: '1',  
54 - // rmhInfo: {  
55 - // authIcon: '',  
56 - // authTitle: '',  
57 - // authTitle2: '',  
58 - // banControl: 0,  
59 - // cnIsAttention: 1,  
60 - // cnIsComment: 1,  
61 - // cnIsLike: 1,  
62 - // cnMainControl: 1,  
63 - // cnShareControl: 1,  
64 - // posterShareControl: 1,  
65 - // rmhDesc: '合肥市公安局官方人民号',  
66 - // rmhHeadUrl: 'https://uatjdcdnphoto.aikan.pdnews.cn/vod/content/202302/202302Sa121448724/TUw.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg',  
67 - // rmhId: '4255290',  
68 - // rmhName: '合肥警方',  
69 - // userId: '513697181730757',  
70 - // userType: '2'  
71 - // }  
72 } as ContentDTO 16 } as ContentDTO
73 17
74 - aboutToAppear(): void {  
75 - }  
76 -  
77 build() { 18 build() {
78 Column() { 19 Column() {
79 // rmh信息 20 // rmh信息
@@ -104,6 +45,7 @@ export struct Card19Component { @@ -104,6 +45,7 @@ export struct Card19Component {
104 }) 45 })
105 ProcessUtils.gotoMultiPictureListPage(photoList,0) 46 ProcessUtils.gotoMultiPictureListPage(photoList,0)
106 }) 47 })
  48 + CarderInteraction()
107 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 49 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
108 } 50 }
109 .padding({ 51 .padding({
@@ -130,13 +72,17 @@ struct createImg { @@ -130,13 +72,17 @@ struct createImg {
130 @Prop fullColumnImgUrls: FullColumnImgUrlDTO[] 72 @Prop fullColumnImgUrls: FullColumnImgUrlDTO[]
131 @State picWidth: number = 0; 73 @State picWidth: number = 0;
132 @State picHeight: number = 0; 74 @State picHeight: number = 0;
133 - aboutToAppear(): void { 75 + @State loadImg: boolean = false;
  76 +
  77 + async aboutToAppear(): Promise<void> {
  78 + this.loadImg = await onlyWifiLoadImg();
134 if(this.fullColumnImgUrls.length === 4) { // 为了使用栅格布局以便于占用三分之二的宽度,加一个占位 79 if(this.fullColumnImgUrls.length === 4) { // 为了使用栅格布局以便于占用三分之二的宽度,加一个占位
135 this.fullColumnImgUrls.splice(2,0, { 80 this.fullColumnImgUrls.splice(2,0, {
136 fullUrl: '' 81 fullUrl: ''
137 } as FullColumnImgUrlDTO) 82 } as FullColumnImgUrlDTO)
138 } 83 }
139 } 84 }
  85 +
140 caclImageRadius(index: number) { 86 caclImageRadius(index: number) {
141 let radius: radiusType = { 87 let radius: radiusType = {
142 topLeft: index === 0 ? $r('app.float.image_border_radius') : 0, 88 topLeft: index === 0 ? $r('app.float.image_border_radius') : 0,
@@ -189,13 +135,14 @@ struct createImg { @@ -189,13 +135,14 @@ struct createImg {
189 alignContent: Alignment.BottomEnd 135 alignContent: Alignment.BottomEnd
190 }) { 136 }) {
191 if (this.getPicType() === 1) { 137 if (this.getPicType() === 1) {
192 - Image(item.fullUrl) 138 + Image(this.loadImg ? item.fullUrl : '')
  139 + .backgroundColor(0xf5f5f5)
193 .width('100%') 140 .width('100%')
194 // .height(172) 141 // .height(172)
195 .autoResize(true) 142 .autoResize(true)
196 .borderRadius(this.caclImageRadius(index)) 143 .borderRadius(this.caclImageRadius(index))
197 } else if (this.getPicType() === 2) { 144 } else if (this.getPicType() === 2) {
198 - Image(item.fullUrl) 145 + Image(this.loadImg ? item.fullUrl : '')
199 // .width('100%') 146 // .width('100%')
200 .height(305) 147 .height(305)
201 .autoResize(true) 148 .autoResize(true)
@@ -221,7 +168,8 @@ struct createImg { @@ -221,7 +168,8 @@ struct createImg {
221 GridCol({ 168 GridCol({
222 span: { xs: 8 } 169 span: { xs: 8 }
223 }) { 170 }) {
224 - Image(item.fullUrl) 171 + Image(this.loadImg ? item.fullUrl : '')
  172 + .backgroundColor(0xf5f5f5)
225 .width('100%') 173 .width('100%')
226 .borderRadius(this.caclImageRadius(index)) 174 .borderRadius(this.caclImageRadius(index))
227 .autoResize(true) 175 .autoResize(true)
@@ -236,7 +184,8 @@ struct createImg { @@ -236,7 +184,8 @@ struct createImg {
236 GridCol({ 184 GridCol({
237 span: { xs: 4 } 185 span: { xs: 4 }
238 }) { 186 }) {
239 - Image(item.fullUrl) 187 + Image(this.loadImg ? item.fullUrl : '')
  188 + .backgroundColor(0xf5f5f5)
240 .aspectRatio(1) 189 .aspectRatio(1)
241 .borderRadius(this.caclImageRadius(index)) 190 .borderRadius(this.caclImageRadius(index))
242 } 191 }
@@ -244,7 +193,8 @@ struct createImg { @@ -244,7 +193,8 @@ struct createImg {
244 GridCol({ 193 GridCol({
245 span: { sm: 4, lg: 3 } 194 span: { sm: 4, lg: 3 }
246 }) { 195 }) {
247 - Image(item.fullUrl) 196 + Image(this.loadImg ? item.fullUrl : '')
  197 + .backgroundColor(0xf5f5f5)
248 .aspectRatio(1) 198 .aspectRatio(1)
249 .borderRadius(this.caclImageRadius(index)) 199 .borderRadius(this.caclImageRadius(index))
250 } 200 }
@@ -3,6 +3,9 @@ import { RmhTitle } from '../cardCommon/RmhTitle' @@ -3,6 +3,9 @@ import { RmhTitle } from '../cardCommon/RmhTitle'
3 import { CardMediaInfo } from '../cardCommon/CardMediaInfo' 3 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
4 import { CommonConstants } from 'wdConstant/Index'; 4 import { CommonConstants } from 'wdConstant/Index';
5 import { ProcessUtils } from 'wdRouter'; 5 import { ProcessUtils } from 'wdRouter';
  6 +import {CarderInteraction} from '../CarderInteraction'
  7 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
  8 +
6 const TAG = 'Card20Component'; 9 const TAG = 'Card20Component';
7 10
8 /** 11 /**
@@ -11,37 +14,6 @@ const TAG = 'Card20Component'; @@ -11,37 +14,6 @@ const TAG = 'Card20Component';
11 @Component 14 @Component
12 export struct Card20Component { 15 export struct Card20Component {
13 @State contentDTO: ContentDTO = { 16 @State contentDTO: ContentDTO = {
14 - // appStyle: '20',  
15 - // coverType: 1,  
16 - // coverUrl: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90',  
17 - // fullColumnImgUrls: [  
18 - // {  
19 - // landscape: 1,  
20 - // size: 1,  
21 - // url: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90',  
22 - // weight: 1600  
23 - // }  
24 - // ],  
25 - // newsTitle: '好玩!》',  
26 - // rmhInfo: {  
27 - // authIcon:  
28 - // 'https://cdnjdphoto.aikan.pdnews.cn/creator-category/icon/auth/yellow.png',  
29 - // authTitle: '10后音乐人王烁然个人人民号',  
30 - // authTitle2: '10后音乐人王烁然个人人民号',  
31 - // banControl: 0,  
32 - // cnIsAttention: 1,  
33 - // rmhDesc: '10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人',  
34 - // rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn/image/creator/rmh/20221031/3d3419e86a.jpeg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg',  
35 - // rmhName: '王烁然',  
36 - // userId: '522435359667845',  
37 - // userType: '2'  
38 - // },  
39 - // objectType: '1',  
40 - // videoInfo: {  
41 - // firstFrameImageUri: '',  
42 - // videoDuration: 37,  
43 - // videoUrl: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/mp4/202105/rmrb_GSNARt6P1622451310.mp4'  
44 - // }  
45 } as ContentDTO; 17 } as ContentDTO;
46 18
47 aboutToAppear(): void { 19 aboutToAppear(): void {
@@ -64,6 +36,7 @@ export struct Card20Component { @@ -64,6 +36,7 @@ export struct Card20Component {
64 if (this.contentDTO.fullColumnImgUrls[0]) { 36 if (this.contentDTO.fullColumnImgUrls[0]) {
65 createImg({ contentDTO: this.contentDTO }) 37 createImg({ contentDTO: this.contentDTO })
66 } 38 }
  39 + CarderInteraction()
67 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 40 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
68 } 41 }
69 .padding({ 42 .padding({
@@ -88,6 +61,12 @@ interface radiusType { @@ -88,6 +61,12 @@ interface radiusType {
88 @Component 61 @Component
89 struct createImg { 62 struct createImg {
90 @Prop contentDTO: ContentDTO 63 @Prop contentDTO: ContentDTO
  64 + @State loadImg: boolean = false;
  65 +
  66 + async aboutToAppear(): Promise<void> {
  67 + this.loadImg = await onlyWifiLoadImg();
  68 + }
  69 +
91 70
92 build() { 71 build() {
93 GridRow() { 72 GridRow() {
@@ -97,7 +76,8 @@ struct createImg { @@ -97,7 +76,8 @@ struct createImg {
97 span: { xs: 12 } 76 span: { xs: 12 }
98 }) { 77 }) {
99 Stack() { 78 Stack() {
100 - Image(this.contentDTO.coverUrl) 79 + Image(this.loadImg ? this.contentDTO.coverUrl : '')
  80 + .backgroundColor(0xf5f5f5)
101 .width(CommonConstants.FULL_WIDTH) 81 .width(CommonConstants.FULL_WIDTH)
102 .aspectRatio(16 / 9) 82 .aspectRatio(16 / 9)
103 .borderRadius($r('app.float.image_border_radius')) 83 .borderRadius($r('app.float.image_border_radius'))
@@ -114,7 +94,8 @@ struct createImg { @@ -114,7 +94,8 @@ struct createImg {
114 span: { xs: 6 } 94 span: { xs: 6 }
115 }) { 95 }) {
116 Stack() { 96 Stack() {
117 - Image(this.contentDTO.coverUrl) 97 + Image(this.loadImg ? this.contentDTO.coverUrl : '')
  98 + .backgroundColor(0xf5f5f5)
118 .width(CommonConstants.FULL_WIDTH) 99 .width(CommonConstants.FULL_WIDTH)
119 .borderRadius($r('app.float.image_border_radius')) 100 .borderRadius($r('app.float.image_border_radius'))
120 CardMediaInfo({ contentDTO: this.contentDTO }) 101 CardMediaInfo({ contentDTO: this.contentDTO })
@@ -3,6 +3,8 @@ import { CommonConstants, CompStyle } from 'wdConstant'; @@ -3,6 +3,8 @@ import { CommonConstants, CompStyle } from 'wdConstant';
3 import { ProcessUtils } from 'wdRouter'; 3 import { ProcessUtils } from 'wdRouter';
4 import { RmhTitle } from '../cardCommon/RmhTitle' 4 import { RmhTitle } from '../cardCommon/RmhTitle'
5 import { CardMediaInfo } from '../cardCommon/CardMediaInfo' 5 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
  6 +import {CarderInteraction} from '../CarderInteraction'
  7 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
6 8
7 const TAG: string = 'Card6Component-Card13Component'; 9 const TAG: string = 'Card6Component-Card13Component';
8 10
@@ -12,6 +14,11 @@ const TAG: string = 'Card6Component-Card13Component'; @@ -12,6 +14,11 @@ const TAG: string = 'Card6Component-Card13Component';
12 @Component 14 @Component
13 export struct Card21Component { 15 export struct Card21Component {
14 @State contentDTO: ContentDTO = {} as ContentDTO; 16 @State contentDTO: ContentDTO = {} as ContentDTO;
  17 + @State loadImg: boolean = false;
  18 +
  19 + async aboutToAppear(): Promise<void> {
  20 + this.loadImg = await onlyWifiLoadImg();
  21 + }
15 22
16 build() { 23 build() {
17 Column() { 24 Column() {
@@ -32,7 +39,8 @@ export struct Card21Component { @@ -32,7 +39,8 @@ export struct Card21Component {
32 39
33 GridItem() { 40 GridItem() {
34 Stack() { 41 Stack() {
35 - Image(this.contentDTO.coverUrl) 42 + Image(this.loadImg ? this.contentDTO.coverUrl : '')
  43 + .backgroundColor(0xf5f5f5)
36 .width(CommonConstants.FULL_WIDTH) 44 .width(CommonConstants.FULL_WIDTH)
37 .borderRadius($r('app.float.image_border_radius')) 45 .borderRadius($r('app.float.image_border_radius'))
38 CardMediaInfo({ contentDTO: this.contentDTO }) 46 CardMediaInfo({ contentDTO: this.contentDTO })
@@ -42,7 +50,7 @@ export struct Card21Component { @@ -42,7 +50,7 @@ export struct Card21Component {
42 } 50 }
43 .columnsTemplate('2fr 1fr') 51 .columnsTemplate('2fr 1fr')
44 .maxCount(1) 52 .maxCount(1)
45 - 53 + CarderInteraction()
46 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 54 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
47 } 55 }
48 .onClick((event: ClickEvent) => { 56 .onClick((event: ClickEvent) => {
@@ -2,8 +2,11 @@ @@ -2,8 +2,11 @@
2 import { ContentDTO } from 'wdBean'; 2 import { ContentDTO } from 'wdBean';
3 import { CommonConstants } from 'wdConstant/Index'; 3 import { CommonConstants } from 'wdConstant/Index';
4 import { ProcessUtils } from 'wdRouter'; 4 import { ProcessUtils } from 'wdRouter';
5 -import { CardMediaInfo } from '../cardCommon/CardMediaInfo'  
6 -import { CardSourceInfo } from '../cardCommon/CardSourceInfo' 5 +import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
  6 +import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
  7 +import { Notes } from './notes';
  8 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
  9 +
7 const TAG: string = 'Card2Component'; 10 const TAG: string = 'Card2Component';
8 11
9 /** 12 /**
@@ -15,38 +18,38 @@ const TAG: string = 'Card2Component'; @@ -15,38 +18,38 @@ const TAG: string = 'Card2Component';
15 */ 18 */
16 @Component 19 @Component
17 export struct Card2Component { 20 export struct Card2Component {
18 - @State contentDTO: ContentDTO = {  
19 - // appStyle: '2',  
20 - // objectType: '1',  
21 - // coverUrl:  
22 - // 'https://rmrbcmsonline.peopleapp.com/upload/image/202404/202404141115457926.png?x-oss-process=image/resize,m_fill,h_450,w_800/quality,q_90',  
23 - // newsTitle: '又见花开!新疆伊犁花海延绵清新怡人',  
24 - // publishTime: '1713067227000',  
25 - // source: '荔枝新闻',  
26 - // videoInfo: {  
27 - // videoDuration: 25,  
28 - // videoLandscape: 1,  
29 - // videoUrl:  
30 - // 'https://rmrbcmsonline.peopleapp.com/upload/video/mp4/202404/1713064515901314d148763996.mp4'  
31 - // }  
32 - } as ContentDTO; 21 + @State contentDTO: ContentDTO = {} as ContentDTO;
  22 + @State loadImg: boolean = false;
  23 +
  24 + async aboutToAppear(): Promise<void> {
  25 + this.loadImg = await onlyWifiLoadImg();
  26 + }
33 27
34 build() { 28 build() {
35 Column() { 29 Column() {
36 Column() { 30 Column() {
37 - //新闻标题  
38 - Text(this.contentDTO.newsTitle)  
39 - .fontSize($r('app.float.font_size_17'))  
40 - .fontColor($r('app.color.color_222222'))  
41 - .maxLines(2)  
42 - .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。  
43 - .align(Alignment.Start) 31 + Stack() {
  32 + //新闻标题
  33 + if (this.contentDTO.objectType == '5') {
  34 + Notes({ objectType: this.contentDTO.objectType })
  35 + }
  36 + Text(this.contentDTO.newsTitle)
  37 + .fontSize($r('app.float.font_size_17'))
  38 + .fontColor($r('app.color.color_222222'))
  39 + .maxLines(2)
  40 + .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
  41 + .align(Alignment.Start)
  42 + .textIndent(this.contentDTO.objectType == '5' ? 40 : 0)
  43 + }
  44 + .alignContent(Alignment.TopStart)
  45 +
44 //大图 46 //大图
45 Stack() { 47 Stack() {
46 - Image(this.contentDTO.coverUrl) 48 + Image(this.loadImg ? this.contentDTO.coverUrl : '')
47 .width(CommonConstants.FULL_WIDTH) 49 .width(CommonConstants.FULL_WIDTH)
48 .aspectRatio(16 / 9) 50 .aspectRatio(16 / 9)
49 .borderRadius($r('app.float.image_border_radius')) 51 .borderRadius($r('app.float.image_border_radius'))
  52 + .backgroundColor(0xf5f5f5)
50 //播放状态+时长 53 //播放状态+时长
51 CardMediaInfo({ 54 CardMediaInfo({
52 contentDTO: this.contentDTO 55 contentDTO: this.contentDTO
@@ -3,6 +3,7 @@ import { CommonConstants } from 'wdConstant/Index'; @@ -3,6 +3,7 @@ import { CommonConstants } from 'wdConstant/Index';
3 import { ProcessUtils } from 'wdRouter'; 3 import { ProcessUtils } from 'wdRouter';
4 import { CardSourceInfo } from '../cardCommon/CardSourceInfo' 4 import { CardSourceInfo } from '../cardCommon/CardSourceInfo'
5 import { CardMediaInfo } from '../cardCommon/CardMediaInfo' 5 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
  6 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
6 const TAG: string = 'Card4Component'; 7 const TAG: string = 'Card4Component';
7 8
8 /** 9 /**
@@ -14,62 +15,12 @@ const TAG: string = 'Card4Component'; @@ -14,62 +15,12 @@ const TAG: string = 'Card4Component';
14 */ 15 */
15 @Component 16 @Component
16 export struct Card4Component { 17 export struct Card4Component {
17 - @State contentDTO: ContentDTO = {  
18 - // appStyle: '4',  
19 - // fullColumnImgUrls: [  
20 - // {  
21 - // format: null,  
22 - // fullUrl: '',  
23 - // height: 187,  
24 - // landscape: 1,  
25 - // size: 1,  
26 - // url: 'https://rmrbcmsonline.peopleapp.com/upload/article_resource/image/1648118198_0c20f7c31c7b4eca6b0d0871e7771c62.png?x-oss-process=image/resize,m_fill,h_160,w_240/quality,q_90',  
27 - // weight: 248  
28 - // },  
29 - // {  
30 - // format: null,  
31 - // fullUrl: '',  
32 - // height: 187,  
33 - // landscape: 1,  
34 - // size: 1,  
35 - // url: 'https://rmrbcmsonline.peopleapp.com/upload/article_resource/image/1648118198_0c20f7c31c7b4eca6b0d0871e7771c62.png?x-oss-process=image/resize,m_fill,h_160,w_240/quality,q_90',  
36 - // weight: 248  
37 - // },  
38 - // {  
39 - // format: null,  
40 - // fullUrl: '',  
41 - // height: 187,  
42 - // landscape: 1,  
43 - // size: 1,  
44 - // url: 'https://rmrbcmsonline.peopleapp.com/upload/article_resource/image/1648118200_d10309bee894a67311e6c8f77df676d4.png?x-oss-process=image/resize,m_fill,h_160,w_240/quality,q_90',  
45 - // weight: 248  
46 - // },  
47 - // {  
48 - // format: null,  
49 - // fullUrl: '',  
50 - // height: 187,  
51 - // landscape: 1,  
52 - // size: 1,  
53 - // url: 'https://rmrbcmsonline.peopleapp.com/upload/article_resource/image/1648118202_f33743e452fb69ee2c45c18a56eccdf6.png?x-oss-process=image/resize,m_fill,h_160,w_240/quality,q_90',  
54 - // weight: 248  
55 - // }  
56 - // ],  
57 - // newsTitle: '科普:如何发现家中是否有白蚁危害?丨又到白蚁分飞季②',  
58 - // rmhInfo: {  
59 - // authIcon:  
60 - // 'https://cdnjdphoto.aikan.pdnews.cn/creator-category/icon/auth/blue.png',  
61 - // authTitle: '封面新闻',  
62 - // rmhDesc: '封面新闻,亿万年轻人的生活方式。',  
63 - // rmhHeadUrl:  
64 - // 'https://cdnjdphoto.aikan.pdnews.cn/image/creator/rmh/20221212/122faff796.jpeg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg',  
65 - // rmhId: '2016608',  
66 - // rmhName: '封面新闻',  
67 - // userId: '522390888224390',  
68 - // userType: '2'  
69 - // },  
70 - // source: '头条号',  
71 - // publishTime: '1651204607000',  
72 - } as ContentDTO; 18 + @State contentDTO: ContentDTO = {} as ContentDTO;
  19 + @State loadImg: boolean = false;
  20 +
  21 + async aboutToAppear(): Promise<void> {
  22 + this.loadImg = await onlyWifiLoadImg();
  23 + }
73 24
74 build() { 25 build() {
75 Column() { 26 Column() {
@@ -88,7 +39,8 @@ export struct Card4Component { @@ -88,7 +39,8 @@ export struct Card4Component {
88 ForEach(this.contentDTO.fullColumnImgUrls, (item: FullColumnImgUrlDTO, index: number) => { 39 ForEach(this.contentDTO.fullColumnImgUrls, (item: FullColumnImgUrlDTO, index: number) => {
89 if (index < 3) { 40 if (index < 3) {
90 GridCol({ span: { xs: 4 } }) { 41 GridCol({ span: { xs: 4 } }) {
91 - Image(item.url) 42 + Image(this.loadImg ? item.url : '')
  43 + .backgroundColor(0xf5f5f5)
92 .width('100%') 44 .width('100%')
93 .aspectRatio(113 / 75) 45 .aspectRatio(113 / 75)
94 .borderRadius({ 46 .borderRadius({
1 import { ContentDTO } from 'wdBean'; 1 import { ContentDTO } from 'wdBean';
2 import { CommonConstants } from 'wdConstant'; 2 import { CommonConstants } from 'wdConstant';
3 import { ProcessUtils } from 'wdRouter'; 3 import { ProcessUtils } from 'wdRouter';
  4 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
4 5
5 const TAG: string = 'Card5Component'; 6 const TAG: string = 'Card5Component';
6 7
@@ -10,21 +11,18 @@ const TAG: string = 'Card5Component'; @@ -10,21 +11,18 @@ const TAG: string = 'Card5Component';
10 // @Entry 11 // @Entry
11 @Component 12 @Component
12 export struct Card5Component { 13 export struct Card5Component {
13 - @State contentDTO: ContentDTO = {  
14 - // coverSize: '850*478',  
15 - // coverType: 1,  
16 - // coverUrl:  
17 - // 'https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20240323/image/display/54ce2de0d20842839e96a644c78361b7.jpg?x-oss-process=image/resize,w_550/quality,q_90/format,jpg',  
18 - // linkUrl:  
19 - // 'https://pd-people-uat.pdnews.cn/h/atv/collect/1000000472?hiddenNavigator=1',  
20 - // newsTitle: '今天是周日,天气阴天,明天是周一。',  
21 - // objectType: '6'  
22 - } as ContentDTO; 14 + @State contentDTO: ContentDTO = {} as ContentDTO;
23 @State titleShowPolicy: number | string = 1 15 @State titleShowPolicy: number | string = 1
  16 + @State loadImg: boolean = false;
  17 +
  18 + async aboutToAppear(): Promise<void> {
  19 + this.loadImg = await onlyWifiLoadImg();
  20 + }
24 21
25 build() { 22 build() {
26 Stack() { 23 Stack() {
27 - Image(this.contentDTO.coverUrl) 24 + Image(this.loadImg ? this.contentDTO.coverUrl : '')
  25 + .backgroundColor(0xf5f5f5)
28 .width(CommonConstants.FULL_WIDTH) 26 .width(CommonConstants.FULL_WIDTH)
29 .autoResize(true) 27 .autoResize(true)
30 .borderRadius($r('app.float.image_border_radius')) 28 .borderRadius($r('app.float.image_border_radius'))
1 import { ContentDTO } from 'wdBean'; 1 import { ContentDTO } from 'wdBean';
2 import { CommonConstants, CompStyle } from 'wdConstant'; 2 import { CommonConstants, CompStyle } from 'wdConstant';
3 import { ProcessUtils } from 'wdRouter'; 3 import { ProcessUtils } from 'wdRouter';
4 -import { CardSourceInfo } from '../cardCommon/CardSourceInfo'  
5 -import { CardMediaInfo } from '../cardCommon/CardMediaInfo' 4 +import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
  5 +import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
  6 +import { Notes } from './notes';
  7 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
  8 +
6 const TAG: string = 'Card6Component-Card13Component'; 9 const TAG: string = 'Card6Component-Card13Component';
7 10
8 /** 11 /**
@@ -11,6 +14,11 @@ const TAG: string = 'Card6Component-Card13Component'; @@ -11,6 +14,11 @@ const TAG: string = 'Card6Component-Card13Component';
11 @Component 14 @Component
12 export struct Card6Component { 15 export struct Card6Component {
13 @State contentDTO: ContentDTO = {} as ContentDTO; 16 @State contentDTO: ContentDTO = {} as ContentDTO;
  17 + @State loadImg: boolean = false;
  18 +
  19 + async aboutToAppear(): Promise<void> {
  20 + this.loadImg = await onlyWifiLoadImg();
  21 + }
14 22
15 build() { 23 build() {
16 Row() { 24 Row() {
@@ -26,12 +34,21 @@ export struct Card6Component { @@ -26,12 +34,21 @@ export struct Card6Component {
26 // .padding(2) 34 // .padding(2)
27 // .margin({ right: 2 }) 35 // .margin({ right: 2 })
28 // } 36 // }
29 - Text(`${this.contentDTO.newsTitle}`)  
30 - .fontSize(16)  
31 - .fontWeight(FontWeight.Normal)  
32 - .maxLines(3)//  
33 - .alignSelf(ItemAlign.Start)  
34 - .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 37 + Stack() {
  38 + if (this.contentDTO.newTags) {
  39 + Notes({ newTags: this.contentDTO.newTags })
  40 + }
  41 +
  42 + Text(`${this.contentDTO.newsTitle}`)
  43 + .fontSize(16)
  44 + .fontWeight(FontWeight.Normal)
  45 + .maxLines(3)
  46 + .alignSelf(ItemAlign.Start)
  47 + .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
  48 + .textIndent(this.contentDTO.newTags.length < 5 && this.contentDTO.newTags.length > 2 ? 60 :
  49 + this.contentDTO.newTags.length != 0 && this.contentDTO.newTags.length < 3 ? 30 : 0)
  50 + }.alignContent(Alignment.TopStart)
  51 +
35 }.height("80%") 52 }.height("80%")
36 .justifyContent(FlexAlign.Start) 53 .justifyContent(FlexAlign.Start)
37 54
@@ -42,9 +59,10 @@ export struct Card6Component { @@ -42,9 +59,10 @@ export struct Card6Component {
42 .alignItems(HorizontalAlign.Start) 59 .alignItems(HorizontalAlign.Start)
43 .justifyContent(FlexAlign.Start) 60 .justifyContent(FlexAlign.Start)
44 .width('58%') 61 .width('58%')
  62 +
45 Stack() { 63 Stack() {
46 - Image(this.contentDTO.coverUrl)  
47 - .backgroundColor($r('app.color.color_B0B0B0')) 64 + Image(this.loadImg ? this.contentDTO.coverUrl : '')
  65 + .backgroundColor( this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
48 .borderRadius(5) 66 .borderRadius(5)
49 .aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4) 67 .aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4)
50 .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 90 : 180) 68 .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 90 : 180)
@@ -2,6 +2,8 @@ import { ContentDTO, slideShows } from 'wdBean'; @@ -2,6 +2,8 @@ import { ContentDTO, slideShows } from 'wdBean';
2 import { CommonConstants } from 'wdConstant'; 2 import { CommonConstants } from 'wdConstant';
3 import { DateTimeUtils } from 'wdKit'; 3 import { DateTimeUtils } from 'wdKit';
4 import { ProcessUtils } from 'wdRouter'; 4 import { ProcessUtils } from 'wdRouter';
  5 +import { Notes } from './notes';
  6 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
5 7
6 /** 8 /**
7 * 时间链卡--CompStyle: 09 9 * 时间链卡--CompStyle: 09
@@ -11,6 +13,11 @@ const TAG: string = 'Card9Component'; @@ -11,6 +13,11 @@ const TAG: string = 'Card9Component';
11 @Component 13 @Component
12 export struct Card9Component { 14 export struct Card9Component {
13 @State contentDTO: ContentDTO = {} as ContentDTO; 15 @State contentDTO: ContentDTO = {} as ContentDTO;
  16 + @State loadImg: boolean = false;
  17 +
  18 + async aboutToAppear(): Promise<void> {
  19 + this.loadImg = await onlyWifiLoadImg();
  20 + }
14 21
15 build() { 22 build() {
16 Column() { 23 Column() {
@@ -26,18 +33,15 @@ export struct Card9Component { @@ -26,18 +33,15 @@ export struct Card9Component {
26 } 33 }
27 // 大图 34 // 大图
28 Stack() { 35 Stack() {
29 - Image(this.contentDTO.coverUrl) 36 + Image(this.loadImg ? this.contentDTO.coverUrl : '')
  37 + .backgroundColor(0xf5f5f5)
30 .width('100%') 38 .width('100%')
31 .borderRadius({ 39 .borderRadius({
32 topLeft: $r('app.float.image_border_radius'), 40 topLeft: $r('app.float.image_border_radius'),
33 topRight: $r('app.float.image_border_radius') 41 topRight: $r('app.float.image_border_radius')
34 }) 42 })
35 - Text('专题')  
36 - .fontSize($r('app.float.font_size_12'))  
37 - .padding({ left: 8, right: 8, top: 3, bottom: 3 })  
38 - .backgroundColor(Color.Red)  
39 - .fontColor(Color.White)  
40 - .borderRadius($r('app.float.button_border_radius')) 43 +
  44 + Notes({ objectType: 5 })
41 .margin({ left: 5, bottom: 5 }) 45 .margin({ left: 5, bottom: 5 })
42 }.alignContent(Alignment.BottomStart) 46 }.alignContent(Alignment.BottomStart)
43 47
@@ -130,7 +134,8 @@ export struct Card9Component { @@ -130,7 +134,8 @@ export struct Card9Component {
130 .alignSelf(ItemAlign.Center) 134 .alignSelf(ItemAlign.Center)
131 .margin({ left: 12 }) 135 .margin({ left: 12 })
132 if (item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) { 136 if (item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) {
133 - Image(item.fullColumnImgUrls[0].url) 137 + Image(this.loadImg? item.fullColumnImgUrls[0].url : '')
  138 + .backgroundColor(0xf5f5f5)
134 .width(90) 139 .width(90)
135 .height(60) 140 .height(60)
136 .borderRadius($r('app.float.image_border_radius')) 141 .borderRadius($r('app.float.image_border_radius'))
  1 +/**
  2 + * 表示
  3 + * objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,
  4 + 14动态图文,15动态视频16问政;100人民号,101标签
  5 + */
  6 +
  7 +@Preview
  8 +@Component
  9 +export struct Notes {
  10 + @State objectType: number | string = 5
  11 + @State newTags: string = ''
  12 +
  13 + build() {
  14 + if (this.returnTypeTitleFn()) {
  15 + Text(this.returnTypeTitleFn())
  16 + .fontSize($r('app.float.font_size_12'))
  17 + .padding({
  18 + left: 5,
  19 + right: 5,
  20 + top: 3,
  21 + bottom: 3
  22 + })
  23 + .linearGradient({ angle: 90, colors: [['#FFFF2B00', 0.0], ['#FFFE6A00', 1.0]] })
  24 + .fontColor(Color.White)
  25 + .borderRadius($r('app.float.button_border_radius'))
  26 + }
  27 + }
  28 +
  29 + returnTypeTitleFn(): string {
  30 + if (this.newTags) {
  31 + return this.newTags
  32 + } else {
  33 + if (this.objectType == 5) {
  34 + return '专题'
  35 + } else if (this.objectType == 10) {
  36 + return 'H5'
  37 + } else if (this.objectType == 8) {
  38 + return '文章'
  39 + }
  40 + }
  41 +
  42 + return ''
  43 + }
  44 +}
@@ -4,7 +4,8 @@ import { BreakPointType, Logger } from 'wdKit'; @@ -4,7 +4,8 @@ import { BreakPointType, Logger } from 'wdKit';
4 import { CompUtils } from '../../utils/CompUtils'; 4 import { CompUtils } from '../../utils/CompUtils';
5 import { ProcessUtils } from 'wdRouter'; 5 import { ProcessUtils } from 'wdRouter';
6 import { EmptyComponent } from '../view/EmptyComponent'; 6 import { EmptyComponent } from '../view/EmptyComponent';
7 -import { CardMediaInfo } from '../cardCommon/CardMediaInfo' 7 +import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
  8 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
8 9
9 const TAG = 'Zh_Carousel_Layout-01'; 10 const TAG = 'Zh_Carousel_Layout-01';
10 11
@@ -163,13 +164,19 @@ export struct ZhCarouselLayout01 { @@ -163,13 +164,19 @@ export struct ZhCarouselLayout01 {
163 struct CarouselLayout01CardView { 164 struct CarouselLayout01CardView {
164 private item: ContentDTO = {} as ContentDTO; 165 private item: ContentDTO = {} as ContentDTO;
165 private length: number = 1; // 轮播图数量 166 private length: number = 1; // 轮播图数量
  167 + @State loadImg: boolean = false;
  168 +
  169 + async aboutToAppear(): Promise<void> {
  170 + this.loadImg = await onlyWifiLoadImg();
  171 + }
166 172
167 build() { 173 build() {
168 Stack() { 174 Stack() {
169 - Image(this.item.coverUrl) 175 + Image(this.loadImg ? this.item.coverUrl : '')
170 .width(CommonConstants.FULL_PARENT) 176 .width(CommonConstants.FULL_PARENT)
171 .height(CommonConstants.FULL_PARENT) 177 .height(CommonConstants.FULL_PARENT)
172 .objectFit(ImageFit.Cover) 178 .objectFit(ImageFit.Cover)
  179 + .backgroundColor(0xf5f5f5)
173 180
174 Row() 181 Row()
175 .width(CommonConstants.FULL_PARENT) 182 .width(CommonConstants.FULL_PARENT)
@@ -3,6 +3,7 @@ import { CommonConstants } from 'wdConstant/Index'; @@ -3,6 +3,7 @@ import { CommonConstants } from 'wdConstant/Index';
3 import { Logger } from 'wdKit/Index'; 3 import { Logger } from 'wdKit/Index';
4 import { ProcessUtils } from 'wdRouter'; 4 import { ProcessUtils } from 'wdRouter';
5 import PageViewModel from '../../viewmodel/PageViewModel'; 5 import PageViewModel from '../../viewmodel/PageViewModel';
  6 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
6 7
7 const TAG = 'Zh_Grid_Layout-02'; 8 const TAG = 'Zh_Grid_Layout-02';
8 const FULL_PARENT: string = '100%'; 9 const FULL_PARENT: string = '100%';
@@ -18,18 +19,22 @@ let listSize: number = 2; @@ -18,18 +19,22 @@ let listSize: number = 2;
18 export struct ZhGridLayout02 { 19 export struct ZhGridLayout02 {
19 @State compDTO: CompDTO = {} as CompDTO 20 @State compDTO: CompDTO = {} as CompDTO
20 @State operDataList: ContentDTO[] = [] 21 @State operDataList: ContentDTO[] = []
21 - currentPage = 1  
22 - pageSize = 12 22 + @State loadImg: boolean = false;
23 23
24 - aboutToAppear() { 24 + async aboutToAppear(): Promise<void> {
25 Logger.debug(TAG, 'aboutToAppear ' + this.compDTO.objectTitle) 25 Logger.debug(TAG, 'aboutToAppear ' + this.compDTO.objectTitle)
26 this.currentPage = 1 26 this.currentPage = 1
27 PageViewModel.getLiveReviewUrl(this.currentPage, this.pageSize).then((liveReviewDTO) => { 27 PageViewModel.getLiveReviewUrl(this.currentPage, this.pageSize).then((liveReviewDTO) => {
28 this.operDataList = [] 28 this.operDataList = []
29 this.operDataList.push(...liveReviewDTO.list) 29 this.operDataList.push(...liveReviewDTO.list)
30 }) 30 })
  31 +
  32 + this.loadImg = await onlyWifiLoadImg();
31 } 33 }
32 34
  35 + currentPage = 1
  36 + pageSize = 12
  37 +
33 build() { 38 build() {
34 Column() { 39 Column() {
35 Scroll() { 40 Scroll() {
@@ -96,7 +101,8 @@ export struct ZhGridLayout02 { @@ -96,7 +101,8 @@ export struct ZhGridLayout02 {
96 @Builder 101 @Builder
97 buildItemCard(item: ContentDTO) { 102 buildItemCard(item: ContentDTO) {
98 Column() { 103 Column() {
99 - Image(item.fullColumnImgUrls[0].url) 104 + Image(this.loadImg ? item.fullColumnImgUrls[0].url : '')
  105 + .backgroundColor(0xf5f5f5)
100 .width('100%') 106 .width('100%')
101 .height(95) 107 .height(95)
102 .borderRadius(4) 108 .borderRadius(4)
@@ -3,6 +3,7 @@ import { CompStyle } from 'wdConstant'; @@ -3,6 +3,7 @@ import { CompStyle } from 'wdConstant';
3 import { Logger } from 'wdKit'; 3 import { Logger } from 'wdKit';
4 import { WDRouterRule } from 'wdRouter'; 4 import { WDRouterRule } from 'wdRouter';
5 import { ProcessUtils } from 'wdRouter'; 5 import { ProcessUtils } from 'wdRouter';
  6 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
6 7
7 const TAG = 'Zh_Grid_Layout-03'; 8 const TAG = 'Zh_Grid_Layout-03';
8 const FULL_PARENT: string = '100%'; 9 const FULL_PARENT: string = '100%';
@@ -18,11 +19,13 @@ let listSize: number = 4; @@ -18,11 +19,13 @@ let listSize: number = 4;
18 @Component 19 @Component
19 export struct ZhGridLayout03 { 20 export struct ZhGridLayout03 {
20 @State compDTO: CompDTO = {} as CompDTO 21 @State compDTO: CompDTO = {} as CompDTO
  22 + @State loadImg: boolean = false;
21 23
22 - aboutToAppear() { 24 + async aboutToAppear(): Promise<void> {
23 if (this.compDTO.operDataList) { 25 if (this.compDTO.operDataList) {
24 listSize = this.compDTO.operDataList.length > 5 ? 4 : this.compDTO.operDataList.length; 26 listSize = this.compDTO.operDataList.length > 5 ? 4 : this.compDTO.operDataList.length;
25 } 27 }
  28 + this.loadImg = await onlyWifiLoadImg();
26 } 29 }
27 30
28 build() { 31 build() {
@@ -52,7 +55,8 @@ export struct ZhGridLayout03 { @@ -52,7 +55,8 @@ export struct ZhGridLayout03 {
52 @Builder 55 @Builder
53 buildItemCard(item: ContentDTO) { 56 buildItemCard(item: ContentDTO) {
54 Column() { 57 Column() {
55 - Image(item.coverUrl) 58 + Image(this.loadImg ? item.coverUrl : '')
  59 + .backgroundColor(0xf5f5f5)
56 .width(44) 60 .width(44)
57 .aspectRatio(1 / 1) 61 .aspectRatio(1 / 1)
58 .margin({ 62 .margin({
@@ -4,7 +4,7 @@ import { HttpUrlUtils } from 'wdNetwork/Index'; @@ -4,7 +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 - 7 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
8 /** 8 /**
9 * 兴趣卡 9 * 兴趣卡
10 * Zh_Single_Column-09 10 * Zh_Single_Column-09
@@ -18,12 +18,13 @@ export struct ZhSingleColumn09 { @@ -18,12 +18,13 @@ export struct ZhSingleColumn09 {
18 @State activeIndexs: Array<number> = [] 18 @State activeIndexs: Array<number> = []
19 @State operDataList: ContentDTO[] = this.compDTO?.operDataList || [] 19 @State operDataList: ContentDTO[] = this.compDTO?.operDataList || []
20 @State selfClosed: Boolean = false; 20 @State selfClosed: Boolean = false;
  21 + @State loadImg: boolean = false;
21 22
22 - aboutToAppear(): void { 23 + async aboutToAppear(): Promise<void> {
  24 + this.loadImg = await onlyWifiLoadImg();
23 this.operDataList = this.shuffleArray(this.compDTO?.operDataList) 25 this.operDataList = this.shuffleArray(this.compDTO?.operDataList)
24 } 26 }
25 27
26 -  
27 getItemWidth(index: number) { 28 getItemWidth(index: number) {
28 if (index % 4 === 0 || index % 4 === 3) { 29 if (index % 4 === 0 || index % 4 === 3) {
29 return 80 30 return 80
@@ -84,7 +85,8 @@ export struct ZhSingleColumn09 { @@ -84,7 +85,8 @@ export struct ZhSingleColumn09 {
84 ForEach(this.operDataList, (item: ContentDTO, index: number) => { 85 ForEach(this.operDataList, (item: ContentDTO, index: number) => {
85 GridItem() { 86 GridItem() {
86 Stack({alignContent: Alignment.TopEnd}) { 87 Stack({alignContent: Alignment.TopEnd}) {
87 - Image(item.coverUrl) 88 + Image(this.loadImg ? item.coverUrl : '')
  89 + .backgroundColor(0xf5f5f5)
88 .width('100%') 90 .width('100%')
89 .height('100%') 91 .height('100%')
90 Text(item.newsTitle) 92 Text(item.newsTitle)
@@ -5,6 +5,7 @@ import { PageRepository } from '../../repository/PageRepository'; @@ -5,6 +5,7 @@ import { PageRepository } from '../../repository/PageRepository';
5 import { CommonConstants } from 'wdConstant/Index'; 5 import { CommonConstants } from 'wdConstant/Index';
6 import { ProcessUtils } from 'wdRouter'; 6 import { ProcessUtils } from 'wdRouter';
7 import { HttpUtils } from 'wdNetwork/Index'; 7 import { HttpUtils } from 'wdNetwork/Index';
  8 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
8 9
9 /** 10 /**
10 * 小视频横划卡 11 * 小视频横划卡
@@ -104,13 +105,21 @@ function textOverflowStyle(maxLine: number) { @@ -104,13 +105,21 @@ function textOverflowStyle(maxLine: number) {
104 struct CreatorItem { 105 struct CreatorItem {
105 @Prop item: ContentDTO 106 @Prop item: ContentDTO
106 @State rmhIsAttention: number = 0 107 @State rmhIsAttention: number = 0
  108 + @State loadImg: boolean = false;
  109 +
  110 + async aboutToAppear(): Promise<void> {
  111 + this.loadImg = await onlyWifiLoadImg();
  112 + }
  113 +
107 build() { 114 build() {
108 ListItem() { 115 ListItem() {
109 Column() { 116 Column() {
110 Stack({ alignContent: Alignment.Bottom }) { 117 Stack({ alignContent: Alignment.Bottom }) {
111 - Image(this.item.coverUrl) 118 + Image(this.loadImg ? this.item.coverUrl : '')
112 .width(156) 119 .width(156)
113 .height(208) 120 .height(208)
  121 + .backgroundColor(0xf5f5f5)
  122 +
114 Row() 123 Row()
115 .width(156) 124 .width(156)
116 .height(80) 125 .height(80)
@@ -7,6 +7,7 @@ import { HttpUtils } from 'wdNetwork/Index'; @@ -7,6 +7,7 @@ import { HttpUtils } from 'wdNetwork/Index';
7 import { DateTimeUtils } from 'wdKit'; 7 import { DateTimeUtils } from 'wdKit';
8 import { LiveModel } from '../../viewmodel/LiveModel' 8 import { LiveModel } from '../../viewmodel/LiveModel'
9 import { Logger, ToastUtils } from 'wdKit'; 9 import { Logger, ToastUtils } from 'wdKit';
  10 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
10 11
11 /** 12 /**
12 * 直播预约卡 13 * 直播预约卡
@@ -32,12 +33,15 @@ export struct ZhSingleRow03 { @@ -32,12 +33,15 @@ export struct ZhSingleRow03 {
32 @State isEndEdge: boolean = false; 33 @State isEndEdge: boolean = false;
33 // @State reserveStatus: reserveItem[] = [] 34 // @State reserveStatus: reserveItem[] = []
34 @State reservedIds: string[] = []; 35 @State reservedIds: string[] = [];
35 - scroller: Scroller = new Scroller() 36 + @State loadImg: boolean = false;
36 37
37 - aboutToAppear(): void { 38 + async aboutToAppear(): Promise<void> {
38 this.getReserveState(); 39 this.getReserveState();
  40 + this.loadImg = await onlyWifiLoadImg();
39 } 41 }
40 42
  43 + scroller: Scroller = new Scroller()
  44 +
41 // 请求所有预约状态 45 // 请求所有预约状态
42 async getReserveState() { 46 async getReserveState() {
43 const reserveBean: reserveReqItem[] = this.compDTO.operDataList.map((item: ContentDTO) => { 47 const reserveBean: reserveReqItem[] = this.compDTO.operDataList.map((item: ContentDTO) => {
@@ -128,10 +132,12 @@ export struct ZhSingleRow03 { @@ -128,10 +132,12 @@ export struct ZhSingleRow03 {
128 ItemCard(item: ContentDTO) { 132 ItemCard(item: ContentDTO) {
129 Column() { 133 Column() {
130 Row() { 134 Row() {
131 - Image(item.coverUrl) 135 + Image(this.loadImg ? item.coverUrl : '')
132 .width(106) 136 .width(106)
133 .height(60) 137 .height(60)
134 .margin({right: 12}) 138 .margin({right: 12})
  139 + .backgroundColor(0xf5f5f5)
  140 +
135 Text(item.newsTitle) 141 Text(item.newsTitle)
136 .width(154) 142 .width(154)
137 .height(60) 143 .height(60)
@@ -256,11 +262,17 @@ function textOverflowStyle(maxLine: number) { @@ -256,11 +262,17 @@ function textOverflowStyle(maxLine: number) {
256 struct CreatorItem { 262 struct CreatorItem {
257 @Prop item: ContentDTO 263 @Prop item: ContentDTO
258 @State rmhIsAttention: number = 0 264 @State rmhIsAttention: number = 0
  265 + @State loadImg: boolean = false;
  266 +
  267 + async aboutToAppear(): Promise<void> {
  268 + this.loadImg = await onlyWifiLoadImg();
  269 + }
259 build() { 270 build() {
260 ListItem() { 271 ListItem() {
261 Column() { 272 Column() {
262 Stack({ alignContent: Alignment.Bottom }) { 273 Stack({ alignContent: Alignment.Bottom }) {
263 - Image(this.item.coverUrl) 274 + Image(this.loadImg ? this.item.coverUrl : '')
  275 + .backgroundColor(0xf5f5f5)
264 .width(156) 276 .width(156)
265 .height(208) 277 .height(208)
266 Row() 278 Row()
@@ -35,7 +35,7 @@ export struct FollowThirdTabsComponent{ @@ -35,7 +35,7 @@ export struct FollowThirdTabsComponent{
35 35
36 Text(item.directoryName) 36 Text(item.directoryName)
37 .fontSize('27lpx') 37 .fontSize('27lpx')
38 - .fontWeight(this.currentIndex === index ? "600lpx" : "400lpx") 38 + .fontWeight(this.currentIndex === index ? 600 : 400)
39 .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) 39 .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
40 .lineHeight('35lpx') 40 .lineHeight('35lpx')
41 .backgroundImage($r('app.media.ic_collect_mid')) 41 .backgroundImage($r('app.media.ic_collect_mid'))
@@ -517,7 +517,7 @@ export struct PaperSingleColumn999CardView { @@ -517,7 +517,7 @@ export struct PaperSingleColumn999CardView {
517 } 517 }
518 } 518 }
519 .backgroundColor(Color.White) 519 .backgroundColor(Color.White)
520 - .margin({ bottom: 5, left: 12, right: 12 }) 520 + .margin({ bottom: 14, left: 12, right: 12 })
521 .borderRadius(4) 521 .borderRadius(4)
522 .onClick(() => { 522 .onClick(() => {
523 ProcessUtils.processPage(this.item) 523 ProcessUtils.processPage(this.item)
@@ -8,10 +8,18 @@ import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' @@ -8,10 +8,18 @@ import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'
8 import { LiveModel } from '../../viewmodel/LiveModel' 8 import { LiveModel } from '../../viewmodel/LiveModel'
9 import { ContentConstants } from '../../constants/ContentConstants' 9 import { ContentConstants } from '../../constants/ContentConstants'
10 import { ProcessUtils } from 'wdRouter'; 10 import { ProcessUtils } from 'wdRouter';
  11 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
  12 +
11 13
12 @Component 14 @Component
13 export struct LiveHorizontalCardComponent { 15 export struct LiveHorizontalCardComponent {
14 @State compDTO: CompDTO = {} as CompDTO 16 @State compDTO: CompDTO = {} as CompDTO
  17 + @State loadImg: boolean = false;
  18 +
  19 + async aboutToAppear(): Promise<void> {
  20 + this.loadImg = await onlyWifiLoadImg();
  21 + }
  22 +
15 23
16 build() { 24 build() {
17 Column() { 25 Column() {
@@ -63,7 +71,8 @@ export struct LiveHorizontalCardComponent { @@ -63,7 +71,8 @@ export struct LiveHorizontalCardComponent {
63 ListItem() { 71 ListItem() {
64 Column() { 72 Column() {
65 Stack({ alignContent: Alignment.BottomEnd }) { 73 Stack({ alignContent: Alignment.BottomEnd }) {
66 - Image(item.coverUrl) 74 + Image(this.loadImg ? item.coverUrl : '')
  75 + .backgroundColor(0xf5f5f5)
67 .aspectRatio(16 / 9) 76 .aspectRatio(16 / 9)
68 .width(this.compDTO.operDataList.length == 2 ? 210 : 150) 77 .width(this.compDTO.operDataList.length == 2 ? 210 : 150)
69 .borderRadius(4) 78 .borderRadius(4)
  1 +import { NetworkUtil, SPHelper } from 'wdKit';
  2 +import { SpConstants } from 'wdConstant';
  3 +
  4 +async function onlyWifiLoadImg() : Promise<boolean> {
  5 + let loadImageOnlyWifiSwitch = await SPHelper.default.get(SpConstants.SETTING_WIFI_IMAGE_SWITCH, '') || false;
  6 + let isNetConnected = NetworkUtil.isNetConnected();
  7 + let netWorkStatus = NetworkUtil.getNetworkType();
  8 +
  9 + if (isNetConnected) {
  10 + if (netWorkStatus === NetworkUtil.TYPE_WIFI) {
  11 + return true;
  12 + } else {
  13 + if (loadImageOnlyWifiSwitch) {
  14 + return false
  15 + } else {
  16 + return true;
  17 + }
  18 + }
  19 + } else {
  20 + return false;
  21 + }
  22 +}
  23 +
  24 +export { onlyWifiLoadImg }
@@ -56,6 +56,7 @@ struct ModifyPasswordPage { @@ -56,6 +56,7 @@ struct ModifyPasswordPage {
56 Row() { 56 Row() {
57 Row() { 57 Row() {
58 TextInput({ placeholder: "请输入原密码" }) 58 TextInput({ placeholder: "请输入原密码" })
  59 + .passwordIcon({onIconSrc:$r("app.media.login_password_on"),offIconSrc:$r("app.media.login_password_off")})
59 .placeholderColor("#CCCCCC") 60 .placeholderColor("#CCCCCC")
60 .type(InputType.Password) 61 .type(InputType.Password)
61 .showPasswordIcon(true) 62 .showPasswordIcon(true)
@@ -78,6 +79,7 @@ struct ModifyPasswordPage { @@ -78,6 +79,7 @@ struct ModifyPasswordPage {
78 Row() { 79 Row() {
79 Row() { 80 Row() {
80 TextInput({ placeholder: "请输入新密码" }) 81 TextInput({ placeholder: "请输入新密码" })
  82 + .passwordIcon({onIconSrc:$r("app.media.login_password_on"),offIconSrc:$r("app.media.login_password_off")})
81 .placeholderColor("#CCCCCC") 83 .placeholderColor("#CCCCCC")
82 .type(InputType.Password) 84 .type(InputType.Password)
83 .showPasswordIcon(true) 85 .showPasswordIcon(true)
@@ -99,9 +101,10 @@ struct ModifyPasswordPage { @@ -99,9 +101,10 @@ struct ModifyPasswordPage {
99 101
100 Row() { 102 Row() {
101 Row() { 103 Row() {
102 - TextInput({ placeholder: "请再请输入原密码" }) 104 + TextInput({ placeholder: "再次输入新密码" })
103 .placeholderColor("#CCCCCC") 105 .placeholderColor("#CCCCCC")
104 .type(InputType.Password) 106 .type(InputType.Password)
  107 + .passwordIcon({onIconSrc:$r("app.media.login_password_on"),offIconSrc:$r("app.media.login_password_off")})
105 .showPasswordIcon(true) 108 .showPasswordIcon(true)
106 .backgroundColor('#00000000') 109 .backgroundColor('#00000000')
107 .onChange((value: string) => { 110 .onChange((value: string) => {
@@ -120,18 +123,23 @@ struct ModifyPasswordPage { @@ -120,18 +123,23 @@ struct ModifyPasswordPage {
120 .alignItems(VerticalAlign.Center) 123 .alignItems(VerticalAlign.Center)
121 124
122 Column() { 125 Column() {
123 - Text("提示:密码长度6-20位,需答谢字母、小写字母、数字、特殊字符中组合三种及三种以上组成").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:'10lpx'}) 126 + Text("提示:密码长度6~20,需大写字母、小写字母、数字、特殊符合中组合三种及三种以上").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:'10lpx'})
124 } 127 }
125 .width('100%') 128 .width('100%')
126 .height('85lpx') 129 .height('85lpx')
127 .alignItems(HorizontalAlign.Start) 130 .alignItems(HorizontalAlign.Start)
128 131
129 Row() { 132 Row() {
130 - Button("确认", { type: ButtonType.Normal, stateEffect: true }) 133 + Button( { type: ButtonType.Normal, stateEffect: true }){
  134 + Text("确认")
  135 + .fontColor("#fff")
  136 + .fontSize("35lpx")
  137 + .lineHeight("50lpx")
  138 + .opacity(this.btnStatus ?1:0.5)
  139 + }
131 .width('100%') 140 .width('100%')
132 .height('80lpx') 141 .height('80lpx')
133 - .backgroundColor(this.btnStatus ? '#da3e22' : '#e5856d')  
134 - .fontColor('#fff') 142 + .backgroundColor(this.btnStatus ? '#ED2800' : '#99ED2800')
135 .borderRadius('4vp') 143 .borderRadius('4vp')
136 .onClick(() => { 144 .onClick(() => {
137 if(this.btnStatus){ 145 if(this.btnStatus){
@@ -157,6 +165,7 @@ struct ModifyPasswordPage { @@ -157,6 +165,7 @@ struct ModifyPasswordPage {
157 }.padding({top:"92lpx",left:"48lpx",right:"48lpx"}) 165 }.padding({top:"92lpx",left:"48lpx",right:"48lpx"})
158 166
159 }.titleMode(NavigationTitleMode.Mini) 167 }.titleMode(NavigationTitleMode.Mini)
  168 + .backButtonIcon($r("app.media.login_back_icon"))
160 .title('') 169 .title('')
161 } 170 }
162 171
@@ -192,4 +201,6 @@ struct ModifyPasswordPage { @@ -192,4 +201,6 @@ struct ModifyPasswordPage {
192 this.toastText = msg 201 this.toastText = msg
193 this.dialogToast.open() 202 this.dialogToast.open()
194 } 203 }
195 -}  
  204 +}
  205 +
  206 +
@@ -200,6 +200,7 @@ export struct SettingPasswordLayout { @@ -200,6 +200,7 @@ export struct SettingPasswordLayout {
200 Row() { 200 Row() {
201 TextInput({ placeholder: item.inputPlacholder }) 201 TextInput({ placeholder: item.inputPlacholder })
202 .placeholderColor("#CCCCCC") 202 .placeholderColor("#CCCCCC")
  203 + .passwordIcon({onIconSrc:$r("app.media.login_password_on"),offIconSrc:$r("app.media.login_password_off")})
203 .type(InputType.Password) 204 .type(InputType.Password)
204 .showPasswordIcon(true) 205 .showPasswordIcon(true)
205 .backgroundColor('#00000000') 206 .backgroundColor('#00000000')