wangliang_wd

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

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  fix:somebug
  feat: 18108 搜索结果-图集卡封面图加载不出
  fix:somebug
  fix:somebug
  uat】 进入竖屏直播-竖屏流-评论预显示静止-默哀,默哀图标显示未爱心,预期默哀
  feat: 17910 【全域规则】频道-外部卡片日期展示规则与需求不一致
  desc:埋点[注销账号页面 - 页面浏览,普通按钮]
  fix:somebug
  fix(埋点):动态详情页/版面页/意见反馈页页面浏览埋点
  解决【18014 UI还原问题-【uat】底部导航-选中视频频道后,图标变成白色。看图】
  desc:埋点[更换手机号页 - 页面浏览,登录按钮点击]
  desc:抽离 更换手机号为单独page
  desc:埋点[修改密码 - 登录按钮点击]
  fix:somebug
  fix(意见反馈):UI调整
  fix:somebug
  fix(17431):电子报-版面,无网络时,点击读报纸,提示信息错误、提示位置不对,不应该提示暂无数据、提示位置应该居中展示
  人民号主页下文章详情页,视频详情页,动态详情页与图集详情页均无法收藏
  精选评论通顶通底
  fix(17226):人民号图集稿件下的图片进行下载时鸿蒙与安卓的提示信息和弹出位置不一致
