张善主

Merge remote-tracking branch 'origin/main'

Showing 18 changed files with 92 additions and 43 deletions
... ... @@ -42,10 +42,12 @@ export struct ENewspaperPageComponent {
console.log("onDateChange-日历选择弹框", "date:", JSON.stringify(date))
if (date.fullYear && date.month && date.date) {
let month: number = date.month + 1
this.calendarDate = `${date.fullYear}-${month > 9 ? month : '0' + month}-${date.date > 9 ? date.date : '0' + date.date}`
this.calendarDate =
`${date.fullYear}-${month > 9 ? month : '0' + month}-${date.date > 9 ? date.date : '0' + date.date}`
this.getNewspaperTime()
this.getNewspaperList()
this.selectDate = new Date(date.fullYear ? date.fullYear : 0, date.month ? date.month : 0, date.date ? date.date : 0)
this.selectDate =
new Date(date.fullYear ? date.fullYear : 0, date.month ? date.month : 0, date.date ? date.date : 0)
}
}
}),
... ... @@ -81,8 +83,8 @@ export struct ENewspaperPageComponent {
this.picHeight = this.picWidth * 566 / 378
//注册字体
font.registerFont({
familyName: 'BebasNeue_Regular',
familySrc: $rawfile('font/BebasNeue_Regular.otf')
familyName: 'BebasNeueBold',
familySrc: $rawfile('font/BebasNeueBold.otf')
})
this.getNewspaperTime()
this.getNewspaperList()
... ... @@ -117,7 +119,7 @@ export struct ENewspaperPageComponent {
Text(this.calendarDate?.replace('-', '.')?.replace('-', '.'))
.fontSize($r('app.float.font_size_20'))
.fontColor($r('app.color.white'))
.fontFamily('BebasNeue_Regular')
.fontFamily('BebasNeueBold')
.fontWeight(FontWeight.Regular)
Image($r('app.media.icon_triangle'))
... ... @@ -148,6 +150,7 @@ export struct ENewspaperPageComponent {
center: { anchor: "__container__", align: VerticalAlign.Center }
})
.id('e_newspaper_share')
.visibility(Visibility.Hidden)
}
.margin({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') })
.height($r('app.float.top_bar_height'))
... ... @@ -208,13 +211,15 @@ export struct ENewspaperPageComponent {
.id('e_newspaper_shadow')
Row() {
Text(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? '已到底部,可以选择其他日期' : '滑动查看下一版')
Text(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? '已到底部,可以选择其他日期' :
'滑动查看下一版')
.fontColor(Color.White)
.fontSize($r('app.float.font_size_14'))
Image($r('app.media.icon_next_page'))
.width($r('app.float.vp_16'))
.height($r('app.float.vp_16'))
.visibility(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? Visibility.None : Visibility.Visible)
.visibility(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? Visibility.None :
Visibility.Visible)
}
.justifyContent(FlexAlign.Center)
.margin({ top: $r('app.float.margin_16') })
... ... @@ -232,7 +237,7 @@ export struct ENewspaperPageComponent {
Text(this.currentPageNum)
.fontSize($r('app.float.font_size_36'))
.fontColor($r('app.color.white'))
.fontFamily('BebasNeue_Regular')
.fontFamily('BebasNeueBold')
Text('版')
.fontSize($r('app.float.font_size_16'))
.fontColor($r('app.color.white'))
... ...
... ... @@ -108,7 +108,7 @@ export struct ImageAndTextPageComponent {
.height(24)
.margin({ right: 5 })
}
if (this.interactData?.likeNum != '0') {
if (this.interactData?.likeNum) {
Text(`${this.interactData?.likeNum}`)
.fontSize(16)
.fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999')
... ...
... ... @@ -150,7 +150,10 @@ export struct SingleColumn999Component {
scrollBackward: NestedScrollMode.SELF_FIRST
})
} else {
EmptyComponent({ emptyHeight: 200 })
if (this.compListItem && this.compListItem?.operDataList) {
EmptyComponent({ emptyHeight: 200 })
}
}
}
... ...
... ... @@ -63,10 +63,10 @@ export struct MultiPictureDetailPageComponent {
this.picHeight = this.picWidth * 578 / 375
this.titleHeight = this.screenWidth * 178 / 375
//注册字体
font.registerFont({
familyName: 'BebasNeue_Regular',
familySrc: $rawfile('font/BebasNeue_Regular.otf')
})
// font.registerFont({
// familyName: 'BebasNeueBold',
// familySrc: $rawfile('font/BebasNeueBold.otf')
// })
// 注册监听网络连接
let netStatus = NetworkUtil.isNetConnected()
if (netStatus) {
... ...
... ... @@ -110,7 +110,7 @@ export struct RMCalendar {
if (this.onDateChange) {
this.onDateChange(item)
if (item.fullYear && item.month) {
this.title = `${item.fullYear}年${item.month + 1}月`
this.title = `${item.fullYear}年${this.getMonthStr(item.month + 1)}月`
}
}
}
... ... @@ -191,18 +191,20 @@ export struct RMCalendar {
*/
private calcData() {
this.title = `${this.selectDay.getFullYear()}年${this.selectDay.getMonth() + 1}月`
this.title = `${this.selectDay.getFullYear()}年${this.getMonthStr(this.selectDay.getMonth() + 1)}月`
this.selectDay.setDate(1)
if (this.selectDay.getFullYear() < this.startDate.getFullYear()
|| (this.selectDay.getFullYear() == this.startDate.getFullYear() && this.selectDay.getMonth() <= this.startDate.getMonth())) {
|| (this.selectDay.getFullYear() == this.startDate.getFullYear() &&
this.selectDay.getMonth() <= this.startDate.getMonth())) {
this.hasPre = false
} else {
this.hasPre = true
}
if (this.selectDay.getFullYear() > this.endDate.getFullYear()
|| (this.selectDay.getFullYear() == this.endDate.getFullYear() && this.selectDay.getMonth() >= this.endDate.getMonth())) {
|| (this.selectDay.getFullYear() == this.endDate.getFullYear() &&
this.selectDay.getMonth() >= this.endDate.getMonth())) {
this.hasNext = false
} else {
this.hasNext = true
... ... @@ -274,7 +276,8 @@ export struct RMCalendar {
Text(this.title)
.fontSize(this.titleFontSize)
.fontColor(this.titleFontColor)
.fontWeight(this.titleFontWeight)
.fontWeight(600)
.fontFamily('PingFang SC-Semibold')
}
Blank()
... ... @@ -318,7 +321,22 @@ export struct RMCalendar {
left: 35,
right: 35
})
.padding(
{ bottom: 20 })
.border({ radius: 4 })
}
}
getMonthStr(month?: number): string {
if (!month) {
return ''
}
if (month <= 0) {
return ''
}
if (month <= 9) {
return '0' + month
}
return month + ''
}
}
\ No newline at end of file
... ...
... ... @@ -100,7 +100,7 @@ export struct RMCalenderCell {
.fontSize(this.itemFontSize)
.fontColor(this.getItemColor())
.fontWeight(this.itemFontWeight)
.fontFamily('BebasNeue_Regular')
.fontFamily('BebasNeueBold')
}
}
// .justifyContent(FlexAlign.Center)
... ...
... ... @@ -30,6 +30,7 @@ const TAG = 'Zh_Single_Row-06'
@Component
export struct ZhSingleRow06 {
@State compDTO: CompDTO = {} as CompDTO
@State likeBl: boolean = false;
build() {
Column() {
... ... @@ -81,7 +82,7 @@ export struct ZhSingleRow06 {
.fontColor(0x999999)
Row(){
Image($r('app.media.icon_like_no'))
Image(this.likeBl ? $r('app.media.icon_like_select') : $r('app.media.icon_like'))
.width(16)
.height(16)
.margin({right: 3})
... ... @@ -90,6 +91,13 @@ export struct ZhSingleRow06 {
.fontSize(14)
.fontColor(0x999999)
}
.onClick(() => {
if (this.likeBl) {
this.likeBl = false;
} else {
this.likeBl = true;
}
})
}
.justifyContent(FlexAlign.SpaceBetween)
.width('100%')
... ...
... ... @@ -67,14 +67,15 @@ export struct PeopleShipHomePageNavComponent {
Row(){
Image($r('app.media.people_ship_top_add'))
.objectFit(ImageFit.Auto)
.width('12vp')
.height('12pv')
.width('13vp')
.height('13pv')
.margin({
right: '2vp'
right: '3vp'
})
Text('关注')
.fontSize($r('app.float.vp_12'))
.fontColor(Color.White)
.height('100%')
}
.alignSelf(ItemAlign.Center)
.justifyContent(FlexAlign.Center)
... ...
... ... @@ -53,9 +53,12 @@ export default struct CustomLayout {
.visibility(this.refreshBean.loadStatus === LoadStatus.LOADING ? Visibility.Visible : Visibility.Hidden)
Text('已更新至最新')
.fontSize(17)
.fontSize(14)
.textAlign(TextAlign.Center)
.fontColor('#bbbbbb')
.fontColor('#676767')
.backgroundColor('#f6f6f6')
.borderRadius(20)
.padding({ left: 19, right: 19, top: 10, bottom: 10 })
.visibility(this.refreshBean.loadStatus != LoadStatus.LOADED ? Visibility.Hidden : Visibility.Visible)
}
... ...
... ... @@ -42,7 +42,7 @@ export struct SearchHistoryComponent{
Row(){
Text("搜索历史")
.textAlign(TextAlign.Center)
.fontWeight('400lpx')
.fontWeight(FontWeight.Regular)
.fontSize('27lpx')
.lineHeight('38lpx')
.fontColor($r('app.color.color_999999'))
... ... @@ -68,7 +68,7 @@ export struct SearchHistoryComponent{
Text(`${item.searchContent}`)
.fontColor($r('app.color.color_222222'))
.fontSize('31lpx')
.fontWeight('400lpx')
.fontWeight(FontWeight.Regular)
.lineHeight('46lpx')
.maxLines(1)
.constraintSize({maxWidth:index%2 === 0?'270lpx':'230lpx'})
... ...
... ... @@ -68,7 +68,7 @@ export struct SearchHotsComponent{
.height('31lpx')
.fontColor($r('app.color.color_666666'))
.fontSize('27lpx')
.fontWeight('400lpx')
.fontWeight(FontWeight.Regular)
.lineHeight('31lpx')
.margin({right:'12lpx'})
}
... ... @@ -77,7 +77,7 @@ export struct SearchHotsComponent{
.fontColor($r('app.color.color_222222'))
.fontSize('31lpx')
.maxLines(1)
.fontWeight('400lpx')
.fontWeight(FontWeight.Regular)
.lineHeight('42lpx')
}.layoutWeight(1)
... ...
... ... @@ -13,7 +13,8 @@ export struct ENewspaperListDialog {
@State pageDialogShow: boolean = false
@State scrollIndex: number = 0
@Prop @Watch('updateRecordsData') newspaperListBean: NewspaperListBean = {} as NewspaperListBean
private listScroller: Scroller = new Scroller();
private listScroller: Scroller = new Scroller()
@State scrollOffset: number = 0
//文字版选择弹框
pageListDialogController: CustomDialogController = new CustomDialogController({
builder: ENewspaperPageDialog({
... ... @@ -73,7 +74,7 @@ export struct ENewspaperListDialog {
Text(this.currentPageNum)
.fontSize($r('app.float.font_size_36'))
.fontColor($r('app.color.color_222222'))
.fontFamily('BebasNeue_Regular')
.fontFamily('BebasNeueBold')
Text('版')
.fontSize($r('app.float.font_size_16'))
.fontColor($r('app.color.color_222222'))
... ... @@ -159,6 +160,7 @@ export struct ENewspaperListDialog {
Text(positionItem.newsTxt)
.fontSize($r('app.float.font_size_14'))
.fontColor($r('app.color.color_999999'))
.lineHeight(25)
.margin({
// bottom: 15
})
... ... @@ -228,18 +230,24 @@ export struct ENewspaperListDialog {
.scrollBar(BarState.Off)
.onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => {
console.info('ENewspaperListDialog::first' + firstIndex)
console.info('ENewspaperListDialog::last' + lastIndex)
console.info('ENewspaperListDialog::center' + centerIndex)
// console.info('ENewspaperListDialog::first' + firstIndex)
// console.info('ENewspaperListDialog::last' + lastIndex)
// console.info('ENewspaperListDialog::center' + centerIndex)
// this.updateCurrentPageNum(firstIndex)
// const tempIndex = this.findClassIndex(firstIndex)
if (firstIndex !== centerIndex) {
return
}
this.currentPageNum = `${centerIndex < 9 ? '0' + (centerIndex + 1) : centerIndex + 1}`
// console.info(`this.scrollOffset:` + this.scrollOffset)
// if (this.scrollOffset == 0) {
this.currentPageNum = `${centerIndex < 9 ? '0' + (centerIndex + 1) : centerIndex + 1}`
// }
})
.onScroll((scrollOffset: number, scrollState: ScrollState) => {
console.info(`onScroll scrollState = ScrollState` + scrollState + `, scrollOffset = ` + scrollOffset)
// console.info(`onScroll scrollState = ScrollState` + scrollState + `, scrollOffset = ` + scrollOffset)
// if (this.scrollOffset == 0) {
// this.scrollOffset = 0
// }
})
}
.margin({ top: 124 })
... ...
... ... @@ -29,7 +29,7 @@ export struct ENewspaperPageDialog {
Text(item.pageNum)
.fontSize($r('app.float.normal_text_size'))
.fontColor(this.currentPageNum == item.pageNum ? Color.White : $r('app.color.color_222222'))
.fontFamily('BebasNeue_Regular')
.fontFamily('BebasNeueBold')
}
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Center)
... ...
... ... @@ -429,7 +429,7 @@
</div>
<!-- 分享 -->
<div class="share" v-if="shareOpen">
<div class="share" v-if="false">
<div
v-if="details.shareInfo.sharePosterOpen == 1"
class="sharePoster share-wrapper share-box"
... ...
... ... @@ -31,10 +31,10 @@ struct ENewspaper {
pageTransition() {
// 定义页面进入时的效果,从底侧滑入
PageTransitionEnter({ type: RouteType.None, duration: 300 })
PageTransitionEnter({ type: RouteType.Push, duration: 400 })
.slide(SlideEffect.Bottom)
// 定义页面退出时的效果,向底侧滑出
PageTransitionExit({ type: RouteType.None, duration: 300 })
PageTransitionExit({ type: RouteType.Pop, duration: 400 })
.slide(SlideEffect.Bottom)
}
... ...
... ... @@ -2,8 +2,6 @@ import { BottomNavigationComponent, LogoutViewModel, PermissionDesComponent } fr
import { BreakpointConstants } from 'wdConstant';
import { BreakpointSystem, EmitterEventId, EmitterUtils, Logger } from 'wdKit';
import router from '@ohos.router';
import { promptAction } from '@kit.ArkUI';
import { HWLocationUtils, WDPushNotificationManager } from 'wdHwAbility/Index';
import { common } from '@kit.AbilityKit';
... ... @@ -44,6 +42,11 @@ struct MainPage {
})
}
pageTransition() {
PageTransitionEnter({ type: RouteType.None, duration: 0 })
PageTransitionExit({ type: RouteType.None, duration: 0 })
}
aboutToDisappear() {
this.breakpointSystem.unregister()
Logger.info(TAG, 'aboutToDisappear');
... ...