wangliang_wd

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

* 'main' of http://192.168.1.42/developOne/harmonyPool: (38 commits)
  fix:somebug
  fix:somebug
  fix:somebug
  desc:埋点[搜索页 - 搜索按钮点击]
  fix:somebug
  视频类型稿件详情页-全部评论,已收藏视频未展示已收藏状态
  desc:埋点[关于页面 - 普通按钮点击]
  desc:埋点[隐私设置页 - 普通按钮]
  desc:埋点[账号与安全页 - 普通按钮]
  fix:bug[17942] 我的消息中的预约消息跳转直播节目会黑屏
  desc:埋点[设置 - 普通按钮-设置]
  fix(17806):功能缺陷-【uat】意见反馈-描述您的问题-上传图片后,点击叉叉按钮,没有反应,预期删除图片,并显示加号上传按钮,看图
  feat: 查看更多相似组件ui
  代码结构调整,将底导、图集从component提到phone里
  ref |> 临时解决视频详情评论点赞资源无法加载问题
  ref |> 调整评论点赞按钮图标
  fix(17804):功能缺陷-【uat】意见反馈-描述您的问题-android上传图片能上传3张,鸿蒙只能2张,看图
  图集详情页-页面与动态区域分割线样式不对
  feat: 17989 轮播图卡-音频专题数据展示交互问题
  fix(17581):人民号动态详情页的长图显示方式与安卓不一致
  ...
