liyubing

Merge remote-tracking branch 'origin/main'

Showing 73 changed files with 1320 additions and 319 deletions
... ... @@ -68,6 +68,8 @@ export class WDRouterPage {
static loginPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginPage");
static oneKeyLoginPage = new WDRouterPage("wdLogin", "ets/pages/login/OneKeyLoginPage");
static forgetPasswordPage = new WDRouterPage("wdLogin", "ets/pages/login/ForgetPasswordPage");
static verifyPhoneNumberPage = new WDRouterPage("wdLogin", "ets/pages/login/VerifyPhoneNumberPage");
static changeBindPhonePage = new WDRouterPage("wdLogin", "ets/pages/login/ChangeBindPhonePage");
static modifyPasswordPage = new WDRouterPage("wdLogin", "ets/pages/login/ModifyPasswordPage");
//我的 预约
static appointmentListPage = new WDRouterPage("wdComponent", "ets/components/page/AppointmentListPage");
... ...
... ... @@ -11,6 +11,9 @@ import { LiveRoomDataBean } from '../live/LiveRoomDataBean';
@Observed
export class ContentDTO implements BaseDTO {
seoTags: string = '';
cornerMark:string = '';
liveType?: string; // 直播新闻-直播状态
expIds: string = '';
itemId: string = '';
shareFlag?: string = '1';
... ... @@ -99,6 +102,8 @@ export class ContentDTO implements BaseDTO {
static clone(old: ContentDTO): ContentDTO {
let content = new ContentDTO();
content.liveType = old.liveType;
content.seoTags = old.seoTags;
content.appStyle = old.appStyle;
content.cityCode = old.cityCode;
content.coverSize = old.coverSize;
... ... @@ -154,6 +159,7 @@ export class ContentDTO implements BaseDTO {
content.rmhInfo = old.rmhInfo;
content.photoNum = old.photoNum;
content.corner = old.corner;
content.cornerMark = old.cornerMark;
content.rmhPlatform = old.rmhPlatform;
content.newTags = old.newTags;
content.titleShow = old.titleShow;
... ...
... ... @@ -49,6 +49,7 @@ const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
/**
* 动态详情页UI
* @author wd-zsz
* */
// @Preview
... ... @@ -109,7 +110,7 @@ export struct DynamicDetailComponent {
//分割线
Image($r('app.media.ic_news_detail_division'))
.width('100%')
.height($r('app.float.margin_12'))
.height($r('app.float.margin_6'))
.padding({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') })
Stack({ alignContent: Alignment.Bottom }) {
if (!this.isNetConnected) {
... ... @@ -533,6 +534,8 @@ export struct DynamicDetailComponent {
}
//点赞操作
this.toggleLikeStatus()
//内容点赞/取消点赞埋点
})
// 评论
... ... @@ -751,7 +754,7 @@ export struct DynamicDetailComponent {
return
}
const params: postExecuteLikeParams = {
status: this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1',
status: this.newsStatusOfUser?.likeStatus === '1' ? 0 : 1,
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
}
... ...
import { ContentDTO, NewspaperListItemBean, NewspaperPositionItemBean, Params } from 'wdBean';
import { StringUtils } from 'wdKit';
import { ProcessUtils } from 'wdRouter';
import { TrackingContent,TrackConstants } from 'wdTracking/Index';
import { newsSkeleton } from './skeleton/newsSkeleton';
@Component
... ... @@ -13,6 +14,20 @@ export struct ENewspaperItemComponent {
private itemBeanClicked: NewspaperPositionItemBean = {} as NewspaperPositionItemBean
@State isShowSkeleton: boolean = true
aboutToAppear(): void {
for (let index = 0; index < this.newspaperListItemBean.items.length; index++) {
const element = this.newspaperListItemBean.items[index];
TrackingContent.common(TrackConstants.EventType.Show,TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
,{
'contentName':element.title,
'contentType':element.newsType,
'contentId':element.newsId,
'panelNumber':this.newspaperListItemBean.pageNum,
'panelName':this.newspaperListItemBean.pageName,
'readMode':'1',
})
}
}
build() {
Stack() {
newsSkeleton()
... ... @@ -70,6 +85,16 @@ export struct ENewspaperItemComponent {
relType:this.itemBeanClicked.relType ?? '0'
} as ContentDTO
ProcessUtils.processPage(content)
//内容点击
TrackingContent.commentClickWithEvent('current_Number_Panel_content_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
,{
'contentName':this.itemBeanClicked.title,
'contentType':this.itemBeanClicked.newsType,
'contentId':this.itemBeanClicked.newsId,
'panelNumber':this.newspaperListItemBean.pageNum,
'panelName':this.newspaperListItemBean.pageName,
'readMode':'1',
})
this.itemBeanClicked = {} as NewspaperPositionItemBean
}
}
... ...
... ... @@ -10,6 +10,7 @@ import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog';
import { RMCalendarBean } from './calendar/RMCalendarBean';
import { newsSkeleton } from './skeleton/newsSkeleton';
import { Logger, ToastUtils, NetworkUtil } from 'wdKit/Index';
import { TrackingContent,TrackConstants, TrackingButton } from 'wdTracking/Index';
@Component
export struct ENewspaperPageComponent {
... ... @@ -33,6 +34,15 @@ export struct ENewspaperPageComponent {
let _swiperIndex = Number.parseInt(this.currentPageNum)
console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "_swiperIndex:", _swiperIndex)
this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex
//电子报--版面序号选择点击
TrackingContent.commentClickWithEvent('panel_number_selection_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
,{
'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,
'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,
'currentPanelDate':this.selectDate.toDateString(),
'currentNumber':this.swiperIndex,
})
}
//日历选择弹框
... ... @@ -50,6 +60,14 @@ export struct ENewspaperPageComponent {
this.selectDate =
new Date(date.fullYear ? date.fullYear : 0, date.month ? date.month : 0, date.date ? date.date : 0)
}
//日历选择点击
TrackingContent.commentClickWithEvent('date_selection_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
,{
'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,
'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,
'currentPanelDate':this.selectDate.toDateString(),
'currentNumber':this.swiperIndex,
})
}
}),
alignment: DialogAlignment.Top,
... ... @@ -189,7 +207,7 @@ export struct ENewspaperPageComponent {
if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
Swiper(this.swiperController) {
ForEach(this.newspaperListBean?.list, (item: NewspaperListItemBean, index: number) => {
ENewspaperItemComponent({ newspaperListItemBean: item })
ENewspaperItemComponent({ newspaperListItemBean: item})
})
}
.index(this.swiperIndex)
... ... @@ -244,6 +262,12 @@ export struct ENewspaperPageComponent {
.id('e_newspaper_next')
.onClick((event: ClickEvent) => {
this.swiperController.showNext()
// 电子报--滑动查看下一版
TrackingButton.click('panelPageViewNextPanel',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
,{
'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,
'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,
})
})
}
... ... @@ -270,6 +294,10 @@ export struct ENewspaperPageComponent {
})
.id('e_newspaper_page_num')
.onClick((event: ClickEvent) => {
if(!NetworkUtil.isNetConnected()){
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
return
}
if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
this.pageDialogShow = !this.pageDialogShow
if (this.pageDialogShow) {
... ... @@ -305,8 +333,20 @@ export struct ENewspaperPageComponent {
})
.id('e_newspaper_read')
.onClick((event: ClickEvent) => {
if(!NetworkUtil.isNetConnected()){
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
return
}
if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
this.isOpenListDialog = true
//电子报--读报纸点击
TrackingContent.commentClickWithEvent('read_newspaper_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
,{
'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,
'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,
'currentPanelDate':this.selectDate.toDateString(),
'currentNumber':this.swiperIndex,
})
}else {
ToastUtils.showToast('暂无数据', 1000)
}
... ...
import { FeedBackParams, FeedbackTypeBean, PhotoListBean } from 'wdBean/Index';
import { AppUtils,
DateTimeUtils,
DeviceUtil,
FastClickUtil, Logger, NetworkUtil, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index';
import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
... ... @@ -9,7 +10,7 @@ import { BusinessError } from '@kit.BasicServicesKit';
import { router } from '@kit.ArkUI';
import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from 'wdRouter/Index';
import { HashMap } from '@kit.ArkTS';
import { TrackConstants, TrackingButton, TrackingPageBrowse } from 'wdTracking/Index';
const TAG = 'FeedBackActivity'
... ... @@ -20,6 +21,7 @@ const TAG = 'FeedBackActivity'
@Entry
@Component
export struct FeedBackActivity {
pageShowTime:number = 0;
@State canSubmit: boolean = false;
@State textNumLabel: string = '0/500';
contact: string = "";
... ... @@ -50,7 +52,7 @@ export struct FeedBackActivity {
.fontSize($r('app.float.font_size_16'))
.fontWeight(FontWeight.Bold)
.width('100%')
.margin({ left: $r('app.float.vp_15'), top: $r('app.float.vp_14') })
.margin({ left: 24, top: $r('app.float.vp_14') })
GridRow({
columns:3,
}) {
... ... @@ -62,6 +64,11 @@ export struct FeedBackActivity {
.onChange((select) => {
feedbackTypeBean.isSelect = select
this.canSubmit = this.checkSubmit()
TrackingButton.click('submit_feedback',TrackConstants.PageName.FeedbackPage,TrackConstants.PageName.FeedbackPage,{
'feedback_type':feedbackTypeBean.id+''
})
})
Text(feedbackTypeBean.classifyName)
.fontColor($r('app.color.color_222222'))
... ... @@ -75,7 +82,7 @@ export struct FeedBackActivity {
}
})
}
.width('100%')
.width('94%')
.margin({top:$r('app.float.vp_16')})
Blank()
.height($r('app.float.margin_5'))
... ... @@ -85,7 +92,7 @@ export struct FeedBackActivity {
.fontSize($r('app.float.font_size_16'))
.fontWeight(FontWeight.Bold)
.width(CommonConstants.FULL_WIDTH)
.margin({ left: $r('app.float.vp_16'), top: $r('app.float.vp_12') })
.margin({ left: 24, top: $r('app.float.vp_12') })
Stack({ alignContent: Alignment.BottomEnd }) {
TextArea({ placeholder: $r('app.string.feedback_comments') })
.width(CommonConstants.FULL_WIDTH)
... ... @@ -108,15 +115,15 @@ export struct FeedBackActivity {
GridCol({
}) {
if(1 == feedbackImageItem.itemType){
Image($r('app.media.feekback_add'))
.width(60)
.height(60)
.onClick(async (event: ClickEvent) => {
if(await FastClickUtil.isMinDelayTime()){
return
}
this.callFilePickerSelectImage();
})
// Image($r('app.media.feekback_add'))
// .width(60)
// .height(60)
// .onClick(async (event: ClickEvent) => {
// if(await FastClickUtil.isMinDelayTime()){
// return
// }
// this.callFilePickerSelectImage();
// })
}else{
Stack({alignContent: Alignment.TopEnd}) {
Image(feedbackImageItem.picPath)
... ... @@ -165,7 +172,7 @@ export struct FeedBackActivity {
.margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_11')})
}
.height(200)
.width('90%')
.width('94%')
.margin({ top: $r('app.float.vp_12') })
.backgroundColor($r('app.color.color_F5F5F5'))
.borderRadius(4)
... ... @@ -176,9 +183,8 @@ export struct FeedBackActivity {
Text($r('app.string.feedback_email'))
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.font_size_14'))
.fontWeight(FontWeight.Bold)
.width('100%')
.margin({ left: $r('app.float.vp_16'), top: $r('app.float.margin_24') })
.width('94%')
.margin({ top: $r('app.float.margin_24') })
Row() {
Text($r('app.string.feedback_mail'))
.fontColor($r('app.color.color_222222'))
... ... @@ -187,6 +193,7 @@ export struct FeedBackActivity {
TextInput({ placeholder: $r('app.string.feedback_hideemail') })
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
// .margin({left:15})
.backgroundColor($r('app.color.color_F5F5F5'))
.onChange((value) => {
// Logger.debug(TAG, "onChange" + value + "/" + this.passwordContent)
... ... @@ -194,7 +201,7 @@ export struct FeedBackActivity {
})
}
.height(44)
.width('90%')
.width('94%')
.backgroundColor($r('app.color.color_F5F5F5'))
.margin({top: $r('app.float.margin_16') })
.borderRadius(4)
... ... @@ -338,9 +345,13 @@ export struct FeedBackActivity {
})
if(!StringUtils.isEmpty(selectType)){
selectType = selectType.substring(0,selectType.length-1)
TrackingButton.click('feedbackPageSubmitFeedback',TrackConstants.PageName.FeedbackPage,TrackConstants.PageName.FeedbackPage,{
'feedbackTypeId':selectType
})
}else{
//
ToastUtils.shortToast($r('app.string.feedback_opinion_type'))
TrackingButton.click('feedbackPageSubmitFeedback',TrackConstants.PageName.FeedbackPage,TrackConstants.PageName.FeedbackPage)
return
}
//内容必填
... ... @@ -380,4 +391,12 @@ export struct FeedBackActivity {
}
}
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
}
onPageHide() {
//页面浏览
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.FeedbackPage,TrackConstants.PageName.FeedbackPage,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
}
}
\ No newline at end of file
... ...
... ... @@ -24,6 +24,10 @@ export struct ImageDownloadComponent {
build() {
Column() {
// Image($r('app.media.save_detail_img'))
// .width(24)
// .height(24)
// .margin({bottom:6})
SaveButton({ icon: SaveIconStyle.LINES })
.iconSize(24)
.iconColor(Color.White)
... ... @@ -33,7 +37,8 @@ export struct ImageDownloadComponent {
await this.saveImage(this.imageBuffer);
promptAction.showToast({
message: $r('app.string.image_request_success'),
duration: 2000
duration: 2000,
alignment:Alignment.Center
})
}
})
... ...
... ... @@ -67,6 +67,7 @@ export struct MorningEveningPaperComponent {
// 顶部安全高度赋值
@State topSafeHeight: number = 0;
@State bottomSafeHeight: number = 0;
@State isHasTopView: boolean = false;
private audioDataList: AudioDataList[] = []
private playerController: WDPlayerController = new WDPlayerController();
... ... @@ -144,7 +145,10 @@ export struct MorningEveningPaperComponent {
Logger.info(TAG, "pageInfoBean dateTime = " + dateTime)
Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle)
this.setComponentBgColor(pageInfoBean.backgroundImgUrl)
this.isHasTopView = this.pageInfoBean?.topicInfo?.frontLinkObject?true:false
let coverUrl = this.isHasTopView?this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string :''
this.setComponentBgColor(coverUrl)
let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId)
// this.compInfoBean = compInfoBean
... ... @@ -201,11 +205,9 @@ export struct MorningEveningPaperComponent {
// const pixelMap: image.PixelMap = await image2PixelMap(item.icon);
Logger.debug(TAG, "compInfoBean compStyle = " + imageUrl)
const imageSource: image.ImageSource | undefined = await getPicture(imageUrl)
if (imageSource && this.pageInfoBean.topicInfo.frontFlag === 1) {
if (imageUrl.length > 0 && this.pageInfoBean.topicInfo.frontFlag === 1) {
const imageSource: image.ImageSource | undefined = await getPicture(imageUrl)
this.pickColor(imageSource)
} else {
if (this.pageInfoBean.topicInfo.topicPattern === 1) {
this.mixedBgColor = '#66BDBD'
... ... @@ -223,8 +225,7 @@ export struct MorningEveningPaperComponent {
effectKit.createColorPicker(pixelMap, (err, colorPicker) => {
let color = colorPicker.getMainColorSync();
Logger.debug(TAG, "compInfoBean compStyle = " + color)
color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha})
// color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha})
// 将取色器选取的color示例转换为十六进制颜色代码
this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16);
Logger.debug(TAG, "compInfoBean compStyle = " + this.mixedBgColor)
... ... @@ -239,15 +240,9 @@ export struct MorningEveningPaperComponent {
// WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}
onPageShow(){
TrackingPageBrowseUtils.TrackingPageBrowseExposureStart()
}
onPageHide() {
this.status = PlayerConstants.STATUS_PAUSE;
this.playerController?.pause();
TrackingPageBrowseUtils.TrackingPageBrowseExposureEnd('','',TrackParamConvert.pageInfoBean_ParamType(this.pageInfoBean))
}
build() {
... ... @@ -259,11 +254,12 @@ export struct MorningEveningPaperComponent {
topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject })
}
if (this.audioPlayUrl.length > 0){
ListItem() {
this.AudioBarView(this.simpleAudioDialog)
}
}
//暂时不展示音频播报
// if (this.audioPlayUrl.length > 0){
// ListItem() {
// this.AudioBarView(this.simpleAudioDialog)
// }
// }
}
ListItem() {
... ... @@ -276,19 +272,24 @@ export struct MorningEveningPaperComponent {
}
}
.height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`).scrollBar(BarState.Off)
.onAreaChange((oldValue: Area, newValue: Area) => {
let persent = Math.abs(Number(newValue.globalPosition.y)) / 150
if (persent > 1) {
persent = 1
}
})
PaperTitleComponent()
PaperTitleComponent().margin({top:this.isHasTopView?this.topSafeHeight:0}).backgroundColor(this.mixedBgColor).opacity(this.isHasTopView?0:1)
}
.width('100%')
.height('100%')
.padding({
top: this.topSafeHeight,
bottom: this.bottomSafeHeight
top: this.isHasTopView?0:this.topSafeHeight,
// bottom: this.bottomSafeHeight
})
// .backgroundColor(Color.Black)
// .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black)
.backgroundColor(this.mixedBgColor ?? Color.Black)
}
@Builder
... ...
... ... @@ -32,36 +32,37 @@ export struct topicInfoView {
})
.id('img_cover')
Row() {
Text("查看详情")
.fontSize(14)
.fontColor($r('app.color.white'))
.maxLines(1)
.borderRadius(2)
.padding({ left: 6, top: 4, bottom: 4 })
if (this.frontLinkObject) {
Row() {
Text("查看详情")
.fontSize(14)
.fontColor($r('app.color.white'))
.maxLines(1)
.borderRadius(2)
.padding({ left: 6, top: 4, bottom: 4 })
Image($r('app.media.more_w'))// .height($r('app.float.top_arrow_size'))
.width(12)
.height(12)
.margin({ left: 4, right: 7 })
}
.backgroundColor($r('app.color.color_99636363'))
.margin({ top: 8, left: 16, right: 16, bottom: 16 })
.borderRadius(2)
.onClick(()=>{
if (this.frontLinkObject) {
Image($r('app.media.more_w'))// .height($r('app.float.top_arrow_size'))
.width(12)
.height(12)
.margin({ left: 4, right: 7 })
}
.backgroundColor($r('app.color.color_99636363'))
.margin({ top: 8, left: 16, right: 16, bottom: 16 })
.borderRadius(2)
.onClick(()=>{
let contentDTO :ContentDTO = new ContentDTO();
contentDTO.objectType = this.frontLinkObject?.newsType.toString()
contentDTO.objectId = this.frontLinkObject?.newsId
contentDTO.linkUrl = this.frontLinkObject?.linkUrl
ProcessUtils.processPage(contentDTO)
}
}).width(80)
.alignRules({
left: { anchor: "__container__", align: HorizontalAlign.Start },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
})
.id('row_detail')
}).width(80)
.alignRules({
left: { anchor: "__container__", align: HorizontalAlign.Start },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
})
.id('row_detail')
}
Text(this.frontLinkObject?.summary ?? "")
.margin({ top: 10 })
... ...
... ... @@ -84,36 +84,74 @@ export struct CardMediaInfo {
// liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
// 显示直播信息
Row() {
if (this.contentDTO?.liveInfo?.liveState === 'wait') {
Image($r('app.media.card_wait'))
.mediaLogo()
Text('预约')
.mediaText()
} else if (this.contentDTO?.liveInfo?.liveState === 'running') {
LottieView({
name: 'live_status_wait',
path: "lottie/live_detail_living.json",
lottieWidth: 14,
lottieHeight: 14,
autoplay: true,
loop: true,
// 搜索接口没有返回liveInfo字段所以得做个区分
if (this.contentDTO && this.contentDTO.liveInfo && JSON.stringify(this.contentDTO.liveInfo) === '{}') {
// 当liveInfo不存在的时候
if (this.contentDTO?.liveType === 'wait') {
Image($r('app.media.card_wait'))
.mediaLogo()
Text('预约')
.mediaText()
} else if (this.contentDTO?.liveType === 'running') {
LottieView({
name: 'live_status_wait',
path: "lottie/live_detail_living.json",
lottieWidth: 14,
lottieHeight: 14,
autoplay: true,
loop: true,
})
.margin({
right: '2vp'
.margin({
right: '2vp'
})
// Image($r('app.media.card_live'))
// .mediaLogo()
Text('直播中')
.mediaText()
} else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo?.replayUri) {
Image($r('app.media.card_play'))
.mediaLogo()
Text('回看')
.mediaText()
}else if(this.contentDTO?.liveInfo?.liveState === 'end' && !this.contentDTO?.liveInfo
?.replayUri){
// Image($r('app.media.card_live'))
// .mediaLogo()
Text('直播中')
.mediaText()
} else if (this.contentDTO?.liveType === 'end' && this.contentDTO?.linkUrl) {
Image($r('app.media.card_play'))
.mediaLogo()
Text('回看')
.mediaText()
}else if(this.contentDTO?.liveInfo?.liveState === 'end' && !this.contentDTO?.linkUrl){
Text('已结束')
.mediaText()
}
}else {
// 当liveInfo存在时后
if (this.contentDTO?.liveInfo?.liveState === 'wait') {
Image($r('app.media.card_wait'))
.mediaLogo()
Text('预约')
.mediaText()
} else if (this.contentDTO?.liveInfo?.liveState === 'running') {
LottieView({
name: 'live_status_wait',
path: "lottie/live_detail_living.json",
lottieWidth: 14,
lottieHeight: 14,
autoplay: true,
loop: true,
})
.margin({
right: '2vp'
})
// Image($r('app.media.card_live'))
// .mediaLogo()
Text('直播中')
.mediaText()
} else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo?.replayUri) {
Image($r('app.media.card_play'))
.mediaLogo()
Text('回看')
.mediaText()
}else if(this.contentDTO?.liveInfo?.liveState === 'end' && !this.contentDTO?.liveInfo
?.replayUri){
Text('已结束')
.mediaText()
}
}
if (!!this.joinPeopleNum) {
Text(' | ')
... ... @@ -136,6 +174,7 @@ export struct CardMediaInfo {
.mediaLogo()
Text(`${this.contentDTO.photoNum}`)
.mediaTextImgtype()
.fontFamily('BebasNeue')
}
.margin({ left: 80,top: 55})
... ...
... ... @@ -26,14 +26,11 @@ export struct CardSourceInfo {
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;
... ... @@ -54,6 +51,12 @@ export struct CardSourceInfo {
.fontColor($r("app.color.color_ED2800"))
.margin({ right: 2 })
}
if(this.contentDTO.cornerMark){
Text(this.contentDTO.cornerMark)
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_ED2800"))
.margin({ right: 2 })
}
if (this.contentDTO.rmhPlatform === 1) {
Text(this.contentDTO.rmhInfo?.rmhName)
.fontSize($r("app.float.font_size_11"))
... ... @@ -91,15 +94,21 @@ export struct CardSourceInfo {
// .fontColor($r("app.color.color_B0B0B0"))
// .flexShrink(0);
// }
if (this.contentDTO.source && this.showTime()) {
// if (this.contentDTO.source && this.showTime()) {
// Text(this.handleTimeStr())
// .fontSize($r("app.float.font_size_11"))
// .fontColor($r("app.color.color_B0B0B0"))
// .flexShrink(0)
// .margin({right: 4})
// }
if (this.showTime()) {
Text(this.handleTimeStr())
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_B0B0B0"))
.flexShrink(0)
.margin({right: 4})
}
if (this.getContentDtoBean()?.interactData?.commentNum && this.contentDTO.source) {
if (this.getContentDtoBean()?.interactData?.commentNum) {
Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`)
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_B0B0B0"))
... ... @@ -107,6 +116,15 @@ export struct CardSourceInfo {
.visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None :
Visibility.Visible)
}
// if (this.getContentDtoBean()?.interactData?.commentNum && this.contentDTO.source) {
// Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`)
// .fontSize($r("app.float.font_size_11"))
// .fontColor($r("app.color.color_B0B0B0"))
// .flexShrink(0)
// .visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None :
// Visibility.Visible)
// }
}
.width(CommonConstants.FULL_WIDTH)
.margin({ top: 8 })
... ...
... ... @@ -80,9 +80,8 @@ export struct RmhTitle {
async aboutToAppear(): Promise<void> {
this.getBatchAttentionStatus()
let page = router.getState();
if (page.path.includes('/page/PeopleShipHomePage') || page.path.includes('/pages/MainPage')) {
const curRouter = router.getState().name;
if (curRouter === 'MainPage') {
this.hideTime = true;
}
... ...
... ... @@ -27,6 +27,7 @@ export struct Card17Component {
@State str03: string = '';
async aboutToAppear(): Promise<void> {
console.log('Card17Component', JSON.stringify(this.contentDTO))
this.titleInit();
this.clicked = hasClicked(this.contentDTO.objectId)
this.loadImg = await onlyWifiLoadImg();
... ... @@ -65,7 +66,7 @@ export struct Card17Component {
GridRow({ gutter: 2 }) {
GridCol({ span: { xs: 8 } }) {
Image(this.loadImg ?
this.contentDTO.fullColumnImgUrls.length > 0 ? this.contentDTO.fullColumnImgUrls[0].url : '' : '')
this.contentDTO.fullColumnImgUrls.length > 0 ? this.contentDTO.fullColumnImgUrls[0].url || this.contentDTO.fullColumnImgUrls[0].fullUrl : '' : '')
.backgroundColor(this.loadImg ? '#f5f5f5' : 0xf5f5f5)
.width(CommonConstants.FULL_WIDTH)
.height(160)// .aspectRatio(CompUtils.ASPECT_RATIO_16_9)
... ... @@ -77,7 +78,7 @@ export struct Card17Component {
GridCol({ span: { xs: 4 } }) {
Image(this.loadImg ?
this.contentDTO.fullColumnImgUrls.length > 1 ? this.contentDTO.fullColumnImgUrls[1].url : '' : '')
this.contentDTO.fullColumnImgUrls.length > 1 ? this.contentDTO.fullColumnImgUrls[1].url || this.contentDTO.fullColumnImgUrls[1].fullUrl : '' : '')
.backgroundColor(this.loadImg ? '#f5f5f5' : 0xf5f5f5)
.width(CommonConstants.FULL_WIDTH)
.height(79)// .aspectRatio(CompUtils.ASPECT_RATIO_16_9)
... ... @@ -94,7 +95,7 @@ export struct Card17Component {
GridCol({ span: { xs: 4 } }) {
Image(this.loadImg ?
this.contentDTO.fullColumnImgUrls.length > 2 ? this.contentDTO.fullColumnImgUrls[2].url : '' : '')
this.contentDTO.fullColumnImgUrls.length > 2 ? this.contentDTO.fullColumnImgUrls[2].url || this.contentDTO.fullColumnImgUrls[2].fullUrl : '' : '')
.backgroundColor(this.loadImg ? '#f5f5f5' : 0xf5f5f5)
.width(CommonConstants.FULL_WIDTH)
.height(79)// .aspectRatio(CompUtils.ASPECT_RATIO_16_9)
... ...
... ... @@ -97,13 +97,14 @@ struct createImg {
@State loadImg: boolean = false;
async aboutToAppear(): Promise<void> {
console.log("createImg", JSON.stringify(this.contentDTO.fullColumnImgUrls))
this.loadImg = await onlyWifiLoadImg();
}
build() {
GridRow() {
if (this.contentDTO.fullColumnImgUrls[0].landscape === 1 || this.contentDTO.fullColumnImgUrls[0].weight > this.contentDTO.fullColumnImgUrls[0].height) {
if (this.contentDTO.fullColumnImgUrls[0].landscape === 1) {
// 横屏
GridCol({
span: { xs: 12 }
... ... @@ -131,6 +132,7 @@ struct createImg {
.backgroundColor(0xf5f5f5)
.width(CommonConstants.FULL_WIDTH)
.borderRadius($r('app.float.image_border_radius'))
.aspectRatio(172 / 230)
CardMediaInfo({ contentDTO: this.contentDTO })
}
.align(Alignment.BottomEnd)
... ...
... ... @@ -50,14 +50,38 @@ export struct Card2Component {
Column() {
Column() {
Stack() {
//新闻标题
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
//Notes({ newTags: this.contentDTO.newTags })
} else if (this.contentDTO.objectType == '5') {
// if(this.contentDTO.objectType == '5'){
// Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center)
// }else if(this.contentDTO.objectType == '2'){
// if(this.contentDTO.seoTags){
// Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
// }else if(this.contentDTO.newTags){
// Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
//
// }
// }else {
// if(this.contentDTO.newTags){
// Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
// }
// }
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center)
//Notes({ objectType: this.contentDTO.objectType })
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
}
}
//新闻标题
// if (this.contentDTO.newTags) {
//
// //Notes({ newTags: this.contentDTO.newTags })
// } else if (this.contentDTO.objectType == '5') {
//
// //Notes({ objectType: this.contentDTO.objectType })
// }
Text() {
if (this.titleMarked) {
... ... @@ -75,9 +99,10 @@ export struct Card2Component {
.lineHeight(27)
.textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
.align(Alignment.Start)
.textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 :
(this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
this.contentDTO.objectType == '5' ? 35 : 0)
.textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
(this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 :
((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 :
0 )
}.alignContent(Alignment.TopStart)
//.textIndent(this.contentDTO.objectType == '5' ? 35 : 0)
... ...
... ... @@ -32,7 +32,6 @@ export struct Card6Component {
this.loadImg = await onlyWifiLoadImg();
this.clicked = hasClicked(this.contentDTO.objectId)
}
titleInit() {
if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
this.titleMarked = true;
... ... @@ -57,12 +56,18 @@ export struct Card6Component {
// .margin({ right: 2 })
// }
Stack() {
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(27).align(Alignment.Center)
} else if (this.contentDTO.objectType == '5') {
Notes({ objectType: this.contentDTO.objectType }).height(27).align(Alignment.Center)
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
}
}
Text() {
if (this.titleMarked) {
Span(this.str01)
... ... @@ -80,9 +85,10 @@ export struct Card6Component {
.maxLines(3)
.alignSelf(ItemAlign.Start)
.textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
.textIndent(this.contentDTO?.newTags?.length < 5 && this.contentDTO?.newTags?.length > 2 ? 58 :
(this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
this.contentDTO.objectType == '5' ? 35 : 0)
.textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
(this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 :
((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 :
0 )
}.alignContent(Alignment.TopStart)
}
... ... @@ -123,4 +129,4 @@ export struct Card6Component {
.justifyContent(FlexAlign.SpaceBetween)
.alignItems(VerticalAlign.Top)
}
}
\ No newline at end of file
}
... ...
... ... @@ -9,7 +9,7 @@
export struct Notes {
@State objectType: number | string = 5
@State newTags: string = ''
@State seoTags: string = ''
build() {
if (this.returnTypeTitleFn()) {
Text(this.returnTypeTitleFn())
... ...
... ... @@ -279,6 +279,7 @@ export struct CommentComponent {
if (commentListModel && commentListModel.list && commentListModel.list.length > 0) {
this.allDatas.clearAllData() // 防止数据重复问题
commentListModel.list.forEach(element => {
element.hasMore = Number.parseInt(element.childCommentNum) ? true : false
let newModel = commentViewModel.deepCopyCommentItemModel(element)
... ...
import { DisplayUtils, EmitterEventId, EmitterUtils } from 'wdKit/Index'
import { DisplayUtils, EmitterEventId, EmitterUtils, ToastUtils } from 'wdKit/Index'
import { publishCommentModel } from '../model/PublishCommentModel'
import { CommentCustomDialog } from './CommentCustomDialog'
import measure from '@ohos.measure'
import { ContentDetailDTO } from 'wdBean/Index'
import { HttpUtils } from 'wdNetwork/Index'
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
@Preview
@Component
... ... @@ -120,6 +122,21 @@ export struct CommentTabComponent {
if(this.contentDetail.appstyle === 9) return
this.onCommentFocus && this.onCommentFocus()
// 未登录,游客评论未打开 则先登录
if (!HttpUtils.isLogin()) {
if (this.contentDetail.visitorComment != 1) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
}
if (this.contentDetail.openComment != 1 && this.contentDetail.commentDisplay != 1) {
ToastUtils.showToast("暂时无法评论", 3000)
return
}
//TODO: 用户被禁言 也不能评论
this.publishCommentModel.rootCommentId = '-1';
this.publishCommentModel.parentId = '-1';
this.publishCommentModel.placeHolderText = "说两句..."
... ...
import { ViewType } from 'wdConstant/Index'
import { DateTimeUtils, LazyDataSource, ToastUtils, WindowModel } from 'wdKit/Index'
import { DateTimeUtils, LazyDataSource, Logger, ToastUtils, WindowModel } from 'wdKit/Index'
import { commentItemModel } from '../model/CommentModel'
import commentViewModel from '../viewmodel/CommentViewModel'
import { router, window } from '@kit.ArkUI'
... ... @@ -18,11 +18,10 @@ const TAG = 'QualityCommentsComponent';
@Preview
@Component
export struct QualityCommentsComponent {
//刷新
@State viewType:number = ViewType.LOADING;
@State viewType: number = ViewType.LOADING;
@State hasMore: boolean = true;
@State currentPage: number = 1;
@State currentPage: number = 1;
private scroller: Scroller = new Scroller();
@State tileOpacity: number = 0;
firstPositionY: number = 0;
... ... @@ -32,11 +31,9 @@ export struct QualityCommentsComponent {
currentWindowColor: string = '#FF4202'
@State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource();
@State dialogController: CustomDialogController | null = null;
/*必传*/
@State publishCommentModel: publishCommentModel = new publishCommentModel()
aboutToDisappear(): void {
// windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' })
this.dialogController = null // 将dialogController置空
... ... @@ -55,7 +52,7 @@ export struct QualityCommentsComponent {
this.showAlert()
}
showAlert(){
showAlert() {
this.dialogController = new CustomDialogController({
builder: CommentCustomDialog({
confirm: (value: Record<string, string>) => {
... ... @@ -74,9 +71,11 @@ export struct QualityCommentsComponent {
})
}
getData(resolve?: (value: string | PromiseLike<string>) => void){
getData(resolve?: (value: string | PromiseLike<string>) => void) {
commentViewModel.fetchQualityCommentList(this.currentPage + '').then((commentListModel) => {
if(resolve) resolve('刷新成功')
if (resolve) {
resolve('刷新成功')
}
if (commentListModel && commentListModel.list && commentListModel.list.length > 0) {
if (this.currentPage === 1) {
... ... @@ -107,8 +106,13 @@ export struct QualityCommentsComponent {
// .aspectRatio(375 / 283);
}
.onAreaChange((oldValue: Area, newValue: Area) => {
let persent = Math.abs(Number(newValue.globalPosition.y)) / 150
if (Number(oldValue.globalPosition.y) == 0 && Number(newValue.globalPosition.y) > 30) {
this.firstPositionY = Number(newValue.globalPosition.y)
return
}
Logger.debug(TAG, "oldValue.globalPosition.y : " + oldValue.globalPosition.y)
Logger.debug(TAG, "newValue.globalPosition.y : " + newValue.globalPosition.y + `,this.topSafeHeight : ` + this.topSafeHeight)
let persent = Math.abs(Number(newValue.globalPosition.y) - this.firstPositionY ) / 150 //- this.topSafeHeight) / 283
if (persent > 1) {
persent = 1
}
... ... @@ -131,18 +135,20 @@ export struct QualityCommentsComponent {
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.offset({
y: (this.topSafeHeight / 2) + 'px'
})
// .offset({
// y: (this.topSafeHeight / 2) + 'px'
// })
.margin({ left: 16 })
.onClick(() => {
router.back()
})
}
.visibility(this.tileOpacity > 0 ? 1 : 0)
.height(this.topSafeHeight + vp2px(44) + 'px')
// .height(this.topSafeHeight + vp2px(44) + 'px')
.height(44)
.width('100%')
.backgroundColor($r('app.color.color_transparent'))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
/*导航栏*/
... ... @@ -159,9 +165,9 @@ export struct QualityCommentsComponent {
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.offset({
y: (this.topSafeHeight / 2) + 'px'
})
// .offset({
// y: (this.topSafeHeight / 2) + 'px'
// })
.margin({ left: 16 })
.onClick(() => {
router.back()
... ... @@ -178,71 +184,76 @@ export struct QualityCommentsComponent {
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.offset({
y: (this.topSafeHeight / 2) + 'px'
})
// .offset({
// y: (this.topSafeHeight / 2) + 'px'
// })
}
.visibility(this.tileOpacity > 0 ? 0 : 1)
.opacity(this.tileOpacity)
.height(this.topSafeHeight + vp2px(44) + 'px')
// .height(this.topSafeHeight + vp2px(44) + 'px')
.height(44)
.width('100%')
.backgroundColor($r('app.color.white'))
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
build() {
Column() {
Stack({ alignContent: Alignment.Top }) {
Scroll() {
Column() {
Stack() {
this.titleHeader()
if(this.viewType == ViewType.ERROR){
ErrorComponent()
}else if(this.viewType == ViewType.EMPTY){
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoComment})
}else {
Stack({ alignContent: Alignment.Top }) {
Scroll() {
Column() {
Stack() {
this.titleHeader()
if (this.viewType == ViewType.ERROR) {
ErrorComponent()
} else if (this.viewType == ViewType.EMPTY) {
EmptyComponent({ emptyType: WDViewDefaultType.WDViewDefaultType_NoComment })
} else {
this.listLayout()
}
}
}.alignContent(Alignment.Top)
}.backgroundColor(this.currentWindowColor).width('100%')
}.alignContent(Alignment.Top)
}
.friction(0.6)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.width('100%')
.height('100%')
this.TabbarTransparent()
this.TabbarNormal()
.backgroundColor(this.currentWindowColor).width('100%')
}
.friction(0.6)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
this.TabbarTransparent()
this.TabbarNormal()
}
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
}
@Builder
listLayout(){
List({ space: 12, scroller:this.scroller }) {
listLayout() {
List({ space: 12, scroller: this.scroller }) {
// ListItemGroup({ header: this.titleHeader() })
LazyForEach(this.allDatas, (item: commentItemModel, index: number) => {
ListItem() {
QualityCommentItem({ item: item, index: index , dialogController:this.dialogController, publishCommentModel:this.publishCommentModel}).margin({ left: 12, right: 12 })
QualityCommentItem({
item: item,
index: index,
dialogController: this.dialogController,
publishCommentModel: this.publishCommentModel
}).margin({ left: 12, right: 12 })
}
})
// 加载更多
ListItem() {
if (this.hasMore === false) NoMoreLayout()
if (this.hasMore === false) {
NoMoreLayout()
}
}
// ListItem() {
//
// }.height(`${this.bottomSafeHeight}` + 'px')
}.onReachEnd(()=>{
}
.onReachEnd(() => {
this.currentPage++
this.getData()
})
... ... @@ -255,14 +266,9 @@ export struct QualityCommentsComponent {
scrollBackward: NestedScrollMode.SELF_FIRST
})
}
}
@Component
struct QualityCommentItem {
@ObjectLink publishCommentModel: publishCommentModel
... ... @@ -279,7 +285,8 @@ struct QualityCommentItem {
Image(this.item.fromUserHeader)
.alt($r(commentViewModel.adjustUserType(this.item.fromUserType) ? 'app.media.WDAccountOwnerHedaerDefaultIcon' : 'app.media.WDAccountDefaultIcon'))
.alt($r(commentViewModel.adjustUserType(this.item.fromUserType) ?
'app.media.WDAccountOwnerHedaerDefaultIcon' : 'app.media.WDAccountDefaultIcon'))
.width(50)
.height(50)
.borderRadius(25)
... ... @@ -296,7 +303,7 @@ struct QualityCommentItem {
}
)
.onClick(() => {
this.jumpToAccountOwner()
this.jumpToAccountOwner()
})
Text(this.item.fromUserName)
.fontSize(14)
... ... @@ -376,7 +383,7 @@ struct QualityCommentItem {
Row() {
Image($r('app.media.comment_icon_pinglun')).width(16).height(16)
}.height('100%')
.onClick(()=>{
.onClick(() => {
this.replyComment()
})
... ...
import { CompDTO, ContentDTO, } from 'wdBean';
import { CompDTO, ContentDTO } from 'wdBean';
import { BreakpointConstants, CommonConstants } from 'wdConstant';
import { BreakPointType, Logger } from 'wdKit';
import { CompUtils } from '../../utils/CompUtils';
... ... @@ -11,6 +11,7 @@ import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Zh_Carousel_Layout-01';
/**
* 轮播组件,即Banner/轮播大图/焦点图/自动滑动
* 样式:
... ... @@ -47,9 +48,11 @@ export struct ZhCarouselLayout01 {
@StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string =
BreakpointConstants.BREAKPOINT_XS;
@State compDTO: CompDTO = {} as CompDTO
@State firstWd: number = 0
@State SecondWd: number = 0
@State swiperIndex: number = 0
private data: MyDataSource = new MyDataSource([])
watchCurrentBreakpoint() {
... ... @@ -75,6 +78,7 @@ export struct ZhCarouselLayout01 {
}
build() {
if (this.compDTO?.operDataList?.length) {
Stack() {
Swiper() {
... ... @@ -206,9 +210,19 @@ struct CarouselLayout01CardView {
Blank()
// 文本信息
Stack() {
if (this.item.objectType == '5' || this.item.objectType == '6') {
if(this.item.objectType == '5'){
Notes({ objectType: this.item.objectType })
} else {
if (this.item.seoTags) {
Notes({ newTags: this.item.seoTags })
}
if (this.item.newTags) {
Notes({ newTags: this.item.newTags })
}
}
// if (this.item.objectType == '5' || this.item.objectType == '6') {
// Notes({ objectType: this.item.objectType })
// }
Text(`${this.item.corner}${this.item.newsTitle}`)
.width(CommonConstants.FULL_PARENT)
.fontColor(Color.White)
... ... @@ -218,7 +232,10 @@ struct CarouselLayout01CardView {
.align(Alignment.Bottom)
.maxLines(CompUtils.MAX_LINES_2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.textIndent(this.item.objectType == '5' ? 35 : 0)
.textIndent((this.item.newTags?.length || this.item.seoTags?.length) > 2 &&
(this.item.newTags?.length ||this.item.seoTags?.length) < 5 ? 58 :
((this.item.newTags?.length > 0 || this.item.seoTags?.length > 0) ||this.item.objectType == '5') ? 35 :
0 )
}
// .height(39)
.padding({
... ...
import MinePageMoreFunctionModel from '../../viewmodel/MinePageMoreFunctionModel'
import { WDRouterRule, WDRouterPage, ProcessUtils } from 'wdRouter'
import { Params } from 'wdBean';
import { ToastUtils } from 'wdKit/Index';
import { TrackingButton, TrackConstants } from 'wdTracking/Index';
@Component
... ...
... ... @@ -3,6 +3,9 @@ import { CommonConstants, ConfigConstants, ScreenType } from 'wdConstant';
import { Logger, ToastUtils, DateTimeUtils } from 'wdKit';
import { CompUtils } from '../../utils/CompUtils';
import { ProcessUtils, WDRouterRule } from 'wdRouter';
import { TrackConstants,
TrackingButton,
TrackingContent, TrackingPageBrowse, TrackParamConvert } from 'wdTracking/Index';
const TAG: string = 'CardView';
... ... @@ -528,6 +531,11 @@ export struct PaperSingleColumn999CardView {
.borderRadius(4)
.onClick(() => {
ProcessUtils.processPage(this.item)
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews,TrackParamConvert.program(this.item))
}).onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
if (isVisible) {
TrackingContent.common(TrackConstants.EventType.Show,TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews,TrackParamConvert.program(this.item))
}
})
}
... ...
... ... @@ -73,13 +73,14 @@ struct EditUserInfoPage {
.width('30')
.height('30')
}
}.margin({top:20,bottom:-10})
Button('点击更换头像')
.fontColor(Color.Gray)
.fontSize(15)
.backgroundColor(Color.White)
.margin(20)
}.margin({top:20,bottom:40})
///目前不支持头像上传,暂时屏蔽
// Button('点击更换头像')
// .fontColor(Color.Gray)
// .fontSize(15)
// .backgroundColor(Color.White)
// .margin(20)
List({}){
ForEach(this.listData,(item:EditListInfo,index:number) =>{
... ...
... ... @@ -14,7 +14,7 @@ import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh';
import { MyCustomDialog } from '../reusable/MyCustomDialog'
import { NetworkUtil } from 'wdKit/Index';
import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils'
import { TrackConstants } from 'wdTracking/Index';
import { TrackConstants, TrackingButton, TrackingContent, TrackParamConvert } from 'wdTracking/Index';
@Entry
@Component
... ... @@ -36,6 +36,9 @@ struct MyCollectionListPage {
builder: MyCustomDialog({
confirm: () => {
this.deleteDatas()
if (this.isAllSelect) {
TrackingButton.click('morning_evening_news_click',TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect)
}
},
titleShow:false,
tipValue: this.isAllSelect?'是否确认清空?':'确认删除'+this.deleteNum.toString()+'条收藏'
... ... @@ -146,7 +149,14 @@ struct MyCollectionListPage {
Column() {
BigPicCardComponent({compDTO:new CompDTO,contentDTO:compDTO})
}
}
}.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
if (isVisible) {
TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect, TrackParamConvert.program(compDTO))
}
})
// .onClick(()=>{
// TrackingContent.common(TrackConstants.EventType.Click, TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect, TrackParamConvert.program(compDTO))
// })
}
... ...
import ArrayList from '@ohos.util.ArrayList'
import { MineSettingComponent } from '../setting/MineSettingComponent';
import { AccountAndSecurityLayout } from '../setting/AccountAndSecurityLayout';
import router from '@ohos.router';
import { Action, Params } from 'wdBean';
import { Params } from 'wdBean';
import { DateTimeUtils } from 'wdKit/Index';
import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index';
import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index';
@Entry
@Component
struct SettingPage {
@State message: string = 'Hello World 02'
@State pageType: string = 'mainSetting';
@State params:Params = router.getParams() as Params;
@State enterActivityTime:number = 0;
@Provide pageShow: number = -1
@Provide pageHide: number = -1
pageShowSettingTime:number = 0;
pageHideSettingTime:number = 0;
pageShowAccountTime:number = 0;
pageHideAccountTime:number = 0;
onPageShow() {
this.pageShow = Math.random()
this.pageType = this.params.pageID;
this.enterActivityTime = DateTimeUtils.getTimeStamp()
if (this.pageType == 'mainSetting'){
this.pageShowSettingTime = DateTimeUtils.getTimeStamp()
}else{
this.pageShowAccountTime = DateTimeUtils.getTimeStamp()
}
}
onPageHide(): void {
this.pageHide = Math.random()
if (this.pageType == 'mainSetting'){
this.pageHideSettingTime = DateTimeUtils.getTimeStamp()
}else{
this.pageHideAccountTime = DateTimeUtils.getTimeStamp()
}
let duration = 0
if(this.pageType == 'mainSetting'){
duration = Math.floor((this.pageHideSettingTime - this.pageShowSettingTime)/1000)
}else{
duration = Math.floor((this.pageHideAccountTime - this.pageShowAccountTime)/1000)
}
if(this.pageType == 'mainSetting'){
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Setting,TrackConstants.PageName.Setting,duration)
}else{
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Account_Management,TrackConstants.PageName.Account_Management,duration)
}
}
... ...
... ... @@ -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 { TrackConstants, TrackingButton } from 'wdTracking/Index';
const TAG = 'TopNavigationComponent';
... ... @@ -83,16 +84,16 @@ export struct TopNavigationComponentNew {
PeopleShipMainComponent({
currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
navIndex: index,
pageId: navItem.pageId + '',
channelId: navItem.channelId + '',
pageId: navItem?.pageId + '',
channelId: navItem?.channelId + '',
})
} else
if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) {
PageComponent({
currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
navIndex: index,
pageId: navItem.pageId + '',
channelId: navItem.channelId + '',
pageId: navItem?.pageId + '',
channelId: navItem?.channelId + '',
autoRefresh: this.autoRefresh2Page
})
} else {
... ... @@ -171,6 +172,7 @@ export struct TopNavigationComponentNew {
.onClick(() => {
if (NetworkUtil.isNetConnected()) {
ProcessUtils.gotoMorningEveningPaper()
TrackingButton.click('morning_evening_news_click',TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews)
} else {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
}
... ...
... ... @@ -190,12 +190,20 @@ export struct SearchResultContentComponent {
})
let isRemain : boolean = false
SearcherAboutDataModel.getCreatorDetailListData({creatorIdList:creatorIdList}).then((rem) => {
resultData.list.forEach((value) => {
resultData.list.forEach((value: SearchResultContentItem) => {
const landscape = value.data.landscape
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)
photos.push(
{
fullUrl: value,
weight:resizeParams.width,
height:resizeParams.height,
landscape: Number(landscape),
} as FullColumnImgUrlDTO
)
})
// }
let contentDTO = this.dataTransform(rem,value, photos);
... ... @@ -458,7 +466,13 @@ export struct SearchResultContentComponent {
let rmhInfo = this.getRmhInfo(rem,value)
console.log('获取photos',JSON.stringify(photos))
console.log('获取value2',JSON.stringify(value))
let liveType = value.data?.liveType;
let seoTags = value.data?.seoTags
let cornerMark = value.data?.cornerMark
let contentDTO = new ContentDTO();
contentDTO.liveType = liveType?liveType: ""
contentDTO.seoTags = seoTags?seoTags: ""
contentDTO.cornerMark = cornerMark?cornerMark: ""
contentDTO.appStyle = value.data.appStyle + ""
contentDTO.cityCode = value.data.cityCode
contentDTO.coverSize = ""
... ...
import { SpConstants } from 'wdConstant';
import { Logger, SPHelper, ToastUtils, EmitterEventId, EmitterUtils } from 'wdKit';
import { Logger, SPHelper, ToastUtils, EmitterEventId, EmitterUtils, DateTimeUtils } from 'wdKit';
import {MineMainSettingFunctionItem} from '../../viewmodel/MineMainSettingFunctionItem';
import MineSettingDatasModel from '../../model/MineSettingDatasModel';
import router from '@ohos.router';
... ... @@ -11,7 +11,7 @@ import { LogoutViewModel } from '../../viewmodel/LogoutViewModel';
import { CustomLogoutDialog } from './CustomLogoutDialog';
import { emitter } from '@kit.BasicServicesKit';
import { ConfirmLogoutDialog } from './ConfirmLogoutDialog';
import { TrackingButton, TrackConstants } from 'wdTracking/Index';
import { TrackingButton, TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
export { SettingPasswordParams } from "wdLogin"
@Component
... ... @@ -22,8 +22,37 @@ export struct AccountAndSecurityLayout {
@State protocolState: boolean = false //协议勾选状态
@State isAccountPage: boolean = true
@State ifSetPassword: boolean = false //是否设置过密码
@Consume pageShow :number
@Consume @Watch('pageHideForUpdateData') pageHide :number
@Watch("checkSetPassword") @Prop enterActivityTime:number = 0;
logoutLayoutShowTime:number = 0;
logoutLayoutHideTime:number = 0;
pageShowAccountTime:number = 0;
pageHideAccountTime:number = 0;
//注销账户 浏览埋点
logoutLayoutHide(){
this.logoutLayoutHideTime = DateTimeUtils.getTimeStamp()
let duration = 0
duration = Math.floor((this.logoutLayoutHideTime - this.logoutLayoutShowTime)/1000)
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account,duration)
}
//账户管理 浏览埋点
logoutLayoutHide2(){
this.pageHideAccountTime = DateTimeUtils.getTimeStamp()
let duration = 0
duration = Math.floor((this.pageHideAccountTime - this.pageShowAccountTime)/1000)
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Account_Management,TrackConstants.PageName.Account_Management,duration)
}
pageHideForUpdateData(){
if(!this.isAccountPage){
this.logoutLayoutHide()
}else{
this.logoutLayoutHide2()
}
}
logoutViewModel = new LogoutViewModel()
dialogController: CustomDialogController = new CustomDialogController({
... ... @@ -57,6 +86,7 @@ export struct AccountAndSecurityLayout {
aboutToAppear() {
this.pageShowAccountTime = DateTimeUtils.getTimeStamp()
// 获取设置页面数据
this.getAccountAndSecurityData()
this.addEmitEvent()
... ... @@ -175,9 +205,7 @@ 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)
WDRouterRule.jumpWithPage(WDRouterPage.changeBindPhonePage)
}else if (index == 1) {
trackButtonClick("accountManagementPageAccountManagementPassword")
if (this.ifSetPassword) {
... ... @@ -185,13 +213,12 @@ export struct AccountAndSecurityLayout {
WDRouterRule.jumpWithPage(WDRouterPage.modifyPasswordPage)
}else{
//设置密码
let pageType = {'pageType': 1} as Record<string, number>;
WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType)
WDRouterRule.jumpWithPage(WDRouterPage.verifyPhoneNumberPage)
}
}else if (index == 3) {
trackButtonClick("accountManagementPageAccountCancellation")
this.isAccountPage=false
// WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType)
this.logoutLayoutShowTime = DateTimeUtils.getTimeStamp()
}
})
... ... @@ -255,6 +282,8 @@ export struct AccountAndSecurityLayout {
})
.onClick(() => {
this.isAccountPage=true
this.pageShowAccountTime = DateTimeUtils.getTimeStamp()
this.logoutLayoutHide()
this.protocolState=false
})
.id('backImage')
... ... @@ -332,6 +361,7 @@ export struct AccountAndSecurityLayout {
Text() {
Span("我已阅读并同意").fontColor("#999999").fontSize(12)
Span("《用户注销协议》").fontColor("#ED2800").fontSize(12).onClick(() => {
TrackingButton.click("cancelAccountPageUserLogoffAgreement",TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account)
let bean = { contentID: "3", pageID: "" } as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
})
... ... @@ -353,6 +383,7 @@ export struct AccountAndSecurityLayout {
if (!this.protocolState) {
return
}
TrackingButton.click("cancelAccountPageconfirmCancelAccount",TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account)
this.dialogController.open()
})
... ... @@ -456,6 +487,7 @@ export struct AccountAndSecurityLayout {
//注销账号
requestLogout() {
TrackingButton.click("cancelAccountPageCancelAccountSuccess",TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account)
this.logoutViewModel.requestLogout().then(()=>{
ToastUtils.shortToast("注销成功")
router.back()
... ...
... ... @@ -5,6 +5,11 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { SpConstants } from 'wdConstant/Index';
import { ContentDetailDTO } from 'wdBean/Index';
import measure from '@ohos.measure'
import {
ContentDetailRequest,
postExecuteLikeParams,
batchLikeAndCollectParams,
} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
const TAG = 'LikeComponent';
... ... @@ -17,7 +22,7 @@ interface ILikeStyleResp {
export struct LikeComponent {
@Consume contentDetailData: ContentDetailDTO
@Prop pageComponentType: number
@State likesStyle: number = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@State likeStatus: boolean = false
viewModel: LikeViewModel = new LikeViewModel()
@Prop @Watch('onDataUpdated') data: Record<string, string>
... ... @@ -36,12 +41,21 @@ export struct LikeComponent {
// this.data['status'] = "1"
aboutToAppear() {
// 2:竖屏直播页 3:图集 4:横屏直播页
if(this.pageComponentType == 2 || this.pageComponentType == 4) {
// 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福
this.likesStyle = this.contentDetailData?.liveInfo?.likesStyle
} else {
// 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
this.likesStyle = this.contentDetailData.likesStyle
}
this.onDataUpdated()
}
onDataUpdated() {
console.log(TAG, '点赞点击')
if (this.data) {
if (this.data['channelId'] !== 'undefined') {
if (this.data['contentType'] !== 'undefined') {
//获取点赞状态
this.getLikeStatus()
//获取点赞数
... ... @@ -74,7 +88,7 @@ export struct LikeComponent {
* 将点赞样式转换为icon
*/
transLikeStyle(): ILikeStyleResp {
if (this.likesStyle === 1) {
if (this.likesStyle === 1 || this.likesStyle === 'love' || this.likesStyle === 'thumb') {
return {
url: this.likeStatus ? $r(`app.media.ic_like_check`) :
this.styleType == 1 ?
... ... @@ -82,12 +96,12 @@ export struct LikeComponent {
$r(`app.media.ic_like_uncheck`),
name: '赞'
}
} else if (this.likesStyle === 2) {
} else if (this.likesStyle === 2 || this.likesStyle === 'pray') {
return {
url: this.likeStatus ? $r(`app.media.ic_thub_check`) : $r(`app.media.ic_thub_uncheck`),
name: '祈祷'
}
} else if (this.likesStyle === 3) {
} else if (this.likesStyle === 3 || this.likesStyle === 'mourning') {
return {
url: this.likeStatus ? $r(`app.media.ic_candle_check`) :
$r(`app.media.ic_candle_uncheck`),
... ... @@ -137,6 +151,7 @@ export struct LikeComponent {
}
.width(154)
.height(40)
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible)
}
@Builder
... ... @@ -154,6 +169,7 @@ export struct LikeComponent {
.onClick(() => {
this.clickButtonEvent()
})
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible)
}
@Builder
... ... @@ -167,7 +183,10 @@ export struct LikeComponent {
.onClick(() => {
this.clickButtonEvent()
})
}.width(24).height(24)
}
.width(24)
.height(24)
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible)
}
@Builder
... ... @@ -242,6 +261,7 @@ export struct LikeComponent {
}.width(24).height(24).onClick(() => {
this.clickButtonEvent()
})
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible)
}
@Builder
... ... @@ -278,6 +298,7 @@ export struct LikeComponent {
}
.width(36)
.height(42)
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible)
}
... ... @@ -300,13 +321,26 @@ export struct LikeComponent {
executeLike(status: string) {
console.log(TAG, '点赞接口调用', status)
this.data['status'] = status
this.data['contentId'] = this.contentDetailData?.newsId + ''
this.data['contentType'] = this.contentDetailData?.newsType + ''
this.viewModel.executeLike2(this.data).then(() => {
const params: postExecuteLikeParams = {
status: Number(status),
contentId: this.data['contentId'],
contentType: this.data['contentType']
}
if(this.data['relType']) {
params.relType = this.data['relType']
}
if(this.data['contentRelId']) {
params.contentRelId = this.data['contentRelId']
}
if(this.data['channelId']) {
params.channelId = this.data['channelId']
}
console.log(TAG, "点赞 params", JSON.stringify(params))
ContentDetailRequest.postExecuteLike(params).then((data) => {
console.log(TAG, '点赞接口调用成功')
console.log(TAG, '点赞接口调用成功', JSON.stringify(data))
// 直播点赞一直增加
if (this.contentDetailData.liveInfo) {
... ... @@ -333,11 +367,25 @@ export struct LikeComponent {
}
getLikeStatus() {
this.viewModel.getLikeStatus(this.data).then((data) => {
if (data && data['data'].length && data['data'][0]['likeStatus']) {
this.likeStatus = data['data'][0]['likeStatus']
} else {
this.likeStatus = false
// console.log(TAG, "this.data", JSON.stringify(this.data))
const params: batchLikeAndCollectParams = {
contentList: [
{
contentId: this.data['contentId'],
contentType: this.data['contentType'],
contentRelId: this.data['contentRelId'] || '' + '',
}
]
}
console.log(TAG, "查询点赞状态params", JSON.stringify(params))
ContentDetailRequest.postBatchLikeAndCollectStatus(params).then(res => {
console.log(TAG, '查询点赞、收藏状态==', JSON.stringify(res.data))
if (res.data) {
if(res.data[0].likeStatus) {
this.likeStatus = res.data[0].likeStatus ? true : false
} else {
this.likeStatus = false
}
}
}).catch(() => {
this.likeStatus = false
... ...
... ... @@ -36,6 +36,7 @@ const TAG = 'OperRowListView';
* 注意:外层需注册 @Provide contentDetailData:contentDetailData = {} as contentDetailData
* 传值示例:
OperRowListView({
contentDetailData: this.contentDetailData[0],
operationButtonList: ['comment', 'like', 'collect', 'listen', 'share']
})
... ... @@ -123,11 +124,25 @@ export struct OperRowListView {
await this.queryContentInteractCount()
// 点赞需要数据
this.likeBean['contentId'] = this.contentDetailData.newsId + ''
this.likeBean['userName'] = this.contentDetailData.userInfo?.userName + ''
if(this.contentDetailData.userInfo?.userName) {
this.likeBean['userName'] = this.contentDetailData.userInfo?.userName + ''
}
this.likeBean['contentType'] = this.contentDetailData.newsType + ''
this.likeBean['title'] = this.contentDetailData.newsTitle + ''
this.likeBean['userHeaderUrl'] = this.contentDetailData.userInfo?.headPhotoUrl + ''
this.likeBean['channelId'] = this.contentDetailData.reLInfo?.channelId + ''
if(this.contentDetailData.newsTitle) {
this.likeBean['title'] = this.contentDetailData.newsTitle + ''
}
if(this.contentDetailData.userInfo?.headPhotoUrl) {
this.likeBean['userHeaderUrl'] = this.contentDetailData.userInfo?.headPhotoUrl + ''
}
if(this.contentDetailData.reLInfo?.channelId) {
this.likeBean['channelId'] = this.contentDetailData.reLInfo?.channelId + ''
}
if(this.contentDetailData?.reLInfo?.relType) {
this.likeBean['relType'] = this.contentDetailData?.reLInfo?.relType + ''
}
if(this.contentDetailData?.reLInfo?.relId) {
this.likeBean['contentRelId'] = this.contentDetailData?.reLInfo?.relId + ''
}
console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData))
console.info(TAG, 'likeBean----', JSON.stringify(this.likeBean))
// 评论需要数据
... ... @@ -202,7 +217,7 @@ export struct OperRowListView {
.padding({
top: 10,
// bottom: 10
bottom: px2vp(this.bottomSafeHeight)
bottom: `${this.bottomSafeHeight}px`
// bottom: 50
})
}
... ... @@ -387,6 +402,7 @@ export struct OperRowListView {
}
]
}
console.info(TAG, '查询用户对作品收藏1', JSON.stringify(params))
// console.info(TAG, '查询用户对作品收藏11', JSON.stringify(params))
let data = await MultiPictureDetailViewModel.getInteractDataStatus(params)
console.info(TAG, '查询用户对作品收藏22', JSON.stringify(data))
... ...
... ... @@ -31,6 +31,7 @@ export struct PermissionDesComponent {
.border({ radius: 5 })
.margin({ top: 12 })
.padding(12)
.zIndex(20)
}
startDismiss() {
... ...
... ... @@ -96,7 +96,7 @@ class MinePageDatasModel{
* 包含名字和图标
*/
getMoreFunctionsData():MinePageCreatorFunctionsItem[]{
if(this.moreData.length === 5){
if(this.moreData.length === 3){
return this.moreData
}
// this.moreData.push(new MinePageMoreFunctionModel("扫一扫",$r('app.media.mine_scan')))
... ...
... ... @@ -177,9 +177,9 @@ export class ColorUtils {
public static getMorningEveningPaperRgb(color: ColorRgb): ColorRgb{
// RGB颜色取值范围是0~255,需要转换为0~1的浮点数
const red: number = color.red / MAX_RGB_VALUE;
const green: number = color.green / MAX_RGB_VALUE;
const blue: number = color.blue / MAX_RGB_VALUE;
const red: number = color.red ;
const green: number = color.green ;
const blue: number = color.blue;
const max: number = Math.max(red, green, blue);
const min: number = Math.min(red, green, blue);
... ...
... ... @@ -34,7 +34,7 @@
},
{
"name": "image_request_success",
"value": "图片下载到图库成功"
"value": "已保存到相册"
},
{
"name": "image_request_fail",
... ...
... ... @@ -119,7 +119,7 @@ export interface postBatchAttentionStatusResult {
export interface postExecuteLikeParams {
status: string;
status: number;
contentId: string;
contentType: string;
relType?: string;
... ...
... ... @@ -112,7 +112,7 @@ export struct DetailPlayShortVideoPage {
{
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
contentRelId: this.contentDetailData?.reLInfo?.relId + '',
contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '',
}
]
}
... ...
... ... @@ -74,7 +74,7 @@ export struct OperationListView {
return
}
const params: postExecuteLikeParams = {
status: this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1',
status: this.newsStatusOfUser?.likeStatus === '1' ? 0 : 1,
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
}
... ...
... ... @@ -56,15 +56,22 @@ export struct PlayerRightView {
return
}
const params: postExecuteLikeParams = {
status: this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1',
status: this.newsStatusOfUser?.likeStatus === '1' ? 0 : 1,
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
userName: this.contentDetailData?.userInfo?.userName || '' + '',
contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '',
title: this.contentDetailData?.newsTitle || '' + '',
channelId: this.contentDetailData?.reLInfo?.channelId + '',
relType: this.contentDetailData?.reLInfo?.relType || '' + '',
userHeaderUrl: this.contentDetailData?.userInfo?.headPhotoUrl || '' + '',
}
console.log(TAG, '点赞params', JSON.stringify(params))
ContentDetailRequest.postExecuteLike(params).then(res => {
console.log(TAG, '点赞this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
if (this.newsStatusOfUser) {
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1'
if (this.newsStatusOfUser.likeStatus === '1') {
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
if (this.newsStatusOfUser.likeStatus == '1') {
this.interactData.likeNum = Number(this.interactData.likeNum || 0) + 1
} else {
this.interactData.likeNum = Math.max(0, Number(this.interactData.likeNum || 0) - 1)
... ... @@ -237,17 +244,17 @@ export struct PlayerRightView {
transLikeStyle(): ILikeStyleResp {
if (this.likesStyle === 1) {
return {
url: this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_like_check`) : $r(`app.media.ic_like_uncheck`),
url: this.newsStatusOfUser.likeStatus == '1' ? $r(`app.media.ic_like_check`) : $r(`app.media.ic_like_uncheck`),
name: '赞'
}
} else if (this.likesStyle === 2) {
return {
url: this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_thub_check`) : $r(`app.media.ic_thub_uncheck`),
url: this.newsStatusOfUser.likeStatus == '1' ? $r(`app.media.ic_thub_check`) : $r(`app.media.ic_thub_uncheck`),
name: '祈祷'
}
} else if (this.likesStyle === 3) {
return {
url: this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_candle_check`) :
url: this.newsStatusOfUser.likeStatus == '1' ? $r(`app.media.ic_candle_check`) :
$r(`app.media.ic_candle_uncheck`),
name: '默哀'
}
... ...
... ... @@ -13,6 +13,7 @@
"wdKit": "file:../../commons/wdKit",
"wdBean": "file:../../features/wdBean",
"wdRouter": "file:../../commons/wdRouter",
"wdTracking": "file:../../features/wdTracking",
"wdNetwork": "file:../../commons/wdNetwork"
}
}
\ No newline at end of file
... ...
... ... @@ -11,6 +11,7 @@ import { notificationManager } from '@kit.NotificationKit';
import { BusinessError } from '@kit.BasicServicesKit';
import { SpConstants } from 'wdConstant/Index';
import { PushContentBean, PushContentParser } from './PushContentParser';
import { ParamType, Tracking } from 'wdTracking/Index';
const TAG = "GetuiPush"
... ... @@ -220,6 +221,15 @@ export class GetuiPush {
this.lastPushContent = undefined
}
private trackingClick(content: PushContentBean) {
let param: ParamType = {
"pushResourceId": "",
"pushTitle": content.notifyTitle || "",
"pushContent": content.notifyContent || "",
}
Tracking.event("push_click", param)
}
private dealWithCmdMessage(result: GTCmdMessage) {
let action: Number = result.action;
if (action === PushConst.BIND_ALIAS_RESULT) {
... ...
... ... @@ -9,6 +9,8 @@ export interface PushContentBean {
want?: Want // want参数 (用来在消费时,回执)
online: boolean // 解析want,是否为在线消息(在线走的是个推通道,离线走的是华为厂商通道)
pushLink?: string // 解析want,对应pushLink参数
notifyTitle?: string
notifyContent?: string
}
/*
... ... @@ -66,7 +68,9 @@ export class PushContentParser {
if (want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK]) {
let pushLink = want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK] as string
return {
isPush: true, online: true, pushLink: pushLink, want: want
isPush: true, online: true, pushLink: pushLink, want: want,
notifyTitle: gtData["title"] as string,
notifyContent: gtData["content"] as string,
}
}
}
... ... @@ -105,7 +109,9 @@ export class PushContentParser {
if (want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK]) {
let pushLink = want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK] as string
return {
isPush: true, online: false, pushLink: pushLink, want: want
isPush: true, online: false, pushLink: pushLink, want: want,
notifyTitle: want.parameters["title"] as string,
notifyContent: want.parameters["content"] as string,
}
}
}
... ...
import { SpConstants } from 'wdConstant/Index'
import { CustomToast, Logger, NetworkUtil, ToastUtils, SPHelper, EmitterEventId,
DateTimeUtils } from 'wdKit/Index'
import { LoginViewModel } from './LoginViewModel'
import { router } from '@kit.ArkUI'
import { emitter } from '@kit.BasicServicesKit'
import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index'
const TAG = 'ChangeBindPhonePage'
/*更换手机号页面*/
@Entry
@Component
struct ChangeBindPhonePage {
@State phoneContent: string = ''
@State codeContent: string = ''
@State isSubmit: boolean = false //是否可以提交 默认不可以
loginViewModel: LoginViewModel = new LoginViewModel()
@State @Watch('onCodeSend') isCodeSend: boolean = false //验证码点击发送事件
@State pageTitle:string = '更换手机号';
@State @Watch('startCount') codeStateSuccess:boolean=false
@State codeBtnState: boolean = false
@State timeCount: number = 60
isFirst:boolean=true//是否第一次获取验证码
lastTime: number = 0
pageShowTime:number = 0;
pageHideTime:number = 0;
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
}
onPageHide(): void {
this.pageHideTime = DateTimeUtils.getTimeStamp()
let duration = 0
duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Change_PhoneNum,TrackConstants.PageName.Change_PhoneNum,duration)
}
onCodeSend() {
if (this.isCodeSend) {
TrackingButton.click("changePhoneNumberPageSendVerificationCode",TrackConstants.PageName.Change_PhoneNum,TrackConstants.PageName.Change_PhoneNum)
this.sendVerifyCode()
}
}
@State toastText:string = ""
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
msg: this.toastText,
}),
autoCancel: false,
alignment: DialogAlignment.Center,
customStyle: true,
maskColor:"#00000000"
})
build() {
Column() {
Image($r('app.media.login_back_icon')).width(24).height(24).margin({ left: 15, top: 10 }).onClick(() => {
router.back()
})
Text(this.pageTitle).fontSize(22).fontColor('#333333').fontWeight(FontWeight.Bold).margin({ left: 25, top: 112 })
Column(){
TextInput({text: this.phoneContent, placeholder: "请输入手机号" })
.fontSize(16)
.height(48)
.placeholderColor("#CCCCCC")
.maxLength(11)
.margin({ top: 36 })
.backgroundColor("#F5F5F5")
.borderRadius(4)
.type(InputType.Number)
.onChange((content) => {
this.phoneContent = content
this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 4)
if (content.length >= 11 ) {
this.codeBtnState = true
} else {
this.codeBtnState = false
}
})
Row() {
TextInput({ text: this.codeContent,placeholder: "验证码" })
.placeholderColor("#CCCCCC")
.layoutWeight(1)
.fontSize(16)
.height(48)
.type(InputType.Number)
.fontColor("#222222")
.backgroundColor("#00000000")
.borderRadius({ topLeft: 4, bottomLeft: 4 })
.onChange((value) => {
this.codeContent = value
this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 4)
})
Text(this.codeStateSuccess ? this.timeCount + "s" : this.isFirst?"发送验证码":'重新获取')
.fontColor(this.codeBtnState?'#ED2800':'#80ED2800')
.width(110)
.fontSize(14)
.fontWeight( FontWeight.Bold)
.height(48)
.textAlign(TextAlign.Center)
.enabled(this.codeStateSuccess?false:true)
.onClick(() => {
if (this.phoneContent.length < 11) {
return
}
let currentTime = DateTimeUtils.getTimeStamp()
if (currentTime - this.lastTime < 500) {
return
}
this.lastTime = currentTime;
this.isCodeSend = true
})
}.margin({ top: 12 })
.height(48)
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Start)
.backgroundImage($r('app.media.code_login_bg'))
.backgroundImageSize({width:'100%',height:48})
}.width('100%')
.padding({ left: 25, right: 25 })
Row() {
Text("确认")
.layoutWeight(1)
.fontColor(this.isSubmit ?"#FFFFFFFF":"#66FFFFFF")
.borderRadius(4)
.fontSize(18)
.textAlign(TextAlign.Center)
.fontWeight(FontWeight.Medium)
.margin({ top: 26 })
.height(44)
.backgroundColor(this.isSubmit ?"#ED2800":"#99ED2800")
.enabled(this.isSubmit ? true : false)
.onClick(() => {
TrackingButton.click("changePhoneNumberPageConfirm",TrackConstants.PageName.Change_PhoneNum,TrackConstants.PageName.Change_PhoneNum)
this.changeBindPhone()
})
}.width('100%')
.padding({ left: 25, right: 25 })
}.width('100%').height('100%').alignItems(HorizontalAlign.Start)
}
//发送验证码
sendVerifyCode() {
if (this.isEmpty(this.phoneContent)) {
return
}
this.loginViewModel.sendVerifyCode(this.phoneContent).then((verifyCode) => {
this.showToastTip("已发送")
this.codeStateSuccess=true
this.isCodeSend=false
Logger.debug(TAG, "sendVerifyCode: " + verifyCode)
}).catch((message: string)=>{
let netStatus = NetworkUtil.isNetConnected()
if (netStatus) {
this.showToastTip(message)
} else {
this.showToastTip("验证码获取失败,请重新尝试")
}
this.codeStateSuccess=false
this.isCodeSend=false
})
}
isEmpty(obj: undefined|null|string): boolean {
return (obj == undefined || obj == null || obj == '');
}
changeBindPhone(){
if (!this.isSubmit) {
return
}
if (this.isEmpty(this.phoneContent)) {
return
}
if (this.isEmpty(this.codeContent)) {
return
}
this.loginViewModel.changeBindPhone(this.phoneContent,this.codeContent).then(()=>{
ToastUtils.shortToast('绑定成功')
this.querySecurity()
}).catch((message: string) => {
if (message != '') {
ToastUtils.shortToast(message)
}
})
}
querySecurity(){
this.loginViewModel.querySecurity().then(()=>{
SPHelper.default.save(SpConstants.USER_PHONE,this.phoneContent)
this.sendEmitEvent()
router.back()
}).catch(()=>{
})
}
sendEmitEvent(){
// 定义一个eventId为1的事件,事件优先级为Low
let event: emitter.InnerEvent = {
eventId: EmitterEventId.PHONE_CHANGE_SUCCESS,
priority: emitter.EventPriority.LOW
};
let eventData: emitter.EventData = {
data: {
content: this.phoneContent,
}
};
// 发送eventId为1的事件,事件内容为eventData
emitter.emit(event, eventData);
}
showToastTip(msg:string){
this.toastText = msg
this.dialogToast.open()
}
startCount() {
this.isFirst = false
let time = setInterval(() => {
Logger.debug("倒计时:" + this.timeCount)
this.timeCount--
if (this.timeCount < 1) {
this.codeStateSuccess = false
this.timeCount = 60
clearInterval(time)
}
}, 1000)
}
}
\ No newline at end of file
... ...
... ... @@ -22,7 +22,7 @@ struct ForgetPasswordPage {
@State isSubmit: boolean = false //是否可以提交 默认不可以
loginViewModel: LoginViewModel = new LoginViewModel()
@State @Watch('onCodeSend') isCodeSend: boolean = false //验证码点击发送事件
pageType:number = (router.getParams() as Record<string, number>)['pageType']; //0、登录->忘记密码 1、设置->重置密码 2、设置->更换手机号页面1 3、设置->更换手机号页面2
pageType:number = (router.getParams() as Record<string, number>)['pageType']; //0、登录->忘记密码 1、设置->重置密码 3、设置->更换手机号页面2(不知道是啥)
phone:string = (router.getParams() as Record<string, number>)['phone'] + ""; //登录 密码登录 填写手机号 点击忘记密码 带过来手机号
@State pageTitle:string = '找回密码';
@State codeStateSuccess:boolean=false
... ... @@ -51,7 +51,6 @@ struct ForgetPasswordPage {
router.back()
})
Text(this.pageTitle).fontSize(22).fontColor('#333333').fontWeight(FontWeight.Bold).margin({ left: 25, top: 112 })
LoginInputComponent({
phoneContent: $phoneContent,
... ... @@ -74,11 +73,7 @@ struct ForgetPasswordPage {
.backgroundColor(this.isSubmit ?"#ED2800":"#99ED2800")
.enabled(this.isSubmit ? true : false)
.onClick(() => {
if(this.pageType==2){
this.changeBindPhone()
}else {
this.checkVerifyCode()
}
this.checkVerifyCode()
})
}.padding({ left: 25, right: 25 }).width('100%')
... ... @@ -98,8 +93,6 @@ struct ForgetPasswordPage {
}
}else if (this.pageType == 1){
this.pageTitle = '验证当前手机号'
}else if (this.pageType == 2){
this.pageTitle = '更换手机号'
}
if (this.isCodeSend) {
this.sendVerifyCode()
... ...
... ... @@ -10,7 +10,7 @@ export struct LoginInputComponent {
@Link isCodeSend: boolean //验证码控件是否点击 默认没有 发送接口
@Link isSubmit: boolean //是否可以提交
isFirst:boolean=true//是否第一次获取验证码
pageType?:number; //0、登录->忘记密码 1、设置->重置密码 2、设置->更换手机号页面1 3、设置->更换手机号页面2
pageType?:number; //0、登录->忘记密码 3、设置->更换手机号页面2
lastTime: number = 0
@Link @Watch('startCount') codeStateSuccess: boolean //验证码获取成功与否回调 成功显示倒计时
@Watch('onCheckChange') @Prop protocolState: boolean = false //协议勾选状态
... ... @@ -33,9 +33,6 @@ export struct LoginInputComponent {
}
async aboutToAppear(){
if (this.pageType == 1 ) {
this.phoneContent = await SPHelper.default.get(SpConstants.USER_PHONE,"") as string;
}
if(this.pageType == 0 ){
let phone = await SPHelper.default.get(SpConstants.USER_PHONE,"") as string
if(StringUtils.isNotEmpty(phone)){
... ... @@ -43,29 +40,9 @@ export struct LoginInputComponent {
}
}
}
@Builder
addCodeLayout() {
if (this.pageType == 1){
TextInput({ text: this.securityPhone(this.phoneContent) })
.placeholderColor("#CCCCCC")
.fontSize(16)
.height(48)
.maxLength(11)
.margin({ top: 36 })
.backgroundColor("#F5F5F5")
.borderRadius(4)
.enabled(false)
.type(InputType.PhoneNumber)
.onChange((content) => {
this.phoneContent = content
this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 4)
if (content.length >= 11) {
this.codeBtnState = true
} else {
this.codeBtnState = false
}
})
}else{
//修改密码 里面的 忘记密码(已登录)
if(StringUtils.isNotEmpty(this.phoneContent) && this.phoneContent.indexOf("****")!=-1 && this.pageType == 0){
TextInput({ text: this.securityPhone(this.phoneContent) })
... ... @@ -115,7 +92,6 @@ export struct LoginInputComponent {
}
})
}
}
Row() {
... ...
... ... @@ -378,6 +378,7 @@ struct LoginPage {
TrackingButton.click("loginPageLoginButton",TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page)
this.loginViewModel.appLogin(this.phoneContent, 2, this.codeContent).then((data) => {
Logger.debug(TAG, "requestLogin: " + data.jwtToken)
this.showToastTip('登录成功')
///同步兴趣tag
let interestsModel = new InterestsHobbiesModel()
interestsModel.updateInterests()
... ...
... ... @@ -29,10 +29,12 @@ struct LoginProtocolWebview {
this.contentID = params.contentID
}
if (params.contentID == "1") { //"人民日报客户端网络服务使用协议"
this.webUrl = this.userProtocol
this.webUrl = await SPHelper.default.get(SpConstants.NET_SERVICE_PROTOCOL, this.userProtocol) as string
this.webviewController.loadUrl(this.webUrl)
} else if(params.contentID == "2"){ //"人民日报客户端用户隐私协议"
this.webUrl = this.privateProtocol
this.webUrl = await SPHelper.default.get(SpConstants.PRIVATE_PROTOCOL, this.privateProtocol) as string
this.webviewController.loadUrl(this.webUrl)
}else if(params.contentID == "3"){ //注销协议
... ...
... ... @@ -4,7 +4,7 @@ import { LoginModel } from './LoginModel';
import { ModifyPasswordRequestItem } from './ModifyPasswordRequestItem';
import { router } from '@kit.ArkUI';
import { encryptMessage } from '../../utils/cryptoUtil';
import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index';
import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index';
/**
* 修改密码页面
... ... @@ -153,6 +153,7 @@ struct ModifyPasswordPage {
.borderRadius('4vp')
.onClick(() => {
if(this.btnStatus){
TrackingButton.click("changePasswordPageConfirm",TrackConstants.PageName.Change_Passwd,TrackConstants.PageName.Change_Passwd)
this.submit()
}
})
... ...
... ... @@ -6,6 +6,7 @@ import { BusinessError } from '@kit.BasicServicesKit'
import { Logger, ToastUtils, CustomToast, EmitterUtils, EmitterEventId } from 'wdKit/Index'
import { LoginViewModel } from './LoginViewModel'
import {InterestsHobbiesModel} from '../../../../../../../products/phone/src/main/ets/pages/viewModel/InterestsHobbiesModel'
import { TrackConstants, TrackingButton, TrackingPageBrowse } from 'wdTracking/Index'
const TAG = "OneKeyLoginPage"
... ... @@ -28,10 +29,35 @@ struct OneKeyLoginPage {
maskColor:"#00000000"
})
// 埋点计算页面浏览时长
private pageStartDate: number = 0
private pageName = TrackConstants.PageName.OneClick_Login
aboutToAppear(): void {
this.anonymousPhone = HuaweiAuth.sharedInstance().anonymousPhone||""
}
onPageShow(): void {
this.pageStartDate = Date.now()
}
onPageHide(): void {
const duration = (Date.now() - this.pageStartDate!)
TrackingPageBrowse.trackCommonPageExposureEnd(this.pageName, this.pageName, duration)
}
// pageTransition() {
// // 为目标页面时,进入:从右边侧滑入,退出:是右侧划出;跳转别的页面:左侧划出,返回:左侧划入。
// PageTransitionEnter({ type: RouteType.Push, duration: 300 })
// .slide(SlideEffect.Right)
// PageTransitionEnter({ type: RouteType.Pop, duration: 300 })
// .slide(SlideEffect.Left)
// PageTransitionExit({ type: RouteType.Push, duration: 300 })
// .slide(SlideEffect.Left)
// PageTransitionExit({ type: RouteType.Pop, duration: 300 })
// .slide(SlideEffect.Right)
// }
build() {
Column() {
this.CloseRow()
... ... @@ -39,14 +65,21 @@ struct OneKeyLoginPage {
Image($r("app.media.login_logo"))
.width(120)
.height(66)
.margin({ top: 78, bottom: 74})
.margin({ top: 34, bottom: 64})
.align(Alignment.Center)
Text(this.anonymousPhone)
.fontSize(30)
.fontWeight(600)
.fontColor("#222222")
.margin({bottom: 10})
.margin({bottom: 12})
.align(Alignment.Center)
Text("华为账号绑定号码")
.fontSize(12)
.fontWeight(400)
.fontColor("#999999")
.margin({bottom: 40})
.align(Alignment.Center)
this.ProtocolRow()
... ... @@ -68,21 +101,26 @@ struct OneKeyLoginPage {
if (!this.agreeProtocol) {
return
}
TrackingButton.click("oneClickLoginPageLoginButton", this.pageName, this.pageName)
this.requestLogin()
})
}
.padding({ left: 25, right: 25 })
.margin({top: 15})
.margin({top: 20})
Button("账号密码登录")
.type(ButtonType.Normal)
.align(Alignment.Center)
.foregroundColor("#666666")
.backgroundColor(Color.White)
.height(26)
.margin({top: 20})
.onClick((event) => {
router.replaceUrl({url: WDRouterPage.loginPage.url()})
})
}
.backgroundColor("#FFFFFF")
}
@Builder ProtocolRow() {
... ... @@ -126,8 +164,9 @@ struct OneKeyLoginPage {
.width(24)
.height(24)
.onClick(() => router.back())
}.margin({ top: 15, right: 15 })
}.margin({ top: 10, right: 16 })
.width("100%")
.height(44)
}
async requestLogin() {
... ...
import { CustomToast, DateTimeUtils, Logger, SPHelper } from 'wdKit/Index'
import { WDRouterRule, WDRouterPage } from 'wdRouter/Index'
import { LoginViewModel } from './LoginViewModel'
import { SettingPasswordParams } from './SettingPasswordLayout'
import { router } from '@kit.ArkUI'
import { SpConstants } from 'wdConstant/Index'
import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index'
const TAG = 'VerifyPhoneNumberPage'
//设置密码(第一次) 验证当前手机号 页面
@Entry
@Component
struct VerifyPhoneNumberPage {
@State phoneContent: string = ''
@State codeContent: string = ''
@State isSubmit: boolean = false //是否可以提交 默认不可以
loginViewModel: LoginViewModel = new LoginViewModel()
@State @Watch('onCodeSend') isCodeSend: boolean = false //验证码点击发送事件
@State pageTitle:string = '验证当前手机号';
@State @Watch('startCount') codeStateSuccess:boolean=false
lastTime: number = 0
@State codeBtnState: boolean = false
@State timeCount: number = 60
isFirst:boolean=true//是否第一次获取验证码
pageShowTime:number = 0;
pageHideTime:number = 0;
onCodeSend() {
if (this.isCodeSend) {
TrackingButton.click("checkingPhoneNumberPageSendVerificationCode",TrackConstants.PageName.Checking_PhoneNum,TrackConstants.PageName.Checking_PhoneNum)
this.sendVerifyCode()
}
}
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
}
onPageHide(): void {
this.pageHideTime = DateTimeUtils.getTimeStamp()
let duration = 0
duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Checking_PhoneNum,TrackConstants.PageName.Checking_PhoneNum,duration)
}
async aboutToAppear(): Promise<void> {
this.phoneContent = await SPHelper.default.get(SpConstants.USER_PHONE,"") as string;
}
@State toastText:string = ""
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
msg: this.toastText,
}),
autoCancel: false,
alignment: DialogAlignment.Center,
customStyle: true,
maskColor:"#00000000"
})
build() {
Column() {
Image($r('app.media.login_back_icon')).width(24).height(24).margin({ left: 15, top: 10 }).onClick(() => {
router.back()
})
Text(this.pageTitle).fontSize(22).fontColor('#333333').fontWeight(FontWeight.Bold).margin({ left: 25, top: 112 })
Column() {
TextInput({ text: this.securityPhone(this.phoneContent) })
.placeholderColor("#CCCCCC")
.fontSize(16)
.height(48)
.maxLength(11)
.margin({ top: 36 })
.backgroundColor("#F5F5F5")
.borderRadius(4)
.enabled(false)
.type(InputType.PhoneNumber)
.onChange((content) => {
this.phoneContent = content
this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 4)
if (content.length >= 11) {
this.codeBtnState = true
} else {
this.codeBtnState = false
}
})
Row() {
TextInput({ text: this.codeContent,placeholder: "验证码" })
.placeholderColor("#CCCCCC")
.layoutWeight(1)
.fontSize(16)
.height(48)
.type(InputType.Number)
.fontColor("#222222")
.backgroundColor("#00000000")
.borderRadius({ topLeft: 4, bottomLeft: 4 })
.onChange((value) => {
this.codeContent = value
this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 4)
})
Text(this.codeStateSuccess ? this.timeCount + "s" : this.isFirst?"发送验证码":'重新获取')
.fontColor(this.codeBtnState?'#ED2800':'#80ED2800')
.width(110)
.fontSize(14)
.fontWeight( FontWeight.Bold)
.height(48)
.textAlign(TextAlign.Center)
.enabled(this.codeStateSuccess?false:true)
.onClick(() => {
if (this.phoneContent.length < 11) {
return
}
let currentTime = DateTimeUtils.getTimeStamp()
if (currentTime - this.lastTime < 500) {
return
}
this.lastTime = currentTime;
this.isCodeSend = true
})
}.margin({ top: 12 })
.height(48)
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Start)
.backgroundImage($r('app.media.code_login_bg'))
.backgroundImageSize({width:'100%',height:48})
}.width('100%').padding({ left: 25, right: 25 })
Row() {
Text("确认")
.layoutWeight(1)
.fontColor(this.isSubmit ?"#FFFFFFFF":"#66FFFFFF")
.borderRadius(4)
.fontSize(18)
.textAlign(TextAlign.Center)
.fontWeight(FontWeight.Medium)
.margin({ top: 26 })
.height(44)
.backgroundColor(this.isSubmit ?"#ED2800":"#99ED2800")
.enabled(this.isSubmit ? true : false)
.onClick(() => {
this.checkVerifyCode()
})
}.padding({ left: 25, right: 25 }).width('100%')
}.width('100%').height('100%').alignItems(HorizontalAlign.Start)
}
//发送验证码
sendVerifyCode() {
if (this.isEmpty(this.phoneContent)) {
return
}
this.loginViewModel.sendVerifyCodeByToken().then(()=>{
this.showToastTip("已发送")
this.codeStateSuccess=true
this.isCodeSend=false
}).catch((message: string)=>{
this.showToastTip(message)
this.codeStateSuccess=false
this.isCodeSend=false
})
}
//校验验证码
checkVerifyCode() {
TrackingButton.click("checkingPhoneNumberPageConfirm",TrackConstants.PageName.Checking_PhoneNum,TrackConstants.PageName.Checking_PhoneNum)
if (!this.isSubmit) {
return
}
if (this.isEmpty(this.phoneContent)) {
return
}
if (this.isEmpty(this.codeContent)) {
return
}
this.loginViewModel.checkVerifyCodeByToken(this.codeContent).then(()=>{
let params: SettingPasswordParams = {
pageID:'1',
phoneContent:this.phoneContent,
codeContent:this.codeContent,
pageType:1
}
WDRouterRule.jumpWithPage(WDRouterPage.settingPasswordPage, params)
}).catch((message: string)=>{
this.showToastTip(message)
})
}
isEmpty(obj: undefined|null|string): boolean {
return (obj == undefined || obj == null || obj == '');
}
showToastTip(msg:string){
this.toastText = msg
this.dialogToast.open()
}
securityPhone(phoneNum:string):string{
let securityNum:string;
let needSecurityString = phoneNum.substring(3, phoneNum.length - 4);
securityNum = phoneNum.replace(needSecurityString,'****')
return securityNum;
}
startCount() {
this.isFirst = false
let time = setInterval(() => {
Logger.debug("倒计时:" + this.timeCount)
this.timeCount--
if (this.timeCount < 1) {
this.codeStateSuccess = false
this.timeCount = 60
clearInterval(time)
}
}, 1000)
}
}
\ No newline at end of file
... ...
... ... @@ -8,6 +8,8 @@
"pages/login/SettingPasswordLayout",
"pages/guide/GuidePages",
"pages/login/OneKeyLoginPage",
"pages/login/ModifyPasswordPage"
"pages/login/ModifyPasswordPage",
"pages/login/ChangeBindPhonePage",
"pages/login/VerifyPhoneNumberPage"
]
}
\ No newline at end of file
... ...
... ... @@ -2,7 +2,8 @@ export namespace TrackConstants {
export enum EventType {
Show = 0,
Click = 1
Click = 1,
CurrentNumberPanelContentExposure = 2,
}
// 行为类型
... ... @@ -24,7 +25,8 @@ export namespace TrackConstants {
UnSubscribe = "unSubscribe",
CloseInterestCard = "closeInterestCard",
SelectInterestCard = "selectInterestCard",
//电子报当前页曝光
CurrentNumberPanelContentExposure = "current_Number_Panel_content_exposure",
}
// 分享聚道
... ... @@ -208,5 +210,11 @@ export namespace TrackConstants {
///兴趣偏好页
Interest = "preferenceSelectionPage",
//意见反馈
FeedbackPage = 'feedbackPage',
//动态详情
DynamicDetailPage = 'dynamicDetailPage',
//早晚报
NewsPaperPage = 'newsPaperPage',
}
}
\ No newline at end of file
... ...
... ... @@ -22,7 +22,15 @@ export class TrackParamConvert {
static pageCompProgram(pageInfo?: PageInfoDTO, comp?: CompInfoBean, program?: ContentDTO) : ParamType {
let params = TrackingUtils.generateParams()
if (program) {
params["contentType"] = program.objectType
params["contentId"] = program.objectId
params["contentName"] = program.newsTitle
params["channelSourceId"] = program.channelId
params["rmhPlatform"] = program.rmhPlatform
TrackParamConvert.appendRecommend(program, params)
}
//TODO: 转换参数
return params
... ...
... ... @@ -29,6 +29,10 @@ export class TrackingContent {
params["action"] = TrackConstants.ActionType.Show
TrackingUtils.fillPositionWith(params)
Tracking.event("content_exposure", params)
}else if(eventType === TrackConstants.EventType.CurrentNumberPanelContentExposure){
params["action"] = TrackConstants.ActionType.Show
TrackingUtils.fillPositionWith(params)
Tracking.event(TrackConstants.ActionType.CurrentNumberPanelContentExposure, params)
}
}
... ... @@ -82,6 +86,10 @@ export class TrackingContent {
}
static commentClick(pageId: string, pageName: string, extParams?: ParamType) {
TrackingContent.commentClickWithEvent("content_comment_click",pageId,pageName,extParams);
}
static commentClickWithEvent(event: string,pageId: string, pageName: string, extParams?: ParamType) {
let params = TrackingUtils.generateParams(extParams)
if (pageId.length) {
params["pageId"] = pageId
... ... @@ -91,7 +99,7 @@ export class TrackingContent {
}
params["action"] =TrackConstants.ActionType.Comment
TrackingUtils.fillPositionWith(params)
Tracking.event("content_comment_click", params)
Tracking.event(event, params)
}
static commentShare(pageId: string, pageName: string, extParams?: ParamType) {
... ...
import { ENewspaperPageComponent } from 'wdComponent';
import { Logger } from 'wdKit';
import { DateTimeUtils, Logger } from 'wdKit';
import common from '@ohos.app.ability.common';
import window from '@ohos.window';
import { TrackingPageBrowse ,TrackConstants} from 'wdTracking/Index';
const TAG = 'ENewspaper';
@Entry
@Component
struct ENewspaper {
pageShowTime:number = 0;
// 获取UIAbility上下文
context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext
... ... @@ -46,6 +48,7 @@ struct ENewspaper {
}
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
this.setSystemBar('#80000000','#80000000', '#FFFFFFFF')
Logger.info(TAG, 'onPageShow');
}
... ... @@ -53,6 +56,8 @@ struct ENewspaper {
onPageHide() {
this.setSystemBar('#FFFFFFFF','#00000000', '#000000')
Logger.info(TAG, 'onPageHide');
//页面浏览
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
}
onBackPress() {
... ...
import { MorningEveningPaperComponent } from 'wdComponent';
import { Logger, WindowModel } from 'wdKit';
import { DateTimeUtils, Logger, WindowModel } from 'wdKit';
import { TrackConstants, TrackingPageBrowse} from 'wdTracking/Index';
const TAG = 'MorningEveningPaperPage';
... ... @@ -7,6 +8,8 @@ const TAG = 'MorningEveningPaperPage';
@Component
struct MorningEveningPaperPage {
@State isPageShow: boolean = false
pageShowTime:number = 0;
pageHideTime:number = 0;
build() {
Column() {
MorningEveningPaperComponent()
... ... @@ -43,6 +46,7 @@ struct MorningEveningPaperPage {
WindowModel.shared.setWindowLayoutFullScreen(true)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
}
this.pageShowTime = DateTimeUtils.getTimeStamp()
}
onPageHide() {
... ... @@ -50,6 +54,12 @@ struct MorningEveningPaperPage {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
this.isPageShow = true
Logger.info(TAG, 'onPageHide');
//早晚报埋点
this.pageHideTime = DateTimeUtils.getTimeStamp()
let duration = 0
duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews,duration)
}
onBackPress() {
... ...
import { Logger } from 'wdKit';
import { DateTimeUtils, Logger } from 'wdKit';
import { DynamicDetailComponent } from 'wdComponent';
import router from '@ohos.router';
import { Params, Action } from 'wdBean';
import { TrackingPageBrowse,TrackConstants } from 'wdTracking/Index';
const TAG = 'DynamicDetailPage';
@Entry
@Component
struct DynamicDetailPage {
pageShowTime:number = 0;
@State relId: string = ''
@State contentId: string = ''
@State relType: string = ''
... ... @@ -30,4 +32,12 @@ struct DynamicDetailPage {
this.relType = params?.extra?.relType || '';
this.contentId = params?.contentID || '';
}
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
}
onPageHide() {
//页面浏览
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.DynamicDetailPage,TrackConstants.PageName.DynamicDetailPage,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
}
}
\ No newline at end of file
... ...
... ... @@ -4,6 +4,7 @@ import { WDRouterPage } from 'wdRouter';
import { SPHelper } from 'wdKit/Index';
import { SpConstants } from 'wdConstant/Index';
import { ButtonOptions, promptAction } from '@kit.ArkUI';
import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index';
@Entry
@Component
... ... @@ -34,6 +35,8 @@ struct LaunchInterestsHobbiesPage {
//直接跳过到首页
//跳转首页
WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
this.trackingLaunchJumpOver(false)
})
}
.width('100%')
... ... @@ -148,6 +151,9 @@ struct LaunchInterestsHobbiesPage {
this.saveTagIds()
//跳转首页
WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
this.trackingLaunchJumpOver(true)
})
}
.width('100%')
... ... @@ -185,4 +191,17 @@ struct LaunchInterestsHobbiesPage {
}
SPHelper.default.saveSync(SpConstants.PUBLICVISUTORMODE_INTERESTTAGS,tags)
}
trackingLaunchJumpOver(selectOrJump:boolean){
let tags = SPHelper.default.getSync(SpConstants.PUBLICVISUTORMODE_INTERESTTAGS,'') as string
let action = selectOrJump?TrackConstants.ActionType.SelectInterestCard:TrackConstants.ActionType.CloseInterestCard
let pageParam: ParamType = {
'interestContentOptions':tags,
'itemId':tags,
'action':action,
'sceneId':'9999',
'cnsTraceId':'selfHold',
}
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Interest,TrackConstants.PageName.Interest,pageParam)
}
}
\ No newline at end of file
... ...
import { DeviceUtil, DisplayUtils, UpgradeTipContent } from 'wdKit/Index'
import { TrackConstants, TrackingButton } from 'wdTracking/Index'
@Preview
@CustomDialog
... ... @@ -35,6 +36,8 @@ export struct UpgradeTipDialog {
.margin({top: 24})
.onClick(() => {
this.controller.close()
TrackingButton.click("notUpdatedTemporarily", TrackConstants.PageName.Update, TrackConstants.PageName.Update)
if (this.cancel) {
this.cancel()
}
... ... @@ -88,6 +91,8 @@ export struct UpgradeTipDialog {
})
.onClick(() => {
this.controller.close()
TrackingButton.click("immediateUpdating", TrackConstants.PageName.Update, TrackConstants.PageName.Update)
if (this.confirm) {
this.confirm()
}
... ...
... ... @@ -131,7 +131,7 @@ export struct BottomNavigationComponent {
@Builder
tabBarBuilder(navItem: BottomNavDTO, index: number) {
Stack({ alignContent: Alignment.Bottom }) {
Image(this.currentNavIndex === index ? navItem.iconC : navItem.icon)
Image(this.getBottomIcon(navItem, this.currentNavIndex === index))
.height(CommonConstants.FULL_PARENT)
.padding({
bottom: 15,
... ... @@ -140,6 +140,7 @@ export struct BottomNavigationComponent {
top: 2
})
.aspectRatio(this.ASPECT_RATIO_1_1)
.alt(this.getBottomLocalIcon(navItem, this.currentNavIndex === index))
Text(navItem.name)
.margin({ bottom: $r('app.float.bottom_navigation_margin_bottom') })
... ... @@ -160,6 +161,48 @@ export struct BottomNavigationComponent {
}
private getBottomIcon(navItem: BottomNavDTO, isSelect: boolean): string | Resource {
if (!navItem) {
return ''
}
let icon: string = ''
if (this.isImmersive) {
// 获取沉浸式icon
icon = isSelect ? navItem.immersiveIconCUrl : navItem.immersiveIconUrl
} else {
// 获取常规icon
icon = isSelect ? navItem.iconC : navItem.icon
}
if (StringUtils.isEmpty(icon) || icon.includes('.pag')) {
// 兜底,获取预置的本地icon
return this.getBottomLocalIcon(navItem, isSelect)
}
return icon
}
private getBottomLocalIcon(navItem: BottomNavDTO, isSelect: boolean): Resource {
if (!navItem) {
return isSelect ? $r('app.media.icon_tab_res1') : $r('app.media.icon_tab_res1_no')
}
// type:1普通 2我的
if (navItem.type == '2') {
// 我的
return isSelect ? $r('app.media.icon_tab_res5') : $r('app.media.icon_tab_res5_no')
} else {
// 顶部样式:中文的(11-新闻;12-人民号;13-视频;14-服务)
if (navItem.topStyle == '11') {
return isSelect ? $r('app.media.icon_tab_res1') : $r('app.media.icon_tab_res1_no')
} else if (navItem.topStyle == '12') {
return isSelect ? $r('app.media.icon_tab_res2') : $r('app.media.icon_tab_res2_no')
} else if (navItem.topStyle == '13') {
return isSelect ? $r('app.media.icon_tab_res3') : $r('app.media.icon_tab_res3_no')
} else if (navItem.topStyle == '14') {
return isSelect ? $r('app.media.icon_tab_res4') : $r('app.media.icon_tab_res4_no')
}
}
return isSelect ? $r('app.media.icon_tab_res1') : $r('app.media.icon_tab_res1_no')
}
// 底导切换函数
async onBottomNavigationIndexChange(navItem: BottomNavDTO, index: number) {
Logger.info(TAG, `onBottomNavigationIndexChange this.currentNavIndex: ${this.currentNavIndex}`);
... ...
... ... @@ -25,7 +25,9 @@ import { EmptyComponent,
viewBlogItemInsightIntentShare} from 'wdComponent/Index';
const TAG = 'MultiPictureDetailPageComponent';
/**
* 多图(图集详情页)UI
*/
@Component
export struct MultiPictureDetailPageComponent {
private relId: string = ''
... ...
... ... @@ -21,6 +21,7 @@ export struct VideoChannelPage {
@Prop topNavList: TopNavDTO[]
@Link _currentNavIndex?: number;
@Consume barBackgroundColor: Color
@Consume isImmersive: boolean
@Consume displayDirection: DisplayDirection
@Consume @Watch('setBarBackgroundColor') currentBottomNavInfo: BottomNavDTO // 当前底导信息
@State @Watch('setBarBackgroundColor') currentTopNavSelectedIndex: number = 0;
... ... @@ -42,8 +43,10 @@ export struct VideoChannelPage {
if (this.currentTopNavSelectedIndex === 0 && this.currentBottomNavInfo?.name === '视频') {
console.error('setBarBackgroundColor', '黑色')
this.barBackgroundColor = Color.Black
this.isImmersive = true
} else {
this.barBackgroundColor = Color.White
this.isImmersive = false
console.error('setBarBackgroundColor', '白色')
}
}
... ...