陈剑华

Merge remote-tracking branch 'origin/main'

Showing 79 changed files with 981 additions and 493 deletions
... ... @@ -8,6 +8,7 @@
"tablet",
"2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true
}
}
\ No newline at end of file
... ...
... ... @@ -3,10 +3,13 @@ export struct CustomToast {
public static LENGTH_LONG = 4000;
public static LENGTH_SHORT = 2000;
@State msg: string = ""
@State msg: ResourceStr = ""
@State duration: number = CustomToast.LENGTH_SHORT
@State bgBorderRadius: number = 10
opacityValue: number = 0.7
bgColor: ResourceColor = $r("app.color.black")
fontSizeValue :number | string | Resource = "27lpx"
lineHeightValue :number | string | Resource = "38lpx"
controller: CustomDialogController
dismiss: () => void = () => {
... ... @@ -27,13 +30,13 @@ export struct CustomToast {
Text(this.msg)
.fontWeight(FontWeight.Regular)
.fontColor($r('app.color.white'))
.fontSize("27lpx")
.lineHeight("38lpx")
.fontSize(this.fontSizeValue)
.lineHeight(this.lineHeightValue)
.textAlign(TextAlign.Center)
}.borderRadius(`${this.bgBorderRadius}lpx`)
.constraintSize({maxWidth:"86%"})
.padding({top:"23lpx",bottom:'23lpx',left:"35lpx",right:"35lpx"})
.backgroundColor($r("app.color.black"))
.opacity(0.7)
.backgroundColor(this.bgColor)
.opacity(this.opacityValue)
}
}
... ...
... ... @@ -8,6 +8,7 @@
"tablet",
"2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
"requestPermissions": [
{
... ...
... ... @@ -21,7 +21,7 @@ export enum HostEnum {
* 环境host管理工具类
*/
export class HostManager {
private static _hostUrl: HostEnum = HostEnum.HOST_UAT;
private static _hostUrl: HostEnum = HostEnum.HOST_PRODUCT;
static changeHost(host: HostEnum) {
HostManager._hostUrl = host;
... ...
... ... @@ -8,6 +8,7 @@
"tablet",
"2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
"requestPermissions": [
{
... ...
... ... @@ -8,6 +8,7 @@
"tablet",
"2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true
}
}
\ No newline at end of file
... ...
... ... @@ -8,6 +8,7 @@
"tablet",
"2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
"pages": "$profile:main_pages"
}
... ...
... ... @@ -8,6 +8,7 @@
"tablet",
"2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true
}
}
\ No newline at end of file
... ...
... ... @@ -173,6 +173,7 @@ export { CreatorsBean } from './src/main/ets/bean/content/CreatorsBean';
export { MasterDetailRes } from './src/main/ets/bean/user/MasterDetailRes';
export { ReserveItemBean } from './src/main/ets/bean/live/ReserveItemBean';
export { PageTrackBean } from './src/main/ets/bean/component/PageTrackBean';
... ...
/**
* pageinfo数据,仅埋点用
*/
export class PageTrackBean {
pageId: string = ''; // 页面id
pageName: string = ''; // 名称
}
\ No newline at end of file
... ...
... ... @@ -8,6 +8,7 @@
"tablet",
"2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true
}
}
\ No newline at end of file
... ...
... ... @@ -7,6 +7,7 @@ import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailView
import { SpConstants } from 'wdConstant/Index';
import { WDShare } from 'wdShare/Index';
import { LikeComponent } from './view/LikeComponent'
import { TrackConstants } from 'wdTracking/Index';
const TAG = 'CarderInteraction'
... ... @@ -22,6 +23,8 @@ export struct CarderInteraction {
@State likeBean: Record<string, string> = {}
@State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
@Provide pageName: string = TrackConstants.PageName.DynamicDetail
@Provide pageId: string = TrackConstants.PageName.DynamicDetail
async aboutToAppear() {
await this.getContentDetailData()
... ...
... ... @@ -46,6 +46,7 @@ export struct CompParser {
console.log('CompParser-compDTO', JSON.stringify(this.compDTO))
this.pageName = this.pageModel.pageInfo.name
// 轮播图屏蔽音频类型稿件
if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
this.audioItems = this.compDTO.operDataList.filter(item => {
... ... @@ -88,7 +89,7 @@ export struct CompParser {
} else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
if (this.compDTO.operDataList.length > this.audioItems.length) {
ZhCarouselLayout01({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
}
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 &&
this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡"
... ...
... ... @@ -37,7 +37,7 @@ export struct ENewspaperItemComponent {
.onComplete(() => {
this.isShowSkeleton = false
})
.objectFit(ImageFit.Fill)
.objectFit(ImageFit.Contain)
.visibility(this.isShowSkeleton ? Visibility.None : Visibility.Visible)
Canvas(this.context)
... ...
... ... @@ -9,12 +9,16 @@ import font from '@ohos.font';
import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog';
import { RMCalendarBean } from './calendar/RMCalendarBean';
import { newsSkeleton } from './skeleton/newsSkeleton';
import { Logger, ToastUtils, NetworkUtil } from 'wdKit/Index';
import { Logger, ToastUtils, NetworkUtil, CustomToast } from 'wdKit/Index';
import { TrackingContent,TrackConstants, TrackingButton } from 'wdTracking/Index';
import { WDShare } from 'wdShare/Index';
import { window } from '@kit.ArkUI';
import { WindowModel } from 'wdKit';
//电子报UI
@Component
export struct ENewspaperPageComponent {
private windowClass?: window.Window;
private displayTool = display.getDefaultDisplaySync()
private screenWidth: number = 0
private picWidth: number = 0
... ... @@ -30,7 +34,27 @@ export struct ENewspaperPageComponent {
@State selectDate: Date = new Date()
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State ratio: string = '100%'
@State toastText:ResourceStr = ""
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
bgColor:$r("app.color.color_B3000000"),
opacityValue:1,
fontSizeValue:"25lpx",
lineHeightValue:"36lpx",
msg: this.toastText,
}),
autoCancel: false,
alignment: DialogAlignment.Center,
customStyle: true,
maskColor:"#00000000"
})
showToastTip(msg:ResourceStr){
this.toastText = msg
this.dialogToast.open()
}
//watch监听报纸页码回调
onCurrentPageNumUpdated(): void {
console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum)
... ... @@ -101,8 +125,12 @@ export struct ENewspaperPageComponent {
// })
async aboutToAppear() {
this.windowClass = WindowModel.shared.getWindowClass(); // 获取应用主窗口
this.screenWidth = this.windowClass?.getWindowProperties()?.windowRect.width
console.log('ENewspaperPageComponent this.screenWidth', this.screenWidth)
// 2000折叠屏 TODO DeviceUtil 方法完善了换判断条件
this.ratio = this.screenWidth > 2000 ? '60%' : '100%'
//获取宽高尺寸
this.screenWidth = this.displayTool.width
this.picWidth = this.screenWidth - vp2px(52)
let screenHeight = this.displayTool.height;
// bottomSafeHeight 底导高度 topSafeHeight 顶导高度 44 顶部高度 60 底部高度
... ... @@ -121,6 +149,7 @@ export struct ENewspaperPageComponent {
})
this.getNewspaperTime()
this.getNewspaperList()
this.resizeWindow()
}
aboutToDisappear() {
... ... @@ -130,6 +159,15 @@ export struct ENewspaperPageComponent {
// if (this.listDialogController) {
// this.listDialogController = null
// }
this.windowClass?.off('windowSizeChange');
}
resizeWindow() {
this.windowClass?.on('windowSizeChange', () => {
this.screenWidth = this.windowClass?.getWindowProperties()?.windowRect.width || this.displayTool.width
// 2000折叠屏 TODO DeviceUtil 方法完善了换判断条件
this.ratio = this.screenWidth > 2000 ? '60%' : '100%'
});
}
build() {
... ... @@ -216,8 +254,9 @@ export struct ENewspaperPageComponent {
ENewspaperItemComponent({ newspaperListItemBean: item})
})
}
.itemSpace(10)
.index(this.swiperIndex)
.width('100%')
.width(this.ratio)
// newspaper_shadow 44 高度 e_newspaper_content 35 margin top
.height(px2vp(this.picHeight) - 44 - 35)
.vertical(true)
... ... @@ -303,7 +342,7 @@ export struct ENewspaperPageComponent {
.id('e_newspaper_page_num')
.onClick((event: ClickEvent) => {
if(!NetworkUtil.isNetConnected()){
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
this.showToastTip('网络出小差了,请检查网络后重试')
return
}
if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
... ... @@ -314,7 +353,7 @@ export struct ENewspaperPageComponent {
this.pageDialogController.close()
}
}else {
ToastUtils.showToast('暂无数据', 1000)
this.showToastTip('暂无数据')
}
})
... ... @@ -342,7 +381,7 @@ export struct ENewspaperPageComponent {
.id('e_newspaper_read')
.onClick((event: ClickEvent) => {
if(!NetworkUtil.isNetConnected()){
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
this.showToastTip('网络出小差了,请检查网络后重试')
return
}
if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
... ... @@ -356,7 +395,7 @@ export struct ENewspaperPageComponent {
'currentNumber':this.swiperIndex,
})
}else {
ToastUtils.showToast('暂无数据', 1000)
this.showToastTip('暂无数据')
}
})
}
... ... @@ -394,7 +433,7 @@ export struct ENewspaperPageComponent {
let listBean = await NewspaperViewModel.getNewspaperList(this.calendarDate, this.picWidth + 'x' + this.picHeight)
this.newspaperListBean = listBean;
} else {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
this.showToastTip('网络出小差了,请检查网络后重试')
}
} catch (exception) {
... ...
import { FeedBackParams, FeedbackTypeBean, PhotoListBean } from 'wdBean/Index';
import { AppUtils,
CustomToast,
DateTimeUtils,
DeviceUtil,
FastClickUtil, Logger, NetworkUtil, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index';
FastClickUtil, Logger, NetworkUtil, StringUtils, UserDataLocal } from 'wdKit/Index';
import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
import { CustomTitleUI } from './reusable/CustomTitleUI'
import { picker } from '@kit.CoreFileKit';
... ... @@ -38,6 +39,21 @@ export struct FeedBackActivity {
addPic: PhotoListBean = {itemType:1} as PhotoListBean
@State pics: PhotoListBean[] = [this.addPic] as PhotoListBean[]
@State toastText:ResourceStr = ""
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
bgColor:$r("app.color.color_B3000000"),
opacityValue:1,
fontSizeValue:"25lpx",
lineHeightValue:"36lpx",
msg: this.toastText,
}),
autoCancel: false,
alignment: DialogAlignment.Center,
customStyle: true,
maskColor:"#00000000"
})
async aboutToAppear() {
await this.getContentDetailData()
}
... ... @@ -124,7 +140,7 @@ export struct FeedBackActivity {
if(value.length> 500){
//隐藏键盘
inputMethod.getController().stopInputSession();
ToastUtils.shortToast($r('app.string.res_feedback_commentsFail'))
this.showToastTip($r('app.string.res_feedback_commentsFail'))
// Logger.debug(TAG, "onChange > 500 " + value)
this.editValue = {classifyName:value.substring(0,500)} as FeedbackTypeBean
}else{
... ... @@ -285,9 +301,10 @@ export struct FeedBackActivity {
}
this.reportCommit()
})
.margin({bottom:20})
.margin({bottom:64})
}
}
}.margin({bottom:20})
// .margin({bottom:64})
}
.backgroundColor($r('app.color.color_fff'))
}
... ... @@ -408,13 +425,13 @@ export struct FeedBackActivity {
})
}else{
//
ToastUtils.shortToast($r('app.string.feedback_opinion_type'))
this.showToastTip($r('app.string.feedback_opinion_type'))
TrackingButton.click('feedbackPageSubmitFeedback',TrackConstants.PageName.FeedbackPage,TrackConstants.PageName.FeedbackPage)
return
}
//内容必填
if(StringUtils.isEmpty(this.editValue.classifyName) || this.editValue.classifyName.length < 10 || this.editValue.classifyName.length>500){
ToastUtils.shortToast($r('app.string.res_feedback_commentsFail'))
this.showToastTip($r('app.string.res_feedback_commentsFail'))
return
}
... ... @@ -457,4 +474,9 @@ export struct FeedBackActivity {
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.FeedbackPage,TrackConstants.PageName.FeedbackPage,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
}
showToastTip(msg:ResourceStr){
this.toastText = msg
this.dialogToast.open()
}
}
\ No newline at end of file
... ...
... ... @@ -11,6 +11,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import NoMoreLayout from '../../page/NoMoreLayout';
import { EmptyComponent } from '../../view/EmptyComponent';
import { ContentDetailDTO, Params } from 'wdBean/Index';
import { TrackingContent, TrackParamConvert } from 'wdTracking/Index';
const TAG = 'CommentComponent';
... ... @@ -31,6 +32,8 @@ export struct CommentComponent {
/*必传*/
@ObjectLink publishCommentModel: publishCommentModel
@Consume contentDetailData: ContentDetailDTO
@Consume pageId: string
@Consume pageName: string
listScroller: ListScroller = new ListScroller(); // scroller控制器
historyOffset: number = 0; // 上次浏览到列表距离顶端的偏移量offset
@State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource();
... ... @@ -66,6 +69,9 @@ export struct CommentComponent {
this.dialogController = new CustomDialogController({
builder: CommentCustomDialog({
onPublishBtnClickTrack: () => {
TrackingContent.commentClick(this.pageId, this.pageName, TrackParamConvert.contentDetail(this.contentDetailData))
},
confirm: (value: Record<string, string>) => {
this.addCommentLocal()
},
... ... @@ -222,6 +228,7 @@ export struct CommentComponent {
}
}
}
.scrollBar(BarState.Off)
.margin({ bottom: 10 })
.onReachEnd(() => {
if (!this.fixedHeightMode) {
... ...
... ... @@ -22,6 +22,7 @@ export struct CommentCustomDialog {
// confirm 表示内部处理调用 内容评论接口 发布了评论并成功,上层只需要 通过 publishCommentModel.lastCommentModel 即可获取最新已提交的评论
confirm?: (value: Record<string, string>) => void
onPublishBtnClickTrack?: () => void // 和confirm配套使用。当设置了onPublishBtnClick 则无效
@State private emojiSwitch: boolean = false
textInputController: TextAreaController = new TextAreaController()
... ... @@ -39,6 +40,11 @@ export struct CommentCustomDialog {
}
}
// 点击时 即可埋点
if (this.onPublishBtnClickTrack) {
this.onPublishBtnClickTrack()
}
let bean: Record<string, string> = {};
// this.publishCommentModel.commentContent = this.commentText
//TODO 判断类型
... ...
... ... @@ -5,6 +5,7 @@ import measure from '@ohos.measure'
import { ContentDetailDTO } from 'wdBean/Index'
import { HttpUtils } from 'wdNetwork/Index'
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
import { TrackingContent, TrackParamConvert } from 'wdTracking/Index'
@Preview
@Component
... ... @@ -20,6 +21,8 @@ export struct CommentTabComponent {
@State type: number = 1
@State placeHolder: string = '说两句...'
@State dialogController: CustomDialogController | null = null;
@Consume pageId: string
@Consume pageName: string
styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏)
/*回调方法*/
dialogControllerConfirm: () => void = () => {
... ... @@ -29,6 +32,9 @@ export struct CommentTabComponent {
this.dialogController = new CustomDialogController({
builder: CommentCustomDialog({
onPublishBtnClickTrack: () => {
TrackingContent.commentClick(this.pageId, this.pageName, TrackParamConvert.contentDetail(this.contentDetail))
},
confirm: (value: Record<string, string>) => {
this.dialogControllerConfirm();
EmitterUtils.sendEvent(EmitterEventId.COMMENT_PUBLISH, this.publishCommentModel.targetId)
... ...
... ... @@ -11,6 +11,7 @@ import { CommentCustomDialog } from './CommentCustomDialog'
import { publishCommentModel } from '../model/PublishCommentModel'
import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter/Index'
import { ContentDTO, MasterDetailRes } from 'wdBean/Index'
import { TrackConstants, TrackingContent } from 'wdTracking/Index'
const TAG = 'QualityCommentsComponent';
... ... @@ -34,6 +35,8 @@ export struct QualityCommentsComponent {
/*必传*/
@State publishCommentModel: publishCommentModel = new publishCommentModel()
// @Consume pageName: string
aboutToDisappear(): void {
// windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' })
this.dialogController = null // 将dialogController置空
... ... @@ -57,6 +60,9 @@ export struct QualityCommentsComponent {
showAlert() {
this.dialogController = new CustomDialogController({
builder: CommentCustomDialog({
onPublishBtnClickTrack: () => {
//TrackingContent.commentClick(this.pageName, this.pageName,{})
},
confirm: (value: Record<string, string>) => {
},
... ...
... ... @@ -189,11 +189,6 @@ class CommentViewModel {
}
HttpRequest.post<ResponseDTO<commentItemModel>>(url, bean).then((data: ResponseDTO<commentItemModel>) => {
// fixme 埋点 评论发布点击
TrackingContent.commentClick(pageId,pageName
,{
'duration':0,
})
if (data.code != 0) {
ToastUtils.showToast(data.message, 1000);
fail()
... ...
... ... @@ -46,7 +46,7 @@ export struct ZhGridLayout03 {
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
bottom: '0vp'
})
}
... ...
import { CompDTO, ContentDTO, Params, Action, ReserveItemBean} from 'wdBean';
import { CompDTO, ContentDTO, Params, Action, ReserveItemBean, PageTrackBean} from 'wdBean';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { postInteractAccentionOperateParams } from 'wdBean';
import { PageRepository } from '../../repository/PageRepository';
... ... @@ -276,7 +276,29 @@ export struct ZhSingleRow03 {
.textAlign(TextAlign.Center)
.borderRadius(3)
.onClick(() => {
this.bookAndCancel(item.relId, item.objectId, !this.isReserved(Number(item.objectId)))
const isSubscribe = !this.isReserved(Number(item.objectId))
// 直播预约埋点
const params: ParamType = {
'contentName': item.newsTitle,
'contentType': item.objectType,
"liveStreamType": item?.liveInfo.vrType === 0 ? 1 : 2,
"vliveId": item.objectId,
"vliveName": item.newsTitle,
"contentId": item.objectId,
"compId": item.relId,
"contentStyle": item.appStyle,
"liveType": getLiveState(item),
'contentShowChannelId': item.channelId,
'linkUrl': item.linkUrl,
"pageId": this.pageId,
"pageName": this.pageName,
}
Logger.info(TAG, `直播预约埋点: ${JSON.stringify(params)}`);
Tracking.event(isSubscribe? "live_subscribe_click": "cancel_live_subscribe_click", params)
this.bookAndCancel(item.relId, item.objectId, isSubscribe)
})
}
... ...
... ... @@ -231,13 +231,10 @@ export struct FollowListDetailUI {
value.forEach((item) => {
if (data.creatorId == item.creatorId) {
data.headPhotoUrl = item.headPhotoUrl
if (item.fansNum > 10000) {
let temp = (item.fansNum / 10000) + ""
let index = temp.indexOf('.')
if (index != -1) {
temp = temp.substring(0, index + 2)
} else {
temp = temp
if (item.fansNum >= 10000) {
let temp = (item.fansNum / 10000) .toFixed(1)
if (Number(temp.substring(temp.length-1)) == 0) {
temp = temp.substring(0, temp.length-2)
}
data.cnFansNum = temp + "万"
} else {
... ...
... ... @@ -207,13 +207,10 @@ export struct HomePageBottomFollowComponent {
value.list.forEach((value) => {
let fansNum: number = value.fansNum
let fansNumString = ""
if (fansNum > 10000) {
let temp = (fansNum / 10000) + ""
let index = temp.indexOf('.')
if (index != -1) {
temp = temp.substring(0, index + 2)
} else {
temp = temp
if (fansNum >= 10000) {
let temp = (fansNum / 10000) .toFixed(1)
if (Number(temp.substring(temp.length-1)) == 0) {
temp = temp.substring(0, temp.length-2)
}
fansNumString = temp + "万"
} else {
... ...
... ... @@ -168,7 +168,18 @@ export struct OtherHomePageBottomFollowComponent{
this.hasMore = false
}else{
value.list.forEach((value)=>{
this.data_follow.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,value.fansNum+"",value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.cnUserType,value.cnUserId,value.mainControl,value.banControl,value.authIcon))
let fansNum: number = value.fansNum
let fansNumString = ""
if (fansNum >= 10000) {
let temp = (fansNum / 10000) .toFixed(1)
if (Number(temp.substring(temp.length-1)) == 0) {
temp = temp.substring(0, temp.length-2)
}
fansNumString = temp + "万"
} else {
fansNumString = fansNum + ""
}
this.data_follow.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,fansNumString,value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.cnUserType,value.cnUserId,value.mainControl,value.banControl,value.authIcon))
})
this.data_follow.notifyDataReload()
this.count = this.data_follow.totalCount()
... ...
... ... @@ -5,7 +5,7 @@ import PageModel from '../../viewmodel/PageModel';
import { autoRefresh, onActionEnd, onActionStart, onActionUpdate } from '../../utils/PullDownRefresh';
import LoadMoreLayout from './LoadMoreLayout';
import { CompParser } from '../CompParser';
import { CompDTO } from 'wdBean';
import { CompDTO, PageTrackBean } from 'wdBean';
import PageHelper from '../../viewmodel/PageHelper';
import { channelSkeleton } from '../skeleton/channelSkeleton'
import { ProcessUtils } from 'wdRouter/Index';
... ... @@ -30,6 +30,13 @@ export struct PageComponent {
private listScroller: Scroller = new Scroller();
private panOption: PanGestureOptions = new PanGestureOptions({ direction: PanDirection.Up | PanDirection.Down })
needload: boolean = true;
// page相关埋点数据,各组件需要,自行取用
// @Provide 暂不能用Provide、Consume,(别的用到组件样式的页面,都需要加provide,否则会crash,暂不用这种方案。待优化)
/**
* @deprecated
*/
private pageTrackBean: PageTrackBean = new PageTrackBean()
build() {
Column() {
if (this.pageModel.viewType == ViewType.LOADING) {
... ... @@ -265,8 +272,14 @@ export struct PageComponent {
this.pageModel.channelId = this.channelId;
this.pageModel.currentPage = 1;
this.pageModel.pageTotalCompSize = 0;
PageHelper.getInitCacheData(this.pageModel, this.pageAdvModel)
PageHelper.getInitData(this.pageModel, this.pageAdvModel)
PageHelper.getInitCacheData(this.pageModel, this.pageAdvModel).then(() => {
this.pageTrackBean.pageId = this.pageId
this.pageTrackBean.pageName = this.pageModel.pageInfo.name
})
PageHelper.getInitData(this.pageModel, this.pageAdvModel).then(() => {
this.pageTrackBean.pageId = this.pageId
this.pageTrackBean.pageName = this.pageModel.pageInfo.name
})
}, 100)
}
}
... ...
import { DateTimeUtils, PermissionUtil } from 'wdKit'
import { BreakpointSystem, DateTimeUtils, PermissionUtil } from 'wdKit'
import { PrivacySettingModel } from '../../model/PrivacySettingModel'
import { Params } from 'wdBean';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import { HttpUtils } from 'wdNetwork/Index';
import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index';
import { TitleBackComponent } from '../setting/TitleBackComponent';
const TAG = 'PrivacySettingPage';
const DiyString = '开启个性化推荐'
... ... @@ -18,6 +19,17 @@ export struct PrivacySettingPage {
tipsEnd = '中相应权限使用规则'
pageShowTime:number = 0;
pageHideTime:number = 0;
@StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
private breakpointSystem = new BreakpointSystem();
@State percent:number = 1
currentChanged(){
if(this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"){
this.percent = 0.7
}else {
this.percent = 1
}
}
onPageShow(): void {
this.getPermissionStatus();
... ... @@ -32,6 +44,8 @@ export struct PrivacySettingPage {
}
aboutToAppear() {
this.breakpointSystem.register();
this.currentChanged()
if (!HttpUtils.getUserId()) {
this.listData.splice(0, 1);
}
... ... @@ -43,6 +57,10 @@ export struct PrivacySettingPage {
}
aboutToDisappear(): void {
this.breakpointSystem.unregister();
}
async getPermissionStatus() {
const permissionUtil = new PermissionUtil();
for (const element of this.listData) {
... ... @@ -57,25 +75,27 @@ export struct PrivacySettingPage {
}
build() {
Navigation() {
Column(){
TitleBackComponent({title:"隐私设置"})
//滑动区域
this.PrivacySettingComponentsUI()
}.backgroundColor('#F8F8F8')
.width("100%")
.height("100%")
}.titleMode(NavigationTitleMode.Mini)
.title('隐私设置')
.backgroundColor('#F8F8F8')
}
@Builder PrivacySettingComponentsUI() {
Column() {
List({ space: '23lpx' }) {
List({ space: `${this.calcHeight(23)}lpx` }) {
ForEach(this.listData, (item: PrivacySettingModel, index:number) => {
ListItem() {
if (item.privacyName == DiyString) {
getTuiJianCell({ item:item, index:index });
getTuiJianCell({ item:item, index:index ,percent:$percent});
} else {
getArrowCell({ item:item, index:index });
getArrowCell({ item:item, index:index ,percent:$percent});
}
}.onClick(() => {
if (item.privacyName == DiyString) {
... ... @@ -103,32 +123,33 @@ export struct PrivacySettingPage {
}
})
})
}
.padding({ left: '29lpx', right: '29lpx' })
.margin({ top: '38lpx' })
}.width('100%')
.padding({ left: `${this.calcHeight(29)}lpx`, right: `${this.calcHeight(29)}lpx` })
.margin({ top: `${this.calcHeight(38)}lpx` })
Row() {
Text(this.tips)
.fontSize('25lpx')
.fontSize(`${this.calcHeight(25)}lpx`)
.textAlign(TextAlign.Start)
.fontColor($r("app.color.color_666666"))
.margin({ left: '29lpx', top: '46lpx' })
.margin({ left: `${this.calcHeight(29)}lpx`, top: `${this.calcHeight(46)}lpx` })
// .backgroundColor(Color.Orange)
Text(this.privacyTips)
.fontSize('25lpx')
.fontSize(`${this.calcHeight(25)}lpx`)
.textAlign(TextAlign.Start)
.fontColor('#ED2800')
.margin({ top: '46lpx' })
.margin({ top: `${this.calcHeight(46)}lpx` })
.onClick(() => {
//跳转隐私政策
let bean={contentID:"2",pageID:""} as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage,bean)
})
Text(this.tipsEnd)
.fontSize('25lpx')
.fontSize(`${this.calcHeight(25)}lpx`)
.textAlign(TextAlign.Start)
.fontColor($r("app.color.color_666666"))
.margin({ top: '46lpx' })
.margin({ top: `${this.calcHeight(46)}lpx` })
}
}
... ... @@ -137,6 +158,10 @@ export struct PrivacySettingPage {
.backgroundColor('#F8F8F8')
.alignItems(HorizontalAlign.Start)
}
calcHeight(value:number): number{
return value * this.percent
}
}
... ... @@ -144,6 +169,7 @@ export struct PrivacySettingPage {
struct getArrowCell {
@ObjectLink item: PrivacySettingModel;
index:number = 0;
@Link percent:number
// 右文字+箭头cell
// @Builder getArrowCell(item:PrivacySettingModel, index) {
build() {
... ... @@ -151,28 +177,32 @@ struct getArrowCell {
// 左侧标题
Text(this.item.privacyName)
.fontColor('#666666')
.fontSize('31lpx')
.fontSize(`${this.calcHeight(31)}lpx`)
Row() {
Text(this.item.permission ? '已开启' : '去设置')
.fontColor(this.item.permission ? '#666666' : '#CCCCCC')
.fontSize('31lpx')
.margin({ right: '8lpx' })
.fontSize(`${this.calcHeight(31)}lpx`)
.margin({ right: `${this.calcHeight(8)}lpx` })
Image($r('app.media.mine_user_arrow'))
.width('27lpx')
.height('27lpx')
.width(`${this.calcHeight(27)}lpx`)
.height(`${this.calcHeight(27)}lpx`)
.objectFit(ImageFit.Auto)
}
}
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.SpaceBetween)
.height('97lpx')
.height(`${this.calcHeight(97)}lpx`)
.width('100%')
.padding({ left: '29lpx', right: '29lpx' })
.padding({ left: `${this.calcHeight(29)}lpx`, right: `${this.calcHeight(29)}lpx` })
.backgroundColor('#FFFFFF')
.borderRadius('8lpx')
.borderRadius(`${this.calcHeight(8)}lpx`)
}
calcHeight(value:number): number{
return value * this.percent
}
}
... ... @@ -180,6 +210,7 @@ struct getArrowCell {
struct getTuiJianCell {
@ObjectLink item: PrivacySettingModel;
index:number = 0;
@Link percent:number
build() {
Column() {
... ... @@ -187,12 +218,12 @@ struct getTuiJianCell {
// 左侧标题
Text(this.item.privacyName)
.fontColor('#666666')
.fontSize('31lpx')
.fontSize(`${this.calcHeight(31)}lpx`)
Row() {
Toggle({ type: ToggleType.Switch, isOn: this.item.permission })
.height('58lpx')
.width('96lpx')
.height(`${this.calcHeight(58)}lpx`)
.width(`${this.calcHeight(96)}lpx`)
.selectedColor('#ED2700')
.onChange((isOn: boolean) => {
// this.privacySwitch = isOn;
... ... @@ -203,25 +234,29 @@ struct getTuiJianCell {
}
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.SpaceBetween)
.height('97lpx')
.height(`${this.calcHeight(97)}lpx`)
.width('100%')
Blank()
.backgroundColor('#EDEDED')
.height('1lpx')
.height(`${this.calcHeight(1)}lpx`)
Text(DiyCloseTipsString)
.fontColor('#999999')
.fontSize('23lpx')
.margin({ right: '8lpx' })
.height('69lpx')
.fontSize(`${this.calcHeight(23)}lpx`)
.margin({ right: `${this.calcHeight(8)}lpx` })
.height(`${this.calcHeight(69)}lpx`)
}
}.width('100%')
.alignItems(HorizontalAlign.Start)
.backgroundColor('#FFFFFF')
.borderRadius('8lpx')
.padding({ left: '29lpx', right: '29lpx' })
.borderRadius(`${this.calcHeight(8)}lpx`)
.padding({ left: `${this.calcHeight(29)}lpx`, right: `${this.calcHeight(29)}lpx` })
}
calcHeight(value:number): number{
return value * this.percent
}
}
... ...
import { WindowModel } from 'wdKit/Index';
import { TrackConstants } from 'wdTracking/Index';
import { QualityCommentsComponent } from '../comment/view/QualityCommentsComponent';
@Entry
@Component
struct QualityCommentsPage {
@Provide pageName: string = TrackConstants.PageName.Best_Comment
@Provide pageId: string = TrackConstants.PageName.Best_Comment
onPageShow(): void {
// WindowModel.shared.setWindowLayoutFullScreen(true)
}
... ...
... ... @@ -23,6 +23,6 @@ struct SettingAboutPage {
build() {
Column(){
AboutPageUI()
}
}.backgroundColor($r('app.color.white'))
}
}
\ No newline at end of file
... ...
... ... @@ -2,7 +2,7 @@ import { MineSettingComponent } from '../setting/MineSettingComponent';
import { AccountAndSecurityLayout } from '../setting/AccountAndSecurityLayout';
import router from '@ohos.router';
import { Params } from 'wdBean';
import { DateTimeUtils } from 'wdKit/Index';
import { BreakpointSystem, DateTimeUtils } from 'wdKit/Index';
import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index';
@Entry
... ... @@ -51,6 +51,7 @@ struct SettingPage {
AccountAndSecurityLayout({enterActivityTime:this.enterActivityTime})
}
}.setFullWidth()
.backgroundColor($r("app.color.white"))
}
// 私有方法
... ...
... ... @@ -14,6 +14,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter'
import { LazyDataSource } from 'wdKit/Index';
import LoadMoreLayout from '../page/LoadMoreLayout'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { TrackConstants, Tracking, TrackingContent, TrackingPageBrowse, TrackParamConvert } from 'wdTracking/Index';
const TAG: string = 'ReserveMorePage';
... ... @@ -47,6 +48,9 @@ struct ReserveMorePage {
@State private liveId: string = ''
@State isLoadingAttention: boolean = false
@State loadImg: boolean = false;
private pageId: string = TrackConstants.PageName.Live_Appointment_List
private pageName: string = TrackConstants.PageName.Live_Appointment_List
private pageShowStartTime: number = 0
build() {
Column() {
... ... @@ -249,8 +253,24 @@ struct ReserveMorePage {
top: index == 0 ? '12vp' : '8vp'
})
.onClick(() => {
// 内容点击埋点
TrackingContent.common(TrackConstants.EventType.Click,
item.pageId,
item.pageId,
TrackParamConvert.program(item))
ProcessUtils.processPage(item)
})
.onVisibleAreaChange([0, 1], (isVisiable: boolean, ratio: number) => {
if (isVisiable) {
// 内容曝光埋点
TrackingContent.common(TrackConstants.EventType.Show,
item.pageId,
item.pageId,
TrackParamConvert.program(item))
}
})
}
/*导航栏*/
... ... @@ -358,12 +378,18 @@ struct ReserveMorePage {
}
onPageShow(): void {
this.pageShowStartTime = Date.now()
if (this.isShow) {
this.data.reloadData()
this.isShow = false
}
}
onPageHide(): void {
const duration = Date.now() - this.pageShowStartTime
TrackingPageBrowse.trackCommonPageExposureEnd(this.pageId, this.pageName, duration)
}
private async getData(resolve?: (value: string | PromiseLike<string>) => void) {
if (this.isLoading) {
if (resolve) {
... ... @@ -386,6 +412,8 @@ struct ReserveMorePage {
this.reserveList = []
this.reservedIds = []
}
liveReviewDTO.list.forEach((content) => { content.pageId = this.pageId })
this.data.push(...liveReviewDTO.list)
//批量查询关注状态
this.getAppointmentInfo(liveReviewDTO.list)
... ... @@ -488,6 +516,11 @@ struct ReserveMorePage {
this.isLoadingAttention = true
this.liveId = reserveItem.liveId.toString()
try {
// 埋点
Tracking.event(!reserveItem.subscribe ? "live_subscribe_click":"cancel_live_subscribe_click",
TrackParamConvert.program(item))
const res = await LiveModel.liveAppointment(reserveItem.relationId, reserveItem.liveId.toString(),
!reserveItem.subscribe);
if (res.code == 0) {
... ...
... ... @@ -4,14 +4,15 @@ import router from '@ohos.router'
export struct CustomTitleUI {
imgBack:boolean = true
titleName:ResourceStr = "默认标题"
@Prop percent:number = 1
build() {
RelativeContainer() {
//标题栏目
if(this.imgBack){
Image($r('app.media.back_icon'))
.width('46lpx')
.height('46lpx')
.width(`${this.calcHeight(46)}lpx`)
.height(`${this.calcHeight(46)}lpx`)
.objectFit(ImageFit.Auto)
.interpolation(ImageInterpolation.High)
.id("back_icon")
... ... @@ -19,7 +20,7 @@ export struct CustomTitleUI {
center: {anchor: "__container__", align: VerticalAlign.Center},
left: {anchor: "__container__", align: HorizontalAlign.Start}
})
.margin({left:'31lpx'})
.margin({left:`${this.calcHeight(31)}lpx`})
.onClick(()=>{
router.back()
})
... ... @@ -28,18 +29,22 @@ export struct CustomTitleUI {
Text(this.titleName)
.maxLines(1)
.id("title")
.fontSize('30lpx')
.fontSize(`${this.calcHeight(30)}lpx`)
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.lineHeight('43lpx')
.lineHeight(`${this.calcHeight(43)}lpx`)
.alignRules({
center: {anchor: "__container__", align: VerticalAlign.Center},
middle: {anchor: "__container__", align: HorizontalAlign.Center}
})
}
.height('84lpx')
.height(`${this.calcHeight(84)}lpx`)
.width('100%')
.backgroundColor($r('app.color.white'))
}
calcHeight(value:number): number{
return value * this.percent
}
}
\ No newline at end of file
... ...
import router from '@ohos.router'
import { NetworkUtil, StringUtils, ToastUtils } from 'wdKit'
import { BreakpointSystem, NetworkUtil, StringUtils, ToastUtils } from 'wdKit'
import { ParamType, TrackConstants, Tracking } from 'wdTracking/Index'
import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
import { SearchHistoryItem } from '../../viewmodel/SearchHistoryItem'
import { SearchRelatedItem } from '../../viewmodel/SearchRelatedItem'
import { EmptyComponent } from '../view/EmptyComponent'
import { SearchHistoryComponent } from './SearchHistoryComponent'
import { SearchHotsComponent } from './SearchHotsComponent'
import { SearchRelatedComponent } from './SearchRelatedComponent'
... ... @@ -34,7 +33,22 @@ export struct SearchComponent {
@State isGetRequest:boolean = false
@Link fromTabName: string
@StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
private breakpointSystem = new BreakpointSystem();
@State percent:number = 1
currentChanged(){
if(this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"){
this.percent = 0.7
}else {
this.percent = 1
}
}
aboutToAppear() {
this.breakpointSystem.register();
this.currentChanged()
//获取提示滚动
this.getSearchHint()
//清除缓存
... ... @@ -49,6 +63,11 @@ export struct SearchComponent {
}, 1000);
}
aboutToDisappear(): void {
this.breakpointSystem.unregister();
}
getRelatedSearchContent() {
if(StringUtils.isNotEmpty(this.searchText)){
SearcherAboutDataModel.getRelatedSearchContentData(encodeURI(this.searchText),getContext(this)).then((value) => {
... ... @@ -127,26 +146,26 @@ export struct SearchComponent {
Scroll(this.scroller) {
Column() {
if(this.searchHistoryData!=null && this.searchHistoryData.length>0){
SearchHistoryComponent({ searchHistoryData: $searchHistoryData, onDelHistory: (): void => this.getSearchHistoryData(),onGetSearchRes: (item,index): void => this.getSearchHistoryResData(item,index),onCloseInput : (): void => this.stopInput() })
SearchHistoryComponent({ searchHistoryData: $searchHistoryData, onDelHistory: (): void => this.getSearchHistoryData(),onGetSearchRes: (item,index): void => this.getSearchHistoryResData(item,index),onCloseInput : (): void => this.stopInput(),percent:this.percent })
}
if(this.searchHistoryData.length>0){
//分隔符
Divider()
.width('100%')
.height('1lpx')
.height(`${this.calcHeight(1)}lpx`)
.color($r('app.color.color_EDEDED'))
.strokeWidth('1lpx')
.strokeWidth(`${this.calcHeight(1)}lpx`)
}
SearchHotsComponent({onGetSearchRes: (item): void => this.getSearchHotResData(item)})
SearchHotsComponent({onGetSearchRes: (item): void => this.getSearchHotResData(item),percent:this.percent})
}
}
.scrollable(ScrollDirection.Vertical)
.scrollBar(BarState.Off)
.width('100%')
.height('100%')
.padding({ left: '31lpx', right: '31lpx' })
.padding({ left: `${this.calcHeight(31)}lpx`, right: `${this.calcHeight(31)}lpx` })
} else {
if (this.hasChooseSearch) {
//搜索结果
... ... @@ -156,10 +175,10 @@ export struct SearchComponent {
this.getSearchHistoryData()
this.getSearchInputResData(this.searchText)
}
}})
},percent:this.percent})
} else {
//联想搜索
SearchRelatedComponent({relatedSearchContentData:$relatedSearchContentsData,onGetSearchRes: (item): void => this.getSearchRelatedResData(item),searchText:this.searchText})
SearchRelatedComponent({relatedSearchContentData:$relatedSearchContentsData,onGetSearchRes: (item): void => this.getSearchRelatedResData(item),searchText:this.searchText,percent:this.percent})
}
}
}.height('100%')
... ... @@ -244,14 +263,14 @@ export struct SearchComponent {
Swiper(this.swiperController) {
ForEach(this.searchTextData, (item: string, index: number) => {
Text(item)
.fontWeight('400lpx')
.fontSize('25lpx')
.fontWeight(400)
.fontSize(`${this.calcHeight(25)}lpx`)
.fontColor($r('app.color.color_666666'))
.lineHeight('35lpx')
.lineHeight(`${this.calcHeight(35)}lpx`)
.textAlign(TextAlign.Start)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Clip })
.margin({ left: '40lpx' })
.margin({ left: `${this.calcHeight(40)}lpx` })
})
}
.loop(true)
... ... @@ -268,9 +287,9 @@ export struct SearchComponent {
Row(){
Search({ value: this.searchText, placeholder: '', controller: this.controller})
.layoutWeight(1)
.height('69lpx')
.height(`${this.calcHeight(69)}lpx`)
.backgroundColor($r('app.color.color_transparent'))
.textFont({ size: "27lpx", weight: "400lpx" })
.textFont({ size: `${this.calcHeight(27)}lpx`, weight: 400 })
// .defaultFocus(true)
.id("searchId")
.searchIcon({
... ... @@ -318,42 +337,44 @@ export struct SearchComponent {
}
}
})
}.padding({right:'70lpx'})
.layoutWeight(1)
Image($r('app.media.search_input_del_icon'))
.width("31lpx")
.height("31lpx")
.width(`${this.calcHeight(31)}lpx`)
.height(`${this.calcHeight(31)}lpx`)
.objectFit(ImageFit.Auto)
.interpolation(ImageInterpolation.Medium)
.margin({left:"495lpx"})
.onClick(()=>{
this.searchText = ""
})
.offset({x:10})
.enabled(true)
.visibility(StringUtils.isEmpty(this.searchText) ? Visibility.Hidden : Visibility.Visible)
}.padding({right:`${this.calcHeight(70)}lpx`})
.layoutWeight(1)
.justifyContent(FlexAlign.SpaceBetween)
}
.backgroundImage($r('app.media.search_page_input_bg'))
.backgroundImageSize(ImageSize.Cover)
.layoutWeight(1)
.height('69lpx')
.height(`${this.calcHeight(69)}lpx`)
//TODO 需要修改输入法 换行
//右
Text("取消")
.textAlign(TextAlign.Center)
.fontWeight('400lpx')
.fontSize('31lpx')
.lineHeight('58lpx')
.fontWeight(400)
.fontSize(`${this.calcHeight(31)}lpx`)
.lineHeight(`${this.calcHeight(58)}lpx`)
.fontColor($r('app.color.color_222222'))
.width('125lpx')
.height('58lpx')
.width(`${this.calcHeight(125)}lpx`)
.height(`${this.calcHeight(58)}lpx`)
.onClick(() => {
router.back()
})
}
.height('85lpx')
.padding({ left: '31lpx' })
.height(`${this.calcHeight(85)}lpx`)
.padding({ left: `${this.calcHeight(31)}lpx` })
.alignItems(VerticalAlign.Center)
}
... ... @@ -395,6 +416,10 @@ export struct SearchComponent {
this.isClickedInputSearch = false
this.isClickedHintSearch = false
}
calcHeight(value:number): number{
return value * this.percent
}
}
function trackSearchClick(upOneLevelPageName: string,keyword:string){
... ...
... ... @@ -27,6 +27,7 @@ export struct SearchHistoryComponent{
alignment: DialogAlignment.Center,
customStyle: true
})
@Prop percent:number = 1
onAccept(){
console.info('Callback when the second button is clicked')
... ... @@ -48,14 +49,14 @@ export struct SearchHistoryComponent{
Text("搜索历史")
.textAlign(TextAlign.Center)
.fontWeight(FontWeight.Regular)
.fontSize('27lpx')
.lineHeight('38lpx')
.fontSize(`${this.calcHeight(27)}lpx`)
.lineHeight(`${this.calcHeight(38)}lpx`)
.fontColor($r('app.color.color_999999'))
.height('38lpx')
.height(`${this.calcHeight(38)}lpx`)
Image($r('app.media.search_delete_icon'))
.height('31lpx')
.width('31lpx')
.height(`${this.calcHeight(31)}lpx`)
.width(`${this.calcHeight(31)}lpx`)
.interpolation(ImageInterpolation.High)
.objectFit(ImageFit.Auto)
.onClick(()=>{
... ... @@ -63,7 +64,7 @@ export struct SearchHistoryComponent{
this.dialogController.open()
})
}.justifyContent(FlexAlign.SpaceBetween)
.margin({bottom:'17lpx'})
.margin({bottom:`${this.calcHeight(17)}lpx`})
.width('100%')
Grid(){
... ... @@ -72,14 +73,14 @@ export struct SearchHistoryComponent{
Row(){
Text(`${item.searchContent}`)
.fontColor($r('app.color.color_222222'))
.fontSize('31lpx')
.fontSize(`${this.calcHeight(31)}lpx`)
.fontWeight(FontWeight.Regular)
.lineHeight('46lpx')
.lineHeight(`${this.calcHeight(46)}lpx`)
.maxLines(1)
.constraintSize({maxWidth:index%2 === 0?'270lpx':'230lpx'})
.constraintSize({maxWidth:index%2 === 0?`${this.calcHeight(270)}lpx`:`${this.calcHeight(230)}lpx`})
.textOverflow({ overflow: TextOverflow.Ellipsis })
.textAlign(TextAlign.Start)
.margin({left:index%2 === 0?'0lpx':'23lpx'})
.margin({left:index%2 === 0?'0lpx':`${this.calcHeight(23)}lpx`})
.onClick(()=>{
if (this.onGetSearchRes !== undefined) {
this.onGetSearchRes(item.searchContent,index)
... ... @@ -87,9 +88,9 @@ export struct SearchHistoryComponent{
})
Image($r('app.media.search_item_delete_icon'))
.width('23lpx')
.height('23lpx')
.margin({left:'4lpx'})
.width(`${this.calcHeight(23)}lpx`)
.height(`${this.calcHeight(23)}lpx`)
.margin({left:`${this.calcHeight(4)}lpx`})
.interpolation(ImageInterpolation.Medium)
.objectFit(ImageFit.Auto)
.onClick(()=>{
... ... @@ -103,19 +104,19 @@ export struct SearchHistoryComponent{
if(index%2 === 0 && index != this.searchHistoryData.length-1 ){
Divider()
.width('2lpx')
.height('23lpx')
.width(`${this.calcHeight(2)}lpx`)
.height(`${this.calcHeight(23)}lpx`)
.color($r('app.color.color_CCCCCC'))
.strokeWidth('2lpx')
.strokeWidth(`${this.calcHeight(2)}lpx`)
.vertical(true)
}
}.height('100%')
.alignItems(VerticalAlign.Center)
.width('100%')
.margin({left:index%2 === 1?'23lpx':'0lpx'})
.margin({left:index%2 === 1?`${this.calcHeight(23)}lpx`:'0lpx'})
}
.height('46lpx')
.height(`${this.calcHeight(46)}lpx`)
.alignSelf(ItemAlign.Center)
})
... ... @@ -123,9 +124,9 @@ export struct SearchHistoryComponent{
.height(this.getCategoryViewHeight())
.rowsTemplate(this.getCategoryRowTmpl())
.columnsTemplate('1fr 1fr')
.rowsGap('23lpx')
.rowsGap(`${this.calcHeight(23)}lpx`)
}
.margin({top:"36lpx",bottom:'46lpx'})
.margin({top:`${this.calcHeight(36)}lpx`,bottom:`${this.calcHeight(46)}lpx`})
}
getCategoryRowCount() {
... ... @@ -140,6 +141,10 @@ export struct SearchHistoryComponent{
}
getCategoryViewHeight() {
return `${50 * this.getCategoryRowCount()}lpx`;
return `${50 * this.percent * this.getCategoryRowCount()}lpx`;
}
calcHeight(value:number): number{
return value * this.percent
}
}
\ No newline at end of file
... ...
... ... @@ -10,6 +10,7 @@ const TAG = "SearchHotsComponent"
export struct SearchHotsComponent{
@State searchHotsData:SearchHotContentItem[] = []
onGetSearchRes?: (item:string) => void;
@Prop percent:number = 1
aboutToAppear(){
//获取搜索热词
... ... @@ -34,22 +35,22 @@ export struct SearchHotsComponent{
if(this.searchHotsData.length>0){
Row() {
Image($r('app.media.search_hot_icon'))
.width('46lpx')
.height('46lpx')
.width(`${this.calcHeight(46)}lpx`)
.height(`${this.calcHeight(46)}lpx`)
.objectFit(ImageFit.Auto)
.margin({right:'8lpx'})
.margin({right:`${this.calcHeight(8)}lpx`})
.interpolation(ImageInterpolation.Medium)
Text("热门搜索")
.textAlign(TextAlign.Center)
.fontWeight(FontWeight.Bold)
.fontSize('33lpx')
.lineHeight('46lpx')
.fontSize(`${this.calcHeight(33)}lpx`)
.lineHeight(`${this.calcHeight(46)}lpx`)
.fontColor($r('app.color.color_222222'))
.height('46lpx')
.height(`${this.calcHeight(46)}lpx`)
}
.width('100%')
.margin({bottom:"15lpx"})
.margin({bottom:`${this.calcHeight(15)}lpx`})
}
List(){
... ... @@ -60,49 +61,49 @@ export struct SearchHotsComponent{
Row(){
if(item.sequence <=3){
Image(item.sequence===1?$r('app.media.search_hot_num1'):item.sequence===2?$r('app.media.search_hot_num2'):$r('app.media.search_hot_num3'))
.width('27lpx')
.height('35lpx')
.width(`${this.calcHeight(27)}lpx`)
.height(`${this.calcHeight(35)}lpx`)
.objectFit(ImageFit.Auto)
.margin({right:'12lpx'})
.margin({right:`${this.calcHeight(12)}lpx`})
.interpolation(ImageInterpolation.High)
}else {
Text(`${item.sequence}`)
.height('31lpx')
.height(`${this.calcHeight(31)}lpx`)
.fontColor($r('app.color.color_666666'))
.fontSize('27lpx')
.fontSize(`${this.calcHeight(27)}lpx`)
.fontWeight(FontWeight.Regular)
.lineHeight('31lpx')
.margin({right:'12lpx'})
.lineHeight(`${this.calcHeight(31)}lpx`)
.margin({right:`${this.calcHeight(12)}lpx`})
}
Text(`${item.hotEntry}`)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.fontColor($r('app.color.color_222222'))
.fontSize('31lpx')
.fontSize(`${this.calcHeight(31)}lpx`)
.maxLines(1)
.fontWeight(FontWeight.Regular)
.lineHeight('42lpx')
.lineHeight(`${this.calcHeight(42)}lpx`)
}.layoutWeight(1)
if(item.mark===1 || item.mark===2){
Image(item.mark===1?$r('app.media.search_hots_mark1'):$r('app.media.search_hots_mark2'))
.width('42lpx')
.height('31lpx')
.width(`${this.calcHeight(42)}lpx`)
.height(`${this.calcHeight(31)}lpx`)
.objectFit(ImageFit.Auto)
.interpolation(ImageInterpolation.High)
}
}.alignItems(VerticalAlign.Center)
.height('84lpx')
.height(`${this.calcHeight(84)}lpx`)
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
if(index != this.searchHotsData.length-1 ){
Divider()
.width('100%')
.height('1lpx')
.height(`${this.calcHeight(1)}lpx`)
.color($r('app.color.color_F5F5F5'))
.strokeWidth('1lpx')
.strokeWidth(`${this.calcHeight(1)}lpx`)
}
}.height('85lpx')
}.height(`${this.calcHeight(85)}lpx`)
.width('100%')
.alignItems(HorizontalAlign.Start)
}
... ... @@ -117,6 +118,10 @@ export struct SearchHotsComponent{
}).layoutWeight(1)
}.width('100%')
.height('100%')
.margin({top:'46lpx'})
.margin({top:`${this.calcHeight(46)}lpx`})
}
calcHeight(value:number): number{
return value * this.percent
}
}
\ No newline at end of file
... ...
... ... @@ -10,6 +10,7 @@ export struct SearchRelatedComponent {
@Link relatedSearchContentData: SearchRelatedItem[]
onGetSearchRes?: (item:string) => void;
@Prop searchText: string
@Prop percent:number = 1
build() {
Column() {
... ... @@ -19,19 +20,19 @@ export struct SearchRelatedComponent {
Column(){
Row() {
Image($r('app.media.search_related_item_icon'))
.width('31lpx')
.height('31lpx')
.width(`${this.calcHeight(31)}lpx`)
.height(`${this.calcHeight(31)}lpx`)
.objectFit(ImageFit.Auto)
.margin({ right: '10lpx' })
.margin({ right:`${this.calcHeight(10)}lpx` })
.interpolation(ImageInterpolation.High)
Text(){
ForEach(item.data_arr,(item:string)=>{
Span(item)
.fontColor(item===this.searchText?$r('app.color.color_ED2800'):$r('app.color.color_000000'))
.fontSize('31lpx')
.fontWeight('400lpx')
.lineHeight('50lpx')
.fontSize(`${this.calcHeight(31)}lpx`)
.fontWeight(400)
.lineHeight(`${this.calcHeight(50)}lpx`)
})
}
.maxLines(1)
... ... @@ -40,14 +41,14 @@ export struct SearchRelatedComponent {
}.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Start)
.height('95lpx')
.height(`${this.calcHeight(95)}lpx`)
if (index != this.relatedSearchContentData.length - 1) {
Divider()
.width('100%')
.height('1lpx')
.height(`${this.calcHeight(1)}lpx`)
.color($r('app.color.color_F5F5F5'))
.strokeWidth('1lpx')
.strokeWidth(`${this.calcHeight(1)}lpx`)
}
}
}.width('100%')
... ... @@ -59,8 +60,11 @@ export struct SearchRelatedComponent {
})
}.width('100%')
}.width('100%')
.margin({ top: '8lpx' })
.padding({ left: '31lpx', right: '31lpx' })
.margin({ top: `${this.calcHeight(8)}lpx` })
.padding({ left: `${this.calcHeight(31)}lpx`, right: `${this.calcHeight(31)}lpx` })
}
calcHeight(value:number): number{
return value * this.percent
}
}
\ No newline at end of file
... ...
... ... @@ -28,6 +28,7 @@ export struct SearchResultComponent {
scroller: Scroller = new Scroller()
onClickTryAgain?: () => void;
@State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
@Prop percent:number = 1
aboutToAppear(): void {
if (this.count.length === 0 && this.isGetRequest == true) {
... ... @@ -71,7 +72,7 @@ export struct SearchResultComponent {
//缺省图
if(this.isConnectNetwork){
EmptyComponent({emptyType:4})
.height('612lpx')
.height(`${this.calcHeight(612)}lpx`)
.width('100%')
}else{
EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
... ... @@ -90,19 +91,19 @@ export struct SearchResultComponent {
ListItem() {
Row() {
Image($r('app.media.search_suggest_icon'))
.width('6lpx')
.height('31lpx')
.width(`${this.calcHeight(6)}lpx`)
.height(`${this.calcHeight(31)}lpx`)
.objectFit(ImageFit.Cover)
.interpolation(ImageInterpolation.High)
.margin({ right: '10lpx' })
.margin({ right: `${this.calcHeight(10)}lpx` })
Text("为你推荐")
.textAlign(TextAlign.Start)
.fontWeight(600)
.fontSize('33lpx')
.lineHeight('46lpx')
.fontSize(`${this.calcHeight(33)}lpx`)
.lineHeight(`${this.calcHeight(46)}lpx`)
.fontColor($r('app.color.color_222222'))
}.height('84lpx')
.padding({ left: '31lpx', right: '31lpx' })
}.height(`${this.calcHeight(84)}lpx`)
.padding({ left: `${this.calcHeight(31)}lpx`, right: `${this.calcHeight(31)}lpx` })
.width('100%')
.alignItems(VerticalAlign.Center)
}
... ... @@ -115,9 +116,9 @@ export struct SearchResultComponent {
if (index != this.data.totalCount() - 1) {
Divider()
.width('100%')
.height('1lpx')
.height(`${this.calcHeight(1)}lpx`)
.color($r('app.color.color_F5F5F5'))
.strokeWidth('1lpx')
.strokeWidth(`${this.calcHeight(1)}lpx`)
}
}
}
... ... @@ -144,7 +145,7 @@ export struct SearchResultComponent {
.vertical(false)
.barMode(BarMode.Fixed)
.barWidth('100%')
.barHeight('84lpx')
.barHeight(`${this.calcHeight(84)}lpx`)
.animationDuration(0)
.width('100%')
.scrollable(false)
... ... @@ -152,26 +153,26 @@ export struct SearchResultComponent {
}
}.width('100%')
.layoutWeight(1)
.margin({ top: '12lpx' })
.margin({ top: `${this.calcHeight(12)}lpx` })
}
@Builder
TabBuilder(index: number, item: string) {
Stack() {
Text(item)
.height('38lpx')
.fontSize('33lpx')
.height(`${this.calcHeight(38)}lpx`)
.fontSize(`${this.calcHeight(33)}lpx`)
.fontWeight(this.currentIndex === index ? 600 : 400)
.fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
.lineHeight('38lpx')
.lineHeight(`${this.calcHeight(38)}lpx`)
if (this.currentIndex === index) {
Divider()
.width('31lpx')
.height('4lpx')
.width(`${this.calcHeight(31)}lpx`)
.height(`${this.calcHeight(4)}lpx`)
.color('#ED2800')
.strokeWidth('4lpx')
.margin({ top: '50lpx' })
.strokeWidth(`${this.calcHeight(4)}lpx`)
.margin({ top: `${this.calcHeight(50)}lpx` })
.id("divTag")
}
}.onClick(() => {
... ... @@ -179,7 +180,11 @@ export struct SearchResultComponent {
this.controller.changeIndex(this.currentIndex)
})
.height('100%')
.margin({ right: '9lpx' })
.padding({ left: '31lpx', right: index === this.count.length - 1 ? "31lpx" : "0lpx" })
.margin({ right: `${this.calcHeight(9)}lpx` })
.padding({ left: `${this.calcHeight(31)}lpx`, right: index === this.count.length - 1 ? `${this.calcHeight(31)}lpx` : "0lpx" })
}
calcHeight(value:number): number{
return value * this.percent
}
}
\ No newline at end of file
... ...
import { Params } from 'wdBean';
import { AppUtils, StringUtils } from 'wdKit/Index';
import { AppUtils, BreakpointSystem, StringUtils } from 'wdKit/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import { TrackingButton, TrackConstants } from 'wdTracking/Index';
import { CustomTitleUI } from '../reusable/CustomTitleUI';
... ... @@ -24,11 +24,25 @@ export struct AboutPageUI {
alignment: DialogAlignment.Center
})
@StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
private breakpointSystem = new BreakpointSystem();
@State percent:number = 1
currentChanged(){
if(this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"){
this.percent = 0.7
}else {
this.percent = 1
}
}
build() {
this.aboutUi()
}
aboutToAppear() {
this.breakpointSystem.register();
this.currentChanged()
let context = getContext();
context.getApplicationContext();
let appVerion = AppUtils.getAppVersionName()
... ... @@ -37,15 +51,19 @@ export struct AboutPageUI {
}
}
aboutToDisappear(): void {
this.breakpointSystem.unregister();
}
@Builder
aboutUi() {
Column() {
CustomTitleUI({titleName:'关于'})
CustomTitleUI({titleName:'关于',percent:this.percent})
Image($r('app.media.setting_about_logo'))
.width('278lpx')
.height('154lpx')
.margin({ top: '173lpx', bottom: '154lpx' })
.width(`${this.calcHeight(278)}lpx`)
.height(`${this.calcHeight(154)}lpx`)
.margin({ top: `${this.calcHeight2(173)}lpx`, bottom: `${this.calcHeight2(154)}lpx` })
.gesture(
TapGesture({ count: 2 })
.onAction((event: GestureEvent) => {
... ... @@ -77,28 +95,28 @@ export struct AboutPageUI {
})
}.divider({
strokeWidth: 1,
startMargin: '29lpx',
endMargin: '29lpx',
startMargin: `${this.calcHeight(29)}lpx`,
endMargin: `${this.calcHeight(29)}lpx`,
color: '#EDEDED'
})
Blank()
Image($r('app.media.about_us_code'))
.width('192lpx')
.height('192lpx')
.width(`${this.calcHeight(192)}lpx`)
.height(`${this.calcHeight(192)}lpx`)
Text(this.version)
.fontSize('25lpx')
.fontSize(`${this.calcHeight(25)}lpx`)
.textAlign(TextAlign.Center)
.fontColor($r("app.color.color_666666"))
.margin({ bottom: '31lpx' })
.margin({ bottom: `${this.calcHeight(31)}lpx` })
Text(this.message)
.fontSize('19lpx')
.fontSize(`${this.calcHeight(19)}lpx`)
.textAlign(TextAlign.Center)
.fontColor($r("app.color.color_999999"))
.margin({ bottom: '35lpx' })
.margin({ bottom: `${this.calcHeight(35)}lpx` })
}
.width('100%')
.height('100%')
... ... @@ -112,18 +130,30 @@ export struct AboutPageUI {
// 左侧标题
Text(`${item}`)
.fontColor('#666666')
.fontSize('31lpx')
.fontSize(`${this.calcHeight(31)}lpx`)
Image($r('app.media.mine_user_arrow'))
.width('27lpx')
.height('27lpx')
.width(`${this.calcHeight(27)}lpx`)
.height(`${this.calcHeight(27)}lpx`)
.objectFit(ImageFit.Auto)
}
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.SpaceBetween)
.height('97lpx')
.height(`${this.calcHeight(97)}lpx`)
.width('100%')
.padding({ left: '29lpx', right: '29lpx' })
.padding({ left:`${this.calcHeight(29)}lpx`, right: `${this.calcHeight(29)}lpx` })
}
calcHeight(value:number): number{
return value * this.percent
}
calcHeight2(value:number): number{
if(this.percent < 1){
return value * 0.3
}else{
return value * 1
}
}
}
... ...
import { BottomNavi, CommonConstants, SpConstants } from 'wdConstant';
import { Logger, SPHelper, StringUtils } from 'wdKit';
import { BreakpointSystem, Logger, SPHelper, StringUtils } from 'wdKit';
import PageViewModel from '../../viewmodel/PageViewModel';
import storageStatistics from "@ohos.file.storageStatistics";
import { BusinessError } from '@ohos.base';
... ... @@ -25,6 +25,17 @@ export struct MineSettingComponent {
@State cacheSize: number = 0
@State accountState:boolean=false
preferences: dataPreferences.Preferences | null = null;
@StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
private breakpointSystem = new BreakpointSystem();
@State percent:number = 1
currentChanged(){
if(this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"){
this.percent = 0.7
}else {
this.percent = 1
}
}
dialogController: CustomDialogController = new CustomDialogController({
builder: MyCustomDialog({
... ... @@ -43,6 +54,8 @@ export struct MineSettingComponent {
customStyle: true
})
aboutToAppear() {
this.breakpointSystem.register();
this.currentChanged()
// 获取设置页面数据
this.getSettingPageData()
... ... @@ -54,6 +67,10 @@ export struct MineSettingComponent {
}
aboutToDisappear(): void {
this.breakpointSystem.unregister();
}
async getAccountState(){
let userId=await SPHelper.default.get(SpConstants.USER_ID,'') as string
if(userId==''){
... ... @@ -91,13 +108,13 @@ export struct MineSettingComponent {
if (item.type == 0) {
Column() {
this.getArrowCell(item,index)
}.padding({ left: '27lpx' }).height('117lpx').justifyContent(FlexAlign.Center)
}.padding({ left: `${this.calcHeight(27)}lpx` }).height(`${this.calcHeight(117)}lpx`).justifyContent(FlexAlign.Center)
} else if (item.type == 1) {
Column() {
this.getSwitchCell(item,index)
}.padding({ left: '27lpx' }).height('117lpx').justifyContent(FlexAlign.Center)
}.padding({ left: `${this.calcHeight(27)}lpx` }).height(`${this.calcHeight(117)}lpx`).justifyContent(FlexAlign.Center)
} else {
Column().width('100%').height('15lpx').backgroundColor(0xf0f0f0)
Column().width('100%').height(`${this.calcHeight(15)}lpx`).backgroundColor(0xf0f0f0)
}
}
})
... ... @@ -112,7 +129,7 @@ export struct MineSettingComponent {
@Builder itemHead(text: string) {
// 列表分组的头部组件,对应联系人分组A、B等位置的组件
if (text.length > 0) {
Row().width('100%').height('20lpx').backgroundColor(0xf0f0f0)
Row().width('100%').height(`${this.calcHeight(20)}lpx`).backgroundColor(0xf0f0f0)
}
}
... ... @@ -125,28 +142,29 @@ export struct MineSettingComponent {
// 判断有没有图片
if (0) {
Image('https://pic.rmb.bdstatic.com/e182cf67c341d1128d2a6cc05886bf62.jpeg@s_0,h_2000')
.height('38lpx')
.margin({ right: '5lpx' })
.height(`${this.calcHeight(38)}lpx`)
.margin({ right: `${this.calcHeight(5)}lpx` })
Text(`${item.title}`)
.margin({ top: '8lpx' })
.height('38lpx')
.margin({ top: `${this.calcHeight(8)}lpx` })
.height(`${this.calcHeight(38)}lpx`)
.fontColor('#333333')
.fontSize('29lpx')
.fontSize(`${this.calcHeight(29)}lpx`)
} else {
Text(`${item.title}`)
.margin({ top: '8lpx' })
.height('38lpx')
.margin({ top: `${this.calcHeight(8)}lpx` })
.height(`${this.calcHeight(38)}lpx`)
.fontColor('#333333')
.fontSize('29lpx')
.fontSize(`${this.calcHeight(29)}lpx`)
}
}.width('60%')
// 右侧文案和右箭头
Row() {
Toggle({ type: ToggleType.Switch, isOn: item.switchState })
.height('50lpx')
.margin({ left: '81lpx', right: '29lpx' })
.height(`${this.calcHeight(50)}lpx`)
.width(`${this.calcHeight(96)}lpx`)
.margin({ left: `${this.calcHeight(81)}lpx`, right: `${this.calcHeight(29)}lpx` })
.selectedColor("#ED2800")
.onChange((isOn: boolean) => {
if(item.itemType=='push_switch'){
... ... @@ -168,13 +186,13 @@ export struct MineSettingComponent {
}
})
}.width('40%')
.margin({ right: '29lpx' })
.margin({ right: `${this.calcHeight(29)}lpx` })
.justifyContent(FlexAlign.End)
}
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.SpaceBetween)
}.height('54lpx')
}.height(`${this.calcHeight(54)}lpx`)
}
// 右文字+箭头cell
... ... @@ -185,10 +203,10 @@ export struct MineSettingComponent {
// 左侧logo和标题
Row() {
Text(`${item.title}`)
.margin({ top: '8lpx' })
.height('38lpx')
.margin({ top: `${this.calcHeight(8)}lpx` })
.height(`${this.calcHeight(38)}lpx`)
.fontColor('#333333')
.fontSize('29lpx')
.fontSize(`${this.calcHeight(29)}lpx`)
}.width('60%')
// 右侧文案和右箭头
... ... @@ -197,13 +215,13 @@ export struct MineSettingComponent {
.fontColor('#999999')
.maxLines(1)
Image($r('app.media.mine_user_arrow_2'))
.width('27lpx')
.height('27lpx')
.width(`${this.calcHeight(27)}lpx`)
.height(`${this.calcHeight(27)}lpx`)
.objectFit(ImageFit.Auto)
.interpolation(ImageInterpolation.High)
Column().width('29lpx')
Column().width(`${this.calcHeight(29)}lpx`)
}.width('40%')
.margin({ right: '29lpx' })
.margin({ right: `${this.calcHeight(29)}lpx` })
.justifyContent(FlexAlign.End)
}
... ... @@ -211,7 +229,7 @@ export struct MineSettingComponent {
.justifyContent(FlexAlign.SpaceBetween)
}
.height('54lpx')
.height(`${this.calcHeight(54)}lpx`)
.onClick(() => {
if (item.itemType == 'account') {
trackButtonClick("settingPageAccountManagement")
... ... @@ -266,6 +284,10 @@ export struct MineSettingComponent {
}
this.preferences.on('change', observer);
}
calcHeight(value:number): number{
return value * this.percent
}
}
function trackButtonClick(buttonName: string){
... ...
... ... @@ -33,7 +33,8 @@ export struct LikeComponent {
styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) 3 透明背景
@State likeCount: number = 0 //点赞数
pageParam: ParamType = {}
PageName: string = ''
@Consume pageName: string
@Consume pageId: string
//上层传值 样例
// this.data['contentId'] = '30035444649' //必须
... ... @@ -81,19 +82,6 @@ export struct LikeComponent {
'contentId': `${this.contentDetailData.newsId}`,
'contentName': `${this.contentDetailData.newsTitle || ''}`,
}
if(this.contentDetailData.newsType == 1) {
this.PageName = TrackConstants.PageName.VideoDetail // 点播
} else if(this.contentDetailData.newsType == 2) {
this.PageName = TrackConstants.PageName.Live_Detail // 直播
} else if(this.contentDetailData.newsType == 5) {
this.PageName = TrackConstants.PageName.Summary_Detail // 专题详情页
} else if(this.contentDetailData.newsType == 8) {
this.PageName = TrackConstants.PageName.Article_Detail // 图文详情页
} else if(this.contentDetailData.newsType == 9) {
this.PageName = TrackConstants.PageName.Atlas_Detail // 图集详情页
} else if(this.contentDetailData.newsType == 14 || this.contentDetailData.newsType == 15) {
this.PageName = TrackConstants.PageName.DynamicDetail // 动态图文/动态视频
}
}
build() {
... ... @@ -378,16 +366,16 @@ export struct LikeComponent {
if (this.contentDetailData.liveInfo) {
this.likeStatus = true
this.likeCount++
TrackingContent.like(true,this.PageName,this.PageName,this.pageParam)
TrackingContent.like(true,this.pageId,this.pageName,this.pageParam)
} else {
this.likeStatus = !this.likeStatus
//点赞和取消点赞成功后更新点赞数
if (this.likeStatus) {
this.likeCount++
TrackingContent.like(true,this.PageName,this.PageName,this.pageParam)
TrackingContent.like(true,this.pageId,this.pageName,this.pageParam)
} else {
this.likeCount--
TrackingContent.like(false,this.PageName,this.PageName,this.pageParam)
TrackingContent.like(false,this.pageId,this.pageName,this.pageParam)
}
}
... ...
... ... @@ -29,7 +29,6 @@ export struct LiveLikeComponent {
@State likeCount: number = 0 //点赞数
@State likeBean: Record<string, string> = {}
pageParam: ParamType = {}
PageName: string = ''
//上层传值 样例
// this.data['contentId'] = '30035444649' //必须
... ... @@ -66,9 +65,6 @@ export struct LiveLikeComponent {
'contentId': `${this.contentDetailData.newsId}`,
'contentName': `${this.contentDetailData.newsTitle || ''}`,
}
if (this.contentDetailData.newsType == 2) {
this.PageName = TrackConstants.PageName.Live_Detail // 直播
}
}
build() {
... ...
... ... @@ -11,7 +11,6 @@ import {
import router from '@ohos.router';
import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel';
import { LiveLikeComponent } from './LiveLikeComponent';
import { CommentTabComponent, CommentIconComponent, } from '../comment/view/CommentTabComponent';
import { publishCommentModel } from '../comment/model/PublishCommentModel'
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { PageRepository } from '../../repository/PageRepository';
... ... @@ -65,7 +64,8 @@ export struct LiveOperRowListView {
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State dialogController: CustomDialogController | null = null;
pageParam: ParamType = {}
PageName: string = ''
@Consume pageName: string
@Consume pageId: string
@State likesStyle: number | string = "love" // 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
... ... @@ -89,9 +89,6 @@ export struct LiveOperRowListView {
'contentId': `${this.contentDetailData.newsId}`,
'contentName': `${this.contentDetailData.newsTitle || ''}`,
}
if(this.contentDetailData.newsType == 2) {
this.PageName = TrackConstants.PageName.Live_Detail // 直播
}
}
async onDetailUpdated() {
... ... @@ -426,9 +423,9 @@ export struct LiveOperRowListView {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
if (this.newsStatusOfUser.collectStatus === 1) {
promptAction.showToast({ message: '收藏成功' })
TrackingContent.collect(true,this.PageName,this.PageName,this.pageParam)
TrackingContent.collect(true,this.pageId,this.pageName,this.pageParam)
} else {
TrackingContent.collect(false,this.PageName,this.PageName,this.pageParam)
TrackingContent.collect(false,this.pageId,this.pageName,this.pageParam)
}
this.queryContentInteractCount()
}
... ...
... ... @@ -89,7 +89,8 @@ export struct OperRowListView {
@State name: string = 'audio_recommend_status_wait'
@State dialogController: CustomDialogController | null = null;
pageParam: ParamType = {}
PageName: string = ''
@Consume pageName: string
@Consume pageId: string
@State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
... ... @@ -119,19 +120,6 @@ export struct OperRowListView {
'contentId': `${this.contentDetailData.newsId}`,
'contentName': `${this.contentDetailData.newsTitle || ''}`,
}
if(this.contentDetailData.newsType == 1) {
this.PageName = TrackConstants.PageName.VideoDetail // 点播
} else if(this.contentDetailData.newsType == 2) {
this.PageName = TrackConstants.PageName.Live_Detail // 直播
} else if(this.contentDetailData.newsType == 5) {
this.PageName = TrackConstants.PageName.Summary_Detail // 专题详情页
} else if(this.contentDetailData.newsType == 8) {
this.PageName = TrackConstants.PageName.Article_Detail // 图文详情页
} else if(this.contentDetailData.newsType == 9) {
this.PageName = TrackConstants.PageName.Atlas_Detail // 图集详情页
} else if(this.contentDetailData.newsType == 14 || this.contentDetailData.newsType == 15) {
this.PageName = TrackConstants.PageName.DynamicDetail // 动态图文/动态视频
}
}
async onDetailUpdated() {
... ... @@ -376,7 +364,7 @@ export struct OperRowListView {
TapGesture()
.onAction((event: GestureEvent) => {
this.AudioSuspension.setPlayerUrl(this.audioUrl, this.audioTitle)
TrackingButton.click('suspendedWindow',this.PageName,this.PageName)
TrackingButton.click('suspendedWindow',this.pageId,this.pageName)
}))
}
.height(36)
... ... @@ -473,9 +461,9 @@ export struct OperRowListView {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
if (this.newsStatusOfUser.collectStatus === 1) {
promptAction.showToast({ message: '收藏成功' })
TrackingContent.collect(true,this.PageName,this.PageName,this.pageParam)
TrackingContent.collect(true,this.pageId,this.pageName,this.pageParam)
} else {
TrackingContent.collect(false,this.PageName,this.PageName,this.pageParam)
TrackingContent.collect(false,this.pageId,this.pageName,this.pageParam)
}
this.queryContentInteractCount()
}
... ...
... ... @@ -300,6 +300,7 @@ export struct ENewspaperListDialog {
}.width('100%')
.height('100%')
.backgroundColor('#80000000')
.margin({bottom:44})
.onClick(() => {
if (this.closeDialog) {
this.closeDialog()
... ...
... ... @@ -8,6 +8,7 @@
"tablet",
"2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
"requestPermissions": [
{
... ...
... ... @@ -157,6 +157,10 @@
"value": "#0D000000"
},
{
"name": "color_B3000000",
"value": "#B3000000"
},
{
"name": "res_color_general_000000_30",
"value": "#4D000000"
}
... ...
... ... @@ -8,6 +8,7 @@
"tablet",
"2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
"requestPermissions": [
{
... ...
... ... @@ -36,6 +36,8 @@ export struct DetailPlayLiveCommon {
@Provide pageBackPress: number = -1
@Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
@Provide publishCommentModel: publishCommentModel = new publishCommentModel()
@Provide pageId: string = TrackConstants.PageName.Live_Detail
@Provide pageName: string = TrackConstants.PageName.Live_Detail
// 横屏或竖屏 general-竖屏,news-横屏
@State liveLandscape: string = ''
@State isLoading: boolean = false
... ...
... ... @@ -9,7 +9,7 @@ import { router, window } from '@kit.ArkUI';
import { WDAliPlayerController } from 'wdPlayer/Index';
import { LiveOperRowListView } from 'wdComponent';
import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
import { TrackConstants, TrackingContent } from 'wdTracking/Index';
import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index';
let TAG: string = 'DetailPlayLivePage';
... ... @@ -98,12 +98,9 @@ export struct DetailPlayLivePage {
this.lastInputedChatComment = result
}
// 发布评论埋点
TrackingContent.commentClick(TrackConstants.PageName.DynamicDetail, TrackConstants.PageName.DynamicDetail,
{
'contentType': `${this.contentDetailData.newsType}`,
'contentId': `${this.contentDetailData.newsId}`,
'contentName': `${this.contentDetailData.newsTitle || ''}`,
});
TrackingContent.commentClick(TrackConstants.PageName.Live_Detail,
TrackConstants.PageName.Live_Detail,
TrackParamConvert.contentDetail(this.contentDetailData));
})
}
}
... ...
... ... @@ -11,7 +11,7 @@ import { ChartItemCompereComponent } from './ChartItemCompereComponent'
import { ChatItemComponent } from './ChartItemComponent'
import { router } from '@kit.ArkUI'
import { EmitterEventId, EmitterUtils, Logger, SPHelper, WindowModel } from 'wdKit/Index'
import { TrackConstants, TrackingContent } from 'wdTracking/Index'
import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index'
const TAG = "PlayerCommentComponent"
/**
... ... @@ -120,12 +120,9 @@ export struct PlayerCommentComponent {
})
// 发布评论埋点
TrackingContent.commentClick(TrackConstants.PageName.DynamicDetail, TrackConstants.PageName.DynamicDetail,
{
'contentType': `${this.contentDetailData.newsType}`,
'contentId': `${this.contentDetailData.newsId}`,
'contentName': `${this.contentDetailData.newsTitle || ''}`,
});
TrackingContent.commentClick(TrackConstants.PageName.Live_Detail,
TrackConstants.PageName.Live_Detail,
TrackParamConvert.contentDetail(this.contentDetailData));
}
},
onBack: () => {
... ...
... ... @@ -8,6 +8,7 @@
"tablet",
"2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
"pages": "$profile:main_pages",
"requestPermissions": [
... ...
... ... @@ -13,7 +13,7 @@ import { PlayerBottomView } from '../view/PlayerBottomView';
import { PlayerRightView } from '../view/PlayerRightView';
import { DisplayDirection } from 'wdConstant/Index';
import { CommentDialogView } from '../view/CommentDialogView';
import { window } from '@kit.ArkUI';
import { componentUtils, window } from '@kit.ArkUI';
import { PlayerFullScreenView } from '../view/PlayerFullScreenView';
import { OperRowListView, publishCommentModel } from 'wdComponent/Index';
import { ParamType, TrackConstants } from 'wdTracking/Index';
... ... @@ -40,7 +40,7 @@ export struct DetailPlayShortVideoPage {
@Provide isOpenDetail: boolean = false // 查看详情按钮点击
@Provide isDragging: boolean = false // 拖动时间进度条
@Provide status: number = PlayerConstants.STATUS_START;
@Consume showCommentList: boolean
@Consume @Watch("showCommentListChanged") showCommentList: boolean
@Consume displayDirection: DisplayDirection
@Consume @Watch('videoStatusChange') switchVideoStatus: boolean
@Consume @Watch('pageShowChange') pageShow: number
... ... @@ -207,15 +207,18 @@ export struct DetailPlayShortVideoPage {
* 屏幕变化动态计算播放器宽高
*/
calculatePlayerRect() {
let width = this.windowWidth
let height = this.windowHeight
if (this.displayDirection === DisplayDirection.VERTICAL) {
width = this.windowWidth
height = this.windowHeight
} else {
width = this.windowHeight
height = this.windowWidth
}
const windowClass = WindowModel.shared.getWindowClass(); // 获取应用主窗口
const rect: window.Rect = windowClass.getWindowProperties().windowRect;
let width = rect.width
let height = rect.height
// if (this.displayDirection === DisplayDirection.VERTICAL) {
width = rect.width
height = rect.height
// } else {
// width = rect.height
// height = rect.width
// }
// 视频宽高比屏幕大,则宽度撑满
if (this.ratio > width / height) {
this.playerWidth = '100%'
... ... @@ -225,10 +228,19 @@ export struct DetailPlayShortVideoPage {
this.playerHeight = '100%'
this.playerWidth = px2vp(height * this.ratio)
}
console.log('calculatePlayerRect=====', this.windowWidth, this.windowHeight)
console.log('calculatePlayerRect=====', width, height)
}
showCommentListChanged() {
if (this.showCommentList) {
this.playerWidth = px2vp(this.windowWidth)
this.playerHeight = px2vp(this.windowWidth) / (16 / 9.0)
} else {
this.calculatePlayerRect()
}
}
build() {
Stack({ alignContent: Alignment.Top }) {
Column() {
... ... @@ -278,6 +290,7 @@ export struct DetailPlayShortVideoPage {
.width('100%')
}
.id('video-container')
.height('100%')
.width('100%')
.onAreaChange(() => this.calculatePlayerRect())
... ... @@ -305,7 +318,9 @@ export struct DetailPlayShortVideoPage {
@Builder
playerViewBuilder() {
Stack() {
Stack({
alignContent: this.showCommentList && this.index === this.currentIndex ? Alignment.Top : Alignment.Center
}) {
WDPlayerRenderView({
playerController: this.playerController,
onLoad: async () => {
... ... @@ -335,7 +350,6 @@ export struct DetailPlayShortVideoPage {
}
.width('100%')
.height('100%')
.align(Alignment.Center)
}
... ...
... ... @@ -31,6 +31,8 @@ export struct DetailVideoListPage {
@Provide switchVideoStatus: boolean = true
@Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL
@Provide showCommentList: boolean = false
@Provide pageName: string = TrackConstants.PageName.VideoDetail
@Provide pageId: string = TrackConstants.PageName.VideoDetail
@State data: ContentDetailDTO[] = []
@State currentIndex: number = 0
@State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
... ...
... ... @@ -30,7 +30,8 @@ const storage = LocalStorage.getShared();
@Component
export struct VideoChannelDetail {
private groupId: string = '' // 楼层id
private pageId: string = '' //页面id
@Provide private pageId: string = '' //页面id
@Provide private pageName: string = ''
private pageNum: number = 1
private pageSize: number = 5
private loadStrategy: string = 'first_load' // 首次加载: first_load, 上推刷新: push_up, 下拉刷新: pull_down
... ...
... ... @@ -41,7 +41,8 @@ export struct PlayerRightView {
@State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
pageParam: ParamType = {}
PageName: string = ''
@Consume pageName: string
@Consume pageId: string
followUserId: string = ''
followUserName: string = ''
... ... @@ -59,19 +60,6 @@ export struct PlayerRightView {
'contentId': `${this.contentDetailData.newsId}`,
'contentName': `${this.contentDetailData.newsTitle || ''}`,
}
if(this.contentDetailData.newsType == 1) {
this.PageName = TrackConstants.PageName.VideoDetail // 点播
} else if(this.contentDetailData.newsType == 2) {
this.PageName = TrackConstants.PageName.Live_Detail // 直播
} else if(this.contentDetailData.newsType == 5) {
this.PageName = TrackConstants.PageName.Summary_Detail // 专题详情页
} else if(this.contentDetailData.newsType == 8) {
this.PageName = TrackConstants.PageName.Article_Detail // 图文详情页
} else if(this.contentDetailData.newsType == 9) {
this.PageName = TrackConstants.PageName.Atlas_Detail // 图集详情页
} else if(this.contentDetailData.newsType == 14 || this.contentDetailData.newsType == 15) {
this.PageName = TrackConstants.PageName.DynamicDetail // 动态图文/动态视频
}
this.followUserId = this.contentDetailData?.rmhInfo?.rmhId || ''
this.followUserName = this.contentDetailData?.rmhInfo?.rmhName || ''
}
... ... @@ -104,11 +92,11 @@ export struct PlayerRightView {
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
if (this.newsStatusOfUser.likeStatus == '1') {
this.interactData.likeNum = Number(this.interactData.likeNum || 0) + 1
TrackingContent.like(true,this.PageName,this.PageName,this.pageParam)
TrackingContent.like(true,this.pageId,this.pageName,this.pageParam)
console.log(TAG, '点赞')
} else {
this.interactData.likeNum = Math.max(0, Number(this.interactData.likeNum || 0) - 1)
TrackingContent.like(false,this.PageName,this.PageName,this.pageParam)
TrackingContent.like(false,this.pageId,this.pageName,this.pageParam)
console.log(TAG, '取消点赞')
}
console.log(TAG, '点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum)
... ... @@ -144,11 +132,11 @@ export struct PlayerRightView {
// this.queryContentInteractCount()
if (this.newsStatusOfUser.collectStatus === 1) {
this.interactData.collectNum = Number(this.interactData.collectNum || 0) + 1
TrackingContent.collect(true,this.PageName,this.PageName,this.pageParam)
TrackingContent.collect(true,this.pageId,this.pageName,this.pageParam)
console.log(TAG, '收藏')
} else {
this.interactData.collectNum = Math.max(0, Number(this.interactData.collectNum || 0) - 1)
TrackingContent.collect(false,this.PageName,this.PageName,this.pageParam)
TrackingContent.collect(false,this.pageId,this.pageName,this.pageParam)
console.log(TAG, '取消收藏')
}
console.log(TAG, '收藏、取消收藏==', this.newsStatusOfUser?.collectStatus, this.interactData?.collectNum)
... ... @@ -212,7 +200,7 @@ export struct PlayerRightView {
}
})
console.log(TAG, '关注号主')
TrackingContent.follow(true,this.followUserId,this.followUserName,TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,this.pageParam)
TrackingContent.follow(true,this.followUserId,this.followUserName,this.pageId,this.pageName,this.pageParam)
}
})
}
... ...
... ... @@ -8,6 +8,7 @@
"tablet",
"2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
"pages": "$profile:main_pages"
}
... ...
... ... @@ -8,6 +8,7 @@
"tablet",
"2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
"pages": "$profile:main_pages"
}
... ...
... ... @@ -8,6 +8,7 @@
"tablet",
"2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
"pages": "$profile:main_pages",
"requestPermissions": [
... ...
... ... @@ -8,6 +8,7 @@
"tablet",
"2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true
}
}
\ No newline at end of file
... ...
import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils,CustomToast, StringUtils, NetworkUtil } from 'wdKit'
import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils,CustomToast, StringUtils, NetworkUtil,
BreakpointSystem } from 'wdKit'
import router from '@ohos.router'
import { LoginViewModel } from './LoginViewModel'
import { LoginInputComponent } from './LoginInputComponent'
... ... @@ -56,6 +57,17 @@ struct LoginPage {
loginViewModel = new LoginViewModel()
@State isProtocol:boolean=false
@StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
private breakpointSystem = new BreakpointSystem();
@State percent:number = 1
currentChanged(){
if(this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"){
this.percent = 0.7
}else {
this.percent = 1
}
}
onCodeSend() {
Logger.debug(TAG, "isCodeSend:" + this.isCodeSend + "")
if (this.isCodeSend) {
... ... @@ -66,6 +78,12 @@ struct LoginPage {
aboutToAppear() {
Logger.debug(TAG, "aboutToAppear:" + this.isCodeSend + "")
this.breakpointSystem.register();
this.currentChanged()
}
aboutToDisappear(): void {
this.breakpointSystem.unregister();
}
onPageShow() {
... ... @@ -144,10 +162,10 @@ struct LoginPage {
Text("登录")
.borderRadius(4)
.fontColor(this.isSubmit ? "#FFFFFFFF" : "#66FFFFFF")
.fontSize("31lpx")
.fontSize(`${this.calcHeight(31)}lpx`)
.fontWeight(400)
.margin({ top: 20 })
.lineHeight("50lpx")
.margin({ top: `${this.calcHeight(20)}` })
.lineHeight(`${this.calcHeight(50)}lpx`)
.height(44)
.textAlign(TextAlign.Center)
.width("100%")
... ... @@ -170,9 +188,9 @@ struct LoginPage {
if (!this.checkCodePage) {
Text('忘记密码')
.fontColor('#666666')
.fontSize("31lpx")
.fontSize(`${this.calcHeight(31)}lpx`)
.fontWeight(400)
.lineHeight("38lpx")
.lineHeight(`${this.calcHeight(38)}lpx`)
.margin({ top: 16 })
.onClick(() => {
TrackingButton.click("loginPageForgotPassword",TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page)
... ... @@ -217,7 +235,8 @@ struct LoginPage {
ProtocolComponent({
cancelMethod: (): void => this.cancelProtocol(),
agreeMethod: (): void => this.agreeProtocol()
agreeMethod: (): void => this.agreeProtocol(),
percent:$percent
})
.visibility(this.isProtocol ? Visibility.Visible : Visibility.None)
... ... @@ -301,15 +320,15 @@ struct LoginPage {
Row() {
Row() {
Image(this.checkCodePage ? $r('app.media.login_qt') : $r('app.media.login_other_password'))
.size({ width: "35lpx", height: "35lpx" })
.margin({right:"8lpx"})
.height("38lpx")
.width("38lpx")
.size({ width: `${this.calcHeight(35)}lpx`, height: `${this.calcHeight(35)}lpx` })
.margin({right:`${this.calcHeight(8)}lpx`})
.height(`${this.calcHeight(38)}lpx`)
.width(`${this.calcHeight(38)}lpx`)
Text(this.checkCodePage ? "密码登录" : "手机号登录")
.fontWeight(400)
.fontColor("#3D3D3D")
.fontSize("23lpx")
.lineHeight("38lpx")
.fontSize(`${this.calcHeight(23)}lpx`)
.lineHeight(`${this.calcHeight(38)}lpx`)
}
.onClick(() => {
this.onPageHide()
... ... @@ -332,7 +351,7 @@ struct LoginPage {
}.height(36)
.width('100%')
.padding({ left: 25, right: 25 })
.margin({ top: "46lpx" })
.margin({ top: `${this.calcHeight(46)}lpx` })
}
.width('100%')
.margin({ bottom: 40 })
... ... @@ -478,7 +497,9 @@ struct LoginPage {
.slide(SlideEffect.Right)
}
calcHeight(value:number): number{
return value * this.percent
}
}
... ... @@ -486,41 +507,42 @@ struct LoginPage {
struct ProtocolComponent {
cancelMethod?: () => void
agreeMethod?: () => void
@Link percent:number
build() {
Stack() {
Column() {
Text("温馨提示")
.fontColor("#222222")
.fontSize("35lpx")
.lineHeight("50lpx")
.fontSize(`${this.calcHeight(35)}lpx`)
.lineHeight(`${this.calcHeight(50)}lpx`)
.width("100%")
.fontWeight(500)
.textAlign(TextAlign.Center)
.margin({ top: "38lpx" })
.margin({ top: `${this.calcHeight(38)}lpx` })
Text() {
Span("为保障您的合法权益,请阅读并同意")
.fontSize("27lpx")
.lineHeight("42lpx")
.fontSize(`${this.calcHeight(27)}lpx`)
.lineHeight(`${this.calcHeight(42)}lpx`)
.fontWeight(400)
.fontColor("#666666")
Span("《用户协议》")
.fontSize("27lpx")
.lineHeight("42lpx")
.fontSize(`${this.calcHeight(27)}lpx`)
.lineHeight(`${this.calcHeight(42)}lpx`)
.fontWeight(400)
.fontColor("#ED2800")
.onClick(() => {
let bean = { contentID: "1", pageID: "" } as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
})
Span("及").fontSize("27lpx")
.lineHeight("42lpx")
Span("及").fontSize(`${this.calcHeight(27)}lpx`)
.lineHeight(`${this.calcHeight(42)}lpx`)
.fontWeight(400)
.fontColor("#666666")
Span("《隐私政策》")
.fontSize("27lpx")
.lineHeight("42lpx")
.fontSize(`${this.calcHeight(27)}lpx`)
.lineHeight(`${this.calcHeight(42)}lpx`)
.fontWeight(400)
.fontColor("#ED2800")
.onClick(() => {
... ... @@ -528,20 +550,20 @@ struct ProtocolComponent {
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
})
Span("后进行登录")
.fontSize("27lpx")
.lineHeight("42lpx")
.fontSize(`${this.calcHeight(27)}lpx`)
.lineHeight(`${this.calcHeight(42)}lpx`)
.fontWeight(400)
.fontColor("#666666")
}.margin({ top: "23lpx", left: "31lpx", right: "31lpx" })
}.margin({ top: `${this.calcHeight(23)}lpx`, left: `${this.calcHeight(31)}lpx`, right: `${this.calcHeight(31)}lpx` })
.wordBreak(WordBreak.BREAK_ALL)
.textAlign(TextAlign.Start)
Divider().color("#f5f5f5").width("100%").margin({ top: "27lpx" }).height('1lpx').strokeWidth('1lpx')
Divider().color("#f5f5f5").width("100%").margin({ top: `${this.calcHeight(27)}lpx` }).height(`${this.calcHeight(1)}lpx`).strokeWidth(`${this.calcHeight(1)}lpx`)
Row() {
Text('放弃登录')
.fontSize("31lpx")
.fontSize(`${this.calcHeight(31)}lpx`)
.fontWeight(500)
.lineHeight("42lpx")
.lineHeight(`${this.calcHeight(42)}lpx`)
.fontColor("#999999")
.layoutWeight(1)
.textAlign(TextAlign.Center)
... ... @@ -553,17 +575,17 @@ struct ProtocolComponent {
.height('100%')
Divider()
.width("1lpx")
.strokeWidth('1lpx')
.width(`${this.calcHeight(1)}lpx`)
.strokeWidth(`${this.calcHeight(1)}lpx`)
.vertical(true)
.height('100%')
.color("#F5F5F5")
Text('同意并登录')
.fontSize("31lpx")
.fontSize(`${this.calcHeight(31)}lpx`)
.fontWeight(500)
.lineHeight("42lpx")
.lineHeight(`${this.calcHeight(42)}lpx`)
.fontColor("#ED2800")
.layoutWeight(1)
.textAlign(TextAlign.Center)
... ... @@ -582,15 +604,19 @@ struct ProtocolComponent {
.justifyContent(FlexAlign.Center)
}
.backgroundColor(Color.White)
.borderRadius("12lpx")
.width("528lpx")
.height("309lpx")
.borderRadius(`${this.calcHeight(12)}lpx`)
.width(`${this.calcHeight(528)}lpx`)
.height(`${this.calcHeight(309)}lpx`)
}.width('100%')
.height('100%')
.backgroundColor('#66000000')
}
calcHeight(value:number): number{
return value * this.percent
}
}
function trackTypeClick(typeValue: number,pageId: string){
... ...
import { CustomToast, DateTimeUtils} from 'wdKit/Index';
import { BreakpointSystem, CustomToast, DateTimeUtils} from 'wdKit/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { LoginModel } from './LoginModel';
import { ModifyPasswordRequestItem } from './ModifyPasswordRequestItem';
... ... @@ -29,6 +29,27 @@ struct ModifyPasswordPage {
})
pageShowTime:number = 0;
pageHideTime:number = 0;
@StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
private breakpointSystem = new BreakpointSystem();
@State percent:number = 1
currentChanged(){
if(this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"){
this.percent = 0.7
}else {
this.percent = 1
}
}
aboutToAppear() {
this.breakpointSystem.register();
this.currentChanged()
}
aboutToDisappear(): void {
this.breakpointSystem.unregister();
}
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
... ... @@ -42,25 +63,54 @@ struct ModifyPasswordPage {
}
build() {
Row() {
Column() {
Column(){
this.TitleBackComponent('')
this.ModifyPasswordLayout()
}
.width('100%')
.height('100%')
}.width('100%')
.height('100%')
}
@Builder TitleBackComponent(title:string){
RelativeContainer() {
Text(title)
.fontColor('#FF333333')
.fontSize(18)
.textAlign(TextAlign.Center)
.height(44)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start },
right: { anchor: "__container__", align: HorizontalAlign.End },
})
.id('titleContent')
Image($r("app.media.login_back_icon"))
.objectFit(ImageFit.Auto)
.height(24)
.width(24)
.margin({
left: 16, top: 8
})
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start },
})
.onClick(() => {
router.back()
})
.id('backImage')
}.height(44)
}
@Builder ModifyPasswordLayout(){
Navigation() {
Column(){
Column() {
Text("修改密码").fontWeight(FontWeight.Bold).fontSize(20).maxLines(1)
}
.width('100%')
.height('75lpx')
.height(`${this.calcHeight(75)}lpx`)
.alignItems(HorizontalAlign.Start)
Row() {
... ... @@ -77,12 +127,12 @@ struct ModifyPasswordPage {
})
}
.alignItems(VerticalAlign.Center)
.height('80lpx')
.height(`${this.calcHeight(80)}lpx`)
.backgroundColor('#f5f5f5')
.borderRadius('4vp')
}
.width('100%')
.height('110lpx')
.height(`${this.calcHeight(110)}lpx`)
.backgroundColor(0xffffff0)
.alignItems(VerticalAlign.Center)
... ... @@ -100,12 +150,12 @@ struct ModifyPasswordPage {
})
}
.alignItems(VerticalAlign.Center)
.height('80lpx')
.height(`${this.calcHeight(80)}lpx`)
.backgroundColor('#f5f5f5')
.borderRadius('4vp')
}
.width('100%')
.height('110lpx')
.height(`${this.calcHeight(110)}lpx`)
.backgroundColor(0xffffff0)
.alignItems(VerticalAlign.Center)
... ... @@ -123,32 +173,32 @@ struct ModifyPasswordPage {
})
}
.alignItems(VerticalAlign.Center)
.height('80lpx')
.height(`${this.calcHeight(80)}lpx`)
.backgroundColor('#f5f5f5')
.borderRadius('4vp')
}
.width('100%')
.height('110lpx')
.height(`${this.calcHeight(110)}lpx`)
.backgroundColor(0xffffff0)
.alignItems(VerticalAlign.Center)
Column() {
Text("提示:密码长度6~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:'10lpx'})
Text("提示:密码长度6~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:`${this.calcHeight(10)}lpx`})
}
.width('100%')
.height('85lpx')
.height(`${this.calcHeight(85)}lpx`)
.alignItems(HorizontalAlign.Start)
Row() {
Button( { type: ButtonType.Normal, stateEffect: true }){
Text("确认")
.fontColor("#fff")
.fontSize("35lpx")
.lineHeight("50lpx")
.fontSize(`${this.calcHeight(35)}lpx`)
.lineHeight(`${this.calcHeight(50)}lpx`)
.opacity(this.btnStatus ?1:0.5)
}
.width('100%')
.height('80lpx')
.height(`${this.calcHeight(80)}lpx`)
.backgroundColor(this.btnStatus ? '#ED2800' : '#99ED2800')
.borderRadius('4vp')
.onClick(() => {
... ... @@ -158,25 +208,22 @@ struct ModifyPasswordPage {
}
})
}
.padding({top:'25lpx'})
.padding({top:`${this.calcHeight(25)}lpx`})
.alignItems(VerticalAlign.Center)
.width('100%')
.height('120lpx')
.height(`${this.calcHeight(120)}lpx`)
Column() {
Text("忘记密码").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:'10lpx'})
Text("忘记密码").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:`${this.calcHeight(10)}lpx`})
.onClick(()=>{
WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage)
})
}
.width('100%')
.height('85lpx')
.height(`${this.calcHeight(85)}lpx`)
.alignItems(HorizontalAlign.Center)
}.padding({top:"92lpx",left:"48lpx",right:"48lpx"})
}.padding({top:`${this.calcHeight(92)}lpx`,left:`${this.calcHeight(48)}lpx`,right:`${this.calcHeight(48)}lpx`})
}.titleMode(NavigationTitleMode.Mini)
.backButtonIcon($r("app.media.login_back_icon"))
.title('')
}
inputTextChange(){
... ... @@ -211,6 +258,10 @@ struct ModifyPasswordPage {
this.toastText = msg
this.dialogToast.open()
}
calcHeight(value:number): number{
return value * this.percent
}
}
... ...
... ... @@ -8,6 +8,7 @@
"tablet",
"2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
"pages": "$profile:main_pages"
}
... ...
... ... @@ -103,6 +103,7 @@ export class WDPlayerController {
case AVPlayerStatus.PLAYING:
this.setBright();
this.status = PlayerConstants.STATUS_START;
this.avPlayer!.videoScaleType = media.VideoScaleType.VIDEO_SCALE_TYPE_FIT
this.watchStatus();
break;
case AVPlayerStatus.PAUSED:
... ...
import componentUtils from '@ohos.arkui.componentUtils';
import { WDPlayerController } from '../controller/WDPlayerController'
import { WindowModel } from 'wdKit';
import { Logger } from '../utils/Logger';
import { Logger, WindowModel } from 'wdKit';
import { enableAliPlayer } from '../utils/GlobalSetting';
import json from '@ohos.util.json';
import { JSON } from '@kit.ArkTS';
class Size {
width: Length = "100%";
... ... @@ -82,12 +83,17 @@ export struct WDPlayerRenderView {
libraryname: enableAliPlayer && this.enableAliPlayer ? "premierlibrary" : undefined,
controller: this.xComponentController
})
.id(this.insId)
.onLoad(async (event) => {
Logger.info(TAG, 'onLoad')
this.xComponentController.setXComponentSurfaceSize({
surfaceWidth: 1920,
surfaceHeight: 1080
if (this.videoHeight > 0 && this.videoWidth > 0) {
this.xComponentController.setXComponentSurfaceRect({
surfaceWidth: this.videoWidth,
surfaceHeight: this.videoHeight
});
}
if (enableAliPlayer && this.enableAliPlayer) {
this.playerController?.setSurfaceId(this.insId)
} else {
... ... @@ -98,8 +104,8 @@ export struct WDPlayerRenderView {
}
})
.zIndex(1000)
.width(this.selfSize.width)
.height(this.selfSize.height)
// .width(this.selfSize.width)
// .height(this.selfSize.height)
}
.onAreaChange(() => {
this.updateLayout()
... ... @@ -108,19 +114,55 @@ export struct WDPlayerRenderView {
.justifyContent(FlexAlign.Center)
.height('100%')
.width('100%')
.align(this.videoWidth > this.videoHeight ? Alignment.Top : Alignment.Center)
// .align(this.videoWidth > this.videoHeight ? Alignment.Top : Alignment.Center)
.align(Alignment.Center)
}
updateLayout() {
let info = componentUtils.getRectangleById(this.insId);
if (info.size.width > 0 && info.size.height > 0 && this.videoHeight > 0 && this.videoWidth > 0) {
if (info.size.width / info.size.height > this.videoWidth / this.videoHeight) {
let scale = info.size.height / this.videoHeight;
this.selfSize = new Size((this.videoWidth * scale / info.size.width) * 100 + "%", '100%');
} else {
let scale = info.size.width / this.videoWidth;
this.selfSize = new Size('100%', (this.videoHeight * scale / info.size.height) * 100 + "%");
Logger.debug(TAG, "播放器区域变化: " + JSON.stringify(info))
Logger.debug(TAG, "xComponent rect: " + JSON.stringify(this.xComponentController.getXComponentSurfaceRect()))
if (info.size.width > 0 && info.size.height > 0) {
// 竖屏
if (this.videoHeight > 0 && this.videoWidth > 0 && this.videoWidth < this.videoHeight) {
let ratio = this.videoWidth / this.videoHeight
const height = info.size.width / ratio
// 竖屏,缩放高度大于 视频区域高度
if (height > info.size.height) {
Logger.debug(TAG, "ratio = " + ratio + " ==> new height = " + height)
Logger.debug(TAG, "高度固定,求宽度: " + info.size.height * ratio)
this.xComponentController.setXComponentSurfaceRect({
surfaceWidth: info.size.height * ratio,
surfaceHeight: info.size.height
});
return
}
}
this.xComponentController.setXComponentSurfaceRect({
surfaceWidth: info.size.width,
surfaceHeight: info.size.height
});
}
// if (info.size.width > 0 && info.size.height > 0 && this.videoHeight > 0 && this.videoWidth > 0) {
// if (info.size.width / info.size.height > this.videoWidth / this.videoHeight) {
// let scale = info.size.height / this.videoHeight;
// this.selfSize = new Size((this.videoWidth * scale / info.size.width) * 100 + "%", '100%');
// } else {
// let scale = info.size.width / this.videoWidth;
// this.selfSize = new Size('100%', (this.videoHeight * scale / info.size.height) * 100 + "%");
// }
// }
}
}
\ No newline at end of file
... ...
... ... @@ -8,6 +8,7 @@
"tablet",
"2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
"pages": "$profile:main_pages",
... ...
... ... @@ -8,6 +8,7 @@
"tablet",
"2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
"pages": "$profile:main_pages"
}
... ...
... ... @@ -135,6 +135,9 @@ export namespace TrackConstants {
/// 我的预约
My_Saved_Live = "mySavedLivePage",
/// 直播预约更多列表
Live_Appointment_List = "liveSubscribeListPage",
/// 兴趣选择
Preference_Selection = "preferenceSelectionPage",
/// 升级页面
... ...
import { CompInfoBean, ContentDetailDTO, ContentDTO, PageInfoBean, PageInfoDTO } from 'wdBean/Index';
import { StringUtils } from 'wdKit/Index';
import { ParamType } from './PublicParams';
import { TrackConstants } from './TrackConstants';
import { TrackingUtils } from './TrackingUtils';
... ... @@ -22,17 +23,40 @@ export class TrackParamConvert {
static pageCompProgram(pageInfo?: PageInfoDTO, comp?: CompInfoBean, program?: ContentDTO) : ParamType {
let params = TrackingUtils.generateParams()
//TODO: 转换参数
if (pageInfo) {
params["pageName"] = pageInfo.name
params["pageId"] = pageInfo.id + ''
TrackParamConvert.appendRecommendPageInfo(pageInfo, params)
}
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)
if (program.liveInfo) {
params["liveType"] = program.liveInfo.liveState
params["liveStreamType"] = ((program.liveInfo.vrType + '') == "1") ? "2" : "1"
params["vliveId"] = program.objectId
params["vliveName"] = program.newsTitle
}
//TODO: 转换参数
if (!StringUtils.isEmpty(program.linkUrl)) {
params["linkUrl"] = program.linkUrl
}
if (program.rmhInfo && program.rmhInfo.rmhId) {
params["saAuthorId"] = program.rmhInfo.rmhId || ""
params["saAuthorName"] = program.rmhInfo.rmhName || ""
}
TrackParamConvert.appendRecommendProgram(program, params)
}
return params
}
... ... @@ -79,10 +103,68 @@ export class TrackParamConvert {
return param
}
private static appendRecommend(detail: object, to: ParamType) {
private static appendRecommend(detail: ContentDetailDTO, to: ParamType) {
//TODO: ContentDetailDTO 增加推荐字段
to["sceneId"] = !StringUtils.isEmpty(detail.sceneId) ? detail.sceneId : "9999"
to["subSceneId"] = !StringUtils.isEmpty(detail.subSceneId) ? detail.subSceneId : ""
//to["cnsTraceId"] = !StringUtils.isEmpty(detail.cnsTraceId) ? detail.cnsTraceId : "selfHold"
to["cnsTraceId"] = "selfHold"
to["itemId"] = !StringUtils.isEmpty(detail.itemId) ? detail.itemId : ""
// to["expIds"] = !StringUtils.isEmpty(detail.expIds) ? detail.expIds : ""
to["expIds"] = ""
/// 这里填写默认值,后续在分享处 再重写
to["shareChannel"] = ""
/// 这里填写默认值,后续在action=browse时,再重写
to["duration"] = 0
}
private static appendRecommendProgram(program: ContentDTO, to: ParamType) {
to["sceneId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "9999"
to["subSceneId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : ""
to["cnsTraceId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "selfHold"
to["itemId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : ""
to["expIds"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : ""
/// 这里填写默认值,后续在分享处 再重写
to["shareChannel"] = ""
/// 这里填写默认值,后续在action=browse时,再重写
to["duration"] = 0
}
private static appendRecommendCompInfo(program: CompInfoBean, to: ParamType) {
// TODO:
// to["sceneId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "9999"
// to["subSceneId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : ""
// to["cnsTraceId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "selfHold"
// to["itemId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : ""
// to["expIds"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : ""
/// 这里填写默认值,后续在分享处 再重写
to["shareChannel"] = ""
/// 这里填写默认值,后续在action=browse时,再重写
to["duration"] = 0
}
private static appendRecommendPageInfo(program: PageInfoDTO, to: ParamType) {
// TODO:
// to["sceneId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "9999"
// to["subSceneId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : ""
// to["cnsTraceId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "selfHold"
// to["itemId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : ""
// to["expIds"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : ""
/// 这里填写默认值,后续在分享处 再重写
to["shareChannel"] = ""
/// 这里填写默认值,后续在action=browse时,再重写
to["duration"] = 0
}
private static appendRecommendPageInfoBean(program: PageInfoBean, to: ParamType) {
to["sceneId"] = "9999"
to["subSceneId"] = ""
to["cnsTraceId"] = "selfHold"
... ... @@ -95,6 +177,13 @@ export class TrackParamConvert {
to["duration"] = 0
}
// 'sceneId': contentDTO.sceneId,
// 'subSceneId': contentDTO.subSceneId,
// 'cnsTraceId': contentDTO.cnsTraceId,
// 'cardItemId': compDTO.cardItemId,
// 'itemId': compDTO.itemId || contentDTO.itemId,
// 'expIds': compDTO.expIds || contentDTO.expIds
///早晚报 专题
static pageInfoBean_ParamType(pageInfo: PageInfoBean) : ParamType {
... ... @@ -128,7 +217,8 @@ export class TrackParamConvert {
"channelSourceId": pageInfo.name,
"pageId": 'summaryDetailPage',
}
TrackParamConvert.appendRecommend(pageInfo, param)
TrackParamConvert.appendRecommendPageInfoBean(pageInfo, param)
return param
}
... ...
... ... @@ -8,6 +8,7 @@
"tablet",
"2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
"pages": "$profile:main_pages"
}
... ...
... ... @@ -2,6 +2,7 @@ import { Action } from 'wdBean';
import { ImageAndTextPageComponent } from 'wdComponent'
import { Logger } from 'wdKit'
import router from '@ohos.router';
import { TrackConstants } from 'wdTracking/Index';
const TAG = 'ImageAndTextDetailPage';
... ... @@ -10,6 +11,9 @@ const TAG = 'ImageAndTextDetailPage';
struct ImageAndTextDetailPage {
action: Action = {} as Action
@Provide pageName: string = TrackConstants.PageName.Article_Detail
@Provide pageId: string = TrackConstants.PageName.Article_Detail
build() {
Column() {
ImageAndTextPageComponent({action: this.action})
... ...
... ... @@ -3,6 +3,7 @@ import { SpacialTopicPageComponent } from 'wdComponent'
import { CommonConstants } from 'wdConstant'
import { Logger } from 'wdKit'
import router from '@ohos.router';
import { TrackConstants } from 'wdTracking/Index';
const TAG = 'SpacialTopicPage';
... ... @@ -12,6 +13,10 @@ struct SpacialTopicPage {
@State action: Action = {} as Action
@State reload: number = 0
@State count: number = 0
@Provide pageName: string = TrackConstants.PageName.Summary_Detail
@Provide pageId: string = TrackConstants.PageName.Summary_Detail
build() {
Column() {
SpacialTopicPageComponent({ action: this.action ,reload:this.reload })
... ...
... ... @@ -2,6 +2,8 @@ import { Logger } from 'wdKit';
import { AudioDetailComponent } from 'wdComponent';
import router from '@ohos.router';
import { Params, Action } from 'wdBean';
import { TrackConstants } from 'wdTracking/Index';
const TAG = 'AudioDetail';
@Entry
@Component
... ... @@ -11,6 +13,9 @@ struct AudioDetail {
@State contentId: string = ''
@State relType: string = ''
@Provide pageId: string = TrackConstants.PageName.Audio_Detail
@Provide pageName: string = TrackConstants.PageName.Audio_Detail
build() {
Column() {
AudioDetailComponent({
... ...
... ... @@ -13,6 +13,9 @@ struct DynamicDetailPage {
@State contentId: string = ''
@State relType: string = ''
@Provide pageName: string = TrackConstants.PageName.DynamicDetail
@Provide pageId: string = TrackConstants.PageName.DynamicDetail
build() {
Column() {
DynamicDetailComponent({
... ...
... ... @@ -19,6 +19,8 @@ struct MultiPictureDetailPage {
@State relType: string = ''
pageShowTime:number = 0;
pageHideTime:number = 0;
@Provide pageId: string = TrackConstants.PageName.Atlas_Detail
@Provide pageName: string = TrackConstants.PageName.Atlas_Detail
build() {
Row() {
... ...
... ... @@ -27,6 +27,7 @@ struct Index {
@State name: string = 'audio_status_wait';
async aboutToAppear() {
window.findWindow("subWindow").setWindowBackgroundColor("#00000000")
this.AudioSuspension.playerController.get().onTimeUpdate = (position, duration) => {
this.currentTime = DateFormatUtil.convertMillisecondsToMinutesSeconds(position);
this.totalTime = DateFormatUtil.convertMillisecondsToMinutesSeconds(duration);
... ...
... ... @@ -46,52 +46,6 @@ export default struct CustomDialogComponent {
}
.width('90%').lineHeight(22)
Row(){
// Button(){
// Text($r('app.string.privacy_text_title_policy'))
// .fontSize('27lpx')
// .fontColor(Color.Red)
// .margin({left:'10lpx',right:'10lpx'})
// }
// .width('90%')
// .height('56lpx')
// .margin({top:'54lpx',right:'19lpx'})
// .backgroundColor('#80000000')
// .onClick(() => {
//
// })
// Button(){
// Text($r('app.string.privacy_text_title_protocol'))
// .fontSize('27lpx')
// .fontColor(Color.Red)
// .margin({left:'10lpx',right:'10lpx'})
// }
// .width('90%')
// .height('56lpx')
// .margin({top:'54lpx',right:'19lpx'})
// .backgroundColor('#80000000')
// .onClick(() => {
//
// })
// Navigator({ target: 'pages/PrivacyPage', type: NavigationType.Push }) {
// Button($r('app.string.privacy_text_title_policy'))
// .onClick(()=>{
// GlobalContext.getContext().setObject('isJumpPrivacy', true);
// })
// {
// // Text($r('app.string.privacy_text_title_policy'))
// // .fontSize($r('app.float.dialog_common_text_size'))
// // .width('50%')
// // .fontColor(Color.Red)
// // .onClick(() => {
// // GlobalContext.getContext().setObject('isJumpPrivacy', true);
// // })
// }
// .fancy(Const.MainConstant_BUTTON_MARGIN_TOP)
// }
// .params({ path: 'https://www.baidu.com', tips: '在线' } as NavigatorModel)
Text($r('app.string.privacy_text_title_policy'))
.fontSize($r('app.float.dialog_common_text_size'))
.width('40%')
... ... @@ -100,14 +54,6 @@ export default struct CustomDialogComponent {
let bean={contentID:"2",pageID:""} as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage,bean)
//GlobalContext.getContext().setObject('isJumpPrivacy', true);
//WDRouterRule.jumpWithPage(WDRouterPage.privacyPage)
// router.pushUrl({
// url: 'pages/PrivacyPage'
// }).catch((error: Error) => {
// //Logger.error(CommonConstants.CUSTOM_DIALOG_TAG, 'CustomDialog pushUrl error ' + JSON.stringify(error));
// });
})
Text($r('app.string.privacy_text_title_protocol'))
.fontSize($r('app.float.dialog_common_text_size'))
... ... @@ -117,30 +63,25 @@ export default struct CustomDialogComponent {
let bean={contentID:"1",pageID:""} as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage,bean)
//GlobalContext.getContext().setObject('isJumpPrivacy', true);
//WDRouterRule.jumpWithPage(WDRouterPage.privacyPage)
// router.pushUrl({
// url: 'pages/PrivacyPage'
// }).catch((error: Error) => {
// //Logger.error(CommonConstants.CUSTOM_DIALOG_TAG, 'CustomDialog pushUrl error ' + JSON.stringify(error));
// });
})
}
.margin({
top:'36lpx',
bottom:'21lpx'
}).visibility(Visibility.None)
Row() {
Text($r('app.string.dialog_text_privacy_statement'))
.width('90%')
.fontColor($r('app.color.dialog_text_color'))
.fontSize(14).margin({top:20})
}.width('90%')
.justifyContent(FlexAlign.Center)
Divider()
.color('#f5f5f5')
.width('100%')
.strokeWidth(1)
.padding({left:16,right:16,top:22})
.padding({top:22})
Row() {
Row() {
Text($r('app.string.dialog_button_disagree'))
.fancy()
... ... @@ -148,24 +89,30 @@ export default struct CustomDialogComponent {
this.controller.close();
this.cancel();
})
Blank()
.backgroundColor($r('app.color.dialog_blank_background_color'))
.width($r('app.float.dialog_blank_width'))
.height($r('app.float.dialog_blank_height'))
}.width("50%")
// Blank()
// .backgroundColor($r('app.color.dialog_blank_background_color'))
// .width($r('app.float.dialog_blank_width'))
// .height($r('app.float.dialog_blank_height'))
Row() {
Text($r('app.string.dialog_button_agree'))
.fancyAgree()
.onClick(() => {
this.controller.close();
this.confirm();
})
}.width("50%")
.height("100%")
.backgroundColor($r("app.color.dialog_fancy_text_right_color"))
}
.margin({ bottom: '21lpx',top:'22lpx' })
.width("100%")
.height(44)
.margin({top: 1})
}
.width('528lpx')
.borderRadius('15')
.backgroundColor(Color.White)
.clip(true)
}
... ... @@ -182,7 +129,8 @@ export default struct CustomDialogComponent {
}
// Common text styles.
@Extend(Text) function fancyAgree () {
.fontColor($r("app.color.dialog_fancy_text_right_color"))
.backgroundColor($r("app.color.dialog_fancy_text_right_color"))
.fontColor($r("app.color.white"))
.fontSize(16)
.textAlign(TextAlign.Center)
.fontWeight(FontWeight.Medium)
... ...
... ... @@ -167,6 +167,7 @@ export struct VideoChannelPage {
topNavIndex: $currentTopNavSelectedIndex,
groupId: this.groupId + '',
pageId: item.pageId + '',
pageName: item.name + '',
channelId: item.channelId + '',
autoRefresh: this.autoRefresh,
})
... ... @@ -178,7 +179,9 @@ export struct VideoChannelPage {
pageId: item.pageId + '',
channelId: item.channelId + '',
autoRefresh: this.autoRefresh
}).margin({ top: 40 })
})
.margin({ top: 40 })
.backgroundColor(Color.White)
}
}, (item: TopNavDTO) => item.channelId + '')
}
... ...
... ... @@ -9,6 +9,7 @@
"tablet",
"2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
... ...