yumaochao
Showing 37 changed files with 288 additions and 111 deletions
@@ -220,6 +220,9 @@ export class ProcessUtils { @@ -220,6 +220,9 @@ export class ProcessUtils {
220 } 220 }
221 221
222 public static gotoDefaultWeb(content: ContentDTO) { 222 public static gotoDefaultWeb(content: ContentDTO) {
  223 +
  224 + // 内链
  225 + if(content.openType == '1'){
223 let taskAction: Action = { 226 let taskAction: Action = {
224 type: 'JUMP_H5_BY_WEB_VIEW', 227 type: 'JUMP_H5_BY_WEB_VIEW',
225 params: { 228 params: {
@@ -227,7 +230,16 @@ export class ProcessUtils { @@ -227,7 +230,16 @@ export class ProcessUtils {
227 } as Params, 230 } as Params,
228 }; 231 };
229 WDRouterRule.jumpWithAction(taskAction) 232 WDRouterRule.jumpWithAction(taskAction)
230 - Logger.debug(TAG, `gotoWeb, ${content.objectId}`); 233 + }else if(content.openType == '2') {
  234 + // 外链
  235 + ProcessUtils.jumpExternalWebPage(content.linkUrl);
  236 + }else {
  237 + // 无需跳转
  238 +
  239 + }
  240 +
  241 +
  242 + Logger.debug(TAG, `gotoWeb, ${content.objectId}`)
231 } 243 }
232 244
233 static commentGotoWeb(content: commentInfo) { 245 static commentGotoWeb(content: commentInfo) {
@@ -15,6 +15,7 @@ export struct WdWebComponent { @@ -15,6 +15,7 @@ export struct WdWebComponent {
15 onWebPrepared: () => void = () => { 15 onWebPrepared: () => void = () => {
16 } 16 }
17 @Prop webUrl: string = '' 17 @Prop webUrl: string = ''
  18 + @Prop @Watch('onReloadStateChanged') reload: number = 0
18 @Link isPageEnd: boolean 19 @Link isPageEnd: boolean
19 20
20 build() { 21 build() {
@@ -87,5 +88,11 @@ export struct WdWebComponent { @@ -87,5 +88,11 @@ export struct WdWebComponent {
87 Logger.debug(TAG, 'onLoadIntercept return false'); 88 Logger.debug(TAG, 'onLoadIntercept return false');
88 return false 89 return false
89 } 90 }
  91 + onReloadStateChanged() {
  92 + Logger.info(TAG, `onReloadStateChanged:::refresh, this.reload: ${this.reload}`);
  93 + if (this.reload > 0) {
  94 + this.webviewControl.refresh()
  95 + }
  96 + }
90 } 97 }
91 98
@@ -15,6 +15,7 @@ export struct WdWebLocalComponent { @@ -15,6 +15,7 @@ export struct WdWebLocalComponent {
15 } 15 }
16 @Prop backVisibility: boolean = false 16 @Prop backVisibility: boolean = false
17 @Prop webResource: Resource = {} as Resource 17 @Prop webResource: Resource = {} as Resource
  18 + @Prop @Watch('onReloadStateChanged') reload: number = 0
18 @State webHeight: string | number = '100%' 19 @State webHeight: string | number = '100%'
19 @Link isPageEnd: boolean 20 @Link isPageEnd: boolean
20 @State videoUrl: string = '' 21 @State videoUrl: string = ''
@@ -240,5 +241,11 @@ export struct WdWebLocalComponent { @@ -240,5 +241,11 @@ export struct WdWebLocalComponent {
240 Logger.debug(TAG, 'onLoadIntercept return false'); 241 Logger.debug(TAG, 'onLoadIntercept return false');
241 return false 242 return false
242 } 243 }
  244 + onReloadStateChanged() {
  245 + Logger.info(TAG, `onReloadStateChanged:::refresh, this.reload: ${this.reload}`);
  246 + if (this.reload > 0) {
  247 + this.webviewControl.refresh()
  248 + }
  249 + }
243 } 250 }
244 251
@@ -10,7 +10,7 @@ import { BaseDTO } from '../component/BaseDTO'; @@ -10,7 +10,7 @@ import { BaseDTO } from '../component/BaseDTO';
10 10
11 @Observed 11 @Observed
12 export class ContentDTO implements BaseDTO { 12 export class ContentDTO implements BaseDTO {
13 - shareFlag?:string='0'; 13 + shareFlag?:string='1';
14 appStyle: string = ''; 14 appStyle: string = '';
15 cityCode: string = ''; 15 cityCode: string = '';
16 coverSize: string = ''; 16 coverSize: string = '';
@@ -30,6 +30,8 @@ export struct CarderInteraction { @@ -30,6 +30,8 @@ export struct CarderInteraction {
30 this.likeBean['title'] = this.contentDetailData.newsTitle + '' 30 this.likeBean['title'] = this.contentDetailData.newsTitle + ''
31 this.likeBean['userHeaderUrl'] = this.contentDetailData.userInfo?.headPhotoUrl + '' 31 this.likeBean['userHeaderUrl'] = this.contentDetailData.userInfo?.headPhotoUrl + ''
32 this.likeBean['channelId'] = this.contentDetailData.reLInfo?.channelId + '' 32 this.likeBean['channelId'] = this.contentDetailData.reLInfo?.channelId + ''
  33 + this.contentDTO.shareFlag = this.contentDTO.shareFlag?this.contentDTO.shareFlag:'1'
  34 + console.log('是否显示分享',this.contentDTO.shareFlag)
33 } 35 }
34 36
35 build() { 37 build() {
@@ -95,6 +95,7 @@ export struct ImageAndTextWebComponent { @@ -95,6 +95,7 @@ export struct ImageAndTextWebComponent {
95 Column() { 95 Column() {
96 WdWebLocalComponent({ 96 WdWebLocalComponent({
97 webviewControl: this.webviewControl, 97 webviewControl: this.webviewControl,
  98 + reload:this.reload,
98 webResource: $rawfile('apph5/index.html'), 99 webResource: $rawfile('apph5/index.html'),
99 backVisibility: false, 100 backVisibility: false,
100 onWebPrepared: this.onWebPrepared.bind(this), 101 onWebPrepared: this.onWebPrepared.bind(this),
1 import { ContentDTO } from 'wdBean/Index'; 1 import { ContentDTO } from 'wdBean/Index';
2 import { ProcessUtils } from 'wdRouter/Index'; 2 import { ProcessUtils } from 'wdRouter/Index';
3 import { InteractMessageModel } from '../../model/InteractMessageModel' 3 import { InteractMessageModel } from '../../model/InteractMessageModel'
4 - 4 +import { DateTimeUtils} from 'wdKit/Index'
5 @Component 5 @Component
6 export struct InteractMComponent { 6 export struct InteractMComponent {
7 messageModel:InteractMessageModel = new InteractMessageModel; 7 messageModel:InteractMessageModel = new InteractMessageModel;
@@ -15,6 +15,7 @@ export struct InteractMComponent { @@ -15,6 +15,7 @@ export struct InteractMComponent {
15 build() { 15 build() {
16 Row(){ 16 Row(){
17 Image(this.messageModel.InteractMsubM.headUrl) 17 Image(this.messageModel.InteractMsubM.headUrl)
  18 + .alt($r('app.media.default_head'))
18 .width(36) 19 .width(36)
19 .height(36) 20 .height(36)
20 .borderRadius(18) 21 .borderRadius(18)
@@ -29,7 +30,7 @@ export struct InteractMComponent { @@ -29,7 +30,7 @@ export struct InteractMComponent {
29 .margin({left:5}) 30 .margin({left:5})
30 }.width('100%') 31 }.width('100%')
31 32
32 - Text(this.messageModel.time) 33 + Text(this.getPublishTime(this.messageModel.time,DateTimeUtils.getDateTimestamp(this.messageModel.time)+""))
33 .margin({top:2}) 34 .margin({top:2})
34 .fontSize('12fp').fontColor('#B0B0B0').margin({top:10,bottom:10}) 35 .fontSize('12fp').fontColor('#B0B0B0').margin({top:10,bottom:10})
35 36
@@ -41,6 +42,7 @@ export struct InteractMComponent { @@ -41,6 +42,7 @@ export struct InteractMComponent {
41 .constraintSize({maxHeight:500}) 42 .constraintSize({maxHeight:500})
42 } 43 }
43 44
  45 + if(this.messageModel.contentType != '211' && this.messageModel.contentType != '210'){
44 Column(){ 46 Column(){
45 if (this.messageModel.contentType === '207' || this.messageModel.contentType === '209'){ 47 if (this.messageModel.contentType === '207' || this.messageModel.contentType === '209'){
46 Text('[你的评论]'+this.buildCommentContent()).fontSize('14fp').fontColor('#666666').constraintSize({maxHeight:500}) 48 Text('[你的评论]'+this.buildCommentContent()).fontSize('14fp').fontColor('#666666').constraintSize({maxHeight:500})
@@ -77,6 +79,7 @@ export struct InteractMComponent { @@ -77,6 +79,7 @@ export struct InteractMComponent {
77 contentDTO.objectId = this.messageModel.InteractMsubM.contentId 79 contentDTO.objectId = this.messageModel.InteractMsubM.contentId
78 ProcessUtils.processPage(contentDTO) 80 ProcessUtils.processPage(contentDTO)
79 }) 81 })
  82 + }
80 }.padding({left:5,right:5}).alignItems(HorizontalAlign.Start).width('90%') 83 }.padding({left:5,right:5}).alignItems(HorizontalAlign.Start).width('90%')
81 }.padding({top:10,left:16,right:16}).width('100%').alignItems(VerticalAlign.Top) 84 }.padding({top:10,left:16,right:16}).width('100%').alignItems(VerticalAlign.Top)
82 } 85 }
@@ -102,4 +105,49 @@ export struct InteractMComponent { @@ -102,4 +105,49 @@ export struct InteractMComponent {
102 let contentString : string = this.messageModel.contentType === '207'?this.messageModel.message:this.messageModel.InteractMsubM.beReply; 105 let contentString : string = this.messageModel.contentType === '207'?this.messageModel.message:this.messageModel.InteractMsubM.beReply;
103 return contentString; 106 return contentString;
104 } 107 }
  108 +
  109 + getPublishTime(data:string,publishTime: string): string {
  110 + const publishTimestamp = parseInt(publishTime)
  111 + const currentTime = Date.now(); // 当前时间戳
  112 +
  113 + // 计算差异
  114 + const timeDifference = currentTime - publishTimestamp;
  115 +
  116 + // 转换为分钟、小时和天
  117 + const minutes = Math.floor(timeDifference / (1000 * 60));
  118 + const hours = Math.floor(timeDifference / (1000 * 60 * 60));
  119 + const days = Math.floor(timeDifference / (1000 * 60 * 60 * 24));
  120 +
  121 + // 根据时间差返回对应的字符串
  122 + let result: string;
  123 +
  124 + if (minutes < 60) {
  125 + result = `${minutes}分钟前`;
  126 + if (minutes === 0) {
  127 + result = `刚刚`;
  128 + }
  129 + } else if (hours < 24) {
  130 + result = `${hours}小时前`;
  131 + } else {
  132 + result = `${days}天前`;
  133 + if (days > 1) {
  134 + let arr = data.split(" ")
  135 + if (arr.length === 2) {
  136 + let arr2 = arr[0].split("-")
  137 + if (arr2.length === 3) {
  138 + result = `${arr2[1]}-${arr2[2]}`
  139 + }
  140 + } else {
  141 + //原始数据是时间戳 需要转成dateString
  142 + let time = DateTimeUtils.formatDate(Number(publishTime))
  143 + let arr = time.split("-")
  144 + if (arr.length === 3) {
  145 + result = `${arr[1]}-${arr[2]}`
  146 + }
  147 + }
  148 + }
  149 + }
  150 + console.log(result);
  151 + return result
  152 + }
105 } 153 }
@@ -20,6 +20,7 @@ export struct SpacialTopicPageComponent { @@ -20,6 +20,7 @@ export struct SpacialTopicPageComponent {
20 action: Action = {} as Action 20 action: Action = {} as Action
21 @State webUrl: string = ''; 21 @State webUrl: string = '';
22 @State isPageEnd: boolean = false 22 @State isPageEnd: boolean = false
  23 + @State reload: number = 0;
23 @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO 24 @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
24 private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean 25 private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean
25 private webPrepared = false; 26 private webPrepared = false;
@@ -101,6 +102,7 @@ export struct SpacialTopicPageComponent { @@ -101,6 +102,7 @@ export struct SpacialTopicPageComponent {
101 WdWebComponent({ 102 WdWebComponent({
102 webviewControl: this.webviewControl, 103 webviewControl: this.webviewControl,
103 webUrl: this.webUrl, 104 webUrl: this.webUrl,
  105 + reload: this.reload,
104 onWebPrepared: this.onWebPrepared.bind(this), 106 onWebPrepared: this.onWebPrepared.bind(this),
105 isPageEnd: $isPageEnd, 107 isPageEnd: $isPageEnd,
106 }) 108 })
@@ -136,6 +138,7 @@ export struct SpacialTopicPageComponent { @@ -136,6 +138,7 @@ export struct SpacialTopicPageComponent {
136 if (!this.action?.params?.backVisibility) { 138 if (!this.action?.params?.backVisibility) {
137 WindowModel.shared.setWindowLayoutFullScreen(true) 139 WindowModel.shared.setWindowLayoutFullScreen(true)
138 } 140 }
  141 + this.reload++
139 } 142 }
140 143
141 aboutToAppear() { 144 aboutToAppear() {
@@ -51,7 +51,7 @@ export struct Card10Component { @@ -51,7 +51,7 @@ export struct Card10Component {
51 } 51 }
52 } 52 }
53 .width(CommonConstants.FULL_WIDTH) 53 .width(CommonConstants.FULL_WIDTH)
54 - .fontSize($r('app.float.font_size_17')) 54 + .fontSize($r('app.float.font_size_18'))
55 .fontWeight(600) 55 .fontWeight(600)
56 .maxLines(2) 56 .maxLines(2)
57 .textOverflow({ overflow: TextOverflow.Ellipsis }) 57 .textOverflow({ overflow: TextOverflow.Ellipsis })
@@ -52,7 +52,7 @@ export struct Card11Component { @@ -52,7 +52,7 @@ export struct Card11Component {
52 Span(this.contentDTO.newsTitle) 52 Span(this.contentDTO.newsTitle)
53 } 53 }
54 } 54 }
55 - .fontSize($r("app.float.font_size_16")) 55 + .fontSize($r("app.float.font_size_18"))
56 .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222")) 56 .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222"))
57 .maxLines(3) 57 .maxLines(3)
58 .textOverflow({ overflow: TextOverflow.Ellipsis }) 58 .textOverflow({ overflow: TextOverflow.Ellipsis })
@@ -50,7 +50,7 @@ export struct Card12Component { @@ -50,7 +50,7 @@ export struct Card12Component {
50 Span(this.contentDTO.newsTitle) 50 Span(this.contentDTO.newsTitle)
51 } 51 }
52 } 52 }
53 - .fontSize($r('app.float.font_size_17')) 53 + .fontSize($r('app.float.font_size_18'))
54 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) 54 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222'))
55 .width(CommonConstants.FULL_WIDTH) 55 .width(CommonConstants.FULL_WIDTH)
56 .textOverflowStyle(3) 56 .textOverflowStyle(3)
@@ -54,7 +54,7 @@ export struct Card14Component { @@ -54,7 +54,7 @@ export struct Card14Component {
54 Span(this.contentDTO.newsTitle) 54 Span(this.contentDTO.newsTitle)
55 } 55 }
56 } 56 }
57 - .fontSize($r('app.float.font_size_17')) 57 + .fontSize($r('app.float.font_size_18'))
58 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) 58 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222'))
59 .textOverflowStyle(3) 59 .textOverflowStyle(3)
60 .lineHeight(25) 60 .lineHeight(25)
@@ -55,7 +55,7 @@ export struct Card15Component { @@ -55,7 +55,7 @@ export struct Card15Component {
55 Span(this.contentDTO.newsTitle) 55 Span(this.contentDTO.newsTitle)
56 } 56 }
57 } 57 }
58 - .fontSize($r('app.float.font_size_17')) 58 + .fontSize($r('app.float.font_size_18'))
59 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) 59 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222'))
60 .width(CommonConstants.FULL_WIDTH) 60 .width(CommonConstants.FULL_WIDTH)
61 .textOverflowStyle(2) 61 .textOverflowStyle(2)
@@ -58,7 +58,7 @@ export struct Card16Component { @@ -58,7 +58,7 @@ export struct Card16Component {
58 Span(this.contentDTO.newsTitle) 58 Span(this.contentDTO.newsTitle)
59 } 59 }
60 } 60 }
61 - .fontSize($r('app.float.font_size_17')) 61 + .fontSize($r('app.float.font_size_18'))
62 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) 62 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222'))
63 .width(CommonConstants.FULL_WIDTH) 63 .width(CommonConstants.FULL_WIDTH)
64 .textOverflowStyle(2) 64 .textOverflowStyle(2)
@@ -49,7 +49,7 @@ export struct Card17Component { @@ -49,7 +49,7 @@ export struct Card17Component {
49 } 49 }
50 } 50 }
51 .textOverflow({ overflow: TextOverflow.Ellipsis }) 51 .textOverflow({ overflow: TextOverflow.Ellipsis })
52 - .fontSize($r('app.float.font_size_17')) 52 + .fontSize($r('app.float.font_size_18'))
53 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) 53 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222'))
54 .lineHeight(25) 54 .lineHeight(25)
55 .maxLines(3) 55 .maxLines(3)
@@ -49,12 +49,12 @@ export struct Card19Component { @@ -49,12 +49,12 @@ export struct Card19Component {
49 Span(this.contentDTO.newsTitle) 49 Span(this.contentDTO.newsTitle)
50 } 50 }
51 } 51 }
52 - .fontSize($r('app.float.font_size_17')) 52 + .fontSize($r('app.float.font_size_18'))
53 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) 53 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222'))
54 .textOverflowStyle(3) 54 .textOverflowStyle(3)
55 .margin({ bottom: 8 }) 55 .margin({ bottom: 8 })
56 .width(CommonConstants.FULL_WIDTH) 56 .width(CommonConstants.FULL_WIDTH)
57 - .lineHeight(22) 57 + .lineHeight(25)
58 .onClick((event: ClickEvent) => { 58 .onClick((event: ClickEvent) => {
59 this.clicked = true; 59 this.clicked = true;
60 ProcessUtils.processPage(this.contentDTO) 60 ProcessUtils.processPage(this.contentDTO)
@@ -50,7 +50,7 @@ export struct Card20Component { @@ -50,7 +50,7 @@ export struct Card20Component {
50 Span(this.contentDTO.newsTitle) 50 Span(this.contentDTO.newsTitle)
51 } 51 }
52 } 52 }
53 - .fontSize($r('app.float.font_size_17')) 53 + .fontSize($r('app.float.font_size_18'))
54 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) 54 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222'))
55 .width(CommonConstants.FULL_WIDTH) 55 .width(CommonConstants.FULL_WIDTH)
56 .textOverflowStyle(3) 56 .textOverflowStyle(3)
@@ -52,7 +52,7 @@ export struct Card21Component { @@ -52,7 +52,7 @@ export struct Card21Component {
52 Span(this.contentDTO.newsTitle) 52 Span(this.contentDTO.newsTitle)
53 } 53 }
54 } 54 }
55 - .fontSize($r('app.float.selected_text_size')) 55 + .fontSize(18)
56 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) 56 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222'))
57 .width(CommonConstants.FULL_WIDTH) 57 .width(CommonConstants.FULL_WIDTH)
58 .maxLines(4) 58 .maxLines(4)
@@ -63,7 +63,7 @@ export struct Card2Component { @@ -63,7 +63,7 @@ export struct Card2Component {
63 Span(this.contentDTO.newsTitle) 63 Span(this.contentDTO.newsTitle)
64 } 64 }
65 } 65 }
66 - .fontSize($r('app.float.font_size_17')) 66 + .fontSize($r('app.float.font_size_18'))
67 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) 67 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222'))
68 .maxLines(2) 68 .maxLines(2)
69 .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 69 .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
@@ -50,7 +50,7 @@ export struct Card3Component { @@ -50,7 +50,7 @@ export struct Card3Component {
50 Span(this.contentDTO.newsTitle) 50 Span(this.contentDTO.newsTitle)
51 } 51 }
52 } 52 }
53 - .fontSize($r("app.float.font_size_16")) 53 + .fontSize($r("app.float.font_size_18"))
54 .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222")) 54 .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222"))
55 .width(CommonConstants.FULL_WIDTH) 55 .width(CommonConstants.FULL_WIDTH)
56 .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 : 56 .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 :
@@ -54,7 +54,7 @@ export struct Card4Component { @@ -54,7 +54,7 @@ export struct Card4Component {
54 Span(this.contentDTO.newsTitle) 54 Span(this.contentDTO.newsTitle)
55 } 55 }
56 } 56 }
57 - .fontSize($r('app.float.font_size_17')) 57 + .fontSize($r('app.float.font_size_18'))
58 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) 58 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222'))
59 .maxLines(3) 59 .maxLines(3)
60 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 60 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
@@ -71,7 +71,7 @@ export struct Card5Component { @@ -71,7 +71,7 @@ export struct Card5Component {
71 } 71 }
72 .width(CommonConstants.FULL_WIDTH) 72 .width(CommonConstants.FULL_WIDTH)
73 .fontColor(Color.White) 73 .fontColor(Color.White)
74 - .fontSize($r('app.float.font_size_17')) 74 + .fontSize($r('app.float.font_size_18'))
75 .fontWeight(FontWeight.Bold) 75 .fontWeight(FontWeight.Bold)
76 .maxLines(2) 76 .maxLines(2)
77 .align(Alignment.TopStart) 77 .align(Alignment.TopStart)
@@ -70,7 +70,7 @@ export struct Card6Component { @@ -70,7 +70,7 @@ export struct Card6Component {
70 } 70 }
71 } 71 }
72 .fontColor(this.clicked ? 0x848484 : 0x222222) 72 .fontColor(this.clicked ? 0x848484 : 0x222222)
73 - .fontSize(16) 73 + .fontSize(18)
74 .lineHeight(24) 74 .lineHeight(24)
75 .fontWeight(FontWeight.Normal) 75 .fontWeight(FontWeight.Normal)
76 .maxLines(3) 76 .maxLines(3)
@@ -50,7 +50,7 @@ export struct Card9Component { @@ -50,7 +50,7 @@ export struct Card9Component {
50 } 50 }
51 .fontColor(this.clicked ? 0x848484 : 0x222222) 51 .fontColor(this.clicked ? 0x848484 : 0x222222)
52 .width(CommonConstants.FULL_WIDTH) 52 .width(CommonConstants.FULL_WIDTH)
53 - .fontSize($r('app.float.font_size_17')) 53 + .fontSize($r('app.float.font_size_18'))
54 .fontWeight(600) 54 .fontWeight(600)
55 .maxLines(2) 55 .maxLines(2)
56 .textOverflow({ overflow: TextOverflow.Ellipsis }) 56 .textOverflow({ overflow: TextOverflow.Ellipsis })
@@ -36,7 +36,7 @@ export struct SearchContentComponent { @@ -36,7 +36,7 @@ export struct SearchContentComponent {
36 Column() { 36 Column() {
37 //新闻标题 37 //新闻标题
38 Text(this.contentDTO.newsTitle) 38 Text(this.contentDTO.newsTitle)
39 - .fontSize($r('app.float.font_size_17')) 39 + .fontSize($r('app.float.font_size_18'))
40 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) 40 .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222'))
41 .maxLines(3) 41 .maxLines(3)
42 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 42 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
@@ -38,20 +38,19 @@ export struct QualityCommentsComponent { @@ -38,20 +38,19 @@ export struct QualityCommentsComponent {
38 38
39 39
40 aboutToDisappear(): void { 40 aboutToDisappear(): void {
41 -  
42 - const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage  
43 - const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口  
44 - windowClass.setWindowBackgroundColor(this.lastWindowColor)  
45 - windowClass.setWindowLayoutFullScreen(false)  
46 // windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' }) 41 // windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' })
47 -  
48 this.dialogController = null // 将dialogController置空 42 this.dialogController = null // 将dialogController置空
  43 + }
49 44
  45 + onPageShow(): void {
  46 + WindowModel.shared.setWindowLayoutFullScreen(true)
50 } 47 }
51 48
52 - aboutToAppear(): void { 49 + onPageHide(): void {
  50 + WindowModel.shared.setWindowLayoutFullScreen(false)
  51 + }
53 52
54 - this.fullScreen(); 53 + aboutToAppear(): void {
55 this.getData(); 54 this.getData();
56 this.showAlert() 55 this.showAlert()
57 } 56 }
@@ -100,13 +99,6 @@ export struct QualityCommentsComponent { @@ -100,13 +99,6 @@ export struct QualityCommentsComponent {
100 }) 99 })
101 } 100 }
102 101
103 - fullScreen() {  
104 - const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage  
105 - const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口  
106 - windowClass.setWindowLayoutFullScreen(true)  
107 -  
108 - }  
109 -  
110 @Builder 102 @Builder
111 titleHeader() { 103 titleHeader() {
112 Row() { 104 Row() {
@@ -249,7 +241,7 @@ export struct QualityCommentsComponent { @@ -249,7 +241,7 @@ export struct QualityCommentsComponent {
249 } 241 }
250 // ListItem() { 242 // ListItem() {
251 // 243 //
252 - // }.height(this.bottomSafeHeight) 244 + // }.height(`${this.bottomSafeHeight}` + 'px')
253 }.onReachEnd(()=>{ 245 }.onReachEnd(()=>{
254 this.currentPage++ 246 this.currentPage++
255 this.getData() 247 this.getData()
@@ -208,7 +208,7 @@ struct CarouselLayout01CardView { @@ -208,7 +208,7 @@ struct CarouselLayout01CardView {
208 Text(`${this.item.corner}${this.item.newsTitle}`) 208 Text(`${this.item.corner}${this.item.newsTitle}`)
209 .width(CommonConstants.FULL_PARENT) 209 .width(CommonConstants.FULL_PARENT)
210 .fontColor(Color.White) 210 .fontColor(Color.White)
211 - .fontSize($r('app.float.font_size_16')) 211 + .fontSize($r('app.float.font_size_18'))
212 .fontWeight(FontWeight.Medium) 212 .fontWeight(FontWeight.Medium)
213 .textAlign(TextAlign.Start) 213 .textAlign(TextAlign.Start)
214 .align(Alignment.Bottom) 214 .align(Alignment.Bottom)
@@ -57,7 +57,7 @@ export struct ZhSingleColumn04 { @@ -57,7 +57,7 @@ export struct ZhSingleColumn04 {
57 .width(12) 57 .width(12)
58 .margin({ left: 12, right: 8 }) 58 .margin({ left: 12, right: 8 })
59 Text(item.newsTitle) 59 Text(item.newsTitle)
60 - .fontSizeColorWeight($r('app.float.font_size_17'), $r('app.color.color_222222'), 400) 60 + .fontSizeColorWeight($r('app.float.font_size_18'), $r('app.color.color_222222'), 400)
61 .maxLines(1) 61 .maxLines(1)
62 .textOverflow({ overflow: TextOverflow.Ellipsis }) 62 .textOverflow({ overflow: TextOverflow.Ellipsis })
63 .layoutWeight(1) 63 .layoutWeight(1)
@@ -101,7 +101,7 @@ struct localCard { @@ -101,7 +101,7 @@ struct localCard {
101 Text(this.operDataListItem.newsTitle) 101 Text(this.operDataListItem.newsTitle)
102 .width(CommonConstants.FULL_PARENT) 102 .width(CommonConstants.FULL_PARENT)
103 .height(CommonConstants.FULL_PARENT) 103 .height(CommonConstants.FULL_PARENT)
104 - .fontSize($r('app.float.font_size_16')) 104 + .fontSize($r('app.float.font_size_18'))
105 .fontColor('#000000') 105 .fontColor('#000000')
106 .align(Alignment.TopStart) 106 .align(Alignment.TopStart)
107 .maxLines(3) 107 .maxLines(3)
@@ -7,6 +7,7 @@ import { EmptyComponent } from '../../view/EmptyComponent'; @@ -7,6 +7,7 @@ import { EmptyComponent } from '../../view/EmptyComponent';
7 import { ChildCommentComponent } from './ChildCommentComponent'; 7 import { ChildCommentComponent } from './ChildCommentComponent';
8 import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDetailItem'; 8 import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDetailItem';
9 import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem'; 9 import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem';
  10 +import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
10 11
11 const TAG = "HomePageBottomCommentComponent" 12 const TAG = "HomePageBottomCommentComponent"
12 13
@@ -22,6 +23,7 @@ export struct HomePageBottomCommentComponent { @@ -22,6 +23,7 @@ export struct HomePageBottomCommentComponent {
22 @State count: number = 0; 23 @State count: number = 0;
23 @Link commentNum: number 24 @Link commentNum: number
24 @State isGetRequest: boolean = false 25 @State isGetRequest: boolean = false
  26 + private scroller: Scroller = new Scroller();
25 27
26 aboutToAppear() { 28 aboutToAppear() {
27 this.getNewPageData() 29 this.getNewPageData()
@@ -42,7 +44,40 @@ export struct HomePageBottomCommentComponent { @@ -42,7 +44,40 @@ export struct HomePageBottomCommentComponent {
42 .offset({ y: "-200lpx" }) 44 .offset({ y: "-200lpx" })
43 } 45 }
44 } else { 46 } else {
45 - List({ space: 3 }) { 47 + CustomPullToRefresh({
  48 + alldata:this.data_comment,
  49 + scroller:this.scroller,
  50 + customList:()=>{
  51 + this.ListLayout()
  52 + },
  53 + onRefresh:(resolve)=>{
  54 + this.curPageNum = 1;
  55 + this.hasMore = true
  56 + this.isGetRequest = false
  57 + this.data_comment.clear()
  58 +
  59 + if (!this.isLoading){
  60 + this.getNewPageData()
  61 + if(resolve) resolve('刷新成功')
  62 + }
  63 + },
  64 + onLoadMore:(resolve)=> {
  65 + console.log(TAG, "触底了");
  66 + if (!this.isLoading) {
  67 + this.isLoading = true
  68 + //加载分页数据
  69 + this.getNewPageData()
  70 + }
  71 + }
  72 + })
  73 + }
  74 + }.layoutWeight(1)
  75 + .justifyContent(FlexAlign.Start)
  76 + .width('100%')
  77 + }
  78 +
  79 + @Builder ListLayout(){
  80 + List({ space: 3,scroller: this.scroller }) {
46 LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => { 81 LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => {
47 ListItem() { 82 ListItem() {
48 ChildCommentComponent({ 83 ChildCommentComponent({
@@ -68,18 +103,6 @@ export struct HomePageBottomCommentComponent { @@ -68,18 +103,6 @@ export struct HomePageBottomCommentComponent {
68 scrollForward: NestedScrollMode.PARENT_FIRST, 103 scrollForward: NestedScrollMode.PARENT_FIRST,
69 scrollBackward: NestedScrollMode.SELF_FIRST 104 scrollBackward: NestedScrollMode.SELF_FIRST
70 }) 105 })
71 - .onReachEnd(() => {  
72 - console.log(TAG, "触底了");  
73 - if (!this.isLoading) {  
74 - this.isLoading = true  
75 - //加载分页数据  
76 - this.getNewPageData()  
77 - }  
78 - })  
79 - }  
80 - }.layoutWeight(1)  
81 - .justifyContent(FlexAlign.Start)  
82 - .width('100%')  
83 } 106 }
84 107
85 getNewPageData() { 108 getNewPageData() {
@@ -7,6 +7,7 @@ import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; @@ -7,6 +7,7 @@ import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI';
7 import { FollowChildComponent } from '../follow/FollowChildComponent'; 7 import { FollowChildComponent } from '../follow/FollowChildComponent';
8 import dataPreferences from '@ohos.data.preferences'; 8 import dataPreferences from '@ohos.data.preferences';
9 import { EmptyComponent } from '../../view/EmptyComponent'; 9 import { EmptyComponent } from '../../view/EmptyComponent';
  10 +import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
10 11
11 const TAG = "HomePageBottomFollowComponent" 12 const TAG = "HomePageBottomFollowComponent"
12 /** 13 /**
@@ -14,6 +15,7 @@ const TAG = "HomePageBottomFollowComponent" @@ -14,6 +15,7 @@ const TAG = "HomePageBottomFollowComponent"
14 */ 15 */
15 @Component 16 @Component
16 export struct HomePageBottomFollowComponent { 17 export struct HomePageBottomFollowComponent {
  18 + private scroller: Scroller = new Scroller();
17 @State data_follow: LazyDataSource<FollowListDetailItem> = new LazyDataSource(); 19 @State data_follow: LazyDataSource<FollowListDetailItem> = new LazyDataSource();
18 @State isLoading: boolean = false 20 @State isLoading: boolean = false
19 @State hasMore: boolean = true 21 @State hasMore: boolean = true
@@ -104,8 +106,40 @@ export struct HomePageBottomFollowComponent { @@ -104,8 +106,40 @@ export struct HomePageBottomFollowComponent {
104 }) 106 })
105 }.layoutWeight(1) 107 }.layoutWeight(1)
106 } else { 108 } else {
107 - List({ space: 3 }) { 109 + CustomPullToRefresh({
  110 + alldata:this.data_follow,
  111 + scroller:this.scroller,
  112 + customList:()=>{
  113 + this.ListLayout()
  114 + },
  115 + onRefresh:(resolve)=>{
  116 + this.curPageNum = 1;
  117 + this.hasMore = true
  118 + this.isGetRequest = false
  119 + this.data_follow.clear()
  120 +
  121 + if (!this.isLoading){
  122 + this.getNewPageData()
  123 + if(resolve) resolve('刷新成功')
  124 + }
  125 + },
  126 + onLoadMore:(resolve)=> {
  127 + console.log(TAG, "触底了");
  128 + if (!this.isLoading) {
  129 + this.isLoading = true
  130 + //加载分页数据
  131 + this.getNewPageData()
  132 + }
  133 + }
  134 + })
  135 + }
  136 + }.layoutWeight(1)
  137 + .justifyContent(FlexAlign.Start)
  138 + .width('100%')
  139 + }
108 140
  141 + @Builder ListLayout(){
  142 + List({ space: 3 ,scroller:this.scroller}) {
109 ListItem() { 143 ListItem() {
110 Row() { 144 Row() {
111 Text("关注更多人民号") 145 Text("关注更多人民号")
@@ -136,7 +170,6 @@ export struct HomePageBottomFollowComponent { @@ -136,7 +170,6 @@ export struct HomePageBottomFollowComponent {
136 FollowChildComponent({ data: item, type: 2 }) 170 FollowChildComponent({ data: item, type: 2 })
137 } 171 }
138 }, (item: FollowListDetailItem, index: number) => index.toString()) 172 }, (item: FollowListDetailItem, index: number) => index.toString())
139 -  
140 //没有更多数据 显示提示 173 //没有更多数据 显示提示
141 if (!this.hasMore) { 174 if (!this.hasMore) {
142 ListItem() { 175 ListItem() {
@@ -153,18 +186,6 @@ export struct HomePageBottomFollowComponent { @@ -153,18 +186,6 @@ export struct HomePageBottomFollowComponent {
153 scrollForward: NestedScrollMode.PARENT_FIRST, 186 scrollForward: NestedScrollMode.PARENT_FIRST,
154 scrollBackward: NestedScrollMode.SELF_FIRST 187 scrollBackward: NestedScrollMode.SELF_FIRST
155 }) 188 })
156 - .onReachEnd(() => {  
157 - console.log(TAG, "触底了");  
158 - if (!this.isLoading) {  
159 - this.isLoading = true  
160 - //加载分页数据  
161 - this.getNewPageData()  
162 - }  
163 - })  
164 - }  
165 - }.layoutWeight(1)  
166 - .justifyContent(FlexAlign.Start)  
167 - .width('100%')  
168 } 189 }
169 190
170 @Styles 191 @Styles
@@ -7,6 +7,7 @@ import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDet @@ -7,6 +7,7 @@ import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDet
7 import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem'; 7 import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem';
8 import { ChildCommentComponent } from './ChildCommentComponent'; 8 import { ChildCommentComponent } from './ChildCommentComponent';
9 import { EmptyComponent } from '../../view/EmptyComponent'; 9 import { EmptyComponent } from '../../view/EmptyComponent';
  10 +import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
10 11
11 const TAG = "HomePageBottomComponent" 12 const TAG = "HomePageBottomComponent"
12 /** 13 /**
@@ -23,6 +24,8 @@ export struct OtherHomePageBottomCommentComponent { @@ -23,6 +24,8 @@ export struct OtherHomePageBottomCommentComponent {
23 @Prop levelHead: string 24 @Prop levelHead: string
24 @Link commentNum: number 25 @Link commentNum: number
25 @State isGetRequest: boolean = false 26 @State isGetRequest: boolean = false
  27 + private scroller: Scroller = new Scroller();
  28 +
26 29
27 aboutToAppear() { 30 aboutToAppear() {
28 this.getNewPageData() 31 this.getNewPageData()
@@ -41,7 +44,41 @@ export struct OtherHomePageBottomCommentComponent { @@ -41,7 +44,41 @@ export struct OtherHomePageBottomCommentComponent {
41 .layoutWeight(1) 44 .layoutWeight(1)
42 } 45 }
43 } else { 46 } else {
44 - List({ space: 3 }) { 47 + CustomPullToRefresh({
  48 + alldata:this.data_comment,
  49 + scroller:this.scroller,
  50 + customList:()=>{
  51 + this.ListLayout()
  52 + },
  53 + onRefresh:(resolve)=>{
  54 + this.curPageNum = 1;
  55 + this.hasMore = true
  56 + this.isGetRequest = false
  57 + this.data_comment.clear()
  58 +
  59 + if (!this.isLoading){
  60 + this.getNewPageData()
  61 + if(resolve) resolve('刷新成功')
  62 + }
  63 + },
  64 + onLoadMore:(resolve)=> {
  65 + console.log(TAG, "触底了");
  66 + if (!this.isLoading) {
  67 + this.isLoading = true
  68 + //加载分页数据
  69 + this.getNewPageData()
  70 + }
  71 + }
  72 + })
  73 + }
  74 + }
  75 + .width('100%')
  76 + .layoutWeight(1)
  77 + .justifyContent(FlexAlign.Start)
  78 + }
  79 +
  80 + @Builder ListLayout(){
  81 + List({ space: 3 ,scroller: this.scroller}) {
45 LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => { 82 LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => {
46 ListItem() { 83 ListItem() {
47 ChildCommentComponent({ 84 ChildCommentComponent({
@@ -50,8 +87,6 @@ export struct OtherHomePageBottomCommentComponent { @@ -50,8 +87,6 @@ export struct OtherHomePageBottomCommentComponent {
50 isLastItem: index === this.data_comment.totalCount() - 1 87 isLastItem: index === this.data_comment.totalCount() - 1
51 }) 88 })
52 } 89 }
53 - .onClick(() => {  
54 - })  
55 }, (item: CommentListItem, index: number) => index.toString()) 90 }, (item: CommentListItem, index: number) => index.toString())
56 91
57 //没有更多数据 显示提示 92 //没有更多数据 显示提示
@@ -69,19 +104,6 @@ export struct OtherHomePageBottomCommentComponent { @@ -69,19 +104,6 @@ export struct OtherHomePageBottomCommentComponent {
69 scrollForward: NestedScrollMode.PARENT_FIRST, 104 scrollForward: NestedScrollMode.PARENT_FIRST,
70 scrollBackward: NestedScrollMode.SELF_FIRST 105 scrollBackward: NestedScrollMode.SELF_FIRST
71 }) 106 })
72 - .onReachEnd(() => {  
73 - console.log(TAG, "触底了");  
74 - if (!this.isLoading) {  
75 - this.isLoading = true  
76 - //加载分页数据  
77 - this.getNewPageData()  
78 - }  
79 - })  
80 - }  
81 - }  
82 - .width('100%')  
83 - .layoutWeight(1)  
84 - .justifyContent(FlexAlign.Start)  
85 } 107 }
86 108
87 @Styles 109 @Styles
@@ -4,6 +4,7 @@ import { WDRouterRule, WDRouterPage } from 'wdRouter'; @@ -4,6 +4,7 @@ import { WDRouterRule, WDRouterPage } from 'wdRouter';
4 import MinePageDatasModel from '../../../model/MinePageDatasModel'; 4 import MinePageDatasModel from '../../../model/MinePageDatasModel';
5 import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; 5 import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem';
6 import { UserFollowListRequestItem } from '../../../viewmodel/UserFollowListRequestItem'; 6 import { UserFollowListRequestItem } from '../../../viewmodel/UserFollowListRequestItem';
  7 +import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
7 import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; 8 import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI';
8 import { EmptyComponent } from '../../view/EmptyComponent'; 9 import { EmptyComponent } from '../../view/EmptyComponent';
9 import { FollowChildComponent } from '../follow/FollowChildComponent'; 10 import { FollowChildComponent } from '../follow/FollowChildComponent';
@@ -22,7 +23,7 @@ export struct OtherHomePageBottomFollowComponent{ @@ -22,7 +23,7 @@ export struct OtherHomePageBottomFollowComponent{
22 @State count:number = 0; 23 @State count:number = 0;
23 @Prop curUserId: string 24 @Prop curUserId: string
24 @State isGetRequest:boolean = false 25 @State isGetRequest:boolean = false
25 - 26 + private scroller: Scroller = new Scroller();
26 27
27 aboutToAppear(){ 28 aboutToAppear(){
28 this.getNewPageData() 29 this.getNewPageData()
@@ -66,8 +67,39 @@ export struct OtherHomePageBottomFollowComponent{ @@ -66,8 +67,39 @@ export struct OtherHomePageBottomFollowComponent{
66 }.layoutWeight(1) 67 }.layoutWeight(1)
67 .justifyContent(FlexAlign.Start) 68 .justifyContent(FlexAlign.Start)
68 }else{ 69 }else{
69 - List({ space: 3 }) { 70 + CustomPullToRefresh({
  71 + alldata:this.data_follow,
  72 + scroller:this.scroller,
  73 + customList:()=>{
  74 + this.ListLayout()
  75 + },
  76 + onRefresh:(resolve)=>{
  77 + this.curPageNum = 1;
  78 + this.hasMore = true
  79 + this.isGetRequest = false
  80 + this.data_follow.clear()
70 81
  82 + if (!this.isLoading){
  83 + this.getNewPageData()
  84 + if(resolve) resolve('刷新成功')
  85 + }
  86 + },
  87 + onLoadMore:(resolve)=> {
  88 + console.log(TAG, "触底了");
  89 + if (!this.isLoading) {
  90 + this.isLoading = true
  91 + //加载分页数据
  92 + this.getNewPageData()
  93 + }
  94 + }
  95 + })
  96 + }
  97 + }
  98 + .width('100%')
  99 + }
  100 +
  101 + @Builder ListLayout(){
  102 + List({ space: 3 ,scroller:this.scroller}) {
71 ListItem() { 103 ListItem() {
72 Row(){ 104 Row(){
73 Text("关注更多人民号") 105 Text("关注更多人民号")
@@ -115,19 +147,7 @@ export struct OtherHomePageBottomFollowComponent{ @@ -115,19 +147,7 @@ export struct OtherHomePageBottomFollowComponent{
115 scrollForward: NestedScrollMode.PARENT_FIRST, 147 scrollForward: NestedScrollMode.PARENT_FIRST,
116 scrollBackward: NestedScrollMode.SELF_FIRST 148 scrollBackward: NestedScrollMode.SELF_FIRST
117 }) 149 })
118 - .onReachEnd(()=>{  
119 - console.log(TAG,"触底了");  
120 - if(!this.isLoading){  
121 - this.isLoading = true  
122 - //加载分页数据  
123 - this.getNewPageData()  
124 } 150 }
125 - })  
126 - }  
127 - }  
128 - .width('100%')  
129 - }  
130 -  
131 151
132 @Styles 152 @Styles
133 listStyle() { 153 listStyle() {
@@ -31,21 +31,26 @@ struct InteractMessagePage { @@ -31,21 +31,26 @@ struct InteractMessagePage {
31 if(this.browSingModel.viewType == ViewType.ERROR){ 31 if(this.browSingModel.viewType == ViewType.ERROR){
32 EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NetworkFailed}) 32 EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NetworkFailed})
33 }else if(this.browSingModel.viewType == ViewType.EMPTY){ 33 }else if(this.browSingModel.viewType == ViewType.EMPTY){
34 - EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoHistory}) 34 + EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoMessage})
35 }else { 35 }else {
36 CustomPullToRefresh({ 36 CustomPullToRefresh({
37 alldata:this.allDatas, 37 alldata:this.allDatas,
38 scroller:this.scroller, 38 scroller:this.scroller,
  39 + hasMore:this.browSingModel.hasMore,
39 customList:()=>{ 40 customList:()=>{
40 this.ListLayout() 41 this.ListLayout()
41 }, 42 },
42 onRefresh:(resolve)=>{ 43 onRefresh:(resolve)=>{
43 - this.browSingModel.currentPage = 0 44 + this.currentPage = 1
44 this.getData(resolve) 45 this.getData(resolve)
45 }, 46 },
46 onLoadMore:(resolve)=> { 47 onLoadMore:(resolve)=> {
47 - this.browSingModel.currentPage++  
48 - this.getData() 48 + if (this.browSingModel.hasMore === false) {
  49 + if(resolve) resolve('')
  50 + return
  51 + }
  52 + this.currentPage++
  53 + this.getData(resolve)
49 } 54 }
50 }) 55 })
51 } 56 }
@@ -75,6 +80,7 @@ struct InteractMessagePage { @@ -75,6 +80,7 @@ struct InteractMessagePage {
75 } 80 }
76 } 81 }
77 } 82 }
  83 + .scrollBar(BarState.Off)
78 .height(CommonConstants.FULL_PARENT) 84 .height(CommonConstants.FULL_PARENT)
79 .edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果 85 .edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果
80 } 86 }
@@ -120,18 +126,19 @@ struct InteractMessagePage { @@ -120,18 +126,19 @@ struct InteractMessagePage {
120 for (let index = 0; index < InteractMessageMItem.list.length; index++) { 126 for (let index = 0; index < InteractMessageMItem.list.length; index++) {
121 const element = InteractMessageMItem.list[index]; 127 const element = InteractMessageMItem.list[index];
122 element.InteractMsubM = JSON.parse(element.remark) 128 element.InteractMsubM = JSON.parse(element.remark)
  129 + this.allDatas.push(element)
123 } 130 }
124 131
125 - this.allDatas.push(...InteractMessageMItem.list)  
126 - if (InteractMessageMItem.list.length === this.browSingModel.pageSize) {  
127 - this.browSingModel.currentPage++;  
128 - this.browSingModel.hasMore = true;  
129 - } else { 132 + if (InteractMessageMItem.hasNext === 0) {
130 this.browSingModel.hasMore = false; 133 this.browSingModel.hasMore = false;
  134 + } else {
  135 + this.browSingModel.hasMore = true;
131 } 136 }
132 } else { 137 } else {
  138 + if (this.currentPage === 1) {
133 this.browSingModel.viewType = ViewType.EMPTY; 139 this.browSingModel.viewType = ViewType.EMPTY;
134 } 140 }
  141 + }
135 }) 142 })
136 } 143 }
137 144
@@ -46,7 +46,7 @@ struct MyCollectionListPage { @@ -46,7 +46,7 @@ struct MyCollectionListPage {
46 46
47 build() { 47 build() {
48 Column(){ 48 Column(){
49 - CustomTitleAndEditUI({titleName:'我的收藏',isDisplayButton:true,editCallback:()=>{ 49 + CustomTitleAndEditUI({titleName:'我的收藏',isDisplayButton:this.browSingModel.viewType == ViewType.ERROR || this.browSingModel.viewType == ViewType.EMPTY?false:true,editCallback:()=>{
50 this.allSelectDatas(false) 50 this.allSelectDatas(false)
51 this.isAllSelect = false 51 this.isAllSelect = false
52 this.selectDatas = [] 52 this.selectDatas = []
@@ -114,6 +114,7 @@ struct MyCollectionListPage { @@ -114,6 +114,7 @@ struct MyCollectionListPage {
114 if (this.browSingModel.hasMore === false) NoMoreLayout() 114 if (this.browSingModel.hasMore === false) NoMoreLayout()
115 } 115 }
116 } 116 }
  117 + .scrollBar(BarState.Off)
117 .height(CommonConstants.FULL_PARENT) 118 .height(CommonConstants.FULL_PARENT)
118 .edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果 119 .edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果
119 } 120 }
1 import router from '@ohos.router' 1 import router from '@ohos.router'
2 -import { StringUtils, ToastUtils } from 'wdKit' 2 +import { NetworkUtil, StringUtils, ToastUtils } from 'wdKit'
3 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' 3 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
4 import { SearchHistoryItem } from '../../viewmodel/SearchHistoryItem' 4 import { SearchHistoryItem } from '../../viewmodel/SearchHistoryItem'
5 import { SearchRelatedItem } from '../../viewmodel/SearchRelatedItem' 5 import { SearchRelatedItem } from '../../viewmodel/SearchRelatedItem'
  6 +import { EmptyComponent } from '../view/EmptyComponent'
6 import { SearchHistoryComponent } from './SearchHistoryComponent' 7 import { SearchHistoryComponent } from './SearchHistoryComponent'
7 import { SearchHotsComponent } from './SearchHotsComponent' 8 import { SearchHotsComponent } from './SearchHotsComponent'
8 import { SearchRelatedComponent } from './SearchRelatedComponent' 9 import { SearchRelatedComponent } from './SearchRelatedComponent'
@@ -30,6 +31,7 @@ export struct SearchComponent { @@ -30,6 +31,7 @@ export struct SearchComponent {
30 scroller: Scroller = new Scroller() 31 scroller: Scroller = new Scroller()
31 @State count:string[] = [] 32 @State count:string[] = []
32 @State isGetRequest:boolean = false; 33 @State isGetRequest:boolean = false;
  34 + @State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
33 35
34 aboutToAppear() { 36 aboutToAppear() {
35 //获取提示滚动 37 //获取提示滚动
@@ -127,8 +129,16 @@ export struct SearchComponent { @@ -127,8 +129,16 @@ export struct SearchComponent {
127 .padding({ left: '31lpx', right: '31lpx' }) 129 .padding({ left: '31lpx', right: '31lpx' })
128 } else { 130 } else {
129 if (this.hasChooseSearch) { 131 if (this.hasChooseSearch) {
  132 + if(!this.isConnectNetwork){
  133 + EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
  134 + this.getSearchInputResData(this.searchText)
  135 + }})
  136 + .layoutWeight(1)
  137 + .width('100%')
  138 + }else{
130 //搜索结果 139 //搜索结果
131 SearchResultComponent({count:this.count,searchText:this.searchText,isGetRequest:this.isGetRequest}) 140 SearchResultComponent({count:this.count,searchText:this.searchText,isGetRequest:this.isGetRequest})
  141 + }
132 } else { 142 } else {
133 //联想搜索 143 //联想搜索
134 SearchRelatedComponent({relatedSearchContentData:$relatedSearchContentsData,onGetSearchRes: (item): void => this.getSearchRelatedResData(item),searchText:this.searchText}) 144 SearchRelatedComponent({relatedSearchContentData:$relatedSearchContentsData,onGetSearchRes: (item): void => this.getSearchRelatedResData(item),searchText:this.searchText})
@@ -138,7 +148,6 @@ export struct SearchComponent { @@ -138,7 +148,6 @@ export struct SearchComponent {
138 .width('100%') 148 .width('100%')
139 } 149 }
140 150
141 -  
142 /** 151 /**
143 * 点击搜索记录列表回调 152 * 点击搜索记录列表回调
144 * @param content 153 * @param content
@@ -330,10 +339,12 @@ export struct SearchComponent { @@ -330,10 +339,12 @@ export struct SearchComponent {
330 } 339 }
331 this.isGetRequest = true 340 this.isGetRequest = true
332 this.resetSearch() 341 this.resetSearch()
  342 + this.isConnectNetwork = NetworkUtil.isNetConnected()
333 }).catch((err: Error) => { 343 }).catch((err: Error) => {
334 console.log(TAG, JSON.stringify(err)) 344 console.log(TAG, JSON.stringify(err))
335 this.isGetRequest = true 345 this.isGetRequest = true
336 this.resetSearch() 346 this.resetSearch()
  347 + this.isConnectNetwork = NetworkUtil.isNetConnected()
337 }) 348 })
338 } 349 }
339 350
@@ -19,7 +19,7 @@ export struct BigPicCardComponent { @@ -19,7 +19,7 @@ export struct BigPicCardComponent {
19 19
20 aboutToAppear() { 20 aboutToAppear() {
21 // 取第一个数据 21 // 取第一个数据
22 - if (this.compDTO.operDataList) { 22 + if (this.compDTO.operDataList.length > 0) {
23 this.contentDTO = this.compDTO.operDataList[0]; 23 this.contentDTO = this.compDTO.operDataList[0];
24 this.contentDTO.appStyle = "2"; 24 this.contentDTO.appStyle = "2";
25 } 25 }