wangliang_wd

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

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  fix |> 修复搜索页面点击tab没有loading加载效果
... ... @@ -30,6 +30,7 @@ import { MoreComponent } from '../cardview/MoreComponent'
import { Card9Component } from '../cardview/Card9Component'
import { WDRouterRule, WDRouterPage } from 'wdRouter/Index'
import { EmptyComponent, WDViewDefaultType } from '../view/EmptyComponent'
import { LottieView } from '../../components/lottie/LottieView'
const TAG = "SearchResultContentComponent"
... ... @@ -288,92 +289,112 @@ export struct SearchResultContentComponent {
build() {
Column() {
if (this.count == 0) {
EmptyComponent({
emptyType: WDViewDefaultType.WDViewDefaultType_NoSearchResult,
emptyButton: false,
}).height('70%')
// 添加动效refresh
if (this.isLoading){
LottieView({
name: 'refreshing',
path: "lottie/refresh_step2.json",
lottieWidth: 87,
lottieHeight: 87,
autoplay: true,
loop: true
}).margin({top:180})
}else {
if (this.count == 0) {
EmptyComponent({
emptyType: WDViewDefaultType.WDViewDefaultType_NoSearchResult,
emptyButton: false,
}).height('70%')
} else {
List({ scroller: this.scroller2 }) {
if (this.data_rmh != null && this.data_rmh.length > 0) {
if (this.data_rmh.length === 1) {
ListItem() {
FollowChildComponent({ data: this.bean, type: 1 ,searchText: decodeURI(this.keywords)})
}.padding({ left: 10 + 6 , right: 10 + 6})
} else {
} else {
List({ scroller: this.scroller2 }) {
if (this.data_rmh != null && this.data_rmh.length > 0) {
if (this.data_rmh.length === 1) {
ListItem() {
FollowChildComponent({ data: this.bean, type: 1, searchText: decodeURI(this.keywords) })
}.padding({ left: 10 + 6, right: 10 + 6 })
} else {
ListItem() {
Column() {
this.SearchListUI()
}
}.padding({ left: 6, right: 6 })
}
}
LazyForEach(this.data, (item: ContentDTO, index: number) => {
ListItem() {
Column() {
this.SearchListUI()
}
}.padding({left: 6, right: 6})
}
}
LazyForEach(this.data, (item: ContentDTO, index: number) => {
ListItem() {
Column() {
if (this.searchType == "activity") {
ActivityItemComponent({ contentDTO: item })
.padding({left: 6, right: 6})
} else if (item.sameContentListSize > 0) {
MoreComponent({ contentDTO: item ,
nextIsAggregateData:(index+1 < this.data.totalCount() && this.data.get(index+1).isAggregateData)})
} else if (item.appStyle == "9") {
Column(){
if(item.isAggregateData && index != 0){
Divider()
.width('100%' )
.color($r('app.color.color_F5F5F5'))
.strokeWidth(5)
}
if (this.searchType == "activity") {
ActivityItemComponent({ contentDTO: item })
.padding({ left: 6, right: 6 })
} else if (item.sameContentListSize > 0) {
MoreComponent({
contentDTO: item,
nextIsAggregateData: (index + 1 < this.data.totalCount() &&
this.data.get(index + 1).isAggregateData)
})
} else if (item.appStyle == "9") {
Column() {
if (item.isAggregateData && index != 0) {
Divider()
.width('100%')
.color($r('app.color.color_F5F5F5'))
.strokeWidth(5)
}
Column() {
Card9Component({
compDTO: new CompDTO,
contentDTO: item,
pageId: "",
pageName: ""
})
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
}
.padding({ left: 6, right: 6 })
}
} else {
Column() {
Card9Component({
if (item.isAggregateData && index != 0) {
Divider()
.width('100%')
.color($r('app.color.color_F5F5F5'))
.strokeWidth(5)
}
CardParser({
compDTO: new CompDTO,
contentDTO: item,
pageId: "",
pageName: ""
isNeedDivider: (index + 1 < this.data.totalCount() &&
this.data.get(index + 1).isAggregateData) ? false : true
})
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
.padding({ left: 6, right: 6 })
}
.padding({left: 6, right: 6})
}
} else {
Column(){
if(item.isAggregateData && index != 0){
Divider()
.width('100%' )
.color($r('app.color.color_F5F5F5'))
.strokeWidth(5)
}
CardParser({ compDTO: new CompDTO, contentDTO: item ,isNeedDivider: (index+1 < this.data.totalCount() && this.data.get(index+1).isAggregateData) ? false : true})
.padding({left: 6, right: 6})
}
}
}
}
}
}, (item: ContentDTO, index: number) => index.toString())
}, (item: ContentDTO, index: number) => index.toString())
//没有更多数据 显示提示
if (!this.hasMore && (this.data.totalCount() > 0 || (this.data_rmh != null && this.data_rmh.length > 0))) {
ListItem() {
ListHasNoMoreDataUI()
//没有更多数据 显示提示
if (!this.hasMore && (this.data.totalCount() > 0 || (this.data_rmh != null && this.data_rmh.length > 0))) {
ListItem() {
ListHasNoMoreDataUI()
}
.padding({ left: 6, right: 6 })
}
.padding({left: 6, right: 6})
}
.cachedCount(5)
.edgeEffect(EdgeEffect.None)
.scrollBar(BarState.Off)
.height('100%')
.onReachEnd(() => {
console.log(TAG, "触底了");
if (!this.isLoading) {
this.getNewSearchResultData()
}
})
}
.cachedCount(5)
.edgeEffect(EdgeEffect.None)
.scrollBar(BarState.Off)
.height('100%')
.onReachEnd(() => {
console.log(TAG, "触底了");
if (!this.isLoading) {
this.getNewSearchResultData()
}
})
}
}
.backgroundColor($r('app.color.white'))
... ...