Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
zhenghy
2024-05-24 18:16:06 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
719e491022ba3bcd1c3ed95c98028156f3ec8f27
719e4910
2 parents
718b84d5
4350677f
Merge remote-tracking branch 'origin/main'
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
613 additions
and
528 deletions
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperItemComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/FeedBackActivity.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card20Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhCarouselLayout01.ets
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchResultContentComponent.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/PlayUIComponent.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/TopPlayComponet.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/vertical/PictureLoading.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/vertical/PlayerComponent.ets
sight_harmony/features/wdLogin/Index.ets
sight_harmony/features/wdLogin/src/main/ets/pages/login/ForgetPasswordPage.ets
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginInputComponent.ets
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginPage.ets
sight_harmony/features/wdLogin/src/main/ets/pages/login/ModifyPasswordPage.ets
sight_harmony/features/wdLogin/src/main/ets/pages/login/SettingPasswordLayout.ets
sight_harmony/features/wdLogin/src/main/ets/pages/login/SettingPasswordPage.ets
sight_harmony/features/wdLogin/src/main/ets/pages/login/VerifyPhoneNumberPage.ets
sight_harmony/features/wdLogin/src/main/resources/base/profile/main_pages.json
sight_harmony/features/wdTracking/src/main/ets/common/TrackConstants.ets
sight_harmony/features/wdTracking/src/main/ets/tracking/TrackingContent.ets
sight_harmony/products/phone/src/main/ets/pages/ENewspaper.ets
sight_harmony/products/phone/src/main/ets/pages/detail/DynamicDetailPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
View file @
719e491
...
...
@@ -49,6 +49,7 @@ const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
/**
* 动态详情页UI
* @author wd-zsz
* */
// @Preview
...
...
@@ -533,6 +534,8 @@ export struct DynamicDetailComponent {
}
//点赞操作
this.toggleLikeStatus()
//内容点赞/取消点赞埋点
})
// 评论
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperItemComponent.ets
View file @
719e491
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
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperPageComponent.ets
View file @
719e491
...
...
@@ -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,
})
})
}
...
...
@@ -316,6 +339,14 @@ export struct ENewspaperPageComponent {
}
if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
this.isOpenListDialog = true
//电子报--读报纸点击
TrackingContent.commentClickWithEvent('read_newspaper_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
,{
'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,
'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,
'currentPanelDate':this.selectDate.toDateString(),
'currentNumber':this.swiperIndex,
})
}else {
ToastUtils.showToast('暂无数据', 1000)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/FeedBackActivity.ets
View file @
719e491
...
...
@@ -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 { Track
Constants, TrackingButton, Track
ingPageBrowse } 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.pageNam
e,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
TrackingPageBrowse.trackCommonPageExposureEnd(
TrackConstants.PageName.FeedbackPage,TrackConstants.PageName.FeedbackPag
e,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
View file @
719e491
...
...
@@ -67,6 +67,7 @@ export struct MorningEveningPaperComponent {
// 顶部安全高度赋值
@State topSafeHeight: number = 0;
@State bottomSafeHeight: number = 0;
@State isHasTopView: boolean = false;
private audioDataList: AudioDataList[] = []
private playerController: WDPlayerController = new WDPlayerController();
...
...
@@ -145,7 +146,9 @@ export struct MorningEveningPaperComponent {
Logger.info(TAG, "pageInfoBean dateTime = " + dateTime)
Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle)
this.setComponentBgColor(this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string)
this.isHasTopView = this.pageInfoBean?.topicInfo?.frontLinkObject?true:false
let coverUrl = this.isHasTopView?this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string :''
this.setComponentBgColor(coverUrl)
let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId)
// this.compInfoBean = compInfoBean
...
...
@@ -202,11 +205,9 @@ export struct MorningEveningPaperComponent {
// const pixelMap: image.PixelMap = await image2PixelMap(item.icon);
Logger.debug(TAG, "compInfoBean compStyle = " + imageUrl)
if (imageUrl.length > 0 && this.pageInfoBean.topicInfo.frontFlag === 1) {
const imageSource: image.ImageSource | undefined = await getPicture(imageUrl)
if (imageSource && this.pageInfoBean.topicInfo.frontFlag === 1) {
this.pickColor(imageSource)
} else {
if (this.pageInfoBean.topicInfo.topicPattern === 1) {
this.mixedBgColor = '#66BDBD'
...
...
@@ -271,15 +272,21 @@ export struct MorningEveningPaperComponent {
}
}
.height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`).scrollBar(BarState.Off)
.onAreaChange((oldValue: Area, newValue: Area) => {
let persent = Math.abs(Number(newValue.globalPosition.y)) / 150
if (persent > 1) {
persent = 1
}
})
PaperTitleComponent().margin({top:this.
topSafeHeight}
)
PaperTitleComponent().margin({top:this.
isHasTopView?this.topSafeHeight:0}).backgroundColor(this.mixedBgColor).opacity(this.isHasTopView?0:1
)
}
.width('100%')
.height('100%')
// .padding({
// top: this.topSafeHeight,
.padding({
top: this.isHasTopView?0:this.topSafeHeight,
// bottom: this.bottomSafeHeight
//
})
})
// .backgroundColor(Color.Black)
// .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black)
.backgroundColor(this.mixedBgColor ?? Color.Black)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card20Component.ets
View file @
719e491
...
...
@@ -97,13 +97,14 @@ struct createImg {
@State loadImg: boolean = false;
async aboutToAppear(): Promise<void> {
console.log("createImg", JSON.stringify(this.contentDTO.fullColumnImgUrls))
this.loadImg = await onlyWifiLoadImg();
}
build() {
GridRow() {
if (this.contentDTO.fullColumnImgUrls[0].landscape === 1
|| this.contentDTO.fullColumnImgUrls[0].weight > this.contentDTO.fullColumnImgUrls[0].height
) {
if (this.contentDTO.fullColumnImgUrls[0].landscape === 1) {
// 横屏
GridCol({
span: { xs: 12 }
...
...
@@ -131,6 +132,7 @@ struct createImg {
.backgroundColor(0xf5f5f5)
.width(CommonConstants.FULL_WIDTH)
.borderRadius($r('app.float.image_border_radius'))
.aspectRatio(172 / 230)
CardMediaInfo({ contentDTO: this.contentDTO })
}
.align(Alignment.BottomEnd)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhCarouselLayout01.ets
View file @
719e491
import { CompDTO, ContentDTO
,
} from 'wdBean';
import { CompDTO, ContentDTO } from 'wdBean';
import { BreakpointConstants, CommonConstants } from 'wdConstant';
import { BreakPointType, Logger } from 'wdKit';
import { CompUtils } from '../../utils/CompUtils';
...
...
@@ -11,6 +11,7 @@ import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Zh_Carousel_Layout-01';
/**
* 轮播组件,即Banner/轮播大图/焦点图/自动滑动
* 样式:
...
...
@@ -47,9 +48,11 @@ export struct ZhCarouselLayout01 {
@StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string =
BreakpointConstants.BREAKPOINT_XS;
@State compDTO: CompDTO = {} as CompDTO
@State firstWd: number = 0
@State SecondWd: number = 0
@State swiperIndex: number = 0
private data: MyDataSource = new MyDataSource([])
watchCurrentBreakpoint() {
...
...
@@ -75,6 +78,7 @@ export struct ZhCarouselLayout01 {
}
build() {
if (this.compDTO?.operDataList?.length) {
Stack() {
Swiper() {
...
...
@@ -206,9 +210,19 @@ struct CarouselLayout01CardView {
Blank()
// 文本信息
Stack() {
if
(this.item.objectType == '5' || this.item.objectType == '6')
{
if
(this.item.objectType == '5')
{
Notes({ objectType: this.item.objectType })
} else {
if (this.item.seoTags) {
Notes({ newTags: this.item.seoTags })
}
if (this.item.newTags) {
Notes({ newTags: this.item.newTags })
}
}
// if (this.item.objectType == '5' || this.item.objectType == '6') {
// Notes({ objectType: this.item.objectType })
// }
Text(`${this.item.corner}${this.item.newsTitle}`)
.width(CommonConstants.FULL_PARENT)
.fontColor(Color.White)
...
...
@@ -218,7 +232,10 @@ struct CarouselLayout01CardView {
.align(Alignment.Bottom)
.maxLines(CompUtils.MAX_LINES_2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.textIndent(this.item.objectType == '5' ? 35 : 0)
.textIndent((this.item.newTags?.length || this.item.seoTags?.length) > 2 &&
(this.item.newTags?.length ||this.item.seoTags?.length) < 5 ? 58 :
((this.item.newTags?.length > 0 || this.item.seoTags?.length > 0) ||this.item.objectType == '5') ? 35 :
0 )
}
// .height(39)
.padding({
...
...
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchResultContentComponent.ets
View file @
719e491
...
...
@@ -190,12 +190,20 @@ export struct SearchResultContentComponent {
})
let isRemain : boolean = false
SearcherAboutDataModel.getCreatorDetailListData({creatorIdList:creatorIdList}).then((rem) => {
resultData.list.forEach((value) => {
resultData.list.forEach((value: SearchResultContentItem) => {
const landscape = value.data.landscape
let photos: FullColumnImgUrlDTO[] = []
// if (value.data.appStyle === 4) {
value.data.appStyleImages.split("&&").forEach((value) => {
const resizeParams = this.extractResizeParams(value)
photos.push({ fullUrl: value,weight:resizeParams.width,height:resizeParams.height, } as FullColumnImgUrlDTO)
photos.push(
{
fullUrl: value,
weight:resizeParams.width,
height:resizeParams.height,
landscape: Number(landscape),
} as FullColumnImgUrlDTO
)
})
// }
let contentDTO = this.dataTransform(rem,value, photos);
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
View file @
719e491
...
...
@@ -38,6 +38,7 @@ export struct DetailPlayLivePage {
aboutToAppear(): void {
Logger.info(TAG, `wyj-aboutToAppear`)
this.listener?.on("change", (mediaQueryResult) => {
Logger.info(TAG, `change;${mediaQueryResult.matches}`)
if (mediaQueryResult?.matches) {
...
...
@@ -85,6 +86,7 @@ export struct DetailPlayLivePage {
}
.height('100%')
.width('100%')
// 设置底部绘制延伸到导航条
}
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/PlayUIComponent.ets
View file @
719e491
...
...
@@ -21,6 +21,8 @@ export struct PlayUIComponent {
@State isPlayStatus: boolean = true
@Consume displayDirection: DisplayDirection
@Prop isShowBottom: boolean
onChangeMenuVisible() {
if (!this.liveDetailsBean || !this.liveDetailsBean.liveInfo ||
this.liveDetailsBean?.liveInfo?.liveState === 'wait') {
...
...
@@ -59,8 +61,11 @@ export struct PlayUIComponent {
if (this.liveDetailsBean && this.liveDetailsBean.liveInfo) {
this.getTopUIComponent()
this.getMiddleUIComponent()
if(this.isShowBottom){
this.getBottomUIComponent()
}
}
}
.width('100%')
.height('100%')
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/TopPlayComponet.ets
View file @
719e491
import { LiveDetailsBean } from 'wdBean/Index';
import { StringUtils } from 'wdKit/Index';
import { WDAliPlayerController, WDPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index';
import {
PlayerConstants,
WDAliPlayerController, WDPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index';
import { PlayUIComponent } from './PlayUIComponent';
import { Logger } from 'wdKit/Index';
import { PictureLoading } from '../../vertical/PictureLoading';
const TAG: string = 'TopPlayComponent'
...
...
@@ -16,13 +17,37 @@ export struct TopPlayComponent {
@State isWait: boolean = false
//已结束直播
@State isEnd: boolean = false
//播放错误
@State isError: boolean = false
// loading 控制字段
@State isLoading: boolean = false
// 获取播放资源能播放了
@State isCanPlay: boolean = false
private playUrl: string = ""
private xComponentIsLoaded: boolean = false
aboutToAppear(): void {
if (this.playerController) {
this.playerController.onCanplay = () => {
this.isCanPlay = true
this.isLoading = true
this.playerController?.play()
}
this.playerController.onStatusChange = (status: number) => {
if (status === PlayerConstants.STATUS_ERROR) {
this.isError = true
this.isLoading = true
this.isCanPlay = false
} else {
this.isError = false
}
}
}
this.updateData()
...
...
@@ -39,6 +64,9 @@ export struct TopPlayComponent {
Logger.debug(TAG, 'ok-' + `${this.imgUrl}`)
}
this.isWait = this.liveDetailsBean?.liveInfo?.liveState == 'wait'
if(this.isWait ){
this.isLoading = true
}
this.isEnd = this.liveDetailsBean?.liveInfo?.liveState === 'end' &&
StringUtils.isEmpty(this.liveDetailsBean?.liveInfo?.vlive[0]?.replayUri)
if (!this.isWait && this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.vlive.length > 0) {
...
...
@@ -74,6 +102,8 @@ export struct TopPlayComponent {
WDPlayerRenderLiveView({
playerController: this.playerController,
onLoad: async () => {
this.isLoading = false
this.isError = false
this.xComponentIsLoaded = true
this.tryToPlay()
}
...
...
@@ -81,18 +111,56 @@ export struct TopPlayComponent {
.height('100%')
.width('100%')
.visibility(this.isWait ? Visibility.None : Visibility.Visible)
Image(this.imgUrl)
.objectFit(ImageFit.Cover)
.visibility(this.isWait || this.isEnd ? Visibility.Visible : Visibility.None)
.contrast(this.isEnd ? 0.2 : 1)
.width('100%')
PlayUIComponent({ playerController: this.playerController })
PictureLoading().visibility(this.isLoading ? Visibility.None : Visibility.Visible)
// 视频播放器上的控制面板和信息
PlayUIComponent({ playerController: this.playerController, isShowBottom: this.isCanPlay })
Text('直播已结束')
.fontSize('20fp')
.fontWeight(500)
.fontColor(Color.White)
.visibility(this.isEnd ? Visibility.Visible :
Visibility.None)
Column() {
Text('直播加载中,请稍候重试')
.fontSize('20fp')
.fontWeight(500)
.margin({ top: 16 })
.fontColor(Color.White)
Button('点击重试')
.type(ButtonType.Normal)
.width(80)
.height(28)
.backgroundColor(Color.Transparent)
.fontColor('#ffcccccc')
.border({ width: 1 })
.borderColor('#4dffffff')
.borderRadius(4)
.fontSize($r('app.float.font_size_12'))
.margin({ top: 16 })
.padding(0)
.onClick(() => {
this.isLoading = false
this.isError = false
this.xComponentIsLoaded = true
this.tryToPlay()
})
}.width('100%').visibility(this.isError ? Visibility.Visible :
Visibility.None)
}
.width('100%')
.alignSelf(ItemAlign.Center)
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/vertical/PictureLoading.ets
View file @
719e491
...
...
@@ -13,6 +13,11 @@ export struct PictureLoading {
Logger.info(TAG, 'pictures preview')
}
aboutToDisappear(): void {
Logger.info(TAG, 'aboutToDisappear')
}
build() {
Row() {
Image(this.imagePath)
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/vertical/PlayerComponent.ets
View file @
719e491
...
...
@@ -79,6 +79,7 @@ export struct PlayerComponent {
playerController: this.playerController,
onLoad: () => {
this.isCanplay = true
console.error('WDAliPlayerController','------1------------')
this.playerController?.firstPlay(this.playUrl);
}
}).margin({ top: 195 }).height(211)
...
...
sight_harmony/features/wdLogin/Index.ets
View file @
719e491
export { add } from "./src/main/ets/utils/Calc"
export { SettingPasswordParams } from "./src/main/ets/pages/login/SettingPassword
Layout
"
export { SettingPasswordParams } from "./src/main/ets/pages/login/SettingPassword
Page
"
export { LoginModule } from './src/main/ets/LoginModule'
\ No newline at end of file
...
...
sight_harmony/features/wdLogin/src/main/ets/pages/login/ForgetPasswordPage.ets
View file @
719e491
...
...
@@ -3,7 +3,7 @@ import { LoginInputComponent } from './LoginInputComponent'
import { LoginViewModel } from './LoginViewModel'
import router from '@ohos.router'
import { WDRouterRule, WDRouterPage } from 'wdRouter';
import { SettingPasswordParams } from './SettingPassword
Layout
'
import { SettingPasswordParams } from './SettingPassword
Page
'
import { Router } from '@ohos.arkui.UIContext'
import { CustomToast, EmitterEventId, EmitterUtils, NetworkUtil, SPHelper, StringUtils, ToastUtils } from 'wdKit/Index'
import { SpConstants } from 'wdConstant/Index'
...
...
@@ -22,7 +22,6 @@ 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、设置->重置密码 3、设置->更换手机号页面2(不知道是啥)
phone:string = (router.getParams() as Record<string, number>)['phone'] + ""; //登录 密码登录 填写手机号 点击忘记密码 带过来手机号
@State pageTitle:string = '找回密码';
@State codeStateSuccess:boolean=false
...
...
@@ -57,7 +56,7 @@ struct ForgetPasswordPage {
codeContent: $codeContent,
isSubmit: $isSubmit,
isCodeSend: $isCodeSend,
pageType:
this.pageType
,
pageType:
0
,
codeStateSuccess:$codeStateSuccess
})
Row() {
...
...
@@ -81,22 +80,9 @@ struct ForgetPasswordPage {
}
aboutToAppear() {
if (router.getParams()) {
let params = router.getParams() as Record<string, number>
this.pageType = params['pageType']
Logger.info(TAG, 'params.contentID:' + params.contentID);
}
if (this.pageType == 0){
this.pageTitle = '找回密码'
if(StringUtils.isNotEmpty(this.phone) && this.phone.indexOf("****") === -1){
this.phoneContent = this.phone
}
}else if (this.pageType == 1){
this.pageTitle = '验证当前手机号'
}
if (this.isCodeSend) {
this.sendVerifyCode()
}
}
//发送验证码
...
...
@@ -105,20 +91,7 @@ struct ForgetPasswordPage {
return
}
if(this.pageType == 1){
this.loginViewModel.sendVerifyCodeByToken().then(()=>{
this.showToastTip("已发送")
this.codeStateSuccess=true
this.isCodeSend=false
}).catch((message: string)=>{
this.showToastTip(message)
this.codeStateSuccess=false
this.isCodeSend=false
})
return
}
if(this.pageType == 0 && this.phoneContent.indexOf("****")!=-1){
if(this.phoneContent.indexOf("****")!=-1){
//设置密码 忘记密码跳转过来的 需要使用上面方法
this.loginViewModel.sendVerifyCodeByToken().then(()=>{
this.showToastTip("已发送")
...
...
@@ -168,22 +141,8 @@ struct ForgetPasswordPage {
if (this.isEmpty(this.codeContent)) {
return
}
if(this.pageType == 1){
this.loginViewModel.checkVerifyCodeByToken(this.codeContent).then(()=>{
let params: SettingPasswordParams = {
pageID:'1',
phoneContent:this.phoneContent,
codeContent:this.codeContent,
pageType:this.pageType
}
WDRouterRule.jumpWithPage(WDRouterPage.settingPasswordPage, params)
}).catch((message: string)=>{
this.showToastTip(message)
})
return
}
if(this.p
ageType == 0 && this.p
honeContent.indexOf("****")!=-1){
if(this.phoneContent.indexOf("****")!=-1){
this.loginViewModel.checkVerifyCodeByToken(this.codeContent).then(()=>{
let params: SettingPasswordParams = {
pageID:'1',
...
...
@@ -203,7 +162,7 @@ struct ForgetPasswordPage {
pageID:'1',
phoneContent:this.phoneContent,
codeContent:this.codeContent,
pageType:
this.pageType
pageType:
0
}
WDRouterRule.jumpWithReplacePage(WDRouterPage.settingPasswordPage, params)
...
...
@@ -218,53 +177,6 @@ struct ForgetPasswordPage {
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()
...
...
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginInputComponent.ets
View file @
719e491
...
...
@@ -10,7 +10,7 @@ export struct LoginInputComponent {
@Link isCodeSend: boolean //验证码控件是否点击 默认没有 发送接口
@Link isSubmit: boolean //是否可以提交
isFirst:boolean=true//是否第一次获取验证码
pageType?:number; //0、登录->忘记密码
3、设置->更换手机号页面2
pageType?:number; //0、登录->忘记密码
lastTime: number = 0
@Link @Watch('startCount') codeStateSuccess: boolean //验证码获取成功与否回调 成功显示倒计时
@Watch('onCheckChange') @Prop protocolState: boolean = false //协议勾选状态
...
...
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginPage.ets
View file @
719e491
...
...
@@ -177,11 +177,10 @@ struct LoginPage {
.onClick(() => {
TrackingButton.click("loginPageForgotPassword",TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page)
if(StringUtils.isNotEmpty(this.accountContent) && StringUtils.photoMatch(this.accountContent)){
let pageType = { 'p
ageType': 0, 'p
hone': Number(this.accountContent) } as Record<string, number>;
let pageType = { 'phone': Number(this.accountContent) } as Record<string, number>;
WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType)
}else{
let pageType = { 'pageType': 0 } as Record<string, number>;
WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType)
WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage)
}
})
}
...
...
sight_harmony/features/wdLogin/src/main/ets/pages/login/ModifyPasswordPage.ets
View file @
719e491
...
...
@@ -166,8 +166,7 @@ struct ModifyPasswordPage {
Column() {
Text("忘记密码").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:'10lpx'})
.onClick(()=>{
let pageType = { 'pageType': 0 } as Record<string, number>;
WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType)
WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage)
})
}
.width('100%')
...
...
sight_harmony/features/wdLogin/src/main/ets/pages/login/SettingPasswordLayout.ets
deleted
100644 → 0
View file @
718b84d
import ArrayList from '@ohos.util.ArrayList';
import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/Index';
import router from '@ohos.router';
import { LoginViewModel } from './LoginViewModel';
import { CustomToast, Logger, SPHelper, ToastUtils } from 'wdKit';
import {
SpConstants
} from '../../../../../../../commons/wdNetwork/oh_modules/wdConstant/src/main/ets/constants/SpConstants'
import data_preferences from '@ohos.data.preferences';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
const TAG = "SettingPasswordLayout"
export interface SettingPasswordParams {
pageID: string;
phoneContent?: string;
codeContent?: string;
tempToken?:string;
pageType?:number; //0、登录->忘记密码 1、设置->重置密码 2、设置->更换手机号页面1 3、设置->更换手机号页面2
}
export default class AccoutPageDataModel {
// 页面数据
compType: number // 0:标题 / 1:密码输入框 / 2:验证码输入框 / 3:desc描述 / 4:按钮 / 5:logo / 6:子标题 7:手机号输入框 7:空白
compLogo: string
compTitle: string
compSubTitle: string = '';
compDesc: string
compButtonTitle: string
inputPlacholder: string
inputTag: number
constructor(compType: number, compTitle: string, compLogo: string, compDesc: string, compButtonTitle: string, inputPlacholder: string, inputTag: number) {
this.compType = compType
this.compTitle = compTitle
this.compLogo = compLogo
this.compDesc = compDesc
this.compButtonTitle = compButtonTitle
this.inputPlacholder = inputPlacholder
this.inputTag = inputTag
}
}
@Entry
@Component
export struct SettingPasswordLayout {
@State listData: Array<AccoutPageDataModel> = new Array(); // 页面配置数据
@State btnStatus: boolean = false;
pageId:number = 0;
phoneContent:string = '';
codeContent:string = '';
tempToken:string = '';
password01: string = '';
password02: string = '';
passwordOri: string = '';
loginViewModel = new LoginViewModel()
pageType?:number; //0、登录->忘记密码 1、设置->重置密码 2、设置->更换手机
@State toastText:string = ""
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
msg: this.toastText,
}),
autoCancel: false,
alignment: DialogAlignment.Center,
customStyle: true,
maskColor:"#00000000"
})
aboutToAppear() {
let params:SettingPasswordParams = router.getParams() as SettingPasswordParams;
this.pageId = parseInt(params.pageID);
this.getPageListData(this.pageId)
this.phoneContent = params.phoneContent!;
this.codeContent = params.codeContent!;
this.pageType = params.pageType;
}
getPageListData(pageId:number) {
switch (pageId) {
case 0:
// 验证/更换手机号
this.listData.push(new AccoutPageDataModel(0, '更换手机号', '', '', '', '', 0))
this.listData.push(new AccoutPageDataModel(7, '', '', '', '', '请输入手机号', 10010))
this.listData.push(new AccoutPageDataModel(2, '', '', '', '', '验证码', 10088))
this.listData.push(new AccoutPageDataModel(4, '', '', '', '确认', '', 0))
break;
case 1:
// 设置密码
this.listData.push(new AccoutPageDataModel(0, '设置密码', '', '', '', '', 0))
this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请输入密码', 10086))
this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '再次输入密码', 10087))
this.listData.push(new AccoutPageDataModel(3, '', '', '提示:密码长度6~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上', '', '', 0))
this.listData.push(new AccoutPageDataModel(4, '', '', '', '确认', '', 0))
break;
case 2:
// 修改密码
this.listData.push(new AccoutPageDataModel(0, '修改密码', '', '', '', '', 0))
this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请输入原密码', 10010))
this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请输入新密码', 10086))
this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请再请输入原密码', 10087))
this.listData.push(new AccoutPageDataModel(3, '', '', '提示:密码长度6~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上', '', '', 0))
this.listData.push(new AccoutPageDataModel(4, '', '', '', '确认', '', 0))
this.listData.push(new AccoutPageDataModel(3, '', '', '忘记密码', '', '', 0))
break;
case 3:
// 绑定手机号
this.listData.push(new AccoutPageDataModel(0, '绑定手机号', '', '', '', '', 0))
this.listData.push(new AccoutPageDataModel(7, '', '', '', '', '请输入手机号', 10010))
this.listData.push(new AccoutPageDataModel(2, '', '', '', '', '验证码', 10088))
this.listData.push(new AccoutPageDataModel(4, '', '', '', '确认', '', 0))
break;
case 4:
// 有logo的
this.listData.push(new AccoutPageDataModel(5, '', '', '', '', '' , 0))
this.listData.push(new AccoutPageDataModel(0, '修改密码', '', '', '', '', 0))
this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请输入原密码', 10010))
this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请输入新密码', 10086))
this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请再请输入原密码', 10087))
this.listData.push(new AccoutPageDataModel(2, '', '', '', '', '验证码', 10088))
this.listData.push(new AccoutPageDataModel(3, '', '', '提示:密码长度6~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上', '', '', 0))
this.listData.push(new AccoutPageDataModel(4, '', '', '', '确认', '', 0))
this.listData.push(new AccoutPageDataModel(3, '', '', '忘记密码', '', '', 0))
break;
default:
break;
}
}
build() {
Navigation() {
this.settingList() //滑动区域
}.titleMode(NavigationTitleMode.Mini)
.title('')
}
// 页面布局
@Builder settingList() {
Column() {
List() {
ForEach(this.listData, (item: AccoutPageDataModel, index: number) => {
ListItem() {
if (item.compType == 0) {
this.getTitleCell(item, HorizontalAlign.Start)
} else if (item.compType == 1) {
this.getPasswordCell(item)
} else if (item.compType == 2) {
this.getCodeCell(item)
} else if (item.compType == 3) {
if (index == this.listData.length - 1) {
this.getDescCell(item, HorizontalAlign.Center)
} else {
this.getDescCell(item, HorizontalAlign.Start)
}
} else if (item.compType == 4) {
this.getButtonCell(item)
} else if (item.compType == 5) {
this.getLogoCell(item)
} else if (item.compType == 7) {
this.getPhoneCell(item)
} else {
Text('' + item.compType)
}
}
})
}
// .divider({
// strokeWidth: 1,
// startMargin: 15,
// endMargin: 10,
// color: '#f0f0f0'
// })
}.width('100%').padding('30lpx')
}
/***************************** UI元素 ******************************************/
// 标题
@Builder getTitleCell(item: AccoutPageDataModel, alignTitle: HorizontalAlign) {
Column() {
Text(item.compTitle).fontWeight(FontWeight.Bold).fontSize(20).maxLines(1)
}
.width('100%')
.height('75lpx')
.alignItems(alignTitle)
}
// 密码输入框
@Builder getPasswordCell(item: AccoutPageDataModel) {
Row() {
Row() {
TextInput({ placeholder: item.inputPlacholder })
.placeholderColor("#CCCCCC")
.passwordIcon({onIconSrc:$r("app.media.login_password_on"),offIconSrc:$r("app.media.login_password_off")})
.type(InputType.Password)
.showPasswordIcon(true)
.backgroundColor('#00000000')
.onChange((value: string) => {
this.inputTextChange(value, item.inputTag)
})
.onSubmit((EnterKeyType) => {
this.showToastTip('submit')
})
}
.alignItems(VerticalAlign.Center)
.height('80lpx')
.backgroundColor('#f5f5f5')
.borderRadius('4vp')
}
.width('100%')
.height('110lpx')
.backgroundColor(0xffffff0)
.alignItems(VerticalAlign.Center)
}
// 手机号输入框
@Builder getPhoneCell(item: AccoutPageDataModel) {
Row() {
Row() {
TextInput({ placeholder: item.inputPlacholder })
.placeholderColor("#CCCCCC")
.backgroundColor('#00000000')
.onChange((value: string) => {
this.inputTextChange(value, item.inputTag)
})
.onSubmit((EnterKeyType) => {
this.showToastTip('submit')
})
}
.alignItems(VerticalAlign.Center)
.height('80lpx')
.backgroundColor('#f5f5f5')
.borderRadius('4vp')
}
.width('100%')
.height('110lpx')
.backgroundColor(0xffffff0)
.alignItems(VerticalAlign.Center)
}
// 验证码码输入框
@Builder getCodeCell(item: AccoutPageDataModel) {
Row() {
Stack() {
Image($r('app.media.get_code_bg')).width('100%').borderRadius('4vp')
Row() {
TextInput({ placeholder: item.inputPlacholder })
.placeholderColor("#CCCCCC")
.backgroundColor('#00000000')
.width('67.28%')
.onChange((value: string) => {
this.inputTextChange(value, item.inputTag)
})
Button('发送验证码')
.width('32.71%')
.backgroundColor('#00000000')
.fontColor('#da3e22')
}
.width('100%')
}.height('80lpx')
}
.width('100%')
.height('110lpx')
.backgroundColor(0xffffff0)
.alignItems(VerticalAlign.Center)
}
// desc
@Builder getDescCell(item: AccoutPageDataModel, alignTitle: HorizontalAlign) {
Column() {
Text(item.compDesc).fontSize(12).maxLines(3).fontColor(0x999999).padding({top:'10lpx'})
.onClick(()=>{
if (item.compDesc == '忘记密码') {
this.showToastTip('密码不符合密码规范')
}
})
}
.width('100%')
.height('85lpx')
.alignItems(alignTitle)
}
// 按钮
@Builder getButtonCell(item: AccoutPageDataModel) {
Row() {
Button(item.compButtonTitle, { type: ButtonType.Normal, stateEffect: true })
.width('100%')
.height('80lpx')
.backgroundColor(this.btnStatus ? '#da3e22' : '#e5856d')
.fontColor('#fff')
.borderRadius('4vp')
.onClick(() => {
this.buttonClick()
})
}
.padding({top:'25lpx'})
.alignItems(VerticalAlign.Center)
.width('100%')
.height('120lpx')
}
// 标题
@Builder getLogoCell(item: AccoutPageDataModel) {
Column() {
Image(item.compLogo).height('150lpx').width('150lpx')
}
.width('100%')
.height('200lpx')
}
/***************************** 事件处理 ******************************************/
// 提交按钮点击事件
async buttonClick() {
if (this.btnStatus) {
// 需要+手机号校验
if (this.password01.length < 6 || this.password01.length > 20) {
this.showToastTip('密码不符合密码规范')
return
}
if (this.password01 != this.password02) {
this.showToastTip('两次输入的密码不一致,请重新输入')
return
}
if(this.pageId == 1){ //设置密码
SPHelper.default.get(SpConstants.USER_TEMP_TOKEN, '').then((str) => {
this.loginViewModel.forgotPassword(this.password01, str.toString()).then((data =>{
if (this.pageType == 0) {//登录页
this.showToastTip("修改成功")
router.back({
url: `${WDRouterPage.getLoginBundleInfo()}`
})
}else if(this.pageType == 1){//设置
let params: Params = {
pageID: 'AccountAndSecurityLayout'
}
this.showToastTip("修改成功")
router.back({
params:params,
url: `${WDRouterPage.getSettingBundleInfo()}`
})
// WDRouterRule.jumpWithPage(WDRouterPage.settingPage, params)
}
}))
.catch((err: string) => {
this.showToastTip(err)
});
}).catch((err: string) => {
this.showToastTip(err)
Logger.error(TAG, 'catch err:' + JSON.stringify(err));
});
}
}
}
// 输入框数据变动:输入数据处理
inputTextChange(text: string, tag: number) {
if (tag == 10086) {
this.password01 = text;
} else if (tag == 10087) {
this.password02 = text;
} else {
this.passwordOri = text;
}
if (this.password01) {
if ((this.password01.length >= 6 && this.password01.length <= 20) && (this.password02.length >= 6 && this.password02.length <= 20)) {
this.btnStatus = true;
} else {
this.btnStatus = false;
}
}
}
showToastTip(msg:string){
this.toastText = msg
this.dialogToast.open()
}
}
sight_harmony/features/wdLogin/src/main/ets/pages/login/SettingPasswordPage.ets
View file @
719e491
import { SettingPasswordLayout } from './SettingPasswordLayout';
import ArrayList from '@ohos.util.ArrayList';
import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/Index';
import router from '@ohos.router';
import { LoginViewModel } from './LoginViewModel';
import { CustomToast, DateTimeUtils, Logger, SPHelper, ToastUtils } from 'wdKit';
import {
SpConstants
} from '../../../../../../../commons/wdNetwork/oh_modules/wdConstant/src/main/ets/constants/SpConstants'
import data_preferences from '@ohos.data.preferences';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index';
const TAG = "SettingPasswordLayout"
export interface SettingPasswordParams {
pageID: string;
phoneContent?: string;
codeContent?: string;
tempToken?:string;
pageType?:number; //0、登录->忘记密码 1、设置->重置密码
}
export default class AccoutPageDataModel {
// 页面数据
compType: number // 0:标题 / 1:密码输入框 / 2:验证码输入框 / 3:desc描述 / 4:按钮 / 5:logo / 6:子标题 7:手机号输入框 7:空白
compLogo: string
compTitle: string
compSubTitle: string = '';
compDesc: string
compButtonTitle: string
inputPlacholder: string
inputTag: number
constructor(compType: number, compTitle: string, compLogo: string, compDesc: string, compButtonTitle: string, inputPlacholder: string, inputTag: number) {
this.compType = compType
this.compTitle = compTitle
this.compLogo = compLogo
this.compDesc = compDesc
this.compButtonTitle = compButtonTitle
this.inputPlacholder = inputPlacholder
this.inputTag = inputTag
}
}
@Entry
@Component
struct SettingPasswordPage {
@State message: string = 'Hello World'
export struct SettingPasswordPage {
@State listData: Array<AccoutPageDataModel> = new Array(); // 页面配置数据
@State btnStatus: boolean = false;
pageId:number = 0;
phoneContent:string = '';
codeContent:string = '';
tempToken:string = '';
password01: string = '';
password02: string = '';
passwordOri: string = '';
loginViewModel = new LoginViewModel()
pageType?:number; //0、登录->忘记密码 1、设置->重置密码
@State toastText:string = ""
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
msg: this.toastText,
}),
autoCancel: false,
alignment: DialogAlignment.Center,
customStyle: true,
maskColor:"#00000000"
})
pageShowResetTime:number = 0;
pageHideResetTime:number = 0;
pageShowSetTime:number = 0;
pageHideSetTime:number = 0;
onPageShow(): void {
if (this.pageType === 0){//重置密码
this.pageShowResetTime = DateTimeUtils.getTimeStamp()
}else{
this.pageShowSetTime = DateTimeUtils.getTimeStamp()
}
}
onPageHide(): void {
if (this.pageType === 0){
this.pageHideResetTime = DateTimeUtils.getTimeStamp()
}else{
this.pageHideSetTime = DateTimeUtils.getTimeStamp()
}
let duration = 0
if(this.pageType === 0){
duration = Math.floor((this.pageHideResetTime - this.pageShowResetTime)/1000)
}else{
duration = Math.floor((this.pageHideSetTime - this.pageShowSetTime)/1000)
}
if(this.pageType === 0){
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Reset_Password,TrackConstants.PageName.Reset_Password,duration)
}else{
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Setup_Passwd,TrackConstants.PageName.Setup_Passwd,duration)
}
}
aboutToAppear() {
let params:SettingPasswordParams = router.getParams() as SettingPasswordParams;
this.pageId = parseInt(params.pageID);
this.getPageListData(this.pageId)
this.phoneContent = params.phoneContent!;
this.codeContent = params.codeContent!;
this.pageType = params.pageType;
}
getPageListData(pageId:number) {
switch (pageId) {
case 0:
break;
case 1:
// 设置密码
this.listData.push(new AccoutPageDataModel(0, '设置密码', '', '', '', '', 0))
this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请输入密码', 10086))
this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '再次输入密码', 10087))
this.listData.push(new AccoutPageDataModel(3, '', '', '提示:密码长度6~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上', '', '', 0))
this.listData.push(new AccoutPageDataModel(4, '', '', '', '确认', '', 0))
break;
case 2:
break;
case 3:
break;
case 4:
break;
}
}
build() {
Navigation() {
this.settingList() //滑动区域
}.titleMode(NavigationTitleMode.Mini)
.title('')
}
// 页面布局
@Builder settingList() {
Column() {
List() {
ForEach(this.listData, (item: AccoutPageDataModel, index: number) => {
ListItem() {
if (item.compType == 0) {
this.getTitleCell(item, HorizontalAlign.Start)
} else if (item.compType == 1) {
this.getPasswordCell(item)
} else if (item.compType == 2) {
this.getCodeCell(item)
} else if (item.compType == 3) {
if (index == this.listData.length - 1) {
this.getDescCell(item, HorizontalAlign.Center)
} else {
this.getDescCell(item, HorizontalAlign.Start)
}
} else if (item.compType == 4) {
this.getButtonCell(item)
} else if (item.compType == 5) {
this.getLogoCell(item)
} else if (item.compType == 7) {
this.getPhoneCell(item)
} else {
Text('' + item.compType)
}
}
})
}
}.width('100%')
.padding('30lpx')
.height('100%')
}
/***************************** UI元素 ******************************************/
// 标题
@Builder getTitleCell(item: AccoutPageDataModel, alignTitle: HorizontalAlign) {
Column() {
Text(item.compTitle).fontWeight(FontWeight.Bold).fontSize(20).maxLines(1)
}
.width('100%')
.height('75lpx')
.alignItems(alignTitle)
}
// 密码输入框
@Builder getPasswordCell(item: AccoutPageDataModel) {
Row() {
Row() {
TextInput({ placeholder: item.inputPlacholder })
.placeholderColor("#CCCCCC")
.passwordIcon({onIconSrc:$r("app.media.login_password_on"),offIconSrc:$r("app.media.login_password_off")})
.type(InputType.Password)
.showPasswordIcon(true)
.backgroundColor('#00000000')
.onChange((value: string) => {
this.inputTextChange(value, item.inputTag)
})
.onSubmit((EnterKeyType) => {
this.showToastTip('submit')
})
}
.alignItems(VerticalAlign.Center)
.height('80lpx')
.backgroundColor('#f5f5f5')
.borderRadius('4vp')
}
.width('100%')
.height('110lpx')
.backgroundColor(0xffffff0)
.alignItems(VerticalAlign.Center)
}
// 手机号输入框
@Builder getPhoneCell(item: AccoutPageDataModel) {
Row() {
Row() {
TextInput({ placeholder: item.inputPlacholder })
.placeholderColor("#CCCCCC")
.backgroundColor('#00000000')
.onChange((value: string) => {
this.inputTextChange(value, item.inputTag)
})
.onSubmit((EnterKeyType) => {
this.showToastTip('submit')
})
}
.alignItems(VerticalAlign.Center)
.height('80lpx')
.backgroundColor('#f5f5f5')
.borderRadius('4vp')
}
.width('100%')
.height('110lpx')
.backgroundColor(0xffffff0)
.alignItems(VerticalAlign.Center)
}
// 验证码码输入框
@Builder getCodeCell(item: AccoutPageDataModel) {
Row() {
Stack() {
Image($r('app.media.get_code_bg')).width('100%').borderRadius('4vp')
Row() {
TextInput({ placeholder: item.inputPlacholder })
.placeholderColor("#CCCCCC")
.backgroundColor('#00000000')
.width('67.28%')
.onChange((value: string) => {
this.inputTextChange(value, item.inputTag)
})
Button('发送验证码')
.width('32.71%')
.backgroundColor('#00000000')
.fontColor('#da3e22')
}
.width('100%')
}.height('80lpx')
}
.width('100%')
.height('110lpx')
.backgroundColor(0xffffff0)
.alignItems(VerticalAlign.Center)
}
// desc
@Builder getDescCell(item: AccoutPageDataModel, alignTitle: HorizontalAlign) {
Column() {
SettingPasswordLayout()
Text(item.compDesc).fontSize(12).maxLines(3).fontColor(0x999999).padding({top:'10lpx'})
.onClick(()=>{
if (item.compDesc == '忘记密码') {
this.showToastTip('密码不符合密码规范')
}
})
}
.width('100%')
.height('85lpx')
.alignItems(alignTitle)
}
.height('100%')
// 按钮
@Builder getButtonCell(item: AccoutPageDataModel) {
Row() {
Button(item.compButtonTitle, { type: ButtonType.Normal, stateEffect: true })
.width('100%')
.height('80lpx')
.backgroundColor(this.btnStatus ? '#da3e22' : '#e5856d')
.fontColor('#fff')
.borderRadius('4vp')
.onClick(() => {
this.buttonClick()
})
}
.padding({top:'25lpx'})
.alignItems(VerticalAlign.Center)
.width('100%')
.height('120lpx')
}
// 标题
@Builder getLogoCell(item: AccoutPageDataModel) {
Column() {
Image(item.compLogo).height('150lpx').width('150lpx')
}
.width('100%')
.height('200lpx')
}
/***************************** 事件处理 ******************************************/
// 提交按钮点击事件
async buttonClick() {
if (this.btnStatus) {
if(this.pageType === 0){
TrackingButton.click("resetPasswordPageConfirmButton",TrackConstants.PageName.Reset_Password,TrackConstants.PageName.Reset_Password)
}else{
TrackingButton.click("setPasswordPageConfirm",TrackConstants.PageName.Setup_Passwd,TrackConstants.PageName.Setup_Passwd)
}
// 需要+手机号校验
if (this.password01.length < 6 || this.password01.length > 20) {
this.showToastTip('密码不符合密码规范')
return
}
if (this.password01 != this.password02) {
this.showToastTip('两次输入的密码不一致,请重新输入')
return
}
if(this.pageId == 1){ //设置密码
SPHelper.default.get(SpConstants.USER_TEMP_TOKEN, '').then((str) => {
this.loginViewModel.forgotPassword(this.password01, str.toString()).then((data =>{
if (this.pageType == 0) {//登录页
this.showToastTip("修改成功")
router.back({
url: `${WDRouterPage.getLoginBundleInfo()}`
})
}else if(this.pageType == 1){//设置
let params: Params = {
pageID: 'AccountAndSecurityLayout'
}
this.showToastTip("修改成功")
router.back({
params:params,
url: `${WDRouterPage.getSettingBundleInfo()}`
})
}
}))
.catch((err: string) => {
this.showToastTip(err)
});
}).catch((err: string) => {
this.showToastTip(err)
Logger.error(TAG, 'catch err:' + JSON.stringify(err));
});
}
}
}
// 输入框数据变动:输入数据处理
inputTextChange(text: string, tag: number) {
if (tag == 10086) {
this.password01 = text;
} else if (tag == 10087) {
this.password02 = text;
} else {
this.passwordOri = text;
}
if (this.password01) {
if ((this.password01.length >= 6 && this.password01.length <= 20) && (this.password02.length >= 6 && this.password02.length <= 20)) {
this.btnStatus = true;
} else {
this.btnStatus = false;
}
}
}
showToastTip(msg:string){
this.toastText = msg
this.dialogToast.open()
}
}
...
...
sight_harmony/features/wdLogin/src/main/ets/pages/login/VerifyPhoneNumberPage.ets
View file @
719e491
import { CustomToast, DateTimeUtils, Logger, SPHelper } from 'wdKit/Index'
import { WDRouterRule, WDRouterPage } from 'wdRouter/Index'
import { LoginViewModel } from './LoginViewModel'
import { SettingPasswordParams } from './SettingPassword
Layout
'
import { SettingPasswordParams } from './SettingPassword
Page
'
import { router } from '@kit.ArkUI'
import { SpConstants } from 'wdConstant/Index'
import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index'
...
...
sight_harmony/features/wdLogin/src/main/resources/base/profile/main_pages.json
View file @
719e491
...
...
@@ -5,7 +5,6 @@
"pages/login/ForgetPasswordPage"
,
"pages/login/LoginProtocolWebview"
,
"pages/login/SettingPasswordPage"
,
"pages/login/SettingPasswordLayout"
,
"pages/guide/GuidePages"
,
"pages/login/OneKeyLoginPage"
,
"pages/login/ModifyPasswordPage"
,
...
...
sight_harmony/features/wdTracking/src/main/ets/common/TrackConstants.ets
View file @
719e491
...
...
@@ -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
...
...
sight_harmony/features/wdTracking/src/main/ets/tracking/TrackingContent.ets
View file @
719e491
...
...
@@ -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) {
...
...
sight_harmony/products/phone/src/main/ets/pages/ENewspaper.ets
View file @
719e491
...
...
@@ -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.pageNam
e,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
TrackingPageBrowse.trackCommonPageExposureEnd(
TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPag
e,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
}
onBackPress() {
...
...
sight_harmony/products/phone/src/main/ets/pages/detail/DynamicDetailPage.ets
View file @
719e491
...
...
@@ -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.pageNam
e,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
TrackingPageBrowse.trackCommonPageExposureEnd(
TrackConstants.PageName.DynamicDetailPage,TrackConstants.PageName.DynamicDetailPag
e,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment