yumaochao
Showing 22 changed files with 417 additions and 78 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 verifyPhoneNumberPage = new WDRouterPage("wdLogin", "ets/pages/login/VerifyPhoneNumberPage");
static changeBindPhonePage = new WDRouterPage("wdLogin", "ets/pages/login/ChangeBindPhonePage");
static modifyPasswordPage = new WDRouterPage("wdLogin", "ets/pages/login/ModifyPasswordPage");
//我的 预约
... ...
import { ContentDTO, NewspaperListItemBean, NewspaperPositionItemBean, Params } from 'wdBean';
import { StringUtils } from 'wdKit';
import { ProcessUtils } from 'wdRouter';
import { TrackingContent,TrackConstants } from 'wdTracking/Index';
import { newsSkeleton } from './skeleton/newsSkeleton';
@Component
... ... @@ -13,6 +14,20 @@ export struct ENewspaperItemComponent {
private itemBeanClicked: NewspaperPositionItemBean = {} as NewspaperPositionItemBean
@State isShowSkeleton: boolean = true
aboutToAppear(): void {
for (let index = 0; index < this.newspaperListItemBean.items.length; index++) {
const element = this.newspaperListItemBean.items[index];
TrackingContent.common(TrackConstants.EventType.Show,TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
,{
'contentName':element.title,
'contentType':element.newsType,
'contentId':element.newsId,
'panelNumber':this.newspaperListItemBean.pageNum,
'panelName':this.newspaperListItemBean.pageName,
'readMode':'1',
})
}
}
build() {
Stack() {
newsSkeleton()
... ... @@ -70,6 +85,16 @@ export struct ENewspaperItemComponent {
relType:this.itemBeanClicked.relType ?? '0'
} as ContentDTO
ProcessUtils.processPage(content)
//内容点击
TrackingContent.commentClickWithEvent('current_Number_Panel_content_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
,{
'contentName':this.itemBeanClicked.title,
'contentType':this.itemBeanClicked.newsType,
'contentId':this.itemBeanClicked.newsId,
'panelNumber':this.newspaperListItemBean.pageNum,
'panelName':this.newspaperListItemBean.pageName,
'readMode':'1',
})
this.itemBeanClicked = {} as NewspaperPositionItemBean
}
}
... ...
... ... @@ -10,7 +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';
import { TrackingContent,TrackConstants, TrackingButton } from 'wdTracking/Index';
@Component
export struct ENewspaperPageComponent {
... ... @@ -34,6 +34,15 @@ export struct ENewspaperPageComponent {
let _swiperIndex = Number.parseInt(this.currentPageNum)
console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "_swiperIndex:", _swiperIndex)
this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex
//电子报--版面序号选择点击
TrackingContent.commentClickWithEvent('panel_number_selection_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
,{
'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,
'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,
'currentPanelDate':this.selectDate.toDateString(),
'currentNumber':this.swiperIndex,
})
}
//日历选择弹框
... ... @@ -51,6 +60,14 @@ export struct ENewspaperPageComponent {
this.selectDate =
new Date(date.fullYear ? date.fullYear : 0, date.month ? date.month : 0, date.date ? date.date : 0)
}
//日历选择点击
TrackingContent.commentClickWithEvent('date_selection_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
,{
'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,
'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,
'currentPanelDate':this.selectDate.toDateString(),
'currentNumber':this.swiperIndex,
})
}
}),
alignment: DialogAlignment.Top,
... ... @@ -190,7 +207,7 @@ export struct ENewspaperPageComponent {
if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
Swiper(this.swiperController) {
ForEach(this.newspaperListBean?.list, (item: NewspaperListItemBean, index: number) => {
ENewspaperItemComponent({ newspaperListItemBean: item })
ENewspaperItemComponent({ newspaperListItemBean: item})
})
}
.index(this.swiperIndex)
... ... @@ -245,6 +262,12 @@ export struct ENewspaperPageComponent {
.id('e_newspaper_next')
.onClick((event: ClickEvent) => {
this.swiperController.showNext()
// 电子报--滑动查看下一版
TrackingButton.click('panelPageViewNextPanel',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
,{
'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,
'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,
})
})
}
... ... @@ -310,6 +333,14 @@ export struct ENewspaperPageComponent {
})
.id('e_newspaper_read')
.onClick((event: ClickEvent) => {
//电子报--读报纸点击
TrackingContent.commentClickWithEvent('read_newspaper_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
,{
'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,
'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,
'currentPanelDate':this.selectDate.toDateString(),
'currentNumber':this.swiperIndex,
})
if(!NetworkUtil.isNetConnected()){
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
return
... ...
... ... @@ -10,7 +10,7 @@ import { BusinessError } from '@kit.BasicServicesKit';
import { router } from '@kit.ArkUI';
import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from 'wdRouter/Index';
import { TrackingPageBrowse } from 'wdTracking/Index';
import { TrackConstants, TrackingButton, TrackingPageBrowse } from 'wdTracking/Index';
const TAG = 'FeedBackActivity'
... ... @@ -22,8 +22,6 @@ const TAG = 'FeedBackActivity'
@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 = "";
... ... @@ -66,6 +64,11 @@ export struct FeedBackActivity {
.onChange((select) => {
feedbackTypeBean.isSelect = select
this.canSubmit = this.checkSubmit()
TrackingButton.click('submit_feedback',TrackConstants.PageName.FeedbackPage,TrackConstants.PageName.FeedbackPage,{
'feedback_type':feedbackTypeBean.id+''
})
})
Text(feedbackTypeBean.classifyName)
.fontColor($r('app.color.color_222222'))
... ... @@ -342,9 +345,13 @@ export struct FeedBackActivity {
})
if(!StringUtils.isEmpty(selectType)){
selectType = selectType.substring(0,selectType.length-1)
TrackingButton.click('feedbackPageSubmitFeedback',TrackConstants.PageName.FeedbackPage,TrackConstants.PageName.FeedbackPage,{
'feedbackTypeId':selectType
})
}else{
//
ToastUtils.shortToast($r('app.string.feedback_opinion_type'))
TrackingButton.click('feedbackPageSubmitFeedback',TrackConstants.PageName.FeedbackPage,TrackConstants.PageName.FeedbackPage)
return
}
//内容必填
... ... @@ -389,7 +396,7 @@ export struct FeedBackActivity {
}
onPageHide() {
//页面浏览
TrackingPageBrowse.trackCommonPageExposureEnd(this.pageId,this.pageName,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.FeedbackPage,TrackConstants.PageName.FeedbackPage,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
}
}
\ No newline at end of file
... ...
... ... @@ -144,7 +144,8 @@ export struct MorningEveningPaperComponent {
Logger.info(TAG, "pageInfoBean dateTime = " + dateTime)
Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle)
this.setComponentBgColor(pageInfoBean.backgroundImgUrl)
this.setComponentBgColor(this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string)
let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId)
// this.compInfoBean = compInfoBean
... ... @@ -223,8 +224,7 @@ export struct MorningEveningPaperComponent {
effectKit.createColorPicker(pixelMap, (err, colorPicker) => {
let color = colorPicker.getMainColorSync();
Logger.debug(TAG, "compInfoBean compStyle = " + color)
color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha})
// color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha})
// 将取色器选取的color示例转换为十六进制颜色代码
this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16);
Logger.debug(TAG, "compInfoBean compStyle = " + this.mixedBgColor)
... ... @@ -272,18 +272,17 @@ export struct MorningEveningPaperComponent {
}
.height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`).scrollBar(BarState.Off)
PaperTitleComponent()
PaperTitleComponent().margin({top:this.topSafeHeight})
}
.width('100%')
.height('100%')
.padding({
top: this.topSafeHeight,
bottom: this.bottomSafeHeight
})
// .padding({
// top: this.topSafeHeight,
// bottom: this.bottomSafeHeight
// })
// .backgroundColor(Color.Black)
// .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black)
.backgroundColor(this.mixedBgColor ?? Color.Black)
}
@Builder
... ...
... ... @@ -32,6 +32,7 @@ export struct topicInfoView {
})
.id('img_cover')
if (this.frontLinkObject) {
Row() {
Text("查看详情")
.fontSize(14)
... ... @@ -49,19 +50,19 @@ export struct topicInfoView {
.margin({ top: 8, left: 16, right: 16, bottom: 16 })
.borderRadius(2)
.onClick(()=>{
if (this.frontLinkObject) {
let contentDTO :ContentDTO = new ContentDTO();
contentDTO.objectType = this.frontLinkObject?.newsType.toString()
contentDTO.objectId = this.frontLinkObject?.newsId
contentDTO.linkUrl = this.frontLinkObject?.linkUrl
ProcessUtils.processPage(contentDTO)
}
}).width(80)
.alignRules({
left: { anchor: "__container__", align: HorizontalAlign.Start },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
})
.id('row_detail')
}
Text(this.frontLinkObject?.summary ?? "")
.margin({ top: 10 })
... ...
... ... @@ -279,6 +279,7 @@ export struct CommentComponent {
if (commentListModel && commentListModel.list && commentListModel.list.length > 0) {
this.allDatas.clearAllData() // 防止数据重复问题
commentListModel.list.forEach(element => {
element.hasMore = Number.parseInt(element.childCommentNum) ? true : false
let newModel = commentViewModel.deepCopyCommentItemModel(element)
... ...
import { DisplayUtils, EmitterEventId, EmitterUtils } from 'wdKit/Index'
import { DisplayUtils, EmitterEventId, EmitterUtils, ToastUtils } from 'wdKit/Index'
import { publishCommentModel } from '../model/PublishCommentModel'
import { CommentCustomDialog } from './CommentCustomDialog'
import measure from '@ohos.measure'
import { ContentDetailDTO } from 'wdBean/Index'
import { HttpUtils } from 'wdNetwork/Index'
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
@Preview
@Component
... ... @@ -120,6 +122,21 @@ export struct CommentTabComponent {
if(this.contentDetail.appstyle === 9) return
this.onCommentFocus && this.onCommentFocus()
// 未登录,游客评论未打开 则先登录
if (!HttpUtils.isLogin()) {
if (this.contentDetail.visitorComment != 1) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
}
if (this.contentDetail.openComment != 1 && this.contentDetail.commentDisplay != 1) {
ToastUtils.showToast("暂时无法评论", 3000)
return
}
//TODO: 用户被禁言 也不能评论
this.publishCommentModel.rootCommentId = '-1';
this.publishCommentModel.parentId = '-1';
this.publishCommentModel.placeHolderText = "说两句..."
... ...
import { ViewType } from 'wdConstant/Index'
import { DateTimeUtils, LazyDataSource, ToastUtils, WindowModel } from 'wdKit/Index'
import { DateTimeUtils, LazyDataSource, Logger, ToastUtils, WindowModel } from 'wdKit/Index'
import { commentItemModel } from '../model/CommentModel'
import commentViewModel from '../viewmodel/CommentViewModel'
import { router, window } from '@kit.ArkUI'
... ... @@ -106,8 +106,13 @@ export struct QualityCommentsComponent {
// .aspectRatio(375 / 283);
}
.onAreaChange((oldValue: Area, newValue: Area) => {
let persent = Math.abs(Number(newValue.globalPosition.y)) / 150
if (Number(oldValue.globalPosition.y) == 0 && Number(newValue.globalPosition.y) > 30) {
this.firstPositionY = Number(newValue.globalPosition.y)
return
}
Logger.debug(TAG, "oldValue.globalPosition.y : " + oldValue.globalPosition.y)
Logger.debug(TAG, "newValue.globalPosition.y : " + newValue.globalPosition.y + `,this.topSafeHeight : ` + this.topSafeHeight)
let persent = Math.abs(Number(newValue.globalPosition.y) - this.firstPositionY ) / 150 //- this.topSafeHeight) / 283
if (persent > 1) {
persent = 1
}
... ... @@ -130,16 +135,17 @@ export struct QualityCommentsComponent {
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.offset({
y: (this.topSafeHeight / 2) + 'px'
})
// .offset({
// y: (this.topSafeHeight / 2) + 'px'
// })
.margin({ left: 16 })
.onClick(() => {
router.back()
})
}
.visibility(this.tileOpacity > 0 ? 1 : 0)
.height(this.topSafeHeight + vp2px(44) + 'px')
// .height(this.topSafeHeight + vp2px(44) + 'px')
.height(44)
.width('100%')
.backgroundColor($r('app.color.color_transparent'))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
... ... @@ -159,9 +165,9 @@ export struct QualityCommentsComponent {
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.offset({
y: (this.topSafeHeight / 2) + 'px'
})
// .offset({
// y: (this.topSafeHeight / 2) + 'px'
// })
.margin({ left: 16 })
.onClick(() => {
router.back()
... ... @@ -178,16 +184,17 @@ export struct QualityCommentsComponent {
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.offset({
y: (this.topSafeHeight / 2) + 'px'
})
// .offset({
// y: (this.topSafeHeight / 2) + 'px'
// })
}
.visibility(this.tileOpacity > 0 ? 0 : 1)
.opacity(this.tileOpacity)
.height(this.topSafeHeight + vp2px(44) + 'px')
// .height(this.topSafeHeight + vp2px(44) + 'px')
.height(44)
.width('100%')
.backgroundColor($r('app.color.white'))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
build() {
... ... @@ -212,7 +219,7 @@ export struct QualityCommentsComponent {
.friction(0.6)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
this.TabbarTransparent()
this.TabbarNormal()
... ...
... ... @@ -213,8 +213,7 @@ export struct AccountAndSecurityLayout {
WDRouterRule.jumpWithPage(WDRouterPage.modifyPasswordPage)
}else{
//设置密码
let pageType = {'pageType': 1} as Record<string, number>;
WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType)
WDRouterRule.jumpWithPage(WDRouterPage.verifyPhoneNumberPage)
}
}else if (index == 3) {
trackButtonClick("accountManagementPageAccountCancellation")
... ...
... ... @@ -177,9 +177,9 @@ export class ColorUtils {
public static getMorningEveningPaperRgb(color: ColorRgb): ColorRgb{
// RGB颜色取值范围是0~255,需要转换为0~1的浮点数
const red: number = color.red / MAX_RGB_VALUE;
const green: number = color.green / MAX_RGB_VALUE;
const blue: number = color.blue / MAX_RGB_VALUE;
const red: number = color.red ;
const green: number = color.green ;
const blue: number = color.blue;
const max: number = Math.max(red, green, blue);
const min: number = Math.min(red, green, blue);
... ...
... ... @@ -10,7 +10,7 @@ export struct LoginInputComponent {
@Link isCodeSend: boolean //验证码控件是否点击 默认没有 发送接口
@Link isSubmit: boolean //是否可以提交
isFirst:boolean=true//是否第一次获取验证码
pageType?:number; //0、登录->忘记密码 1、设置->重置密码 3、设置->更换手机号页面2
pageType?:number; //0、登录->忘记密码 3、设置->更换手机号页面2
lastTime: number = 0
@Link @Watch('startCount') codeStateSuccess: boolean //验证码获取成功与否回调 成功显示倒计时
@Watch('onCheckChange') @Prop protocolState: boolean = false //协议勾选状态
... ... @@ -33,9 +33,6 @@ export struct LoginInputComponent {
}
async aboutToAppear(){
if (this.pageType == 1 ) {
this.phoneContent = await SPHelper.default.get(SpConstants.USER_PHONE,"") as string;
}
if(this.pageType == 0 ){
let phone = await SPHelper.default.get(SpConstants.USER_PHONE,"") as string
if(StringUtils.isNotEmpty(phone)){
... ... @@ -43,29 +40,9 @@ export struct LoginInputComponent {
}
}
}
@Builder
addCodeLayout() {
if (this.pageType == 1){
TextInput({ text: this.securityPhone(this.phoneContent) })
.placeholderColor("#CCCCCC")
.fontSize(16)
.height(48)
.maxLength(11)
.margin({ top: 36 })
.backgroundColor("#F5F5F5")
.borderRadius(4)
.enabled(false)
.type(InputType.PhoneNumber)
.onChange((content) => {
this.phoneContent = content
this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 4)
if (content.length >= 11) {
this.codeBtnState = true
} else {
this.codeBtnState = false
}
})
}else{
//修改密码 里面的 忘记密码(已登录)
if(StringUtils.isNotEmpty(this.phoneContent) && this.phoneContent.indexOf("****")!=-1 && this.pageType == 0){
TextInput({ text: this.securityPhone(this.phoneContent) })
... ... @@ -115,7 +92,6 @@ export struct LoginInputComponent {
}
})
}
}
Row() {
... ...
... ... @@ -378,6 +378,7 @@ struct LoginPage {
TrackingButton.click("loginPageLoginButton",TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page)
this.loginViewModel.appLogin(this.phoneContent, 2, this.codeContent).then((data) => {
Logger.debug(TAG, "requestLogin: " + data.jwtToken)
this.showToastTip('登录成功')
///同步兴趣tag
let interestsModel = new InterestsHobbiesModel()
interestsModel.updateInterests()
... ...
... ... @@ -29,10 +29,12 @@ struct LoginProtocolWebview {
this.contentID = params.contentID
}
if (params.contentID == "1") { //"人民日报客户端网络服务使用协议"
this.webUrl = this.userProtocol
this.webUrl = await SPHelper.default.get(SpConstants.NET_SERVICE_PROTOCOL, this.userProtocol) as string
this.webviewController.loadUrl(this.webUrl)
} else if(params.contentID == "2"){ //"人民日报客户端用户隐私协议"
this.webUrl = this.privateProtocol
this.webUrl = await SPHelper.default.get(SpConstants.PRIVATE_PROTOCOL, this.privateProtocol) as string
this.webviewController.loadUrl(this.webUrl)
}else if(params.contentID == "3"){ //注销协议
... ...
import { CustomToast, DateTimeUtils, Logger, SPHelper } from 'wdKit/Index'
import { WDRouterRule, WDRouterPage } from 'wdRouter/Index'
import { LoginViewModel } from './LoginViewModel'
import { SettingPasswordParams } from './SettingPasswordLayout'
import { router } from '@kit.ArkUI'
import { SpConstants } from 'wdConstant/Index'
import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index'
const TAG = 'VerifyPhoneNumberPage'
//设置密码(第一次) 验证当前手机号 页面
@Entry
@Component
struct VerifyPhoneNumberPage {
@State phoneContent: string = ''
@State codeContent: string = ''
@State isSubmit: boolean = false //是否可以提交 默认不可以
loginViewModel: LoginViewModel = new LoginViewModel()
@State @Watch('onCodeSend') isCodeSend: boolean = false //验证码点击发送事件
@State pageTitle:string = '验证当前手机号';
@State @Watch('startCount') codeStateSuccess:boolean=false
lastTime: number = 0
@State codeBtnState: boolean = false
@State timeCount: number = 60
isFirst:boolean=true//是否第一次获取验证码
pageShowTime:number = 0;
pageHideTime:number = 0;
onCodeSend() {
if (this.isCodeSend) {
TrackingButton.click("checkingPhoneNumberPageSendVerificationCode",TrackConstants.PageName.Checking_PhoneNum,TrackConstants.PageName.Checking_PhoneNum)
this.sendVerifyCode()
}
}
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
}
onPageHide(): void {
this.pageHideTime = DateTimeUtils.getTimeStamp()
let duration = 0
duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Checking_PhoneNum,TrackConstants.PageName.Checking_PhoneNum,duration)
}
async aboutToAppear(): Promise<void> {
this.phoneContent = await SPHelper.default.get(SpConstants.USER_PHONE,"") as string;
}
@State toastText:string = ""
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
msg: this.toastText,
}),
autoCancel: false,
alignment: DialogAlignment.Center,
customStyle: true,
maskColor:"#00000000"
})
build() {
Column() {
Image($r('app.media.login_back_icon')).width(24).height(24).margin({ left: 15, top: 10 }).onClick(() => {
router.back()
})
Text(this.pageTitle).fontSize(22).fontColor('#333333').fontWeight(FontWeight.Bold).margin({ left: 25, top: 112 })
Column() {
TextInput({ text: this.securityPhone(this.phoneContent) })
.placeholderColor("#CCCCCC")
.fontSize(16)
.height(48)
.maxLength(11)
.margin({ top: 36 })
.backgroundColor("#F5F5F5")
.borderRadius(4)
.enabled(false)
.type(InputType.PhoneNumber)
.onChange((content) => {
this.phoneContent = content
this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 4)
if (content.length >= 11) {
this.codeBtnState = true
} else {
this.codeBtnState = false
}
})
Row() {
TextInput({ text: this.codeContent,placeholder: "验证码" })
.placeholderColor("#CCCCCC")
.layoutWeight(1)
.fontSize(16)
.height(48)
.type(InputType.Number)
.fontColor("#222222")
.backgroundColor("#00000000")
.borderRadius({ topLeft: 4, bottomLeft: 4 })
.onChange((value) => {
this.codeContent = value
this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 4)
})
Text(this.codeStateSuccess ? this.timeCount + "s" : this.isFirst?"发送验证码":'重新获取')
.fontColor(this.codeBtnState?'#ED2800':'#80ED2800')
.width(110)
.fontSize(14)
.fontWeight( FontWeight.Bold)
.height(48)
.textAlign(TextAlign.Center)
.enabled(this.codeStateSuccess?false:true)
.onClick(() => {
if (this.phoneContent.length < 11) {
return
}
let currentTime = DateTimeUtils.getTimeStamp()
if (currentTime - this.lastTime < 500) {
return
}
this.lastTime = currentTime;
this.isCodeSend = true
})
}.margin({ top: 12 })
.height(48)
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Start)
.backgroundImage($r('app.media.code_login_bg'))
.backgroundImageSize({width:'100%',height:48})
}.width('100%').padding({ left: 25, right: 25 })
Row() {
Text("确认")
.layoutWeight(1)
.fontColor(this.isSubmit ?"#FFFFFFFF":"#66FFFFFF")
.borderRadius(4)
.fontSize(18)
.textAlign(TextAlign.Center)
.fontWeight(FontWeight.Medium)
.margin({ top: 26 })
.height(44)
.backgroundColor(this.isSubmit ?"#ED2800":"#99ED2800")
.enabled(this.isSubmit ? true : false)
.onClick(() => {
this.checkVerifyCode()
})
}.padding({ left: 25, right: 25 }).width('100%')
}.width('100%').height('100%').alignItems(HorizontalAlign.Start)
}
//发送验证码
sendVerifyCode() {
if (this.isEmpty(this.phoneContent)) {
return
}
this.loginViewModel.sendVerifyCodeByToken().then(()=>{
this.showToastTip("已发送")
this.codeStateSuccess=true
this.isCodeSend=false
}).catch((message: string)=>{
this.showToastTip(message)
this.codeStateSuccess=false
this.isCodeSend=false
})
}
//校验验证码
checkVerifyCode() {
TrackingButton.click("checkingPhoneNumberPageConfirm",TrackConstants.PageName.Checking_PhoneNum,TrackConstants.PageName.Checking_PhoneNum)
if (!this.isSubmit) {
return
}
if (this.isEmpty(this.phoneContent)) {
return
}
if (this.isEmpty(this.codeContent)) {
return
}
this.loginViewModel.checkVerifyCodeByToken(this.codeContent).then(()=>{
let params: SettingPasswordParams = {
pageID:'1',
phoneContent:this.phoneContent,
codeContent:this.codeContent,
pageType:1
}
WDRouterRule.jumpWithPage(WDRouterPage.settingPasswordPage, params)
}).catch((message: string)=>{
this.showToastTip(message)
})
}
isEmpty(obj: undefined|null|string): boolean {
return (obj == undefined || obj == null || obj == '');
}
showToastTip(msg:string){
this.toastText = msg
this.dialogToast.open()
}
securityPhone(phoneNum:string):string{
let securityNum:string;
let needSecurityString = phoneNum.substring(3, phoneNum.length - 4);
securityNum = phoneNum.replace(needSecurityString,'****')
return securityNum;
}
startCount() {
this.isFirst = false
let time = setInterval(() => {
Logger.debug("倒计时:" + this.timeCount)
this.timeCount--
if (this.timeCount < 1) {
this.codeStateSuccess = false
this.timeCount = 60
clearInterval(time)
}
}, 1000)
}
}
\ No newline at end of file
... ...
... ... @@ -9,6 +9,7 @@
"pages/guide/GuidePages",
"pages/login/OneKeyLoginPage",
"pages/login/ModifyPasswordPage",
"pages/login/ChangeBindPhonePage"
"pages/login/ChangeBindPhonePage",
"pages/login/VerifyPhoneNumberPage"
]
}
\ No newline at end of file
... ...
... ... @@ -2,7 +2,8 @@ export namespace TrackConstants {
export enum EventType {
Show = 0,
Click = 1
Click = 1,
CurrentNumberPanelContentExposure = 2,
}
// 行为类型
... ... @@ -24,7 +25,8 @@ export namespace TrackConstants {
UnSubscribe = "unSubscribe",
CloseInterestCard = "closeInterestCard",
SelectInterestCard = "selectInterestCard",
//电子报当前页曝光
CurrentNumberPanelContentExposure = "current_Number_Panel_content_exposure",
}
// 分享聚道
... ... @@ -208,5 +210,11 @@ export namespace TrackConstants {
///兴趣偏好页
Interest = "preferenceSelectionPage",
//意见反馈
FeedbackPage = 'feedbackPage',
//动态详情
DynamicDetailPage = 'dynamicDetailPage',
//早晚报
NewsPaperPage = 'newsPaperPage',
}
}
\ No newline at end of file
... ...
... ... @@ -22,7 +22,15 @@ export class TrackParamConvert {
static pageCompProgram(pageInfo?: PageInfoDTO, comp?: CompInfoBean, program?: ContentDTO) : ParamType {
let params = TrackingUtils.generateParams()
if (program) {
params["contentType"] = program.objectType
params["contentId"] = program.objectId
params["contentName"] = program.newsTitle
params["channelSourceId"] = program.channelId
params["rmhPlatform"] = program.rmhPlatform
TrackParamConvert.appendRecommend(program, params)
}
//TODO: 转换参数
return params
... ...
... ... @@ -29,6 +29,10 @@ export class TrackingContent {
params["action"] = TrackConstants.ActionType.Show
TrackingUtils.fillPositionWith(params)
Tracking.event("content_exposure", params)
}else if(eventType === TrackConstants.EventType.CurrentNumberPanelContentExposure){
params["action"] = TrackConstants.ActionType.Show
TrackingUtils.fillPositionWith(params)
Tracking.event(TrackConstants.ActionType.CurrentNumberPanelContentExposure, params)
}
}
... ... @@ -82,6 +86,10 @@ export class TrackingContent {
}
static commentClick(pageId: string, pageName: string, extParams?: ParamType) {
TrackingContent.commentClickWithEvent("content_comment_click",pageId,pageName,extParams);
}
static commentClickWithEvent(event: string,pageId: string, pageName: string, extParams?: ParamType) {
let params = TrackingUtils.generateParams(extParams)
if (pageId.length) {
params["pageId"] = pageId
... ... @@ -91,7 +99,7 @@ export class TrackingContent {
}
params["action"] =TrackConstants.ActionType.Comment
TrackingUtils.fillPositionWith(params)
Tracking.event("content_comment_click", params)
Tracking.event(event, params)
}
static commentShare(pageId: string, pageName: string, extParams?: ParamType) {
... ...
... ... @@ -2,7 +2,7 @@ import { ENewspaperPageComponent } from 'wdComponent';
import { DateTimeUtils, Logger } from 'wdKit';
import common from '@ohos.app.ability.common';
import window from '@ohos.window';
import { TrackingPageBrowse } from 'wdTracking/Index';
import { TrackingPageBrowse ,TrackConstants} from 'wdTracking/Index';
const TAG = 'ENewspaper';
... ... @@ -10,8 +10,6 @@ const TAG = 'ENewspaper';
@Component
struct ENewspaper {
pageShowTime:number = 0;
pageId:string = 'newsPaperPage';
pageName:string=this.pageId;
// 获取UIAbility上下文
context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext
... ... @@ -59,7 +57,7 @@ struct ENewspaper {
this.setSystemBar('#FFFFFFFF','#00000000', '#000000')
Logger.info(TAG, 'onPageHide');
//页面浏览
TrackingPageBrowse.trackCommonPageExposureEnd(this.pageId,this.pageName,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
}
onBackPress() {
... ...
... ... @@ -2,15 +2,13 @@ import { DateTimeUtils, Logger } from 'wdKit';
import { DynamicDetailComponent } from 'wdComponent';
import router from '@ohos.router';
import { Params, Action } from 'wdBean';
import { TrackingPageBrowse } from 'wdTracking/Index';
import { TrackingPageBrowse,TrackConstants } 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 = ''
... ... @@ -39,7 +37,7 @@ struct DynamicDetailPage {
}
onPageHide() {
//页面浏览
TrackingPageBrowse.trackCommonPageExposureEnd(this.pageId,this.pageName,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.DynamicDetailPage,TrackConstants.PageName.DynamicDetailPage,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
}
}
\ No newline at end of file
... ...
... ... @@ -4,6 +4,7 @@ import { WDRouterPage } from 'wdRouter';
import { SPHelper } from 'wdKit/Index';
import { SpConstants } from 'wdConstant/Index';
import { ButtonOptions, promptAction } from '@kit.ArkUI';
import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index';
@Entry
@Component
... ... @@ -34,6 +35,8 @@ struct LaunchInterestsHobbiesPage {
//直接跳过到首页
//跳转首页
WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
this.trackingLaunchJumpOver(false)
})
}
.width('100%')
... ... @@ -148,6 +151,9 @@ struct LaunchInterestsHobbiesPage {
this.saveTagIds()
//跳转首页
WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
this.trackingLaunchJumpOver(true)
})
}
.width('100%')
... ... @@ -185,4 +191,17 @@ struct LaunchInterestsHobbiesPage {
}
SPHelper.default.saveSync(SpConstants.PUBLICVISUTORMODE_INTERESTTAGS,tags)
}
trackingLaunchJumpOver(selectOrJump:boolean){
let tags = SPHelper.default.getSync(SpConstants.PUBLICVISUTORMODE_INTERESTTAGS,'') as string
let action = selectOrJump?TrackConstants.ActionType.SelectInterestCard:TrackConstants.ActionType.CloseInterestCard
let pageParam: ParamType = {
'interestContentOptions':tags,
'itemId':tags,
'action':action,
'sceneId':'9999',
'cnsTraceId':'selfHold',
}
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Interest,TrackConstants.PageName.Interest,pageParam)
}
}
\ No newline at end of file
... ...