陈剑华

Merge remote-tracking branch 'origin/main'

Showing 32 changed files with 502 additions and 268 deletions
... ... @@ -3,7 +3,7 @@
*/
export const enum CompStyle {
Label_03 = 'Label-03', // 标题卡:icon+文字
Label_03 = 'Label-03', // 标题卡:icon+文字
Carousel_Layout_02 = 'Carousel_Layout-02', // 直播轮播卡:直播
Single_Row_02 = 'Zh_Single_Row-02', // 通用横划卡:视频、直播、专题
Single_Row_03 = 'Single_Row-03', // 直播横划卡:直播
... ...
... ... @@ -64,4 +64,7 @@ export { MpaasUpgradeCheck, UpgradeTipContent } from './src/main/ets/mpaas/Mpaas
export { TingyunAPM } from './src/main/ets/tingyunAPM/TingyunAPM'
export { FastClickUtil } from './src/main/ets/utils/FastClickUtil';
\ No newline at end of file
export { FastClickUtil } from './src/main/ets/utils/FastClickUtil';
// export { PublicPopupDialogView } from "./src/main/ets/pubComps/dialog/PublicPopupDialogView"
export { PublicDialogManager, CloseAction } from "./src/main/ets/pubComps/dialog/PublicDialogManager"
\ No newline at end of file
... ...
export type CloseAction = () => void
export class PublicDialogManager {
private dialogControllers: CustomDialogController[] = []
private closeActions: CloseAction[] = []
private constructor() {
}
private static manager: PublicDialogManager
static shareInstance(): PublicDialogManager {
if (!PublicDialogManager.manager) {
PublicDialogManager.manager = new PublicDialogManager()
}
return PublicDialogManager.manager
}
openDialog(dialogController: CustomDialogController, closeAction: CloseAction) {
if (!dialogController) {
return
}
dialogController.open()
this.dialogControllers.push(dialogController)
this.closeActions.push(closeAction)
}
closeDialog(dialogController: CustomDialogController) {
if (!dialogController) {
return
}
dialogController.close()
const index = this.dialogControllers.indexOf(dialogController)
if (index != -1) {
this.dialogControllers.splice(index, 1)
this.closeActions.splice(index, 1)[0]()
}
}
closeLastDialog() {
const count = this.dialogControllers.length
if (count > 0) {
this.closeDialog(this.dialogControllers[count - 1])
}
}
}
\ No newline at end of file
... ...
import { PublicDialogManager } from './PublicDialogManager'
/*
* 公共自定义弹出框,上层赋值showPopup变量,决定是否显示
*
* 当上层需要关闭,调用 PublicDialogManager.shareInstance().closeDialog(dialogController) 关闭
*
* ===> customBuilder 当前传值有问题,用不了
*/
@Component
struct PublicPopupDialogView {
// 决定是否显示变量
@Link @Watch('showPopupAction') showPopup: boolean
// 自定义弹框的 @CustomDialog
private customBuilder: Object | null = null
private autoCancel: boolean = false
dialogController: CustomDialogController = new CustomDialogController({
builder: this.customBuilder,
autoCancel: this.autoCancel,
cancel: () => {
this.showPopup = false
},
customStyle: true,
alignment: DialogAlignment.Bottom,
})
showPopupAction(val: boolean) {
if (this.showPopup) {
PublicDialogManager.shareInstance().openDialog(this.dialogController, this.closeAction)
} else {
PublicDialogManager.shareInstance().closeDialog(this.dialogController)
}
}
@Builder emptyBuild() {
}
closeAction() {
this.showPopup = false
}
build() {
this.emptyBuild()
}
}
... ...
... ... @@ -97,4 +97,6 @@ export { PageRepository } from './src/main/ets/repository/PageRepository';
export { MultiPictureDetailViewModel } from './src/main/ets/viewmodel/MultiPictureDetailViewModel';
export { viewBlogItemInsightIntentShare } from './src/main/ets/utils/InsightIntentShare';
\ No newline at end of file
export { viewBlogItemInsightIntentShare } from './src/main/ets/utils/InsightIntentShare';
export { CommentListDialogView } from './src/main/ets/components/comment/view/CommentListDialog';
... ...
import { Action, NewspaperListItemBean, NewspaperPositionItemBean, Params } from 'wdBean';
import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO';
import { ContentDTO, NewspaperListItemBean, NewspaperPositionItemBean, Params } from 'wdBean';
import { StringUtils } from 'wdKit';
import { WDRouterRule } from 'wdRouter';
import { ProcessUtils } from 'wdRouter';
import { newsSkeleton } from './skeleton/newsSkeleton';
@Component
... ... @@ -62,21 +61,15 @@ export struct ENewspaperItemComponent {
}
if (event.type === TouchType.Up) {
this.context.clearRect(0, 0, this.context.width, this.context.height)
if (this.itemBeanClicked && this.itemBeanClicked.newsId) {
let taskAction: Action = {
type: 'JUMP_INNER_NEW_PAGE',
params: {
contentID: '' + this.itemBeanClicked.newsId,
pageID: 'IMAGE_TEXT_DETAIL',
extra: {
relType: this.itemBeanClicked.relType ?? '',
relId: '' + this.itemBeanClicked.relId,
sourcePage: '5'
} as ExtraDTO
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
if (this.itemBeanClicked != null && this.itemBeanClicked.newsId != 0) {
//公共跳转
let content: ContentDTO = {
objectId:this.itemBeanClicked.newsId+'',
objectType:this.itemBeanClicked.newsType+'',
relId:this.itemBeanClicked.relId+'',
relType:this.itemBeanClicked.relType ?? '0'
} as ContentDTO
ProcessUtils.processPage(content)
this.itemBeanClicked = {} as NewspaperPositionItemBean
}
}
... ... @@ -139,7 +132,6 @@ export struct ENewspaperItemComponent {
}
}
if (vp2px(x) > minX && vp2px(x) < maxX && vp2px(y) > minY && vp2px(y) < maxY) {
this.itemBeanClicked = itemBean;
return xys;
... ...
... ... @@ -52,7 +52,7 @@ export struct Card19Component {
.fontColor(0xED2800)
Span(this.str03)
} else {
Span(this.contentDTO.newsTitle)
Span(this.contentDTO.newsTitle=='null'?"":this.contentDTO.newsTitle)
}
}
.fontSize($r('app.float.font_size_18'))
... ...
/**
* More_Comp
*/
import { ContentDTO } from 'wdBean/Index';
const TAG: string = 'More_Comp';
@Entry
... ...
import { DateTimeUtils, EmitterEventId, EmitterUtils, LazyDataSource, StringUtils } from 'wdKit/Index';
import { DateTimeUtils, EmitterEventId, EmitterUtils, LazyDataSource,
PublicDialogManager,
StringUtils } from 'wdKit/Index';
import { commentItemModel, WDPublicUserType } from '../model/CommentModel';
import commentViewModel from '../viewmodel/CommentViewModel';
import { CommentText } from './CommentText';
... ... @@ -21,6 +23,7 @@ const testString = '因为读书的人\n是低着头向上看的人\n身处一
export struct CommentComponent {
private onCloseClick = () => {
}
showTitleComponent: boolean = true
@Prop showCloseIcon?: boolean = false
@State hasMore: boolean = true;
@State currentPage: number = 1;
... ... @@ -40,6 +43,9 @@ export struct CommentComponent {
@Prop @Watch("parentOnReachEnd") reachEndIncreament: number = 0
reachEndLoadMoreFinish?: () => void
// 是否在弹框中
@Provide inDialog: boolean = false
// 在自定义组件即将析构销毁时将dialogControlle置空
aboutToDisappear() {
this.dialogController = null // 将dialogController置空
... ... @@ -163,7 +169,9 @@ export struct CommentComponent {
build() {
Column() {
List({ scroller: this.listScroller }) {
ListItemGroup({ header: this.titleHeader() })
if (this.showTitleComponent) {
ListItemGroup({ header: this.titleHeader() })
}
if (!this.isComments) {
EmptyComponent({ emptyType: 17 })
... ... @@ -259,7 +267,7 @@ export struct CommentComponent {
this.publishCommentModel.totalCommentNumer = commentListModel.totalCommentNum + ''
}
if (commentListModel.list.length === 0) {
if (commentListModel.list.length === 0 && this.allDatas.totalCount() == 0) {
this.isComments = false
}
... ... @@ -299,6 +307,8 @@ struct ChildCommentItem {
@ObjectLink item: commentItemModel
@Consume contentDetailData: ContentDetailDTO
@Consume inDialog: boolean
build() {
Column() {
Row() {
... ... @@ -406,7 +416,12 @@ struct ChildCommentItem {
.margin({ left: 47 })
.alignContent(Alignment.Center)
.onClick(() => {
commentViewModel.jumpToAccountPage(this.item)
commentViewModel.jumpToAccountPage(this.item, () => {
if (this.inDialog) {
PublicDialogManager.shareInstance().closeLastDialog()
}
})
})
}
... ... @@ -514,6 +529,8 @@ struct commentHeaderView {
@Link dialogController: CustomDialogController | null
@ObjectLink item: commentItemModel
@Consume inDialog: boolean
build() {
Column() {
Row() {
... ... @@ -607,7 +624,12 @@ struct commentHeaderView {
.margin({ left: 8 })
.alignContent(Alignment.Center)
.onClick(() => {
commentViewModel.jumpToAccountPage(this.item)
commentViewModel.jumpToAccountPage(this.item, () => {
if (this.inDialog) {
PublicDialogManager.shareInstance().closeLastDialog()
}
})
})
}
... ... @@ -640,6 +662,8 @@ struct commentFooterView {
@Link dialogController: CustomDialogController | null
@ObjectLink item: commentItemModel
@Consume inDialog: boolean
build() {
Row() {
... ... @@ -710,6 +734,9 @@ struct commentFooterView {
// 未登录,跳转登录
const user_id = HttpUtils.getUserId()
if (!user_id) {
if (this.inDialog) {
PublicDialogManager.shareInstance().closeLastDialog()
}
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
... ...
import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index'
import { PublicDialogManager } from 'wdKit/Index'
import { TrackConstants } from 'wdTracking/Index'
import { OperRowListView } from '../../view/OperRowListView'
import { publishCommentModel } from '../model/PublishCommentModel'
import { CommentComponent } from './CommentComponent'
/// 评论列表弹框
@Component
export struct CommentListDialogView {
@Link @Watch('showCommentListChange') showCommentList: boolean
@Link contentDetailData: ContentDetailDTO // 详情页传
@Link pageInfo: PageInfoDTO // 专题页传
onClose?: () => void
// @Consume pageId: TrackConstants.PageName
// @Consume pageName: TrackConstants.PageName
private dialogController: CustomDialogController = new CustomDialogController({
builder: CommentListDialog({
contentDetailData: this.contentDetailData,
pageInfo: this.pageInfo,
onClose: this.onClose
}),
autoCancel: false,
customStyle: true,
alignment: DialogAlignment.Bottom,
})
showCommentListChange(val: boolean) {
if (this.showCommentList) {
PublicDialogManager.shareInstance().openDialog(this.dialogController, this.closeAction.bind(this))
} else {
PublicDialogManager.shareInstance().closeDialog(this.dialogController)
}
}
closeAction() {
this.showCommentList = false
}
build() {
}
}
@CustomDialog
export struct CommentListDialog {
struct CommentListDialog {
/// 内部使用
@State private publishCommentModel: publishCommentModel = new publishCommentModel()
... ... @@ -15,12 +54,12 @@ export struct CommentListDialog {
@State windowHeight: number = AppStorage.get<number>('windowHeight') || 0
/// 外部初始化
@Consume contentDetailData: ContentDetailDTO // 详情页传
@Consume pageInfo: PageInfoDTO // 专题页传
@Link contentDetailData: ContentDetailDTO // 详情页传
@Link pageInfo: PageInfoDTO // 专题页传
onClose?: () => void
aboutToAppear(): void {
if (this.contentDetailData) {
if (this.contentDetailData.newsId) {
if (this.contentDetailData?.openComment) {
this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '')
... ... @@ -33,40 +72,76 @@ export struct CommentListDialog {
this.operationButtonList.push('comment')
}
if (this.contentDetailData?.openLikes && this.contentDetailData?.likesStyle != 4) {
this.operationButtonList.push('like')
}
this.operationButtonList.push('collect')
this.operationButtonList.push('share')
}
if (this.pageInfo) {
//TODO: 专题的逻辑判断
}
}
build() {
Column() {
this.titleHeaderView()
CommentComponent({
publishCommentModel: this.publishCommentModel,
showCloseIcon: true,
fixedHeightMode: true,
onCloseClick: () => {
this.controller!.close()
if (this.onClose) {
this.onClose()
}
}
inDialog: true,
showTitleComponent: false
}).layoutWeight(1)
OperRowListView({
componentType: 1,
componentType: 4,
pageComponentType: 8,
showBackIcon: false,
operationButtonList: this.operationButtonList,
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
showCommentIcon: true,
styleType: 1,
inDialog: true,
dialogBeforeJumpOtherPageAction: () => {
PublicDialogManager.shareInstance().closeLastDialog()
}
})
}
.height(this.windowHeight - this.windowWidth * 9 / 16 + 'px')
.zIndex(1000)
.backgroundColor(Color.White)
}
@Builder titleHeaderView() {
Row() {
Row() {
Image($r('app.media.redLine'))
.height(16)
.width(3)
Text('全部评论')
.fontSize(18)// .fontColor('#222222')
.fontColor($r('app.color.color_222222'))
.fontWeight(FontWeight.Medium)
.margin({ left: 5 })
}
.margin({ left: 16 })
Image($r('app.media.close_button'))
.height(16)
.width(16)
.margin({ right: 16 })// .visibility(this.showCloseIcon ? Visibility.Visible : Visibility.Hidden)
.onClick(() => {
if (this.onClose) {
this.onClose()
}
})
}
.height(44)
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
}
}
\ No newline at end of file
... ...
... ... @@ -483,7 +483,7 @@ class CommentViewModel {
return false
}
jumpToAccountPage(commentItem: commentItemModel) {
jumpToAccountPage(commentItem: commentItemModel, beforeJump: () => void = () => {}) {
let url = HttpUrlUtils.getOtherUserDetailDataUrl()
let item : Record<string, string >= {}
... ... @@ -504,6 +504,7 @@ class CommentViewModel {
return
}
beforeJump()
if (result.data.userType === "1") { // 普通用户
let params: Record<string, string> = {'userId': result.data.userId};
WDRouterRule.jumpWithPage(WDRouterPage.otherNormalUserHomePagePage,params)
... ...
... ... @@ -45,7 +45,7 @@ export struct ZhGridLayout02NewsContent {
buildItemCard(item: ContentDTO, index: number) {
Column() {
Stack({ alignContent: Alignment.BottomEnd }) {
Image(this.loadImg ? item.fullColumnImgUrls[0].url : '')
Image(this.loadImg ? item == undefined ? '' : item.fullColumnImgUrls[0].url : '')
.backgroundColor(0xf5f5f5)
.width('100%')
.height(95)
... ... @@ -58,7 +58,12 @@ export struct ZhGridLayout02NewsContent {
.fontSize(12)
.fontWeight(400)
.fontColor(Color.White)
.textShadow({ radius: 2, color: 'rgba(0,0,0,0.3)', offsetX: 0, offsetY: 2 })
.textShadow({
radius: 2,
color: 'rgba(0,0,0,0.3)',
offsetX: 0,
offsetY: 2
})
.margin({
right: '5vp',
bottom: '5vp'
... ...
import { TrackConstants, TrackingButton } from 'wdTracking/Index'
import MinePageDatasModel from '../../../model/MinePageDatasModel'
import { onlyWifiLoadImg } from '../../../utils/lazyloadImg'
import { AppointmentOperationRequestItem } from '../../../viewmodel/AppointmentOperationRequestItem'
... ... @@ -200,6 +201,10 @@ export struct AppointmentListChildComponent {
if (value != null) {
if (value.code === 0 || value.code.toString() === "0") {
this.item.isAppointment = !this.item.isAppointment
if(!this.item.isAppointment){
TrackingButton.click("mySavedLivePageUnSubscribe",TrackConstants.PageName.My_Saved_Live,TrackConstants.PageName.My_Saved_Live)
}
}
}
})
... ...
... ... @@ -2,6 +2,7 @@ import { SpConstants } from 'wdConstant/Index'
import { SPHelper, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index'
import { HttpUtils } from 'wdNetwork/Index'
import { WDRouterRule, WDRouterPage } from 'wdRouter/Index'
import { TrackConstants, TrackingContent } from 'wdTracking/Index'
import MinePageDatasModel from '../../../model/MinePageDatasModel'
import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'
import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRequestItem'
... ... @@ -266,6 +267,12 @@ export struct FollowChildComponent{
this.data.status = this.data.status ==="0"?"1":"0"
UserDataLocal.setUserFollowOperation(this.data.creatorId+","+this.data.status)
if(this.data.status == "1"){//关注
TrackingContent.follow(true,this.data.cnUserName,this.data.cnUserId,TrackConstants.PageName.My_Follow,TrackConstants.PageName.My_Follow)
}else {//取消关注
TrackingContent.follow(false,this.data.cnUserName,this.data.cnUserId,TrackConstants.PageName.My_Follow,TrackConstants.PageName.My_Follow)
}
}
}
})
... ...
import { EmitterUtils, EmitterEventId, Logger, NetworkUtil } from 'wdKit/Index'
import { ParamType, TrackConstants, Tracking } from 'wdTracking/Index'
import MinePageDatasModel from '../../../model/MinePageDatasModel'
import { FollowListItem } from '../../../viewmodel/FollowListItem'
import { CustomTitleUI } from '../../reusable/CustomTitleUI'
... ... @@ -70,6 +71,7 @@ export struct FollowFirstTabsComponent{
}.onClick(()=>{
this.currentIndex = index
this.controller.changeIndex(this.currentIndex)
trackTabFirstClick(item.directoryName)
})
.height('100%')
.margin({right:'9lpx'})
... ... @@ -103,6 +105,7 @@ export struct FollowFirstTabsComponent{
.animationDuration(0)
.onChange((index: number) => {
this.currentIndex = index
trackTabFirstClick(this.data[index].directoryName)
})
.width('100%')
.layoutWeight(1)
... ... @@ -117,4 +120,13 @@ export struct FollowFirstTabsComponent{
this.isConnectNetwork = c
}
}
}
\ No newline at end of file
}
function trackTabFirstClick(firstLevelTabName: string){
let params: ParamType = {}
params["firstLevelTabName"] = firstLevelTabName
params["pageName"] = TrackConstants.PageName.My_Follow
params["pageId"] = TrackConstants.PageName.My_Follow
Tracking.event("my_follow_page_tab_click", params)
}
\ No newline at end of file
... ...
... ... @@ -265,19 +265,24 @@ struct LiveMorePage {
.fontSize('12vp')
.fontWeight(400)
.fontColor(Color.White)
.textShadow({ radius: 2, color: 'rgba(0,0,0,0.3)', offsetX: 0, offsetY: 2 })
.margin({
right: '5vp'
})
Divider()
.vertical(true)
.strokeWidth(1)
.height('12vp')
.margin({ top: 2, bottom: 2 })
.color(Color.White)
// Divider()
// .vertical(true)
// .strokeWidth(1)
// .height('12vp')
// .margin({ top: 2, bottom: 2 })
// .color(Color.White)
Image($r('app.media.icon_comp_line_live')).height('11vp').width('1.5vp')
if (this.getLiveRoomNumber(item).length > 0) {
Text(this.getLiveRoomNumber(item))
.fontSize('12vp')
.fontWeight(400)
.textShadow({ radius: 2, color: 'rgba(0,0,0,0.3)', offsetX: 0, offsetY: 2 })
.fontColor(Color.White)
.margin({
left: '5vp'
... ...
... ... @@ -546,45 +546,45 @@ export struct TopNavigationComponent {
return null
}
private getTextInfo(index: number): Record<string, number> {
let strJson = getInspectorByKey(index.toString())
try {
let obj: Record<string, string> = JSON.parse(strJson)
let rectInfo: number[][] = JSON.parse('[' + obj.$rect + ']')
return { 'left': px2vp(rectInfo[0][0]), 'width': px2vp(rectInfo[1][0] - rectInfo[0][0]) }
} catch (error) {
return { 'left': 0, 'width': 0 }
}
}
private getCurrentIndicatorInfo(index: number, event: TabsAnimationEvent): Record<string, number> {
let nextIndex = index
if (index > 0 && event.currentOffset > 0) {
nextIndex--
} else if (index < 3 && event.currentOffset < 0) {
nextIndex++
}
let indexInfo = this.getTextInfo(index)
let nextIndexInfo = this.getTextInfo(nextIndex)
let swipeRatio = Math.abs(event.currentOffset / this.tabsWidth)
let currentIndex = swipeRatio > 0.5 ? nextIndex : index // 页面滑动超过一半,tabBar切换到下一页。
let currentLeft = indexInfo.left + (nextIndexInfo.left - indexInfo.left) * swipeRatio
let currentWidth = indexInfo.width + (nextIndexInfo.width - indexInfo.width) * swipeRatio
return { 'index': currentIndex, 'left': currentLeft, 'width': currentWidth }
}
private startAnimateTo(duration: number, leftMargin: number, width: number) {
animateTo({
duration: duration, // 动画时长
curve: Curve.Linear, // 动画曲线
iterations: 1, // 播放次数
playMode: PlayMode.Normal, // 动画模式
onFinish: () => {
console.info('play end')
}
}, () => {
this.indicatorLeftMargin = leftMargin
this.indicatorWidth = width
})
}
// private getTextInfo(index: number): Record<string, number> {
// let strJson = getInspectorByKey(index.toString())
// try {
// let obj: Record<string, string> = JSON.parse(strJson)
// let rectInfo: number[][] = JSON.parse('[' + obj.$rect + ']')
// return { 'left': px2vp(rectInfo[0][0]), 'width': px2vp(rectInfo[1][0] - rectInfo[0][0]) }
// } catch (error) {
// return { 'left': 0, 'width': 0 }
// }
// }
//
// private getCurrentIndicatorInfo(index: number, event: TabsAnimationEvent): Record<string, number> {
// let nextIndex = index
// if (index > 0 && event.currentOffset > 0) {
// nextIndex--
// } else if (index < 3 && event.currentOffset < 0) {
// nextIndex++
// }
// let indexInfo = this.getTextInfo(index)
// let nextIndexInfo = this.getTextInfo(nextIndex)
// let swipeRatio = Math.abs(event.currentOffset / this.tabsWidth)
// let currentIndex = swipeRatio > 0.5 ? nextIndex : index // 页面滑动超过一半,tabBar切换到下一页。
// let currentLeft = indexInfo.left + (nextIndexInfo.left - indexInfo.left) * swipeRatio
// let currentWidth = indexInfo.width + (nextIndexInfo.width - indexInfo.width) * swipeRatio
// return { 'index': currentIndex, 'left': currentLeft, 'width': currentWidth }
// }
// private startAnimateTo(duration: number, leftMargin: number, width: number) {
// animateTo({
// duration: duration, // 动画时长
// curve: Curve.Linear, // 动画曲线
// iterations: 1, // 播放次数
// playMode: PlayMode.Normal, // 动画模式
// onFinish: () => {
// console.info('play end')
// }
// }, () => {
// this.indicatorLeftMargin = leftMargin
// this.indicatorWidth = width
// })
// }
}
\ No newline at end of file
... ...
... ... @@ -50,6 +50,10 @@ export struct OperRowListView {
}
private onCommentIconClick: () => void = () => {
}
@Provide inDialog: boolean = false
private dialogBeforeJumpOtherPageAction: () => void = () => {}
@Prop @Watch('onDetailUpdated') contentDetailData: ContentDetailDTO // 稿件详情
/**
* 组件样式类型,根据详情页类型传值,组件内部根据样式展现类型做判断
... ... @@ -233,23 +237,23 @@ export struct OperRowListView {
left: 16
})
if (this.showCommentIcon) {
if (this.showCommentIcon // 页面控制开关,直播传false
&& this.contentDetailData.openComment == 1 // 内容开关
&& this.publishCommentModel?.targetId) {
Column() {
if (this.publishCommentModel?.targetId) {
CommentIconComponent({
publishCommentModel: this.publishCommentModel,
styleType: this.styleType,
contentDetail: this.contentDetailData
})
.onClick(() => {
this.onCommentIconClick()
CommentIconComponent({
publishCommentModel: this.publishCommentModel,
styleType: this.styleType,
contentDetail: this.contentDetailData
})
.onClick(() => {
this.onCommentIconClick()
console.log(JSON.stringify(this.dialogController?.open))
console.log(JSON.stringify(this.dialogController?.open))
// 评论弹框内部嵌入
!this.showBackIcon && this.dialogController?.open()
})
}
// 评论弹框内部嵌入
!this.showBackIcon && this.dialogController?.open()
})
}
.width(48)
}
... ...
... ... @@ -6,6 +6,7 @@ import PageAdModel from '../viewmodel/PageAdvModel';
import { LoadStatus } from '../components/refresh/RefreshLayoutBean';
import { Logger } from 'wdKit/Index';
const TAG = 'PullDownRefresh'
/***********新的下拉、上拉手势 start **********/
export function onActionStart(pageModel: PageModel, pageAdvModel: PageAdModel, event?: GestureEvent) {
if (event === undefined) {
... ... @@ -157,11 +158,22 @@ export function touchUpPullRefresh(pageModel: PageModel, pageAdvModel: PageAdMod
let advSelf: PageAdModel = pageAdvModel;
PageHelper.refreshUI(self, advSelf)
}, Const.DELAY_TIME);
setRefreshTimeoutTimer(pageModel)
} else {
closeRefresh(pageModel, false);
}
}
export function setRefreshTimeoutTimer(pageModel: PageModel) {
let timeoutId = setTimeout(() => {
closeRefresh(pageModel, false);
Logger.error(TAG, 'closeRefresh by timeout')
}, Const.REFRESH_TIMEOUT__TIME);
// 取消超时关闭定时器
clearTimeout(pageModel.refreshTimeoutTimerId)
pageModel.refreshTimeoutTimerId = timeoutId
}
/**
* 自动刷新接口,如首页底导,双击按钮自动刷新
* @param pageModel 页面数据
... ... @@ -177,6 +189,7 @@ export function autoRefresh(pageModel: PageModel, pageAdvModel: PageAdModel) {
pullRefreshState(pageModel, RefreshState.Refreshing);
pageModel.currentPage = 1;
PageHelper.refreshUI(pageModel, pageAdvModel)
setRefreshTimeoutTimer(pageModel)
}
export function pullRefreshState(pageModel: PageModel, state: number) {
... ... @@ -225,6 +238,8 @@ export function pullRefreshState(pageModel: PageModel, state: number) {
export function closeRefresh(pageModel: PageModel, isRefreshSuccess: boolean) {
let self = pageModel;
// 取消超时关闭定时器
clearTimeout(self.refreshTimeoutTimerId)
setTimeout(() => {
let delay = Const.RefreshConstant_DELAY_PULL_DOWN_REFRESH;
if (self.isCanRefresh === true) {
... ...
import PageModel from '../viewmodel/PageModel';
import { RefreshConstants as Const } from './RefreshConstants';
import PageHelper from '../viewmodel/PageHelper';
import { Logger } from 'wdKit/Index';
const TAG = 'PullUpLoadMore'
export function touchMoveLoadMore(model: PageModel, event: TouchEvent) {
// list size +1
if (model.endIndex >= model.compList.totalCount()-3 && model.endIndex <= model.compList.totalCount()) {
if (model.endIndex >= model.compList.totalCount() - 3 && model.endIndex <= model.compList.totalCount()) {
// model.offsetY = event.touches[0].y - model.downY;
// if (Math.abs(model.offsetY) > vp2px(model.pullUpLoadHeight) / 2) {
// model.isCanLoadMore = true;
... ... @@ -32,6 +35,7 @@ export function touchUpLoadMore(model: PageModel) {
// closeLoadMore(model);
PageHelper.loadMore(self)
}, Const.DELAY_TIME);
setLoadMoreTimeoutTimer(self)
} else {
closeLoadMore(self);
}
... ... @@ -41,4 +45,14 @@ export function closeLoadMore(model: PageModel) {
model.isCanLoadMore = false;
model.isLoading = false;
model.isVisiblePullUpLoad = false;
}
export function setLoadMoreTimeoutTimer(pageModel: PageModel) {
let timeoutId = setTimeout(() => {
closeLoadMore(pageModel);
Logger.error(TAG, 'closeLoadMore by timeout')
}, Const.REFRESH_TIMEOUT__TIME);
// 取消超时关闭定时器
clearTimeout(pageModel.loadMoreTimeoutTimerId)
pageModel.loadMoreTimeoutTimerId = timeoutId
}
\ No newline at end of file
... ...
... ... @@ -14,7 +14,7 @@ export class RefreshConstants {
* The delay time.
*/
static readonly DELAY_TIME: number = 50;
static readonly REFRESH_TIMEOUT__TIME: number = 10000;
/**
* The animation duration.
*/
... ... @@ -25,12 +25,10 @@ export class RefreshConstants {
static readonly RefreshConstant_DELAY_PULL_DOWN_REFRESH: number = 50;
static readonly RefreshConstant_CLOSE_PULL_DOWN_REFRESH_TIME: number = 150;
static readonly RefreshConstant_DELAY_SHRINK_ANIMATION_TIME: number = 1500;
/**
* The page size.
*/
static readonly PAGE_SIZE: number = 20;
/**
* The refresh and load height.
*/
... ... @@ -59,6 +57,7 @@ export class RefreshConstants {
static readonly RefreshLayout_IMAGE_WIDTH: number = 18;
static readonly RefreshLayout_IMAGE_HEIGHT: number = 18;
}
/**
* The refresh state enum.
*/
... ...
... ... @@ -49,6 +49,9 @@ export class PageHelper {
}
private refreshUIEnd(pageModel: PageModel, isRefreshSuccess: boolean) {
if (pageModel.loadStrategy != 2) {
return
}
closeRefresh(pageModel, isRefreshSuccess)
}
... ... @@ -119,6 +122,7 @@ export class PageHelper {
}
}).catch((err: string | Resource) => {
promptAction.showToast({ message: err });
this.refreshUIEnd(pageModel, false)
})
} else {
Logger.debug(TAG, 'getPageInfo')
... ... @@ -127,6 +131,7 @@ export class PageHelper {
if (pageInfo == null) {
pageModel.viewType = ViewType.EMPTY;
pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1;
this.refreshUIEnd(pageModel, false)
return;
}
pageModel.pageInfo = pageInfo;
... ... @@ -146,6 +151,7 @@ export class PageHelper {
Logger.debug(TAG, 'getPageInfo go on')
this.parseGroup(pageModel, false)
}).catch(() => {
this.refreshUIEnd(pageModel, false)
if (this.isPageLoaded(pageModel)) {
return
}
... ... @@ -406,7 +412,7 @@ export class PageHelper {
/**
* 竖直方向list,将数据拆出来,组装成comp
*/
private createSpecialComp(compList: CompDTO[]): CompDTO[]{
private createSpecialComp(compList: CompDTO[]): CompDTO[] {
if (!compList) {
return compList
}
... ...
... ... @@ -28,13 +28,28 @@ export default class PageModel {
loadStrategy: number = 1;
currentPage: number = 1;
pageSize: number = Const.PAGE_SIZE;
/**
* @deprecated
*/
pullDownRefreshText: Resource = $r('app.string.pull_down_refresh_text');
/**
* @deprecated
*/
pullDownRefreshImage: Resource = $r('app.media.ic_pull_down_refresh');
pullDownRefreshHeight: number = Const.CUSTOM_LAYOUT_HEIGHT;
isVisiblePullDown: boolean = false;
load: LoadStatus = LoadStatus.IDLE;
/**
* @deprecated
*/
pullUpLoadText: Resource = $r('app.string.pull_up_load_text');
/**
* @deprecated
*/
pullUpLoadImage: Resource = $r('app.media.ic_pull_up_load');
/**
* @deprecated
*/
pullUpLoadHeight: number = Const.CUSTOM_LAYOUT_HEIGHT;
isVisiblePullUpLoad: boolean = false;
offsetY: number = 0;
... ... @@ -50,6 +65,8 @@ export default class PageModel {
isPullRefreshOperation = false;
isLoading: boolean = false;
isCanLoadMore: boolean = false;
refreshTimeoutTimerId: number = 0;
loadMoreTimeoutTimerId: number = 0;
// keyGenerator相关字符串,用于刷新list布局
timestamp: String = '1';
... ...
... ... @@ -83,23 +83,29 @@ export struct DetailPlayLiveCommon {
* 获取直播信息,可区分横竖屏直播
*/
getLiveDetails() {
this.liveViewModel.getLiveDetails(this.contentId, this.relId, this.relType)
.then(
(data) => {
if (data.length > 0) {
this.liveDetailsBean = data[0]
this.liveState = this.liveDetailsBean.liveInfo?.liveState
this.liveStyle = this.liveDetailsBean.liveInfo.liveStyle
if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) {
this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url
//todo 不加setTimeOut ,接口返回的数据 就没法让PlayerComponent #@Consume @Watch('updateData') liveDetailsBean 的updateData方法运行
setTimeout(() => {
this.liveDetailsBean = data[0]
}, 10)
this.liveState = data[0].liveInfo?.liveState
this.liveStyle = data[0].liveInfo.liveStyle
if (data[0].fullColumnImgUrls && data[0].fullColumnImgUrls.length > 0) {
this.imgUrl = data[0].fullColumnImgUrls[0].url
}
if (this.liveDetailsBean.liveInfo.liveState == 'end') {
this.playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri
if (data[0].liveInfo.liveState == 'end') {
this.playUrl = data[0].liveInfo.vlive[0].replayUri
}
console.log(TAG, 'getLiveDetails:', JSON.stringify((this.liveDetailsBean)))
// console.log(TAG, 'getLiveDetails:', JSON.stringify((this.liveDetailsBean)))
}
},
() => {
... ...
... ... @@ -36,6 +36,7 @@ export struct DetailPlayVLivePage {
aboutToAppear(): void {
this.openFullScreen()
this.getLiveRoomData()
}
aboutToDisappear(): void {
... ...
... ... @@ -21,6 +21,7 @@ export struct PlayerComponent {
@State playUrl: string = ''
@State isCanplay: boolean = false
pageShowChange() {
this.playerController?.play()
}
... ... @@ -30,15 +31,10 @@ export struct PlayerComponent {
}
aboutToAppear(): void {
console.log(TAG, 'aboutToAppear')
this.playerController.onCanplay = () => {
console.log('可以播放了')
this.playerController?.play()
this.isCanplay = true
}
}
async aboutToDisappear(): Promise<void> {
await this.playerController?.pause()
await this.playerController?.stop()
await this.playerController?.release()
... ... @@ -63,7 +59,6 @@ export struct PlayerComponent {
this.liveStreamType = liveStreamType
this.playUrl = playUrl
}
}
... ... @@ -75,6 +70,7 @@ export struct PlayerComponent {
WDPlayerRenderVLiveView({
playerController: this.playerController,
onLoad: () => {
this.isCanplay = true
this.playerController?.firstPlay(this.playUrl);
}
})
... ... @@ -82,12 +78,14 @@ export struct PlayerComponent {
AliPlayerRenderView({
playerController: this.playerController,
onLoad: () => {
this.isCanplay = true
this.playerController?.firstPlay(this.playUrl);
}
}).margin({ top: 195 }).height(211)
}
PictureLoading().visibility(this.isCanplay ? Visibility.None : Visibility.Visible)
}
.height('100%')
.width('100%')
... ... @@ -98,8 +96,11 @@ export struct PlayerComponent {
this.isShowControl = !this.isShowControl
}
})
}
.height('100%')
.width('100%')
}
}
\ No newline at end of file
... ...
... ... @@ -185,7 +185,7 @@ export struct DetailPlayShortVideoPage {
index: $index,
currentIndex: $currentIndex,
showCommentList: $showCommentList,
publishCommentModel: $publishCommentModel
// publishCommentModel: $publishCommentModel
})
this.playerViewBuilder()
... ...
import { ContentDetailDTO } from 'wdBean/Index'
import { WindowModel } from 'wdKit/Index'
import {
publishCommentModel
} from '../../../../../wdComponent/src/main/ets/components/comment/model/PublishCommentModel'
import { CommentComponent } from '../../../../../wdComponent/src/main/ets/components/comment/view/CommentComponent'
import { OperRowListView } from '../../../../../wdComponent/src/main/ets/components/view/OperRowListView'
import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index'
import { CommentListDialogView } from 'wdComponent/Index'
@Component
export struct CommentDialogView {
@Link publishCommentModel: publishCommentModel
@Link @Watch('showCommentListChange') showCommentList: boolean
@Link index: number
@Link currentIndex: number
@Consume windowWidth: number
@Consume windowHeight: number
@Consume bottomSafeHeight: number
@Consume topSafeHeight: number
@Consume contentDetailData: ContentDetailDTO
@State fakePageInfo: PageInfoDTO = {} as PageInfoDTO
@State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16)
// @State modifier: DrawModifier = new DrawModifier();
dialogController: CustomDialogController = new CustomDialogController({
builder: DetailDialog({
publishCommentModel: $publishCommentModel,
contentDetailData: $contentDetailData,
dialogOffsetY: $dialogOffsetY,
showCommentList: $showCommentList,
windowWidth: this.windowWidth,
windowHeight: this.windowHeight
}),
autoCancel: false,
customStyle: true,
alignment: DialogAlignment.Bottom,
// onWillDismiss: (dismissDialogAction: DismissDialogAction) => {
// this.showCommentList = false
// dismissDialogAction.dismiss()
// },
// openAnimation: { duration: 0 },
// closeAnimation: { duration: 0 },
})
/**
* 问题:弹窗从底部到上动画无法添加
*/
@State @Watch("innerShowCommentChange") innerShowComment: boolean = false
showCommentListChange(val: boolean) {
if (this.showCommentList && this.index === this.currentIndex) {
this.dialogController.open()
console.log('open')
// animateTo({ duration: 10000, expectedFrameRateRange: { min: 60, max: 60, expected: 60 } }, () => {
// this.dialogOffsetY = 500
// this.modifier.invalidate()
// })
this.innerShowComment = true
} else {
this.dialogController.close()
console.log('close')
this.innerShowComment = false
}
}
build() {
innerShowCommentChange() {
this.showCommentList = this.innerShowComment
}
}
@CustomDialog
export struct DetailDialog {
controller: CustomDialogController
@Link publishCommentModel: publishCommentModel
@Link dialogOffsetY: number
@Link contentDetailData: ContentDetailDTO
@Link showCommentList: boolean
@Prop windowWidth: number
@Prop windowHeight: number
build() {
Column() {
CommentComponent({
publishCommentModel: this.publishCommentModel,
showCloseIcon: true,
fixedHeightMode: true,
onCloseClick: () => {
console.log('onCloseClick')
this.showCommentList = false
this.controller.close()
// setTimeout(() => {
//
// }, 1000)
}
}).layoutWeight(1)
OperRowListView({
componentType: 4,
pageComponentType: 8,
showBackIcon: false,
operationButtonList: ['comment', 'like', 'collect', 'share'],
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
showCommentIcon: true,
styleType: 1,
onBack: () => {
WindowModel.shared.setWindowLayoutFullScreen(false)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}
})
}
.height(this.windowHeight - this.windowWidth * 9 / 16 + 'px')
// .margin({ top: this.dialogOffsetY + 'px' })
.zIndex(1000)
.backgroundColor(Color.White)
CommentListDialogView({
showCommentList: this.innerShowComment,
contentDetailData: this.contentDetailData,
pageInfo: this.fakePageInfo,
onClose: () => {
this.showCommentList = false
}
})
}
}
\ No newline at end of file
... ...
... ... @@ -2,15 +2,11 @@ import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils,CustomToast, String
import router from '@ohos.router'
import { LoginViewModel } from './LoginViewModel'
import { LoginInputComponent } from './LoginInputComponent'
import { ErrorToastUtils, SPHelper } from 'wdKit'
import { WDRouterPage } from 'wdRouter/src/main/ets/router/WDRouterPage';
import { WDRouterRule } from 'wdRouter/src/main/ets/router/WDRouterRule';
import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/src/main/ets/bean/content/Params'
import {InterestsHobbiesModel} from '../../../../../../../products/phone/src/main/ets/pages/viewModel/InterestsHobbiesModel'
import HuaweiAuth from '../../utils/HuaweiAuth'
import { loginComponentManager, LoginWithHuaweiIDButton } from '@hms.core.account.LoginComponent'
import { BusinessError } from '@ohos.base'
import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'
import { TrackingPageBrowse, TrackConstants, TrackingButton, ParamType, Tracking } from 'wdTracking/Index'
@Extend(Row)
function otherStyle() {
... ... @@ -43,7 +39,6 @@ struct LoginPage {
@State isSubmit: boolean = false
@State checkCodePage: boolean = true //判断是否是验证码页面 默认验证码登录
@State passwordSwitch: boolean = true //密码显示
// @State isPasswordSubmit: boolean = false //账户密码状态 是否出发登录
lastTime: number = 0
@State codeStateSuccess:boolean=false
@State toastText:string = ""
... ... @@ -64,6 +59,7 @@ struct LoginPage {
onCodeSend() {
Logger.debug(TAG, "isCodeSend:" + this.isCodeSend + "")
if (this.isCodeSend) {
TrackingButton.click("loginPageGetVerificationCode",TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page)
this.sendVerifyCode()
}
}
... ... @@ -81,7 +77,12 @@ struct LoginPage {
this.pageHideTime = DateTimeUtils.getTimeStamp()
let duration = 0
duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page,duration)
if(this.checkCodePage){
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page,duration)
}else{
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page,duration)
}
}
build() {
... ... @@ -96,20 +97,16 @@ struct LoginPage {
.margin({ top: 78 })
.align(Alignment.Center)
if (this.checkCodePage) {
LoginInputComponent({
phoneContent: $phoneContent,
codeContent: $codeContent,
isSubmit: $isSubmit,
isCodeSend: $isCodeSend,
codeStateSuccess:$codeStateSuccess,
protocolState:this.protocolState,
isNeedProtocol:true
})
} else {
this.addPassword()
}
LoginInputComponent({
phoneContent: $phoneContent,
codeContent: $codeContent,
isSubmit: $isSubmit,
isCodeSend: $isCodeSend,
codeStateSuccess:$codeStateSuccess,
protocolState:this.protocolState,
isNeedProtocol:true
}).visibility(this.checkCodePage ? Visibility.Visible : Visibility.None)
this.addPassword()
Row() {
Image(this.protocolState ? $r('app.media.login_checkbox_select') : $r('app.media.login_checkbox_unselected'))
... ... @@ -122,11 +119,21 @@ struct LoginPage {
Text() {
Span("我已阅读并同意").fontColor("#999999").fontSize(12)
Span("《用户协议》").fontColor("#ED2800").fontSize(12).onClick(() => {
if(this.checkCodePage){
TrackingButton.click("loginPageUserAgreement",TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page)
}else{
TrackingButton.click("loginPageUserAgreement",TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page)
}
let bean = { contentID: "1", pageID: "" } as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
})
Span("及").fontColor("#999999").fontSize(12)
Span("《隐私政策》").fontColor("#ED2800").fontSize(12).onClick(() => {
if(this.checkCodePage){
TrackingButton.click("loginPagePrivacyAgreement",TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page)
}else{
TrackingButton.click("loginPagePrivacyAgreement",TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page)
}
let bean = { contentID: "2", pageID: "" } as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
})
... ... @@ -137,10 +144,11 @@ struct LoginPage {
Text("登录")
.borderRadius(4)
.fontColor(this.isSubmit ? "#FFFFFFFF" : "#66FFFFFF")
.fontSize(18)
.fontWeight(FontWeight.Medium)
.fontSize("31lpx")
.fontWeight(400)
.margin({ top: 20 })
.height(44)
.lineHeight("50lpx")
.height(44)
.textAlign(TextAlign.Center)
.width("100%")
.backgroundColor(this.isSubmit ? "#FFED2800" : "#99ED2800")
... ... @@ -160,9 +168,14 @@ struct LoginPage {
if (!this.checkCodePage) {
Text('忘记密码').fontColor('#666666').fontSize(14).margin({ top: 16 })
Text('忘记密码')
.fontColor('#666666')
.fontSize("31lpx")
.fontWeight(400)
.lineHeight("38lpx")
.margin({ top: 16 })
.onClick(() => {
// router.pushUrl({ url: 'pages/login/ForgetPasswordPage' })
TrackingButton.click("loginPageForgotPassword",TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page)
if(StringUtils.isNotEmpty(this.accountContent) && StringUtils.photoMatch(this.accountContent)){
let pageType = { 'pageType': 0, 'phone': Number(this.accountContent) } as Record<string, number>;
WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType)
... ... @@ -228,11 +241,7 @@ struct LoginPage {
})
RelativeContainer() {
// if (this.passwordSwitch) {
this.addPasswordInputLayout()
// } else {
// this.addPasswordInputLayout()
// }
Image(this.passwordSwitch ? $r('app.media.login_password_off') : $r('app.media.login_password_on'))
.onClick(() => {
... ... @@ -251,6 +260,7 @@ struct LoginPage {
.height(48)
.width('100%')
}.padding({ left: 25, right: 25 }).width('100%').margin({ top: 36 })
.visibility(this.checkCodePage ? Visibility.None : Visibility.Visible)
}
... ... @@ -289,24 +299,6 @@ struct LoginPage {
}.width('100%')
Row() {
/*Row() {
Image($r('app.media.login_wx'))
.width(20).height(20).onClick(()=>{
ErrorToastUtils.ErrorToast.showToast(ErrorToastUtils.ErrorType.NET_CORE_NO_NETWORK)
})
}.backgroundImage($r('app.media.login_other_left'), ImageRepeat.NoRepeat)
.otherStyle()
Row() {
Image($r('app.media.login_qq')).size({ width: 20, height: 20 })
}.backgroundImage($r('app.media.login_other_middle'), ImageRepeat.NoRepeat)
.otherStyle()
Row() {
Image($r('app.media.login_wb')).size({ width: 20, height: 20 })
}.backgroundImage($r('app.media.login_other_middle'), ImageRepeat.NoRepeat)
.otherStyle()*/
Row() {
Image(this.checkCodePage ? $r('app.media.login_qt') : $r('app.media.login_other_password'))
.size({ width: "35lpx", height: "35lpx" })
... ... @@ -320,10 +312,19 @@ struct LoginPage {
.lineHeight("38lpx")
}
.onClick(() => {
this.onPageHide()
if(this.checkCodePage){
trackTypeClick(0,TrackConstants.PageName.Phone_Login_Page)
}else{
trackTypeClick(6,TrackConstants.PageName.Login_Page)
}
this.updateAccount()
this.checkCodePage = !this.checkCodePage;
this.checkCodePage = !this.checkCodePage
this.passwordSwitch = true
this.isSubmit = false
this.pageShowTime = DateTimeUtils.getTimeStamp()
}).width('100%')
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Center)
... ... @@ -374,6 +375,7 @@ struct LoginPage {
requestLogin() {
Logger.debug('LoginViewModel', "requestLogin")
if (this.checkCodePage) {
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)
///同步兴趣tag
... ... @@ -385,6 +387,7 @@ struct LoginPage {
this.showToastTip(error)
})
} else {
TrackingButton.click("loginPageLoginButton",TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page)
this.loginViewModel.appLoginByPassword(this.accountContent, 0, this.passwordContent, "").then((data) => {
Logger.debug(TAG, "requestLogin: " + data.jwtToken)
this.showToastTip('登录成功')
... ... @@ -588,3 +591,12 @@ struct ProtocolComponent {
}
}
function trackTypeClick(typeValue: number,pageId: string){
let params: ParamType = {}
params["loginType"] = typeValue
params["pageName"] = pageId
params["pageId"] = pageId
Tracking.event("login_type_click", params)
}
... ...
... ... @@ -137,7 +137,6 @@ export class WDAliPlayerController {
onStateChanged: (status: number) => {
this.avPlayerStatus = status
Logger.debug(TAG, "status update:" + `${this.getStatusStringWith(status)}`)
switch (status) {
case initalized: {
//this.avPlayer?.prepare();
... ...
... ... @@ -99,7 +99,7 @@ export struct MultiPictureDetailPageComponent {
index: $index,
currentIndex: $currentIndex,
showCommentList: $showCommentList,
publishCommentModel: $publishCommentModel
// publishCommentModel: $publishCommentModel
})
}
... ...