Showing 44 changed files with 653 additions and 161 deletions
... ... @@ -68,6 +68,7 @@ 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 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,7 +11,8 @@ import { LiveRoomDataBean } from '../live/LiveRoomDataBean';
@Observed
export class ContentDTO implements BaseDTO {
seoTags?:string;
seoTags: string = '';
cornerMark:string = '';
liveType?: string; // 直播新闻-直播状态
expIds: string = '';
itemId: string = '';
... ... @@ -158,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;
... ...
... ... @@ -751,7 +751,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 + '',
}
... ...
... ... @@ -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 { promptAction } from '@kit.ArkUI';
@Component
export struct ENewspaperPageComponent {
... ... @@ -270,6 +271,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,6 +310,10 @@ 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
}else {
... ...
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 { TrackingPageBrowse } from 'wdTracking/Index';
const TAG = 'FeedBackActivity'
... ... @@ -20,6 +21,9 @@ const TAG = 'FeedBackActivity'
@Entry
@Component
export struct FeedBackActivity {
pageShowTime:number = 0;
pageId:string = 'feedbackPage';
pageName:string=this.pageId;
@State canSubmit: boolean = false;
@State textNumLabel: string = '0/500';
contact: string = "";
... ... @@ -50,7 +54,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,
}) {
... ... @@ -75,7 +79,7 @@ export struct FeedBackActivity {
}
})
}
.width('100%')
.width('94%')
.margin({top:$r('app.float.vp_16')})
Blank()
.height($r('app.float.margin_5'))
... ... @@ -85,7 +89,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)
... ... @@ -165,7 +169,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 +180,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 +190,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 +198,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)
... ... @@ -380,4 +384,12 @@ export struct FeedBackActivity {
}
}
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
}
onPageHide() {
//页面浏览
TrackingPageBrowse.trackCommonPageExposureEnd(this.pageId,this.pageName,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
})
}
})
... ...
... ... @@ -174,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)
... ...
... ... @@ -50,14 +50,39 @@ 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) {
Span(this.str01)
... ... @@ -74,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
}
... ...
... ... @@ -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) {
... ... @@ -143,6 +142,7 @@ export struct QualityCommentsComponent {
.height(this.topSafeHeight + vp2px(44) + 'px')
.width('100%')
.backgroundColor($r('app.color.color_transparent'))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
/*导航栏*/
... ... @@ -187,62 +187,66 @@ export struct QualityCommentsComponent {
.height(this.topSafeHeight + vp2px(44) + 'px')
.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 +259,9 @@ export struct QualityCommentsComponent {
scrollBackward: NestedScrollMode.SELF_FIRST
})
}
}
@Component
struct QualityCommentItem {
@ObjectLink publishCommentModel: publishCommentModel
... ... @@ -279,7 +278,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 +296,7 @@ struct QualityCommentItem {
}
)
.onClick(() => {
this.jumpToAccountOwner()
this.jumpToAccountOwner()
})
Text(this.item.fromUserName)
.fontSize(14)
... ... @@ -376,7 +376,7 @@ struct QualityCommentItem {
Row() {
Image($r('app.media.comment_icon_pinglun')).width(16).height(16)
}.height('100%')
.onClick(()=>{
.onClick(() => {
this.replyComment()
})
... ...
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)
}
}
... ...
... ... @@ -460,10 +460,11 @@ export struct SearchResultContentComponent {
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.liveType = liveType?liveType: ""
contentDTO.seoTags = seoTags?seoTags: ""
// console.log('获取value333333333',JSON.stringify(contentDTO.liveType))
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) {
... ... @@ -191,7 +219,7 @@ export struct AccountAndSecurityLayout {
}else if (index == 3) {
trackButtonClick("accountManagementPageAccountCancellation")
this.isAccountPage=false
// WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType)
this.logoutLayoutShowTime = DateTimeUtils.getTimeStamp()
}
})
... ... @@ -255,6 +283,8 @@ export struct AccountAndSecurityLayout {
})
.onClick(() => {
this.isAccountPage=true
this.pageShowAccountTime = DateTimeUtils.getTimeStamp()
this.logoutLayoutHide()
this.protocolState=false
})
.id('backImage')
... ... @@ -332,6 +362,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 +384,7 @@ export struct AccountAndSecurityLayout {
if (!this.protocolState) {
return
}
TrackingButton.click("cancelAccountPageconfirmCancelAccount",TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account)
this.dialogController.open()
})
... ... @@ -456,6 +488,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))
... ...
... ... @@ -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: '默哀'
}
... ...
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、登录->忘记密码 1、设置->重置密码 3、设置->更换手机号页面2
lastTime: number = 0
@Link @Watch('startCount') codeStateSuccess: boolean //验证码获取成功与否回调 成功显示倒计时
@Watch('onCheckChange') @Prop protocolState: boolean = false //协议勾选状态
... ...
... ... @@ -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()
}
})
... ...
... ... @@ -8,6 +8,7 @@
"pages/login/SettingPasswordLayout",
"pages/guide/GuidePages",
"pages/login/OneKeyLoginPage",
"pages/login/ModifyPasswordPage"
"pages/login/ModifyPasswordPage",
"pages/login/ChangeBindPhonePage"
]
}
\ No newline at end of file
... ...
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 } from 'wdTracking/Index';
const TAG = 'ENewspaper';
@Entry
@Component
struct ENewspaper {
pageShowTime:number = 0;
pageId:string = 'newsPaperPage';
pageName:string=this.pageId;
// 获取UIAbility上下文
context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext
... ... @@ -46,6 +50,7 @@ struct ENewspaper {
}
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
this.setSystemBar('#80000000','#80000000', '#FFFFFFFF')
Logger.info(TAG, 'onPageShow');
}
... ... @@ -53,6 +58,8 @@ struct ENewspaper {
onPageHide() {
this.setSystemBar('#FFFFFFFF','#00000000', '#000000')
Logger.info(TAG, 'onPageHide');
//页面浏览
TrackingPageBrowse.trackCommonPageExposureEnd(this.pageId,this.pageName,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
}
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 } from 'wdTracking/Index';
const TAG = 'DynamicDetailPage';
@Entry
@Component
struct DynamicDetailPage {
pageShowTime:number = 0;
pageId:string = 'dynamicDetailPage';
pageName:string=this.pageId;
@State relId: string = ''
@State contentId: string = ''
@State relType: string = ''
... ... @@ -30,4 +34,12 @@ struct DynamicDetailPage {
this.relType = params?.extra?.relType || '';
this.contentId = params?.contentID || '';
}
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
}
onPageHide() {
//页面浏览
TrackingPageBrowse.trackCommonPageExposureEnd(this.pageId,this.pageName,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
}
}
\ No newline at end of file
... ...
... ... @@ -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', '白色')
}
}
... ...