王士厅
Showing 18 changed files with 86 additions and 35 deletions
... ... @@ -64,4 +64,6 @@ export class SpConstants{
// 个推推送
static GETUI_PUSH_CID = "cid"
static GETUI_PUSH_DEVICE_TOKEN = "deviceToken"
//link
static HAS_LINK="has_link"
}
\ No newline at end of file
... ...
import { Logger } from 'wdKit'
import { Logger, SPHelper, StringUtils } from 'wdKit'
import { Want } from '@kit.AbilityKit'
import { url } from '@kit.ArkTS'
import { AppInnerLinkGenerator } from './AppInnerLinkGenerator'
... ... @@ -6,6 +6,7 @@ import { ContentType } from '../common/ContentType'
import { AppInnerLink } from './AppInnerLink'
import { HttpBizUtil, HttpUrlUtils, ResponseDTO } from 'wdNetwork'
import { ContentDetailDTO } from 'wdBean'
import { SpConstants } from 'wdConstant'
const TAG = "AppLinkingManager"
... ... @@ -16,6 +17,7 @@ export class AppLinkingManager {
private hasEnterMain = false
private lastUrlObj?: url.URL
private isJumpInnerLink:boolean = true
private static manager: AppLinkingManager
private constructor() {
... ... @@ -58,13 +60,19 @@ export class AppLinkingManager {
this.comsumeLastUriContent()
}
comsumeLastUriContent() {
comsumeLastUriContent(isJump:boolean = true) {
this.isJumpInnerLink = isJump
Logger.debug(TAG, "尝试消费拉起链接: " + this.lastUrlObj?.toString())
if (!this.lastUrlObj) {
return
}
let path = this.lastUrlObj?.pathname ?? ""
if(!this.isJumpInnerLink && StringUtils.isNotEmpty(path)){
SPHelper.default.save(SpConstants.HAS_LINK, true)
return
}
if (this.dealWithRMHArticle()
|| this.dealWithNormalArticle()
|| this.dealWithCreator()
... ... @@ -187,7 +195,9 @@ export class AppLinkingManager {
}
jumpInnerLink(innerLink: string) {
Logger.debug(TAG, "即将跳转链接: " + innerLink)
AppInnerLink.jumpWithLink(innerLink)
if(this.isJumpInnerLink){
Logger.debug(TAG, "即将跳转链接: " + innerLink)
AppInnerLink.jumpWithLink(innerLink)
}
}
}
\ No newline at end of file
... ...
... ... @@ -189,7 +189,8 @@ export struct CardParser {
contentDTO,
compDTO: this.compDTO,
pageId: this.pageId,
pageName: this.pageName
pageName: this.pageName,
isPeopleShipHome:this.isPeopleShipHome
})
this.getBehindDivider()
} else if (contentDTO.appStyle === CompStyle.Card_20) {
... ...
... ... @@ -46,10 +46,16 @@ export struct ENewspaperItemComponent {
this.contentHeight = event?.contentHeight
}
// this.isShowSkeleton = false
this.isShowSkeleton = false
})
.objectFit(ImageFit.Contain)
.zIndex(10)
newsSkeleton({showBottom: this.isShowSkeleton})
.visibility(this.isShowSkeleton ? Visibility.Visible : Visibility.None)
.width('100%')
.zIndex(1)
if (this.contentWidth !== 0) {
Canvas(this.context)
... ...
... ... @@ -25,7 +25,6 @@ export struct ENewspaperPageComponent {
@State picHeight: number = 0
@Provide itemPicWidth: number = 0
@Provide itemPicHeight: number = 0
@State isShowSkeleton:boolean = false
@Provide topMargin: number = DisplayUtils.getDeviceHeight()
... ... @@ -84,7 +83,6 @@ export struct ENewspaperPageComponent {
builder: ENewspaperCalendarDialog({
selectDate: this.selectDate,
onDateChange: (date: RMCalendarBean) => {
this.isShowSkeleton = true
console.log("onDateChange-日历选择弹框", "date:", JSON.stringify(date))
if (date.fullYear && date.month && date.date) {
let month: number = date.month + 1
... ... @@ -256,7 +254,7 @@ export struct ENewspaperPageComponent {
})
.id('e_newspaper_top')
if (!this.newspaperListBean || !this.newspaperListBean.list || this.newspaperListBean.list.length == 0 || this.isShowSkeleton) {
if (!this.newspaperListBean || !this.newspaperListBean.list || this.newspaperListBean.list.length == 0) {
newsSkeleton()
.alignRules({
top: { anchor: "e_newspaper_top", align: VerticalAlign.Bottom },
... ... @@ -478,7 +476,6 @@ export struct ENewspaperPageComponent {
let listBean =
await NewspaperViewModel.getNewspaperList(this.calendarDate, this.itemPicWidth + 'x' + this.itemPicHeight)
this.newspaperListBean = listBean;
this.isShowSkeleton = false
} else {
this.showToastTip('网络出小差了,请检查网络后重试')
}
... ...
... ... @@ -23,6 +23,7 @@ export struct Card19Component {
@State clicked: boolean = false;
@State titleMarked: boolean = false;
@State textArr: textItem[] = []
isPeopleShipHome: boolean = false;
async aboutToAppear(): Promise<void> {
this.titleInit();
... ... @@ -47,7 +48,8 @@ export struct Card19Component {
contentDTO: this.contentDTO,
compDTO: this.compDTO,
pageId: this.pageId,
pageName: this.pageName
pageName: this.pageName,
isPeopleShipHome:this.isPeopleShipHome
}
) // 标题
if (this.contentDTO.newsTitle) {
... ...
... ... @@ -118,7 +118,6 @@ export struct MoreComponent {
let contentDTO = MinePageDatasModel.dataTransform(rem,value, photos);
if(value.type != "13"){
this.contentDTO.sameContentList.push(contentDTO)
console.log("ycg","123")
}
})
... ...
... ... @@ -58,14 +58,14 @@ export default struct MinePageUserSimpleInfoUI {
.alt(this.userType === "1"?$r('app.media.default_head_userPage'):$r('app.media.AccountOwner_DefaultIcon'))
.width(64)
.height(64)
.objectFit(ImageFit.Fill)
.borderRadius(32)
.objectFit(ImageFit.Auto)
.clip(new Circle({ width: 64, height: 64 }))
if(StringUtils.isNotEmpty(this.levelHead)){
Image(this.levelHead)
.width(90)
.height(90)
.objectFit(ImageFit.Cover)
.objectFit(ImageFit.Auto)
// .borderRadius(50)
}
}
... ...
... ... @@ -9,6 +9,7 @@ import { TrackConstants,
import { WDShare } from 'wdShare/Index';
import { hasClicked, persistentStorage } from '../../utils/persistentStorage';
import { LottieView } from '../lottie/LottieView';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
const TAG: string = 'CardView';
... ... @@ -398,6 +399,7 @@ export struct PaperSingleColumn999CardView {
@State isRead: boolean = false;//已读状态
@State interactData: InteractDataDTO = new InteractDataDTO
@Consume @Watch('onChangeCommentList') commentList: InteractDataDTO[]
@State loadImg: boolean = false;
getPublishTime(): string {
const publishTimestamp = parseInt(this.item?.publishTime)
... ... @@ -441,7 +443,7 @@ export struct PaperSingleColumn999CardView {
.margin({ left: 16, right: 16, top: 16 })
if (this.item?.coverUrl) {
Stack({ alignContent: Alignment.BottomEnd }) {
Image(this.item?.coverUrl)
Image(this.loadImg?this.item?.coverUrl:'')
.borderRadius(5)
.objectFit(ImageFit.Fill)
.aspectRatio(319 / 179) ///图片设计比例
... ... @@ -624,7 +626,8 @@ export struct PaperSingleColumn999CardView {
})
}
aboutToAppear(): void {
async aboutToAppear(): Promise<void> {
this.loadImg = await onlyWifiLoadImg();
this.onChangeCommentList()
this.isRead = hasClicked(this.item.objectId, '')
}
... ...
... ... @@ -96,8 +96,8 @@ export struct PeopleShipHomeListComponent {
startMargin: 0,
endMargin: 0
})
.onChange((index: number) => {
this.currentIndex = index
.onAnimationStart((index: number,targetindex:number) => {
this.currentIndex = targetindex
})
}
... ...
... ... @@ -272,9 +272,9 @@ struct MineHomePage {
}
.backgroundColor($r('app.color.white'))
.animationDuration(0)
.onChange((index: number) => {
this.currentIndex = index
trackTabFirstClick(index === 0 ? "评论":"关注")
.onAnimationStart((index: number,targetindex:number) => {
this.currentIndex = targetindex
trackTabFirstClick(targetindex === 0 ? "评论":"关注")
})
.vertical(false)
.barHeight(44)
... ... @@ -412,11 +412,13 @@ struct MineHomePage {
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.lineHeight(16)
.textOverflow({overflow:TextOverflow.Ellipsis})
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "head_icon", align: HorizontalAlign.End }
left: { anchor: "head_icon", align: HorizontalAlign.End },
right: { anchor: "rightText", align: HorizontalAlign.Start },
})
.margin({ left: 6 })
.margin({ left: 6,right:6 })
Text("编辑资料")
.height(22)
... ...
... ... @@ -221,9 +221,9 @@ struct OtherNormalUserHomePage {
}
.backgroundColor($r('app.color.white'))
.animationDuration(0)
.onChange((index: number) => {
this.currentIndex = index
trackTabFirstClick(index === 0 ? "评论":"关注")
.onAnimationStart((index: number,targetindex:number) => {
this.currentIndex = targetindex
trackTabFirstClick(targetindex === 0 ? "评论":"关注")
})
.vertical(false)
.barHeight('77lpx')
... ... @@ -341,11 +341,13 @@ struct OtherNormalUserHomePage {
.fontWeight('400lpx')
.fontColor($r('app.color.color_222222'))
.lineHeight('42lpx')
.textOverflow({overflow:TextOverflow.Ellipsis})
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "head_icon", align: HorizontalAlign.End }
left: { anchor: "head_icon", align: HorizontalAlign.End },
right: { anchor: "__container__", align: HorizontalAlign.End },
})
.margin({ left: '12lpx' })
.margin({ left: 6,right:6 })
}
.visibility(this.tileOpacity > 0 ? 0 : 1)
.height('84lpx')
... ...
... ... @@ -13,9 +13,26 @@ import { DisplayDirection } from 'wdConstant';
export struct PlayerUIComponent {
private playerController?: WDAliPlayerController
@Provide isSmall:boolean = false
@Consume isShowControl: boolean
@Consume @Watch('onChangeMenuVisible') isShowControl: boolean
@Consume isFullScreen: boolean
@Consume displayDirection: DisplayDirection
@State isPlayStatus: boolean = true;
onChangeMenuVisible() {
if (this.displayDirection == DisplayDirection.VERTICAL
|| !this.isShowControl
|| !this.isPlayStatus) {
return
}
let time: number = 0
if (this.isShowControl) {
setTimeout(() => {
this.isShowControl = false
}, 5 * 1000)
} else {
clearTimeout(time)
}
}
aboutToAppear() {
if (!this.playerController) {
return
... ... @@ -76,7 +93,7 @@ export struct PlayerUIComponent {
.position({ y: '100%' })
.markAnchor({ y: '100%' })
PlayerVideoControlComponent({ playerController: this.playerController })
PlayerVideoControlComponent({ playerController: this.playerController,isPlayStatus: $isPlayStatus})
.visibility(this.isShowControl ? Visibility.Visible : Visibility.Hidden)
.animation({ duration: 500 })
.position({ y: '100%' })
... ...
... ... @@ -13,7 +13,7 @@ export struct PlayerVideoControlComponent {
@State totalTime: string = ''
@State progressVal: number = 0;
//是否处于播放状态中
@State isPlayStatus: boolean = true
@Link isPlayStatus?: boolean
@Consume displayDirection: DisplayDirection
@Consume contentDetailData: ContentDetailDTO
@Consume isSmall:boolean
... ...
... ... @@ -7,6 +7,7 @@ import { BusinessError } from '@ohos.base';
import { DeviceUtil, EmitterEventId, EmitterUtils, Logger, SPHelper, WindowModel } from 'wdKit';
import { ConfigurationConstant } from '@kit.AbilityKit';
import { StartupManager } from '../startupmanager/StartupManager';
import { AppLinkingManager } from 'wdRouter';
let floatWindowClass: window.Window | null = null;
const TAG = 'EntryAbility'
... ... @@ -19,7 +20,8 @@ export default class EntryAbility extends UIAbility {
StartupManager.sharedInstance().appAgreedProtocol()
}
Logger.info(TAG, 'Ability onCreate');
//只判断不跳转
AppLinkingManager.sharedInstance().comsumeLastUriContent(false)
// 还没深色模式需求,暂直接不跟随系统。
this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT);
... ...
... ... @@ -59,7 +59,14 @@ struct LaunchPage {
this.timerId = setTimeout(() => {
this.isJumpToAdvertising = true;
WDRouterRule.jumpWithPage(WDRouterPage.launchAdvertisingPage)
let hasLink = SPHelper.default.getSync(SpConstants.HAS_LINK,false)
if(hasLink){
SPHelper.default.deleteSync(SpConstants.HAS_LINK)
WDRouterRule.jumpWithPage(WDRouterPage.mainPage)
}else{
WDRouterRule.jumpWithPage(WDRouterPage.launchAdvertisingPage)
}
// router.pushUrl({
// url: 'pages/LaunchAdvertisingPage'
... ...
... ... @@ -214,7 +214,7 @@ export struct BottomNavigationComponent {
},
onLoadListener:{
onLoadFailed:(err)=>{
console.error("ycg","Load Failed Reason: " + err + " cost " + (new Date().getTime() ) + " milliseconds");
console.error("Load Failed Reason: " + err + " cost " + (new Date().getTime() ) + " milliseconds");
}
}
};
... ...
... ... @@ -108,6 +108,7 @@ export class StartupManager {
appOnDestory() {
Logger.debug(TAG, "App onDestory")
NetworkManager.getInstance().release()
SPHelper.default.deleteSync(SpConstants.HAS_LINK)
}
// 同意隐私协议之后,立即执行必要初始化
... ...