yumaochao
... ... @@ -11,7 +11,6 @@ import {
import { LiveInfoDTO } from 'wdBean/src/main/ets/bean/detail/LiveInfoDTO'
import { VoiceInfoDTO } from 'wdBean/src/main/ets/bean/detail/VoiceInfoDTO'
import { LazyDataSource, StringUtils, UserDataLocal } from 'wdKit/Index'
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
import MinePageDatasModel from '../../model/MinePageDatasModel'
import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
import { CreatorDetailRequestItem } from '../../viewmodel/CreatorDetailRequestItem'
... ... @@ -30,6 +29,7 @@ import { SearchCreatorComponent } from './SearchCreatorComponent'
import { JSON } from '@kit.ArkTS'
import { MoreComponent } from '../cardview/MoreComponent'
import { Card9Component } from '../cardview/Card9Component'
import { WDRouterRule, WDRouterPage } from 'wdRouter/Index'
const TAG = "SearchResultContentComponent"
... ... @@ -46,6 +46,12 @@ export struct SearchResultContentComponent {
curPageNum: number = 1;
@State bean: FollowListDetailItem = new FollowListDetailItem("", "", "", "", "", "", "", "", "", -1, -1, "")
scroller: Scroller = new Scroller()
private scroller2: Scroller = new Scroller()
@State ellipseW: number = 0
@State moreWidth:number = 20
@State listLeft: number = 0
@State isEnd: boolean = false
aboutToAppear(): void {
if (this.searchType == "全部") {
... ... @@ -243,7 +249,7 @@ export struct SearchResultContentComponent {
if (this.count == 0) {
ListHasNoMoreDataUI({ style: 2 })
} else {
List() {
List({scroller:this.scroller2}) {
if (this.data_rmh != null && this.data_rmh.length > 0){
if (this.data_rmh.length === 1){
ListItem(){
... ... @@ -306,44 +312,70 @@ export struct SearchResultContentComponent {
@Builder
SearchListUI() {
List({space:'8lpx'}) {
ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => {
ListItem() {
SearchCreatorComponent({item:item})
}
.width('150lpx')
.height('100%')
})
List({initialIndex: 0,space:'8lpx',scroller: this.scroller}) {
ListItemGroup(){
ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => {
ListItem() {
SearchCreatorComponent({item:item})
}
.width('150lpx')
.height('100%')
})
}.offset({ left: this.listLeft })
ListItem(){
Column(){
Text("查看更多")
.width('19lpx')
.fontSize('19lpx')
.fontWeight('400lpx')
.lineHeight('27lpx')
.fontColor($r('app.color.color_9E9E9E'))
}.borderRadius({topLeft:'4lpx',bottomLeft:'4lpx'})
.height('180lpx')
.width('77lpx')
.backgroundColor($r('app.color.color_EDEDED'))
.justifyContent(FlexAlign.Center)
this.itemEnd()
}.height('100%')
.margin({left:'23lpx'})
.onClick(()=>{
let params: Params = {
pageID: this.keywords
}
WDRouterRule.jumpWithPage(WDRouterPage.searchCreatorPage,params)
})
}
.cachedCount(6)
.edgeEffect(EdgeEffect.None)
.scrollBar(BarState.Off)
.listDirection(Axis.Horizontal)
.width('100%')
.height('219lpx')
.onReachEnd(() => {
this.isEnd = true
console.log(TAG,'is end')
})
.onScrollFrameBegin((offset: number, state: ScrollState) => {
console.log(TAG,'offset', offset)
if (!this.scroller.isAtEnd()) {
this.isEnd = false
}
if (this.ellipseW > 0) {
return { offsetRemain: 0 }
}
return { offsetRemain: offset }
})
.parallelGesture(
PanGesture({ direction: PanDirection.Horizontal, distance: 1 })
.onActionStart((event: GestureEvent) => {
console.info(TAG,'Pan start')
})
.onActionUpdate((event: GestureEvent) => {
if (event && this.isEnd) {
// console.log('event.offsetX',event.offsetX)
this.listLeft = event.offsetX < -60 ? -60 : event.offsetX > 0 ? 0 : event.offsetX
this.ellipseW = (-this.listLeft) / 1.5
console.log(TAG,"this.ellipseW==>" + this.ellipseW)
}
})
.onActionEnd((event: GestureEvent) => {
console.info(TAG,'Pan end')
this.listLeft = 0
// this.moreWidth = 20
if (event.offsetX < 0 && this.ellipseW >=20) {
console.log(TAG,'跳转')
let params: Params = {
pageID: this.keywords
}
WDRouterRule.jumpWithPage(WDRouterPage.searchCreatorPage,params)
}
this.ellipseW = 0
})
)
Divider()
.width('100%')
... ... @@ -352,6 +384,32 @@ export struct SearchResultContentComponent {
.strokeWidth('12lpx')
}
@Builder
itemEnd() {
Row() {
Ellipse()
.width(2* this.ellipseW)
.height('100%')
.fill('rgb(240,235,238)')
.position({ left: -this.ellipseW, top: 0 })
Column(){
Text(this.ellipseW === 0 ? '' : this.ellipseW < 20? '查看更多' : '松手查看')
.width('19lpx')
.fontSize('19lpx')
.fontWeight('400lpx')
.lineHeight('27lpx')
.fontColor("#9E9E9E")
}
.height('100%')
.width(this.moreWidth)
.backgroundColor("#EDEDED")
.justifyContent(FlexAlign.Center)
}
.height('100%')
}
private dataTransform(rem:CreatorDetailResponseItem[],value: SearchResultContentItem, photos: FullColumnImgUrlDTO[]): ContentDTO {
let rmhInfo = this.getRmhInfo(rem,value)
console.log('获取photos',JSON.stringify(photos))
... ...
... ... @@ -7,7 +7,7 @@ import { MinePageComponent } from 'wdComponent/src/main/ets/components/page/Mine
import { CompUtils, TopNavigationComponent, TopNavigationComponentNew } from 'wdComponent/Index';
import { VideoChannelPage } from './VideoChannelPage';
import ChannelViewModel from 'wdComponent/src/main/ets/viewmodel/ChannelViewModel';
import { ImageKnifeComponent, ImageKnifeOption, NONE } from '@ohos/imageknife';
import { ALL, ImageKnifeComponent, ImageKnifeOption, NONE } from '@ohos/imageknife';
const TAG = 'BottomNavigationComponent';
PersistentStorage.persistProp('channelIds', '');
... ... @@ -188,8 +188,8 @@ export struct BottomNavigationComponent {
errorholderSrc: defaultIcon,
// 是否开启一级内存缓存
isCacheable: true,
// 磁盘缓存none
strategy: new NONE()
// 磁盘缓存
strategy: new ALL()
};
return imageKnifeOption
}
... ... @@ -263,6 +263,7 @@ export struct BottomNavigationComponent {
}
onBottomNavigationDataUpdated() {
Logger.error('yyyy','onBottomNavigationDataUpdated '+JSON.stringify(this.bottomNavList))
// Logger.info(TAG, `onBottomNavigationDataUpdated currentNavIndex: ${this.currentNavIndex},length:${this.bottomNavItemList.length}`);
}
... ...