王士厅
Showing 18 changed files with 266 additions and 197 deletions
... ... @@ -40,15 +40,10 @@ export class Logger {
Logger.domain = domain;
}
static debug(prefixStr?:string,...args: string[]) {
static debug(...args: string[]) {
if (!Logger.isDebug) {
return
}
if(prefixStr){
Logger.prefix = prefixStr
}else {
Logger.prefix = 'SightApp';
}
Logger.logContent(LogLevel.DEBUG, ...args)
}
... ... @@ -90,55 +85,68 @@ export class Logger {
static logContent(level: LogLevel, ...args: string[]) {
let msg = Logger.getMsg(...args)
let tag = Logger.getTag(...args)
let length = msg.length
if (length < Logger.CHUNK_SIZE) {
// 不超限,保持原来的打印
Logger.print(level, ...args)
Logger.print(tag, level, ...args)
} else {
// 超限,分段打印
for (let i = 0; i < length; i += Logger.CHUNK_SIZE) {
let count = Math.min(length - i, Logger.CHUNK_SIZE);
Logger.printExt(level, msg.substring(i, i + count));
Logger.printExt(tag, level, msg.substring(i, i + count));
}
}
}
static print(level: LogLevel, ...msg: string[]) {
static print(tag: string, level: LogLevel, ...msg: string[]) {
let prefix = Logger.prefix
if (tag) {
prefix = tag
}
switch (level) {
case LogLevel.DEBUG:
hilog.debug(Logger.domain, Logger.prefix, Logger.format, msg);
hilog.debug(Logger.domain, prefix, Logger.format, msg);
break
case LogLevel.INFO:
hilog.info(Logger.domain, Logger.prefix, Logger.format, msg);
hilog.info(Logger.domain, prefix, Logger.format, msg);
break
case LogLevel.WARN:
hilog.warn(Logger.domain, Logger.prefix, Logger.format, msg);
hilog.warn(Logger.domain, prefix, Logger.format, msg);
break
case LogLevel.ERROR:
hilog.error(Logger.domain, Logger.prefix, Logger.format, msg);
hilog.error(Logger.domain, prefix, Logger.format, msg);
break
case LogLevel.FATAL:
hilog.fatal(Logger.domain, Logger.prefix, Logger.format, msg);
hilog.fatal(Logger.domain, prefix, Logger.format, msg);
break
}
}
static printExt(level: LogLevel, msg: string) {
static printExt(tag: string, level: LogLevel, msg: string) {
let prefix = Logger.prefix
if (tag) {
prefix = tag
}
switch (level) {
case LogLevel.DEBUG:
hilog.debug(Logger.domain, Logger.prefix, Logger.format_ext, msg);
hilog.debug(Logger.domain, prefix, Logger.format_ext, msg);
break
case LogLevel.INFO:
hilog.info(Logger.domain, Logger.prefix, Logger.format_ext, msg);
hilog.info(Logger.domain, prefix, Logger.format_ext, msg);
break
case LogLevel.WARN:
hilog.warn(Logger.domain, Logger.prefix, Logger.format_ext, msg);
hilog.warn(Logger.domain, prefix, Logger.format_ext, msg);
break
case LogLevel.ERROR:
hilog.error(Logger.domain, Logger.prefix, Logger.format_ext, msg);
hilog.error(Logger.domain, prefix, Logger.format_ext, msg);
break
case LogLevel.FATAL:
hilog.fatal(Logger.domain, Logger.prefix, Logger.format_ext, msg);
hilog.fatal(Logger.domain, prefix, Logger.format_ext, msg);
break
}
}
... ... @@ -153,6 +161,20 @@ export class Logger {
})
return msg.substring(2, msg.length);
}
static getTag(...args: string[]): string {
if (args == null || args.length <= 0) {
return '';
}
if (args.length > 1) {
return args[0]
} else {
return ''
}
}
}
// export default new Logger('SightApp', 0xFF00)
\ No newline at end of file
... ...
... ... @@ -55,7 +55,7 @@ export struct Card14Component {
)
}
// 左标题,右图
Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween }) {
Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start }) {
Text() {
if (this.titleMarked) {
... ... @@ -77,16 +77,14 @@ export struct Card14Component {
.lineHeight(25)
.fontFamily('PingFang SC-Regular')
.textAlign(TextAlign.Start)
// .flexBasis('auto')
.margin({right: 12})
.flexBasis(214)
.width('64%')
Image(this.loadImg ? this.contentDTO.coverUrl : '')
.backgroundColor(0xf5f5f5)
.flexBasis(117)
.aspectRatio(3 / 2)
.height(78)
.borderRadius($r('app.float.image_border_radius'))
// .flexBasis(160)
.backgroundImageSize(ImageSize.Auto)
}
... ...
... ... @@ -161,7 +161,7 @@ export struct ZhSingleColumn09 {
.height(90)
.columnsTemplate('1fr 1fr 1fr 1fr')
.rowsTemplate('1fr 1fr')
.margin({bottom: 10})
.margin({bottom: 5})
Row() {
Row() {
... ... @@ -188,7 +188,7 @@ export struct ZhSingleColumn09 {
this.selfClosed = true;
})
}
.height(40)
.height(20)
.width('100%')
.borderRadius(3)
.justifyContent(FlexAlign.SpaceBetween)
... ...
... ... @@ -5,7 +5,7 @@ export struct PeopleShipHomeAttentionComponent {
@Consume isAttention: string
@Consume isLoadingAttention: boolean
build() {
Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Flex({ alignItems: ItemAlign.Start, justifyContent: FlexAlign.Start }) {
Button({type: ButtonType.Normal, stateEffect: false } ) {
Stack() {
Row()
... ... @@ -117,7 +117,6 @@ export struct PeopleShipHomeAttentionComponent {
ToastUtils.showToast('分享为公共方法,待开发', 1000);
})
.visibility(Visibility.Hidden)
}
}
... ...
... ... @@ -253,7 +253,7 @@ export struct PeopleShipHomePageTopComponent {
// 分享-关注
PeopleShipHomeAttentionComponent()
.width('100%')
.width(`calc(100% - ${32 + 'vp'})`)
.margin({
top: '10vp',
bottom: '16vp'
... ...
... ... @@ -85,8 +85,8 @@ export default struct CustomLayout {
name: this.animateName,
path: "lottie/refresh_step1.json", // 路径加载动画只支持entry/src/main/ets 文件夹下的相对路径
})
}
this.animateItem.goToAndStop(1)
}
let total = CustomLayout.REFRESH_HEIGHT
let progress = offset * 100 / total
this.animateItem?.goToAndStop(this.getFramesByProgress(progress), true);
... ... @@ -103,9 +103,6 @@ export default struct CustomLayout {
path: "lottie/refresh_step2.json", // 路径加载动画只支持entry/src/main/ets 文件夹下的相对路径
})
}
// this.animateItem2.isLoaded
// TODO 是否拦截重复触发
this.animateItem2.goToAndPlay(1)
}
getFramesByProgress(progress: number): number {
... ...
... ... @@ -18,14 +18,18 @@ export struct CustomPullToRefresh {
.setAnimDuration(500);
private refreshSettings: RenderingContextSettings = new RenderingContextSettings(true)
private refreshContext: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.refreshSettings)
private refreshingSettings: RenderingContextSettings = new RenderingContextSettings(true)
private refreshingContext: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.refreshingSettings)
private loadMoreSettings: RenderingContextSettings = new RenderingContextSettings(true)
private loadMoreContext: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.loadMoreSettings)
private refreshAnimation: AnimationItem | null = null;
private refreshingAnimation: AnimationItem | null = null;
private loadMoreAnimation: AnimationItem | null = null;
private refreshAnimName: string = "refresh";
private refreshingAnimName: string = "refreshing";
private loadMoreAnimName: string = "loadMore";
private refreshAnimationDestroy = true
private refreshingAnimationDestroy = true
// refresh-1,refreshing-2,refreshed-3,idle-4
@State @Watch('stateChange') private refreshState: number = 4;
... ... @@ -120,9 +124,23 @@ export struct CustomPullToRefresh {
})
.onDisAppear(() => {
lottie.destroy(this.refreshAnimName);
})
.visibility(this.refreshState == 1 ? Visibility.Visible : Visibility.Hidden)
Canvas(this.refreshingContext)
.width(60)
.height(60)
.backgroundColor(Color.Transparent)
.onReady(() => {
// 可在此生命回调周期中加载动画,可以保证动画尺寸正确
//抗锯齿的设置
this.refreshContext.imageSmoothingEnabled = true;
this.refreshContext.imageSmoothingQuality = 'medium'
})
.onDisAppear(() => {
lottie.destroy(this.refreshingAnimName);
})
.visibility((this.refreshState == 1 || this.refreshState == 2) ? Visibility.Visible : Visibility.Hidden)
.visibility(this.refreshState == 2 ? Visibility.Visible : Visibility.Hidden)
Text('已更新至最新')
.fontSize(14)
... ... @@ -175,10 +193,7 @@ export struct CustomPullToRefresh {
}
private refreshAnim(percent: number) {
if (this.refreshAnimation == null || this.refreshAnimation.name != this.refreshAnimName ||
this.refreshAnimationDestroy) {
this.refreshAnimation?.destroy(this.refreshAnimName)
this.refreshAnimation?.destroy(this.refreshingAnimName)
if (this.refreshAnimation == null || this.refreshAnimationDestroy) {
this.refreshAnimation = lottie.loadAnimation({
container: this.refreshContext,
renderer: 'canvas', // canvas 渲染模式
... ... @@ -212,21 +227,19 @@ export struct CustomPullToRefresh {
}
private refreshingAnim() {
// Logger.error('zzzz', 'animate2, 1')
// 先销毁之前的动画
if (this.refreshAnimation == null || this.refreshAnimation.name != this.refreshingAnimName ||
this.refreshAnimationDestroy) {
this.refreshAnimation?.destroy(this.refreshAnimName)
this.refreshAnimation?.destroy(this.refreshingAnimName)
this.refreshAnimation = lottie.loadAnimation({
container: this.refreshContext,
if (this.refreshingAnimation == null || this.refreshingAnimationDestroy) {
this.refreshingAnimation?.destroy(this.refreshingAnimName)
this.refreshingAnimation = lottie.loadAnimation({
container: this.refreshingContext,
renderer: 'canvas', // canvas 渲染模式
loop: 10,
autoplay: true,
name: this.refreshingAnimName,
path: "lottie/refresh_step2.json", // 路径加载动画只支持entry/src/main/ets 文件夹下的相对路径
})
this.addRefreshAnimListener()
this.refreshingAnimationDestroy = false
this.addRefreshingAnimListener()
}
// Logger.error('zzzz', 'animate2, 2')
}
... ... @@ -242,6 +255,13 @@ export struct CustomPullToRefresh {
});
}
private addRefreshingAnimListener() {
this.refreshingAnimation?.addEventListener('destroy', (args: Object): void => {
// Logger.error('zzzz', "lottie destroy");
this.refreshingAnimationDestroy = true
});
}
loadMoreAnimate() {
if (this.loadMoreAnimation == null) {
this.loadMoreAnimation = lottie.loadAnimation({
... ...
... ... @@ -66,31 +66,31 @@ export struct SearchComponent {
this.breakpointSystem.unregister();
}
getRelatedSearchContent() {
if (StringUtils.isNotEmpty(this.searchText)) {
SearcherAboutDataModel.getRelatedSearchContentData(encodeURI(this.searchText), getContext(this)).then((value) => {
getRelatedSearchContent(searchText: string) {
if (StringUtils.isNotEmpty(searchText)) {
SearcherAboutDataModel.getRelatedSearchContentData(encodeURI(searchText), getContext(this)).then((value) => {
if (value != null && value.length > 0) {
this.relatedSearchContentsData = []
value.forEach(item => {
let tempValue: string = item
let tempArr: string[] = []
if (tempValue.indexOf(this.searchText) === -1) {
if (tempValue.indexOf(searchText) === -1) {
tempArr.push(item)
this.relatedSearchContentsData.push(new SearchRelatedItem(item, tempArr))
} else {
while (tempValue.indexOf(this.searchText) != -1) {
let index = tempValue.indexOf(this.searchText)
while (tempValue.indexOf(searchText) != -1) {
let index = tempValue.indexOf(searchText)
if (index === 0) {
try {
tempArr.push(this.searchText)
tempValue = tempValue.substring(this.searchText.length, tempValue.length)
tempArr.push(searchText)
tempValue = tempValue.substring(searchText.length, tempValue.length)
} catch (e) {
}
} else {
try {
tempArr.push(tempValue.substring(0, index))
tempArr.push(this.searchText)
tempValue = tempValue.substring(index + this.searchText.length, tempValue.length)
tempArr.push(searchText)
tempValue = tempValue.substring(index + searchText.length, tempValue.length)
} catch (e) {
}
}
... ... @@ -356,7 +356,7 @@ export struct SearchComponent {
this.resetSearch()
} else {
if (this.hasInputContent) {
this.getRelatedSearchContent()
this.getRelatedSearchContent(value)
}
}
})
... ...
... ... @@ -142,7 +142,7 @@ export struct SearchResultComponent {
SearchResultContentComponent({ keywords: this.searchText, searchType: item ,sameSearch:this.sameSearch,isCurrentShow:this.currentIndex === index})
}.tabBar(this.TabBuilder(index, item))
.layoutWeight(1)
}, (item: string, index: number) => index.toString())
}, (item: string) => item)
}
.vertical(false)
.barMode(BarMode.Fixed)
... ...
... ... @@ -19,8 +19,7 @@ import { FollowListDetailItem } from '../../viewmodel/FollowListDetailItem'
import { FollowListStatusRequestItem } from '../../viewmodel/FollowListStatusRequestItem'
import { QueryListIsFollowedItem } from '../../viewmodel/QueryListIsFollowedItem'
import { SearchResultContentData } from '../../viewmodel/SearchResultContentData'
import {
SearchResultContentItem, SearchRmhDescription } from '../../viewmodel/SearchResultContentItem'
import { SearchResultContentItem, SearchRmhDescription } from '../../viewmodel/SearchResultContentItem'
import { CardParser } from '../CardParser'
import { FollowChildComponent } from '../mine/follow/FollowChildComponent'
import { ListHasNoMoreDataUI } from '../reusable/ListHasNoMoreDataUI'
... ... @@ -38,7 +37,7 @@ export struct SearchResultContentComponent {
@State keywords: string = ""
@State searchType: string = ""
@State data: LazyDataSource<ContentDTO> = new LazyDataSource();
tempList : ContentDTO[] = []
tempList: ContentDTO[] = []
@State data_rmh: SearchRmhDescription[] = []
@State count: number = -1;
@State isLoading: boolean = false
... ... @@ -48,14 +47,14 @@ export struct SearchResultContentComponent {
scroller: Scroller = new Scroller()
private scroller2: Scroller = new Scroller()
@State ellipseW: number = 0
@State moreWidth:number = 20
@State moreWidth: number = 20
@State listLeft: number = 0
@State isEnd: boolean = false
@Watch('updateData') @Prop sameSearch:number = 0
@Prop isCurrentShow:boolean = false;
@Watch('updateData') @Prop sameSearch: number = 0
@Prop isCurrentShow: boolean = false;
updateData(){
if(this.isCurrentShow){
updateData() {
if (this.isCurrentShow) {
this.data_rmh = []
this.data.clearAllData()
... ... @@ -115,7 +114,7 @@ export struct SearchResultContentComponent {
data.headerPhotoUrl = item.headPhotoUrl.split("?")[0]
data.mainControl = item.mainControl + ""
if(data_temp.length === 1){
if (data_temp.length === 1) {
this.bean.headPhotoUrl = item.headPhotoUrl.split("?")[0]
this.bean.cnUserName = item.userName
this.bean.creatorId = item.creatorId
... ... @@ -133,8 +132,8 @@ export struct SearchResultContentComponent {
} else {
this.bean.cnFansNum = item.fansNum + ""
}
let regex:RegExp = new RegExp('\n','g')
this.bean.introduction = item.introduction.replace(regex,'')
let regex: RegExp = new RegExp('\n', 'g')
this.bean.introduction = item.introduction.replace(regex, '')
this.bean.mainControl = item.mainControl
this.bean.banControl = item.banControl
... ... @@ -148,9 +147,13 @@ export struct SearchResultContentComponent {
data_temp.forEach((data) => {
this.data_rmh.push(data)
})
if(this.data_rmh.length > 0){
this.count = 1
}
//只有一条创作者,获取 创作者信息
if (this.data_rmh.length === 1) {
if(StringUtils.isNotEmpty(UserDataLocal.getUserId())){
if (StringUtils.isNotEmpty(UserDataLocal.getUserId())) {
//查询是否被关注
let status = new FollowListStatusRequestItem()
status.creatorIds.push(new QueryListIsFollowedItem(this.data_rmh[0].creatorId))
... ... @@ -159,7 +162,7 @@ export struct SearchResultContentComponent {
}).catch((err: Error) => {
console.log(TAG, "请求失败")
})
}else{
} else {
this.bean.status = ""
}
}
... ... @@ -192,6 +195,8 @@ export struct SearchResultContentComponent {
})
})
if (data.contentList.length > 0) {
SearcherAboutDataModel.getInteractListData(data, getContext(this)).then((newValue) => {
newValue.forEach((item) => {
resultData.list.forEach((data) => {
... ... @@ -206,32 +211,32 @@ export struct SearchResultContentComponent {
})
// 批量号主信息
let creatorIdList: string[] = []
resultData.list.forEach((value:SearchResultContentItem) => {
resultData.list.forEach((value: SearchResultContentItem) => {
creatorIdList.push(value.data.creatorId)
})
SearcherAboutDataModel.getCreatorDetailListData({creatorIdList:creatorIdList}).then((rem) => {
SearcherAboutDataModel.getCreatorDetailListData({ creatorIdList: creatorIdList }).then((rem) => {
resultData.list.forEach((value: SearchResultContentItem) => {
const landscape = value.data.landscape
let photos: FullColumnImgUrlDTO[] = []
// if (value.data.appStyle === 4) {
value.data.appStyleImages.split("&&").forEach((value) => {
let resizeParams = MinePageDatasModel.extractResizeParams(value)
if(resizeParams && resizeParams.length === 2){
if (resizeParams && resizeParams.length === 2) {
photos.push(
{
fullUrl: value,
weight:resizeParams[0],
height:resizeParams[1],
weight: resizeParams[0],
height: resizeParams[1],
landscape: Number(landscape),
} as FullColumnImgUrlDTO
)
}
})
// }
let contentDTO = this.dataTransform(rem,value, photos);
if(value.data.type != "13"){
let contentDTO = this.dataTransform(rem, value, photos);
if (value.data.type != "13") {
this.data.push(contentDTO)
if(value.data.sameContentList != null && value.data.sameContentList.length > 0) {
if (value.data.sameContentList != null && value.data.sameContentList.length > 0) {
let contentDTO2 = new ContentDTO();
contentDTO2.sameContentListJson = JSON.stringify(value.data.sameContentList)
contentDTO2.sameContentListSize = value.data.sameContentList.length
... ... @@ -257,6 +262,9 @@ export struct SearchResultContentComponent {
this.isLoading = false
this.count = this.count === -1 ? 0 : this.count
})
}else {
this.hasMore = false
}
}
build() {
... ... @@ -264,15 +272,15 @@ export struct SearchResultContentComponent {
if (this.count == 0) {
ListHasNoMoreDataUI({ style: 2 })
} else {
List({scroller:this.scroller2}) {
if (this.data_rmh != null && this.data_rmh.length > 0){
if (this.data_rmh.length === 1){
ListItem(){
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 })
}.padding({left:"31lpx",right:"31lpx"})
}else{
ListItem(){
Column(){
}.padding({ left: "31lpx", right: "31lpx" })
} else {
ListItem() {
Column() {
this.SearchListUI()
}
}
... ... @@ -283,21 +291,26 @@ export struct SearchResultContentComponent {
Column() {
if (this.searchType == "activity") {
ActivityItemComponent({ contentDTO: item })
}else if(item.sameContentListSize > 0){
} else if (item.sameContentListSize > 0) {
MoreComponent({ contentDTO: item })
}else if(item.appStyle == "9"){
Column(){
Card9Component({ compDTO: new CompDTO, contentDTO:item, pageId: "", pageName: "" })
} else if (item.appStyle == "9") {
Column() {
Card9Component({
compDTO: new CompDTO,
contentDTO: item,
pageId: "",
pageName: ""
})
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
}
} else {
if(this.data?.get(index + 1)?.sameContentListSize > 0) {
if (this.data?.get(index + 1)?.sameContentListSize > 0) {
Divider()
.width('100%')
.color($r('app.color.color_F5F5F5'))
.strokeWidth(4)
}
CardParser({compDTO:new CompDTO, contentDTO: item })
CardParser({ compDTO: new CompDTO, contentDTO: item })
}
if (index != this.data.totalCount() - 1) {
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
... ... @@ -312,7 +325,7 @@ export struct SearchResultContentComponent {
}, (item: ContentDTO, index: number) => index.toString())
//没有更多数据 显示提示
if (!this.hasMore && this.data.totalCount() > 0) {
if (!this.hasMore && (this.data.totalCount() > 0|| (this.data_rmh != null && this.data_rmh.length > 0))) {
ListItem() {
ListHasNoMoreDataUI()
}
... ... @@ -320,6 +333,7 @@ export struct SearchResultContentComponent {
}.cachedCount(5)
.edgeEffect(EdgeEffect.None)
.scrollBar(BarState.Off)
.height('100%')
.onReachEnd(() => {
console.log(TAG, "触底了");
if (!this.isLoading) {
... ... @@ -334,23 +348,23 @@ export struct SearchResultContentComponent {
@Builder
SearchListUI() {
List({initialIndex: 0,space:'8lpx',scroller: this.scroller}) {
ListItemGroup(){
List({ initialIndex: 0, space: '8lpx', scroller: this.scroller }) {
ListItemGroup() {
ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => {
ListItem() {
SearchCreatorComponent({item:item})
SearchCreatorComponent({ item: item })
}
.width('150lpx')
.height('100%')
})
}.offset({ left: this.listLeft })
ListItem(){
if (this.data_rmh.length === 10){
ListItem() {
if (this.data_rmh.length === 10) {
this.itemEnd()
}
}.height('100%')
.margin({left:'23lpx'})
.margin({ left: '23lpx' })
}
.edgeEffect(EdgeEffect.None)
.scrollBar(BarState.Off)
... ... @@ -359,10 +373,10 @@ export struct SearchResultContentComponent {
.height('219lpx')
.onReachEnd(() => {
this.isEnd = true
console.log(TAG,'is end')
console.log(TAG, 'is end')
})
.onScrollFrameBegin((offset: number, state: ScrollState) => {
console.log(TAG,'offset', offset)
console.log(TAG, 'offset', offset)
if (!this.scroller.isAtEnd()) {
this.isEnd = false
}
... ... @@ -374,31 +388,35 @@ export struct SearchResultContentComponent {
.parallelGesture(
PanGesture({ direction: PanDirection.Horizontal, distance: 1 })
.onActionStart((event: GestureEvent) => {
console.info(TAG,'Pan start')
console.info(TAG, 'Pan start')
})
.onActionUpdate((event: GestureEvent) => {
///小于10个不展示滑动
if (this.data_rmh.length < 10) return;
if (this.data_rmh.length < 10) {
return;
}
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)
console.log(TAG, "this.ellipseW==>" + this.ellipseW)
}
})
.onActionEnd((event: GestureEvent) => {
if (this.data_rmh.length < 10) return;
console.info(TAG,'Pan end')
if (this.data_rmh.length < 10) {
return;
}
console.info(TAG, 'Pan end')
this.listLeft = 0
// this.moreWidth = 20
if (event.offsetX < 0 && this.ellipseW >=20) {
console.log(TAG,'跳转')
if (event.offsetX < 0 && this.ellipseW >= 20) {
console.log(TAG, '跳转')
let params: Params = {
pageID: this.keywords
}
WDRouterRule.jumpWithPage(WDRouterPage.searchCreatorPage,params)
WDRouterRule.jumpWithPage(WDRouterPage.searchCreatorPage, params)
}
this.ellipseW = 0
})
... ... @@ -411,18 +429,17 @@ export struct SearchResultContentComponent {
.strokeWidth('12lpx')
}
@Builder
itemEnd() {
Row() {
Ellipse()
.width(2* this.ellipseW)
.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? '查看更多' : '松手查看')
Column() {
Text(this.ellipseW === 0 ? '' : this.ellipseW < 20 ? '查看更多' : '松手查看')
.width('19lpx')
.fontSize('19lpx')
.fontWeight('400lpx')
... ... @@ -437,17 +454,18 @@ export struct SearchResultContentComponent {
.height('100%')
}
private dataTransform(rem:CreatorDetailResponseItem[],value: SearchResultContentItem, photos: FullColumnImgUrlDTO[]): ContentDTO {
let rmhInfo = this.getRmhInfo(rem,value)
console.log('获取photos',JSON.stringify(photos))
console.log('获取value2',JSON.stringify(value))
private dataTransform(rem: CreatorDetailResponseItem[], value: SearchResultContentItem,
photos: FullColumnImgUrlDTO[]): ContentDTO {
let rmhInfo = this.getRmhInfo(rem, value)
console.log('获取photos', JSON.stringify(photos))
console.log('获取value2', JSON.stringify(value))
let liveType = value.data?.liveType;
let seoTags = value.data?.seoTags
let cornerMark = value.data?.cornerMark
let contentDTO = new ContentDTO();
contentDTO.liveType = liveType?liveType: ""
contentDTO.seoTags = seoTags?seoTags: ""
contentDTO.cornerMark = cornerMark?cornerMark: ""
contentDTO.liveType = liveType ? liveType : ""
contentDTO.seoTags = seoTags ? seoTags : ""
contentDTO.cornerMark = cornerMark ? cornerMark : ""
contentDTO.appStyle = value.data.appStyle + ""
contentDTO.cityCode = value.data.cityCode
contentDTO.coverSize = ""
... ... @@ -529,13 +547,13 @@ export struct SearchResultContentComponent {
}
// 搜索数据转化rmhInfo
private getRmhInfo(rem:CreatorDetailResponseItem[],value:SearchResultContentItem){
private getRmhInfo(rem: CreatorDetailResponseItem[], value: SearchResultContentItem) {
let obj = value.data
let rmhInfo:RmhInfoDTO = {
rmhHeadUrl:obj.headerPhotoUrl,
rmhName:obj.creatorName,
rmhId:obj.creatorId,
authIcon:obj.authIcon,
let rmhInfo: RmhInfoDTO = {
rmhHeadUrl: obj.headerPhotoUrl,
rmhName: obj.creatorName,
rmhId: obj.creatorId,
authIcon: obj.authIcon,
authTitle: obj.authTitle,
authTitle2: '',
banControl: 0,
... ... @@ -546,44 +564,43 @@ export struct SearchResultContentComponent {
cnMainControl: 0,
cnShareControl: 0,
cnIsComment: 0,
cnIsLike:0,
cnIsLike: 0,
posterShareControl: 0,
rmhDesc: obj.introduction,
userId: obj.userId,
userType: obj.userType,
honoraryIcon:'',
rmhPlatform:0
honoraryIcon: '',
rmhPlatform: 0
}
if(rem.length>0){
rem.forEach(item=>{
if(item.creatorId === obj.creatorId){
if (rem.length > 0) {
rem.forEach(item => {
if (item.creatorId === obj.creatorId) {
rmhInfo = {
rmhHeadUrl:item.headPhotoUrl,
rmhName:item.userName,
rmhId:item.creatorId,
authIcon:item.authIcon,
rmhHeadUrl: item.headPhotoUrl,
rmhName: item.userName,
rmhId: item.creatorId,
authIcon: item.authIcon,
authTitle: item.authTitle,
authTitle2: '',
banControl: 0,
cnIsAttention:item.isAttention,
cnIsAttention: item.isAttention,
cnAttention: 0,
cnlsComment: 0,
cnlsLike: 0,
cnMainControl: 0,
cnShareControl: 0,
cnIsComment: 0,
cnIsLike:0,
cnIsLike: 0,
posterShareControl: 0,
rmhDesc: item.introduction,
userId: item.userId,
userType: item.userType,
honoraryIcon:'',
rmhPlatform:0
honoraryIcon: '',
rmhPlatform: 0
}
}
})
}
return rmhInfo
}
}
\ No newline at end of file
... ...
... ... @@ -57,10 +57,10 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
liveToMore() {
if (!!this.compDTO.dataSourceType) {
if (this.compDTO.dataSourceType === 'OBJECT_POS') {
ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle)
return;
}
// if (this.compDTO.dataSourceType === 'OBJECT_POS') {
// ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle)
// return;
// }
if (this.compDTO.linkUrl) {
let taskAction: Action = {
type: 'JUMP_H5_BY_WEB_VIEW',
... ...
... ... @@ -5,11 +5,25 @@
*/
export class SearchResultCountItem{
/*
"allTotal":0,
"activityTotal":0,
"cmsTotal":0,
"trueTotal":0,
"pageSize":1,
"keyword":"wuhuhuan",
"totalCount":0,
"pageNum":1,
"videoTotal":0,
"rmhTotal":5
*/
keyword:string ='' //搜索关键字
allTotal: number = 0 //所有tab总量
cmsTotal: number = 0 //精选总量
rmhTotal: number = 0 //人民号总量
videoTotal: number = 0 //视频总量
activityTotal: number = 0 //活动数据总量
}
\ No newline at end of file
... ...
... ... @@ -370,6 +370,7 @@ export struct PlayUIComponent {
this.playerController?.pause()
} else {
this.isPlayStatus = true
this.playerController?.firstPlay(this.liveUrl)
this.playerController?.play()
}
})
... ...
... ... @@ -36,6 +36,7 @@ struct GuidePages {
ChildItem(index: number) {
RelativeContainer() {
Image(this.guideImage[index])
.objectFit(ImageFit.Contain)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
... ...
... ... @@ -122,6 +122,7 @@ struct LoginPage {
this.disableScreenCapture()
}
onPageHide(): void {
this.pageHideTime = DateTimeUtils.getTimeStamp()
let duration = 0
... ... @@ -132,8 +133,6 @@ struct LoginPage {
}else{
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page,duration)
}
this.isPrivacyMode = false
this.disableScreenCapture()
}
build() {
... ... @@ -262,6 +261,10 @@ struct LoginPage {
right: { anchor: "__container__", align: HorizontalAlign.End }
})
.onClick(() => {
///关闭禁止截图
this.isPrivacyMode = false
this.disableScreenCapture()
router.back()
})
.id('id_close')
... ...
... ... @@ -91,11 +91,11 @@ struct LaunchAdvertisingPage {
Text('广告')
.fontColor(Color.White)
.textAlign(TextAlign.Center)
.fontSize('24lpx')
.width('72lpx')
.height('36lpx')
.fontSize(12)
.width(36)
.height(18)
.borderRadius(2)
.margin({top:'15lpx',left:'19lpx'})
.margin({top:'8px',left:'10px'})
.backgroundColor('#80000000')
.margin({left:16})
}
... ... @@ -104,13 +104,13 @@ struct LaunchAdvertisingPage {
Button(){
Text(this.time + 's 跳过')
.fontSize('27lpx')
.fontSize(14)
.fontColor(Color.White)
.margin({left:'28lpx',right:'28lpx'})
.margin({left:14,right:14})
}
.width('148lpx')
.height('56lpx')
.margin({top:'10lpx',right:'19lpx'})
.width(74)
.height(28)
.margin({top:5,right:10})
.backgroundColor('#80000000')
.onClick(() => {
this.trackingLaunchJumpOver()
... ... @@ -125,21 +125,21 @@ struct LaunchAdvertisingPage {
Button(){
Row(){
Text(this.defaultModel.isAd == '1'?'点击跳转至详情或第三方应用':'点击跳转至详情')
.fontSize('31lpx')
.fontSize(16)
.fontColor(Color.White)
.margin({
left:'55lpx'
left:28
})
Image($r('app.media.Slice'))
.width('46lpx')
.height('46lpx')
.margin({right:'55lpx'})
.width(28)
.height(23)
.margin({right:28})
}.alignItems(VerticalAlign.Center)
}
.width('566lpx')
.height('111lpx')
.width(284)
.height(56)
.margin({
bottom: '51lpx'
bottom: 26
})
.borderWidth(1)
.borderColor(Color.White)
... ... @@ -151,8 +151,8 @@ struct LaunchAdvertisingPage {
if(this.defaultModel.screenType == '1') {
Column(){
Image($r('app.media.LaunchPage_logo'))
.width('278lpx')
.height('154lpx')
.width(140)
.height(77)
.margin({top:20})
}.width('100%').height('16%').backgroundColor(Color.White)
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
... ...
... ... @@ -40,11 +40,11 @@ struct LaunchInterestsHobbiesPage {
Row(){
Blank()
Text('跳过')
.fontSize('27lpx')
.fontSize(14)
.fontColor('#333333')
.width('54lpx')
.height('35lpx')
.margin({top:'30lpx',right:'46lpx'})
.width(30)
.height(18)
.margin({top:15,right:23})
.onClick(()=>{
//直接跳过到首页
//跳转首页
... ... @@ -58,20 +58,20 @@ struct LaunchInterestsHobbiesPage {
.justifyContent(FlexAlign.End)
Text('选择感兴趣的内容')
.fontSize('46lpx')
.fontSize(23)
.fontWeight(FontWeight.Bold)
.textAlign(TextAlign.Center)
.fontColor('#333333')
.width('100%')
.height('61lpx')
.margin({top:'54lpx'})
.height(30)
.margin({top:27})
Text('完善信息,将为您推荐个性化的内容')
.fontSize('27lpx')
.fontSize(14)
.textAlign(TextAlign.Center)
.fontColor('#9E9E9E')
.width('100%')
.height('35lpx')
.margin({top:'12lpx'})
.height(17)
.margin({top:6})
if(!this.isConnectNetwork){
EmptyComponent({ emptyType: 1,emptyHeight:"60%" ,retry: () => {
... ... @@ -141,39 +141,36 @@ struct LaunchInterestsHobbiesPage {
})
}
.width('90%')
.margin({top:'61lpx',bottom:'300lpx'})
.margin({top:30,bottom:150})
.columnsTemplate('1fr 1fr 1fr')
.columnsGap('23lpx')
.rowsGap('23lpx')
.scrollBar(BarState.Off)
}
}
.width('100%')
.height('100%')
}
.width('100%')
.height(`calc(100% - ${158 + 'lpx'})`)
// .backgroundColor(Color.Red)
.height(`calc(100% - ${260 + 'px'})`)
Stack({alignContent:Alignment.Center}){
Button(this.selectCount == 0?'选好了':'选好了(' + this.selectCount + ')')
.fontSize('35lpx')
.fontSize(18)
.fontColor('#FFFFFF')
.backgroundColor('#ED2800')
.type(ButtonType.Normal)
.borderRadius('10lpx')
.width('662lpx')
.height('84lpx')
.margin({top:'10lpx'})
.borderRadius(5)
.width(320)
.height(44)
.margin({top:5})
Image('')
.width('662lpx')
.height('84lpx')
.margin({top:'10lpx'})
.width(320)
.height(44)
.margin({top:5})
.backgroundColor(Color.White)
.opacity(this.selectCount == 0 ? 0.6 : 0)
.borderRadius('10lpx')
.borderRadius(5)
.onClick(()=>{
if (this.selectCount == 0) {
this.dialogToast.open()
... ... @@ -188,8 +185,8 @@ struct LaunchInterestsHobbiesPage {
})
}
.width('100%')
.height('108lpx')
.margin({top:0})
.height(54)
.margin({top:5})
// .backgroundColor(Color.Orange)
}
.width('100%')
... ...
... ... @@ -166,10 +166,10 @@ struct LaunchPage {
Stack({alignContent:Alignment.Bottom}){
Image($r('app.media.LaunchPage_logo'))
.width('278lpx')
.height('154lpx')
.width(139)
.height(87)
.margin({
bottom:'48lpx'
bottom:24
})
}
... ...