wangliang_wd

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

* 'main' of http://192.168.1.42/developOne/harmonyPool: (29 commits)
  ref |> 修改评论列表评论内容行高
  ref |> 补充推送内链跳转与设置别名问题解决
  ref |> 修复子评论 查看更多和收起交互UI
  底导换肤修改
  feat:展会广告,点击图片没有跳转到百度
  fix:bug[17921]互动消息中的点赞显示内容鸿蒙与安卓不一致
  音频悬浮窗配置子窗口透明(无效),布局调整
  feat:广告
  feat: 17390 UI还原问题--健康频道-时间轴专题_时间节点样式与安卓不一致,点偏大
  切环境,清除首页缓存
  feat: 16997 搜索结果页-稿件发布日期展示错误
  fix:bug[17752] 消息中的预约消息在无网络时的缺省图与安卓不一致
  fix:bug[17754] 消息下的预约消息鸿蒙与安卓的标题显示不一致
  fix:bug[17795] 早晚报>多图类型稿件详情页,进入号主页_顶部展示与安卓效果不一致
  fix:bug[17051] UI还原问题--编辑资料背景图鸿蒙版未能全铺
  fix:somebug
  feat: 17492 功能缺陷-【uat】进入精选评论卡,点击点赞,未变成已点赞
  分页加载ui,消失逻辑修改
  全屏调试
  feat: 17492 功能缺陷-【uat】进入精选评论卡,点击点赞,未变成已点赞
  ...