Showing 48 changed files with 797 additions and 177 deletions
{
"float": [
{
"name": "font_size_10",
"value": "10fp"
},
{
"name": "font_size_11",
"value": "11fp"
},
{
"name": "font_size_12",
"value": "12fp"
},
{
"name": "font_size_13",
"value": "13fp"
},
{
"name": "font_size_14",
"value": "14fp"
},
{
"name": "font_size_16",
"value": "16fp"
},
{
"name": "normal_text_size",
"value": "16fp"
},
{
"name": "font_size_17",
"value": "17fp"
},
{
"name": "selected_text_size",
"value": "17vp"
},
{
"name": "font_size_18",
"value": "18fp"
},
{
"name": "font_size_24",
"value": "24fp"
},
{
"name": "font_size_20",
"value": "20fp"
},
{
"name": "font_size_36",
"value": "36fp"
},
{
"name": "margin_4_negative",
"value": "-4vp"
},
{
"name": "margin_6_negative",
"value": "-6vp"
},
{
"name": "main_margin",
"value": "14vp"
},
{
"name": "margin_4",
"value": "4vp"
},
{
"name": "margin_8",
"value": "8vp"
},
{
"name": "margin_9",
"value": "9vp"
},
{
"name": "label_margin_top",
"value": "10vp"
},
{
"name": "margin_12",
"value": "12vp"
},
{
"name": "margin_bottom_16",
"value": "16vp"
},
{
"name": "label_margin_bottom",
"value": "8vp"
},
{
"name": "single_row_03_item_width",
"value": "158vp"
},
{
"name": "single_row_03_item_height",
"value": "160vp"
},
{
"name": "margin_80",
"value": "80vp"
},
{
"name": "margin_2",
"value": "2vp"
},
{
"name": "margin_5",
"value": "5vp"
},
{
"name": "margin_7",
"value": "7vp"
},
{
"name": "margin_20",
"value": "20vp"
},
{
"name": "margin_24",
"value": "24vp"
},
{
"name": "margin_25",
"value": "25vp"
},
{
"name": "margin_28",
"value": "28vp"
},
{
"name": "margin_40",
"value": "40vp"
},
{
"name": "margin_48",
"value": "48vp"
},
{
"name": "margin_54",
"value": "54vp"
},
{
"name": "margin_60",
"value": "60vp"
},
{
"name": "margin_154",
"value": "154vp"
},
{
"name": "single_row_03_img_height",
"value": "88vp"
},
{
"name": "image_border_radius",
"value": "5vp"
},
{
"name": "button_border_radius",
"value": "3vp"
},
{
"name": "border_radius_6",
"value": "6vp"
},
{
"name": "bottom_navigation_margin_bottom",
"value": "4vp"
},
{
"name": "bottom_navigation_barHeight",
"value": "50vp"
},
{
"name": "top_tab_bar_height",
"value": "40vp"
},
{
"name": "top_tab_item_max_width",
"value": "300vp"
},
{
"name": "top_tab_item_min_width",
"value": "20vp"
},
{
"name": "top_tab_item_padding_horizontal",
"value": "7vp"
},
{
"name": "top_tab_item_padding_bottom",
"value": "2vp"
},
{
"name": "top_tab_item_padding_top",
"value": "5vp"
},
{
"name": "top_bar_height",
"value": "44vp"
},
{
"name": "top_arrow_size",
"value": "24vp"
},
{
"name": "margin_1",
"value": "1vp"
},
{
"name": "margin_6",
"value": "6vp"
},
{
"name": "margin_16",
"value": "16vp"
},
{
"name": "vp_20",
"value": "20vp"
},
{
"name": "margin_32",
"value": "32vp"
},
{
"name": "margin_36",
"value": "36vp"
},
{
"name": "margin_44",
"value": "44vp"
},
{
"name": "vp_3",
"value": "3vp"
},
{
"name": "vp_2",
"value": "2vp"
},
{
"name": "vp_55",
"value": "55vp"
},
{
"name": "vp_12",
"value": "12vp"
},
{
"name": "vp_4",
"value": "4vp"
},
{
"name": "vp_8",
"value": "8vp"
},
{
"name": "vp_16",
"value": "16vp"
},
{
"name": "vp_28",
"value": "28vp"
},
{
"name": "vp_80",
"value": "80vp"
},
{
"name": "card_comp_pagePadding_lf",
"value": "16fp"
},
{
"name": "card_comp_pagePadding_tb",
"value": "14fp"
},
{
"name": "margin_116",
"value": "116vp"
},
{
"name": "vp_11",
"value": "11vp"
},
{
"name": "vp_22",
"value": "22vp"
},
{
"name": "vp_14",
"value": "14vp"
},
{
"name": "vp_15",
"value": "15vp"
},
{
"name": "vp_18",
"value": "18vp"
},
{
"name": "vp_13",
"value": "13vp"
},
{
"name": "margin_115",
"value": "115vp"
}
]
}
... ...
... ... @@ -64,6 +64,7 @@ export const enum CompStyle {
Card_21 = '21', // 小视频卡人民号
Card_22 = '22', // 时间链
Card_23 = '23', // 问政卡
More_Comp= 'More_Comp', // 点击查看更多相似
... ...
... ... @@ -98,7 +98,7 @@ export interface IStatusContentList {
// relType: string;
contentType: string;
// contentRelId: string;
contentRelId: string;
}
export interface batchLikeAndCollectParams {
// userType: number;
... ...
... ... @@ -12,8 +12,6 @@ export { LoadingComponent } from "./src/main/ets/components/view/LoadingComponen
export { PageComponent } from "./src/main/ets/components/page/PageComponent"
export { BottomNavigationComponent } from "./src/main/ets/components/page/BottomNavigationComponent"
export { LikeComponent } from "./src/main/ets/components/view/LikeComponent"
export { TopNavigationComponent } from "./src/main/ets/components/page/TopNavigationComponent"
... ... @@ -51,8 +49,6 @@ export { DetailViewModel } from "./src/main/ets/viewmodel/DetailViewModel"
export { BigPicCardComponent } from "./src/main/ets/components/view/BigPicCardComponent"
export { MultiPictureDetailPageComponent } from "./src/main/ets/components/MultiPictureDetailPageComponent"
export { AudioDetailComponent } from "./src/main/ets/components/AudioDetailComponent"
export { DynamicDetailComponent } from "./src/main/ets/components/DynamicDetailComponent"
... ... @@ -89,3 +85,14 @@ export { LiveFollowComponent } from "./src/main/ets/components/cardCommon/LiveFo
export { publishCommentModel } from './src/main/ets/components/comment/model/PublishCommentModel';
export { MultiPictureDetailItemComponent } from './src/main/ets/components/MultiPictureDetailItemComponent';
export { OperRowListView } from './src/main/ets/components/view/OperRowListView';
export { ImageDownloadComponent } from './src/main/ets/components/ImageDownloadComponent';
export { PageRepository } from './src/main/ets/repository/PageRepository';
export { MultiPictureDetailViewModel } from './src/main/ets/viewmodel/MultiPictureDetailViewModel';
export { viewBlogItemInsightIntentShare } from './src/main/ets/utils/InsightIntentShare';
\ No newline at end of file
... ...
... ... @@ -14,7 +14,6 @@
"wdKit": "file:../../commons/wdKit",
"wdWebComponent": "file:../../commons/wdWebComponent",
"wdBean": "file:../../features/wdBean",
"wdDetailPlayShortVideo": "file:../../features/wdDetailPlayShortVideo",
"wdRouter": "file:../../commons/wdRouter",
"wdNetwork": "file:../../commons/wdNetwork",
"wdJsBridge": "file:../../commons/wdJsBridge",
... ...
... ... @@ -5,7 +5,6 @@ import { Card3Component } from './cardview/Card3Component';
import { Card4Component } from './cardview/Card4Component';
import { Card5Component } from './cardview/Card5Component';
import { Card6Component } from './cardview/Card6Component';
import { Card9Component } from './cardview/Card9Component';
import { Card10Component } from './cardview/Card10Component';
import { Card11Component } from './cardview/Card11Component';
import { Card12Component } from './cardview/Card12Component';
... ... @@ -48,8 +47,6 @@ export struct CardParser {
} else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle
.Card_13) {
Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO })
} else if (contentDTO.appStyle === CompStyle.Card_09) {
Card9Component({ contentDTO })
} else if (contentDTO.appStyle === CompStyle.Card_10) {
Card10Component({ compDTO: this.compDTO, contentDTO })
} else if (contentDTO.appStyle === CompStyle.Card_11) {
... ...
import { CompDTO } from 'wdBean';
import { CompDTO, ContentDTO } from 'wdBean';
import { CommonConstants, CompStyle } from 'wdConstant/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import PageModel from '../viewmodel/PageModel';
import { CardParser } from './CardParser';
import { Card2Component } from './cardview/Card2Component';
import { Card9Component } from './cardview/Card9Component';
import { Card5Component } from './cardview/Card5Component';
import { AdvCardParser } from './cardViewAdv/AdvCardParser';
import { ZhCarouselLayout01 } from './compview/ZhCarouselLayout01';
... ... @@ -35,10 +36,24 @@ export struct CompParser {
@ObjectLink compDTO: CompDTO
@State compIndex: number = 0;
@State private pageModel: PageModel = new PageModel();
@State audioItems: ContentDTO[] = [];
@State noneAudioItems: ContentDTO[] = [];
aboutToAppear(): void {
// 轮播图屏蔽音频类型稿件
if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
this.audioItems = this.compDTO.operDataList.filter(item => {
return item.objectType === '13' || item.linkUrl.includes('audiotopic')
})
this.noneAudioItems = this.compDTO.operDataList.filter(item => {
return item.objectType !== '13' && !item.linkUrl.includes('audiotopic')
})
this.compDTO.operDataList = this.noneAudioItems;
}
}
build() {
Column() {
this.componentBuilder();
}
}
... ... @@ -50,73 +65,80 @@ export struct CompParser {
if (this.compDTO.operDataList[0]?.objectType !== '3' &&
this.compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口
if (this.compDTO.compStyle === CompStyle.Label_03) {
LabelComponent({ compDTO: this.compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
if (this.compDTO.operDataList.length > this.audioItems.length) {
ZhCarouselLayout01({ compDTO: this.compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
}
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 &&
this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡"
LiveHorizontalCardComponent({ compDTO: this.compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) {
if (this.compDTO.operDataList.length > 1) {
HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: this.compDTO })
} else {
HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: this.compDTO })
}
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_02) {
ZhSingleRow02({ compDTO: this.compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) {
ZhSingleRow03({ compDTO: this.compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题
//ZhGridLayout02({ compDTO: this.compDTO })
CompNormalTitle({ compDTO: this.compDTO })
// Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
// Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Card_Comp_Zh_Grid_Layout_02) { //双列流小视频,一行两图卡
ZhGridLayout02NewsContent({ compDTO: this.compDTO, operDataList: this.compDTO.operDataList })
} else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) {
ZhGridLayout03({ compDTO: this.compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_04) {
ZhSingleRow04({ compDTO: this.compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_05) {
// ZhSingleRow05({ compDTO })
// Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
// Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) {
ZhSingleRow06({ compDTO: this.compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
//头图卡 和comStyle 2相同,
Card5Component({ contentDTO: this.compDTO.operDataList[0], titleShowPolicy: this.compDTO.titleShowPolicy })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) {
// 大图卡
Card2Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0] })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Card_09) {
//时间链卡
Card9Component({ contentDTO:this.compDTO.operDataList[0] })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_04) {
ZhSingleColumn04({ compDTO: this.compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_05) {
// ZhSingleColumn05({ compDTO: compDTO })
// Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
// Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} 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(3).color('#ffffff').padding({ left: 0, right: 0 }).margin({ top: -3 })
Divider().strokeWidth(6).color('#f5f5f5')
ZhSingleColumn09({ compDTO: this.compDTO })
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 })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
//Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 0, right: 0 })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (!Number.isNaN(Number(this.compDTO.compStyle))) {
CardParser({ contentDTO: this.compDTO.operDataList[0], compDTO: this.compDTO });
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
... ... @@ -129,7 +151,7 @@ export struct CompParser {
// WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage)
// }
// })
// Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
// Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 })
}
}
... ...
... ... @@ -547,7 +547,7 @@ export struct DynamicDetailComponent {
}
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.padding({ bottom: 76 })
.padding({ bottom: 100 })
.scrollBar(BarState.Off)
.alignSelf(ItemAlign.Start)
}
... ... @@ -559,7 +559,7 @@ export struct DynamicDetailComponent {
operationButtonList: this.operationButtonList,
styleType: 1,
})
.height(100)
}
}
.alignSelf(ItemAlign.Start)
... ... @@ -627,6 +627,7 @@ export struct DynamicDetailComponent {
{
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
contentRelId: this.contentDetailData?.reLInfo?.relId + '',
}
]
}
... ...
... ... @@ -278,6 +278,7 @@ export struct FeedBackActivity {
// 其中包含Array<string>类型的photoUris,为返回图库选择后的媒体文件的uri数组;还包含boolean类型的isOriginalPhoto,指示返回图库选择后的媒体文件是否为原图。
// 声明变量array,其取值为PhotoSelectResult中的数组。
array = PhotoSelectResult['photoUris'];
let beforeLen = this.pics.length;
let startIndex = this.pics.length-1;
let totalLen = this.pics.length+array.length;
if(totalLen > 3){
... ... @@ -293,7 +294,7 @@ export struct FeedBackActivity {
mediaFlag = true;
Logger.info(TAG, `select image/video uri: ${value}`);
})
if(this.pics.length<3){
if(this.pics.length<=3 && beforeLen != 3 && array.length != 3){
this.addPic.id = startIndex
this.pics[this.pics.length-1]=this.addPic;
}
... ...
... ... @@ -37,7 +37,9 @@ import { componentUtils, window } from '@kit.ArkUI';
const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
const TAG: string = 'ImageAndTextPageComponent'
/**
* 图文详情页
* */
@Component
export struct ImageAndTextPageComponent {
scroller: Scroller = new Scroller();
... ... @@ -326,6 +328,7 @@ export struct ImageAndTextPageComponent {
{
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
contentRelId: this.contentDetailData?.reLInfo?.relId + '',
}
]
}
... ...
... ... @@ -21,7 +21,7 @@ export struct MultiPictureDetailItemComponent {
.alt($r('app.media.datail_imageLoading_w'))
.width(this.imageWidth)
.objectFit(ImageFit.Contain)
.objectFit(ImageFit.Auto)
.interpolation(ImageInterpolation.High)
.onComplete(event => {
this.imageWidth = '100%'
... ...
... ... @@ -130,8 +130,10 @@ export struct CardMediaInfo {
Image($r('app.media.card_image'))
.mediaLogo()
Text(`${this.contentDTO.photoNum}`)
.mediaText()
.mediaTextImgtype()
}
.margin({ left: 80,top: 55})
} else if (this.contentDTO.objectType === '13') {
// 显示音频信息
Row() {
... ... @@ -161,8 +163,17 @@ export struct CardMediaInfo {
.height(14)
.margin({ right: 3 })
}
@Styles
mediaLogo2() {
.width(14)
.height(14)
.margin({ top:5,right:5 })
}
}
@Extend(Text)
function mediaText() {
.fontColor($r('app.color.color_fff'))
... ... @@ -174,3 +185,14 @@ function mediaText() {
offsetY: 2
})
}
@Extend(Text)
function mediaTextImgtype() {
.fontColor($r('app.color.color_fff'))
.fontSize($r('app.float.font_size_13'))
.lineHeight(18)
.textShadow({
radius: 2,
color: 'rgba(0,0,0,0.3)',
offsetY: 2
})
}
... ...
import { CompDTO, ContentDTO } from 'wdBean'
import { CommonConstants } from 'wdConstant/Index';
import { DateTimeUtils } from 'wdKit/Index';
import { JSON } from '@kit.ArkTS';
import router from '@ohos.router'
@Component
export struct CardSourceInfo {
@State contentDTO: ContentDTO = new ContentDTO();
@ObjectLink compDTO: CompDTO
handleTimeStr() {
return DateTimeUtils.getCommentTime(
this.contentDTO.publishTime.includes(' ')
? Number.parseFloat(new Date(this.contentDTO.publishTime).getTime().toString())
: Number.parseFloat(this.contentDTO.publishTime)
)
}
showTime() {
console.log('curRouter', this.contentDTO.publishTime)
const curRouter = router.getState().name;
const publishTime = this.contentDTO.publishTime.includes(' ')
? new Date(this.contentDTO.publishTime).getTime().toString()
: this.contentDTO.publishTime
let flag: boolean = false;
if (curRouter === 'MainPage') {
if (this.isTwoDaysAgo(publishTime)) {
console.log('curRouter 01')
flag = false
} else {
console.log('curRouter 02')
flag = true;
}
} else {
console.log('curRouter 03')
flag = true;
}
return flag;
}
isTwoDaysAgo(date: string) {
const twoDaysAgo = new Date();
twoDaysAgo.setDate(twoDaysAgo.getDate() - 2);
console.log('curRouter', date)
return parseInt(date) < twoDaysAgo.getTime()
}
build() {
Flex({ alignItems: ItemAlign.Center }) {
if (this.contentDTO.corner) {
... ... @@ -52,11 +91,12 @@ export struct CardSourceInfo {
// .fontColor($r("app.color.color_B0B0B0"))
// .flexShrink(0);
// }
if (this.contentDTO.source) {
Text(DateTimeUtils.getCommentTime(Number.parseFloat(new Date(this.contentDTO.publishTime).getTime().toString())))
if (this.contentDTO.source && this.showTime()) {
Text(this.handleTimeStr())
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_B0B0B0"))
.flexShrink(0);
.flexShrink(0)
.margin({right: 4})
}
if (this.getContentDtoBean()?.interactData?.commentNum && this.contentDTO.source) {
... ... @@ -64,7 +104,6 @@ export struct CardSourceInfo {
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_B0B0B0"))
.flexShrink(0)
.margin({ left: 6 })
.visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None :
Visibility.Visible)
}
... ...
... ... @@ -75,7 +75,7 @@ export struct Card4Component {
ForEach(this.contentDTO.fullColumnImgUrls, (item: FullColumnImgUrlDTO, index: number) => {
if (index < 3) {
GridCol({ span: { xs: 4 } }) {
Image(this.loadImg ? item.url : '')
Image(this.loadImg ? item.url || item.fullUrl : '')
.backgroundColor(0xf5f5f5)
.width('100%')
.aspectRatio(113 / 75)
... ...
/**
* More_Comp
*/
const TAG: string = 'Card9Component';
@Entry
@Component
export struct MoreComponent {
build() {
Row() {
Text('点击展开更多相似')
.fontSize(16)
Image($r('app.media.comment_unfold'))
.width(16)
.height(16)
}
.justifyContent(FlexAlign.Center)
.width('100%')
.height(48)
.backgroundColor(0xffffff)
}
}
\ No newline at end of file
... ...
... ... @@ -114,7 +114,7 @@ export class commentItemModel {
/*评论点赞状态 0-未点赞 1-已点赞*/
api_status: boolean = false;
api_level: string = '';
api_levelHead: string = 'http';
api_levelHead: string = '';
api_userId: string = '';
api_creatorId: string = '';
api_userType: string = '';
... ...
import { DateTimeUtils, EmitterEventId, EmitterUtils, LazyDataSource } from 'wdKit/Index';
import { DateTimeUtils, EmitterEventId, EmitterUtils, LazyDataSource, StringUtils } from 'wdKit/Index';
import { commentItemModel, WDPublicUserType } from '../model/CommentModel';
import commentViewModel from '../viewmodel/CommentViewModel';
import { CommentText } from './CommentText';
... ... @@ -303,34 +303,7 @@ struct ChildCommentItem {
Column() {
Row() {
//头像
Stack() {
Image(this.item.fromUserHeader)
.alt($r('app.media.default_head'))
.width('24')
.height('24')
.objectFit(ImageFit.Cover)
.borderRadius(16)
Image(this.item.api_levelHead)
.width('36')
.height('36')
.objectFit(ImageFit.Cover)
.borderRadius(24)
}
.width(48)
.height(48)
.margin({ left: 47 })
.alignContent(Alignment.Center)
.onClick(() => {
// TODO 跳转个人详情
// 跳转到号主页
if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
const params: Params = {
creatorId: this.contentDetailData.rmhInfo.rmhId,
pageID: ''
}
WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
}
})
this.headerView()
//昵称
Text() {
... ... @@ -354,7 +327,7 @@ struct ChildCommentItem {
/// 人民号>置顶>作者
//人民号
if (this.item.fromUserType === WDPublicUserType.WDPublicUserType_Matrix) {
if (this.item.fromUserType !== 1) {
Image($r('app.media.comment_rmh_tag')).width(20).height(20).margin({ left: 5 });
}
//置顶
... ... @@ -400,6 +373,53 @@ struct ChildCommentItem {
.width('100%')
}
@Builder headerView() {
Stack() {
Stack() {
Image(this.item.fromUserHeader)
.alt($r('app.media.default_head'))
.width(24)
.height(24)
.objectFit(ImageFit.Cover)
.borderRadius(16)
if (this.item.api_authIcon && this.item.api_authIcon.length) {
Image(this.item.api_authIcon) // 加v
.width(14).height(14)
.objectFit(ImageFit.Cover)
}
}.width(24).height(24)
.alignContent(Alignment.BottomEnd)
if ((!this.item.api_authIcon || this.item.api_authIcon.length == 0)
&& this.item.fromUserType === 1
&& ((this.item.api_levelHead && this.item.api_levelHead.length > 0)
|| (this.item.avatarFrame && this.item.avatarFrame.length > 0))) {
Image(this.customBorderIconURL())
.width('36')
.height('36')
.objectFit(ImageFit.Cover)
.borderRadius(24)
}
}
.width(48).height(48)
.margin({ left: 47 })
.alignContent(Alignment.Center)
.onClick(() => {
commentViewModel.jumpToAccountPage(this.item)
})
}
customBorderIconURL() : string {
if (this.item.avatarFrame.length > 0) {
return this.item.avatarFrame
}
if (this.item.fromUserType === 1) {
return this.item.api_levelHead
}
return ""
}
replyComment() {
if (this.item.id && this.item.checkStatus == '2') { // 审核通过的才显示回复
this.publishCommentModel.rootCommentId = this.item.rootCommentId
... ... @@ -498,26 +518,7 @@ struct commentHeaderView {
Column() {
Row() {
//头像
Stack() {
Image(this.item.fromUserHeader)
.alt($r('app.media.default_head'))
.width('32')
.height('32')
.objectFit(ImageFit.Cover)
.borderRadius(16)
Image(this.item.api_levelHead)
.width('48')
.height('48')
.objectFit(ImageFit.Cover)
.borderRadius(24)
}
.width(48)
.height(48)
.margin({ left: 8 })
.alignContent(Alignment.Center)
.onClick(() => {
commentViewModel.jumpToAccountPage(this.item)
})
this.headerView()
//昵称
Text(this.item.fromUserName)
... ... @@ -531,7 +532,7 @@ struct commentHeaderView {
/// 人民号>置顶>作者
//人民号
if (this.item.fromUserType === WDPublicUserType.WDPublicUserType_Matrix) {
if (this.item.fromUserType !== 1) {
Image($r('app.media.comment_rmh_tag')).width(20).height(20).margin({ left: 5 });
}
//置顶
... ... @@ -573,6 +574,53 @@ struct commentHeaderView {
.padding({bottom: 8})
}
@Builder headerView() {
Stack() {
Stack() {
Image(this.item.fromUserHeader)
.alt($r('app.media.default_head'))
.width(32)
.height(32)
.objectFit(ImageFit.Cover)
.borderRadius(16)
if (this.item.api_authIcon && this.item.api_authIcon.length > 0) {
Image(this.item.api_authIcon) // 加v
.width(14).height(14)
.objectFit(ImageFit.Cover)
}
}.width(32).height(32)
.alignContent(Alignment.BottomEnd)
if ((!this.item.api_authIcon || this.item.api_authIcon.length == 0)
&& this.item.fromUserType === 1
&& ((this.item.api_levelHead && this.item.api_levelHead.length > 0)
|| (this.item.avatarFrame && this.item.avatarFrame.length > 0))) {
Image(this.customBorderIconURL())
.width(48)
.height(48)
.objectFit(ImageFit.Cover)
.borderRadius(24)
}
}
.width(48).height(48)
.margin({ left: 8 })
.alignContent(Alignment.Center)
.onClick(() => {
commentViewModel.jumpToAccountPage(this.item)
})
}
customBorderIconURL() : string {
if (this.item.avatarFrame.length > 0) {
return this.item.avatarFrame
}
if (this.item.fromUserType === 1) {
return this.item.api_levelHead
}
return ""
}
replyComment() {
if (this.item.id && this.item.checkStatus == '2') { // 审核通过的才显示回复
this.publishCommentModel.rootCommentId = this.item.rootCommentId
... ... @@ -596,7 +644,7 @@ struct commentFooterView {
Row() {
Row({ space: 6 }) {
Text(this.item.region ? (this.item.region + '网友') : '人民日报客户端网友')
Text(this.item.region.length > 0 ? (this.item.region + '网友') : '人民日报客户端网友')
.fontColor($r('app.color.color_B0B0B0'))
.fontSize(12);
Image($r('app.media.comment_hyphen'))
... ... @@ -631,7 +679,7 @@ struct commentFooterView {
.fontColor($r('app.color.color_666666'))
.fontSize(14)
Image($r(this.item.api_status ? 'app.media.comment_like_select' : 'app.media.comment_like_normal'))
Image(this.item.api_status ? $r('app.media.comment_like_select') : $r('app.media.comment_like_normal'))
.size({
width: 16,
height: 16
... ...
... ... @@ -381,7 +381,7 @@ struct QualityCommentItem {
})
Row() {
Image($r(this.item.api_status ? 'app.media.comment_like_select' : 'app.media.comment_like_normal'))
Image(this.item.api_status ? $r('app.media.comment_like_select') : $r('app.media.comment_like_normal'))
.width(16)
.height(16)
if (this.item.likeNum && this.item.likeNum != '0') {
... ...
... ... @@ -419,7 +419,7 @@ class CommentViewModel {
newModel.fromUserHeader = model.fromUserHeader
newModel.fromUserId = model.fromUserId
newModel.fromUserName = model.fromUserName
if (model.toUserType != null) {
if (model.fromUserType) {
newModel.fromUserType = model.fromUserType
}
newModel.id = model.id
... ... @@ -443,7 +443,7 @@ class CommentViewModel {
// newModel.isLoading = model.isLoading
if (model.toUserType != null) {
if (model.toUserType) {
newModel.toUserType = model.toUserType.toString()
}
newModel.topFlag = model.topFlag
... ...
... ... @@ -71,6 +71,7 @@ export struct ZhSingleRow06 {
{
contentId: this.compDTO.operDataList[0]?.commentInfo?.newsId + '',
contentType: this.compDTO.operDataList[0]?.commentInfo?.newsType + '',
contentRelId: this.compDTO.operDataList[0]?.commentInfo?.relId + '',
}
]
}
... ...
... ... @@ -154,7 +154,12 @@ export struct FollowListDetailUI {
} else {
fansNumString = fansNum + ""
}
this.data.push(new FollowListDetailItem(value.attentionHeadPhotoUrl, value.attentionUserName, fansNumString, value.introduction, value.attentionCreatorId, "1", value.attentionUserId, value.attentionUserType, value.attentionUserId, value.mainControl, value.banControl, value.authIcon))
let introduction = value.introduction
if(value.introduction.indexOf("\n") != -1){
let regex:RegExp = new RegExp('\n','g')
introduction = value.introduction.replace(regex,'')
}
this.data.push(new FollowListDetailItem(value.attentionHeadPhotoUrl, value.attentionUserName, fansNumString, introduction, value.attentionCreatorId, "1", value.attentionUserId, value.attentionUserType, value.attentionUserId, value.mainControl, value.banControl, value.authIcon))
})
this.data.notifyDataReload()
this.count = this.data.totalCount()
... ... @@ -272,7 +277,12 @@ export struct FollowListDetailUI {
})
result.forEach((item) => {
this.data.push(new FollowListDetailItem(item.headPhotoUrl, item.cnUserName, item.cnFansNum, item.introduction, item.creatorId, item.status, item.attentionUserId, item.cnUserType, item.cnUserId, item.mainControl, item.banControl, item.authIcon))
let introduction = item.introduction
if(item.introduction.indexOf("\n") != -1){
let regex:RegExp = new RegExp('\n','g')
introduction = item.introduction.replace(regex,'')
}
this.data.push(new FollowListDetailItem(item.headPhotoUrl, item.cnUserName, item.cnFansNum, introduction, item.creatorId, item.status, item.attentionUserId, item.cnUserType, item.cnUserId, item.mainControl, item.banControl, item.authIcon))
})
this.data.notifyDataReload()
... ...
import { LazyDataSource, NetworkUtil, StringUtils } from 'wdKit/Index';
import { LazyDataSource, NetworkUtil, StringUtils, ToastUtils } from 'wdKit/Index';
import { Remark, SubscribeMessageModel,
WDMessageCenterMessageType } from '../../../../model/InteractMessageModel';
import MinePageDatasModel from '../../../../model/MinePageDatasModel';
... ... @@ -81,7 +81,6 @@ export struct SubscribeMessageComponent{
}
})
.width('100%')
.margin({bottom:px2vp(this.bottomSafeHeight)})
}
}
.backgroundColor($r('app.color.color_F9F9F9'))
... ... @@ -89,13 +88,9 @@ export struct SubscribeMessageComponent{
.width('100%')
}
@Builder ListLayout(){
List({scroller: this.scroller}) {
LazyForEach(this.data, (item: SubscribeMessageModel, index: number) => {
ListItem() {
SubscribeListChildComponent({ item: item })
}.width('100%')
.onClick(()=>{
jumpDetail(item: SubscribeMessageModel){
MinePageDatasModel.getAssertDetailData(item.relId,item.contentId,item.relType).then((value) => {
if(value == "1"){
let action = {
type:item.contentType,
params:{
... ... @@ -107,18 +102,37 @@ export struct SubscribeMessageComponent{
}
} as Action
WDRouterRule.jumpWithPage(WDRouterPage.detailPlayLiveCommon, action)
}else{
ToastUtils.shortToast("内容不存在")
}
}).catch((err: Error) => {
console.log(TAG, JSON.stringify(err))
})
}
@Builder ListLayout(){
List({scroller: this.scroller}) {
LazyForEach(this.data, (item: SubscribeMessageModel, index: number) => {
ListItem() {
SubscribeListChildComponent({ item: item })
}.width('100%')
.onClick(()=>{
this.jumpDetail(item)
})
})
//没有更多数据 显示提示
if (!this.hasMore) {
ListItem() {
ListHasNoMoreDataUI()
}
}.padding({bottom:px2vp(this.bottomSafeHeight) + 10})
}
}.width('100%')
.edgeEffect(EdgeEffect.None)
.height("100%")
.scrollBar(BarState.Off)
.layoutWeight(1)
}
getNewPageData() {
... ...
... ... @@ -3,7 +3,7 @@ import { PrivacySettingModel } from '../../model/PrivacySettingModel'
import { Params } from 'wdBean';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import { HttpUtils } from 'wdNetwork/Index';
import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index';
import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index';
const TAG = 'PrivacySettingPage';
const DiyString = '开启个性化推荐'
... ... @@ -79,8 +79,19 @@ export struct PrivacySettingPage {
}
}.onClick(() => {
if (item.privacyName == DiyString) {
trackButtonClick("privacySettingPagePersonalizedRecommendations")
return
}
if(item.privacyName == "相册权限"){
trackButtonClick("privacySettingPageAlbumPermissions")
}else if(item.privacyName == "相机权限"){
trackButtonClick("privacySettingPageCameraPermissions")
}else if(item.privacyName == "定位权限"){
trackButtonClick("privacySettingPageLocationPermissions")
}else if(item.privacyName == "麦克风权限"){
trackButtonClick("privacySettingPageMicrophonePermissions")
}
if (!item.permission) {
//跳转权限设置
const permissionUtil = new PermissionUtil();
... ... @@ -213,3 +224,7 @@ struct getTuiJianCell {
.padding({ left: '29lpx', right: '29lpx' })
}
}
function trackButtonClick(buttonName: string){
TrackingButton.click(buttonName, TrackConstants.PageName.Privacy_Setting, TrackConstants.PageName.Privacy_Setting)
}
... ...
... ... @@ -4,7 +4,7 @@ import { AccountAndSecurityLayout } from '../setting/AccountAndSecurityLayout';
import router from '@ohos.router';
import { Action, Params } from 'wdBean';
import { DateTimeUtils } from 'wdKit/Index';
import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index';
import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index';
@Entry
@Component
... ... @@ -67,6 +67,4 @@ struct SettingPage {
export { SettingPage };
/*
* */
\ No newline at end of file
... ...
... ... @@ -8,6 +8,7 @@ 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 { TrackingButton, TrackConstants } from 'wdTracking/Index';
const TAG = 'TopNavigationComponent';
... ... @@ -367,6 +368,7 @@ export struct TopNavigationComponent {
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Center)
.onClick(() => {
TrackingButton.click("", TrackConstants.PageName.Search, "PEOPLE")
WDRouterRule.jumpWithPage(WDRouterPage.searchPage)
})
}
... ...
... ... @@ -63,14 +63,23 @@ export struct PeopleShipMainComponent {
if (this.viewType == ViewType.LOADING) {
this.LoadingLayout()
} else if (this.viewType == ViewType.ERROR) {
ErrorComponent()
.onTouch(() => {
if (this.viewType === ViewType.ERROR) {
//缺省页
EmptyComponent({
emptyType: this.pageModel.emptyType,
emptyButton: true,
retry: () => {
this.getData()
}
})
} else if (this.viewType == ViewType.EMPTY) {
EmptyComponent()
//缺省页
EmptyComponent({
emptyType: this.pageModel.emptyType,
emptyButton: true,
retry: () => {
this.getData()
}
})
} else {
if (this.followList.length == 0) {
CustomPullToRefresh({
... ...
... ... @@ -6,6 +6,7 @@
*/
import { SPHelper } from 'wdKit/Index'
import { WDRouterPage, WDRouterRule } from 'wdRouter'
import { TrackingButton, TrackConstants } from 'wdTracking/Index'
import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'
import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
... ... @@ -77,6 +78,7 @@ export struct FirstTabTopSearchComponent {
.backgroundImage($r('app.media.background_search'))
.backgroundImageSize(ImageSize.Cover)
.onClick(() => {
TrackingButton.click("", TrackConstants.PageName.Search, "NEWS")
WDRouterRule.jumpWithPage(WDRouterPage.searchPage)
})
}
... ...
import { Params } from 'wdBean';
import { AppUtils, StringUtils } from 'wdKit/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import { TrackingButton, TrackConstants } from 'wdTracking/Index';
import { CustomTitleUI } from '../reusable/CustomTitleUI';
import { EnvironmentCustomDialog } from './EnvironmentCustomDialog';
... ... @@ -58,9 +59,11 @@ export struct AboutPageUI {
this.getArrowCell(item, index)
}.onClick(() => {
if (index == 0) {
trackButtonClick("aboutPagePrivacyAgreement")
let bean = { contentID: "2", pageID: "" } as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
} else if(index == 1){
trackButtonClick("aboutPageUserAgreement")
let bean = { contentID: "1", pageID: "" } as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
}else if(index == 2){
... ... @@ -124,4 +127,8 @@ export struct AboutPageUI {
}
}
function trackButtonClick(buttonName: string){
TrackingButton.click(buttonName, TrackConstants.PageName.About, TrackConstants.PageName.About)
}
... ...
import { BottomNavi, CommonConstants, SpConstants } from 'wdConstant';
import { Logger, SPHelper, ToastUtils, UserDataLocal, EmitterEventId, EmitterUtils } from 'wdKit';
import { TopNavigationComponent } from '../page/TopNavigationComponent';
import PageViewModel from '../../viewmodel/PageViewModel';
import { SpConstants } from 'wdConstant';
import { Logger, SPHelper, ToastUtils, EmitterEventId, EmitterUtils } from 'wdKit';
import {MineMainSettingFunctionItem} from '../../viewmodel/MineMainSettingFunctionItem';
import MineSettingDatasModel from '../../model/MineSettingDatasModel';
import storageStatistics from "@ohos.file.storageStatistics";
import { BusinessError } from '@ohos.base';
import ArrayList from '@ohos.util.ArrayList';
import router from '@ohos.router';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import { Params } from 'wdBean';
import { SettingPasswordParams } from 'wdLogin';
import { LoginViewModel } from 'wdLogin/src/main/ets/pages/login/LoginViewModel';
import { Router } from '@ohos.arkui.UIContext';
import promptAction from '@ohos.promptAction';
import { LogoutViewModel } from '../../viewmodel/LogoutViewModel';
import { CustomLogoutDialog } from './CustomLogoutDialog';
import { emitter } from '@kit.BasicServicesKit';
import { ConfirmLogoutDialog } from './ConfirmLogoutDialog';
import { TrackingButton, TrackConstants } from 'wdTracking/Index';
export { SettingPasswordParams } from "wdLogin"
@Component
... ... @@ -183,9 +175,11 @@ export struct AccountAndSecurityLayout {
.onClick(() => {
console.log(index + "")
if (index == 0){
trackButtonClick("accountManagementPageChangePhoneNumber")
let pageType = {'pageType': 2} as Record<string, number>;
WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType)
}else if (index == 1) {
trackButtonClick("accountManagementPageAccountManagementPassword")
if (this.ifSetPassword) {
//修改密码
WDRouterRule.jumpWithPage(WDRouterPage.modifyPasswordPage)
... ... @@ -195,6 +189,7 @@ export struct AccountAndSecurityLayout {
WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType)
}
}else if (index == 3) {
trackButtonClick("accountManagementPageAccountCancellation")
this.isAccountPage=false
// WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType)
}
... ... @@ -215,6 +210,7 @@ export struct AccountAndSecurityLayout {
Column() {
Button('退出登录',{ stateEffect: true ,type: ButtonType.Normal}).width('90%').height('80lpx').backgroundColor('#da3e22').fontColor('#fff').margin('20lpx').borderRadius('8lpx').onClick(()=>{
trackButtonClick("accountManagementPageLogout")
this.confirmDialogController.open()
})
}
... ... @@ -516,3 +512,7 @@ export struct AccountArrowCell{
.height('54lpx')
}
}
function trackButtonClick(buttonName: string){
TrackingButton.click(buttonName, TrackConstants.PageName.Account_Management, TrackConstants.PageName.Account_Management)
}
\ No newline at end of file
... ...
... ... @@ -15,6 +15,7 @@ import common from '@ohos.app.ability.common';
import dataPreferences from '@ohos.data.preferences';
import { TitleBackComponent } from './TitleBackComponent';
import { MyCustomDialog } from '../reusable/MyCustomDialog';
import { TrackingButton, TrackConstants } from 'wdTracking/Index';
@Component
export struct MineSettingComponent {
... ... @@ -74,11 +75,6 @@ export struct MineSettingComponent {
}
build() {
// Navigation() {
// //滑动区域
// this.settingList()
// }.titleMode(NavigationTitleMode.Mini)
// .title('设置')
Column(){
TitleBackComponent({title:"设置"})
this.settingList()
... ... @@ -154,15 +150,19 @@ export struct MineSettingComponent {
.selectedColor("#ED2800")
.onChange((isOn: boolean) => {
if(item.itemType=='push_switch'){
trackButtonClick("settingPagePushSwitch")
//推送
SPHelper.default.save(SpConstants.SETTING_PUSH_SWITCH,isOn)
}else if(item.itemType=='wifi_switch'){
trackButtonClick("settingPageOnlyWifiNetworkLoadPicture")
//wifi 图片
SPHelper.default.save(SpConstants.SETTING_WIFI_IMAGE_SWITCH,isOn)
}else if(item.itemType=='video_switch'){
trackButtonClick("settingPageAutomaticallyPlayVideoOnWifiNetwork")
//wifi 视频
SPHelper.default.save(SpConstants.SETTING_WIFI_VIDEO_SWITCH,isOn)
}else if(item.itemType=='suspensionState_switch'){
trackButtonClick("settingPagePlayerFloatingWindowSwitchClick")
//悬浮窗
SPHelper.default.save(SpConstants.SETTING_SUSPENSION_SWITCH,isOn)
}
... ... @@ -214,13 +214,16 @@ export struct MineSettingComponent {
.height('54lpx')
.onClick(() => {
if (item.itemType == 'account') {
trackButtonClick("settingPageAccountManagement")
let params: Params = {
pageID: 'AccountAndSecurityLayout'
}
WDRouterRule.jumpWithPage(WDRouterPage.settingPage, params)
} else if (item.itemType == 'private_setting') {
WDRouterRule.jumpWithPage(WDRouterPage.privacySettingPage)
trackButtonClick("settingPagePrivacySettings")
} else if (item.itemType == 'clear_cache') {
trackButtonClick("settingPageClearCache")
this.dialogController.open()
}
})
... ... @@ -264,3 +267,7 @@ export struct MineSettingComponent {
this.preferences.on('change', observer);
}
}
function trackButtonClick(buttonName: string){
TrackingButton.click(buttonName, TrackConstants.PageName.Setting, TrackConstants.PageName.Setting)
}
... ...
... ... @@ -73,7 +73,7 @@ export struct OperRowListView {
@Prop operationButtonList?: string[] = ['comment', 'collect', 'share'] // 组件展示条件
@State needLike: boolean = true
@ObjectLink publishCommentModel: publishCommentModel
@State styleType: number = 1
@State styleType: number = -1
@State showCommentIcon: boolean = true
@State bgColor: ResourceColor = Color.White
@State interactData: InteractDataDTO = {} as InteractDataDTO
... ... @@ -148,10 +148,9 @@ export struct OperRowListView {
// 视频详情页
Column() {
Image($r('app.media.ic_news_detail_division'))
.width('100%')
.height($r('app.float.margin_1'))
// .margin({bottom: -2})
if(this.styleType != 3) {
Divider().strokeWidth(1).color(this.styleType == 1 ? '#F5F5F5' : this.styleType == 2 ? '#262626' : 'rgba(0,0,0,0)')
}
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
// AudioDialog()
... ... @@ -381,12 +380,13 @@ export struct OperRowListView {
{
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
contentRelId: this.contentDetailData?.reLInfo?.relId + '',
}
]
}
// console.info(TAG, '查询用户对作品收藏11', JSON.stringify(params))
let data = await MultiPictureDetailViewModel.getInteractDataStatus(params)
// console.info(TAG, '查询用户对作品收藏22', JSON.stringify(data))
console.info(TAG, '查询用户对作品收藏22', JSON.stringify(data))
this.newsStatusOfUser = data[0];
} catch (exception) {
// console.error(TAG, JSON.stringify(exception))
... ... @@ -400,6 +400,7 @@ export struct OperRowListView {
console.log(TAG, '收藏点击')
// 未登录,跳转登录
const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
console.log(TAG, '收藏点击,登录', user_id)
if (!user_id) {
console.log(TAG, '收藏点击,用户未登录')
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
... ... @@ -415,9 +416,10 @@ export struct OperRowListView {
}],
}
console.log(TAG, '收藏点击', JSON.stringify(params))
// console.log(TAG, '收藏点击', JSON.stringify(params))
PageRepository.postExecuteCollectRecord(params).then(res => {
console.log(TAG, '收藏点击 res', JSON.stringify(res))
console.log(TAG, '收藏点击 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
if (this.newsStatusOfUser) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
if (this.newsStatusOfUser.collectStatus === 1) {
... ...
... ... @@ -724,6 +724,31 @@ class MinePageDatasModel{
return WDHttp.get<ResponseDTO<String>>(url)
};
/**
* 预约消息 查询详情
* @returns
*/
getAssertDetailData(relId:string,contentId:string,relType:string): Promise<String> {
return new Promise<String>((success, error) => {
this.fetchAssertDetailData(relId,contentId,relType).then((navResDTO: ResponseDTO<String>) => {
console.log(TAG,JSON.stringify(navResDTO))
if (!navResDTO || StringUtils.isEmpty(navResDTO.data)) {
success("0");
return
}
success("1");
}).catch((err: Error) => {
error(err)
})
})
}
fetchAssertDetailData(relId:string,contentId:string,relType:string) {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.DETAIL_PATH + `?relId=${relId}&contentId=${contentId}&relType=${relType}`
return WDHttp.get<ResponseDTO<String>>(url)
};
}
const minePageDatasModel = MinePageDatasModel.getInstance()
... ...
... ... @@ -52,9 +52,9 @@ class MineSettingDatasModel{
this.mainSettingData.push(new MineMainSettingFunctionItem(null, 'wifi网络情况下自动播放视频', null, 1, videoState,"video_switch"))
let suspensionState=SPHelper.default.getSync(SpConstants.SETTING_SUSPENSION_SWITCH,false) as boolean
this.mainSettingData.push(new MineMainSettingFunctionItem(null, '开启播放器悬浮窗', null, 1, suspensionState,"suspensionState_switch"))
this.mainSettingData.push(new MineMainSettingFunctionItem(null, null, null, 2, null,""))
// this.mainSettingData.push(new MineMainSettingFunctionItem(null, null, null, 2, null,""))
this.mainSettingData.push(new MineMainSettingFunctionItem(null, '清理缓存', '32MB', 0, false,"clear_cache"))
this.mainSettingData.push(new MineMainSettingFunctionItem(null, '评价我们', null, 0, false,""))
// this.mainSettingData.push(new MineMainSettingFunctionItem(null, '评价我们', null, 0, false,""))
return this.mainSettingData
}
... ...
... ... @@ -25,6 +25,7 @@ const Normal_Page_Size = 20 // 常规每页数量
const Rec_Page_Size = 10 // 推荐每页数量
const SpecialComp: string[] = [CompStyle.Zh_Single_Column_03.toString()]
/**
* 处理返回后的数据
... ... @@ -379,7 +380,8 @@ export class PageHelper {
*/
private factoryCompArray(compList: CompDTO[]): ArrayList<CompDTO> {
let pageCompList: ArrayList<CompDTO> = new ArrayList() // 收集页面组件、稿件和本地组件容器
compList.forEach((element: CompDTO) => {
let newCompList = this.createSpecialComp(compList)
newCompList.forEach((element: CompDTO) => {
let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0);
//移除音频 和 活动
if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) {
... ... @@ -402,6 +404,41 @@ export class PageHelper {
}
/**
* 竖直方向list,将数据拆出来,组装成comp
*/
private createSpecialComp(compList: CompDTO[]): CompDTO[]{
if (!compList) {
return compList
}
let tmpList: CompDTO[] = []
compList.forEach((value, index) => {
if (SpecialComp.includes(value.compStyle)) {
let list = value.operDataList
if (list) {
if (list.length == 1) {
tmpList.push(value)
} else {
list.forEach((content) => {
let newComp = CompDTO.createNewsBean(value)
newComp.operDataList = []
// 特殊样式,comp只保留一个content,多余的一一拆成新的comp
newComp.operDataList.push(content)
tmpList.push(newComp)
})
}
} else {
tmpList.push(value)
}
} else {
tmpList.push(value)
}
})
// 重新赋值,将contentList拆出来了。
return tmpList
}
/**
* 信息流页面,所有稿件需要参与批查,如 批查评论、批查关注状态等接口
* @param compList
* @param pageModel
... ...
... ... @@ -85,7 +85,7 @@ export interface IStatusContentList {
// relType: string;
contentType: string;
// contentRelId: string;
contentRelId: string;
}
export interface batchLikeAndCollectParams {
... ...
... ... @@ -15,7 +15,7 @@
"wdNetwork": "file:../../commons/wdNetwork",
"wdConstant": "file:../../commons/wdConstant",
"wdDetailPlayApi": "file:../../features/wdDetailPlayApi",
// "wdComponent": "file:../../features/wdComponent"
"wdComponent": "file:../../features/wdComponent",
"wdShare": "file:../../features/wdShare"
}
}
... ...
... ... @@ -112,6 +112,7 @@ export struct DetailPlayShortVideoPage {
{
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
contentRelId: this.contentDetailData?.reLInfo?.relId + '',
}
]
}
... ...
... ... @@ -97,6 +97,7 @@ export struct DetailDialog {
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
showCommentIcon: true,
styleType: 1,
onBack: () => {
WindowModel.shared.setWindowLayoutFullScreen(false)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
... ...
... ... @@ -289,12 +289,10 @@ struct LoginPage {
}.width('100%')
Row() {
Row() {
/*Row() {
Image($r('app.media.login_wx'))
.width(20).height(20).onClick(()=>{
Logger.debug("测试",'开始'+Logger.isDebug)
ErrorToastUtils.ErrorToast.showToast(ErrorToastUtils.ErrorType.NET_CORE_NO_NETWORK)
Logger.debug("测试",'开始2'+Logger.isDebug)
})
}.backgroundImage($r('app.media.login_other_left'), ImageRepeat.NoRepeat)
.otherStyle()
... ... @@ -307,25 +305,36 @@ struct LoginPage {
Row() {
Image($r('app.media.login_wb')).size({ width: 20, height: 20 })
}.backgroundImage($r('app.media.login_other_middle'), ImageRepeat.NoRepeat)
.otherStyle()
.otherStyle()*/
Row() {
Image(this.checkCodePage ? $r('app.media.login_qt') : $r('app.media.login_other_password'))
.size({ width: 20, height: 20 })
}.backgroundImage($r('app.media.login_other_right'), ImageRepeat.NoRepeat)
.otherStyle().onClick(() => {
.size({ width: "35lpx", height: "35lpx" })
.margin({right:"8lpx"})
.height("38lpx")
.width("38lpx")
Text(this.checkCodePage ? "密码登录" : "手机号登录")
.fontWeight(400)
.fontColor("#3D3D3D")
.fontSize("23lpx")
.lineHeight("38lpx")
}
.onClick(() => {
this.updateAccount()
this.checkCodePage = !this.checkCodePage;
this.passwordSwitch = true
this.isSubmit = false
})
}).width('100%')
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Center)
}.height(36)
.width('100%')
.padding({ left: 25, right: 25 })
// .justifyContent(FlexAlign.SpaceEvenly)
.margin({ top: 24 })
}.width('100%').margin({ bottom: 40 })
.margin({ top: "46lpx" })
}
.width('100%')
.margin({ bottom: 40 })
}
updateAccount(){
... ...
import { BottomNavigationComponent, LogoutViewModel, PermissionDesComponent } from 'wdComponent';
import { LogoutViewModel, PermissionDesComponent } from 'wdComponent';
import { BreakpointConstants } from 'wdConstant';
import { common } from '@kit.AbilityKit';
... ... @@ -8,6 +8,7 @@ import { UpgradeTipDialog } from "./upgradePage/UpgradeTipDialog"
import { ProcessUtils } from 'wdRouter/Index';
import { StartupManager } from '../startupmanager/StartupManager';
import { BusinessError } from '@kit.BasicServicesKit';
import { BottomNavigationComponent } from './view/BottomNavigationComponent';
const TAG = 'MainPage';
... ...
import { Logger } from 'wdKit';
import { MultiPictureDetailPageComponent } from 'wdComponent';
import router from '@ohos.router';
import { Params, Action } from 'wdBean';
import { WindowModel } from 'wdKit/Index';
import { MultiPictureDetailPageComponent } from '../view/MultiPictureDetailPageComponent';
const TAG = 'MultiPictureDetailPage';
/**
... ...
import { BottomNavi, CommonConstants, DisplayDirection } from 'wdConstant';
import { BottomNavDTO, NavigationBodyDTO, NavigationDetailDTO, TopNavDTO } from 'wdBean';
import { EmitterEventId, EmitterUtils, Logger, StringUtils } from 'wdKit';
import { TopNavigationComponent } from './TopNavigationComponent';
import { MinePageComponent } from './MinePageComponent';
import { CompUtils } from '../../utils/CompUtils';
import ChannelViewModel from '../../viewmodel/ChannelViewModel';
import HomeChannelUtils, { AssignChannelParam } from 'wdRouter';
import { VideoChannelPage } from './VideoChannelPage';
import { HttpUtils } from 'wdNetwork/Index';
import HomeChannelUtils, { AssignChannelParam } from 'wdRouter/Index';
import { MinePageComponent } from 'wdComponent/src/main/ets/components/page/MinePageComponent';
import { CompUtils, TopNavigationComponent } from 'wdComponent/Index';
import { VideoChannelPage } from './VideoChannelPage';
import ChannelViewModel from 'wdComponent/src/main/ets/viewmodel/ChannelViewModel';
const TAG = 'BottomNavigationComponent';
let storage = LocalStorage.getShared();
... ...
... ... @@ -8,23 +8,21 @@ import {
postInteractAccentionOperateParams,
Params
} from 'wdBean';
import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
import display from '@ohos.display';
import font from '@ohos.font';
import { OperRowListView } from './view/OperRowListView';
import { MultiPictureDetailItemComponent } from './MultiPictureDetailItemComponent';
import { ImageDownloadComponent } from '../components/ImageDownloadComponent';
import { publishCommentModel } from '../components/comment/model/PublishCommentModel';
import { EmptyComponent } from './view/EmptyComponent';
import { DateTimeUtils } from 'wdKit/Index';
import { HttpUrlUtils } from 'wdNetwork/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { PageRepository } from '../repository/PageRepository';
import { SpConstants } from 'wdConstant/Index';
import { router } from '@kit.ArkUI';
import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
import { CommentDialogView } from 'wdDetailPlayShortVideo/Index';
import { EmptyComponent,
ImageDownloadComponent,
MultiPictureDetailItemComponent,
MultiPictureDetailViewModel,
OperRowListView,
PageRepository,
publishCommentModel,
viewBlogItemInsightIntentShare} from 'wdComponent/Index';
const TAG = 'MultiPictureDetailPageComponent';
... ...
... ... @@ -4,9 +4,10 @@
*/
import { BottomNavDTO, TopNavDTO } from 'wdBean/Index'
import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index';
import { PageComponent } from './PageComponent';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import { DisplayDirection } from 'wdConstant/Index';
import { PageComponent } from 'wdComponent/Index';
import { TrackingButton, TrackConstants } from 'wdTracking/Index';
const TAG = 'VideoChannelPage'
... ... @@ -124,6 +125,7 @@ export struct VideoChannelPage {
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Center)
.onClick(() => {
TrackingButton.click("", TrackConstants.PageName.Search, "VIDEOS")
WDRouterRule.jumpWithPage(WDRouterPage.searchPage)
})
.backgroundColor(Color.Transparent)
... ...