wangliang_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  底导tab宽度修改,扩大点击响应热区
  ref |> 图文详情页 适配全屏
  fix:bug[17637] 编辑简介区域鸿蒙与安卓区域大小不一致
  fix: 1、读报纸,滑到底部,继续上滑,缺少向上并回弹的效果
  fix:bug[18286]  【UAT】【搜索】根据稿件名称搜索到结果后,再次点击搜索按钮,不能触发搜索
@@ -32,7 +32,7 @@ export struct ENewspaperPageComponent { @@ -32,7 +32,7 @@ export struct ENewspaperPageComponent {
32 @State swiperIndex: number = 0; 32 @State swiperIndex: number = 0;
33 //当前选择的日期标记 33 //当前选择的日期标记
34 @State selectDate: Date = new Date() 34 @State selectDate: Date = new Date()
35 - @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 35 + @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
36 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 36 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
37 @State ratio: string = '100%' 37 @State ratio: string = '100%'
38 @State toastText: ResourceStr = "" 38 @State toastText: ResourceStr = ""
@@ -280,12 +280,13 @@ export struct ENewspaperPageComponent { @@ -280,12 +280,13 @@ export struct ENewspaperPageComponent {
280 this.swiperIndex = index 280 this.swiperIndex = index
281 }) 281 })
282 282
  283 + Row() {
283 Image($r('app.media.newspaper_shadow')) 284 Image($r('app.media.newspaper_shadow'))
284 .height($r('app.float.vp_12')) 285 .height($r('app.float.vp_12'))
285 .width('100%') 286 .width('100%')
286 - .margin({ left: 10, right: 10, top: -1 })  
287 .objectFit(ImageFit.Contain) 287 .objectFit(ImageFit.Contain)
288 - .alignRules({ 288 +
  289 + }.margin({ top: -1,left: 10, right: 10 }).alignRules({
289 top: { anchor: "e_newspaper_content", align: VerticalAlign.Bottom }, 290 top: { anchor: "e_newspaper_content", align: VerticalAlign.Bottom },
290 // left: { anchor: 'e_newspaper_content', align: HorizontalAlign.Start }, 291 // left: { anchor: 'e_newspaper_content', align: HorizontalAlign.Start },
291 // right: { anchor: 'e_newspaper_content', align: HorizontalAlign.End } 292 // right: { anchor: 'e_newspaper_content', align: HorizontalAlign.End }
@@ -407,7 +408,7 @@ export struct ENewspaperPageComponent { @@ -407,7 +408,7 @@ export struct ENewspaperPageComponent {
407 .width('100%') 408 .width('100%')
408 .height('100%') 409 .height('100%')
409 .backgroundColor($r('app.color.color_80000000')) 410 .backgroundColor($r('app.color.color_80000000'))
410 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) 411 + // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
411 .id('e_newspaper_container') 412 .id('e_newspaper_container')
412 413
413 if (this.isOpenListDialog) { 414 if (this.isOpenListDialog) {
@@ -61,6 +61,7 @@ export struct ImageAndTextPageComponent { @@ -61,6 +61,7 @@ export struct ImageAndTextPageComponent {
61 @State likeNum: number = 0 61 @State likeNum: number = 0
62 @State reachEndIncreament: number = 0 62 @State reachEndIncreament: number = 0
63 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 63 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
  64 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
64 @State isScrollTop: boolean = true 65 @State isScrollTop: boolean = true
65 @State offsetY: number = 0 66 @State offsetY: number = 0
66 pageShowTime:number = 0; 67 pageShowTime:number = 0;
@@ -88,7 +89,7 @@ export struct ImageAndTextPageComponent { @@ -88,7 +89,7 @@ export struct ImageAndTextPageComponent {
88 action: this.action, 89 action: this.action,
89 isPageEnd: $isPageEnd 90 isPageEnd: $isPageEnd
90 }) 91 })
91 - .padding({ top: 15, bottom: 10 }) 92 + .padding({ bottom: 10 })
92 Column() { 93 Column() {
93 // 点赞 94 // 点赞
94 if (this.contentDetailData?.openLikes && this.contentDetailData?.likesStyle !== 4) { 95 if (this.contentDetailData?.openLikes && this.contentDetailData?.likesStyle !== 4) {
@@ -159,8 +160,8 @@ export struct ImageAndTextPageComponent { @@ -159,8 +160,8 @@ export struct ImageAndTextPageComponent {
159 } 160 }
160 .id('imgTextContainer') 161 .id('imgTextContainer')
161 } 162 }
  163 + .padding({bottom: 44})
162 .width(CommonConstants.FULL_WIDTH) 164 .width(CommonConstants.FULL_WIDTH)
163 - .height(CommonConstants.FULL_HEIGHT)  
164 .scrollBar(BarState.Off) 165 .scrollBar(BarState.Off)
165 .align(Alignment.Top) 166 .align(Alignment.Top)
166 .onReachEnd(() => { 167 .onReachEnd(() => {
@@ -174,10 +175,10 @@ export struct ImageAndTextPageComponent { @@ -174,10 +175,10 @@ export struct ImageAndTextPageComponent {
174 retry: () => { 175 retry: () => {
175 this.getDetail() 176 this.getDetail()
176 } 177 }
177 - }).padding({ bottom: 200 }) 178 + }).padding({ bottom: 44 })
178 } else { 179 } else {
179 if (!this.isPageEnd) { 180 if (!this.isPageEnd) {
180 - detailedSkeleton().padding({ bottom: this.bottomSafeHeight }) 181 + detailedSkeleton().padding({ bottom: 44 })
181 } 182 }
182 } 183 }
183 // 底部交互区 184 // 底部交互区
@@ -206,12 +207,10 @@ export struct ImageAndTextPageComponent { @@ -206,12 +207,10 @@ export struct ImageAndTextPageComponent {
206 this.isScrollTop = !this.isScrollTop 207 this.isScrollTop = !this.isScrollTop
207 } 208 }
208 }) 209 })
209 - .position({ y: '100%' })  
210 } 210 }
  211 + .margin({top: `${this.topSafeHeight}px`, bottom: `${this.bottomSafeHeight}px`})
211 .width(CommonConstants.FULL_WIDTH) 212 .width(CommonConstants.FULL_WIDTH)
212 - .height(CommonConstants.FULL_HEIGHT)  
213 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])  
214 - .padding({ top: 38 }) 213 + // .height(CommonConstants.FULL_HEIGHT)
215 214
216 // 发布时间 215 // 发布时间
217 Column() { 216 Column() {
@@ -242,6 +241,7 @@ export struct ImageAndTextPageComponent { @@ -242,6 +241,7 @@ export struct ImageAndTextPageComponent {
242 .backgroundColor(Color.White) 241 .backgroundColor(Color.White)
243 }.backgroundColor(Color.White) 242 }.backgroundColor(Color.White)
244 } 243 }
  244 + .margin({top: `${this.topSafeHeight}px`, bottom: `${this.bottomSafeHeight}px`})
245 .width(CommonConstants.FULL_WIDTH) 245 .width(CommonConstants.FULL_WIDTH)
246 .height(CommonConstants.FULL_HEIGHT) 246 .height(CommonConstants.FULL_HEIGHT)
247 .backgroundColor(Color.White) 247 .backgroundColor(Color.White)
1 import router from '@ohos.router' 1 import router from '@ohos.router'
2 -import { BreakpointSystem, NetworkUtil, StringUtils, ToastUtils } from 'wdKit' 2 +import { BreakpointSystem, DateTimeUtils, NetworkUtil, StringUtils, ToastUtils } from 'wdKit'
3 import { ParamType, TrackConstants, Tracking } from 'wdTracking/Index' 3 import { ParamType, TrackConstants, Tracking } from 'wdTracking/Index'
4 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' 4 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
5 import { SearchHistoryItem } from '../../viewmodel/SearchHistoryItem' 5 import { SearchHistoryItem } from '../../viewmodel/SearchHistoryItem'
@@ -32,6 +32,7 @@ export struct SearchComponent { @@ -32,6 +32,7 @@ export struct SearchComponent {
32 @State count:string[] = [] 32 @State count:string[] = []
33 @State isGetRequest:boolean = false 33 @State isGetRequest:boolean = false
34 @Link fromTabName: string 34 @Link fromTabName: string
  35 + @State sameSearch:number = 0 //再次搜索
35 36
36 @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm'; 37 @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
37 private breakpointSystem = new BreakpointSystem(); 38 private breakpointSystem = new BreakpointSystem();
@@ -175,7 +176,7 @@ export struct SearchComponent { @@ -175,7 +176,7 @@ export struct SearchComponent {
175 this.getSearchHistoryData() 176 this.getSearchHistoryData()
176 this.getSearchInputResData(this.searchText) 177 this.getSearchInputResData(this.searchText)
177 } 178 }
178 - },percent:this.percent}) 179 + },percent:this.percent,sameSearch:this.sameSearch})
179 } else { 180 } else {
180 //联想搜索 181 //联想搜索
181 SearchRelatedComponent({relatedSearchContentData:$relatedSearchContentsData,onGetSearchRes: (item): void => this.getSearchRelatedResData(item),searchText:this.searchText,percent:this.percent}) 182 SearchRelatedComponent({relatedSearchContentData:$relatedSearchContentsData,onGetSearchRes: (item): void => this.getSearchRelatedResData(item),searchText:this.searchText,percent:this.percent})
@@ -402,6 +403,7 @@ export struct SearchComponent { @@ -402,6 +403,7 @@ export struct SearchComponent {
402 } 403 }
403 this.isGetRequest = true 404 this.isGetRequest = true
404 this.resetSearch() 405 this.resetSearch()
  406 + this.sameSearch = DateTimeUtils.getTimeStamp()
405 }).catch((err: Error) => { 407 }).catch((err: Error) => {
406 console.log(TAG, JSON.stringify(err)) 408 console.log(TAG, JSON.stringify(err))
407 this.isGetRequest = true 409 this.isGetRequest = true
@@ -29,6 +29,8 @@ export struct SearchResultComponent { @@ -29,6 +29,8 @@ export struct SearchResultComponent {
29 onClickTryAgain?: () => void; 29 onClickTryAgain?: () => void;
30 @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() 30 @State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
31 @Prop percent:number = 1 31 @Prop percent:number = 1
  32 + @Prop sameSearch:number = 0
  33 +
32 34
33 aboutToAppear(): void { 35 aboutToAppear(): void {
34 if (this.count.length === 0 && this.isGetRequest == true) { 36 if (this.count.length === 0 && this.isGetRequest == true) {
@@ -137,7 +139,7 @@ export struct SearchResultComponent { @@ -137,7 +139,7 @@ export struct SearchResultComponent {
137 Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { 139 Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
138 ForEach(this.count, (item: string, index: number) => { 140 ForEach(this.count, (item: string, index: number) => {
139 TabContent() { 141 TabContent() {
140 - SearchResultContentComponent({ keywords: this.searchText, searchType: item }) 142 + SearchResultContentComponent({ keywords: this.searchText, searchType: item ,sameSearch:this.sameSearch,isCurrentShow:this.currentIndex === index})
141 }.tabBar(this.TabBuilder(index, item)) 143 }.tabBar(this.TabBuilder(index, item))
142 .layoutWeight(1) 144 .layoutWeight(1)
143 }, (item: string, index: number) => index.toString()) 145 }, (item: string, index: number) => index.toString())
@@ -51,7 +51,22 @@ export struct SearchResultContentComponent { @@ -51,7 +51,22 @@ export struct SearchResultContentComponent {
51 @State moreWidth:number = 20 51 @State moreWidth:number = 20
52 @State listLeft: number = 0 52 @State listLeft: number = 0
53 @State isEnd: boolean = false 53 @State isEnd: boolean = false
  54 + @Watch('updateData') @Prop sameSearch:number = 0
  55 + @Prop isCurrentShow:boolean = false;
54 56
  57 + updateData(){
  58 + if(this.isCurrentShow){
  59 + this.data_rmh = []
  60 +
  61 + this.data.clearAllData()
  62 +
  63 + this.curPageNum = 1
  64 + this.hasMore = true
  65 + this.isLoading = false
  66 + this.getNewSearchResultData()
  67 + }
  68 +
  69 + }
55 70
56 aboutToAppear(): void { 71 aboutToAppear(): void {
57 if (this.searchType == "全部") { 72 if (this.searchType == "全部") {
@@ -18,6 +18,7 @@ export struct ENewspaperListDialog { @@ -18,6 +18,7 @@ export struct ENewspaperListDialog {
18 private listScroller: Scroller = new Scroller() 18 private listScroller: Scroller = new Scroller()
19 @State scrollOffset: number = 0 19 @State scrollOffset: number = 0
20 @State isCurrentViewOpen: boolean = false 20 @State isCurrentViewOpen: boolean = false
  21 + @Consume bottomSafeHeight:number
21 //文字版选择弹框 22 //文字版选择弹框
22 pageListDialogController: CustomDialogController = new CustomDialogController({ 23 pageListDialogController: CustomDialogController = new CustomDialogController({
23 builder: ENewspaperPageDialog({ 24 builder: ENewspaperPageDialog({
@@ -266,13 +267,13 @@ export struct ENewspaperListDialog { @@ -266,13 +267,13 @@ export struct ENewspaperListDialog {
266 left: 15, 267 left: 15,
267 right: 15, 268 right: 15,
268 // top: 16, 269 // top: 16,
269 - bottom: 16 270 + // bottom: 16
270 }) 271 })
271 .margin({ 272 .margin({
272 bottom: 85 273 bottom: 85
273 }) 274 })
274 .scrollBar(BarState.Off) 275 .scrollBar(BarState.Off)
275 - .edgeEffect(EdgeEffect.None) 276 + .edgeEffect(EdgeEffect.Spring)
276 .onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => { 277 .onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => {
277 console.info('ENewspaperListDialog::first' + firstIndex) 278 console.info('ENewspaperListDialog::first' + firstIndex)
278 console.info('ENewspaperListDialog::last' + lastIndex) 279 console.info('ENewspaperListDialog::last' + lastIndex)
@@ -288,19 +289,14 @@ export struct ENewspaperListDialog { @@ -288,19 +289,14 @@ export struct ENewspaperListDialog {
288 // } 289 // }
289 }) 290 })
290 } 291 }
291 - // .margin({ top: 124 })  
292 .margin({ top: this.topHeight }) 292 .margin({ top: this.topHeight })
293 -  
294 .width('100%') 293 .width('100%')
295 .backgroundColor(Color.White) 294 .backgroundColor(Color.White)
296 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])  
297 - .onClick(() => {  
298 295
299 - })  
300 }.width('100%') 296 }.width('100%')
301 .height('100%') 297 .height('100%')
302 .backgroundColor('#80000000') 298 .backgroundColor('#80000000')
303 - .margin({bottom:44}) 299 + .margin({bottom:50})
304 .onClick(() => { 300 .onClick(() => {
305 if (this.closeDialog) { 301 if (this.closeDialog) {
306 this.closeDialog() 302 this.closeDialog()
@@ -214,12 +214,7 @@ struct MineHomePage { @@ -214,12 +214,7 @@ struct MineHomePage {
214 .fontWeight('400lpx') 214 .fontWeight('400lpx')
215 .fontColor(this.isHasIntroduction?$r('app.color.color_222222'):$r('app.color.color_999999')) 215 .fontColor(this.isHasIntroduction?$r('app.color.color_222222'):$r('app.color.color_999999'))
216 .textAlign(TextAlign.Start) 216 .textAlign(TextAlign.Start)
217 - .onClick(()=>{  
218 - let params: editModelParams = {  
219 - editContent: this.isHasIntroduction?this.desc:''  
220 - }  
221 - WDRouterRule.jumpWithPage(WDRouterPage.editUserIntroductionPage,params)  
222 - }) 217 +
223 if(!this.isHasIntroduction){ 218 if(!this.isHasIntroduction){
224 Image($r('app.media.user_info_edit_icon')) 219 Image($r('app.media.user_info_edit_icon'))
225 .width('27lpx') 220 .width('27lpx')
@@ -227,7 +222,12 @@ struct MineHomePage { @@ -227,7 +222,12 @@ struct MineHomePage {
227 .interpolation(ImageInterpolation.High) 222 .interpolation(ImageInterpolation.High)
228 .objectFit(ImageFit.Auto) 223 .objectFit(ImageFit.Auto)
229 } 224 }
  225 + }.onClick(()=>{
  226 + let params: editModelParams = {
  227 + editContent: this.isHasIntroduction?this.desc:''
230 } 228 }
  229 + WDRouterRule.jumpWithPage(WDRouterPage.editUserIntroductionPage,params)
  230 + })
231 231
232 232
233 Text(`来到人民日报${this.registerTimeForDay}天`) 233 Text(`来到人民日报${this.registerTimeForDay}天`)
@@ -140,6 +140,7 @@ export struct BottomNavigationComponent { @@ -140,6 +140,7 @@ export struct BottomNavigationComponent {
140 .opacity(this.currentNavIndex === index ? this.FULL_OPACITY : this.SIXTY_OPACITY) 140 .opacity(this.currentNavIndex === index ? this.FULL_OPACITY : this.SIXTY_OPACITY)
141 } 141 }
142 .zIndex(10) 142 .zIndex(10)
  143 + .width('100%')
143 .height($r('app.float.bottom_navigation_barHeight')) 144 .height($r('app.float.bottom_navigation_barHeight'))
144 .hoverEffect(HoverEffect.Highlight) 145 .hoverEffect(HoverEffect.Highlight)
145 .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) 146 .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)