Showing 63 changed files with 534 additions and 154 deletions
... ... @@ -34,6 +34,7 @@
{
"name": "default",
"signingConfig": "default",
"compileSdkVersion": "5.0.0(12)",
"compatibleSdkVersion": "5.0.0(12)",
"runtimeOS": "HarmonyOS",
}
... ...
... ... @@ -89,6 +89,15 @@ export class KVStoreHelper {
}
}
deleteAll() {
this.kvManager?.deleteKVStore(AppUtils.getPackageName(getContext()), KVStoreHelper._default_store_id)
.then(() => {
Logger.error(TAG, 'deleteAll success')
}).catch((e: object) => {
Logger.error(TAG, 'deleteAll error: ' + JSON.stringify(e))
})
}
private checkStoreCreated() {
if (!this.kvManager) {
this.createKVManager()
... ...
... ... @@ -93,10 +93,8 @@ export class HttpBizUtil {
*/
static refreshToken(): Promise<string> {
let url = HttpUrlUtils.getRefreshTokenUrl();
let params: HashMap<string, string> = new HashMap<string, string>()
params.set('refreshToken', HttpUtils.getRefreshToken())
params.set('deviceId', HttpUtils.getDeviceId())
// Logger.debug(TAG, 'refreshToken getRefreshToken: ' + HttpUrlUtils.getRefreshToken())
let params: RefreshTokenParam =
new RefreshTokenParam(HttpUtils.getRefreshToken(), HttpUtils.getDeviceId())
// 请求刷新token接口
return new Promise<string>((success, error) => {
WDHttp.post<ResponseDTO<RefreshTokenRes>>(url, params).then((resDTO: ResponseDTO<RefreshTokenRes>) => {
... ... @@ -124,3 +122,13 @@ export class HttpBizUtil {
})
}
}
export class RefreshTokenParam {
refreshToken: string = ''
deviceId: string = ''
constructor(refreshToken: string, deviceId: string) {
this.refreshToken = refreshToken
this.deviceId = deviceId
}
}
\ No newline at end of file
... ...
import { url } from '@kit.ArkTS'
import App from '@system.app'
import { Action, Params } from 'wdBean/Index'
import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'
import { Logger } from 'wdKit/Index'
import { WDRouterRule } from '../router/WDRouterRule'
import { ProcessUtils } from './ProcessUtils'
const TAG = "AppInnerLink"
... ... @@ -8,7 +12,7 @@ export class AppInnerLink {
static readonly INNER_LINK_PROTCOL = "rmrbapp:"
static readonly INNER_LINK_HOSTNAME = "rmrb.app"
static readonly INNER_LINK_PATHNAME = "openwith"
static readonly INNER_LINK_PATHNAME = "/openwith"
// 内链跳转
// 内链地址例如:rmrbapp://rmrb.app/openwith?type=article&subType=h5_template_article&contentId=30000762651&relId=500000038702&skipType=1&relType=1
... ... @@ -48,19 +52,110 @@ export class AppInnerLink {
}
private static jumpParams(params: InnerLinkParam) {
if (!AppInnerLink.validTypes(params.type)) {
return
}
const contentType = AppInnerLink.contentTypeWithType(params.type)
if (params.type == "article") {
let taskAction: Action = {
type: 'JUMP_INNER_NEW_PAGE',
params: {
contentID: params.contentId,
pageID: 'IMAGE_TEXT_DETAIL',
extra: {
relType: params.relType,
relId: params.relId,
sourcePage: '5', // ???
} as ExtraDTO
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
return
}
if (params.type == "video"
|| params.type == "dynamic"
|| params.type == "live"
|| params.type == "audio"
|| params.type == "picture") {
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
params: {
detailPageType: contentType,
contentID: params.contentId,
extra: {
relType: params.relType,
relId: params.relId,
} as ExtraDTO
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
return
}
if (params.type == "owner_page" && params.creatorId) {
ProcessUtils.gotoPeopleShipHomePage(params.creatorId)
return
}
if (params.type == "topic") {
}
if (params.type == "channel") {
}
}
private static contentTypeWithType(type?: string) : number | undefined {
switch (type) {
case "video": return 1
case "dynamic": return 14
case "live": return 2
case "audio": return 13
case "picture": return 9
case "article": return 8
case "ask": return 16
}
return
}
private static validTypes(type?: string) : boolean {
if (!type) {
return false
}
let typeArray = ["article", "dynamic", "live", "video", "topic", "audio", "ask", "picture", "owner_page", "topic", "channel"]
return typeArray.indexOf(type) != -1
}
private static jumpNoParams(params: InnerLinkParam) {
if (!params.type || params.type != "app" || !params.subType) {
return
}
if (params.subType == "login") {
ProcessUtils.gotoLoginPage();
} else if (params.subType == "search") {
} else if (params.subType == "home") {
} else if (params.subType == "mine") {
}
private static jumpAppH5(params: InnerLinkParam) {
}
private static jumpAppH5(params: InnerLinkParam) {
if (params.type && params.type == "h5" && params.url) {
ProcessUtils.gotoDefaultWebPage(params.url);
}
}
private static jumpOutH5(params: InnerLinkParam) {
if (params.type && params.type == "h5" && params.url) {
ProcessUtils.jumpExternalWebPage(params.url);
}
}
private static jumpThirdApp(params: InnerLinkParam) {
//TODO:
}
static parseParams(link: string) : InnerLinkParam | undefined {
... ...
... ... @@ -90,7 +90,7 @@ export struct WdWebComponent {
}
onReloadStateChanged() {
Logger.info(TAG, `onReloadStateChanged:::refresh, this.reload: ${this.reload}`);
if (this.reload > 0) {
if (this.reload > 0 && this.isPageEnd) {
this.webviewControl.refresh()
}
}
... ...
... ... @@ -7,17 +7,20 @@ import { TopNavDTO } from './TopNavDTO';
export class NavigationBodyDTO {
backgroundColor: string = ''; // 迭代二新增-底部导航背景色(信息流频道)
bottomNavList: BottomNavDTO[] = [];
// greyBottomNav: GreyBottomNav; // 灰度皮肤
immersiveBackgroundColor: string = ''; // 迭代二新增-底部导航背景色(沉浸式频道)
nightBackgroundColor: string = ''; // 迭代三新增-底部导航背景色(夜间模式)
greyBottomNav?: GreyBottomNavBean; // 灰度皮肤
md5: string = ''
}
export class GreyBottomNavBean {
bottomNavList: BottomNavDTO[] = [];
greyUserList: string[] = [];
}
export class NavigationDetailDTO {
id: string = ''; // 迭代二新增-底部导航背景色(信息流频道)
bottomNavCompList: BottomNavCompDTO[] = [];
topNavChannelList: TopNavDTO[] = [];
md5: string = ''
}
... ...
... ... @@ -121,15 +121,15 @@ export struct CompParser {
CardParser({ contentDTO: this.compDTO.operDataList[0], compDTO: this.compDTO });
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else {
Text(this.compDTO.compStyle)
.width(CommonConstants.FULL_PARENT)
.padding(10)
.onClick(() => {
if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) { //精选评论
WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage)
}
})
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
// Text(this.compDTO.compStyle)
// .width(CommonConstants.FULL_PARENT)
// .padding(10)
// .onClick(() => {
// if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) { //精选评论
// WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage)
// }
// })
// Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
}
}
... ...
... ... @@ -5,7 +5,6 @@ import {
EmitterUtils,
EmitterEventId,
NetworkUtil,
DisplayUtils
} from 'wdKit';
import {
Action,
... ... @@ -33,6 +32,7 @@ import { CommentComponent } from '../components/comment/view/CommentComponent'
import { HttpUtils } from 'wdNetwork/Index';
import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
import { componentUtils, window } from '@kit.ArkUI';
const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
... ... @@ -58,6 +58,9 @@ export struct ImageAndTextPageComponent {
@State likeNum: number = 0
@State reachEndIncreament: number = 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State isScrollTop: boolean = true
@State offsetY: number = 0
build() {
Stack({ alignContent: Alignment.Top }) {
Stack({ alignContent: Alignment.Bottom }) {
... ... @@ -125,9 +128,11 @@ export struct ImageAndTextPageComponent {
fixedHeightMode: false,
reachEndIncreament: this.reachEndIncreament,
reachEndLoadMoreFinish: () => {
}
}).onAreaChange((oldValue: Area, newValue: Area) => {
}).id('comment')
.onAreaChange((oldValue: Area, newValue: Area) => {
this.info = newValue
})
// .onMeasureSize()
... ... @@ -135,6 +140,7 @@ export struct ImageAndTextPageComponent {
}
}
}
.id('imgTextContainer')
}
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
... ... @@ -163,8 +169,27 @@ export struct ImageAndTextPageComponent {
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
styleType: 1,
onCommentIconClick: () => {
const info = componentUtils.getRectangleById('comment');
console.log(JSON.stringify(info))
if (!this.offsetY) {
this.offsetY = componentUtils.getRectangleById('comment').windowOffset.y
}
// 定位到评论区域
if (this.isScrollTop) {
this.scroller.scrollTo({
xOffset: 0,
yOffset: this.offsetY,
animation: true
})
} else {
this.scroller.scrollEdge(Edge.Top)
}
this.isScrollTop = !this.isScrollTop
}
})
.position({y: '100%'})
.position({ y: '100%' })
}
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
... ... @@ -174,7 +199,7 @@ export struct ImageAndTextPageComponent {
// 发布时间
Column() {
Row() {
if(this.isNetConnected && !this.detailContentEmpty) {
if (this.isNetConnected && !this.detailContentEmpty) {
Image(this.contentDetailData?.rmhInfo ? $r('app.media.logo_rmh') : $r('app.media.logo_rmrb'))
.width(80)
.height(28)
... ... @@ -207,7 +232,7 @@ export struct ImageAndTextPageComponent {
private async getDetail() {
this.isNetConnected = NetworkUtil.isNetConnected()
if(!this.isNetConnected) {
if (!this.isNetConnected) {
this.emptyType = 1
}
let contentId: string = ''
... ... @@ -229,7 +254,7 @@ export struct ImageAndTextPageComponent {
let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType)
// 判断内容是否已下线,空数组表示下线
this.detailContentEmpty = detailBeans.length === 0 ? true : false
if(this.detailContentEmpty) {
if (this.detailContentEmpty) {
this.emptyType = 18
}
console.log(TAG, JSON.stringify(detailBeans))
... ... @@ -270,12 +295,11 @@ export struct ImageAndTextPageComponent {
}
//意图上报
private viewBlogInsightIntentShare(){
private viewBlogInsightIntentShare() {
let context = getContext(this) as common.UIAbilityContext;
viewBlogItemInsightIntentShare(context,this.contentDetailData, this.interactData)
viewBlogItemInsightIntentShare(context, this.contentDetailData, this.interactData)
}
private async getRecommend() {
let params: postRecommendListParams = {
imei: HttpUtils.getImei(),
... ...
... ... @@ -90,6 +90,9 @@ export struct SpacialTopicPageComponent {
this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')
this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')
// }
if (this.contentDetailData[0]?.openComment) {
this.operationButtonList = ['collect', 'share']
}
this.trySendData2H5()
}
}
... ...
... ... @@ -45,13 +45,18 @@ export struct CardMediaInfo {
.mediaLogo()
Text('回看')
.mediaText()
} else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo
?.replayUri) {
// Image($r('app.media.card_live'))
// .mediaLogo()
Text('直播结束')
}else if(this.contentDTO?.liveInfo?.liveState === 'end' && !this.contentDTO?.liveInfo
?.replayUri){
Text('已结束')
.mediaText()
}
// } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo
// ?.replayUri) {
// // Image($r('app.media.card_live'))
// // .mediaLogo()
// Text('直播结束')
// .mediaText()
// }
}
} else if (this.contentDTO.objectType === '9') {
// 显示组图;图片数量
... ...
... ... @@ -53,7 +53,7 @@ export struct CardSourceInfo {
// .flexShrink(0);
// }
if (this.contentDTO.source) {
Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)))
Text(DateTimeUtils.getCommentTime(Number.parseFloat(new Date(this.contentDTO.publishTime).getTime().toString())))
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_B0B0B0"))
.flexShrink(0);
... ...
... ... @@ -22,6 +22,8 @@ export struct AdvCardParser {
@State compDTO: CompDTO = {} as CompDTO;
pageModel: PageModel = new PageModel();
build() {
this.contentBuilder(this.pageModel, this.compDTO);
}
... ...
import { CompDTO } from 'wdBean';
import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from 'wdRouter';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import PageModel from '../../viewmodel/PageModel';
import { CardAdvBottom } from './CardAdvBottom';
... ... @@ -17,8 +18,11 @@ const TAG: string = 'Card2Component';
@Component
export struct CardAdvBigImageComponent {
@State compDTO: CompDTO = {} as CompDTO
@State loadImg: boolean = false;
pageModel: PageModel = new PageModel();
aboutToAppear(): void {
async aboutToAppear(): Promise<void> {
this.loadImg = await onlyWifiLoadImg();
}
... ... @@ -33,7 +37,8 @@ export struct CardAdvBigImageComponent {
//新闻标题
Text(this.compDTO.matInfo.advTitle).bottomTextStyle().margin({ bottom: 8, })
//大图
Image(this.compDTO.matInfo.matImageUrl[0])
Image(this.loadImg ? this.compDTO.matInfo.matImageUrl[0] : '')
.backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(16 / 9)
.borderRadius(4)
... ...
... ... @@ -4,6 +4,7 @@ import { AdvExtraData, AdvExtraItemData } from 'wdBean/src/main/ets/bean/adv/Adv
import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean';
import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from 'wdRouter';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import PageModel from '../../viewmodel/PageModel';
import { CardAdvTop } from './CardAdvTop';
... ... @@ -23,14 +24,14 @@ export struct CardAdvGanMiComponent {
@State advExtraData: AdvExtraData = {} as AdvExtraData
@State advLength: number = 0;
pageModel: PageModel = new PageModel();
@State loadImg: boolean = false;
aboutToAppear(): void {
async aboutToAppear(): Promise<void> {
this.loadImg = await onlyWifiLoadImg();
let extraData = this.compDTO.matInfo.extraData
let labelDTO = JSON.parse(extraData) as AdvExtraData
this.advExtraData = labelDTO
//this.advExtraData.item = [this.advExtraData.item[0]]
// this.advExtraData.item[2].title ="我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国"
this.advLength = this.advExtraData.item.length
}
... ... @@ -46,8 +47,9 @@ export struct CardAdvGanMiComponent {
Row() {
Stack() {
//长图
Image(this.advExtraData.itemTopImage)
Image(this.loadImg ? this.advExtraData.itemTopImage : '')
.width(CommonConstants.FULL_WIDTH)
.backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
.aspectRatio(343 / 40)
.borderRadius(4)
.borderWidth(0.5)
... ... @@ -73,8 +75,9 @@ export struct CardAdvGanMiComponent {
// 广告列表信息
Column() {
Image(content.image)
Image(this.loadImg ? content.image : '')
.width('100%')
.backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
.aspectRatio(150 / 84)
.borderWidth(0.5)
.borderColor($r('app.color.color_0D000000'))
... ... @@ -84,7 +87,7 @@ export struct CardAdvGanMiComponent {
.fontSize('16fp')
.fontColor($r('app.color.color_222222'))
.fontSize('15fp')
.maxLines(3)
.maxLines(2)
.lineHeight(20)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.width('100%')
... ... @@ -121,7 +124,7 @@ export struct CardAdvGanMiComponent {
})
// 更多按钮
commonButton(this.advExtraData)
this.commonButton()
}
.width(CommonConstants.FULL_WIDTH)
... ... @@ -131,19 +134,21 @@ export struct CardAdvGanMiComponent {
})
}
}
/*
/*
标题样式
*/
@Builder
function commonButton(advExtraData: AdvExtraData) {
@Builder
commonButton() {
Row() {
Row() {
Blank()
Text('查看更多').fontColor('#222222').fontSize('14fp')
Text(this.advExtraData.itemMore == undefined ? $r('app.string.look_more') :
this.advExtraData.itemMore.title == undefined ? $r('app.string.look_more') : this.advExtraData.itemMore.title)
.fontColor('#222222')
.fontSize('14fp')
Image($r('app.media.icon_comp_more_right_red')).width(16).height(16)
Blank()
... ... @@ -153,11 +158,14 @@ function commonButton(advExtraData: AdvExtraData) {
.borderRadius(3)
.padding({ top: 10, bottom: 10, })
.onClick(() => {
if (this.advExtraData.itemMore != undefined) {
let matInfo: CompAdvMatInfoBean = {
linkUrl: advExtraData.itemMore.linkUrl,
linkType: advExtraData.itemMore.linkType
linkUrl: this.advExtraData.itemMore.linkUrl,
linkType: this.advExtraData.itemMore.linkType
} as CompAdvMatInfoBean;
ProcessUtils.openAdvDetail(matInfo)
}
})
}.width('100%').padding({
left: $r('app.float.card_comp_pagePadding_lf'),
... ... @@ -165,4 +173,6 @@ function commonButton(advExtraData: AdvExtraData) {
})
}
}
... ...
... ... @@ -2,6 +2,7 @@
import { CompDTO } from 'wdBean';
import { CommonConstants, CompStyle } from 'wdConstant/Index';
import { ProcessUtils } from 'wdRouter';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import PageModel from '../../viewmodel/PageModel';
import { CardAdvBottom } from './CardAdvBottom';
... ... @@ -20,8 +21,10 @@ export struct CardAdvLongImageComponent {
@State compDTO: CompDTO = {} as CompDTO
@State haveTitle: boolean = true
pageModel: PageModel = new PageModel();
@State loadImg: boolean = false;
aboutToAppear(): void {
async aboutToAppear(): Promise<void> {
this.loadImg = await onlyWifiLoadImg();
this.haveTitle = this.compDTO.matInfo.advSubType === CompStyle.Card_Adv_7;
}
... ... @@ -37,7 +40,8 @@ export struct CardAdvLongImageComponent {
Text(this.compDTO.matInfo.advTitle).width('100%').bottomTextStyle().margin({ bottom: 8, })
}
//长图
Image(this.compDTO.matInfo.matImageUrl[0])
Image(this.loadImg ? this.compDTO.matInfo.matImageUrl[0] : '')
.backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(343 / 96)
.borderRadius(4)
... ...
... ... @@ -6,6 +6,7 @@ import measure from '@ohos.measure';
import { DisplayUtils } from 'wdKit/Index';
import { CardAdvBottom } from './CardAdvBottom';
import PageModel from '../../viewmodel/PageModel';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
const TAG: string = 'CardAdvSmallImageComponent';
... ... @@ -22,7 +23,10 @@ export struct CardAdvSmallImageComponent {
@State compDTO: CompDTO = {} as CompDTO
@State isBigThreeLine: boolean = false // 标题的行数大于等于3行 是true
pageModel: PageModel = new PageModel();
aboutToAppear(): void {
@State loadImg: boolean = false;
async aboutToAppear(): Promise<void> {
this.loadImg = await onlyWifiLoadImg();
// 计算标题文本行数
let screenWith = DisplayUtils.getDeviceWidth();
... ... @@ -54,14 +58,14 @@ export struct CardAdvSmallImageComponent {
.id("title_name")
// 广告图
Image(this.compDTO.matInfo.matImageUrl[0])
Image(this.loadImg ? this.compDTO.matInfo.matImageUrl[0] : '')
.width('34%')
.aspectRatio(3 / 2)
.id('adv_imag')
.backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
.borderWidth(0.5)
.borderColor($r('app.color.color_0D000000'))
.borderRadius(4)
//.alt('wwww.baidu.com')
.borderRadius(4)//.alt('wwww.baidu.com')
.alignRules({
top: { anchor: 'title_name', align: VerticalAlign.Top },
left: { anchor: 'title_name', align: HorizontalAlign.End },
... ... @@ -69,7 +73,7 @@ export struct CardAdvSmallImageComponent {
.margin({ left: 12 })
CardAdvBottom({pageModel:this.pageModel,compDTO:this.compDTO}).width('62%').id('bottom_adv').alignRules({
CardAdvBottom({ pageModel: this.pageModel, compDTO: this.compDTO }).width('62%').id('bottom_adv').alignRules({
bottom: { anchor: this.isBigThreeLine ? '' : 'adv_imag', align: VerticalAlign.Bottom },
right: { anchor: this.isBigThreeLine ? '' : 'adv_imag', align: HorizontalAlign.Start },
top: { anchor: this.isBigThreeLine ? 'title_name' : '', align: VerticalAlign.Bottom },
... ... @@ -94,13 +98,15 @@ export struct CardAdvSmallImageComponent {
}
// 获取文本几行
private getTextLineNum(text: string, constraintWidth: number, lineHeight: number, fontSize: number | string | Resource) {
private getTextLineNum(text: string, constraintWidth: number, lineHeight: number,
fontSize: number | string | Resource) {
let size = this.topMeasureText(text, constraintWidth, lineHeight, fontSize)
let height: number = Number(size.height)
return Math.ceil(px2vp(height) / lineHeight)
}
private topMeasureText(text: string, constraintWidth: number, lineHeight: number, fontSize: number | string | Resource) {
private topMeasureText(text: string, constraintWidth: number, lineHeight: number,
fontSize: number | string | Resource) {
return measure.measureTextSize({
textContent: text,
fontSize: fontSize,
... ...
... ... @@ -2,6 +2,7 @@
import { CompDTO } from 'wdBean';
import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from 'wdRouter';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import PageModel from '../../viewmodel/PageModel';
import { CardAdvBottom } from './CardAdvBottom';
... ... @@ -18,9 +19,11 @@ const TAG: string = 'Card2Component';
@Component
export struct CardAdvThreeImageComponent {
@State compDTO: CompDTO = {} as CompDTO
@State loadImg: boolean = false;
pageModel: PageModel = new PageModel();
aboutToAppear(): void {
async aboutToAppear(): Promise<void> {
this.loadImg = await onlyWifiLoadImg();
}
aboutToDisappear(): void {
... ... @@ -43,7 +46,8 @@ export struct CardAdvThreeImageComponent {
ForEach(this.compDTO.matInfo.matImageUrl, (url: string, index: number) => {
if (index < 3) {
GridCol({ span: { xs: 4 } }) {
Image(url)
Image(this.loadImg ? url : '')
.backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
.width('100%')
.aspectRatio(113 / 75)
.borderRadius({
... ... @@ -62,7 +66,7 @@ export struct CardAdvThreeImageComponent {
.margin({ top: 8 })
// 广告工具组件
CardAdvBottom({pageModel:this.pageModel,compDTO:this.compDTO}).width('100%').margin({ top: 8 })
CardAdvBottom({ pageModel: this.pageModel, compDTO: this.compDTO }).width('100%').margin({ top: 8 })
}
.width('100%')
.justifyContent(FlexAlign.Start)
... ...
... ... @@ -2,6 +2,7 @@
import { CompDTO, ContentDTO } from 'wdBean';
import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from 'wdRouter';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import PageModel from '../../viewmodel/PageModel';
import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
import { CardAdvBottom } from './CardAdvBottom';
... ... @@ -20,11 +21,11 @@ const TAG: string = 'Card2Component';
export struct CardAdvVideoComponent {
@State compDTO: CompDTO = {} as CompDTO
@State contentDTO: ContentDTO = new ContentDTO()
@State loadImg: boolean = false;
pageModel: PageModel = new PageModel();
aboutToAppear(): void {
// this.contentDTO.objectType = '1'
// this.contentDTO.videoInfo = { videoDuration: 1000 } as VideoInfoDTO
async aboutToAppear(): Promise<void> {
this.loadImg = await onlyWifiLoadImg();
}
aboutToDisappear(): void {
... ... @@ -39,7 +40,8 @@ export struct CardAdvVideoComponent {
Text(this.compDTO.matInfo.advTitle).bottomTextStyle()
//大图
Stack() {
Image(this.compDTO.matInfo.matImageUrl[0])
Image(this.loadImg ? this.compDTO.matInfo.matImageUrl[0] : '')
.backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(16 / 9)
.borderRadius(4)
... ... @@ -54,7 +56,7 @@ export struct CardAdvVideoComponent {
.width(CommonConstants.FULL_WIDTH)
.margin({ top: 8 })
CardAdvBottom({pageModel:this.pageModel,compDTO:this.compDTO}).margin({
CardAdvBottom({ pageModel: this.pageModel, compDTO: this.compDTO }).margin({
top: 8,
})
}
... ...
... ... @@ -3,6 +3,7 @@ import { AdvExtraData, AdvExtraItemData } from 'wdBean/src/main/ets/bean/adv/Adv
import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean';
import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from 'wdRouter';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import PageModel from '../../viewmodel/PageModel';
import { CardAdvTop } from './CardAdvTop';
... ... @@ -21,9 +22,10 @@ export struct CardAdvVideoExComponent {
@State compDTO: CompDTO = {} as CompDTO
@State advExtraData: AdvExtraData = {} as AdvExtraData
pageModel: PageModel = new PageModel();
@State loadImg: boolean = false;
aboutToAppear(): void {
async aboutToAppear(): Promise<void> {
this.loadImg = await onlyWifiLoadImg();
let extraData = this.compDTO.matInfo.extraData
let labelDTO = JSON.parse(extraData) as AdvExtraData
... ... @@ -40,13 +42,17 @@ export struct CardAdvVideoExComponent {
Stack() {
//长图
Image(this.advExtraData.itemTopImage)
Image(this.loadImg ? this.advExtraData.itemTopImage : '')
.width(CommonConstants.FULL_WIDTH)
.backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
.aspectRatio(343 / 80)
.borderRadius(4)
.borderWidth(0.5)
.borderColor($r('app.color.color_0D000000'))
.onClick(() => {
ProcessUtils.openAdvDetail(this.compDTO.matInfo)
})
CardAdvTop({ pageModel: this.pageModel, compDTO: this.compDTO })
}
... ... @@ -74,7 +80,7 @@ export struct CardAdvVideoExComponent {
}.width('100%').listDirection(Axis.Vertical).margin({ top: 10, bottom: 10 })
// 更多按钮
commonButton(this.advExtraData)
this.commonButton()
}
.width(CommonConstants.FULL_WIDTH)
... ... @@ -86,14 +92,12 @@ export struct CardAdvVideoExComponent {
})
}
}
/*
/*
标题样式
*/
@Builder
function commonButton(advExtraData: AdvExtraData) {
@Builder
commonButton() {
Row() {
Blank()
... ... @@ -108,9 +112,11 @@ function commonButton(advExtraData: AdvExtraData) {
.padding({ top: 10, bottom: 10, })
.onClick(() => {
let matInfo: CompAdvMatInfoBean = {
linkUrl: advExtraData.itemMore.linkUrl,
linkType: advExtraData.itemMore.linkType
linkUrl: this.advExtraData.itemMore.linkUrl,
linkType: this.advExtraData.itemMore.linkType
} as CompAdvMatInfoBean;
ProcessUtils.openAdvDetail(matInfo)
})
}
}
... ...
... ... @@ -5,6 +5,7 @@ import { CommonConstants } from 'wdConstant';
import { ProcessUtils } from 'wdRouter';
import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
import { Notes } from './notes';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
const TAG = 'Card11Component';
... ... @@ -23,6 +24,7 @@ export struct Card11Component {
async aboutToAppear(): Promise<void> {
this.titleInit();
this.clicked = hasClicked(this.contentDTO.objectId)
}
titleInit() {
... ... @@ -76,8 +78,8 @@ export struct Card11Component {
})
.backgroundColor($r("app.color.white"))
.onClick((event: ClickEvent) => {
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
}
... ...
... ... @@ -4,6 +4,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from 'wdRouter';
import {CarderInteraction} from '../CarderInteraction'
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
const TAG = 'Card12Component';
... ... @@ -21,6 +22,7 @@ export struct Card12Component {
aboutToAppear(): void {
this.titleInit();
this.clicked = hasClicked(this.contentDTO.objectId)
}
titleInit() {
... ... @@ -69,6 +71,7 @@ export struct Card12Component {
})
.onClick((event: ClickEvent) => {
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
}
... ...
... ... @@ -5,6 +5,7 @@ import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from 'wdRouter';
import {CarderInteraction} from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
const TAG = 'Card14Component';
... ... @@ -23,6 +24,7 @@ export struct Card14Component {
async aboutToAppear(): Promise<void> {
this.titleInit();
this.clicked = hasClicked(this.contentDTO.objectId)
this.loadImg = await onlyWifiLoadImg();
}
... ... @@ -88,6 +90,7 @@ export struct Card14Component {
})
.onClick((event: ClickEvent) => {
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
}
... ...
... ... @@ -5,6 +5,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CommonConstants } from 'wdConstant/Index';
import {CarderInteraction} from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
const TAG: string = 'Card15Component';
... ... @@ -27,6 +28,7 @@ export struct Card15Component {
async aboutToAppear(): Promise<void> {
this.titleInit();
this.clicked = hasClicked(this.contentDTO.objectId)
this.loadImg = await onlyWifiLoadImg();
}
... ... @@ -85,6 +87,7 @@ export struct Card15Component {
})
.onClick((event: ClickEvent) => {
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
}
... ...
... ... @@ -5,6 +5,7 @@ import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from 'wdRouter';
import {CarderInteraction} from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
const TAG = 'Card16Component';
... ... @@ -28,6 +29,7 @@ export struct Card16Component {
async aboutToAppear(): Promise<void> {
this.titleInit();
this.clicked = hasClicked(this.contentDTO.objectId)
this.loadImg = await onlyWifiLoadImg();
}
... ... @@ -87,6 +89,7 @@ export struct Card16Component {
})
.onClick((event: ClickEvent) => {
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
}
... ...
... ... @@ -5,6 +5,7 @@ import { WDRouterRule } from 'wdRouter';
import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
const TAG = 'Card17Component';
... ... @@ -24,6 +25,7 @@ export struct Card17Component {
async aboutToAppear(): Promise<void> {
this.titleInit();
this.clicked = hasClicked(this.contentDTO.objectId)
this.loadImg = await onlyWifiLoadImg();
}
... ... @@ -105,6 +107,7 @@ export struct Card17Component {
.width(CommonConstants.FULL_WIDTH)
.onClick((event: ClickEvent) => {
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
params: {
... ...
... ... @@ -4,6 +4,7 @@ import { ProcessUtils } from 'wdRouter';
import { CommonConstants } from 'wdConstant/Index';
import { CarderInteraction } from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
const TAG = 'Card19Component';
... ... @@ -21,6 +22,7 @@ export struct Card19Component {
async aboutToAppear(): Promise<void> {
this.titleInit();
this.clicked = hasClicked(this.contentDTO.objectId)
console.log('card19',JSON.stringify(this.contentDTO))
}
... ... @@ -74,6 +76,7 @@ export struct Card19Component {
})
.onClick((event: ClickEvent) => {
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
}
... ...
... ... @@ -5,6 +5,7 @@ import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from 'wdRouter';
import {CarderInteraction} from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
const TAG = 'Card20Component';
... ... @@ -22,6 +23,7 @@ export struct Card20Component {
aboutToAppear(): void {
this.titleInit();
this.clicked = hasClicked(this.contentDTO.objectId)
}
titleInit() {
... ... @@ -71,6 +73,7 @@ export struct Card20Component {
})
.onClick((event: ClickEvent) => {
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
}
... ...
... ... @@ -5,6 +5,7 @@ import { RmhTitle } from '../cardCommon/RmhTitle'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import {CarderInteraction} from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
const TAG: string = 'Card6Component-Card13Component';
... ... @@ -23,6 +24,7 @@ export struct Card21Component {
async aboutToAppear(): Promise<void> {
this.titleInit();
this.clicked = hasClicked(this.contentDTO.objectId)
this.loadImg = await onlyWifiLoadImg();
}
... ... @@ -79,6 +81,7 @@ export struct Card21Component {
}
.onClick((event: ClickEvent) => {
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
.padding({
... ...
... ... @@ -7,7 +7,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
import { Notes } from './notes';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
// import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
const TAG: string = 'Card2Component';
/**
... ... @@ -29,9 +29,9 @@ export struct Card2Component {
@State str03: string = '';
async aboutToAppear(): Promise<void> {
this.clicked = hasClicked(this.contentDTO.objectId)
this.titleInit();
this.loadImg = await onlyWifiLoadImg();
// this.clicked = hasClicked(this.contentDTO.objectId)
}
titleInit() {
... ... @@ -109,7 +109,7 @@ export struct Card2Component {
})
.onClick((event: ClickEvent) => {
this.clicked = true;
// persistentStorage(this.contentDTO.objectId);
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
}
... ...
... ... @@ -3,6 +3,7 @@ import { CompDTO, ContentDTO } from 'wdBean';
import { ProcessUtils } from 'wdRouter';
import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
import { Notes } from './notes';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
/**
* 卡片样式:"appStyle":"3"
... ... @@ -20,7 +21,7 @@ export struct Card3Component {
async aboutToAppear(): Promise<void> {
this.titleInit();
// this.clicked = hasClicked(this.contentDTO.objectId)
this.clicked = hasClicked(this.contentDTO.objectId)
}
titleInit() {
... ... @@ -71,6 +72,7 @@ export struct Card3Component {
})
.onClick((event: ClickEvent) => {
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
}
... ...
... ... @@ -5,6 +5,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { Notes } from './notes';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
const TAG: string = 'Card4Component';
/**
... ... @@ -26,6 +27,7 @@ export struct Card4Component {
@ObjectLink compDTO: CompDTO
async aboutToAppear(): Promise<void> {
this.clicked = hasClicked(this.contentDTO.objectId)
this.titleInit();
this.loadImg = await onlyWifiLoadImg();
}
... ... @@ -102,6 +104,7 @@ export struct Card4Component {
.alignItems(HorizontalAlign.Start)
.onClick((event: ClickEvent) => {
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
//bottom 评论等信息
... ...
... ... @@ -3,6 +3,7 @@ import { CommonConstants } from 'wdConstant';
import { ProcessUtils } from 'wdRouter';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { Notes } from './notes';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
const TAG: string = 'Card5Component';
... ... @@ -21,6 +22,7 @@ export struct Card5Component {
@State str03: string = '';
async aboutToAppear(): Promise<void> {
this.clicked = hasClicked(this.contentDTO.objectId)
this.loadImg = await onlyWifiLoadImg();
this.titleInit();
... ... @@ -95,6 +97,7 @@ export struct Card5Component {
})
.onClick((event: ClickEvent) => {
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
... ...
... ... @@ -6,6 +6,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
import { Notes } from './notes';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { Logger } from 'wdKit/Index';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
const TAG: string = 'Card6Component-Card13Component';
... ... @@ -26,7 +27,7 @@ export struct Card6Component {
async aboutToAppear(): Promise<void> {
this.titleInit();
this.loadImg = await onlyWifiLoadImg();
// this.clicked = hasClicked(this.contentDTO.objectId)
this.clicked = hasClicked(this.contentDTO.objectId)
}
titleInit() {
... ... @@ -104,7 +105,7 @@ export struct Card6Component {
}
.onClick((event: ClickEvent) => {
this.clicked = true;
// persistentStorage(this.contentDTO.objectId);
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
.padding({
... ...
... ... @@ -4,6 +4,7 @@ import { DateTimeUtils } from 'wdKit';
import { ProcessUtils } from 'wdRouter';
import { Notes } from './notes';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
/**
* 时间链卡--CompStyle: 09
... ... @@ -23,6 +24,7 @@ export struct Card9Component {
async aboutToAppear(): Promise<void> {
this.titleInit();
// this.loadImg = await onlyWifiLoadImg();
this.clicked = hasClicked(this.contentDTO.objectId)
}
titleInit() {
... ... @@ -111,6 +113,7 @@ export struct Card9Component {
.margin({ bottom: 8 })
.onClick((event: ClickEvent) => {
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
})
}
... ... @@ -140,7 +143,7 @@ export struct Card9Component {
// 标题
Image($r("app.media.timeAxis"))
.width(9)
.height(9)
.height(6)
.margin({ right: 5 })
.fillColor(item.newsTitleColor)
... ... @@ -163,6 +166,7 @@ export struct Card9Component {
.textOverflow({ overflow: TextOverflow.Ellipsis })
.alignSelf(ItemAlign.Center)
.margin({ left: 12 })
// .padding({bottom: 20})
// if (item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) {
// Image(this.loadImg? item.fullColumnImgUrls[0].url : '')
// .backgroundColor(0xf5f5f5)
... ... @@ -175,7 +179,7 @@ export struct Card9Component {
}
.alignContent(Alignment.TopStart)
}
.height(item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url ? 100 : 78)
.height(item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url ? 100 : 50)
.alignItems(HorizontalAlign.Start)
}
}
\ No newline at end of file
... ...
... ... @@ -422,12 +422,13 @@ struct footerExpandedView {
build() {
Row() {
if (this.item.expanded) {
if (this.item.childsHasMore) {
Row() {
Text().backgroundColor($r('app.color.color_EDEDED')).width(24).height(1)
Text('查看更多回复').fontColor($r('app.color.color_222222')).fontSize(14).margin({ left: 6 })
if (this.item.childsHasMore) {
Row() {
Text('查看更多回复').fontColor($r('app.color.color_222222')).fontSize(14)
Image($r('app.media.comment_unfold')).width(12).height(12)
}.margin({ left: 53 })
}.margin({ left: 6 })
.onClick(() => {
if (this.item.isLoading) {
return
... ... @@ -439,13 +440,14 @@ struct footerExpandedView {
Row() {
Text('收起').fontColor($r('app.color.color_222222')).fontSize(14)
Image($r('app.media.comment_pickUp')).width(12).height(12)
}.margin({ left: this.item.childsHasMore ? 32 : 213 })
}.margin({ left: 6 })
.onClick(() => {
this.item.pageNum = 1
this.item.expanded = false
this.item.childComments = []
this.item.childCommentsLazyDataSource.clear()
})
}.margin({ left: 53 })
} else {
Row() {
Text().backgroundColor($r('app.color.color_EDEDED')).width(24).height(1)
... ... @@ -568,6 +570,7 @@ struct commentHeaderView {
publishCommentModel: this.publishCommentModel
}).margin({ left: 59, right: 16 })
}.alignItems(HorizontalAlign.Start)
.padding({bottom: 8})
}
replyComment() {
... ...
... ... @@ -9,7 +9,7 @@ import { ContentDetailDTO } from 'wdBean/Index'
export struct CommentTabComponent {
private onCommentFocus: () => void = () => {
}
private onLoad: (dialogController: CustomDialogController) => void = () => {
private onLoad: (dialogController: CustomDialogController | null) => void = () => {
}
@ObjectLink publishCommentModel: publishCommentModel
@Prop contentDetail: ContentDetailDTO
... ...
... ... @@ -129,8 +129,10 @@ export struct CommentText {
// Stack({ alignContent: Alignment.BottomEnd }) {
Text(this.longMessage) {
Span(this.expandedStates ? this.longMessage : this.maxLineMesssage)
.lineHeight(this.lineHeight)
Span(this.collapseText)
.fontColor("#999999")
.lineHeight(this.lineHeight)
.onClick(() => {
if (this.collapseText == collapseString) {
this.collapseText = uncollapseString;
... ... @@ -171,6 +173,7 @@ export struct CommentText {
else {
Text(this.longMessage)
.width('100%')
.lineHeight(this.lineHeight)
.fontSize(this.fontSize)
.fontWeight(this.fontWeight)
.fontColor(this.fontColor)
... ...
... ... @@ -139,7 +139,7 @@ export struct ZhSingleRow06 {
.height(16)
.margin({right: 3})
Text('点赞')
Text(Number(this.newsStatusOfUser?.likeStatus) == 1 ? '已赞' : '点赞')
.fontSize(15)
.fontColor(0x999999)
.onClick(() => {
... ...
... ... @@ -48,8 +48,8 @@ export struct MessageListUI {
this.msgData.forEach((item) => {
if (item.title == "预约消息") {
if (value.subscribeInfo != null) {
if (value.subscribeInfo.title) {
item.desc = value.subscribeInfo.title
if (value.subscribeInfo.message) {
item.desc = value.subscribeInfo.message
}
if (value.subscribeInfo.time) {
item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.subscribeInfo.time)+"")
... ... @@ -64,7 +64,7 @@ export struct MessageListUI {
}
if (value.activeInfo != null) {
if (value.activeInfo.title) {
item.desc = value.activeInfo.title
item.desc = value.activeInfo.title.replace("null","")
}
if (value.activeInfo.time) {
item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.activeInfo.time) + "")
... ... @@ -72,8 +72,8 @@ export struct MessageListUI {
}
}/*else if (item.title == "系统消息") {
if (value.systemInfo != null) {
if (value.systemInfo.title) {
item.desc = value.systemInfo.title
if (value.systemInfo.message) {
item.desc = value.systemInfo.message
}
if (value.systemInfo.time) {
item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.systemInfo.time) + "")
... ...
... ... @@ -84,11 +84,13 @@ export struct SubscribeListChildComponent{
}.backgroundColor($r('app.color.white'))
.borderRadius("8lpx")
.height("336lpx")
.width("100%")
.padding({left:"23lpx",right:"23lpx"})
}
.backgroundColor($r('app.color.color_F5F5F5'))
.width("100%")
.height("423lpx")
.padding({left:"31lpx",right:"31lpx"})
.alignItems(HorizontalAlign.Center)
}
... ...
import { LazyDataSource, StringUtils } from 'wdKit/Index';
import { LazyDataSource, NetworkUtil, StringUtils } from 'wdKit/Index';
import { Remark, SubscribeMessageModel,
WDMessageCenterMessageType } from '../../../../model/InteractMessageModel';
import MinePageDatasModel from '../../../../model/MinePageDatasModel';
... ... @@ -21,6 +21,8 @@ export struct SubscribeMessageComponent{
curPageNum: number = 1;
@State isGetRequest: boolean = false
private scroller: Scroller = new Scroller();
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
aboutToAppear() {
this.getNewPageData()
... ... @@ -32,9 +34,27 @@ export struct SubscribeMessageComponent{
CustomTitleUI({ titleName: "预约消息" })
if (this.count == 0) {
if (this.isGetRequest == true) {
if(this.isConnectNetwork){
EmptyComponent({ emptyType: 5 })
.height('100%')
.width('100%')
}else{
EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
this.isConnectNetwork = NetworkUtil.isNetConnected()
if(this.isConnectNetwork){
this.curPageNum = 1;
this.hasMore = true
this.isGetRequest = false
this.data.clear()
if (!this.isLoading) {
this.getNewPageData()
}
}
},})
.layoutWeight(1)
.width('100%')
}
}
} else {
CustomPullToRefresh({
... ... @@ -60,6 +80,8 @@ export struct SubscribeMessageComponent{
}
}
})
.width('100%')
.margin({bottom:px2vp(this.bottomSafeHeight)})
}
}
.backgroundColor($r('app.color.color_F9F9F9'))
... ... @@ -94,7 +116,7 @@ export struct SubscribeMessageComponent{
}
}
}.width('100%')
.cachedCount(4)
.height("100%")
.scrollBar(BarState.Off)
.layoutWeight(1)
}
... ...
import { BottomNavi, CommonConstants } from 'wdConstant';
import { BottomNavDTO, NavigationBodyDTO, TopNavDTO } from 'wdBean';
import { EmitterEventId, EmitterUtils, Logger } from 'wdKit';
import { BottomNavDTO, NavigationBodyDTO, NavigationDetailDTO, TopNavDTO } from 'wdBean';
import { EmitterEventId, EmitterUtils, Logger, StringUtils } from 'wdKit';
import { TopNavigationComponent } from './TopNavigationComponent';
import { MinePageComponent } from './MinePageComponent';
import { CompUtils } from '../../utils/CompUtils';
import ChannelViewModel from '../../viewmodel/ChannelViewModel';
import HomeChannelUtils, { AssignChannelParam } from 'wdRouter';
import { VideoChannelPage } from './VideoChannelPage';
import { HttpUtils } from 'wdNetwork/Index';
const TAG = 'BottomNavigationComponent';
let storage = LocalStorage.getShared();
... ... @@ -98,6 +99,7 @@ export struct BottomNavigationComponent {
});
}
.zIndex(10)
.scrollable(false)
.animationDuration(0)
.barHeight($r('app.float.bottom_navigation_barHeight'))
... ... @@ -132,6 +134,7 @@ export struct BottomNavigationComponent {
.fontColor(this.currentNavIndex === index ? navItem.nameCColor : navItem.nameColor)
.opacity(this.currentNavIndex === index ? this.FULL_OPACITY : this.SIXTY_OPACITY)
}
.zIndex(10)
.height($r('app.float.bottom_navigation_barHeight'))
.hoverEffect(HoverEffect.Highlight)
.onClick(() => {
... ... @@ -223,7 +226,7 @@ export struct BottomNavigationComponent {
}
private getBottomDetail() {
// 1、获取顶导缓存数据
// // 1、获取顶导缓存数据
// this.bottomNavList.forEach((value) => {
// // 先用底导带回的list初始化
// this.topNavMap[value.id] = value.topNavChannelList
... ... @@ -247,11 +250,32 @@ export struct BottomNavigationComponent {
private setData(data: NavigationBodyDTO) {
Logger.debug(TAG, 'setData')
if (data && data.bottomNavList != null) {
Logger.info(TAG, `setData, bottomNav.length: ${data.bottomNavList.length}`);
if (data == null) {
return
}
let list: BottomNavDTO[] = []
let userId: string = HttpUtils.getUserId()
// 先匹配换肤
if (data.greyBottomNav != null && data.greyBottomNav.greyUserList != null &&
data.greyBottomNav.greyUserList.length > 0) {
// data.greyBottomNav.greyUserList.includes(userId)不生效,直接用循环匹配
for (let i = 0; i < data.greyBottomNav.greyUserList.length; i++) {
let id = data.greyBottomNav.greyUserList[i]
if (id == userId) {
list = data.greyBottomNav.bottomNavList
break
}
}
}
// 没有匹配到换肤,则直接用data.bottomNavList
if (list.length <= 0) {
list = data.bottomNavList
}
if (list.length > 0) {
Logger.info(TAG, `setData, bottomNav.length: ${list.length}`);
// 使用filter方法移除name为'服务'的项
data.bottomNavList = data.bottomNavList.filter(item => item.name !== '服务');
this.bottomNavList = data.bottomNavList
list = list.filter(item => item.name !== '服务');
this.bottomNavList = list
}
}
}
\ No newline at end of file
... ...
... ... @@ -12,7 +12,7 @@ export default struct NoMoreLayout {
Text($r('app.string.footer_text'))
.fontSize(RefreshConstants.NoMoreLayoutConstant_TITLE_FONT)
.textAlign(TextAlign.Center)
.fontColor('#CCCCCC')
.fontColor('#999999')
.margin({bottom:40})
}
.width(RefreshConstants.FULL_WIDTH)
... ...
... ... @@ -38,9 +38,11 @@ struct PeopleShipHomePage {
@State attentionOpacity: boolean = false
@Provide topHeight: number = 286
@State isLoading: boolean = true
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
build() {
Stack({ alignContent: Alignment.TopStart }) {
Stack({ alignContent: Alignment.Top }){
// 顶部图片
Image($r('app.media.home_page_bg'))
.width('100%')
... ... @@ -48,6 +50,18 @@ struct PeopleShipHomePage {
.objectFit(ImageFit.Fill)
.backgroundColor(Color.White)
.visibility(this.isLoading ? Visibility.None : Visibility.Visible)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
Row()
.height(px2vp(this.topSafeHeight))
.width("100%")
.backgroundColor($r('app.color.white'))
.visibility(this.attentionOpacity ? 1 : 0)
.opacity(this.topOpacity )
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
Column(){
// 头部返回
... ... @@ -109,7 +123,7 @@ struct PeopleShipHomePage {
})
}
}
}.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
.alignItems(HorizontalAlign.Start)
.justifyContent(FlexAlign.Start)
.width('100%')
... ...
... ... @@ -78,9 +78,12 @@ export struct PeopleShipHomeArticleListComponent {
List({scroller: this.scroller}) {
// 下拉刷新
ForEach(this.arr, (item: ContentDTO) => {
ForEach(this.arr, (item: ContentDTO, index: number) => {
ListItem() {
Column() {
CardParser({compDTO:new CompDTO, contentDTO: item })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
}
}.width("100%")
.backgroundColor(Color.Transparent)
}, (item: ContentDTO, index: number) => item.objectId + index.toString())
... ...
import { SPHelper } from 'wdKit/Index';
import { KVStoreHelper, SPHelper } from 'wdKit/Index';
import { HostEnum, HostManager, HttpUrlUtils } from 'wdNetwork/Index';
@CustomDialog
... ... @@ -86,11 +86,16 @@ export struct EnvironmentCustomDialog {
Button('确认')
.margin({ top: 20 })
.onClick(() => {
new Promise<void>(() => {
// HttpUrlUtils.hostUrl = this.currentEnvironment
SPHelper.default.saveSync('hostUrl', this.currentEnvironment);
// 清首页缓存
KVStoreHelper.default.deleteAll()
// TODO 清sp相关
this.controller.close()
this.confirm()
})
})
}.height(261).backgroundColor(Color.White).borderRadius(6).width('74%')
}
... ...
... ... @@ -64,6 +64,7 @@ export struct OperRowListView {
/**
* 用于区分页面类型,在哪个页面嵌套就传相应的值
* 1:视频详情页 2:竖屏直播页 3:图集 4:横屏直播页
* 8: 评论弹框内
*/
@Prop pageComponentType?: number = -1
@Prop showBackIcon?: boolean = true
... ... @@ -208,7 +209,7 @@ export struct OperRowListView {
contentDetail: this.contentDetailData,
onCommentFocus: this.onCommentFocus,
pageComponentType: this.pageComponentType,
onLoad: (dialogController: CustomDialogController) => {
onLoad: (dialogController: CustomDialogController | null) => {
this.dialogController = dialogController
}
})
... ...
... ... @@ -36,6 +36,7 @@ struct MineHomePage {
@State params:Record<string, string> = router.getParams() as Record<string, string>;
@State isCommentEnter:string = "";
@State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
onPageShow(): void {
this.getUserInfo()
... ... @@ -52,10 +53,21 @@ struct MineHomePage {
build() {
if(this.isConnectNetwork){
Stack({ alignContent: Alignment.Top }){
Stack({ alignContent: Alignment.Top }){
Image($r('app.media.title_bg'))
.width('100%')
.height('355lpx')
.objectFit(ImageFit.Cover)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
Row()
.height(px2vp(this.topSafeHeight))
.width("100%")
.backgroundColor($r('app.color.white'))
.visibility(this.tileOpacity > 0 ? 0 : 1)
.opacity(this.tileOpacity )
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
Column(){
Stack({ alignContent: Alignment.Top }){
... ... @@ -262,7 +274,7 @@ struct MineHomePage {
.scrollBar(BarState.Off)
.width('100%')
.layoutWeight(1)
}
}.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
}.width('100%')
.layoutWeight(1)
}else{
... ... @@ -385,10 +397,10 @@ struct MineHomePage {
this.editUserInfo()
})
}
.visibility(this.tileOpacity > 0 ? 0 : 1)
.height('84lpx')
.width('100%')
.backgroundColor($r('app.color.white'))
.visibility(this.tileOpacity > 0 ? 0 : 1)
.opacity(this.tileOpacity )
}
... ...
... ... @@ -15,6 +15,7 @@ const TAG = "OtherNormalUserHomePage"
struct OtherNormalUserHomePage {
@State params:Record<string, string> = router.getParams() as Record<string, string>;
@Watch('change') @State curUserId: string = '-1';
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
onPageShow() {
this.curUserId = this.params?.['userId'];
... ... @@ -52,10 +53,21 @@ struct OtherNormalUserHomePage {
build() {
if(this.isConnectNetwork){
Stack({ alignContent: Alignment.Top }){
Stack({ alignContent: Alignment.Top }){
Image($r('app.media.title_bg'))
.width('100%')
.height('355lpx')
.objectFit(ImageFit.Cover)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
Row()
.height(px2vp(this.topSafeHeight))
.width("100%")
.backgroundColor($r('app.color.white'))
.visibility(this.tileOpacity > 0 ? 0 : 1)
.opacity(this.tileOpacity )
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
Column(){
Stack({ alignContent: Alignment.Top }){
... ... @@ -229,7 +241,7 @@ struct OtherNormalUserHomePage {
.scrollBar(BarState.Off)
.width('100%')
.layoutWeight(1)
}
}.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
}.width('100%')
.layoutWeight(1)
}else{
... ...
... ... @@ -9,6 +9,7 @@ struct SubscribeMessagePage {
build() {
Column(){
SubscribeMessageComponent()
}
}.height("100%")
.width("100%")
}
}
\ No newline at end of file
... ...
... ... @@ -29,7 +29,7 @@ export function touchUpLoadMore(model: PageModel) {
if ((self.isCanLoadMore === true) && (self.hasMore === true) && (self.isLoading === false)) {
self.isLoading = true;
setTimeout(() => {
closeLoadMore(model);
// closeLoadMore(model);
PageHelper.loadMore(self)
}, Const.DELAY_TIME);
} else {
... ...
... ... @@ -13,7 +13,7 @@ export class RefreshConstants {
/**
* The delay time.
*/
static readonly DELAY_TIME: number = 200;
static readonly DELAY_TIME: number = 50;
/**
* The animation duration.
... ...
// PersistentStorage.persistProp('clickedIds', []);
//
// function persistentStorage(id: string | number, type: 'add' | 'remove' | undefined = 'add') {
// let clickedIds = AppStorage.get<string>('clickedIds')?.split(',') || [];
// let index = clickedIds.indexOf(id.toString())
// if (type === 'add') {
// if (index >= 0) return;
// clickedIds.push(id.toString());
// } else if (type === 'remove') {
// clickedIds.splice(index, 1);
// }
// AppStorage.set('clickedIds', clickedIds.join(','));
// }
//
// function hasClicked(id: string | number) {
// let clickedIds = AppStorage.get<string>('clickedIds')?.split(',') || [];
// let index = clickedIds.indexOf(id.toString())
// if (index >= 0) return true;
// return false;
// }
//
// export { persistentStorage, hasClicked }
\ No newline at end of file
PersistentStorage.persistProp('clickedIds', []);
function persistentStorage(id: string | number, type: 'add' | 'remove' | undefined = 'add') {
let _clickedIds = AppStorage.get<string[]>('clickedIds');
let clickedIds = _clickedIds?.toString()?.split(',') || [];
let index = clickedIds.indexOf(id.toString())
if (type === 'add') {
if (index >= 0) return;
clickedIds.push(id.toString());
} else if (type === 'remove') {
clickedIds.splice(index, 1);
}
AppStorage.set('clickedIds', clickedIds.join(','));
}
function hasClicked(id: string | number) {
let _clickedIds = AppStorage.get<string[]>('clickedIds');
let clickedIds = _clickedIds?.toString()?.split(',') || [];
let index = clickedIds.indexOf(id.toString())
if (index >= 0) return true;
return false;
}
export { persistentStorage, hasClicked }
\ No newline at end of file
... ...
... ... @@ -14,6 +14,7 @@ import { BaseDTO } from 'wdBean/src/main/ets/bean/component/BaseDTO';
import { viewBlogInsightIntentShare, ActionMode } from '../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
import { CacheData } from 'wdNetwork/Index';
import { closeLoadMore } from '../utils/PullUpLoadMore';
const TAG = 'PageHelper';
... ... @@ -37,7 +38,7 @@ export class PageHelper {
if (!netStatus) {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
setTimeout(() => {
closeRefresh(pageModel, false)
this.refreshUIEnd(pageModel, false)
}, 500)
return
}
... ... @@ -46,6 +47,10 @@ export class PageHelper {
this.getPageInfo(pageModel, pageAdvModel)
}
private refreshUIEnd(pageModel: PageModel, isRefreshSuccess: boolean) {
closeRefresh(pageModel, isRefreshSuccess)
}
/**
* 分页加载
*/
... ... @@ -60,6 +65,10 @@ export class PageHelper {
this.compLoadMore(pageModel)
}
private loadMoreEnd(pageModel: PageModel) {
closeLoadMore(pageModel)
}
/**
* 进页面请求数据
*/
... ... @@ -105,7 +114,7 @@ export class PageHelper {
} else {
//更新数据
pageModel.compList.addItems(liveReviewDTO.list);
closeRefresh(pageModel, true);
this.refreshUIEnd(pageModel, true);
}
}).catch((err: string | Resource) => {
promptAction.showToast({ message: err });
... ... @@ -233,7 +242,7 @@ export class PageHelper {
//
pageModel.currentPage++
pageModel.viewType = ViewType.LOADED
closeRefresh(pageModel, true)
this.refreshUIEnd(pageModel, true)
if (pageModel.compList.isEmpty()) {
// 没数据,展示空页面
... ... @@ -277,6 +286,7 @@ export class PageHelper {
//聚合页
if (pageModel.pageType == 1) {
PageViewModel.postThemeList(pageModel.currentPage, pageModel.pageSize, pageModel.extra).then((liveReviewDTO) => {
this.loadMoreEnd(pageModel)
if (liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0) {
pageModel.hasMore = false;
return;
... ... @@ -290,6 +300,7 @@ export class PageHelper {
}
}).catch((err: string | Resource) => {
promptAction.showToast({ message: err });
this.loadMoreEnd(pageModel)
})
} else {
... ... @@ -301,7 +312,7 @@ export class PageHelper {
// 默认加载更多走 楼层接口
PageViewModel.getPageGroupCompData(pageModel.bizCopy())
.then((data: PageDTO) => {
this.loadMoreEnd(pageModel)
if (data == null || data.compList == null || data.compList.length == 0) {
pageModel.hasMore = false;
} else {
... ... @@ -316,6 +327,7 @@ export class PageHelper {
}
}).catch((err: string | Resource) => {
promptAction.showToast({ message: err });
this.loadMoreEnd(pageModel)
})
}
}
... ... @@ -651,6 +663,7 @@ export class PageHelper {
let pageSize = Normal_Page_Size
PageViewModel.getLiveReviewUrl(currentPage, pageSize).then((liveReviewDTO) => {
this.loadMoreEnd(pageModel)
if (liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0) {
pageModel.hasMore = false;
} else {
... ... @@ -696,9 +709,9 @@ export class PageHelper {
this.getLiveRoomDataInfo(pageInfo.oneRequestPageGroupCompList.convertToArray())
}
}).catch((err: string | Resource) => {
promptAction.showToast({ message: err });
this.loadMoreEnd(pageModel)
})
}
... ...
... ... @@ -102,5 +102,10 @@
"name": "feedback_hideemail",
"value": "请输入电话或者邮箱"
}
,
{
"name": "look_more",
"value": "查看更多"
}
]
}
\ No newline at end of file
... ...
... ... @@ -17,6 +17,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';
const TAG = 'DetailPlayShortVideoPage';
... ... @@ -294,6 +295,15 @@ export struct DetailPlayShortVideoPage {
.margin({ top: 280 })
.onClick(() => {
// 全屏方案待定
// this.displayDirection = DisplayDirection.VERTICAL
this.displayDirection = this.displayDirection == DisplayDirection.VERTICAL ?
DisplayDirection.VIDEO_HORIZONTAL :
DisplayDirection.VERTICAL
WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE_INVERTED)
})
}
... ...
... ... @@ -91,6 +91,7 @@ export struct DetailDialog {
OperRowListView({
componentType: 1,
pageComponentType: 8,
showBackIcon: false,
operationButtonList: ['comment', 'like', 'collect', 'share'],
contentDetailData: this.contentDetailData,
... ...
... ... @@ -149,6 +149,9 @@ export class GetuiPush {
}
setAlias(bind: boolean, alias: string, sn: string = this.ALIAS_SN_USERID) {
if (typeof alias == "number") {
alias = `${alias}`
}
if (!this.initialed) { return }
if (bind) {
Logger.debug(TAG, "推送 绑定别名 " + alias)
... ...
... ... @@ -56,9 +56,15 @@ export class PushContentParser {
},*/
let gtData = want.parameters[PushContentParser.LAUNCH_PARAM_GETUI_DATA] as Record<string, string | number | object>
if (gtData[PushContentParser.LAUNCH_PARAM_GETUI_TASKID] != undefined) {
let json = JSON.parse(gtData["wantUri"] as string) as Record<string, string | number>
if (json && json[PushContentParser.PUSH_PARAM_PUSH_LINK] != null) {
const pushLink = json[PushContentParser.PUSH_PARAM_PUSH_LINK] as string
// let json = JSON.parse(gtData["wantUri"] as string) as Record<string, string | number>
// if (json && json[PushContentParser.PUSH_PARAM_PUSH_LINK] != null) {
// const pushLink = json[PushContentParser.PUSH_PARAM_PUSH_LINK] as string
// return {
// isPush: true, online: true, pushLink: pushLink, want: want
// }
// }
if (want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK]) {
let pushLink = want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK] as string
return {
isPush: true, online: true, pushLink: pushLink, want: want
}
... ...
... ... @@ -96,6 +96,7 @@ export struct WDPlayerRenderView {
this.onLoad(event)
}
})
.zIndex(1000)
.width(this.selfSize.width)
.height(this.selfSize.height)
}
... ...
... ... @@ -117,6 +117,12 @@ export default class EntryAbility extends UIAbility {
return;
}
console.info('floatWindowClass Succeeded in loading the content.');
let color: string = 'rgba(0,0,0,0)';
try {
(floatWindowClass as window.Window).setWindowBackgroundColor(color);
} catch (exception) {
console.error('Failed to set the background color. Cause: ' + JSON.stringify(exception));
};
});
floatWindowClass.on('windowEvent', (data) => {
... ...
... ... @@ -88,7 +88,6 @@ struct Index {
.height(20)
.fontColor('#222222')
.fontSize(14)
.margin({ top: 10, left: 10 })
.alignSelf(ItemAlign.Start)
.onStart(() => {
console.info('Marquee animation complete onStart')
... ... @@ -115,7 +114,7 @@ struct Index {
}
.width("100%")
.height(16)
.margin({ top: 4, left: 10 })
.margin({ top: 4})
Progress({ value: this.progressVal, total: 100, type: ProgressType.Capsule })
.color("#ED2800")
... ... @@ -194,7 +193,13 @@ struct Index {
)
.width('100%')
.height('100%')
.borderRadius(4)
.padding({
top: 10,
bottom: 10,
left: 10,
right: 0
})
.backgroundColor(Color.White)
.borderRadius(2)
}
}
\ No newline at end of file
... ...