Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
wangliang_wd
2024-05-27 15:51:48 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8eccd3e4d35a63e11d36919173729a08c36dc995
8eccd3e4
1 parent
6b312349
feat:优化早晚报
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
22 deletions
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/CardView.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
sight_harmony/features/wdComponent/src/main/ets/components/search/FirstTabTopSearchComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
View file @
8eccd3e
...
...
@@ -68,6 +68,7 @@ export struct MorningEveningPaperComponent {
@State topSafeHeight: number = 0;
@State bottomSafeHeight: number = 0;
@State isHasTopView: boolean = false;
@State scrollOffset: number = 0
private audioDataList: AudioDataList[] = []
private playerController: WDPlayerController = new WDPlayerController();
...
...
@@ -267,24 +268,22 @@ export struct MorningEveningPaperComponent {
compListItem: this.compListItem,
})
.margin({
top: this.
pageInfoBean?.topicInfo?.frontLinkObject ? 10 : 44
top: this.
isHasTopView ? 10 : 44+this.topSafeHeight
})
}
}
.height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`).scrollBar(BarState.Off)
.onAreaChange((oldValue: Area, newValue: Area) => {
let persent = Math.abs(Number(newValue.globalPosition.y)) / 150
if (persent > 1) {
persent = 1
}
// .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`)
.scrollBar(BarState.Off)
.onWillScroll(scrollOffset =>{
this.scrollOffset = this.scrollOffset + scrollOffset as number
})
PaperTitleComponent().margin({top:this.isHasTopView?this.topSafeHeight:0}).backgroundColor(this.mixedBgColor).opacity(this.isHasTopView?0:1
)
this.topPaperTitle(
)
}
.width('100%')
.height('100%')
.padding({
top:
this.isHasTopView?0:this.topSafeHeight
,
top:
0
,
// bottom: this.bottomSafeHeight
})
// .backgroundColor(Color.Black)
...
...
@@ -293,6 +292,13 @@ export struct MorningEveningPaperComponent {
}
@Builder
topPaperTitle(){
Column(){
PaperTitleComponent().margin({top:this.topSafeHeight})
}.height(44+this.topSafeHeight).backgroundColor(this.scrollOffset > 100?this.mixedBgColor:'')
}
@Builder
AudioBarView(dialog: CustomDialogController) {
Row() {
Stack({ alignContent: Alignment.Start }) {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/CardView.ets
View file @
8eccd3e
...
...
@@ -438,7 +438,7 @@ export struct PaperSingleColumn999CardView {
Stack({ alignContent: Alignment.BottomEnd }) {
Image(this.item?.coverUrl)
.borderRadius(5)
.aspectRatio(
16 / 9)
.aspectRatio(
319 / 179) ///图片设计比例
.padding({ top: 10 })
if (this.item?.videoInfo) {
Row() {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
View file @
8eccd3e
...
...
@@ -9,6 +9,7 @@ import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils
import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent';
import { channelSkeleton } from '../skeleton/channelSkeleton';
import { TrackConstants, TrackingButton } from 'wdTracking/Index';
import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'
const TAG = 'TopNavigationComponent';
...
...
@@ -170,13 +171,7 @@ export struct TopNavigationComponentNew {
.height(30)
.width(124)
.onClick(() => {
if (NetworkUtil.isNetConnected()) {
ProcessUtils.gotoMorningEveningPaper()
TrackingButton.click('morning_evening_news_click', TrackConstants.SummaryType.MorningAndEveningNews,
TrackConstants.SummaryType.MorningAndEveningNews)
} else {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
}
this.clickMorningEveningPaper()
})
}.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
...
...
@@ -621,4 +616,21 @@ export struct TopNavigationComponentNew {
this.indicatorWidth = width
})
}
clickMorningEveningPaper(){
if (NetworkUtil.isNetConnected()) {
DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean =>{
if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) {
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id);
ProcessUtils.gotoMorningEveningPaper()
TrackingButton.click('morning_evening_news_click',TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews)
}else {
ToastUtils.showToast('暂无早晚报信息', 1000)
}
}).catch()
} else {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
}
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/search/FirstTabTopSearchComponent.ets
View file @
8eccd3e
...
...
@@ -7,7 +7,6 @@
import { SPHelper } from 'wdKit/Index'
import { WDRouterPage, WDRouterRule } from 'wdRouter'
import { TrackingButton, TrackConstants } from 'wdTracking/Index'
import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'
import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
const TAG = "FirstTabTopSearchComponent"
...
...
@@ -19,10 +18,6 @@ export struct FirstTabTopSearchComponent {
async aboutToAppear() {
this.getSearchHint()
let dailyPaperTopicBean = await DailyPaperTopicModel.getDailyPaperTopic()
if (dailyPaperTopicBean) {
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id);
}
}
getSearchHint() {
...
...
Please
register
or
login
to post a comment