wangliang_wd

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

* 'main' of http://192.168.1.42/developOne/harmonyPool: (67 commits)
  feat:直播频道的tab背景色高度不够
  feat:直播间背景图 高斯模糊
  feat:进入横屏多路直播-置空-评论预显示禁止直播间,大家聊不支持下拉刷新
  feat:直播详情直播间组件刷新清理页面数据
  漏提
  专题web,修改
  组件复用,待调
  ref |> 工程target依赖 productRelease
  ref |> 增加工程配置 productRelease + 发布证书 + 发布profile
  视频栏目下视频与直播进行滑动切换时存在一个很明显的黑色背景的骨架图加载残留
  -fix bug修复
  feat: 17543 功能缺陷-页面加载-信息流图片加载,手机打开仅wifi加载图片控制,进入教育频道,长图图片未显示
  -fix bug修复
  fix:somobug
  fix:somobug
  fix:轮播图卡修改底部样式
  feat: 18425 人民号小视频卡展现样式鸿蒙与安卓不一致标题显示的行数未能显示4行
  feat: 18453 小视频横滑卡-选择不跳转右滑至卡片结尾不该展示查看更多按钮
  feat: 滑动卡片样式
  ref |> 增加直播预约更多列表页面的埋点事件
  ...
Showing 100 changed files with 1665 additions and 886 deletions
... ... @@ -20,14 +20,27 @@
"name": "default",
"type": "HarmonyOS",
"material": {
"storePassword": "0000001EF28F8A628911F4F52B75E452C814EE4370854DD8DFCE186496B6AD88F8DE5AD3E10F24C1079F2EDD1FFF",
"certpath": "./singing_config/manual_com.peopledailychina.hosactivity_sign/鸿蒙中文版客户端证书.cer",
"storePassword": "0000001E857CAD6D7E7172B6C87426344CEF8CC3281AB0461B4FA467DA64A1E11BD35929D150343E5D8E1EEE2740",
"keyAlias": "peopledailyhosalias",
"keyPassword": "0000001E2E8A50EFF2E6D2023242B432388B2748F8299D8BB319C0B06CFF7DCEA7482C5E3CDF1398CCE095BDC68B",
"keyPassword": "0000001E383EA87F51D8B158D5D1FC9ACC10179A0C93E81FD01B2E24D5B449EF1E50789BCEBC4FA09E3E5445C12A",
"profile": "./singing_config/manual_com.peopledailychina.hosactivity_sign/peopledaiychina-hos-profile-debugDebug.p7b",
"signAlg": "SHA256withECDSA",
"storeFile": "./singing_config/manual_com.peopledailychina.hosactivity_sign/keystorefile.p12"
}
},
{
"name": "release",
"type": "HarmonyOS",
"material": {
"storePassword": "0000001E423C7B1ED6AA1EC296F8E9D84C03F7D2E2BD770655E9EABA798E457E15B4D993CCA36416B0200E92DED7",
"certpath": "./singing_config/manual_com.peopledailychina.hosactivity_sign/鸿蒙中文版客户端证书正式.cer",
"keyAlias": "peopledailyhosalias",
"keyPassword": "0000001E9C2E794B52FC032F4C6ED037D72ADAAC76F3F0F001342A7D79ABE3A45E01FA86911A0510DB2B532847E2",
"profile": "./singing_config/manual_com.peopledailychina.hosactivity_sign/peopledailychina-hos-profile-releaseRelease.p7b",
"signAlg": "SHA256withECDSA",
"storeFile": "./singing_config/manual_com.peopledailychina.hosactivity_sign/keystorefile.p12"
}
}
],
"products": [
... ... @@ -37,6 +50,13 @@
"compileSdkVersion": "5.0.0(12)",
"compatibleSdkVersion": "5.0.0(12)",
"runtimeOS": "HarmonyOS",
},
{
"name": "productRELEASE",
"signingConfig": "release",
"compileSdkVersion": "5.0.0(12)",
"compatibleSdkVersion": "5.0.0(12)",
"runtimeOS": "HarmonyOS",
}
],
"buildModeSet": [
... ... @@ -56,7 +76,8 @@
{
"name": "default",
"applyToProducts": [
"default"
"default",
"productRELEASE"
]
}
]
... ... @@ -68,7 +89,8 @@
{
"name": "default",
"applyToProducts": [
"default"
"default",
"productRELEASE"
]
}
]
... ... @@ -80,7 +102,8 @@
{
"name": "default",
"applyToProducts": [
"default"
"default",
"productRELEASE"
]
}
]
... ... @@ -92,7 +115,8 @@
{
"name": "default",
"applyToProducts": [
"default"
"default",
"productRELEASE"
]
}
]
... ... @@ -104,7 +128,8 @@
{
"name": "default",
"applyToProducts": [
"default"
"default",
"productRELEASE"
]
}
]
... ... @@ -116,7 +141,8 @@
{
"name": "default",
"applyToProducts": [
"default"
"default",
"productRELEASE"
]
}
]
... ... @@ -128,7 +154,8 @@
{
"name": "default",
"applyToProducts": [
"default"
"default",
"productRELEASE"
]
}
]
... ... @@ -144,7 +171,8 @@
{
"name": "default",
"applyToProducts": [
"default"
"default",
"productRELEASE"
]
}
]
... ... @@ -168,7 +196,8 @@
{
"name": "default",
"applyToProducts": [
"default"
"default",
"productRELEASE"
]
}
]
... ... @@ -180,7 +209,8 @@
{
"name": "default",
"applyToProducts": [
"default"
"default",
"productRELEASE"
]
}
]
... ... @@ -192,7 +222,8 @@
{
"name": "default",
"applyToProducts": [
"default"
"default",
"productRELEASE"
]
}
]
... ... @@ -204,7 +235,8 @@
{
"name": "default",
"applyToProducts": [
"default"
"default",
"productRELEASE"
]
}
]
... ... @@ -216,7 +248,8 @@
{
"name": "default",
"applyToProducts": [
"default"
"default",
"productRELEASE"
]
}
]
... ... @@ -228,7 +261,8 @@
{
"name": "default",
"applyToProducts": [
"default"
"default",
"productRELEASE"
]
}
]
... ... @@ -240,7 +274,8 @@
{
"name": "default",
"applyToProducts": [
"default"
"default",
"productRELEASE"
]
}
]
... ... @@ -252,7 +287,8 @@
{
"name": "default",
"applyToProducts": [
"default"
"default",
"productRELEASE"
]
}
]
... ... @@ -264,7 +300,8 @@
{
"name": "default",
"applyToProducts": [
"default"
"default",
"productRELEASE"
]
}
]
... ... @@ -276,7 +313,8 @@
{
"name": "default",
"applyToProducts": [
"default"
"default",
"productRELEASE"
]
}
]
... ...
... ... @@ -8,6 +8,7 @@
"tablet",
"2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true
}
}
\ No newline at end of file
... ...
... ... @@ -5,6 +5,7 @@ export class BridgeUtil {
static readonly YY_OVERRIDE_SCHEMA = "yy://";
static readonly YY_RETURN_DATA = BridgeUtil.YY_OVERRIDE_SCHEMA + "return/";
static readonly YY_FETCH_QUEUE = BridgeUtil.YY_RETURN_DATA + "_fetchQueue/";
static readonly BRIDGE_LOADED_MSG = "__bridge_loaded__";
static readonly EMPTY_STR = "";
static readonly UNDERLINE_STR = "_";
static readonly SPLIT_MARK = "/";
... ...
... ... @@ -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": [
{
... ...
... ... @@ -32,8 +32,8 @@ export class HttpBizUtil {
if (!headers) {
headers = new HashMap()
}
headers?.replace('RMRB-X-TOKEN', token)
headers?.replace('cookie', 'RMRB-X-TOKEN=' + token)
headers?.set('RMRB-X-TOKEN', token)
headers?.set('cookie', 'RMRB-X-TOKEN=' + token)
Logger.debug(TAG, 'get again send: ' + token)
// refreshToken为空场景不处理,直接请求接口。
WDHttp.get<T>(url, headers).then((againResDTO: T) => {
... ... @@ -71,8 +71,8 @@ export class HttpBizUtil {
if (!headers) {
headers = new HashMap()
}
headers?.replace('RMRB-X-TOKEN', token)
headers?.replace('cookie', 'RMRB-X-TOKEN=' + token)
headers?.set('RMRB-X-TOKEN', token)
headers?.set('cookie', 'RMRB-X-TOKEN=' + token)
Logger.debug(TAG, 'post again send: ' + token)
// refreshToken为空场景不处理,直接请求接口。
WDHttp.post<T>(url, data, headers).then((againResDTO: T) => {
... ...
... ... @@ -8,6 +8,7 @@
"tablet",
"2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
"requestPermissions": [
{
... ...
... ... @@ -166,6 +166,25 @@ export class ProcessUtils {
* @param content
* */
public static gotoMultiPictureListPage(photoList: PhotoListBean[], swiperIndex?: number) {
let tempP = [] as PhotoListBean[]
let relIndex = 0;
for (let index = 0; index < photoList.length; index++) {
const element = photoList[index];
if(!StringUtils.isEmpty(element.picPath)){
relIndex = relIndex+1
}
}
tempP.length = relIndex
relIndex = 0
for (let index = 0; index < photoList.length; index++) {
const element = photoList[index];
if(!StringUtils.isEmpty(element.picPath)){
tempP[relIndex] = element
relIndex = relIndex+1
}
}
photoList.length = tempP.length
photoList = tempP
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
params: {
... ...
... ... @@ -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"
}
... ...
... ... @@ -12,6 +12,7 @@ export class H5CallNativeType {
static jsCall_receiveH5Data = 'jsCall_receiveH5Data'
static jsCall_getAppLoginAuthInfo = 'jsCall_getAppLoginAuthInfo'
static jsCall_appNotifyEvent = 'jsCall_appNotifyEvent'
static jsCall_receiveSubjectData = 'jsCall_receiveSubjectData'
// TODO 业务自行新增类型、自行在JsBridgeBiz#performJSCallNative里添加接收分支处理。
... ... @@ -24,6 +25,7 @@ export class H5CallNativeType {
H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_receiveH5Data)
H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_getAppLoginAuthInfo)
H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_appNotifyEvent)
H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_receiveSubjectData)
}
}
... ...
... ... @@ -17,6 +17,7 @@ export struct WdWebComponent {
@Prop webUrl: string = ''
@Prop @Watch('onReloadStateChanged') reload: number = 0
@Link isPageEnd: boolean
@State subjectData : string = ''
build() {
Column() {
... ... @@ -36,19 +37,7 @@ export struct WdWebComponent {
})
.onLoadIntercept((event) => {
let url: string = event.data.getRequestUrl().toString()
url = url.replace("%(?![0-9a-fA-F]{2})", "%25")
.replace("\\+", "%2B");
url = decodeURIComponent(url)
if (url.startsWith(BridgeUtil.YY_RETURN_DATA)) {
this.webviewControl.handlerReturnData(url)
return true
}
if (url.startsWith(BridgeUtil.YY_OVERRIDE_SCHEMA)) {
Logger.debug(TAG, 'flushMessageQueue');
this.webviewControl.flushMessageQueue()
return true
}
return this.onLoadIntercept(event.data.getRequestUrl().toString());
return this.onLoadIntercept(url);
})
}
}
... ... @@ -60,6 +49,7 @@ export struct WdWebComponent {
let handle = (data: Message, f: Callback) => {
Logger.debug('registerHandlers handlerName: ' + JSON.stringify(data))
this.defaultPerformJSCallNative(data, f)
this.defaultGetReceiveSubjectData(data, f)
};
this.webviewControl.registerHandler(handleName, { handle: handle });
}
... ... @@ -71,21 +61,42 @@ export struct WdWebComponent {
private defaultPerformJSCallNative: (data: Message, f: Callback) => void = (data: Message, f: Callback) => {
performJSCallNative(data, f)
}
/**
*/
private defaultGetReceiveSubjectData: (data: Message, f: Callback) => void = (data: Message, f: Callback) => {
if(data.handlerName === H5CallNativeType.jsCall_receiveSubjectData) {
f('')
}
}
onPageBegin: (url?: string) => void = () => {
Logger.debug(TAG, 'onPageBegin');
this.registerHandlers();
//有时序问题 必须延时执行
setTimeout(() => {
BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl)
}, 200)
}
onPageEnd: (url?: string) => void = () => {
Logger.debug(TAG, 'onPageEnd');
this.onWebPrepared()
this.isPageEnd = true
}
onLoadIntercept: (url?: string) => boolean = () => {
Logger.debug(TAG, 'onLoadIntercept return false');
onLoadIntercept: (url: string) => boolean = (url: string) => {
Logger.debug(TAG, 'onLoadIntercept');
url = url.replace("%(?![0-9a-fA-F]{2})", "%25")
.replace("\\+", "%2B");
url = decodeURIComponent(url)
if (url.startsWith(BridgeUtil.YY_RETURN_DATA)) {
this.webviewControl.handlerReturnData(url)
return true
}
if (url.startsWith(BridgeUtil.YY_OVERRIDE_SCHEMA)) {
Logger.debug(TAG, 'flushMessageQueue');
this.webviewControl.flushMessageQueue()
return true
}
if (url.includes(BridgeUtil.BRIDGE_LOADED_MSG)) {
// jsBridge load通知,注入js
BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl)
return true
}
return false
}
onReloadStateChanged() {
... ...
... ... @@ -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
... ...
... ... @@ -22,6 +22,7 @@ export struct SpacialTopicPageComponent {
scroller: Scroller = new Scroller();
action: Action = {} as Action
@State webUrl: string = '';
@State subjectData: string = '';
@State isPageEnd: boolean = false
@Prop reload: number = 0;
@Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
... ... @@ -57,6 +58,36 @@ export struct SpacialTopicPageComponent {
let context = getContext(this) as common.UIAbilityContext;
viewBlogItemInsightIntentShare(context,this.contentDetailData)
}
async getWebviewPageData (){
let pageId = this.action.params?.extra?.pageId
let relId: string = ''
let relType: string = ''
let contentId: string = ''
if (this.action && this.action.params) {
if (this.action.params.contentID) {
contentId = this.action.params.contentID;
}
if (this.action && this.action.params && this.action.params.extra) {
if (this.action.params.extra.relId) {
relId = this.action.params.extra.relId;
}
if (this.action.params.extra.relType) {
relType = this.action.params.extra.relType
}
}
}
if(pageId){
// let pageInfoMsg = await PageRepository.fetchMorningEveningPageInfo(pageId)
// let pageCompInfoMsg = await PageRepository.fetchMorningEveningCompInfo(Number(pageId), groupId, refreshTime, topicId, 1, 20)
// let res = {
// dataJson: {
// pageInfoResponseMap: pageInfoMsg,
// compInfoResponseMap: pageCompInfoMsg,
// },
// }
}
}
private async getDetail() {
this.isNetConnected = NetworkUtil.isNetConnected()
... ... @@ -93,12 +124,17 @@ export struct SpacialTopicPageComponent {
this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')
this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')
// }
this.trySendData2H5()
this.subjectData = 'dasdasdadas'
//TODO
// this.trySendData2H5()
}
if(pageInfoMsg && pageInfoMsg.data){
this.contentDetailData.openComment = Number(pageInfoMsg.data.topicInfo.commentFlag)
this.contentDetailData.commentDisplay = Number(pageInfoMsg.data.topicInfo.commentShowFlag)
}
console.log('contentDetailData',this.contentDetailData)
}
}
}
... ... @@ -115,14 +151,16 @@ export struct SpacialTopicPageComponent {
.textAlign(TextAlign.Center)
.fontWeight(500)
.visibility(this.action?.params?.backVisibility && this.isPageEnd ? Visibility.Visible : Visibility.None)
WdWebComponent({
webviewControl: this.webviewControl,
webUrl: this.webUrl,
reload: this.reload,
onWebPrepared: this.onWebPrepared.bind(this),
isPageEnd: $isPageEnd,
})
if(this.subjectData.length > 0){
WdWebComponent({
webviewControl: this.webviewControl,
webUrl: this.webUrl,
reload: this.reload,
onWebPrepared: this.onWebPrepared.bind(this),
isPageEnd: $isPageEnd,
subjectData: this.subjectData
})
}
}
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
... ...
... ... @@ -11,6 +11,7 @@ import font from '@ohos.font';
* 视频:点播图标+时长;直播图标+'直播中'
*/
@Component
@Reusable
export struct CardMediaInfo {
@State livePeopleNum :boolean = true
... ... @@ -33,6 +34,16 @@ export struct CardMediaInfo {
})
}
aboutToReuse(params: Record<string, object>): void {
this.contentDTO = params.contentDTO as ContentDTO
}
aboutToRecycle(): void {
}
aboutToDisappear(): void {
}
/**
* 全域数字显示规则
* 1、当数量为千位以內时,显示数字,不保留小数点,比如 4585
... ...
import { CompDTO, ContentDTO } from 'wdBean'
import { CommonConstants } from 'wdConstant/Index';
import { DateTimeUtils } from 'wdKit/Index';
import { JSON } from '@kit.ArkTS';
import router from '@ohos.router'
@Reusable
@Component
export struct CardSourceInfo {
@State contentDTO: ContentDTO = new ContentDTO();
@ObjectLink compDTO: CompDTO
aboutToAppear(): void {
}
aboutToReuse(params: Record<string, object>): void {
this.contentDTO = params.contentDTO as ContentDTO
}
aboutToRecycle(): void {
}
aboutToDisappear(): void {
}
handleTimeStr() {
return DateTimeUtils.getCommentTime(
this.contentDTO.publishTime.includes(' ')
... ...
... ... @@ -219,7 +219,8 @@ struct createImg {
}) {
Image(this.loadImg ? item.fullUrl : '')
.backgroundColor(0xf5f5f5)
.width('100%')
.width(113)
.height(113)
.autoResize(true)
.borderRadius(this.caclImageRadius(index))
.opacity(!item.weight && !item.height ? 0 : 1)
... ... @@ -233,6 +234,8 @@ struct createImg {
Image(this.loadImg ? item.fullUrl : '')
.backgroundColor(0xf5f5f5)
.aspectRatio(1)
.width(113)
.height(113)
.borderRadius(this.caclImageRadius(index))
if(this.getPicType(item.weight, item.height) !== 3){
Flex({ direction: FlexDirection.Row }) {
... ...
... ... @@ -88,7 +88,7 @@ export struct Card6Component {
.fontSize(18)
.lineHeight(27)
.fontWeight(FontWeight.Normal)
.maxLines(2)
.maxLines(this.contentDTO.appStyle === '6' ? 5 : 2)
.alignSelf(ItemAlign.Start)
.textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
.textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
... ... @@ -107,7 +107,7 @@ export struct Card6Component {
}
.alignItems(HorizontalAlign.Start)
.height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78: 156)
.height(78)
.justifyContent(FlexAlign.SpaceBetween)
... ... @@ -119,7 +119,7 @@ export struct Card6Component {
.backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
.borderRadius(5)
.aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4)
.height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156)
.height(78)
CardMediaInfo({ contentDTO: this.contentDTO })
}
... ... @@ -138,7 +138,7 @@ export struct Card6Component {
})
.width(CommonConstants.FULL_WIDTH)
// .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 107 : 217)
.height(106)
.justifyContent(FlexAlign.SpaceBetween)
.alignItems(VerticalAlign.Top)
}
... ...
... ... @@ -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()
... ...
... ... @@ -289,9 +289,9 @@ struct indicatorAnimations {
build() {
Flex({ alignItems: ItemAlign.End }) {
Stack() {
Image($r('app.media.swiper_indicator_gray'))
.width('100%')
.height(2)
// Image($r('app.media.swiper_indicator_gray'))
// .width('100%')
// .height(2)
Image($r('app.media.swiper_indicator_white'))
.width(this.leftW)
.height(2)
... ... @@ -312,6 +312,7 @@ struct indicatorAnimations {
.margin({
bottom: -2
})
.fontFamily('BebasNeue')
.flexShrink(0)
.animation({
duration: 300,
... ... @@ -319,9 +320,9 @@ struct indicatorAnimations {
playMode: PlayMode.Normal
})
Stack() {
Image($r('app.media.swiper_indicator_gray'))
.width('100%')
.height(2)
// Image($r('app.media.swiper_indicator_gray'))
// .width('100%')
// .height(2)
Image($r('app.media.swiper_indicator_white'))
.width(this.rightW)
.height(2)
... ...
... ... @@ -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'
})
}
... ...
... ... @@ -34,7 +34,7 @@ export struct ZhSingleRow02 {
edgeAnimation() {
if (this.moreWidth < this.initMoreWidth * 3) {
if (!this.moreTips) {
this.moreTips = '查看更多';
this.moreTips = '查看 ';
}
this.moreWidth = this.moreWidth + 2
}
... ... @@ -54,8 +54,7 @@ export struct ZhSingleRow02 {
resetEdgeAnimation() {
if (this.moreWidth > this.initMoreWidth) {
this.moreWidth = this.moreWidth - 1
this.resetEdgeAnimation();
this.moreWidth = 16
}
this.resetMoreTips()
}
... ... @@ -91,21 +90,30 @@ export struct ZhSingleRow02 {
.margin({ right: 8 })
})
}
if (this.compDTO.operDataList.length >= 2) {
Column() {
if (this.moreWidth > this.initMoreWidth + 2) {
Text(this.moreTips)
.fontSize(8)
.fontColor(0x858585)
.width(8)
if (this.compDTO.operDataList.length >= 2 && (this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) {
Row() {
Ellipse()
.width(2* (this.moreWidth - this.initMoreWidth - 1))
.height('100%')
.fill(0xe9e9e9)
.position({ left: -(this.moreWidth - this.initMoreWidth - 3) * 0.8 , top: 0 })
Column() {
if (this.moreWidth > this.initMoreWidth + 2) {
Text(this.moreTips)
.fontSize(8)
.fontColor(0x858585)
.width(8)
}
}
.justifyContent(FlexAlign.Center)
.align(Alignment.Center)
.height('100%')
.width(this.initMoreWidth)
.backgroundColor(0xe9e9e9)
.borderRadius({ topLeft: 5, bottomLeft: 5 })
}
.justifyContent(FlexAlign.Center)
.align(Alignment.Center)
.height('100%')
.width(this.moreWidth)
.backgroundColor(0xe9e9e9)
.borderRadius({ topLeft: 5, bottomLeft: 5 })
.margin({left: 1.5 * (this.moreWidth - this.initMoreWidth)})
}
}
}
... ... @@ -233,6 +241,8 @@ struct CreatorItem {
.textOverflow({overflow: TextOverflow.Ellipsis})
.width(140)
.margin({bottom: 8})
.height(42)
.lineHeight(21)
}
}
.width(156)
... ...
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';
... ... @@ -10,6 +10,7 @@ import { Logger, ToastUtils } from 'wdKit';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { SpConstants } from 'wdConstant/Index'
import { InfomationCardClick } from '../../utils/infomationCardClick';
import { ParamType, Tracking } from 'wdTracking/Index';
/**
* 直播预约卡
... ... @@ -17,7 +18,17 @@ import { InfomationCardClick } from '../../utils/infomationCardClick';
*/
const TAG = 'Zh_Single_Row-03'
function getLiveState(contentDTO: ContentDTO) {
if (contentDTO?.liveInfo?.liveState === 'wait') {
return 'liveSubscribe'
} else if (contentDTO?.liveInfo?.liveState === 'running') {
return 'livePlaying'
} else if (contentDTO?.liveInfo?.liveState === 'end') {
return 'liveEnd'
} else {
return ''
}
}
interface reserveReqItem {
liveId: string,
relationId: string,
... ... @@ -67,8 +78,7 @@ export struct ZhSingleRow03 {
resetEdgeAnimation() {
if (this.moreWidth > this.initMoreWidth) {
this.moreWidth = this.moreWidth - 1
this.resetEdgeAnimation();
this.moreWidth = 16
}
this.resetMoreTips()
}
... ... @@ -155,21 +165,30 @@ export struct ZhSingleRow03 {
this.ItemCard(item)
})
}
if (this.compDTO.operDataList.length >= 2) {
Column() {
if (this.moreWidth > this.initMoreWidth + 2) {
Text(this.moreTips)
.fontSize(8)
.fontColor(0x858585)
.width(8)
if (this.compDTO.operDataList.length >= 2 && (this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) {
Row() {
Ellipse()
.width(2* (this.moreWidth - this.initMoreWidth - 1))
.height(116)
.fill(0xf9f9f9)
.position({ left: -(this.moreWidth - this.initMoreWidth - 3) * 0.8 , top: 0 })
Column() {
if (this.moreWidth > this.initMoreWidth + 2) {
Text(this.moreTips)
.fontSize(8)
.fontColor(0x858585)
.width(8)
}
}
.justifyContent(FlexAlign.Center)
.align(Alignment.Center)
.height(116)
.width(this.initMoreWidth)
.backgroundColor(0xf9f9f9)
.borderRadius({ topLeft: 5, bottomLeft: 5 })
}
.justifyContent(FlexAlign.Center)
.align(Alignment.Center)
.width(this.moreWidth)
.backgroundColor(0xf9f9f9)
.borderRadius({ topLeft: 5, bottomLeft: 5 })
.height(116)
.margin({left: 1.5 * (this.moreWidth - this.initMoreWidth)})
}
}
}
... ... @@ -208,42 +227,44 @@ export struct ZhSingleRow03 {
@Builder
ItemCard(item: ContentDTO) {
Column() {
Row() {
Image(this.loadImg ? item.coverUrl : '')
.width(106)
.height(60)
.margin({right: 12})
.backgroundColor(0xf5f5f5)
Text(item.newsTitle)
.width(154)
.height(60)
.maxLines(3)
.textOverflow({overflow: TextOverflow.Ellipsis})
}
.margin({bottom: 16})
if (this.compDTO.operDataList.length >= 2) {
Column() {
Row() {
Image(this.loadImg ? item.coverUrl : '')
.width(106)
.height(60)
.margin({right: 12})
.backgroundColor(0xf5f5f5)
.margin({right: 12})
Row() {
Flex({justifyContent: FlexAlign.SpaceBetween}){
Row() {
Text(this.format(new Date(item.liveInfo.liveStartTime).getTime()))
.margin({right: 6})
.fontColor(0x000000)
.fontSize(13)
.textAlign(TextAlign.Start)
Image($r('app.media.timeline_rect'))
.width(4)
.height(3)
.margin({right: 6})
Text(item.liveInfo.liveStartTime.split(' ')[1].slice(0, 5))
.margin({right: 6})
.fontColor(0x000000)
.fontSize(13)
Text('开始直播')
.fontColor(0xC8C8C8)
.fontSize(13)
}
Text(item.newsTitle)
.width(154)
.height(60)
.maxLines(3)
.textOverflow({overflow: TextOverflow.Ellipsis})
}
.margin({bottom: 16})
Row() {
Flex({justifyContent: FlexAlign.SpaceBetween}){
Row() {
Text(this.format(new Date(item.liveInfo.liveStartTime).getTime()))
.margin({right: 6})
.fontColor(0x000000)
.fontSize(13)
.textAlign(TextAlign.Start)
Image($r('app.media.timeline_rect'))
.width(4)
.height(3)
.margin({right: 6})
Text(item.liveInfo.liveStartTime.split(' ')[1].slice(0, 5))
.margin({right: 6})
.fontColor(0x000000)
.fontSize(13)
Text('开始直播')
.fontColor(0xC8C8C8)
.fontSize(13)
}
Row() {
Text(this.isReserved(Number(item.objectId)) ? '已预约' : '预约')
... ... @@ -255,24 +276,114 @@ 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)
})
}
.margin({top: -5})
}
.margin({top: -5})
}
}
.width(298)
.height(116)
.padding({top: 12, bottom: 12, left: 12, right: 12})
.backgroundColor(0xf9f9f9)
.margin({right: 8})
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
ProcessUtils.processPage(item)
})
} else {
Column() {
Row() {
Image(this.loadImg ? item.coverUrl : '')
.width(106)
.height(60)
.backgroundColor(0xf5f5f5)
.margin({right: 12})
Text(item.newsTitle)
.width(201)
.height(60)
.maxLines(3)
.textOverflow({overflow: TextOverflow.Ellipsis})
}
.margin({bottom: 16})
.justifyContent(FlexAlign.Start)
Row() {
Flex({justifyContent: FlexAlign.SpaceBetween}){
Row() {
Text(this.format(new Date(item.liveInfo.liveStartTime).getTime()))
.margin({right: 6})
.fontColor(0x000000)
.fontSize(13)
.textAlign(TextAlign.Start)
Image($r('app.media.timeline_rect'))
.width(4)
.height(3)
.margin({right: 6})
Text(item.liveInfo.liveStartTime.split(' ')[1].slice(0, 5))
.margin({right: 6})
.fontColor(0x000000)
.fontSize(13)
Text('开始直播')
.fontColor(0xC8C8C8)
.fontSize(13)
}
Row() {
Text(this.isReserved(Number(item.objectId)) ? '已预约' : '预约')
.width(48)
.height(24)
.backgroundColor(this.isReserved(Number(item.objectId)) ? 0xffffff : 0xED2800)
.fontColor(this.isReserved(Number(item.objectId)) ? 0xC8C8C8 : 0xffffff)
.fontSize(12)
.textAlign(TextAlign.Center)
.borderRadius(3)
.onClick(() => {
this.bookAndCancel(item.relId, item.objectId, !this.isReserved(Number(item.objectId)))
})
}
.margin({top: -5})
}
}
}
.width('100%')
.height(116)
.padding({top: 12, bottom: 12, left: 12, right: 12})
.backgroundColor(0xf9f9f9)
.margin({right: 8})
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
ProcessUtils.processPage(item)
})
}
.width(298)
.height(116)
.padding({top: 12, bottom: 12, left: 12, right: 12})
.backgroundColor(0xf9f9f9)
.margin({right: 8})
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
ProcessUtils.processPage(item)
})
}
... ... @@ -290,21 +401,20 @@ export struct ZhSingleRow03 {
.fontWeight(600)
}
Row() {
Text("更多")
.fontSize($r("app.float.font_size_14"))
.fontColor($r("app.color.color_999999"))
.margin({ right: 1 })
Image($r("app.media.more"))
.width(14)
.height(14)
if (this.compDTO?.objectType === '0' || this.compDTO?.objectType === '') {
Row() {
Text("更多")
.fontSize($r("app.float.font_size_14"))
.fontColor($r("app.color.color_999999"))
.margin({ right: 1 })
Image($r("app.media.more"))
.width(14)
.height(14)
}
.onClick(() => {
this.jumpToMore();
})
}
.padding({
right: $r('app.float.card_comp_pagePadding_lf'),
})
.onClick(() => {
this.jumpToMore();
})
}
.justifyContent(FlexAlign.SpaceBetween)
.margin({ top: 8, bottom: 8 })
... ... @@ -331,85 +441,4 @@ export struct ZhSingleRow03 {
}
@Extend(Text)
function textOverflowStyle(maxLine: number) {
.maxLines(maxLine)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}
@Component
struct CreatorItem {
@Prop item: ContentDTO
@State rmhIsAttention: number = 0
@State loadImg: boolean = false;
async aboutToAppear(): Promise<void> {
this.loadImg = await onlyWifiLoadImg();
}
build() {
ListItem() {
Column() {
Stack({ alignContent: Alignment.Bottom }) {
Image(this.loadImg ? this.item.coverUrl : '')
.backgroundColor(0xf5f5f5)
.width(156)
.height(208)
.border({width: 1})
.borderRadius(3)
Row()
.width(156)
.height(80)
.linearGradient({
direction: GradientDirection.Bottom,
colors: [['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]]
})
Text(this.item.newsTitle)
.fontColor(0xffffff)
.fontSize(14)
.maxLines(2)
.textOverflow({overflow: TextOverflow.Ellipsis})
.width(140)
.margin({bottom: 8})
}
}
.width(156)
.height(208)
.margin({ right: 11 })
.borderColor($r('app.color.color_EDEDED'))
.borderRadius($r('app.float.image_border_radius'))
}
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.item)
})
}
/**
* 关注号主 TODO 这里后面需要抽离
*/
handleAccention(item: ContentDTO, status: number) {
this.rmhIsAttention = this.rmhIsAttention ? 0 : 1
return
// 未登录,跳转登录
if (!HttpUtils.getUserId()) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
const params: postInteractAccentionOperateParams = {
attentionUserType: item.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号)
attentionUserId: item.rmhInfo?.userId || '', // 被关注用户号主id
attentionCreatorId: item.rmhInfo?.rmhId || '', // 被关注用户号主id
// userType: 1,
// userId: '1', // TODO 用户id需要从本地获取
status: status,
}
PageRepository.postInteractAccentionOperate(params).then(res => {
console.log(TAG, '关注号主==', JSON.stringify(res.data))
if (status === 1) {
this.rmhIsAttention = 0
} else {
this.rmhIsAttention = 1
}
})
}
}
... ...
... ... @@ -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) {
... ... @@ -69,6 +76,7 @@ export struct PageComponent {
onActionEnd(this.pageModel, this.pageAdvModel)
})
)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
... ... @@ -88,7 +96,7 @@ export struct PageComponent {
LazyForEach(this.pageModel.compList, (compDTO: CompDTO, compIndex: number) => {
ListItem() {
Column() {
CompParser({ pageModel: this.pageModel, compDTO: compDTO, compIndex: compIndex });
CompParser({ pageModel: this.pageModel, compDTO: compDTO, compIndex: compIndex, pageId: this.pageId });
}
}
},
... ... @@ -265,8 +273,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"))
}
// 私有方法
... ...
... ... @@ -45,7 +45,7 @@ export struct TopNavigationComponentNew {
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@Link _currentNavIndex?: number;
// 顶导当前选中/焦点下标
@State currentTopNavSelectedIndex: number = 0;
@State @Watch('updateCurrentTopNavSelectedIndex') currentTopNavSelectedIndex: number = 0;
// 顶导数据
@State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = []
@State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002
... ... @@ -114,20 +114,6 @@ export struct TopNavigationComponentNew {
.onChange((index) => {
Logger.info(TAG, `onChange index : ${index}`);
// 顶部tab埋点
if(this.currentBottomNavName === '新闻') {
const tab = this.myChannelList[index]
Logger.info(TAG, `顶部tab : ${JSON.stringify(tab)}`);
const params: ParamType = {
"pageName": tab.name,
"tabName": tab.name,
"pageId": tab.pageId,
}
Tracking.event("home_page_tab_click ", params)
}
if (this.isBroadcastByIndex(index)) {
// 跳转到播报页面
ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId)
... ... @@ -217,6 +203,7 @@ export struct TopNavigationComponentNew {
moreChannelList: $moreChannelList,
localChannelList: $localChannelList,
changeTab: (index) => {
this.changePage(index)
}
})
... ... @@ -496,6 +483,32 @@ export struct TopNavigationComponentNew {
`onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`);
}
updateCurrentTopNavSelectedIndex() {
Logger.info(TAG, `currentTopNavSelectedIndex : ${this.currentTopNavSelectedIndex}、${this.currentBottomNavName}`);
// 顶部tab埋点
if(this.currentBottomNavName === '新闻') {
const tab = this.myChannelList[this.currentTopNavSelectedIndex]
Logger.info(TAG, `新闻tab埋点: ${JSON.stringify(tab)}`);
const params: ParamType = {
"pageName": tab.name,
"tabName": tab.name,
"pageId": tab.pageId,
}
Tracking.event("home_page_tab_click ", params)
} else if(this.currentBottomNavName === '人民号') {
const tab = this.topNavList[this.currentTopNavSelectedIndex]
Logger.info(TAG, `人民号tab埋点: ${JSON.stringify(tab)}`);
const params: ParamType = {
"pageName": tab.name,
"tabName": tab.name,
"pageId": tab.pageId,
}
Tracking.event("People_account_page_tab_click", params)
}
}
onAutoRefresh() {
if (this.bottomNavIndex != this._currentNavIndex) {
return
... ...
... ... @@ -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")
.objectFit(ImageFit.Auto)
.interpolation(ImageInterpolation.Medium)
.margin({left:"495lpx"})
.onClick(()=>{
this.searchText = ""
})
.visibility(StringUtils.isEmpty(this.searchText) ? Visibility.Hidden : Visibility.Visible)
Image($r('app.media.search_input_del_icon'))
.width(`${this.calcHeight(31)}lpx`)
.height(`${this.calcHeight(31)}lpx`)
.objectFit(ImageFit.Auto)
.interpolation(ImageInterpolation.Medium)
.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){
... ...
... ... @@ -43,8 +43,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
resetEdgeAnimation() {
if (this.moreWidth > this.initMoreWidth) {
this.moreWidth = this.moreWidth - 1
this.resetEdgeAnimation();
this.moreWidth = 16
}
this.resetMoreTips()
}
... ... @@ -130,6 +129,8 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
.margin({ top: 8 })
.width(150)
.lineHeight(19)
.height(42)
.lineHeight(21)
}
.padding({ right: 16 })
// .offset({x:16})
... ... @@ -139,21 +140,31 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
})
})
}
if (this.compDTO.operDataList.length > 2) {
Column() {
if (this.moreWidth > this.initMoreWidth + 2) {
Text(this.moreTips)
.fontSize(8)
.fontColor(0x858585)
.width(8)
if (this.compDTO.operDataList.length >= 2 && (this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) {
Row() {
Ellipse()
.width(2* (this.moreWidth - this.initMoreWidth - 1))
.height(this.compDTO.operDataList.length == 2 ? 180 : 146)
.fill(0xf1f3f4)
.position({ left: -(this.moreWidth - this.initMoreWidth - 3) * 0.8 })
Column() {
if (this.moreWidth > this.initMoreWidth + 2) {
Text(this.moreTips)
.fontSize(8)
.fontColor(0x858585)
.width(8)
}
}
.justifyContent(FlexAlign.Center)
.align(Alignment.Center)
.height(this.compDTO.operDataList.length == 2 ? 180 : 146)
.width(this.initMoreWidth)
.backgroundColor(0xf1f3f4)
.borderRadius({ topLeft: 5, bottomLeft: 5 })
}
.justifyContent(FlexAlign.Center)
.align(Alignment.Center)
.width(this.moreWidth)
.backgroundColor(0xf1f3f4)
.borderRadius({ topLeft: 5, bottomLeft: 5 })
.height(this.compDTO.operDataList.length == 2 ? 180 : 146)
.margin({left: 1.5 * (this.moreWidth - this.initMoreWidth)})
}
}
}
... ...
... ... @@ -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)
}
}
... ...
... ... @@ -152,6 +152,8 @@ export struct LiveHorizontalCardComponent {
.textAlign(TextAlign.Start)
.margin({ top: 8 })
.width(this.compDTO.operDataList.length == 2 ? 210 : 150)
.height(42)
.lineHeight(21)
}
.padding({ right: 16 })
.onClick(() => {
... ...
... ... @@ -4,9 +4,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { SpConstants } from 'wdConstant/Index';
import measure from '@ohos.measure'
import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index';
import {
ContentDetailDTO,
} from 'wdBean';
import { ContentDetailDTO, } from 'wdBean';
import { LiveModel } from '../../viewmodel/LiveModel';
import { HttpUtils } from 'wdNetwork/Index';
import vibrator from '@ohos.vibrator';
... ... @@ -31,7 +29,6 @@ export struct LiveLikeComponent {
@State likeCount: number = 0 //点赞数
@State likeBean: Record<string, string> = {}
pageParam: ParamType = {}
PageName: string = ''
//上层传值 样例
// this.data['contentId'] = '30035444649' //必须
... ... @@ -47,6 +44,7 @@ export struct LiveLikeComponent {
this.onDetailUpdated()
this.contentTrackingDict()
}
async onDetailUpdated() {
// 2:竖屏直播页 4:横屏直播页
// 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福
... ... @@ -61,15 +59,12 @@ export struct LiveLikeComponent {
this.getLikeCount()
}
contentTrackingDict(){
contentTrackingDict() {
this.pageParam = {
'contentType': `${this.contentDetailData.newsType}`,
'contentId': `${this.contentDetailData.newsId}`,
'contentName': `${this.contentDetailData.newsTitle || ''}`,
}
if(this.contentDetailData.newsType == 2) {
this.PageName = TrackConstants.PageName.Live_Detail // 直播
}
}
build() {
... ... @@ -118,7 +113,9 @@ export struct LiveLikeComponent {
.width(36)
.height(36)
.borderRadius(18)
.backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : this.pageComponentType === 8 ? Color.Transparent : '#FFF5F5F5')
.backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' :
this.pageComponentType === 8 ? Color.Transparent : '#FFF5F5F5')
if (this.likeCount != 0) {
RelativeContainer() {
Image(this.styleType == 1 ? $r('app.media.comment_icon_number_bg') : $r('app.media.ic_like_back_Select'))
... ... @@ -211,6 +208,16 @@ export struct LiveLikeComponent {
console.error(`An unexpected error occurred. Code: ${e.code}, message: ${e.message}`);
}
this.likeCount++
this.likeStatus = true
//内容点赞、取消点赞Tracking 1点赞 0取消点赞
TrackingContent.like(true, TrackConstants.PageName.DynamicDetail, TrackConstants.PageName.DynamicDetail,
{
'contentType': `${this.contentDetailData.newsType}`,
'contentId': `${this.contentDetailData.newsId}`,
'contentName': `${this.contentDetailData.newsTitle || ''}`,
})
}).catch(() => {
})
... ... @@ -245,6 +252,7 @@ export struct LiveLikeComponent {
this.likeCount = 0
})
}
private getMeasureText(text: string) {
let width = measure.measureText({
textContent: text,
... ...
... ... @@ -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": [
{
... ...
... ... @@ -23,7 +23,7 @@ const TAG = 'DetailPlayLiveCommon'
@Component
export struct DetailPlayLiveCommon {
private liveViewModel: LiveViewModel = new LiveViewModel()
pageShowTime:number = 0;
pageShowTime: number = 0;
@Provide relId: string = ''
@Provide contentId: string = ''
@Provide relType: string = ''
... ... @@ -36,9 +36,10 @@ 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
async aboutToAppear(): Promise<void> {
... ... @@ -51,12 +52,6 @@ export struct DetailPlayLiveCommon {
}
aboutToDisappear(): void {
console.error("XXXXZZZZ", '---aboutToDisappear------------')
}
build() {
Column() {
// 直播预约或横屏直播统一进横屏直播
... ... @@ -66,7 +61,7 @@ export struct DetailPlayLiveCommon {
} else if (this.liveLandscape === 'general') {
// 沉浸式直播
DetailPlayVLivePage()
}else {
} else {
PictureLoading().visibility(this.isLoading ? Visibility.None : Visibility.Visible)
}
}
... ... @@ -86,20 +81,16 @@ export struct DetailPlayLiveCommon {
if (data) {
let detailData = data[0]
//人民号类型单独获取直播地址
if (detailData.rmhPlatform === 1) {
if (detailData.rmhPlatform === 1 && detailData.liveInfo?.liveState === 'running') { //
let vliveId = detailData.liveInfo.vlive[0].vliveId as string
console.error(TAG, 'vliveId==' + vliveId)
let pullStreamAddressData = await this.liveViewModel.getLiveRoomPullAddress(vliveId) as GetPullAddressBean
if (pullStreamAddressData) {
console.log(TAG, ' GetPullAddressBean:', JSON.stringify(pullStreamAddressData))
// console.log(TAG, ' GetPullAddressBean:', JSON.stringify(pullStreamAddressData))
let m3u8uUrl = pullStreamAddressData.transCode[0].m3u8Url
detailData.liveInfo.vlive[0].liveUrl = m3u8uUrl
this.playUrl = m3u8uUrl
console.log(TAG, ' GetPullAddressBean:', m3u8uUrl)
// console.log(TAG, ' GetPullAddressBean:', m3u8uUrl)
}
}
this.liveLandscape =
... ... @@ -133,7 +124,7 @@ export struct DetailPlayLiveCommon {
ToastUtils.shortToast('内容不存在')
router.back()
}
},()=>{
}, () => {
this.isLoading
ToastUtils.shortToast('内容不存在')
router.back()
... ... @@ -141,8 +132,6 @@ export struct DetailPlayLiveCommon {
})
}
onPageShow() {
this.pageShow = Math.random()
Logger.info(TAG, 'onPageShow')
... ... @@ -152,10 +141,10 @@ export struct DetailPlayLiveCommon {
onPageHide() {
this.pageHide = Math.random()
Logger.info(TAG, 'onPageHide')
console.error("XXXXZZZZ", '---onPageHide------------')
//页面浏览
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Live_Detail,TrackConstants.PageName.Live_Detail
,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Live_Detail,
TrackConstants.PageName.Live_Detail
, Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime) / 1000))
}
... ...
... ... @@ -9,6 +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, TrackParamConvert } from 'wdTracking/Index';
let TAG: string = 'DetailPlayLivePage';
... ... @@ -34,10 +35,9 @@ export struct DetailPlayLivePage {
@Consume @Watch('onBackPressCus') pageBackPress: number
@Consume contentDetailData: ContentDetailDTO
@Consume publishCommentModel: publishCommentModel
// 尽量不要动属性。用来作为输入了评论之后,值传递
@State lastInputedLiveComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的直播间消息
@State lastInputedChatComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的大家聊消息
@State lastInputedLiveComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的直播间消息
@State lastInputedChatComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的大家聊消息
aboutToAppear(): void {
Logger.info(TAG, `wyj-aboutToAppear`)
... ... @@ -69,10 +69,12 @@ export struct DetailPlayLivePage {
TopPlayComponent({ playerController: this.playerController })
.height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%')
TabComponent({ tabs: this.tabs,
TabComponent({
tabs: this.tabs,
changeToTab: this.changeToTab,
lastInputedLiveComment: this.lastInputedLiveComment,
lastInputedChatComment: this.lastInputedChatComment})
lastInputedChatComment: this.lastInputedChatComment
})
.layoutWeight(1)
.visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
... ... @@ -95,6 +97,10 @@ export struct DetailPlayLivePage {
} else {
this.lastInputedChatComment = result
}
// 发布评论埋点
TrackingContent.commentClick(TrackConstants.PageName.Live_Detail,
TrackConstants.PageName.Live_Detail,
TrackParamConvert.contentDetail(this.contentDetailData));
})
}
}
... ...
... ... @@ -7,6 +7,7 @@ import { WDAliPlayerController } from 'wdPlayer/Index';
import { DisplayDirection } from 'wdConstant/Index';
import { LiveEmptyComponent, WDLiveViewDefaultType } from 'wdComponent/Index';
import { PlayerEndView } from '../widgets/vertical/PlayerEndView';
import { TrackConstants, TrackingButton } from 'wdTracking/Index';
const storage = LocalStorage.getShared();
const TAG = 'DetailPlayVLivePage'
... ... @@ -96,6 +97,9 @@ export struct DetailPlayVLivePage {
.markAnchor({ x: 56, y: this.bottomSafeHeight })
.onClick(() => {
this.swiperController.showNext()
// 埋点
TrackingButton.click('clearScreen', TrackConstants.PageName.Live_Detail,
TrackConstants.PageName.Live_Detail)
})
}
... ... @@ -116,7 +120,5 @@ export struct DetailPlayVLivePage {
console.error(TAG, 'getLiveDetails catch', message)
})
}
}
... ...
import { ContentDetailDTO,
import {
ContentDetailDTO,
GetPullAddressBean,
LiveDetailsBean, LiveRoomBean, LiveRoomDataBean,
LiveDetailsBean,
LiveRoomBean,
LiveRoomDataBean,
LiveRoomItemBean,
ValueType } from 'wdBean/Index'
ValueType
} from 'wdBean/Index'
import { ContentDetailRequest } from 'wdDetailPlayApi/Index'
import { Logger } from 'wdKit/Index'
import { ToastUtils } from 'wdKit/src/main/ets/utils/ToastUtils'
... ... @@ -25,24 +29,33 @@ export class LiveViewModel {
//console.error("XXXXZZZZ", '---getContentDetail---1------------')
success(data)
}).catch((message: string) => {
// console.error("XXXXZZZZ", '----getContentDetail--2------------')
// console.error("XXXXZZZZ", '----getContentDetail--2------------')
fail(message)
})
})
}
async getLiveRoomPullAddress(vliveId:string) : Promise<GetPullAddressBean>{
return new Promise<GetPullAddressBean>((success, fail) => {
ContentDetailRequest.getLiveRoomPullStream(vliveId).then(async (resDTO: ResponseDTO<GetPullAddressBean>) => {
console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
if (resDTO.data) {
success(resDTO.data)
}
}).catch(() => {
fail("数据为空")
})
/**
* 获取直播间的拉流地址
* @param vliveId
* @returns
*/
async getLiveRoomPullAddress(vliveId: string): Promise<GetPullAddressBean | null> {
return new Promise<GetPullAddressBean | null>((success, fail) => {
ContentDetailRequest.getLiveRoomPullStream(vliveId)
.then(async (resDTO: ResponseDTO<GetPullAddressBean>) => {
console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
if (resDTO.data) {
success(resDTO.data)
} else {
success(null)
}
})
.catch(() => {
success(null)
})
})
... ... @@ -102,6 +115,7 @@ export class LiveViewModel {
})
})
}
// 直播详情-C端点赞接口
getLiveRoomNumberLike(liveId: string, number: number, deviceId: string | number) {
return new Promise<number>((success, fail) => {
... ... @@ -112,6 +126,7 @@ export class LiveViewModel {
})
})
}
// 直播详情-查询是否点赞接口
getLiveLike(liveId: string, userId: ValueType, deviceId: string | number) {
return new Promise<boolean>((success, fail) => {
... ...
import { ContentDetailDTO, LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index'
import { EmptyComponent, ErrorComponent, WDViewDefaultType } from 'wdComponent/Index'
import { CustomPullToRefresh, EmptyComponent, ErrorComponent, WDViewDefaultType } from 'wdComponent/Index'
import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout'
import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayout'
import { RefreshLayoutBean } from 'wdComponent/src/main/ets/components/page/RefreshLayoutBean'
... ... @@ -7,8 +7,10 @@ import PageModel from 'wdComponent/src/main/ets/viewmodel/PageModel'
import { ViewType } from 'wdConstant/Index'
import { LiveViewModel } from '../../viewModel/LiveViewModel'
import { TabChatItemComponent } from './TabChatItemComponent'
import { EmitterEventId, EmitterUtils, Logger } from 'wdKit';
import { EmitterEventId, EmitterUtils, LazyDataSource, Logger } from 'wdKit';
import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'
import { PeopleShipNoMoreData } from 'wdComponent/src/main/ets/components/reusable/PeopleShipNoMoreData'
import LoadMoreLayout from 'wdComponent/src/main/ets/components/page/LoadMoreLayout'
const TAG: string = 'TabChatComponent';
... ... @@ -20,13 +22,15 @@ const TAG: string = 'TabChatComponent';
export struct TabChatComponent {
@State private pageModel: PageModel = new PageModel()
liveViewModel: LiveViewModel = new LiveViewModel()
@State liveChatList: Array<LiveRoomItemBean> = []
@State liveChatList: LazyDataSource<LiveRoomItemBean> = new LazyDataSource();
// @State liveList: LazyDataSource<LiveRoomItemBean> = new LazyDataSource();
@Consume contentDetailData: ContentDetailDTO
@Consume publishCommentModel: publishCommentModel
@Prop @Watch("lastInputedCommentChanged") lastInputedComment: LiveRoomItemBean
private scroller: Scroller = new Scroller()
aboutToAppear(): void {
this.getLiveChatList()
this.getLiveList()
//注册通知
EmitterUtils.receiveEvent(EmitterEventId.COMMENT_PUBLISH, async (targetId?: string) => {
... ... @@ -62,7 +66,20 @@ export struct TabChatComponent {
} else if (this.pageModel.viewType == ViewType.EMPTY) {
EmptyComponent({ emptyType: WDViewDefaultType.WDViewDefaultType_NoComment1 })
} else {
this.ListLayout()
// this.ListLayout()
CustomPullToRefresh({
alldata: this.liveChatList,
scroller: this.scroller,
hasMore: false,
customList: () => {
this.ListLayout()
},
onRefresh: (resolve) => {
this.pageModel.currentPage = 1
this.getLiveList(resolve)
},
})
}
}
.align(Alignment.Top)
... ... @@ -73,32 +90,33 @@ export struct TabChatComponent {
@Builder
ListLayout() {
List() {
ListItem() {
// 下拉刷新 TODO 待对接新的下拉刷新组件
// RefreshLayout({
// refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullDown, this.pageModel.pullDownRefreshImage,
// this.pageModel.pullDownRefreshText, this.pageModel.pullDownRefreshHeight)
// })
}
List({ scroller: this.scroller }) {
ForEach(this.liveChatList, (item: LiveRoomItemBean) => {
LazyForEach(this.liveChatList, (item: LiveRoomItemBean) => {
ListItem() {
TabChatItemComponent({ item: item })
}
})
},
(item: LiveRoomItemBean, contentIndex: number) => JSON.stringify(item)
)
// 加载更多
// ListItem() {
// if (this.pageModel.hasMore) {
// LoadMoreLayout({
// refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage,
// this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight)
// })
// } else {
// ListHasNoMoreDataUI()
// }
// }
}
ListItem() {
if (this.pageModel.hasMore && this.liveChatList && this.liveChatList.totalCount() > 0) {
LoadMoreLayout({ isVisible: this.pageModel.hasMore })
} else if (!this.pageModel.hasMore && !this.pageModel.isLoading) {
PeopleShipNoMoreData()
}
}
} .edgeEffect(EdgeEffect.None)
.scrollBar(BarState.Off)
.onReachEnd(() => {
Logger.debug(TAG, "触底了");
if (!this.pageModel.isLoading && this.pageModel.hasMore) {
//加载分页数据
//this.currentPage++;
this.getLiveList()
}
})
}
@Builder
... ... @@ -109,7 +127,16 @@ export struct TabChatComponent {
})
}
getLiveChatList() {
async getLiveList(resolve?: (value: string | PromiseLike<string>) => void) {
if (this.pageModel.isLoading) {
if (resolve) {
resolve('已更新至最新')
}
return
}
this.pageModel.isLoading = true
this.pageModel.currentPage = 1
this.liveViewModel.getLiveChatList(
this.pageModel.currentPage,
... ... @@ -118,6 +145,17 @@ export struct TabChatComponent {
20,)
.then(
(data) => {
this.pageModel.isLoading = false
if (resolve) {
if (this.pageModel.currentPage == 1) {
resolve('已更新至最新')
} else {
resolve('')
}
}
if(this.pageModel.currentPage ===1){
this.liveChatList.clear()
}
Logger.debug(TAG, `${JSON.stringify(data)}`)
if (data.barrageResponses && data.barrageResponses.length > 0) {
this.pageModel.viewType = ViewType.LOADED;
... ...
... ... @@ -135,6 +135,9 @@ export struct TabLiveComponent {
resolve('')
}
}
if(this.pageModel.currentPage ===1){
this.liveList.clear()
}
Logger.debug(TAG, '直播间数据:' + `${JSON.stringify(data)}`)
if (data.barrageResponses && data.barrageResponses.length > 0) {
/**
... ... @@ -146,9 +149,6 @@ export struct TabLiveComponent {
3.内容:详情接口的简介,newIntroduction
*/
this.pageModel.viewType = ViewType.LOADED;
if(this.pageModel.currentPage ===1){
this.liveList.clear()
}
this.liveList.push(...data.barrageResponses)
if (data.barrageResponses.length === this.pageModel.pageSize) {
... ...
... ... @@ -56,7 +56,7 @@ export struct PlayUIComponent {
/*
初始话播放器设置
*/
initPlayerSet(){
initPlayerSet() {
//播放进度监听
if (this.playerController) {
... ... @@ -280,7 +280,12 @@ export struct PlayUIComponent {
}
// 进度条
this.playProgressView()
if (this.contentDetailData.liveInfo?.liveState == 'running') {
Blank()
} else {
this.playProgressView()
}
// 总的播放时间
if (this.contentDetailData?.liveInfo?.liveState != 'running' || this.contentDetailData.showTime) {
Text(this.totalTime)
... ...
import { ContentDetailDTO, LiveDetailsBean } from 'wdBean/Index';
import { ContentDetailDTO } from 'wdBean/Index';
import { Logger, StringUtils } from 'wdKit/Index';
import { PlayerConstants, WDAliPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index';
import { PlayUIComponent } from './PlayUIComponent';
import { PictureLoading } from '../../vertical/PictureLoading';
import { ParamType, TrackConstants } from 'wdTracking/Index';
import { TrackConstants } from 'wdTracking/Index';
const TAG: string = 'TopPlayComponent'
... ... @@ -25,21 +25,20 @@ export struct TopPlayComponent {
//播放错误
@State isError: boolean = false
// loading 控制字段
@State isLoading: boolean = false
@State isHideLoading: boolean = false
// 获取播放资源能播放了
@State isCanPlay: boolean = false
// 当前播放资源的状态
@Provide playSourceState: number = 0
private playUrl: string = ""
private xComponentIsLoaded: boolean = false
pageParam: ParamType = {}
aboutToAppear(): void {
if (this.playerController) {
this.playerController.onCanplay = () => {
this.isCanPlay = true
this.isLoading = true
this.isHideLoading = true
this.playerController?.play()
}
... ... @@ -49,7 +48,7 @@ export struct TopPlayComponent {
Logger.debug(TAG, 'status==>' + status)
if (status === PlayerConstants.STATUS_ERROR) {
this.isError = true
this.isLoading = true
this.isHideLoading = true
this.isCanPlay = false
} else if (status === PlayerConstants.STATUS_COMPLETION) {
// 播放完成
... ... @@ -67,8 +66,9 @@ export struct TopPlayComponent {
* 更新直播播放数据
*/
updateData() {
// 检测等待中的直播预告是否视频资源
// 检测直播等待状态的直播预告是否视频资源
if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewType === 1
&& this.contentDetailData?.liveInfo?.liveState == 'wait'
&& this.contentDetailData.liveInfo.previewUrl &&
this.contentDetailData.liveInfo.previewUrl.length > 0) {
// 预告资源是视频
... ... @@ -79,7 +79,6 @@ export struct TopPlayComponent {
if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewUrl &&
this.contentDetailData.liveInfo.previewUrl.length > 0) {
this.previewUrl = this.contentDetailData.liveInfo.previewUrl
} else if (this.contentDetailData.fullColumnImgUrls && this.contentDetailData.fullColumnImgUrls.length > 0) {
this.previewUrl = this.contentDetailData.fullColumnImgUrls[0].url
}
... ... @@ -88,18 +87,17 @@ export struct TopPlayComponent {
if (this.isVideoSource) {
this.isWait = false
this.isLoading = false
this.isHideLoading = false
} else {
this.isWait = this.contentDetailData?.liveInfo?.liveState == 'wait'
if (this.isWait) {
this.isLoading = true
this.isHideLoading = true
}
}
this.isEnd = this.contentDetailData?.liveInfo?.liveState === 'end' &&
StringUtils.isEmpty(this.contentDetailData?.liveInfo?.vlive[0]?.replayUri)
// Logger.debug(TAG, `---0------>` + this.isWait + ' ->' + this.isLoading + ' ->' + this.isEnd)
if (!this.isWait) {
if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.vlive.length > 0) {
let playUrl = ''
... ... @@ -115,31 +113,38 @@ export struct TopPlayComponent {
} else {
Logger.debug(TAG, `---0------>${playUrl}`)
if (StringUtils.isNotEmpty(playUrl)) {
Logger.debug(TAG, `---isNotEmpty------>`)
this.playUrl = playUrl
this.tryToPlay()
}
}
} else {
this.isWait = true
this.isLoading = true
this.isHideLoading = true
}
}
// 直播结束
if (this.contentDetailData?.liveInfo?.liveState === 'end') {
this.isHideLoading = true
this.isWait = StringUtils.isNotEmpty(this.playUrl)
}
// 文字直播 running 状态
if (this.contentDetailData?.liveInfo?.liveWay === 1 && this.contentDetailData?.liveInfo?.liveState === 'running') {
this.isWait = true
this.isLoading = true
this.isHideLoading = true
if (this.contentDetailData.fullColumnImgUrls && this.contentDetailData.fullColumnImgUrls.length > 0) {
this.previewUrl = this.contentDetailData.fullColumnImgUrls[0].url
} else {
this.previewUrl = ''
}
}
//Logger.debug(TAG, `---0------>` + this.isWait + ' ->' + this.isHideLoading + ' ->' + this.isEnd+' -->'+this.isVideoSource)
}
tryToPlay() {
Logger.debug(TAG, `---1------>`)
if (!this.xComponentIsLoaded) {
Logger.debug(TAG, "需要xComponent加载完成")
return
... ... @@ -148,16 +153,12 @@ export struct TopPlayComponent {
Logger.debug(TAG, "播放地址为空")
return
}
this.contentTrackingDict()
this.playerController?.firstPlay(this.playUrl, TrackConstants.PageName.Live_Detail, this.pageParam);
}
contentTrackingDict() {
this.pageParam = {
this.playerController?.firstPlay(this.playUrl, TrackConstants.PageName.Live_Detail, {
'contentType': `${this.contentDetailData.newsType}`,
'contentId': `${this.contentDetailData.newsId}`,
'contentName': `${this.contentDetailData.newsTitle || ''}`,
}
});
}
build() {
... ... @@ -166,11 +167,13 @@ export struct TopPlayComponent {
WDPlayerRenderLiveView({
playerController: this.playerController,
onLoad: async () => {
this.isLoading = false
this.isError = false
this.xComponentIsLoaded = true
Logger.debug(TAG, `---onLoad------>`)
this.tryToPlay()
if (StringUtils.isNotEmpty(this.playUrl)) {
this.isHideLoading = false
this.isError = false
this.xComponentIsLoaded = true
Logger.debug(TAG, `---onLoad------>`)
this.tryToPlay()
}
}
})
.height('100%')
... ... @@ -185,12 +188,13 @@ export struct TopPlayComponent {
.objectFit(ImageFit.Cover)
.alt($r('app.media.live_room_image_fail'))
.visibility(this.isWait || this.isEnd ? Visibility.Visible : Visibility.None)
.contrast(this.isEnd ? 0.2 : 1)
// .contrast(this.isEnd ? 0.4 : 1)
.blur(this.isEnd ? 20 : 0)
.width('100%')
}
// loading
PictureLoading().visibility(this.isLoading ? Visibility.None : Visibility.Visible)
PictureLoading().visibility(this.isHideLoading ? Visibility.None : Visibility.Visible)
// 视频播放器上的控制面板和信息
PlayUIComponent({ playerController: this.playerController, isShowBottom: this.isCanPlay, liveUrl: this.playUrl })
... ... @@ -226,7 +230,7 @@ export struct TopPlayComponent {
.margin({ top: 16 })
.padding(0)
.onClick(() => {
this.isLoading = false
this.isHideLoading = false
this.isError = false
this.xComponentIsLoaded = true
this.tryToPlay()
... ...
... ... @@ -11,6 +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, TrackParamConvert } from 'wdTracking/Index'
const TAG = "PlayerCommentComponent"
/**
... ... @@ -105,6 +106,7 @@ export struct PlayerCommentComponent {
contentDetailData: this.contentDetailData,
onCommentInputFocus: () => {
},
onCommentInputed: (content) => {
if (content.comment) {
... ... @@ -116,6 +118,11 @@ export struct PlayerCommentComponent {
this.liveChatList.push(result)
this.scroller.scrollEdge(Edge.Bottom)
})
// 发布评论埋点
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,8 +228,17 @@ 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() {
... ... @@ -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() {
this.ModifyPasswordLayout()
}
.width('100%')
.height('100%')
}.width('100%')
.height('100%')
Column(){
this.TitleBackComponent('')
this.ModifyPasswordLayout()
}
}
@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)
}
//TODO: 转换参数
if (program.liveInfo) {
params["liveType"] = program.liveInfo.liveState
params["liveStreamType"] = ((program.liveInfo.vrType + '') == "1") ? "2" : "1"
params["vliveId"] = program.objectId
params["vliveName"] = program.newsTitle
}
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})
... ...
import { Action } from 'wdBean';
import { SpacialTopicPageComponent } from 'wdComponent'
import { CommonConstants } from 'wdConstant'
import { Logger } from 'wdKit'
import { CommonConstants, SpConstants } from 'wdConstant'
import { Logger, SPHelper, StringUtils } from 'wdKit'
import router from '@ohos.router';
import dataPreferences from '@ohos.data.preferences';
import { TrackConstants } from 'wdTracking/Index';
const TAG = 'SpacialTopicPage';
... ... @@ -12,6 +14,22 @@ struct SpacialTopicPage {
@State action: Action = {} as Action
@State reload: number = 0
@State count: number = 0
preferences: dataPreferences.Preferences | null = null;
observer = (key: string) => {
if(key == SpConstants.USER_ID){
if(StringUtils.isEmpty(SPHelper.default.getSync(SpConstants.USER_ID,""))){
// 未登录
}else {
// 登录
this.reload = this.reload + 1
}
}
}
@Provide pageName: string = TrackConstants.PageName.Summary_Detail
@Provide pageId: string = TrackConstants.PageName.Summary_Detail
build() {
Column() {
SpacialTopicPageComponent({ action: this.action ,reload:this.reload })
... ... @@ -34,9 +52,16 @@ struct SpacialTopicPage {
Logger.info(TAG, `aboutToAppearcount:${this.reload}`);
let action: Action = router.getParams() as Action
this.action = action
this.addLoginStatusObserver()
}
async addLoginStatusObserver(){
this.preferences = await SPHelper.default.getPreferences();
this.preferences.on('change', this.observer);
}
onPageShow() {
this.reload = this.reload + 1
// this.reload = this.reload + 1
Logger.info(TAG, `onPageShowcount:${this.reload}`);
}
}
\ No newline at end of file
... ...
... ... @@ -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,55 +63,56 @@ 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)
Text($r('app.string.dialog_text_privacy_statement'))
.width('90%')
.fontColor($r('app.color.dialog_text_color'))
.fontSize(14).margin({top:20})
Row() {
Text($r('app.string.dialog_text_privacy_statement'))
.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() {
Text($r('app.string.dialog_button_disagree'))
.fancy()
.onClick(() => {
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'))
Text($r('app.string.dialog_button_agree'))
.fancyAgree()
.onClick(() => {
this.controller.close();
this.confirm();
})
Row() {
Text($r('app.string.dialog_button_disagree'))
.fancy()
.onClick(() => {
this.controller.close();
this.cancel();
})
}.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)
... ...
... ... @@ -8,6 +8,8 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter';
import { DisplayDirection } from 'wdConstant/Index';
import { PageComponent } from 'wdComponent/Index';
import { TrackingButton, TrackConstants } from 'wdTracking/Index';
import { Logger } from 'wdKit';
import { ParamType, Tracking } from 'wdTracking/Index';
const TAG = 'VideoChannelPage'
... ... @@ -100,6 +102,18 @@ export struct VideoChannelPage {
right: $r('app.float.top_tab_item_padding_horizontal'),
})
.onClick(() => {
// 视频tab埋点
const tab = this.topNavList[index]
Logger.info(TAG, `视频tab埋点: ${JSON.stringify(tab)}`);
const params: ParamType = {
"pageName": tab.name,
"tabName": tab.name,
"pageId": tab.pageId,
}
Tracking.event("video_page_tab_click", params)
if (this.currentTopNavSelectedIndex === index) {
this.autoRefresh++
}
... ... @@ -112,7 +126,6 @@ export struct VideoChannelPage {
.width('100%')
.justifyContent(FlexAlign.Center)
.backgroundColor(this.currentTopNavSelectedIndex === 0 ? Color.Transparent : Color.White)
// 搜索按钮
Row() {
... ... @@ -153,6 +166,7 @@ export struct VideoChannelPage {
topNavIndex: $currentTopNavSelectedIndex,
groupId: this.groupId + '',
pageId: item.pageId + '',
pageName: item.name + '',
channelId: item.channelId + '',
autoRefresh: this.autoRefresh,
})
... ... @@ -164,7 +178,9 @@ export struct VideoChannelPage {
pageId: item.pageId + '',
channelId: item.channelId + '',
autoRefresh: this.autoRefresh
}).margin({ top: 40 })
})
.padding({ top: 55 })
.backgroundColor(Color.White)
}
}, (item: TopNavDTO) => item.channelId + '')
}
... ...
... ... @@ -9,6 +9,7 @@
"tablet",
"2in1"
],
"compressNativeLibs": true,
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
... ...