yumaochao
Showing 42 changed files with 237 additions and 95 deletions
@@ -34,6 +34,7 @@ @@ -34,6 +34,7 @@
34 { 34 {
35 "name": "default", 35 "name": "default",
36 "signingConfig": "default", 36 "signingConfig": "default",
  37 + "compileSdkVersion": "5.0.0(12)",
37 "compatibleSdkVersion": "5.0.0(12)", 38 "compatibleSdkVersion": "5.0.0(12)",
38 "runtimeOS": "HarmonyOS", 39 "runtimeOS": "HarmonyOS",
39 } 40 }
@@ -93,10 +93,8 @@ export class HttpBizUtil { @@ -93,10 +93,8 @@ export class HttpBizUtil {
93 */ 93 */
94 static refreshToken(): Promise<string> { 94 static refreshToken(): Promise<string> {
95 let url = HttpUrlUtils.getRefreshTokenUrl(); 95 let url = HttpUrlUtils.getRefreshTokenUrl();
96 - let params: HashMap<string, string> = new HashMap<string, string>()  
97 - params.set('refreshToken', HttpUtils.getRefreshToken())  
98 - params.set('deviceId', HttpUtils.getDeviceId())  
99 - // Logger.debug(TAG, 'refreshToken getRefreshToken: ' + HttpUrlUtils.getRefreshToken()) 96 + let params: RefreshTokenParam =
  97 + new RefreshTokenParam(HttpUtils.getRefreshToken(), HttpUtils.getDeviceId())
100 // 请求刷新token接口 98 // 请求刷新token接口
101 return new Promise<string>((success, error) => { 99 return new Promise<string>((success, error) => {
102 WDHttp.post<ResponseDTO<RefreshTokenRes>>(url, params).then((resDTO: ResponseDTO<RefreshTokenRes>) => { 100 WDHttp.post<ResponseDTO<RefreshTokenRes>>(url, params).then((resDTO: ResponseDTO<RefreshTokenRes>) => {
@@ -124,3 +122,13 @@ export class HttpBizUtil { @@ -124,3 +122,13 @@ export class HttpBizUtil {
124 }) 122 })
125 } 123 }
126 } 124 }
  125 +
  126 +export class RefreshTokenParam {
  127 + refreshToken: string = ''
  128 + deviceId: string = ''
  129 +
  130 + constructor(refreshToken: string, deviceId: string) {
  131 + this.refreshToken = refreshToken
  132 + this.deviceId = deviceId
  133 + }
  134 +}
@@ -90,7 +90,7 @@ export struct WdWebComponent { @@ -90,7 +90,7 @@ export struct WdWebComponent {
90 } 90 }
91 onReloadStateChanged() { 91 onReloadStateChanged() {
92 Logger.info(TAG, `onReloadStateChanged:::refresh, this.reload: ${this.reload}`); 92 Logger.info(TAG, `onReloadStateChanged:::refresh, this.reload: ${this.reload}`);
93 - if (this.reload > 0) { 93 + if (this.reload > 0 && this.isPageEnd) {
94 this.webviewControl.refresh() 94 this.webviewControl.refresh()
95 } 95 }
96 } 96 }
@@ -121,15 +121,15 @@ export struct CompParser { @@ -121,15 +121,15 @@ export struct CompParser {
121 CardParser({ contentDTO: this.compDTO.operDataList[0], compDTO: this.compDTO }); 121 CardParser({ contentDTO: this.compDTO.operDataList[0], compDTO: this.compDTO });
122 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) 122 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
123 } else { 123 } else {
124 - Text(this.compDTO.compStyle)  
125 - .width(CommonConstants.FULL_PARENT)  
126 - .padding(10)  
127 - .onClick(() => {  
128 - if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) { //精选评论  
129 - WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage)  
130 - }  
131 - })  
132 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) 124 + // Text(this.compDTO.compStyle)
  125 + // .width(CommonConstants.FULL_PARENT)
  126 + // .padding(10)
  127 + // .onClick(() => {
  128 + // if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) { //精选评论
  129 + // WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage)
  130 + // }
  131 + // })
  132 + // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
133 } 133 }
134 } 134 }
135 135
@@ -5,7 +5,6 @@ import { @@ -5,7 +5,6 @@ import {
5 EmitterUtils, 5 EmitterUtils,
6 EmitterEventId, 6 EmitterEventId,
7 NetworkUtil, 7 NetworkUtil,
8 - DisplayUtils  
9 } from 'wdKit'; 8 } from 'wdKit';
10 import { 9 import {
11 Action, 10 Action,
@@ -33,6 +32,7 @@ import { CommentComponent } from '../components/comment/view/CommentComponent' @@ -33,6 +32,7 @@ import { CommentComponent } from '../components/comment/view/CommentComponent'
33 import { HttpUtils } from 'wdNetwork/Index'; 32 import { HttpUtils } from 'wdNetwork/Index';
34 import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' 33 import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
35 import { common } from '@kit.AbilityKit'; 34 import { common } from '@kit.AbilityKit';
  35 +import { componentUtils, window } from '@kit.ArkUI';
36 36
37 const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; 37 const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
38 38
@@ -58,6 +58,9 @@ export struct ImageAndTextPageComponent { @@ -58,6 +58,9 @@ export struct ImageAndTextPageComponent {
58 @State likeNum: number = 0 58 @State likeNum: number = 0
59 @State reachEndIncreament: number = 0 59 @State reachEndIncreament: number = 0
60 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 60 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
  61 + @State isScrollTop: boolean = true
  62 + @State offsetY: number = 0
  63 +
61 build() { 64 build() {
62 Stack({ alignContent: Alignment.Top }) { 65 Stack({ alignContent: Alignment.Top }) {
63 Stack({ alignContent: Alignment.Bottom }) { 66 Stack({ alignContent: Alignment.Bottom }) {
@@ -125,9 +128,11 @@ export struct ImageAndTextPageComponent { @@ -125,9 +128,11 @@ export struct ImageAndTextPageComponent {
125 fixedHeightMode: false, 128 fixedHeightMode: false,
126 reachEndIncreament: this.reachEndIncreament, 129 reachEndIncreament: this.reachEndIncreament,
127 reachEndLoadMoreFinish: () => { 130 reachEndLoadMoreFinish: () => {
128 -  
129 } 131 }
130 - }).onAreaChange((oldValue: Area, newValue: Area) => { 132 +
  133 + }).id('comment')
  134 +
  135 + .onAreaChange((oldValue: Area, newValue: Area) => {
131 this.info = newValue 136 this.info = newValue
132 }) 137 })
133 // .onMeasureSize() 138 // .onMeasureSize()
@@ -135,6 +140,7 @@ export struct ImageAndTextPageComponent { @@ -135,6 +140,7 @@ export struct ImageAndTextPageComponent {
135 } 140 }
136 } 141 }
137 } 142 }
  143 + .id('imgTextContainer')
138 } 144 }
139 .width(CommonConstants.FULL_WIDTH) 145 .width(CommonConstants.FULL_WIDTH)
140 .height(CommonConstants.FULL_HEIGHT) 146 .height(CommonConstants.FULL_HEIGHT)
@@ -163,8 +169,27 @@ export struct ImageAndTextPageComponent { @@ -163,8 +169,27 @@ export struct ImageAndTextPageComponent {
163 publishCommentModel: this.publishCommentModel, 169 publishCommentModel: this.publishCommentModel,
164 operationButtonList: this.operationButtonList, 170 operationButtonList: this.operationButtonList,
165 styleType: 1, 171 styleType: 1,
  172 + onCommentIconClick: () => {
  173 + const info = componentUtils.getRectangleById('comment');
  174 + console.log(JSON.stringify(info))
  175 +
  176 + if (!this.offsetY) {
  177 + this.offsetY = componentUtils.getRectangleById('comment').windowOffset.y
  178 + }
  179 + // 定位到评论区域
  180 + if (this.isScrollTop) {
  181 + this.scroller.scrollTo({
  182 + xOffset: 0,
  183 + yOffset: this.offsetY,
  184 + animation: true
  185 + })
  186 + } else {
  187 + this.scroller.scrollEdge(Edge.Top)
  188 + }
  189 + this.isScrollTop = !this.isScrollTop
  190 + }
166 }) 191 })
167 - .position({y: '100%'}) 192 + .position({ y: '100%' })
168 } 193 }
169 .width(CommonConstants.FULL_WIDTH) 194 .width(CommonConstants.FULL_WIDTH)
170 .height(CommonConstants.FULL_HEIGHT) 195 .height(CommonConstants.FULL_HEIGHT)
@@ -174,7 +199,7 @@ export struct ImageAndTextPageComponent { @@ -174,7 +199,7 @@ export struct ImageAndTextPageComponent {
174 // 发布时间 199 // 发布时间
175 Column() { 200 Column() {
176 Row() { 201 Row() {
177 - if(this.isNetConnected && !this.detailContentEmpty) { 202 + if (this.isNetConnected && !this.detailContentEmpty) {
178 Image(this.contentDetailData?.rmhInfo ? $r('app.media.logo_rmh') : $r('app.media.logo_rmrb')) 203 Image(this.contentDetailData?.rmhInfo ? $r('app.media.logo_rmh') : $r('app.media.logo_rmrb'))
179 .width(80) 204 .width(80)
180 .height(28) 205 .height(28)
@@ -207,7 +232,7 @@ export struct ImageAndTextPageComponent { @@ -207,7 +232,7 @@ export struct ImageAndTextPageComponent {
207 232
208 private async getDetail() { 233 private async getDetail() {
209 this.isNetConnected = NetworkUtil.isNetConnected() 234 this.isNetConnected = NetworkUtil.isNetConnected()
210 - if(!this.isNetConnected) { 235 + if (!this.isNetConnected) {
211 this.emptyType = 1 236 this.emptyType = 1
212 } 237 }
213 let contentId: string = '' 238 let contentId: string = ''
@@ -229,7 +254,7 @@ export struct ImageAndTextPageComponent { @@ -229,7 +254,7 @@ export struct ImageAndTextPageComponent {
229 let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType) 254 let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType)
230 // 判断内容是否已下线,空数组表示下线 255 // 判断内容是否已下线,空数组表示下线
231 this.detailContentEmpty = detailBeans.length === 0 ? true : false 256 this.detailContentEmpty = detailBeans.length === 0 ? true : false
232 - if(this.detailContentEmpty) { 257 + if (this.detailContentEmpty) {
233 this.emptyType = 18 258 this.emptyType = 18
234 } 259 }
235 console.log(TAG, JSON.stringify(detailBeans)) 260 console.log(TAG, JSON.stringify(detailBeans))
@@ -270,12 +295,11 @@ export struct ImageAndTextPageComponent { @@ -270,12 +295,11 @@ export struct ImageAndTextPageComponent {
270 } 295 }
271 296
272 //意图上报 297 //意图上报
273 - private viewBlogInsightIntentShare(){ 298 + private viewBlogInsightIntentShare() {
274 let context = getContext(this) as common.UIAbilityContext; 299 let context = getContext(this) as common.UIAbilityContext;
275 - viewBlogItemInsightIntentShare(context,this.contentDetailData, this.interactData) 300 + viewBlogItemInsightIntentShare(context, this.contentDetailData, this.interactData)
276 } 301 }
277 302
278 -  
279 private async getRecommend() { 303 private async getRecommend() {
280 let params: postRecommendListParams = { 304 let params: postRecommendListParams = {
281 imei: HttpUtils.getImei(), 305 imei: HttpUtils.getImei(),
@@ -90,6 +90,9 @@ export struct SpacialTopicPageComponent { @@ -90,6 +90,9 @@ export struct SpacialTopicPageComponent {
90 this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '') 90 this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')
91 this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '') 91 this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')
92 // } 92 // }
  93 + if (this.contentDetailData[0]?.openComment) {
  94 + this.operationButtonList = ['collect', 'share']
  95 + }
93 this.trySendData2H5() 96 this.trySendData2H5()
94 } 97 }
95 } 98 }
@@ -22,6 +22,8 @@ export struct AdvCardParser { @@ -22,6 +22,8 @@ export struct AdvCardParser {
22 @State compDTO: CompDTO = {} as CompDTO; 22 @State compDTO: CompDTO = {} as CompDTO;
23 pageModel: PageModel = new PageModel(); 23 pageModel: PageModel = new PageModel();
24 24
  25 +
  26 +
25 build() { 27 build() {
26 this.contentBuilder(this.pageModel, this.compDTO); 28 this.contentBuilder(this.pageModel, this.compDTO);
27 } 29 }
1 import { CompDTO } from 'wdBean'; 1 import { CompDTO } from 'wdBean';
2 import { CommonConstants } from 'wdConstant/Index'; 2 import { CommonConstants } from 'wdConstant/Index';
3 import { ProcessUtils } from 'wdRouter'; 3 import { ProcessUtils } from 'wdRouter';
  4 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
4 import PageModel from '../../viewmodel/PageModel'; 5 import PageModel from '../../viewmodel/PageModel';
5 import { CardAdvBottom } from './CardAdvBottom'; 6 import { CardAdvBottom } from './CardAdvBottom';
6 7
@@ -17,8 +18,11 @@ const TAG: string = 'Card2Component'; @@ -17,8 +18,11 @@ const TAG: string = 'Card2Component';
17 @Component 18 @Component
18 export struct CardAdvBigImageComponent { 19 export struct CardAdvBigImageComponent {
19 @State compDTO: CompDTO = {} as CompDTO 20 @State compDTO: CompDTO = {} as CompDTO
  21 +
  22 + @State loadImg: boolean = false;
20 pageModel: PageModel = new PageModel(); 23 pageModel: PageModel = new PageModel();
21 - aboutToAppear(): void { 24 + async aboutToAppear(): Promise<void> {
  25 + this.loadImg = await onlyWifiLoadImg();
22 26
23 } 27 }
24 28
@@ -33,7 +37,8 @@ export struct CardAdvBigImageComponent { @@ -33,7 +37,8 @@ export struct CardAdvBigImageComponent {
33 //新闻标题 37 //新闻标题
34 Text(this.compDTO.matInfo.advTitle).bottomTextStyle().margin({ bottom: 8, }) 38 Text(this.compDTO.matInfo.advTitle).bottomTextStyle().margin({ bottom: 8, })
35 //大图 39 //大图
36 - Image(this.compDTO.matInfo.matImageUrl[0]) 40 + Image(this.loadImg ? this.compDTO.matInfo.matImageUrl[0] : '')
  41 + .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
37 .width(CommonConstants.FULL_WIDTH) 42 .width(CommonConstants.FULL_WIDTH)
38 .aspectRatio(16 / 9) 43 .aspectRatio(16 / 9)
39 .borderRadius(4) 44 .borderRadius(4)
@@ -4,6 +4,7 @@ import { AdvExtraData, AdvExtraItemData } from 'wdBean/src/main/ets/bean/adv/Adv @@ -4,6 +4,7 @@ import { AdvExtraData, AdvExtraItemData } from 'wdBean/src/main/ets/bean/adv/Adv
4 import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean'; 4 import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean';
5 import { CommonConstants } from 'wdConstant/Index'; 5 import { CommonConstants } from 'wdConstant/Index';
6 import { ProcessUtils } from 'wdRouter'; 6 import { ProcessUtils } from 'wdRouter';
  7 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
7 import PageModel from '../../viewmodel/PageModel'; 8 import PageModel from '../../viewmodel/PageModel';
8 import { CardAdvTop } from './CardAdvTop'; 9 import { CardAdvTop } from './CardAdvTop';
9 10
@@ -23,14 +24,14 @@ export struct CardAdvGanMiComponent { @@ -23,14 +24,14 @@ export struct CardAdvGanMiComponent {
23 @State advExtraData: AdvExtraData = {} as AdvExtraData 24 @State advExtraData: AdvExtraData = {} as AdvExtraData
24 @State advLength: number = 0; 25 @State advLength: number = 0;
25 pageModel: PageModel = new PageModel(); 26 pageModel: PageModel = new PageModel();
  27 + @State loadImg: boolean = false;
26 28
27 - aboutToAppear(): void { 29 + async aboutToAppear(): Promise<void> {
  30 + this.loadImg = await onlyWifiLoadImg();
28 31
29 let extraData = this.compDTO.matInfo.extraData 32 let extraData = this.compDTO.matInfo.extraData
30 let labelDTO = JSON.parse(extraData) as AdvExtraData 33 let labelDTO = JSON.parse(extraData) as AdvExtraData
31 this.advExtraData = labelDTO 34 this.advExtraData = labelDTO
32 - //this.advExtraData.item = [this.advExtraData.item[0]]  
33 - // this.advExtraData.item[2].title ="我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国"  
34 this.advLength = this.advExtraData.item.length 35 this.advLength = this.advExtraData.item.length
35 } 36 }
36 37
@@ -46,8 +47,9 @@ export struct CardAdvGanMiComponent { @@ -46,8 +47,9 @@ export struct CardAdvGanMiComponent {
46 Row() { 47 Row() {
47 Stack() { 48 Stack() {
48 //长图 49 //长图
49 - Image(this.advExtraData.itemTopImage) 50 + Image(this.loadImg ? this.advExtraData.itemTopImage : '')
50 .width(CommonConstants.FULL_WIDTH) 51 .width(CommonConstants.FULL_WIDTH)
  52 + .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
51 .aspectRatio(343 / 40) 53 .aspectRatio(343 / 40)
52 .borderRadius(4) 54 .borderRadius(4)
53 .borderWidth(0.5) 55 .borderWidth(0.5)
@@ -73,8 +75,9 @@ export struct CardAdvGanMiComponent { @@ -73,8 +75,9 @@ export struct CardAdvGanMiComponent {
73 // 广告列表信息 75 // 广告列表信息
74 Column() { 76 Column() {
75 77
76 - Image(content.image) 78 + Image(this.loadImg ? content.image : '')
77 .width('100%') 79 .width('100%')
  80 + .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
78 .aspectRatio(150 / 84) 81 .aspectRatio(150 / 84)
79 .borderWidth(0.5) 82 .borderWidth(0.5)
80 .borderColor($r('app.color.color_0D000000')) 83 .borderColor($r('app.color.color_0D000000'))
@@ -84,7 +87,7 @@ export struct CardAdvGanMiComponent { @@ -84,7 +87,7 @@ export struct CardAdvGanMiComponent {
84 .fontSize('16fp') 87 .fontSize('16fp')
85 .fontColor($r('app.color.color_222222')) 88 .fontColor($r('app.color.color_222222'))
86 .fontSize('15fp') 89 .fontSize('15fp')
87 - .maxLines(3) 90 + .maxLines(2)
88 .lineHeight(20) 91 .lineHeight(20)
89 .textOverflow({ overflow: TextOverflow.Ellipsis }) 92 .textOverflow({ overflow: TextOverflow.Ellipsis })
90 .width('100%') 93 .width('100%')
@@ -143,7 +146,9 @@ function commonButton(advExtraData: AdvExtraData) { @@ -143,7 +146,9 @@ function commonButton(advExtraData: AdvExtraData) {
143 Row() { 146 Row() {
144 Row() { 147 Row() {
145 Blank() 148 Blank()
146 - Text('查看更多').fontColor('#222222').fontSize('14fp') 149 + Text(advExtraData.itemMore.title == null ? $r('app.string.look_more') : advExtraData.itemMore.title)
  150 + .fontColor('#222222')
  151 + .fontSize('14fp')
147 Image($r('app.media.icon_comp_more_right_red')).width(16).height(16) 152 Image($r('app.media.icon_comp_more_right_red')).width(16).height(16)
148 Blank() 153 Blank()
149 154
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 import { CompDTO } from 'wdBean'; 2 import { CompDTO } from 'wdBean';
3 import { CommonConstants, CompStyle } from 'wdConstant/Index'; 3 import { CommonConstants, CompStyle } from 'wdConstant/Index';
4 import { ProcessUtils } from 'wdRouter'; 4 import { ProcessUtils } from 'wdRouter';
  5 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
5 import PageModel from '../../viewmodel/PageModel'; 6 import PageModel from '../../viewmodel/PageModel';
6 import { CardAdvBottom } from './CardAdvBottom'; 7 import { CardAdvBottom } from './CardAdvBottom';
7 8
@@ -20,8 +21,10 @@ export struct CardAdvLongImageComponent { @@ -20,8 +21,10 @@ export struct CardAdvLongImageComponent {
20 @State compDTO: CompDTO = {} as CompDTO 21 @State compDTO: CompDTO = {} as CompDTO
21 @State haveTitle: boolean = true 22 @State haveTitle: boolean = true
22 pageModel: PageModel = new PageModel(); 23 pageModel: PageModel = new PageModel();
  24 + @State loadImg: boolean = false;
23 25
24 - aboutToAppear(): void { 26 + async aboutToAppear(): Promise<void> {
  27 + this.loadImg = await onlyWifiLoadImg();
25 this.haveTitle = this.compDTO.matInfo.advSubType === CompStyle.Card_Adv_7; 28 this.haveTitle = this.compDTO.matInfo.advSubType === CompStyle.Card_Adv_7;
26 } 29 }
27 30
@@ -37,7 +40,8 @@ export struct CardAdvLongImageComponent { @@ -37,7 +40,8 @@ export struct CardAdvLongImageComponent {
37 Text(this.compDTO.matInfo.advTitle).width('100%').bottomTextStyle().margin({ bottom: 8, }) 40 Text(this.compDTO.matInfo.advTitle).width('100%').bottomTextStyle().margin({ bottom: 8, })
38 } 41 }
39 //长图 42 //长图
40 - Image(this.compDTO.matInfo.matImageUrl[0]) 43 + Image(this.loadImg ? this.compDTO.matInfo.matImageUrl[0] : '')
  44 + .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
41 .width(CommonConstants.FULL_WIDTH) 45 .width(CommonConstants.FULL_WIDTH)
42 .aspectRatio(343 / 96) 46 .aspectRatio(343 / 96)
43 .borderRadius(4) 47 .borderRadius(4)
@@ -6,6 +6,7 @@ import measure from '@ohos.measure'; @@ -6,6 +6,7 @@ import measure from '@ohos.measure';
6 import { DisplayUtils } from 'wdKit/Index'; 6 import { DisplayUtils } from 'wdKit/Index';
7 import { CardAdvBottom } from './CardAdvBottom'; 7 import { CardAdvBottom } from './CardAdvBottom';
8 import PageModel from '../../viewmodel/PageModel'; 8 import PageModel from '../../viewmodel/PageModel';
  9 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
9 10
10 const TAG: string = 'CardAdvSmallImageComponent'; 11 const TAG: string = 'CardAdvSmallImageComponent';
11 12
@@ -22,7 +23,10 @@ export struct CardAdvSmallImageComponent { @@ -22,7 +23,10 @@ export struct CardAdvSmallImageComponent {
22 @State compDTO: CompDTO = {} as CompDTO 23 @State compDTO: CompDTO = {} as CompDTO
23 @State isBigThreeLine: boolean = false // 标题的行数大于等于3行 是true 24 @State isBigThreeLine: boolean = false // 标题的行数大于等于3行 是true
24 pageModel: PageModel = new PageModel(); 25 pageModel: PageModel = new PageModel();
25 - aboutToAppear(): void { 26 + @State loadImg: boolean = false;
  27 +
  28 + async aboutToAppear(): Promise<void> {
  29 + this.loadImg = await onlyWifiLoadImg();
26 30
27 // 计算标题文本行数 31 // 计算标题文本行数
28 let screenWith = DisplayUtils.getDeviceWidth(); 32 let screenWith = DisplayUtils.getDeviceWidth();
@@ -54,14 +58,14 @@ export struct CardAdvSmallImageComponent { @@ -54,14 +58,14 @@ export struct CardAdvSmallImageComponent {
54 .id("title_name") 58 .id("title_name")
55 59
56 // 广告图 60 // 广告图
57 - Image(this.compDTO.matInfo.matImageUrl[0]) 61 + Image(this.loadImg ? this.compDTO.matInfo.matImageUrl[0] : '')
58 .width('34%') 62 .width('34%')
59 .aspectRatio(3 / 2) 63 .aspectRatio(3 / 2)
60 .id('adv_imag') 64 .id('adv_imag')
  65 + .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
61 .borderWidth(0.5) 66 .borderWidth(0.5)
62 .borderColor($r('app.color.color_0D000000')) 67 .borderColor($r('app.color.color_0D000000'))
63 - .borderRadius(4)  
64 - //.alt('wwww.baidu.com') 68 + .borderRadius(4)//.alt('wwww.baidu.com')
65 .alignRules({ 69 .alignRules({
66 top: { anchor: 'title_name', align: VerticalAlign.Top }, 70 top: { anchor: 'title_name', align: VerticalAlign.Top },
67 left: { anchor: 'title_name', align: HorizontalAlign.End }, 71 left: { anchor: 'title_name', align: HorizontalAlign.End },
@@ -69,7 +73,7 @@ export struct CardAdvSmallImageComponent { @@ -69,7 +73,7 @@ export struct CardAdvSmallImageComponent {
69 .margin({ left: 12 }) 73 .margin({ left: 12 })
70 74
71 75
72 - CardAdvBottom({pageModel:this.pageModel,compDTO:this.compDTO}).width('62%').id('bottom_adv').alignRules({ 76 + CardAdvBottom({ pageModel: this.pageModel, compDTO: this.compDTO }).width('62%').id('bottom_adv').alignRules({
73 bottom: { anchor: this.isBigThreeLine ? '' : 'adv_imag', align: VerticalAlign.Bottom }, 77 bottom: { anchor: this.isBigThreeLine ? '' : 'adv_imag', align: VerticalAlign.Bottom },
74 right: { anchor: this.isBigThreeLine ? '' : 'adv_imag', align: HorizontalAlign.Start }, 78 right: { anchor: this.isBigThreeLine ? '' : 'adv_imag', align: HorizontalAlign.Start },
75 top: { anchor: this.isBigThreeLine ? 'title_name' : '', align: VerticalAlign.Bottom }, 79 top: { anchor: this.isBigThreeLine ? 'title_name' : '', align: VerticalAlign.Bottom },
@@ -94,13 +98,15 @@ export struct CardAdvSmallImageComponent { @@ -94,13 +98,15 @@ export struct CardAdvSmallImageComponent {
94 } 98 }
95 99
96 // 获取文本几行 100 // 获取文本几行
97 - private getTextLineNum(text: string, constraintWidth: number, lineHeight: number, fontSize: number | string | Resource) { 101 + private getTextLineNum(text: string, constraintWidth: number, lineHeight: number,
  102 + fontSize: number | string | Resource) {
98 let size = this.topMeasureText(text, constraintWidth, lineHeight, fontSize) 103 let size = this.topMeasureText(text, constraintWidth, lineHeight, fontSize)
99 let height: number = Number(size.height) 104 let height: number = Number(size.height)
100 return Math.ceil(px2vp(height) / lineHeight) 105 return Math.ceil(px2vp(height) / lineHeight)
101 } 106 }
102 107
103 - private topMeasureText(text: string, constraintWidth: number, lineHeight: number, fontSize: number | string | Resource) { 108 + private topMeasureText(text: string, constraintWidth: number, lineHeight: number,
  109 + fontSize: number | string | Resource) {
104 return measure.measureTextSize({ 110 return measure.measureTextSize({
105 textContent: text, 111 textContent: text,
106 fontSize: fontSize, 112 fontSize: fontSize,
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 import { CompDTO } from 'wdBean'; 2 import { CompDTO } 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 { onlyWifiLoadImg } from '../../utils/lazyloadImg';
5 import PageModel from '../../viewmodel/PageModel'; 6 import PageModel from '../../viewmodel/PageModel';
6 import { CardAdvBottom } from './CardAdvBottom'; 7 import { CardAdvBottom } from './CardAdvBottom';
7 8
@@ -18,9 +19,11 @@ const TAG: string = 'Card2Component'; @@ -18,9 +19,11 @@ const TAG: string = 'Card2Component';
18 @Component 19 @Component
19 export struct CardAdvThreeImageComponent { 20 export struct CardAdvThreeImageComponent {
20 @State compDTO: CompDTO = {} as CompDTO 21 @State compDTO: CompDTO = {} as CompDTO
  22 + @State loadImg: boolean = false;
21 pageModel: PageModel = new PageModel(); 23 pageModel: PageModel = new PageModel();
22 - aboutToAppear(): void {  
23 24
  25 + async aboutToAppear(): Promise<void> {
  26 + this.loadImg = await onlyWifiLoadImg();
24 } 27 }
25 28
26 aboutToDisappear(): void { 29 aboutToDisappear(): void {
@@ -43,7 +46,8 @@ export struct CardAdvThreeImageComponent { @@ -43,7 +46,8 @@ export struct CardAdvThreeImageComponent {
43 ForEach(this.compDTO.matInfo.matImageUrl, (url: string, index: number) => { 46 ForEach(this.compDTO.matInfo.matImageUrl, (url: string, index: number) => {
44 if (index < 3) { 47 if (index < 3) {
45 GridCol({ span: { xs: 4 } }) { 48 GridCol({ span: { xs: 4 } }) {
46 - Image(url) 49 + Image(this.loadImg ? url : '')
  50 + .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
47 .width('100%') 51 .width('100%')
48 .aspectRatio(113 / 75) 52 .aspectRatio(113 / 75)
49 .borderRadius({ 53 .borderRadius({
@@ -62,7 +66,7 @@ export struct CardAdvThreeImageComponent { @@ -62,7 +66,7 @@ export struct CardAdvThreeImageComponent {
62 .margin({ top: 8 }) 66 .margin({ top: 8 })
63 67
64 // 广告工具组件 68 // 广告工具组件
65 - CardAdvBottom({pageModel:this.pageModel,compDTO:this.compDTO}).width('100%').margin({ top: 8 }) 69 + CardAdvBottom({ pageModel: this.pageModel, compDTO: this.compDTO }).width('100%').margin({ top: 8 })
66 } 70 }
67 .width('100%') 71 .width('100%')
68 .justifyContent(FlexAlign.Start) 72 .justifyContent(FlexAlign.Start)
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 import { CompDTO, ContentDTO } from 'wdBean'; 2 import { CompDTO, 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 { onlyWifiLoadImg } from '../../utils/lazyloadImg';
5 import PageModel from '../../viewmodel/PageModel'; 6 import PageModel from '../../viewmodel/PageModel';
6 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; 7 import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
7 import { CardAdvBottom } from './CardAdvBottom'; 8 import { CardAdvBottom } from './CardAdvBottom';
@@ -20,11 +21,11 @@ const TAG: string = 'Card2Component'; @@ -20,11 +21,11 @@ const TAG: string = 'Card2Component';
20 export struct CardAdvVideoComponent { 21 export struct CardAdvVideoComponent {
21 @State compDTO: CompDTO = {} as CompDTO 22 @State compDTO: CompDTO = {} as CompDTO
22 @State contentDTO: ContentDTO = new ContentDTO() 23 @State contentDTO: ContentDTO = new ContentDTO()
  24 + @State loadImg: boolean = false;
23 pageModel: PageModel = new PageModel(); 25 pageModel: PageModel = new PageModel();
24 - aboutToAppear(): void {  
25 26
26 - // this.contentDTO.objectType = '1'  
27 - // this.contentDTO.videoInfo = { videoDuration: 1000 } as VideoInfoDTO 27 + async aboutToAppear(): Promise<void> {
  28 + this.loadImg = await onlyWifiLoadImg();
28 } 29 }
29 30
30 aboutToDisappear(): void { 31 aboutToDisappear(): void {
@@ -39,7 +40,8 @@ export struct CardAdvVideoComponent { @@ -39,7 +40,8 @@ export struct CardAdvVideoComponent {
39 Text(this.compDTO.matInfo.advTitle).bottomTextStyle() 40 Text(this.compDTO.matInfo.advTitle).bottomTextStyle()
40 //大图 41 //大图
41 Stack() { 42 Stack() {
42 - Image(this.compDTO.matInfo.matImageUrl[0]) 43 + Image(this.loadImg ? this.compDTO.matInfo.matImageUrl[0] : '')
  44 + .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
43 .width(CommonConstants.FULL_WIDTH) 45 .width(CommonConstants.FULL_WIDTH)
44 .aspectRatio(16 / 9) 46 .aspectRatio(16 / 9)
45 .borderRadius(4) 47 .borderRadius(4)
@@ -54,7 +56,7 @@ export struct CardAdvVideoComponent { @@ -54,7 +56,7 @@ export struct CardAdvVideoComponent {
54 .width(CommonConstants.FULL_WIDTH) 56 .width(CommonConstants.FULL_WIDTH)
55 .margin({ top: 8 }) 57 .margin({ top: 8 })
56 58
57 - CardAdvBottom({pageModel:this.pageModel,compDTO:this.compDTO}).margin({ 59 + CardAdvBottom({ pageModel: this.pageModel, compDTO: this.compDTO }).margin({
58 top: 8, 60 top: 8,
59 }) 61 })
60 } 62 }
@@ -3,6 +3,7 @@ import { AdvExtraData, AdvExtraItemData } from 'wdBean/src/main/ets/bean/adv/Adv @@ -3,6 +3,7 @@ import { AdvExtraData, AdvExtraItemData } from 'wdBean/src/main/ets/bean/adv/Adv
3 import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean'; 3 import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean';
4 import { CommonConstants } from 'wdConstant/Index'; 4 import { CommonConstants } from 'wdConstant/Index';
5 import { ProcessUtils } from 'wdRouter'; 5 import { ProcessUtils } from 'wdRouter';
  6 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
6 import PageModel from '../../viewmodel/PageModel'; 7 import PageModel from '../../viewmodel/PageModel';
7 import { CardAdvTop } from './CardAdvTop'; 8 import { CardAdvTop } from './CardAdvTop';
8 9
@@ -21,9 +22,10 @@ export struct CardAdvVideoExComponent { @@ -21,9 +22,10 @@ export struct CardAdvVideoExComponent {
21 @State compDTO: CompDTO = {} as CompDTO 22 @State compDTO: CompDTO = {} as CompDTO
22 @State advExtraData: AdvExtraData = {} as AdvExtraData 23 @State advExtraData: AdvExtraData = {} as AdvExtraData
23 pageModel: PageModel = new PageModel(); 24 pageModel: PageModel = new PageModel();
  25 + @State loadImg: boolean = false;
24 26
25 - aboutToAppear(): void {  
26 - 27 + async aboutToAppear(): Promise<void> {
  28 + this.loadImg = await onlyWifiLoadImg();
27 29
28 let extraData = this.compDTO.matInfo.extraData 30 let extraData = this.compDTO.matInfo.extraData
29 let labelDTO = JSON.parse(extraData) as AdvExtraData 31 let labelDTO = JSON.parse(extraData) as AdvExtraData
@@ -40,14 +42,14 @@ export struct CardAdvVideoExComponent { @@ -40,14 +42,14 @@ export struct CardAdvVideoExComponent {
40 42
41 Stack() { 43 Stack() {
42 //长图 44 //长图
43 - Image(this.advExtraData.itemTopImage) 45 + Image(this.loadImg ? this.advExtraData.itemTopImage : '')
44 .width(CommonConstants.FULL_WIDTH) 46 .width(CommonConstants.FULL_WIDTH)
  47 + .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
45 .aspectRatio(343 / 80) 48 .aspectRatio(343 / 80)
46 .borderRadius(4) 49 .borderRadius(4)
47 .borderWidth(0.5) 50 .borderWidth(0.5)
48 .borderColor($r('app.color.color_0D000000')) 51 .borderColor($r('app.color.color_0D000000'))
49 52
50 -  
51 CardAdvTop({ pageModel: this.pageModel, compDTO: this.compDTO }) 53 CardAdvTop({ pageModel: this.pageModel, compDTO: this.compDTO })
52 } 54 }
53 .alignContent(Alignment.Top) 55 .alignContent(Alignment.Top)
@@ -5,6 +5,7 @@ import { CommonConstants } from 'wdConstant'; @@ -5,6 +5,7 @@ import { CommonConstants } from 'wdConstant';
5 import { ProcessUtils } from 'wdRouter'; 5 import { ProcessUtils } from 'wdRouter';
6 import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; 6 import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
7 import { Notes } from './notes'; 7 import { Notes } from './notes';
  8 +import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
8 9
9 const TAG = 'Card11Component'; 10 const TAG = 'Card11Component';
10 11
@@ -23,6 +24,7 @@ export struct Card11Component { @@ -23,6 +24,7 @@ export struct Card11Component {
23 24
24 async aboutToAppear(): Promise<void> { 25 async aboutToAppear(): Promise<void> {
25 this.titleInit(); 26 this.titleInit();
  27 + this.clicked = hasClicked(this.contentDTO.objectId)
26 } 28 }
27 29
28 titleInit() { 30 titleInit() {
@@ -76,8 +78,8 @@ export struct Card11Component { @@ -76,8 +78,8 @@ export struct Card11Component {
76 }) 78 })
77 .backgroundColor($r("app.color.white")) 79 .backgroundColor($r("app.color.white"))
78 .onClick((event: ClickEvent) => { 80 .onClick((event: ClickEvent) => {
79 -  
80 this.clicked = true; 81 this.clicked = true;
  82 + persistentStorage(this.contentDTO.objectId);
81 ProcessUtils.processPage(this.contentDTO) 83 ProcessUtils.processPage(this.contentDTO)
82 }) 84 })
83 } 85 }
@@ -4,6 +4,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo' @@ -4,6 +4,7 @@ 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 import {CarderInteraction} from '../CarderInteraction'
  7 +import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
7 8
8 const TAG = 'Card12Component'; 9 const TAG = 'Card12Component';
9 10
@@ -21,6 +22,7 @@ export struct Card12Component { @@ -21,6 +22,7 @@ export struct Card12Component {
21 22
22 aboutToAppear(): void { 23 aboutToAppear(): void {
23 this.titleInit(); 24 this.titleInit();
  25 + this.clicked = hasClicked(this.contentDTO.objectId)
24 } 26 }
25 27
26 titleInit() { 28 titleInit() {
@@ -69,6 +71,7 @@ export struct Card12Component { @@ -69,6 +71,7 @@ export struct Card12Component {
69 }) 71 })
70 .onClick((event: ClickEvent) => { 72 .onClick((event: ClickEvent) => {
71 this.clicked = true; 73 this.clicked = true;
  74 + persistentStorage(this.contentDTO.objectId);
72 ProcessUtils.processPage(this.contentDTO) 75 ProcessUtils.processPage(this.contentDTO)
73 }) 76 })
74 } 77 }
@@ -5,6 +5,7 @@ import { CommonConstants } from 'wdConstant/Index'; @@ -5,6 +5,7 @@ import { CommonConstants } from 'wdConstant/Index';
5 import { ProcessUtils } from 'wdRouter'; 5 import { ProcessUtils } from 'wdRouter';
6 import {CarderInteraction} from '../CarderInteraction' 6 import {CarderInteraction} from '../CarderInteraction'
7 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 7 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
  8 +import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
8 9
9 const TAG = 'Card14Component'; 10 const TAG = 'Card14Component';
10 11
@@ -23,6 +24,7 @@ export struct Card14Component { @@ -23,6 +24,7 @@ export struct Card14Component {
23 24
24 async aboutToAppear(): Promise<void> { 25 async aboutToAppear(): Promise<void> {
25 this.titleInit(); 26 this.titleInit();
  27 + this.clicked = hasClicked(this.contentDTO.objectId)
26 this.loadImg = await onlyWifiLoadImg(); 28 this.loadImg = await onlyWifiLoadImg();
27 } 29 }
28 30
@@ -88,6 +90,7 @@ export struct Card14Component { @@ -88,6 +90,7 @@ export struct Card14Component {
88 }) 90 })
89 .onClick((event: ClickEvent) => { 91 .onClick((event: ClickEvent) => {
90 this.clicked = true; 92 this.clicked = true;
  93 + persistentStorage(this.contentDTO.objectId);
91 ProcessUtils.processPage(this.contentDTO) 94 ProcessUtils.processPage(this.contentDTO)
92 }) 95 })
93 } 96 }
@@ -5,6 +5,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo' @@ -5,6 +5,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
5 import { CommonConstants } from 'wdConstant/Index'; 5 import { CommonConstants } from 'wdConstant/Index';
6 import {CarderInteraction} from '../CarderInteraction' 6 import {CarderInteraction} from '../CarderInteraction'
7 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 7 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
  8 +import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
8 9
9 const TAG: string = 'Card15Component'; 10 const TAG: string = 'Card15Component';
10 11
@@ -27,6 +28,7 @@ export struct Card15Component { @@ -27,6 +28,7 @@ export struct Card15Component {
27 28
28 async aboutToAppear(): Promise<void> { 29 async aboutToAppear(): Promise<void> {
29 this.titleInit(); 30 this.titleInit();
  31 + this.clicked = hasClicked(this.contentDTO.objectId)
30 this.loadImg = await onlyWifiLoadImg(); 32 this.loadImg = await onlyWifiLoadImg();
31 } 33 }
32 34
@@ -85,6 +87,7 @@ export struct Card15Component { @@ -85,6 +87,7 @@ export struct Card15Component {
85 }) 87 })
86 .onClick((event: ClickEvent) => { 88 .onClick((event: ClickEvent) => {
87 this.clicked = true; 89 this.clicked = true;
  90 + persistentStorage(this.contentDTO.objectId);
88 ProcessUtils.processPage(this.contentDTO) 91 ProcessUtils.processPage(this.contentDTO)
89 }) 92 })
90 } 93 }
@@ -5,6 +5,7 @@ import { CommonConstants } from 'wdConstant/Index'; @@ -5,6 +5,7 @@ import { CommonConstants } from 'wdConstant/Index';
5 import { ProcessUtils } from 'wdRouter'; 5 import { ProcessUtils } from 'wdRouter';
6 import {CarderInteraction} from '../CarderInteraction' 6 import {CarderInteraction} from '../CarderInteraction'
7 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 7 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
  8 +import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
8 9
9 const TAG = 'Card16Component'; 10 const TAG = 'Card16Component';
10 11
@@ -28,6 +29,7 @@ export struct Card16Component { @@ -28,6 +29,7 @@ export struct Card16Component {
28 29
29 async aboutToAppear(): Promise<void> { 30 async aboutToAppear(): Promise<void> {
30 this.titleInit(); 31 this.titleInit();
  32 + this.clicked = hasClicked(this.contentDTO.objectId)
31 this.loadImg = await onlyWifiLoadImg(); 33 this.loadImg = await onlyWifiLoadImg();
32 } 34 }
33 35
@@ -87,6 +89,7 @@ export struct Card16Component { @@ -87,6 +89,7 @@ export struct Card16Component {
87 }) 89 })
88 .onClick((event: ClickEvent) => { 90 .onClick((event: ClickEvent) => {
89 this.clicked = true; 91 this.clicked = true;
  92 + persistentStorage(this.contentDTO.objectId);
90 ProcessUtils.processPage(this.contentDTO) 93 ProcessUtils.processPage(this.contentDTO)
91 }) 94 })
92 } 95 }
@@ -5,6 +5,7 @@ import { WDRouterRule } from 'wdRouter'; @@ -5,6 +5,7 @@ import { WDRouterRule } from 'wdRouter';
5 import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; 5 import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
6 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 6 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
7 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; 7 import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
  8 +import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
8 9
9 const TAG = 'Card17Component'; 10 const TAG = 'Card17Component';
10 11
@@ -24,6 +25,7 @@ export struct Card17Component { @@ -24,6 +25,7 @@ export struct Card17Component {
24 25
25 async aboutToAppear(): Promise<void> { 26 async aboutToAppear(): Promise<void> {
26 this.titleInit(); 27 this.titleInit();
  28 + this.clicked = hasClicked(this.contentDTO.objectId)
27 this.loadImg = await onlyWifiLoadImg(); 29 this.loadImg = await onlyWifiLoadImg();
28 } 30 }
29 31
@@ -105,6 +107,7 @@ export struct Card17Component { @@ -105,6 +107,7 @@ export struct Card17Component {
105 .width(CommonConstants.FULL_WIDTH) 107 .width(CommonConstants.FULL_WIDTH)
106 .onClick((event: ClickEvent) => { 108 .onClick((event: ClickEvent) => {
107 this.clicked = true; 109 this.clicked = true;
  110 + persistentStorage(this.contentDTO.objectId);
108 let taskAction: Action = { 111 let taskAction: Action = {
109 type: 'JUMP_DETAIL_PAGE', 112 type: 'JUMP_DETAIL_PAGE',
110 params: { 113 params: {
@@ -4,6 +4,7 @@ import { ProcessUtils } from 'wdRouter'; @@ -4,6 +4,7 @@ import { ProcessUtils } from 'wdRouter';
4 import { CommonConstants } from 'wdConstant/Index'; 4 import { CommonConstants } from 'wdConstant/Index';
5 import { CarderInteraction } from '../CarderInteraction' 5 import { CarderInteraction } from '../CarderInteraction'
6 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 6 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
  7 +import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
7 8
8 const TAG = 'Card19Component'; 9 const TAG = 'Card19Component';
9 10
@@ -21,6 +22,7 @@ export struct Card19Component { @@ -21,6 +22,7 @@ export struct Card19Component {
21 22
22 async aboutToAppear(): Promise<void> { 23 async aboutToAppear(): Promise<void> {
23 this.titleInit(); 24 this.titleInit();
  25 + this.clicked = hasClicked(this.contentDTO.objectId)
24 console.log('card19',JSON.stringify(this.contentDTO)) 26 console.log('card19',JSON.stringify(this.contentDTO))
25 } 27 }
26 28
@@ -74,6 +76,7 @@ export struct Card19Component { @@ -74,6 +76,7 @@ export struct Card19Component {
74 }) 76 })
75 .onClick((event: ClickEvent) => { 77 .onClick((event: ClickEvent) => {
76 this.clicked = true; 78 this.clicked = true;
  79 + persistentStorage(this.contentDTO.objectId);
77 ProcessUtils.processPage(this.contentDTO) 80 ProcessUtils.processPage(this.contentDTO)
78 }) 81 })
79 } 82 }
@@ -5,6 +5,7 @@ import { CommonConstants } from 'wdConstant/Index'; @@ -5,6 +5,7 @@ import { CommonConstants } from 'wdConstant/Index';
5 import { ProcessUtils } from 'wdRouter'; 5 import { ProcessUtils } from 'wdRouter';
6 import {CarderInteraction} from '../CarderInteraction' 6 import {CarderInteraction} from '../CarderInteraction'
7 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 7 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
  8 +import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
8 9
9 const TAG = 'Card20Component'; 10 const TAG = 'Card20Component';
10 11
@@ -22,6 +23,7 @@ export struct Card20Component { @@ -22,6 +23,7 @@ export struct Card20Component {
22 23
23 aboutToAppear(): void { 24 aboutToAppear(): void {
24 this.titleInit(); 25 this.titleInit();
  26 + this.clicked = hasClicked(this.contentDTO.objectId)
25 } 27 }
26 28
27 titleInit() { 29 titleInit() {
@@ -71,6 +73,7 @@ export struct Card20Component { @@ -71,6 +73,7 @@ export struct Card20Component {
71 }) 73 })
72 .onClick((event: ClickEvent) => { 74 .onClick((event: ClickEvent) => {
73 this.clicked = true; 75 this.clicked = true;
  76 + persistentStorage(this.contentDTO.objectId);
74 ProcessUtils.processPage(this.contentDTO) 77 ProcessUtils.processPage(this.contentDTO)
75 }) 78 })
76 } 79 }
@@ -5,6 +5,7 @@ import { RmhTitle } from '../cardCommon/RmhTitle' @@ -5,6 +5,7 @@ import { RmhTitle } from '../cardCommon/RmhTitle'
5 import { CardMediaInfo } from '../cardCommon/CardMediaInfo' 5 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
6 import {CarderInteraction} from '../CarderInteraction' 6 import {CarderInteraction} from '../CarderInteraction'
7 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 7 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
  8 +import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
8 9
9 const TAG: string = 'Card6Component-Card13Component'; 10 const TAG: string = 'Card6Component-Card13Component';
10 11
@@ -23,6 +24,7 @@ export struct Card21Component { @@ -23,6 +24,7 @@ export struct Card21Component {
23 24
24 async aboutToAppear(): Promise<void> { 25 async aboutToAppear(): Promise<void> {
25 this.titleInit(); 26 this.titleInit();
  27 + this.clicked = hasClicked(this.contentDTO.objectId)
26 this.loadImg = await onlyWifiLoadImg(); 28 this.loadImg = await onlyWifiLoadImg();
27 } 29 }
28 30
@@ -79,6 +81,7 @@ export struct Card21Component { @@ -79,6 +81,7 @@ export struct Card21Component {
79 } 81 }
80 .onClick((event: ClickEvent) => { 82 .onClick((event: ClickEvent) => {
81 this.clicked = true; 83 this.clicked = true;
  84 + persistentStorage(this.contentDTO.objectId);
82 ProcessUtils.processPage(this.contentDTO) 85 ProcessUtils.processPage(this.contentDTO)
83 }) 86 })
84 .padding({ 87 .padding({
@@ -7,7 +7,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; @@ -7,7 +7,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
7 import { Notes } from './notes'; 7 import { Notes } from './notes';
8 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 8 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
9 9
10 -// import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; 10 +import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
11 const TAG: string = 'Card2Component'; 11 const TAG: string = 'Card2Component';
12 12
13 /** 13 /**
@@ -29,9 +29,9 @@ export struct Card2Component { @@ -29,9 +29,9 @@ export struct Card2Component {
29 @State str03: string = ''; 29 @State str03: string = '';
30 30
31 async aboutToAppear(): Promise<void> { 31 async aboutToAppear(): Promise<void> {
  32 + this.clicked = hasClicked(this.contentDTO.objectId)
32 this.titleInit(); 33 this.titleInit();
33 this.loadImg = await onlyWifiLoadImg(); 34 this.loadImg = await onlyWifiLoadImg();
34 - // this.clicked = hasClicked(this.contentDTO.objectId)  
35 } 35 }
36 36
37 titleInit() { 37 titleInit() {
@@ -109,7 +109,7 @@ export struct Card2Component { @@ -109,7 +109,7 @@ export struct Card2Component {
109 }) 109 })
110 .onClick((event: ClickEvent) => { 110 .onClick((event: ClickEvent) => {
111 this.clicked = true; 111 this.clicked = true;
112 - // persistentStorage(this.contentDTO.objectId); 112 + persistentStorage(this.contentDTO.objectId);
113 ProcessUtils.processPage(this.contentDTO) 113 ProcessUtils.processPage(this.contentDTO)
114 }) 114 })
115 } 115 }
@@ -3,6 +3,7 @@ import { CompDTO, ContentDTO } from 'wdBean'; @@ -3,6 +3,7 @@ import { CompDTO, ContentDTO } from 'wdBean';
3 import { ProcessUtils } from 'wdRouter'; 3 import { ProcessUtils } from 'wdRouter';
4 import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; 4 import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
5 import { Notes } from './notes'; 5 import { Notes } from './notes';
  6 +import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
6 7
7 /** 8 /**
8 * 卡片样式:"appStyle":"3" 9 * 卡片样式:"appStyle":"3"
@@ -20,7 +21,7 @@ export struct Card3Component { @@ -20,7 +21,7 @@ export struct Card3Component {
20 21
21 async aboutToAppear(): Promise<void> { 22 async aboutToAppear(): Promise<void> {
22 this.titleInit(); 23 this.titleInit();
23 - // this.clicked = hasClicked(this.contentDTO.objectId) 24 + this.clicked = hasClicked(this.contentDTO.objectId)
24 } 25 }
25 26
26 titleInit() { 27 titleInit() {
@@ -71,6 +72,7 @@ export struct Card3Component { @@ -71,6 +72,7 @@ export struct Card3Component {
71 }) 72 })
72 .onClick((event: ClickEvent) => { 73 .onClick((event: ClickEvent) => {
73 this.clicked = true; 74 this.clicked = true;
  75 + persistentStorage(this.contentDTO.objectId);
74 ProcessUtils.processPage(this.contentDTO) 76 ProcessUtils.processPage(this.contentDTO)
75 }) 77 })
76 } 78 }
@@ -5,6 +5,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo' @@ -5,6 +5,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo'
5 import { CardMediaInfo } from '../cardCommon/CardMediaInfo' 5 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
6 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 6 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
7 import { Notes } from './notes'; 7 import { Notes } from './notes';
  8 +import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
8 const TAG: string = 'Card4Component'; 9 const TAG: string = 'Card4Component';
9 10
10 /** 11 /**
@@ -26,6 +27,7 @@ export struct Card4Component { @@ -26,6 +27,7 @@ export struct Card4Component {
26 @ObjectLink compDTO: CompDTO 27 @ObjectLink compDTO: CompDTO
27 28
28 async aboutToAppear(): Promise<void> { 29 async aboutToAppear(): Promise<void> {
  30 + this.clicked = hasClicked(this.contentDTO.objectId)
29 this.titleInit(); 31 this.titleInit();
30 this.loadImg = await onlyWifiLoadImg(); 32 this.loadImg = await onlyWifiLoadImg();
31 } 33 }
@@ -102,6 +104,7 @@ export struct Card4Component { @@ -102,6 +104,7 @@ export struct Card4Component {
102 .alignItems(HorizontalAlign.Start) 104 .alignItems(HorizontalAlign.Start)
103 .onClick((event: ClickEvent) => { 105 .onClick((event: ClickEvent) => {
104 this.clicked = true; 106 this.clicked = true;
  107 + persistentStorage(this.contentDTO.objectId);
105 ProcessUtils.processPage(this.contentDTO) 108 ProcessUtils.processPage(this.contentDTO)
106 }) 109 })
107 //bottom 评论等信息 110 //bottom 评论等信息
@@ -3,6 +3,7 @@ import { CommonConstants } from 'wdConstant'; @@ -3,6 +3,7 @@ import { CommonConstants } from 'wdConstant';
3 import { ProcessUtils } from 'wdRouter'; 3 import { ProcessUtils } from 'wdRouter';
4 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 4 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
5 import { Notes } from './notes'; 5 import { Notes } from './notes';
  6 +import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
6 7
7 const TAG: string = 'Card5Component'; 8 const TAG: string = 'Card5Component';
8 9
@@ -21,6 +22,7 @@ export struct Card5Component { @@ -21,6 +22,7 @@ export struct Card5Component {
21 @State str03: string = ''; 22 @State str03: string = '';
22 23
23 async aboutToAppear(): Promise<void> { 24 async aboutToAppear(): Promise<void> {
  25 + this.clicked = hasClicked(this.contentDTO.objectId)
24 this.loadImg = await onlyWifiLoadImg(); 26 this.loadImg = await onlyWifiLoadImg();
25 27
26 this.titleInit(); 28 this.titleInit();
@@ -95,6 +97,7 @@ export struct Card5Component { @@ -95,6 +97,7 @@ export struct Card5Component {
95 }) 97 })
96 .onClick((event: ClickEvent) => { 98 .onClick((event: ClickEvent) => {
97 this.clicked = true; 99 this.clicked = true;
  100 + persistentStorage(this.contentDTO.objectId);
98 ProcessUtils.processPage(this.contentDTO) 101 ProcessUtils.processPage(this.contentDTO)
99 }) 102 })
100 103
@@ -6,6 +6,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; @@ -6,6 +6,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
6 import { Notes } from './notes'; 6 import { Notes } from './notes';
7 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 7 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
8 import { Logger } from 'wdKit/Index'; 8 import { Logger } from 'wdKit/Index';
  9 +import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
9 10
10 const TAG: string = 'Card6Component-Card13Component'; 11 const TAG: string = 'Card6Component-Card13Component';
11 12
@@ -26,7 +27,7 @@ export struct Card6Component { @@ -26,7 +27,7 @@ export struct Card6Component {
26 async aboutToAppear(): Promise<void> { 27 async aboutToAppear(): Promise<void> {
27 this.titleInit(); 28 this.titleInit();
28 this.loadImg = await onlyWifiLoadImg(); 29 this.loadImg = await onlyWifiLoadImg();
29 - // this.clicked = hasClicked(this.contentDTO.objectId) 30 + this.clicked = hasClicked(this.contentDTO.objectId)
30 } 31 }
31 32
32 titleInit() { 33 titleInit() {
@@ -104,7 +105,7 @@ export struct Card6Component { @@ -104,7 +105,7 @@ export struct Card6Component {
104 } 105 }
105 .onClick((event: ClickEvent) => { 106 .onClick((event: ClickEvent) => {
106 this.clicked = true; 107 this.clicked = true;
107 - // persistentStorage(this.contentDTO.objectId); 108 + persistentStorage(this.contentDTO.objectId);
108 ProcessUtils.processPage(this.contentDTO) 109 ProcessUtils.processPage(this.contentDTO)
109 }) 110 })
110 .padding({ 111 .padding({
@@ -4,6 +4,7 @@ import { DateTimeUtils } from 'wdKit'; @@ -4,6 +4,7 @@ import { DateTimeUtils } from 'wdKit';
4 import { ProcessUtils } from 'wdRouter'; 4 import { ProcessUtils } from 'wdRouter';
5 import { Notes } from './notes'; 5 import { Notes } from './notes';
6 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 6 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
  7 +import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
7 8
8 /** 9 /**
9 * 时间链卡--CompStyle: 09 10 * 时间链卡--CompStyle: 09
@@ -23,6 +24,7 @@ export struct Card9Component { @@ -23,6 +24,7 @@ export struct Card9Component {
23 async aboutToAppear(): Promise<void> { 24 async aboutToAppear(): Promise<void> {
24 this.titleInit(); 25 this.titleInit();
25 // this.loadImg = await onlyWifiLoadImg(); 26 // this.loadImg = await onlyWifiLoadImg();
  27 + this.clicked = hasClicked(this.contentDTO.objectId)
26 } 28 }
27 29
28 titleInit() { 30 titleInit() {
@@ -111,6 +113,7 @@ export struct Card9Component { @@ -111,6 +113,7 @@ export struct Card9Component {
111 .margin({ bottom: 8 }) 113 .margin({ bottom: 8 })
112 .onClick((event: ClickEvent) => { 114 .onClick((event: ClickEvent) => {
113 this.clicked = true; 115 this.clicked = true;
  116 + persistentStorage(this.contentDTO.objectId);
114 ProcessUtils.processPage(this.contentDTO) 117 ProcessUtils.processPage(this.contentDTO)
115 }) 118 })
116 } 119 }
@@ -163,6 +166,7 @@ export struct Card9Component { @@ -163,6 +166,7 @@ export struct Card9Component {
163 .textOverflow({ overflow: TextOverflow.Ellipsis }) 166 .textOverflow({ overflow: TextOverflow.Ellipsis })
164 .alignSelf(ItemAlign.Center) 167 .alignSelf(ItemAlign.Center)
165 .margin({ left: 12 }) 168 .margin({ left: 12 })
  169 + // .padding({bottom: 20})
166 // if (item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) { 170 // if (item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) {
167 // Image(this.loadImg? item.fullColumnImgUrls[0].url : '') 171 // Image(this.loadImg? item.fullColumnImgUrls[0].url : '')
168 // .backgroundColor(0xf5f5f5) 172 // .backgroundColor(0xf5f5f5)
@@ -175,7 +179,7 @@ export struct Card9Component { @@ -175,7 +179,7 @@ export struct Card9Component {
175 } 179 }
176 .alignContent(Alignment.TopStart) 180 .alignContent(Alignment.TopStart)
177 } 181 }
178 - .height(item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url ? 100 : 78) 182 + .height(item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url ? 100 : 50)
179 .alignItems(HorizontalAlign.Start) 183 .alignItems(HorizontalAlign.Start)
180 } 184 }
181 } 185 }
@@ -9,7 +9,7 @@ import { ContentDetailDTO } from 'wdBean/Index' @@ -9,7 +9,7 @@ import { ContentDetailDTO } from 'wdBean/Index'
9 export struct CommentTabComponent { 9 export struct CommentTabComponent {
10 private onCommentFocus: () => void = () => { 10 private onCommentFocus: () => void = () => {
11 } 11 }
12 - private onLoad: (dialogController: CustomDialogController) => void = () => { 12 + private onLoad: (dialogController: CustomDialogController | null) => void = () => {
13 } 13 }
14 @ObjectLink publishCommentModel: publishCommentModel 14 @ObjectLink publishCommentModel: publishCommentModel
15 @Prop contentDetail: ContentDetailDTO 15 @Prop contentDetail: ContentDetailDTO
@@ -139,7 +139,7 @@ export struct ZhSingleRow06 { @@ -139,7 +139,7 @@ export struct ZhSingleRow06 {
139 .height(16) 139 .height(16)
140 .margin({right: 3}) 140 .margin({right: 3})
141 141
142 - Text('点赞') 142 + Text(Number(this.newsStatusOfUser?.likeStatus) == 1 ? '已赞' : '点赞')
143 .fontSize(15) 143 .fontSize(15)
144 .fontColor(0x999999) 144 .fontColor(0x999999)
145 .onClick(() => { 145 .onClick(() => {
@@ -98,6 +98,7 @@ export struct BottomNavigationComponent { @@ -98,6 +98,7 @@ export struct BottomNavigationComponent {
98 }); 98 });
99 99
100 } 100 }
  101 + .zIndex(10)
101 .scrollable(false) 102 .scrollable(false)
102 .animationDuration(0) 103 .animationDuration(0)
103 .barHeight($r('app.float.bottom_navigation_barHeight')) 104 .barHeight($r('app.float.bottom_navigation_barHeight'))
@@ -132,6 +133,7 @@ export struct BottomNavigationComponent { @@ -132,6 +133,7 @@ export struct BottomNavigationComponent {
132 .fontColor(this.currentNavIndex === index ? navItem.nameCColor : navItem.nameColor) 133 .fontColor(this.currentNavIndex === index ? navItem.nameCColor : navItem.nameColor)
133 .opacity(this.currentNavIndex === index ? this.FULL_OPACITY : this.SIXTY_OPACITY) 134 .opacity(this.currentNavIndex === index ? this.FULL_OPACITY : this.SIXTY_OPACITY)
134 } 135 }
  136 + .zIndex(10)
135 .height($r('app.float.bottom_navigation_barHeight')) 137 .height($r('app.float.bottom_navigation_barHeight'))
136 .hoverEffect(HoverEffect.Highlight) 138 .hoverEffect(HoverEffect.Highlight)
137 .onClick(() => { 139 .onClick(() => {
@@ -78,9 +78,12 @@ export struct PeopleShipHomeArticleListComponent { @@ -78,9 +78,12 @@ export struct PeopleShipHomeArticleListComponent {
78 78
79 List({scroller: this.scroller}) { 79 List({scroller: this.scroller}) {
80 // 下拉刷新 80 // 下拉刷新
81 - ForEach(this.arr, (item: ContentDTO) => { 81 + ForEach(this.arr, (item: ContentDTO, index: number) => {
82 ListItem() { 82 ListItem() {
  83 + Column() {
83 CardParser({compDTO:new CompDTO, contentDTO: item }) 84 CardParser({compDTO:new CompDTO, contentDTO: item })
  85 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  86 + }
84 }.width("100%") 87 }.width("100%")
85 .backgroundColor(Color.Transparent) 88 .backgroundColor(Color.Transparent)
86 }, (item: ContentDTO, index: number) => item.objectId + index.toString()) 89 }, (item: ContentDTO, index: number) => item.objectId + index.toString())
@@ -64,6 +64,7 @@ export struct OperRowListView { @@ -64,6 +64,7 @@ export struct OperRowListView {
64 /** 64 /**
65 * 用于区分页面类型,在哪个页面嵌套就传相应的值 65 * 用于区分页面类型,在哪个页面嵌套就传相应的值
66 * 1:视频详情页 2:竖屏直播页 3:图集 4:横屏直播页 66 * 1:视频详情页 2:竖屏直播页 3:图集 4:横屏直播页
  67 + * 8: 评论弹框内
67 */ 68 */
68 @Prop pageComponentType?: number = -1 69 @Prop pageComponentType?: number = -1
69 @Prop showBackIcon?: boolean = true 70 @Prop showBackIcon?: boolean = true
@@ -208,7 +209,7 @@ export struct OperRowListView { @@ -208,7 +209,7 @@ export struct OperRowListView {
208 contentDetail: this.contentDetailData, 209 contentDetail: this.contentDetailData,
209 onCommentFocus: this.onCommentFocus, 210 onCommentFocus: this.onCommentFocus,
210 pageComponentType: this.pageComponentType, 211 pageComponentType: this.pageComponentType,
211 - onLoad: (dialogController: CustomDialogController) => { 212 + onLoad: (dialogController: CustomDialogController | null) => {
212 this.dialogController = dialogController 213 this.dialogController = dialogController
213 } 214 }
214 }) 215 })
@@ -29,7 +29,7 @@ export function touchUpLoadMore(model: PageModel) { @@ -29,7 +29,7 @@ export function touchUpLoadMore(model: PageModel) {
29 if ((self.isCanLoadMore === true) && (self.hasMore === true) && (self.isLoading === false)) { 29 if ((self.isCanLoadMore === true) && (self.hasMore === true) && (self.isLoading === false)) {
30 self.isLoading = true; 30 self.isLoading = true;
31 setTimeout(() => { 31 setTimeout(() => {
32 - closeLoadMore(model); 32 + // closeLoadMore(model);
33 PageHelper.loadMore(self) 33 PageHelper.loadMore(self)
34 }, Const.DELAY_TIME); 34 }, Const.DELAY_TIME);
35 } else { 35 } else {
@@ -13,7 +13,7 @@ export class RefreshConstants { @@ -13,7 +13,7 @@ export class RefreshConstants {
13 /** 13 /**
14 * The delay time. 14 * The delay time.
15 */ 15 */
16 - static readonly DELAY_TIME: number = 200; 16 + static readonly DELAY_TIME: number = 50;
17 17
18 /** 18 /**
19 * The animation duration. 19 * The animation duration.
1 -// PersistentStorage.persistProp('clickedIds', []);  
2 -//  
3 -// function persistentStorage(id: string | number, type: 'add' | 'remove' | undefined = 'add') {  
4 -// let clickedIds = AppStorage.get<string>('clickedIds')?.split(',') || [];  
5 -// let index = clickedIds.indexOf(id.toString())  
6 -// if (type === 'add') {  
7 -// if (index >= 0) return;  
8 -// clickedIds.push(id.toString());  
9 -// } else if (type === 'remove') {  
10 -// clickedIds.splice(index, 1);  
11 -// }  
12 -// AppStorage.set('clickedIds', clickedIds.join(','));  
13 -// }  
14 -//  
15 -// function hasClicked(id: string | number) {  
16 -// let clickedIds = AppStorage.get<string>('clickedIds')?.split(',') || [];  
17 -// let index = clickedIds.indexOf(id.toString())  
18 -// if (index >= 0) return true;  
19 -// return false;  
20 -// }  
21 -//  
22 -// export { persistentStorage, hasClicked }  
  1 +PersistentStorage.persistProp('clickedIds', []);
  2 +
  3 +function persistentStorage(id: string | number, type: 'add' | 'remove' | undefined = 'add') {
  4 + let _clickedIds = AppStorage.get<string[]>('clickedIds');
  5 + let clickedIds = _clickedIds?.toString()?.split(',') || [];
  6 + let index = clickedIds.indexOf(id.toString())
  7 + if (type === 'add') {
  8 + if (index >= 0) return;
  9 + clickedIds.push(id.toString());
  10 + } else if (type === 'remove') {
  11 + clickedIds.splice(index, 1);
  12 + }
  13 + AppStorage.set('clickedIds', clickedIds.join(','));
  14 +}
  15 +
  16 +function hasClicked(id: string | number) {
  17 + let clickedIds = AppStorage.get<string>('clickedIds')?.split(',') || [];
  18 + let index = clickedIds.indexOf(id.toString())
  19 + if (index >= 0) return true;
  20 + return false;
  21 +}
  22 +
  23 +export { persistentStorage, hasClicked }
@@ -14,6 +14,7 @@ import { BaseDTO } from 'wdBean/src/main/ets/bean/component/BaseDTO'; @@ -14,6 +14,7 @@ import { BaseDTO } from 'wdBean/src/main/ets/bean/component/BaseDTO';
14 import { viewBlogInsightIntentShare, ActionMode } from '../utils/InsightIntentShare' 14 import { viewBlogInsightIntentShare, ActionMode } from '../utils/InsightIntentShare'
15 import { common } from '@kit.AbilityKit'; 15 import { common } from '@kit.AbilityKit';
16 import { CacheData } from 'wdNetwork/Index'; 16 import { CacheData } from 'wdNetwork/Index';
  17 +import { closeLoadMore } from '../utils/PullUpLoadMore';
17 18
18 const TAG = 'PageHelper'; 19 const TAG = 'PageHelper';
19 20
@@ -37,7 +38,7 @@ export class PageHelper { @@ -37,7 +38,7 @@ export class PageHelper {
37 if (!netStatus) { 38 if (!netStatus) {
38 ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) 39 ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
39 setTimeout(() => { 40 setTimeout(() => {
40 - closeRefresh(pageModel, false) 41 + this.refreshUIEnd(pageModel, false)
41 }, 500) 42 }, 500)
42 return 43 return
43 } 44 }
@@ -46,6 +47,10 @@ export class PageHelper { @@ -46,6 +47,10 @@ export class PageHelper {
46 this.getPageInfo(pageModel, pageAdvModel) 47 this.getPageInfo(pageModel, pageAdvModel)
47 } 48 }
48 49
  50 + private refreshUIEnd(pageModel: PageModel, isRefreshSuccess: boolean) {
  51 + closeRefresh(pageModel, isRefreshSuccess)
  52 + }
  53 +
49 /** 54 /**
50 * 分页加载 55 * 分页加载
51 */ 56 */
@@ -60,6 +65,10 @@ export class PageHelper { @@ -60,6 +65,10 @@ export class PageHelper {
60 this.compLoadMore(pageModel) 65 this.compLoadMore(pageModel)
61 } 66 }
62 67
  68 + private loadMoreEnd(pageModel: PageModel) {
  69 + closeLoadMore(pageModel)
  70 + }
  71 +
63 /** 72 /**
64 * 进页面请求数据 73 * 进页面请求数据
65 */ 74 */
@@ -105,7 +114,7 @@ export class PageHelper { @@ -105,7 +114,7 @@ export class PageHelper {
105 } else { 114 } else {
106 //更新数据 115 //更新数据
107 pageModel.compList.addItems(liveReviewDTO.list); 116 pageModel.compList.addItems(liveReviewDTO.list);
108 - closeRefresh(pageModel, true); 117 + this.refreshUIEnd(pageModel, true);
109 } 118 }
110 }).catch((err: string | Resource) => { 119 }).catch((err: string | Resource) => {
111 promptAction.showToast({ message: err }); 120 promptAction.showToast({ message: err });
@@ -233,7 +242,7 @@ export class PageHelper { @@ -233,7 +242,7 @@ export class PageHelper {
233 // 242 //
234 pageModel.currentPage++ 243 pageModel.currentPage++
235 pageModel.viewType = ViewType.LOADED 244 pageModel.viewType = ViewType.LOADED
236 - closeRefresh(pageModel, true) 245 + this.refreshUIEnd(pageModel, true)
237 246
238 if (pageModel.compList.isEmpty()) { 247 if (pageModel.compList.isEmpty()) {
239 // 没数据,展示空页面 248 // 没数据,展示空页面
@@ -277,6 +286,7 @@ export class PageHelper { @@ -277,6 +286,7 @@ export class PageHelper {
277 //聚合页 286 //聚合页
278 if (pageModel.pageType == 1) { 287 if (pageModel.pageType == 1) {
279 PageViewModel.postThemeList(pageModel.currentPage, pageModel.pageSize, pageModel.extra).then((liveReviewDTO) => { 288 PageViewModel.postThemeList(pageModel.currentPage, pageModel.pageSize, pageModel.extra).then((liveReviewDTO) => {
  289 + this.loadMoreEnd(pageModel)
280 if (liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0) { 290 if (liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0) {
281 pageModel.hasMore = false; 291 pageModel.hasMore = false;
282 return; 292 return;
@@ -290,6 +300,7 @@ export class PageHelper { @@ -290,6 +300,7 @@ export class PageHelper {
290 } 300 }
291 }).catch((err: string | Resource) => { 301 }).catch((err: string | Resource) => {
292 promptAction.showToast({ message: err }); 302 promptAction.showToast({ message: err });
  303 + this.loadMoreEnd(pageModel)
293 }) 304 })
294 } else { 305 } else {
295 306
@@ -301,7 +312,7 @@ export class PageHelper { @@ -301,7 +312,7 @@ export class PageHelper {
301 // 默认加载更多走 楼层接口 312 // 默认加载更多走 楼层接口
302 PageViewModel.getPageGroupCompData(pageModel.bizCopy()) 313 PageViewModel.getPageGroupCompData(pageModel.bizCopy())
303 .then((data: PageDTO) => { 314 .then((data: PageDTO) => {
304 - 315 + this.loadMoreEnd(pageModel)
305 if (data == null || data.compList == null || data.compList.length == 0) { 316 if (data == null || data.compList == null || data.compList.length == 0) {
306 pageModel.hasMore = false; 317 pageModel.hasMore = false;
307 } else { 318 } else {
@@ -316,6 +327,7 @@ export class PageHelper { @@ -316,6 +327,7 @@ export class PageHelper {
316 } 327 }
317 }).catch((err: string | Resource) => { 328 }).catch((err: string | Resource) => {
318 promptAction.showToast({ message: err }); 329 promptAction.showToast({ message: err });
  330 + this.loadMoreEnd(pageModel)
319 }) 331 })
320 } 332 }
321 } 333 }
@@ -651,6 +663,7 @@ export class PageHelper { @@ -651,6 +663,7 @@ export class PageHelper {
651 let pageSize = Normal_Page_Size 663 let pageSize = Normal_Page_Size
652 664
653 PageViewModel.getLiveReviewUrl(currentPage, pageSize).then((liveReviewDTO) => { 665 PageViewModel.getLiveReviewUrl(currentPage, pageSize).then((liveReviewDTO) => {
  666 + this.loadMoreEnd(pageModel)
654 if (liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0) { 667 if (liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0) {
655 pageModel.hasMore = false; 668 pageModel.hasMore = false;
656 } else { 669 } else {
@@ -696,9 +709,9 @@ export class PageHelper { @@ -696,9 +709,9 @@ export class PageHelper {
696 this.getLiveRoomDataInfo(pageInfo.oneRequestPageGroupCompList.convertToArray()) 709 this.getLiveRoomDataInfo(pageInfo.oneRequestPageGroupCompList.convertToArray())
697 710
698 } 711 }
699 -  
700 }).catch((err: string | Resource) => { 712 }).catch((err: string | Resource) => {
701 promptAction.showToast({ message: err }); 713 promptAction.showToast({ message: err });
  714 + this.loadMoreEnd(pageModel)
702 }) 715 })
703 } 716 }
704 717
@@ -102,5 +102,10 @@ @@ -102,5 +102,10 @@
102 "name": "feedback_hideemail", 102 "name": "feedback_hideemail",
103 "value": "请输入电话或者邮箱" 103 "value": "请输入电话或者邮箱"
104 } 104 }
  105 + ,
  106 + {
  107 + "name": "look_more",
  108 + "value": "查看更多"
  109 + }
105 ] 110 ]
106 } 111 }
@@ -17,6 +17,7 @@ import { PlayerBottomView } from '../view/PlayerBottomView'; @@ -17,6 +17,7 @@ import { PlayerBottomView } from '../view/PlayerBottomView';
17 import { PlayerRightView } from '../view/PlayerRightView'; 17 import { PlayerRightView } from '../view/PlayerRightView';
18 import { DisplayDirection } from 'wdConstant/Index'; 18 import { DisplayDirection } from 'wdConstant/Index';
19 import { CommentDialogView } from '../view/CommentDialogView'; 19 import { CommentDialogView } from '../view/CommentDialogView';
  20 +import { window } from '@kit.ArkUI';
20 21
21 const TAG = 'DetailPlayShortVideoPage'; 22 const TAG = 'DetailPlayShortVideoPage';
22 23
@@ -294,6 +295,15 @@ export struct DetailPlayShortVideoPage { @@ -294,6 +295,15 @@ export struct DetailPlayShortVideoPage {
294 .margin({ top: 280 }) 295 .margin({ top: 280 })
295 .onClick(() => { 296 .onClick(() => {
296 // 全屏方案待定 297 // 全屏方案待定
  298 + // this.displayDirection = DisplayDirection.VERTICAL
  299 + this.displayDirection = this.displayDirection == DisplayDirection.VERTICAL ?
  300 + DisplayDirection.VIDEO_HORIZONTAL :
  301 + DisplayDirection.VERTICAL
  302 + WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
  303 + window.Orientation.PORTRAIT :
  304 + window.Orientation.LANDSCAPE_INVERTED)
  305 +
  306 +
297 }) 307 })
298 308
299 } 309 }
@@ -91,6 +91,7 @@ export struct DetailDialog { @@ -91,6 +91,7 @@ export struct DetailDialog {
91 91
92 OperRowListView({ 92 OperRowListView({
93 componentType: 1, 93 componentType: 1,
  94 + pageComponentType: 8,
94 showBackIcon: false, 95 showBackIcon: false,
95 operationButtonList: ['comment', 'like', 'collect', 'share'], 96 operationButtonList: ['comment', 'like', 'collect', 'share'],
96 contentDetailData: this.contentDetailData, 97 contentDetailData: this.contentDetailData,
@@ -96,6 +96,7 @@ export struct WDPlayerRenderView { @@ -96,6 +96,7 @@ export struct WDPlayerRenderView {
96 this.onLoad(event) 96 this.onLoad(event)
97 } 97 }
98 }) 98 })
  99 + .zIndex(1000)
99 .width(this.selfSize.width) 100 .width(this.selfSize.width)
100 .height(this.selfSize.height) 101 .height(this.selfSize.height)
101 } 102 }