陈剑华

Merge remote-tracking branch 'origin/main'

Showing 48 changed files with 903 additions and 471 deletions
... ... @@ -220,14 +220,26 @@ export class ProcessUtils {
}
public static gotoDefaultWeb(content: ContentDTO) {
let taskAction: Action = {
type: 'JUMP_H5_BY_WEB_VIEW',
params: {
url: content.linkUrl,
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
Logger.debug(TAG, `gotoWeb, ${content.objectId}`);
// 内链
if(content.openType == '1'){
let taskAction: Action = {
type: 'JUMP_H5_BY_WEB_VIEW',
params: {
url: content.linkUrl,
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
}else if(content.openType == '2') {
// 外链
ProcessUtils.jumpExternalWebPage(content.linkUrl);
}else {
// 无需跳转
}
Logger.debug(TAG, `gotoWeb, ${content.objectId}`)
}
static commentGotoWeb(content: commentInfo) {
... ...
... ... @@ -18,7 +18,6 @@ export function handleJsCallAppService(data: Message, callback: (res: string) =>
if (queryString) {
url = url + `?${queryString}`
}
console.log('yzl', queryString, url)
WDHttp.get(url).then((res) => {
callback(JSON.stringify({
netError: '0',
... ...
... ... @@ -15,6 +15,7 @@ export struct WdWebComponent {
onWebPrepared: () => void = () => {
}
@Prop webUrl: string = ''
@Prop @Watch('onReloadStateChanged') reload: number = 0
@Link isPageEnd: boolean
build() {
... ... @@ -87,5 +88,11 @@ export struct WdWebComponent {
Logger.debug(TAG, 'onLoadIntercept return false');
return false
}
onReloadStateChanged() {
Logger.info(TAG, `onReloadStateChanged:::refresh, this.reload: ${this.reload}`);
if (this.reload > 0) {
this.webviewControl.refresh()
}
}
}
... ...
... ... @@ -15,6 +15,7 @@ export struct WdWebLocalComponent {
}
@Prop backVisibility: boolean = false
@Prop webResource: Resource = {} as Resource
@Prop @Watch('onReloadStateChanged') reload: number = 0
@State webHeight: string | number = '100%'
@Link isPageEnd: boolean
@State videoUrl: string = ''
... ... @@ -240,5 +241,11 @@ export struct WdWebLocalComponent {
Logger.debug(TAG, 'onLoadIntercept return false');
return false
}
onReloadStateChanged() {
Logger.info(TAG, `onReloadStateChanged:::refresh, this.reload: ${this.reload}`);
if (this.reload > 0) {
this.webviewControl.refresh()
}
}
}
... ...
... ... @@ -10,73 +10,77 @@
/*
信息流广告素材解析累
*/
export interface CompAdvMatInfoBean {
export class CompAdvMatInfoBean {
id:number = 0
/**
* 广告标题
*/
advTitle: string
advTitle: string = ''
/**
* 3:信息流广告
*/
advType: string
advType: string =''
/**
* 信息流广告类型(4:轮播图 5:三图广告 6:小图广告 7:长通栏广告 8:大图广告 9:视频广告 10:展会广告 11:冠名广告 12:顶部长通栏广告)
*/
advSubType: number
advSubType: number = 0
/**
* 素材图片信息;adv_subtype=4,5,6,7,8,9,12 时使用
*/
matImageUrl: string[]
matImageUrl: string[] = []
/**
* 视频广告地址(adv_subtype=9)
*/
matVideoUrl: string
matVideoUrl: string = ''
/**
* 扩展信息:advSubType=10,11时使用,字段示例见接口备注。
*/
extraData: string
extraData: string = ''
/**
* 链接类型: 0:无链接;1:内链(文章);2:外链
*/
linkType: string
linkType: string = ''
/**
* 链接跳转类型 :0-没链接,不用打开,1-端内打开,2-端外打开
*/
openType: string
openType: string = ''
/**
* 广告跳转链接
*/
linkUrl: string
linkUrl: string = ''
/**
* 素材类型(0:图片 1:视频)
*/
matType: string
matType: string = ''
/**
* 开屏样式(1:全屏样式 0:底部固定Logo)
*/
startStyle: string
startStyle: string = ''
// 本地字段
originalPostion : number = -1 // 广告原始投放位置
}
/**
* 信息流广告位
*/
export interface CompAdvSlotInfoBean {
export class CompAdvSlotInfoBean {
/**
* 组件id
*/
compId: string;
compId: string = '';
/**
* 广告位位置 从1开始
*/
position: number;
position: number = 0;
/**
* 频道id
*/
channelId: string;
channelId: string = '';
}
\ No newline at end of file
... ...
... ... @@ -40,7 +40,7 @@ export class CompDTO implements BaseDTO {
/**
* 信息流广告素材
*/
matInfo: CompAdvMatInfoBean = {} as CompAdvMatInfoBean
matInfo: CompAdvMatInfoBean = new CompAdvMatInfoBean
pageId?: string;
objectType?: string;
hasMore: number = 1
... ...
... ... @@ -10,6 +10,7 @@ import { BaseDTO } from '../component/BaseDTO';
@Observed
export class ContentDTO implements BaseDTO {
shareFlag?:string='1';
appStyle: string = '';
cityCode: string = '';
coverSize: string = '';
... ...
... ... @@ -30,23 +30,28 @@ export struct CarderInteraction {
this.likeBean['title'] = this.contentDetailData.newsTitle + ''
this.likeBean['userHeaderUrl'] = this.contentDetailData.userInfo?.headPhotoUrl + ''
this.likeBean['channelId'] = this.contentDetailData.reLInfo?.channelId + ''
this.contentDTO.shareFlag = this.contentDTO.shareFlag?this.contentDTO.shareFlag:'1'
console.log('是否显示分享',this.contentDTO.shareFlag)
}
build() {
Row() {
Row() {
Image($r('app.media.CarderInteraction_share'))
.width(18)
.height(18)
Text('分享')
.margin({ left: 4 })
.fontSize(14)
.fontColor('#666666')
if(this.contentDTO.shareFlag === '1'){
Row() {
Image($r('app.media.CarderInteraction_share'))
.width(18)
.height(18)
Text('分享')
.margin({ left: 4 })
.fontSize(14)
.fontColor('#666666')
}
.justifyContent(FlexAlign.Center)
.onClick(() => {
WDShare.shareContent(this.contentDetailData)
})
}
.justifyContent(FlexAlign.Center)
.onClick(() => {
WDShare.shareContent(this.contentDetailData)
})
Row() {
Image($r('app.media.CarderInteraction_comment'))
... ... @@ -66,11 +71,11 @@ export struct CarderInteraction {
}
.width('100%')
.margin({ top: 11 })
.padding({
left: 21,
right: 21
})
.justifyContent(FlexAlign.SpaceBetween)
// .padding({
// left: 21,
// right: 21
// })
.justifyContent(FlexAlign.SpaceAround)
.alignItems(VerticalAlign.Center)
}
... ...
... ... @@ -105,8 +105,10 @@ export struct CompParser {
// ZhSingleColumn05({ compDTO: compDTO })
// Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) {
Divider().strokeWidth(3).color('#ffffff').padding({ left: 16, right: 16 }).margin({top: -3})
Divider().strokeWidth(6).color('#f5f5f5')
ZhSingleColumn09({ compDTO: this.compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(6).color('#f5f5f5')
} else if (this.compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告
AdvCardParser({ pageModel: this.pageModel, compDTO: this.compDTO })
//Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 16, right: 16 })
... ...
... ... @@ -23,7 +23,6 @@ export struct ImageAndTextWebComponent {
private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean
private webPrepared = false;
private dataPrepared = false;
async onDetailDataUpdated() {
if (this.action) {
let contentId: string = ''
... ... @@ -96,6 +95,7 @@ export struct ImageAndTextWebComponent {
Column() {
WdWebLocalComponent({
webviewControl: this.webviewControl,
reload:this.reload,
webResource: $rawfile('apph5/index.html'),
backVisibility: false,
onWebPrepared: this.onWebPrepared.bind(this),
... ...
import { ContentDTO } from 'wdBean/Index';
import { ProcessUtils } from 'wdRouter/Index';
import { InteractMessageModel } from '../../model/InteractMessageModel'
import { DateTimeUtils} from 'wdKit/Index'
@Component
export struct InteractMComponent {
messageModel:InteractMessageModel = new InteractMessageModel;
... ... @@ -15,6 +15,7 @@ export struct InteractMComponent {
build() {
Row(){
Image(this.messageModel.InteractMsubM.headUrl)
.alt($r('app.media.default_head'))
.width(36)
.height(36)
.borderRadius(18)
... ... @@ -29,7 +30,7 @@ export struct InteractMComponent {
.margin({left:5})
}.width('100%')
Text(this.messageModel.time)
Text(this.getPublishTime(this.messageModel.time,DateTimeUtils.getDateTimestamp(this.messageModel.time)+""))
.margin({top:2})
.fontSize('12fp').fontColor('#B0B0B0').margin({top:10,bottom:10})
... ... @@ -41,42 +42,44 @@ export struct InteractMComponent {
.constraintSize({maxHeight:500})
}
Column(){
if (this.messageModel.contentType === '207' || this.messageModel.contentType === '209'){
Text('[你的评论]'+this.buildCommentContent()).fontSize('14fp').fontColor('#666666').constraintSize({maxHeight:500})
.margin({top:15,bottom:10})
.width('100%')
if(this.messageModel.contentType != '211' && this.messageModel.contentType != '210'){
Column(){
if (this.messageModel.contentType === '207' || this.messageModel.contentType === '209'){
Text('[你的评论]'+this.buildCommentContent()).fontSize('14fp').fontColor('#666666').constraintSize({maxHeight:500})
.margin({top:15,bottom:10})
.width('100%')
Divider()
.color('#EDEDED')
.backgroundColor('#EDEDED')
.width('100%')
.height(1)
}
Row(){
Image($r('app.media.MessageOriginTextIcon'))
.width('12')
.height('12')
Text(this.messageModel.InteractMsubM.contentTitle)
.fontSize('12fp')
.fontColor('#666666')
.maxLines(1)
.width('90%')
.textOverflow({overflow:TextOverflow.Ellipsis})
Divider()
.color('#EDEDED')
.backgroundColor('#EDEDED')
.width('100%')
.height(1)
}
Row(){
Image($r('app.media.MessageOriginTextIcon'))
.width('12')
.height('12')
Text(this.messageModel.InteractMsubM.contentTitle)
.fontSize('12fp')
.fontColor('#666666')
.maxLines(1)
.width('90%')
.textOverflow({overflow:TextOverflow.Ellipsis})
Blank()
Blank()
Image($r('app.media.mine_user_edit'))
.width('12')
.height('12')
}.margin({top:10,bottom:15})
}.padding({left:10,right:10}).alignItems(HorizontalAlign.Start).backgroundColor('#f5f5f5').borderRadius(5)
.onClick(()=>{
let contentDTO :ContentDTO = new ContentDTO();
contentDTO.objectType = this.messageModel.InteractMsubM.contentType
contentDTO.objectId = this.messageModel.InteractMsubM.contentId
ProcessUtils.processPage(contentDTO)
})
Image($r('app.media.mine_user_edit'))
.width('12')
.height('12')
}.margin({top:10,bottom:15})
}.padding({left:10,right:10}).alignItems(HorizontalAlign.Start).backgroundColor('#f5f5f5').borderRadius(5)
.onClick(()=>{
let contentDTO :ContentDTO = new ContentDTO();
contentDTO.objectType = this.messageModel.InteractMsubM.contentType
contentDTO.objectId = this.messageModel.InteractMsubM.contentId
ProcessUtils.processPage(contentDTO)
})
}
}.padding({left:5,right:5}).alignItems(HorizontalAlign.Start).width('90%')
}.padding({top:10,left:16,right:16}).width('100%').alignItems(VerticalAlign.Top)
}
... ... @@ -102,4 +105,49 @@ export struct InteractMComponent {
let contentString : string = this.messageModel.contentType === '207'?this.messageModel.message:this.messageModel.InteractMsubM.beReply;
return contentString;
}
getPublishTime(data:string,publishTime: string): string {
const publishTimestamp = parseInt(publishTime)
const currentTime = Date.now(); // 当前时间戳
// 计算差异
const timeDifference = currentTime - publishTimestamp;
// 转换为分钟、小时和天
const minutes = Math.floor(timeDifference / (1000 * 60));
const hours = Math.floor(timeDifference / (1000 * 60 * 60));
const days = Math.floor(timeDifference / (1000 * 60 * 60 * 24));
// 根据时间差返回对应的字符串
let result: string;
if (minutes < 60) {
result = `${minutes}分钟前`;
if (minutes === 0) {
result = `刚刚`;
}
} else if (hours < 24) {
result = `${hours}小时前`;
} else {
result = `${days}天前`;
if (days > 1) {
let arr = data.split(" ")
if (arr.length === 2) {
let arr2 = arr[0].split("-")
if (arr2.length === 3) {
result = `${arr2[1]}-${arr2[2]}`
}
} else {
//原始数据是时间戳 需要转成dateString
let time = DateTimeUtils.formatDate(Number(publishTime))
let arr = time.split("-")
if (arr.length === 3) {
result = `${arr[1]}-${arr[2]}`
}
}
}
}
console.log(result);
return result
}
}
\ No newline at end of file
... ...
... ... @@ -21,6 +21,8 @@ import { effectKit } from '@kit.ArkGraphics2D';
import { window } from '@kit.ArkUI';
import { PeopleShipMainViewModel } from '../../viewmodel/PeopleShipMainViewModel';
import { AudioSuspensionModel } from '../../viewmodel/AudioSuspensionModel'
import { viewColumInsightIntentShare } from '../../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
const TAG = 'MorningEveningPaperComponent';
... ... @@ -126,6 +128,10 @@ export struct MorningEveningPaperComponent {
// let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId)
let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + dailyPaperTopicPageId) //"25091"
this.pageInfoBean = pageInfoBean;
//早晚报意图上报
let context = getContext(this) as common.UIAbilityContext;
viewColumInsightIntentShare(context,String(dailyPaperTopicPageId), this.pageInfoBean)
this.title = this.pageInfoBean?.topicInfo?.title
let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN)
const dateShow = new Date(dateTime)
... ...
... ... @@ -20,6 +20,7 @@ export struct SpacialTopicPageComponent {
action: Action = {} as Action
@State webUrl: string = '';
@State isPageEnd: boolean = false
@State reload: number = 0;
@Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean
private webPrepared = false;
... ... @@ -101,6 +102,7 @@ export struct SpacialTopicPageComponent {
WdWebComponent({
webviewControl: this.webviewControl,
webUrl: this.webUrl,
reload: this.reload,
onWebPrepared: this.onWebPrepared.bind(this),
isPageEnd: $isPageEnd,
})
... ... @@ -136,6 +138,7 @@ export struct SpacialTopicPageComponent {
if (!this.action?.params?.backVisibility) {
WindowModel.shared.setWindowLayoutFullScreen(true)
}
this.reload++
}
aboutToAppear() {
... ...
... ... @@ -66,10 +66,10 @@ export struct CardSourceInfo {
*/
private getContentDtoBean(): ContentDTO {
if (this.compDTO == undefined) {
return new ContentDTO
return this.contentDTO
}
if(this.compDTO.operDataList.length == 0){
return new ContentDTO
return this.contentDTO
}
return this.compDTO.operDataList[0]
}
... ...
... ... @@ -54,7 +54,7 @@ export struct CardAdvBottom {
let currentIndex = -1
for (let i = 0; i < this.pageModel.compList.size(); i++) {
let b = this.pageModel.compList.getData(i) as CompDTO
if (a.compStyle === b.compStyle && a.matInfo === b.matInfo) {
if (a.compStyle == b.compStyle && a.matInfo.id == b.matInfo.id && a.matInfo.originalPostion == b.matInfo.originalPostion) {
currentIndex = i
break;
}
... ...
... ... @@ -66,7 +66,7 @@ export struct CardAdvTop {
let currentIndex = -1
for (let i = 0; i < this.pageModel.compList.size(); i++) {
let b = this.pageModel.compList.getData(i) as CompDTO
if (a.compStyle === b.compStyle && a.matInfo === b.matInfo) {
if (a.compStyle == b.compStyle && a.matInfo.id == b.matInfo.id && a.matInfo.originalPostion == b.matInfo.originalPostion) {
currentIndex = i
break;
}
... ...
... ... @@ -21,6 +21,7 @@ export struct Card19Component {
async aboutToAppear(): Promise<void> {
this.titleInit();
console.log('card19',JSON.stringify(this.contentDTO))
}
titleInit() {
... ... @@ -66,7 +67,7 @@ export struct Card19Component {
const photo: PhotoListBean = {
width: item.weight,
height: item.height,
picPath: item.fullUrl,
picPath: item.fullUrl||item.url,
picDesc: ''
}
return photo
... ... @@ -110,6 +111,7 @@ struct createImg {
fullUrl: ''
} as FullColumnImgUrlDTO)
}
console.log('card19-this.fullColumnImgUrls',JSON.stringify(this.fullColumnImgUrls))
}
caclImageRadius(index: number) {
... ... @@ -163,14 +165,14 @@ struct createImg {
alignContent: Alignment.BottomEnd
}) {
if (this.getPicType() === 1) {
Image(this.loadImg ? item.fullUrl : '')
Image(this.loadImg ? item.fullUrl||item.url : '')
.backgroundColor(0xf5f5f5)
.width('100%')
.height(172)
.autoResize(true)
.borderRadius(this.caclImageRadius(index))
} else if (this.getPicType() === 2) {
Image(this.loadImg ? item.fullUrl : '')
Image(this.loadImg ? item.fullUrl||item.url : '')
.width('100%')
.height(305)
.autoResize(true)
... ...
... ... @@ -7,7 +7,8 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
import { Notes } from './notes';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
// import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { viewBlogInsightIntentShare, ActionMode } from '../../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
const TAG: string = 'Card2Component';
/**
... ... @@ -104,6 +105,11 @@ export struct Card2Component {
this.clicked = true;
// persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
if (this.contentDTO?.channelId === '2001' || this.contentDTO?.channelId === '2002') {
let context = getContext(this) as common.UIAbilityContext;
viewBlogInsightIntentShare(context, this.contentDTO?.channelId, [this.compDTO], ActionMode.EXECUTED)
}
})
}
}
... ...
... ... @@ -71,7 +71,7 @@ export struct Card5Component {
}
.width(CommonConstants.FULL_WIDTH)
.fontColor(Color.White)
.fontSize($r('app.float.normal_text_size'))
.fontSize($r('app.float.font_size_17'))
.fontWeight(FontWeight.Bold)
.maxLines(2)
.align(Alignment.TopStart)
... ...
... ... @@ -190,6 +190,7 @@ export struct CommentIconComponent {
.width(this.getMeasureText(this.publishCommentModel.totalCommentNumer) +
12)// .backgroundColor(Color.Green)
.id("Text")
.visibility(this.publishCommentModel.totalCommentNumer ? Visibility.Visible : Visibility.Hidden)
// .offset({
// x: 3
// })
... ...
... ... @@ -38,20 +38,19 @@ export struct QualityCommentsComponent {
aboutToDisappear(): void {
const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage
const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口
windowClass.setWindowBackgroundColor(this.lastWindowColor)
windowClass.setWindowLayoutFullScreen(false)
// windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' })
this.dialogController = null // 将dialogController置空
}
onPageShow(): void {
WindowModel.shared.setWindowLayoutFullScreen(true)
}
aboutToAppear(): void {
onPageHide(): void {
WindowModel.shared.setWindowLayoutFullScreen(false)
}
this.fullScreen();
aboutToAppear(): void {
this.getData();
this.showAlert()
}
... ... @@ -100,13 +99,6 @@ export struct QualityCommentsComponent {
})
}
fullScreen() {
const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage
const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口
windowClass.setWindowLayoutFullScreen(true)
}
@Builder
titleHeader() {
Row() {
... ... @@ -249,7 +241,7 @@ export struct QualityCommentsComponent {
}
// ListItem() {
//
// }.height(this.bottomSafeHeight)
// }.height(`${this.bottomSafeHeight}` + 'px')
}.onReachEnd(()=>{
this.currentPage++
this.getData()
... ...
... ... @@ -55,7 +55,7 @@ export struct ZhGridLayout02 {
.width(CommonConstants.FULL_WIDTH)
GridRow({
gutter: { x: 12, y: 15 },
gutter: { x: 12, y: 13 },
columns: { sm: listSize, md: 2 },
breakpoints: { value: ['320vp', '520vp', '840vp'] }
}) {
... ... @@ -120,7 +120,7 @@ export struct ZhGridLayout02 {
}
Text(item.newsTitle)
.margin({ top: '5' })
.margin({top:'6'})
.fontSize(13)
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
... ...
... ... @@ -59,12 +59,16 @@ export struct ZhGridLayout03 {
.backgroundColor(0xf5f5f5)
.width(44)
.aspectRatio(1 / 1)
.margin({
bottom: 16
})
// .margin({
// bottom: 16
// })
Text(item.newsTitle)
.fontSize(13)
.maxLines(1)
.margin({
top: 8,
bottom:11
})
.textOverflow({ overflow: TextOverflow.Ellipsis })
}
.width('100%')
... ...
... ... @@ -7,6 +7,7 @@ import { EmptyComponent } from '../../view/EmptyComponent';
import { ChildCommentComponent } from './ChildCommentComponent';
import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDetailItem';
import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem';
import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
const TAG = "HomePageBottomCommentComponent"
... ... @@ -22,6 +23,7 @@ export struct HomePageBottomCommentComponent {
@State count: number = 0;
@Link commentNum: number
@State isGetRequest: boolean = false
private scroller: Scroller = new Scroller();
aboutToAppear() {
this.getNewPageData()
... ... @@ -42,39 +44,31 @@ export struct HomePageBottomCommentComponent {
.offset({ y: "-200lpx" })
}
} else {
List({ space: 3 }) {
LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => {
ListItem() {
ChildCommentComponent({
data: item,
levelHead: UserDataLocal.getUserLevelHeaderUrl(),
isLastItem: index === this.data_comment.totalCount() - 1
})
CustomPullToRefresh({
alldata:this.data_comment,
scroller:this.scroller,
customList:()=>{
this.ListLayout()
},
onRefresh:(resolve)=>{
this.curPageNum = 1;
this.hasMore = true
this.isGetRequest = false
this.data_comment.clear()
if (!this.isLoading){
this.getNewPageData()
if(resolve) resolve('刷新成功')
}
}, (item: CommentListItem, index: number) => index.toString())
//没有更多数据 显示提示
if (!this.hasMore) {
ListItem() {
ListHasNoMoreDataUI()
},
onLoadMore:(resolve)=> {
console.log(TAG, "触底了");
if (!this.isLoading) {
this.isLoading = true
//加载分页数据
this.getNewPageData()
}
}
}
.cachedCount(15)
.layoutWeight(1)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.nestedScroll({
scrollForward: NestedScrollMode.PARENT_FIRST,
scrollBackward: NestedScrollMode.SELF_FIRST
})
.onReachEnd(() => {
console.log(TAG, "触底了");
if (!this.isLoading) {
this.isLoading = true
//加载分页数据
this.getNewPageData()
}
})
}
}.layoutWeight(1)
... ... @@ -82,6 +76,35 @@ export struct HomePageBottomCommentComponent {
.width('100%')
}
@Builder ListLayout(){
List({ space: 3,scroller: this.scroller }) {
LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => {
ListItem() {
ChildCommentComponent({
data: item,
levelHead: UserDataLocal.getUserLevelHeaderUrl(),
isLastItem: index === this.data_comment.totalCount() - 1
})
}
}, (item: CommentListItem, index: number) => index.toString())
//没有更多数据 显示提示
if (!this.hasMore) {
ListItem() {
ListHasNoMoreDataUI()
}
}
}
.cachedCount(15)
.layoutWeight(1)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.nestedScroll({
scrollForward: NestedScrollMode.PARENT_FIRST,
scrollBackward: NestedScrollMode.SELF_FIRST
})
}
getNewPageData() {
this.isLoading = true
if (this.hasMore) {
... ...
... ... @@ -7,6 +7,7 @@ import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI';
import { FollowChildComponent } from '../follow/FollowChildComponent';
import dataPreferences from '@ohos.data.preferences';
import { EmptyComponent } from '../../view/EmptyComponent';
import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
const TAG = "HomePageBottomFollowComponent"
/**
... ... @@ -14,6 +15,7 @@ const TAG = "HomePageBottomFollowComponent"
*/
@Component
export struct HomePageBottomFollowComponent {
private scroller: Scroller = new Scroller();
@State data_follow: LazyDataSource<FollowListDetailItem> = new LazyDataSource();
@State isLoading: boolean = false
@State hasMore: boolean = true
... ... @@ -104,61 +106,30 @@ export struct HomePageBottomFollowComponent {
})
}.layoutWeight(1)
} else {
List({ space: 3 }) {
CustomPullToRefresh({
alldata:this.data_follow,
scroller:this.scroller,
customList:()=>{
this.ListLayout()
},
onRefresh:(resolve)=>{
this.curPageNum = 1;
this.hasMore = true
this.isGetRequest = false
this.data_follow.clear()
ListItem() {
Row() {
Text("关注更多人民号")
.fontWeight('400lpx')
.fontColor($r('app.color.color_222222'))
.lineHeight('38lpx')
.fontSize('27lpx')
.textAlign(TextAlign.Center)
.margin({ right: '4lpx' })
Image($r('app.media.arrow_icon_right'))
.objectFit(ImageFit.Auto)
.width('27lpx')
.height('27lpx')
if (!this.isLoading){
this.getNewPageData()
if(resolve) resolve('刷新成功')
}
.height('69lpx')
.width('659lpx')
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Center)
.backgroundColor($r('app.color.color_F5F5F5'))
.margin({ top: '31lpx', bottom: '4lpx' })
}.onClick(() => {
let params = { 'index': "1" } as Record<string, string>
WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params)
})
LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => {
ListItem() {
FollowChildComponent({ data: item, type: 2 })
},
onLoadMore:(resolve)=> {
console.log(TAG, "触底了");
if (!this.isLoading) {
this.isLoading = true
//加载分页数据
this.getNewPageData()
}
}, (item: FollowListDetailItem, index: number) => index.toString())
//没有更多数据 显示提示
if (!this.hasMore) {
ListItem() {
ListHasNoMoreDataUI()
}
}
}
.cachedCount(15)
.padding({ left: '31lpx', right: '31lpx' })
.layoutWeight(1)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.nestedScroll({
scrollForward: NestedScrollMode.PARENT_FIRST,
scrollBackward: NestedScrollMode.SELF_FIRST
})
.onReachEnd(() => {
console.log(TAG, "触底了");
if (!this.isLoading) {
this.isLoading = true
//加载分页数据
this.getNewPageData()
}
})
}
... ... @@ -167,6 +138,56 @@ export struct HomePageBottomFollowComponent {
.width('100%')
}
@Builder ListLayout(){
List({ space: 3 ,scroller:this.scroller}) {
ListItem() {
Row() {
Text("关注更多人民号")
.fontWeight('400lpx')
.fontColor($r('app.color.color_222222'))
.lineHeight('38lpx')
.fontSize('27lpx')
.textAlign(TextAlign.Center)
.margin({ right: '4lpx' })
Image($r('app.media.arrow_icon_right'))
.objectFit(ImageFit.Auto)
.width('27lpx')
.height('27lpx')
}
.height('69lpx')
.width('659lpx')
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Center)
.backgroundColor($r('app.color.color_F5F5F5'))
.margin({ top: '31lpx', bottom: '4lpx' })
}.onClick(() => {
let params = { 'index': "1" } as Record<string, string>
WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params)
})
LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => {
ListItem() {
FollowChildComponent({ data: item, type: 2 })
}
}, (item: FollowListDetailItem, index: number) => index.toString())
//没有更多数据 显示提示
if (!this.hasMore) {
ListItem() {
ListHasNoMoreDataUI()
}
}
}
.cachedCount(15)
.padding({ left: '31lpx', right: '31lpx' })
.layoutWeight(1)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.nestedScroll({
scrollForward: NestedScrollMode.PARENT_FIRST,
scrollBackward: NestedScrollMode.SELF_FIRST
})
}
@Styles
listStyle() {
.backgroundColor(Color.White)
... ...
... ... @@ -7,6 +7,7 @@ import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDet
import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem';
import { ChildCommentComponent } from './ChildCommentComponent';
import { EmptyComponent } from '../../view/EmptyComponent';
import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
const TAG = "HomePageBottomComponent"
/**
... ... @@ -23,6 +24,8 @@ export struct OtherHomePageBottomCommentComponent {
@Prop levelHead: string
@Link commentNum: number
@State isGetRequest: boolean = false
private scroller: Scroller = new Scroller();
aboutToAppear() {
this.getNewPageData()
... ... @@ -41,41 +44,31 @@ export struct OtherHomePageBottomCommentComponent {
.layoutWeight(1)
}
} else {
List({ space: 3 }) {
LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => {
ListItem() {
ChildCommentComponent({
data: item,
levelHead: this.levelHead,
isLastItem: index === this.data_comment.totalCount() - 1
})
CustomPullToRefresh({
alldata:this.data_comment,
scroller:this.scroller,
customList:()=>{
this.ListLayout()
},
onRefresh:(resolve)=>{
this.curPageNum = 1;
this.hasMore = true
this.isGetRequest = false
this.data_comment.clear()
if (!this.isLoading){
this.getNewPageData()
if(resolve) resolve('刷新成功')
}
.onClick(() => {
})
}, (item: CommentListItem, index: number) => index.toString())
//没有更多数据 显示提示
if (!this.hasMore) {
ListItem() {
ListHasNoMoreDataUI()
},
onLoadMore:(resolve)=> {
console.log(TAG, "触底了");
if (!this.isLoading) {
this.isLoading = true
//加载分页数据
this.getNewPageData()
}
}
}
.cachedCount(15)
.layoutWeight(1)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.nestedScroll({
scrollForward: NestedScrollMode.PARENT_FIRST,
scrollBackward: NestedScrollMode.SELF_FIRST
})
.onReachEnd(() => {
console.log(TAG, "触底了");
if (!this.isLoading) {
this.isLoading = true
//加载分页数据
this.getNewPageData()
}
})
}
}
... ... @@ -84,6 +77,35 @@ export struct OtherHomePageBottomCommentComponent {
.justifyContent(FlexAlign.Start)
}
@Builder ListLayout(){
List({ space: 3 ,scroller: this.scroller}) {
LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => {
ListItem() {
ChildCommentComponent({
data: item,
levelHead: this.levelHead,
isLastItem: index === this.data_comment.totalCount() - 1
})
}
}, (item: CommentListItem, index: number) => index.toString())
//没有更多数据 显示提示
if (!this.hasMore) {
ListItem() {
ListHasNoMoreDataUI()
}
}
}
.cachedCount(15)
.layoutWeight(1)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.nestedScroll({
scrollForward: NestedScrollMode.PARENT_FIRST,
scrollBackward: NestedScrollMode.SELF_FIRST
})
}
@Styles
listStyle() {
.backgroundColor(Color.White)
... ...
... ... @@ -4,6 +4,7 @@ import { WDRouterRule, WDRouterPage } from 'wdRouter';
import MinePageDatasModel from '../../../model/MinePageDatasModel';
import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem';
import { UserFollowListRequestItem } from '../../../viewmodel/UserFollowListRequestItem';
import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI';
import { EmptyComponent } from '../../view/EmptyComponent';
import { FollowChildComponent } from '../follow/FollowChildComponent';
... ... @@ -22,7 +23,7 @@ export struct OtherHomePageBottomFollowComponent{
@State count:number = 0;
@Prop curUserId: string
@State isGetRequest:boolean = false
private scroller: Scroller = new Scroller();
aboutToAppear(){
this.getNewPageData()
... ... @@ -66,68 +67,87 @@ export struct OtherHomePageBottomFollowComponent{
}.layoutWeight(1)
.justifyContent(FlexAlign.Start)
}else{
List({ space: 3 }) {
ListItem() {
Row(){
Text("关注更多人民号")
.fontWeight('400lpx')
.fontColor($r('app.color.color_222222'))
.lineHeight('38lpx')
.fontSize('27lpx')
.textAlign(TextAlign.Center)
.margin({right:'4lpx'})
Image($r('app.media.arrow_icon_right'))
.objectFit(ImageFit.Auto)
.width('27lpx')
.height('27lpx')
}.height('69lpx')
.width('659lpx')
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Center)
.backgroundColor($r('app.color.color_F5F5F5'))
.margin({top:'31lpx',bottom:'4lpx'})
}.onClick(()=>{
let params = {'index': "1"} as Record<string, string>;
WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params)
})
CustomPullToRefresh({
alldata:this.data_follow,
scroller:this.scroller,
customList:()=>{
this.ListLayout()
},
onRefresh:(resolve)=>{
this.curPageNum = 1;
this.hasMore = true
this.isGetRequest = false
this.data_follow.clear()
LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => {
ListItem() {
FollowChildComponent({data: item,type:2})
if (!this.isLoading){
this.getNewPageData()
if(resolve) resolve('刷新成功')
}
.onClick(() => {
})
}, (item: FollowListDetailItem, index: number) => index.toString())
//没有更多数据 显示提示
if(!this.hasMore){
ListItem(){
ListHasNoMoreDataUI()
},
onLoadMore:(resolve)=> {
console.log(TAG, "触底了");
if (!this.isLoading) {
this.isLoading = true
//加载分页数据
this.getNewPageData()
}
}
}.cachedCount(15)
.padding({left:'31lpx',right:'31lpx'})
.layoutWeight(1)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.nestedScroll({
scrollForward: NestedScrollMode.PARENT_FIRST,
scrollBackward: NestedScrollMode.SELF_FIRST
})
.onReachEnd(()=>{
console.log(TAG,"触底了");
if(!this.isLoading){
this.isLoading = true
//加载分页数据
this.getNewPageData()
}
})
}
}
.width('100%')
}
@Builder ListLayout(){
List({ space: 3 ,scroller:this.scroller}) {
ListItem() {
Row(){
Text("关注更多人民号")
.fontWeight('400lpx')
.fontColor($r('app.color.color_222222'))
.lineHeight('38lpx')
.fontSize('27lpx')
.textAlign(TextAlign.Center)
.margin({right:'4lpx'})
Image($r('app.media.arrow_icon_right'))
.objectFit(ImageFit.Auto)
.width('27lpx')
.height('27lpx')
}.height('69lpx')
.width('659lpx')
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Center)
.backgroundColor($r('app.color.color_F5F5F5'))
.margin({top:'31lpx',bottom:'4lpx'})
}.onClick(()=>{
let params = {'index': "1"} as Record<string, string>;
WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params)
})
LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => {
ListItem() {
FollowChildComponent({data: item,type:2})
}
.onClick(() => {
})
}, (item: FollowListDetailItem, index: number) => index.toString())
//没有更多数据 显示提示
if(!this.hasMore){
ListItem(){
ListHasNoMoreDataUI()
}
}
}.cachedCount(15)
.padding({left:'31lpx',right:'31lpx'})
.layoutWeight(1)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.nestedScroll({
scrollForward: NestedScrollMode.PARENT_FIRST,
scrollBackward: NestedScrollMode.SELF_FIRST
})
}
@Styles
listStyle() {
... ...
... ... @@ -27,7 +27,7 @@ struct EditUserInfoPage {
}
}),
alignment: DialogAlignment.Bottom,
offset:{dx:0,dy:-20}
offset:{dx:0,dy:-20},
})
aboutToAppear() {
... ... @@ -97,14 +97,14 @@ struct EditUserInfoPage {
Row(){
Text(r.title)
.fontSize(15)
.fontColor(Color.Gray)
.fontColor('#666666')
Blank()
Text(r.subTitle)
.textOverflow({overflow:TextOverflow.Ellipsis})
.maxLines(1)
.fontSize(14)
.fontColor(Color.Gray)
.fontColor(r.subTitle === '待完善'?'#999999':'#666666')
.padding({right:10})
.width('70%')
.textAlign(TextAlign.End)
... ...
... ... @@ -45,7 +45,7 @@ struct EditUserIntroductionPage {
Divider()
.margin(20)
Text('1、账号中(头像、昵称等)不允许含有违禁违规内容;\n2、最多60个字,只能输入中文、数字、英文字母。')
Text('1、账号中(头像、昵称等)不允许含有违禁违规内容;\n2、最多60个字,只能输入中文、数字、英文字母。')
.fontSize(13)
.padding(12)
.fontColor(Color.Gray).lineHeight(25)
... ... @@ -54,6 +54,8 @@ struct EditUserIntroductionPage {
.type(ButtonType.Normal)
.width('90%')
.backgroundColor('#ED2800')
.opacity(this.numCount === 0 ? 0.6 : 1)
.fontColor(this.numCount === 0 ? '#999999' : Color.White)
.borderRadius(5)
.margin(30)
.onClick(()=>{
... ...
... ... @@ -47,7 +47,7 @@ struct EditUserNikeNamePage {
Divider()
.margin(20)
Text('1、账号中(头像、昵称等)不允许含有违禁违规内容;\n2、最多16个字,只能输入中文、数字、英文字母。')
Text('1、账号中(头像、昵称等)不允许含有违禁违规内容;\n2、最多16个字,只能输入中文、数字、英文字母。')
.fontSize(13)
.padding(12)
.fontColor(Color.Gray).lineHeight(25)
... ... @@ -56,6 +56,8 @@ struct EditUserNikeNamePage {
.type(ButtonType.Normal)
.width('90%')
.backgroundColor('#ED2800')
.opacity(this.numCount === 0 ? 0.6 : 1)
.fontColor(this.numCount === 0 ? '#999999' : Color.White)
.borderRadius(5)
.margin(30)
.onClick(()=>{
... ...
... ... @@ -31,21 +31,26 @@ struct InteractMessagePage {
if(this.browSingModel.viewType == ViewType.ERROR){
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NetworkFailed})
}else if(this.browSingModel.viewType == ViewType.EMPTY){
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoHistory})
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoMessage})
}else {
CustomPullToRefresh({
alldata:this.allDatas,
scroller:this.scroller,
hasMore:this.browSingModel.hasMore,
customList:()=>{
this.ListLayout()
},
onRefresh:(resolve)=>{
this.browSingModel.currentPage = 0
this.currentPage = 1
this.getData(resolve)
},
onLoadMore:(resolve)=> {
this.browSingModel.currentPage++
this.getData()
if (this.browSingModel.hasMore === false) {
if(resolve) resolve('')
return
}
this.currentPage++
this.getData(resolve)
}
})
}
... ... @@ -75,6 +80,7 @@ struct InteractMessagePage {
}
}
}
.scrollBar(BarState.Off)
.height(CommonConstants.FULL_PARENT)
.edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果
}
... ... @@ -120,17 +126,18 @@ struct InteractMessagePage {
for (let index = 0; index < InteractMessageMItem.list.length; index++) {
const element = InteractMessageMItem.list[index];
element.InteractMsubM = JSON.parse(element.remark)
this.allDatas.push(element)
}
this.allDatas.push(...InteractMessageMItem.list)
if (InteractMessageMItem.list.length === this.browSingModel.pageSize) {
this.browSingModel.currentPage++;
this.browSingModel.hasMore = true;
} else {
if (InteractMessageMItem.hasNext === 0) {
this.browSingModel.hasMore = false;
} else {
this.browSingModel.hasMore = true;
}
} else {
this.browSingModel.viewType = ViewType.EMPTY;
if (this.currentPage === 1) {
this.browSingModel.viewType = ViewType.EMPTY;
}
}
})
}
... ...
... ... @@ -11,6 +11,7 @@ import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI';
import { BigPicCardComponent } from '../view/BigPicCardComponent';
import { contentListItemParams } from '../../model/MyCollectionModel';
import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh';
import { MyCustomDialog } from '../reusable/MyCustomDialog'
@Entry
@Component
... ... @@ -26,13 +27,26 @@ struct MyCollectionListPage {
@State currentPage: number = 1;
private scroller: Scroller = new Scroller();
dialogController: CustomDialogController = new CustomDialogController({
builder: MyCustomDialog({
confirm: () => {
this.deleteDatas()
},
titleShow:false,
tipValue: this.isAllSelect?'是否确认清空?':'确认删除'+this.deleteNum.toString()+'条收藏'
}),
autoCancel: true,
alignment: DialogAlignment.Center,
customStyle: true
})
aboutToAppear(){
this.getData()
}
build() {
Column(){
CustomTitleAndEditUI({titleName:'我的收藏',isDisplayButton:true,editCallback:()=>{
CustomTitleAndEditUI({titleName:'我的收藏',isDisplayButton:this.browSingModel.viewType == ViewType.ERROR || this.browSingModel.viewType == ViewType.EMPTY?false:true,editCallback:()=>{
this.allSelectDatas(false)
this.isAllSelect = false
this.selectDatas = []
... ... @@ -73,7 +87,7 @@ struct MyCollectionListPage {
this.allSelectDatas(isAllSelect)
},
confirmCallback:()=>{
this.deleteDatas()
this.dialogController.open()
}
})
}
... ... @@ -100,6 +114,7 @@ struct MyCollectionListPage {
if (this.browSingModel.hasMore === false) NoMoreLayout()
}
}
.scrollBar(BarState.Off)
.height(CommonConstants.FULL_PARENT)
.edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果
}
... ...
... ... @@ -15,7 +15,8 @@ import { NoMoreBean } from './NoMoreBean';
import { RefreshLayoutBean } from '../refresh/RefreshLayoutBean';
import RefreshLayout from '../refresh/RefreshLayout';
import json from '@ohos.util.json';
import { viewBlogInsightIntentShare, ActionMode } from '../../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
const TAG = 'PageComponent';
@Component
... ... @@ -31,7 +32,6 @@ export struct PageComponent {
@Prop @Watch('onAutoRefresh') autoRefresh: number = 0
private listScroller: Scroller = new Scroller();
needload: boolean = true;
build() {
Column() {
if (this.pageModel.viewType == ViewType.LOADING) {
... ... @@ -257,7 +257,6 @@ export struct PageComponent {
this.pageModel.pageTotalCompSize = 0;
PageHelper.getInitData(this.pageModel, this.pageAdvModel)
}, 100)
}
}
... ...
import { insightIntent } from '@kit.IntentsKit';
import { BottomNavDTO, CompDTO, TopNavDTO } from 'wdBean';
import { SpConstants } from 'wdConstant';
import { DisplayUtils, LazyDataSource, Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit';
... ... @@ -9,8 +8,6 @@ import { FirstTabTopSearchComponent } from '../search/FirstTabTopSearchComponent
import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils';
import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent';
import { channelSkeleton } from '../skeleton/channelSkeleton';
import { common } from '@kit.AbilityKit';
const TAG = 'TopNavigationComponent';
... ... @@ -61,8 +58,6 @@ export struct TopNavigationComponent {
@Prop @Watch('onAutoRefresh') autoRefresh: number = 0
// 传递给page的自动刷新通知
@State autoRefresh2Page: number = 0
//保存当前导航选中时的时间戳 意图开始时间
@State executedStartTime: number = new Date().getTime()
// 当前底导index
@State navIndex: number = 0
@State animationDuration: number = 0
... ... @@ -190,48 +185,6 @@ export struct TopNavigationComponent {
return item.channelType === 3
}
//意图共享
topNavInsightIntentShare(item: TopNavDTO){
let tapNavIntent: insightIntent.InsightIntent = {
intentName: 'ViewBlog',
intentVersion: '1.0.1',
identifier: '52dac3b0-6520-4974-81e5-25f0879449b5',
intentActionInfo: {
actionMode: 'EXPECTED',
currentPercentage: 50,
executedTimeSlots: {
executedEndTime: new Date().getTime(),
executedStartTime: this.executedStartTime
}
},
intentEntityInfo: {
entityName: 'Blog',
entityId: String(item.pageId) || '',
displayName: item.name,
logoURL: 'https://www-file.huawei.com/-/media/corporate/images/home/logo/huawei_logo.png',
rankingHint: 99,
isPublicData: true
}
}
console.log('yzl',JSON.stringify(tapNavIntent))
try {
let context = getContext(this) as common.UIAbilityContext;
// 共享数据
insightIntent.shareIntent(context, [tapNavIntent], (error) => {
if (error?.code) {
// 处理业务逻辑错误
console.error(`shareIntent failed, error.code: ${error?.code}, error.message: ${error?.message}`);
return;
}
// 执行正常业务
console.log('shareIntent succeed');
});
} catch (error) {
// 处理异常
console.error(`error.code: ${error?.code}, error.message: ${error?.message}`);
}
}
build() {
Column() {
... ...
import router from '@ohos.router'
import { StringUtils, ToastUtils } from 'wdKit'
import { NetworkUtil, StringUtils, ToastUtils } from 'wdKit'
import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
import { SearchHistoryItem } from '../../viewmodel/SearchHistoryItem'
import { SearchRelatedItem } from '../../viewmodel/SearchRelatedItem'
import { EmptyComponent } from '../view/EmptyComponent'
import { SearchHistoryComponent } from './SearchHistoryComponent'
import { SearchHotsComponent } from './SearchHotsComponent'
import { SearchRelatedComponent } from './SearchRelatedComponent'
... ... @@ -30,6 +31,7 @@ export struct SearchComponent {
scroller: Scroller = new Scroller()
@State count:string[] = []
@State isGetRequest:boolean = false;
@State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
aboutToAppear() {
//获取提示滚动
... ... @@ -127,8 +129,16 @@ export struct SearchComponent {
.padding({ left: '31lpx', right: '31lpx' })
} else {
if (this.hasChooseSearch) {
//搜索结果
SearchResultComponent({count:this.count,searchText:this.searchText,isGetRequest:this.isGetRequest})
if(!this.isConnectNetwork){
EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
this.getSearchInputResData(this.searchText)
}})
.layoutWeight(1)
.width('100%')
}else{
//搜索结果
SearchResultComponent({count:this.count,searchText:this.searchText,isGetRequest:this.isGetRequest})
}
} else {
//联想搜索
SearchRelatedComponent({relatedSearchContentData:$relatedSearchContentsData,onGetSearchRes: (item): void => this.getSearchRelatedResData(item),searchText:this.searchText})
... ... @@ -138,7 +148,6 @@ export struct SearchComponent {
.width('100%')
}
/**
* 点击搜索记录列表回调
* @param content
... ... @@ -329,11 +338,13 @@ export struct SearchComponent {
// }
}
this.isGetRequest = true
this.resetSearch()
this.resetSearch()
this.isConnectNetwork = NetworkUtil.isNetConnected()
}).catch((err: Error) => {
console.log(TAG, JSON.stringify(err))
this.isGetRequest = true
this.resetSearch()
this.isConnectNetwork = NetworkUtil.isNetConnected()
})
}
... ...
... ... @@ -15,6 +15,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
import MinePageDatasModel from '../../model/MinePageDatasModel'
import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
import { CreatorDetailRequestItem } from '../../viewmodel/CreatorDetailRequestItem'
import { CreatorDetailResponseItem } from '../../viewmodel/CreatorDetailResponseItem';
import { FollowListDetailItem } from '../../viewmodel/FollowListDetailItem'
import { FollowListStatusRequestItem } from '../../viewmodel/FollowListStatusRequestItem'
import { QueryListIsFollowedItem } from '../../viewmodel/QueryListIsFollowedItem'
... ... @@ -63,6 +64,7 @@ export struct SearchResultContentComponent {
if (this.hasMore) {
SearcherAboutDataModel.getSearchResultListData("15", `${this.curPageNum}`, this.searchType, this.keywords,
getContext(this)).then((value) => {
if (!this.data || value.list.length == 0) {
this.hasMore = false
this.isLoading = false
... ... @@ -70,7 +72,6 @@ export struct SearchResultContentComponent {
} else {
if (value.list[0].dataList != null) {
let data_temp: SearchRmhDescription[] = []
data_temp = value.list[0].dataList
//TODO 查询创作者详情接口
... ... @@ -121,7 +122,6 @@ export struct SearchResultContentComponent {
data_temp.forEach((data) => {
this.data_rmh.push(data)
})
//只有一条创作者,获取 创作者信息
if (this.data_rmh.length === 1) {
if(StringUtils.isNotEmpty(UserDataLocal.getUserId())){
... ... @@ -178,21 +178,34 @@ export struct SearchResultContentComponent {
}
})
})
// 批量号主信息
let creatorIdList: string[] = []
resultData.list.forEach((value:SearchResultContentItem) => {
creatorIdList.push(value.data.creatorId)
})
SearcherAboutDataModel.getCreatorDetailListData({creatorIdList:creatorIdList}).then((rem) => {
resultData.list.forEach((value) => {
let photos: FullColumnImgUrlDTO[] = []
if (value.data.appStyle === 4) {
value.data.appStyleImages.split("&&").forEach((value) => {
photos.push({ url: value } as FullColumnImgUrlDTO)
})
}
let contentDTO = this.dataTransform(value, photos);
if(value.data.type != "13"){
this.data.push(contentDTO)
}
resultData.list.forEach((value) => {
let photos: FullColumnImgUrlDTO[] = []
// if (value.data.appStyle === 4) {
value.data.appStyleImages.split("&&").forEach((value) => {
const resizeParams = this.extractResizeParams(value)
photos.push({ fullUrl: value,weight:resizeParams.width,height:resizeParams.height, } as FullColumnImgUrlDTO)
})
// }
let contentDTO = this.dataTransform(rem,value, photos);
if(value.data.type != "13"){
this.data.push(contentDTO)
}
})
}).catch((err: Error) => {
console.log(TAG, JSON.stringify(err))
})
this.data.notifyDataReload()
this.count = this.data.totalCount()
if (this.data.totalCount() < resultData.totalCount) {
... ... @@ -380,84 +393,171 @@ export struct SearchResultContentComponent {
.strokeWidth('12lpx')
}
private dataTransform(value: SearchResultContentItem, photos: FullColumnImgUrlDTO[]): ContentDTO {
let contentDTO = new ContentDTO();
contentDTO.appStyle = value.data.appStyle + ""
contentDTO.cityCode = value.data.cityCode
contentDTO.coverSize = ""
contentDTO.coverType = value.data.type == "5" ? 1 : -1
contentDTO.coverUrl =
this.searchType == "activity" ? value.data.zhChannelPageImg : value.data.appStyleImages.split("&&")[0];
contentDTO.description = value.data.description
contentDTO.districtCode = value.data.districtCode
contentDTO.endTime = value.data.endTime
contentDTO.hImageUrl = ""
contentDTO.heatValue = ""
contentDTO.innerUrl = ""
contentDTO.landscape = Number.parseInt(value.data.landscape)
contentDTO.linkUrl = value.data.linkUrl
contentDTO.openLikes = Number.parseInt(value.data.openLikes)
contentDTO.openUrl = ""
contentDTO.pageId = value.data.pageId
contentDTO.programAuth = ""
contentDTO.programId = ""
contentDTO.programName = ""
contentDTO.programSource = -1
contentDTO.programType = Number.parseInt(value.data.status)
contentDTO.provinceCode = value.data.provinceCode
contentDTO.showTitleEd = value.data.showTitleEd
contentDTO.showTitleIng = value.data.showTitleIng
contentDTO.showTitleNo = value.data.showTitleNo
contentDTO.startTime = value.data.startTime
contentDTO.subType = ""
contentDTO.subtitle = ""
contentDTO.title = value.data.title
contentDTO.vImageUrl = ""
contentDTO.screenType = ""
contentDTO.source = StringUtils.isEmpty(value.data.creatorName) ? value.data.sourceName : value.data.creatorName
contentDTO.objectId = value.data.id
contentDTO.objectType = value.data.type
contentDTO.channelId = value.data.channelId
contentDTO.relId = value.data.relId
contentDTO.relType = value.data.relType
contentDTO.newsTitle = value.data.titleLiteral;
contentDTO.publishTime =
StringUtils.isNotEmpty(value.data.firstPublishTime) ? value.data.firstPublishTime : value.data.publishTime
contentDTO.visitorComment = -1
contentDTO.fullColumnImgUrls = photos
contentDTO.newsSummary = ""
contentDTO.hasMore = -1
contentDTO.slideShows = []
contentDTO.voiceInfo = {} as VoiceInfoDTO
contentDTO.tagWord = -1
contentDTO.isSelect = true
contentDTO.rmhInfo = {} as RmhInfoDTO
contentDTO.photoNum = -1
contentDTO.liveInfo = {} as LiveInfoDTO;
contentDTO.videoInfo = {
videoDuration: Number.parseInt(value.data.duration)
} as VideoInfoDTO;
let interact = new InteractDataDTO()
interact.collectNum = value.data.collectNum
interact.commentNum = value.data.commentNum
interact.contentId = value.data.id
interact.contentType = Number.parseInt(value.data.type)
interact.likeNum = value.data.likeNum
interact.readNum = Number.parseInt(value.data.readNum)
interact.shareNum = Number.parseInt(value.data.shareNum)
contentDTO.interactData = interact
contentDTO.corner = ''
contentDTO.rmhPlatform = 0
contentDTO.newTags = ''
contentDTO.isSearch = true
contentDTO.publishTimestamp = ""
contentDTO.bottomNavId = '';
contentDTO.openType = '';
contentDTO.extra = '';
contentDTO.titleShow = value.data.type == "5" ? 1 : 0;
contentDTO.contentText = value.data.contentText;
return contentDTO;
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 contentDTO = new ContentDTO();
contentDTO.appStyle = value.data.appStyle + ""
contentDTO.cityCode = value.data.cityCode
contentDTO.coverSize = ""
contentDTO.coverType = value.data.type == "5" ? 1 : -1
contentDTO.coverUrl =
this.searchType == "activity" ? value.data.zhChannelPageImg : value.data.appStyleImages.split("&&")[0];
contentDTO.description = value.data.description
contentDTO.districtCode = value.data.districtCode
contentDTO.endTime = value.data.endTime
contentDTO.hImageUrl = ""
contentDTO.heatValue = ""
contentDTO.innerUrl = ""
contentDTO.landscape = Number.parseInt(value.data.landscape)
contentDTO.linkUrl = value.data.linkUrl
contentDTO.openLikes = Number.parseInt(value.data.openLikes)
contentDTO.openUrl = ""
contentDTO.pageId = value.data.pageId
contentDTO.programAuth = ""
contentDTO.programId = ""
contentDTO.programName = ""
contentDTO.programSource = -1
contentDTO.programType = Number.parseInt(value.data.status)
contentDTO.provinceCode = value.data.provinceCode
contentDTO.showTitleEd = value.data.showTitleEd
contentDTO.showTitleIng = value.data.showTitleIng
contentDTO.showTitleNo = value.data.showTitleNo
contentDTO.startTime = value.data.startTime
contentDTO.subType = ""
contentDTO.subtitle = ""
contentDTO.title = value.data.title
contentDTO.vImageUrl = ""
contentDTO.screenType = ""
contentDTO.source = StringUtils.isEmpty(value.data.creatorName) ? value.data.sourceName : value.data.creatorName
contentDTO.objectId = value.data.id
contentDTO.objectType = value.data.type
contentDTO.channelId = value.data.channelId
contentDTO.relId = value.data.relId
contentDTO.relType = value.data.relType
contentDTO.newsTitle = value.data.titleLiteral;
contentDTO.publishTime =
StringUtils.isNotEmpty(value.data.firstPublishTime) ? value.data.firstPublishTime : value.data.publishTime
contentDTO.visitorComment = -1
contentDTO.fullColumnImgUrls = photos
contentDTO.newsSummary = ""
contentDTO.hasMore = -1
contentDTO.slideShows = []
contentDTO.voiceInfo = {} as VoiceInfoDTO
contentDTO.tagWord = -1
contentDTO.isSelect = true
contentDTO.rmhInfo = {} as RmhInfoDTO
contentDTO.photoNum = -1
contentDTO.liveInfo = {} as LiveInfoDTO;
contentDTO.videoInfo = {
videoDuration: Number.parseInt(value.data.duration)
} as VideoInfoDTO;
let interact = new InteractDataDTO()
interact.collectNum = value.data.collectNum
interact.commentNum = value.data.commentNum
interact.contentId = value.data.id
interact.contentType = Number.parseInt(value.data.type)
interact.likeNum = value.data.likeNum
interact.readNum = Number.parseInt(value.data.readNum)
interact.shareNum = Number.parseInt(value.data.shareNum)
contentDTO.interactData = interact
contentDTO.corner = ''
contentDTO.rmhPlatform = 0
contentDTO.newTags = ''
contentDTO.isSearch = true
contentDTO.publishTimestamp = ""
contentDTO.bottomNavId = '';
contentDTO.openType = '';
contentDTO.extra = '';
contentDTO.titleShow = value.data.type == "5" ? 1 : 0;
contentDTO.rmhInfo = rmhInfo
contentDTO.shareFlag = value.data.shareFlag
return contentDTO;
}
// 搜索数据转化rmhInfo
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,
authTitle: obj.authTitle,
authTitle2: '',
banControl: 0,
cnIsAttention: 0,
cnAttention: 0,
cnlsComment: 0,
cnlsLike: 0,
cnMainControl: 0,
cnShareControl: 0,
cnIsComment: 0,
cnIsLike:0,
posterShareControl: 0,
rmhDesc: obj.introduction,
userId: obj.userId,
userType: obj.userType,
honoraryIcon:''
}
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,
authTitle: item.authTitle,
authTitle2: '',
banControl: 0,
cnIsAttention:item.isAttention,
cnAttention: 0,
cnlsComment: 0,
cnlsLike: 0,
cnMainControl: 0,
cnShareControl: 0,
cnIsComment: 0,
cnIsLike:0,
posterShareControl: 0,
rmhDesc: item.introduction,
userId: item.userId,
userType: item.userType,
honoraryIcon:''
}
}
})
}
return rmhInfo
}
private extractResizeParams(url: string) {
const heightRegex = /h_(\d+)/; // 匹配高度参数,如h_450
const widthRegex = /w_(\d+)/; // 匹配宽度参数,如w_800
const heightMatch = url.match(heightRegex);
const widthMatch = url.match(widthRegex);
let height = heightMatch ? `h_${heightMatch[1]}` : undefined
let width = widthMatch ? `w_${widthMatch[1]}` : undefined
let h:number =0
let w:number =0
if(height){
h = Number(height.split('_')[1])
}
if(width){
w = Number(width.split('_')[1])
}
interface Obj{
width:number;
height:number
}
let obj:Obj = {
width:w,
height:h
}
return obj
}
}
\ No newline at end of file
... ...
... ... @@ -19,7 +19,7 @@ export struct BigPicCardComponent {
aboutToAppear() {
// 取第一个数据
if (this.compDTO.operDataList) {
if (this.compDTO.operDataList.length > 0) {
this.contentDTO = this.compDTO.operDataList[0];
this.contentDTO.appStyle = "2";
}
... ...
... ... @@ -55,10 +55,10 @@ export struct LikeComponent {
} else if (this.componentType == 4) {
// 直播,点赞按钮底测有灰色圆角背景+右上点赞数量
this.likeCompStyle4()
} else if (this.componentType == 5) {
} else if (this.componentType == 5) {
// 图集点赞,展示标识
this.likeCompStyle5()
}else {
} else {
//1: 底部栏目样式 默认样式
this.likeCompStyle1()
}
... ... @@ -188,7 +188,7 @@ export struct LikeComponent {
.alignItems(VerticalAlign.Center)
.position({ x: '100%', })
.markAnchor({ x: '100%' })
.backgroundImage(this.likeStatus? $r('app.media.ic_like_back_Select'):$r('app.media.ic_like_back'))
.backgroundImage(this.likeStatus ? $r('app.media.ic_like_back_Select') : $r('app.media.ic_like_back'))
.backgroundImageSize(ImageSize.Auto)
.visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden)
}.width(24).height(24)
... ... @@ -209,7 +209,7 @@ export struct LikeComponent {
.width(36)
.height(36)
.borderRadius(18)
.backgroundColor(this.pageComponentType === 4 ? '#4D000000' : '#FFF5F5F5')
.backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : '#FFF5F5F5')
Row() {
... ...
... ... @@ -9,7 +9,7 @@ export struct AreaPickerDialog {
@Provide currentSecondBean: AreaListManageModel = new AreaListManageModel('','','',[])
@Provide currentThirdBean: AreaListManageModel = new AreaListManageModel('','','',[])
controller: CustomDialogController
title: string = '地区选择'
title: string = '修改地区'
@Provide dataSource: AreaListModel[] = []
result: JSON[] = [];
confirmCallback: (province:string,city:string,county:string,address:string) => void = () => {
... ... @@ -33,7 +33,7 @@ export struct AreaPickerDialog {
Blank()
Button('确定',{type:ButtonType.Normal})
Button('提交',{type:ButtonType.Normal})
.onClick(()=> {
this.controller.close()
this.confirmCallback(this.currentFirst.label,this.currentSecondBean.label,this.currentThirdBean.label,this.currentFirst.label+this.currentSecondBean.label+this.currentThirdBean.label);
... ...
... ... @@ -28,9 +28,11 @@ export struct FirstLevelComponent {
this.currentFirst = EditInfoViewModel.getAreaListManageModel(this.dataSource[index as number])
})
.backgroundColor(Color.White)
.border({color:'#e2e2e2',width:{right:0.5}})
// .border({color:'#e2e2e2',width:{right:0.5}})
.width('100%')
.layoutWeight(1)
.selectedTextStyle({color:'#666666'})
.textStyle({color:'#999999'})
}
}
.justifyContent(FlexAlign.Center)
... ...
... ... @@ -21,9 +21,11 @@ export struct SecondLevelComponent {
this.currentSecondBean = EditInfoViewModel.getAreaListManageModel(this.currentFirst.children[index as number])
})
.backgroundColor(Color.White)
.border({color:'#e2e2e2',width:{right:0.5}})
// .border({color:'#e2e2e2',width:{right:0.5}})
.width('100%')
.layoutWeight(1)
.selectedTextStyle({color:'#666666'})
.textStyle({color:'#999999'})
}
}
.justifyContent(FlexAlign.Center)
... ...
... ... @@ -22,9 +22,11 @@ export struct ThirdLevelComponent {
this.currentThirdBean = EditInfoViewModel.getAreaListManageModel(this.currentSecondBean.children[index as number])
})
.backgroundColor(Color.White)
.border({color:'#e2e2e2',width:{right:0.5}})
// .border({color:'#e2e2e2',width:{right:0.5}})
.width('100%')
.layoutWeight(1)
.selectedTextStyle({color:'#666666'})
.textStyle({color:'#999999'})
}
}
.justifyContent(FlexAlign.Center)
... ...
import { common } from '@kit.AbilityKit';
import { insightIntent } from '@kit.IntentsKit';
import { CompDTO, CompList, ContentDTO, PageInfoBean } from 'wdBean';
function generateUniqueId() {
// 生成当前时间戳
let timestamp = new Date().getTime();
// 将时间戳转换成16进制字符串
let hexString = timestamp.toString(16);
// 确保字符串长度为16位,不足的话在前面补0
while (hexString.length < 16) {
hexString = '0' + hexString;
}
// 格式化为UUID样式
let uuid = hexString.substring(0, 8) + '-' +
hexString.substring(8, 12) + '-' +
hexString.substring(12, 16) + '-' +
hexString.substring(16, 20) + '-' +
hexString.substring(20);
return uuid;
}
export const enum ActionMode {
// 将来时
EXPECTED = 'EXPECTED',
// 完成时
EXECUTED = 'EXECUTED',
}
//ViewBlog意图共享-频道列表
export function viewBlogInsightIntentShare(context: common.UIAbilityContext, entityGroupId: string,
compList: CompDTO[] | CompList[], actionMode: ActionMode) {
console.log('viewBlogInsightIntentShare',actionMode)
let insightIntentArray: insightIntent.InsightIntent [] = []
if (compList?.length > 0) {
compList?.forEach((item: CompDTO | CompList) => {
item.operDataList.forEach((_item: ContentDTO) => {
let viewBlogInsightIntentItem: insightIntent.InsightIntent = {
intentName: 'ViewBlog',
intentVersion: '1.0.1',
identifier: generateUniqueId(),
intentActionInfo: {
actionMode,
currentPercentage: 50,
//目前不考虑发生时段
// executedTimeSlots: {
// executedEndTime: new Date().getTime(),
// executedStartTime: pageModel.executedStartTime
// }
},
intentEntityInfo: {
entityName: 'Blog',
entityId: _item?.objectId,
displayName: _item?.newsTitle,
entityGroupId, //channelId
logoURL: _item?.coverUrl,
metadataModificationTime: _item?.publishTimestamp,
blogTitle: _item?.newsTitle,
blogType: 'Normal',
blogCategory: item.name,
categoryDisplayName: item.name,
blogSubTitle: _item?.newsSummary.length > 20 ?
_item?.newsSummary.substring(0, 20) : _item?.newsSummary,
blogAuthor: _item?.source,
blogPublishTime: _item?.publishTimestamp,
tag: _item?.newTags,
likeCount: _item?.interactData?.likeNum || 0,
forwardCount: _item?.interactData?.shareNum || 0,
commentCount: _item?.interactData?.commentNum || 0,
favorites: _item?.interactData?.collectNum || 0,
viewCount: _item?.interactData?.readNum || 0,
rankingHint: 99,
isPublicData: true
}
}
insightIntentArray.push(viewBlogInsightIntentItem)
})
})
console.log('yzl', JSON.stringify(insightIntentArray[0]))
try {
// 共享数据
insightIntent.shareIntent(context, insightIntentArray, (error) => {
if (error?.code) {
// 处理业务逻辑错误
console.error(`shareIntent failed, error.code: ${error?.code}, error.message: ${error?.message}`);
return;
}
// 执行正常业务
console.log('shareIntent succeed');
});
} catch (error) {
// 处理异常
console.error(`error.code: ${error?.code}, error.message: ${error?.message}`);
}
}
}
//ViewBlog意图共享-早晚报
export function viewColumInsightIntentShare(context: common.UIAbilityContext, entityId: string,
pageInfoBean: PageInfoBean) {
console.log('viewColumInsightIntentShare')
let viewBlogInsightIntentItem: insightIntent.InsightIntent = {
intentName: 'ViewColumn',
intentVersion: '1.0.1',
identifier: generateUniqueId(),
intentActionInfo: {
actionMode: ActionMode.EXECUTED,
currentPercentage: 50,
},
intentEntityInfo: {
entityName: 'Column',
entityId,
displayName:pageInfoBean?.topicInfo?.title,
description: pageInfoBean?.shareSummary,
logoURL:pageInfoBean?.shareCoverUrl,
activityType:['RecentViews'],
columnTitle: pageInfoBean?.topicInfo?.title,
columnSubTitle: pageInfoBean?.shareSummary,
rankingHint: 99,
isPublicData: true
}
}
try {
// 共享数据
insightIntent.shareIntent(context, [viewBlogInsightIntentItem], (error) => {
if (error?.code) {
// 处理业务逻辑错误
console.error(`shareIntent failed, error.code: ${error?.code}, error.message: ${error?.message}`);
return;
}
// 执行正常业务
console.log('shareIntent succeed');
});
} catch (error) {
// 处理异常
console.error(`error.code: ${error?.code}, error.message: ${error?.message}`);
}
}
... ...
... ... @@ -125,7 +125,7 @@ class EditInfoViewModel {
this.BasePostRequest(item.editDataType == WDEditDataModelType.WDEditDataModelType_nickname?HttpUrlUtils.APPOINTMENT_editUserDetail1_PATH:HttpUrlUtils.APPOINTMENT_editUserDetail_PATH,this.params)
.then((navResDTO: ResponseDTO) => {
if (navResDTO.code == 0) {
promptAction.showToast({ message: '修改成功' })
promptAction.showToast({ message: '您的资料已提交' })
success(navResDTO)
}else {
promptAction.showToast({ message: navResDTO.message })
... ...
... ... @@ -11,7 +11,8 @@ import { ArrayList } from '@kit.ArkTS';
import { WDViewDefaultType } from '../components/view/EmptyComponent';
import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean';
import { BaseDTO } from 'wdBean/src/main/ets/bean/component/BaseDTO';
import { viewBlogInsightIntentShare, ActionMode } from '../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
const TAG = 'PageHelper';
/**
... ... @@ -272,15 +273,17 @@ export class PageHelper {
let b = advPosition - a;
// console.error('ZZZXXXXX', matInfo.advSubType + '-------------' + matInfo.advTitle + " " + advPosition + " " + a + " " + b)
if (b <= pageCompSize && b >= 0) {
// 创建广告稿件
let advComp: CompDTO = new CompDTO;
advComp.compStyle = CompStyle.Card_Comp_Adv
advComp.matInfo = matInfo
if (pageCompSize == slotInfo.position) {
pageCompList.add(advComp)
} else {
pageCompList.insert(advComp, b + layoutAdvIndex)
}
matInfo.originalPostion = pageCompList.getIndexOf(advComp)
layoutAdvIndex = layoutAdvIndex + 1;
... ... @@ -347,6 +350,11 @@ export class PageHelper {
PageViewModel.getInteractData(compList).then((data: InteractDataDTO[]) => {
// 刷新,替换所有数据
this.resetInteract(data, pageModel.compList)
if(pageModel?.channelId === '2001' || pageModel?.channelId === '2002'){
//早晚报意图上报
let context = getContext(this) as common.UIAbilityContext;
viewBlogInsightIntentShare(context, pageModel?.channelId, compList, ActionMode.EXPECTED)
}
})
// 测试数据
... ...
... ... @@ -199,6 +199,7 @@ export struct DetailPlayShortVideoPage {
})
}
.width('100%')
.layoutWeight(1)
.onClick(() => {
this.playerController?.switchPlayOrPause();
... ... @@ -223,9 +224,10 @@ export struct DetailPlayShortVideoPage {
}
.height('100%')
.width('100%')
.padding({
top: this.displayDirection === DisplayDirection.VIDEO_HORIZONTAL ? 0 : this.topSafeHeight + 'px'
})
// .padding({
// top: this.displayDirection === DisplayDirection.VIDEO_HORIZONTAL ? 0 : this.topSafeHeight + 'px'
// })
if (this.showCommentList) {
CommentComponentPage({})
... ...
... ... @@ -258,15 +258,12 @@ export struct VideoChannelDetail {
.visibility(this.isMouted ? Visibility.None : Visibility.Visible)
Swiper(this.swiperController) {
ForEach(this.data, (item: ContentDetailDTO, index: number) => {
Column() {
DetailPlayShortVideoPage({
contentDetailData: item,
currentIndex: this.currentIndex,
index: index,
interactData: this.interactDataList[index]
})
}.width('100%')
.height('100%')
DetailPlayShortVideoPage({
contentDetailData: item,
currentIndex: this.currentIndex,
index: index,
interactData: this.interactDataList[index]
})
}, (item: ContentDetailDTO) => item.newsId + '')
}
.displayCount(1, true)
... ...
... ... @@ -47,7 +47,7 @@ struct LaunchInterestsHobbiesPage {
.width('100%')
.height('61lpx')
.margin({top:'84lpx'})
Text('完善信息将为您推荐个性化的内容')
Text('完善信息,将为您推荐个性化的内容')
.fontSize('27lpx')
.textAlign(TextAlign.Center)
.fontColor('#9E9E9E')
... ... @@ -69,8 +69,8 @@ struct LaunchInterestsHobbiesPage {
Image('')
.width('100%')
.height('100%')
.backgroundColor(Color.Gray)
.opacity(item.choose?0.85:0)
.backgroundColor(Color.Black)
.opacity(item.choose?0.5:0)
.borderRadius(5)
}
... ... @@ -134,14 +134,14 @@ struct LaunchInterestsHobbiesPage {
.width('662lpx')
.height('84lpx')
.backgroundColor(Color.White)
.opacity(this.selectCount == 0 ? 0.3 : 0)
.opacity(this.selectCount == 0 ? 0.6 : 0)
.borderRadius('10lpx')
.onClick(()=>{
if (this.selectCount == 0) {
promptAction.showToast({
message : '请先选择您感兴趣的内容哦',
duration: 2000,
bottom: '50%'
bottom: '50%',
})
return
}
... ...