liyubing

Merge remote-tracking branch 'origin/main'

... ... @@ -163,7 +163,7 @@ function buildErrorMsg(httpStatus: number): string {
if(httpStatus != undefined){
message = `连接出错(${httpStatus})!`;
}else{
message = `连接出错!`;
message = `网络出小差了,请检查网络后重试`;
}
}
... ...
... ... @@ -61,6 +61,7 @@ export struct ImageAndTextPageComponent {
@State likeNum: number = 0
@State reachEndIncreament: number = 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State isScrollTop: boolean = true
@State offsetY: number = 0
pageShowTime:number = 0;
... ... @@ -88,7 +89,7 @@ export struct ImageAndTextPageComponent {
action: this.action,
isPageEnd: $isPageEnd
})
.padding({ top: 15, bottom: 10 })
.padding({ bottom: 10 })
Column() {
// 点赞
if (this.contentDetailData?.openLikes && this.contentDetailData?.likesStyle !== 4) {
... ... @@ -159,8 +160,8 @@ export struct ImageAndTextPageComponent {
}
.id('imgTextContainer')
}
.padding({bottom: 44})
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.scrollBar(BarState.Off)
.align(Alignment.Top)
.onReachEnd(() => {
... ... @@ -174,10 +175,10 @@ export struct ImageAndTextPageComponent {
retry: () => {
this.getDetail()
}
}).padding({ bottom: 200 })
}).padding({ bottom: 44 })
} else {
if (!this.isPageEnd) {
detailedSkeleton().padding({ bottom: this.bottomSafeHeight })
detailedSkeleton().padding({ bottom: 44 })
}
}
// 底部交互区
... ... @@ -206,12 +207,10 @@ export struct ImageAndTextPageComponent {
this.isScrollTop = !this.isScrollTop
}
})
.position({ y: '100%' })
}
.margin({top: `${this.topSafeHeight}px`, bottom: `${this.bottomSafeHeight}px`})
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
.padding({ top: 38 })
// .height(CommonConstants.FULL_HEIGHT)
// 发布时间
Column() {
... ... @@ -242,6 +241,7 @@ export struct ImageAndTextPageComponent {
.backgroundColor(Color.White)
}.backgroundColor(Color.White)
}
.margin({top: `${this.topSafeHeight}px`, bottom: `${this.bottomSafeHeight}px`})
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.backgroundColor(Color.White)
... ...
... ... @@ -239,7 +239,7 @@ struct createImg {
}) {
Stack({alignContent: Alignment.BottomEnd}) {
Image(this.loadImg ? item.fullUrl : '')
.backgroundColor(0xf5f5f5)
.backgroundColor(index === 2 ? 0xffffff : 0xf5f5f5)
.aspectRatio(1)
.width(113)
.height(113)
... ...
... ... @@ -108,7 +108,7 @@ export struct Card9Component {
// 时间线--后端返回三个,
Column() {
ForEach(this.contentDTO.slideShows, (item: slideShows, index: number) => {
this.timelineItem(item, index)
this.timelineItem(item, index, index === this.contentDTO.slideShows.length - 1)
})
}
... ... @@ -149,25 +149,41 @@ export struct Card9Component {
}
@Builder
timelineItem(item: slideShows, index: number) {
timelineItem(item: slideShows, index: number, isLastOne: boolean) {
Column() {
Stack() {
if (index < this.contentDTO.slideShows.length - 1) {
if (index === 0) {
Divider()
.vertical(true)
.color($r('app.color.color_EDEDED'))
.strokeWidth(1)
.margin({ top: index > 0 ? 0 : 16, left: 4 })
}
if (index > 0 && index == this.contentDTO.slideShows.length - 1) {
.margin({ top: 16, left: 4 })
.height(16)
} else {
Divider()
.vertical(true)
.color($r('app.color.color_EDEDED'))
.strokeWidth(1)
.margin({ top: 0, left: 4 })
.height(16)
.margin({ left: 4 })
if (!isLastOne)
{
Divider()
.vertical(true)
.color($r('app.color.color_EDEDED'))
.strokeWidth(1)
.margin({ top: 16, left: 4 })
.height(16)
}
}
// Divider()
// .vertical(true)
// .color($r('app.color.color_EDEDED'))
// .strokeWidth(1)
// .margin({ top: index > 0 ? 0 : 32, left: 4 })
// .height(16)
Column() {
Row() {
// 标题
... ... @@ -195,21 +211,14 @@ export struct Card9Component {
.maxLines(2)
.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)
// .width(90)
// .height(60)
// .borderRadius($r('app.float.image_border_radius'))
// }
.margin({ left: 4 })
.padding({ bottom: 20, left: 12 })
.border({ width: { left: isLastOne ? 0 : 1 }, color: 0xededed})
}
}
}
.alignContent(Alignment.TopStart)
}
.height(item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url ? 100 : 50)
.alignItems(HorizontalAlign.Start)
}
}
\ No newline at end of file
... ...
... ... @@ -109,6 +109,7 @@ struct localCard {
.width('100%')
.margin({ bottom: 6 })
.flexShrink(0)
.maxLines(1)
Text(this.operDataListItem.newsTitle)
.width(CommonConstants.FULL_PARENT)
... ...
... ... @@ -214,12 +214,7 @@ struct MineHomePage {
.fontWeight('400lpx')
.fontColor(this.isHasIntroduction?$r('app.color.color_222222'):$r('app.color.color_999999'))
.textAlign(TextAlign.Start)
.onClick(()=>{
let params: editModelParams = {
editContent: this.isHasIntroduction?this.desc:''
}
WDRouterRule.jumpWithPage(WDRouterPage.editUserIntroductionPage,params)
})
if(!this.isHasIntroduction){
Image($r('app.media.user_info_edit_icon'))
.width('27lpx')
... ... @@ -227,7 +222,12 @@ struct MineHomePage {
.interpolation(ImageInterpolation.High)
.objectFit(ImageFit.Auto)
}
}
}.onClick(()=>{
let params: editModelParams = {
editContent: this.isHasIntroduction?this.desc:''
}
WDRouterRule.jumpWithPage(WDRouterPage.editUserIntroductionPage,params)
})
Text(`来到人民日报${this.registerTimeForDay}天`)
... ...
... ... @@ -102,6 +102,7 @@ struct VisitorCommentPage {
.width('100%')
}.width("100%")
.height("100%")
.backgroundColor(Color.White)
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
... ...
... ... @@ -115,7 +115,7 @@ struct LaunchAdvertisingPage {
if (this.defaultModel.linkUrl.length > 0 || this.defaultModel.objectId.length > 0){
Button(){
Row(){
Text('点击跳转至详情')
Text(this.defaultModel.isAd == '1'?'点击跳转至详情或第三方应用':'点击跳转至详情')
.fontSize('31lpx')
.fontColor(Color.White)
.margin({
... ...
... ... @@ -3,6 +3,7 @@ import { WDRouterRule } from 'wdRouter';
import { WDRouterPage } from 'wdRouter';
import { SPHelper } from 'wdKit/Index';
import { SpConstants } from 'wdConstant/Index';
import { CustomToast} from 'wdKit'
import { ButtonOptions, promptAction, window } from '@kit.ArkUI';
import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index';
import { ImageKnifeComponent,ScaleType } from '@ohos/imageknife';
... ... @@ -16,6 +17,16 @@ struct LaunchInterestsHobbiesPage {
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
msg: '请先选择您感兴趣的内容哦',
}),
autoCancel: false,
alignment: DialogAlignment.Center,
customStyle: true,
maskColor:"#00000000"
})
aboutToAppear(){
//请求接口,获取兴趣偏好数据
this.requestInterestsData()
... ... @@ -153,11 +164,7 @@ struct LaunchInterestsHobbiesPage {
.borderRadius('10lpx')
.onClick(()=>{
if (this.selectCount == 0) {
promptAction.showToast({
message : '请先选择您感兴趣的内容哦',
duration: 2000,
bottom: '50%',
})
this.dialogToast.open()
return
}
this.saveTagIds()
... ...
... ... @@ -139,6 +139,7 @@ export struct BottomNavigationComponent {
.opacity(this.currentNavIndex === index ? this.FULL_OPACITY : this.SIXTY_OPACITY)
}
.zIndex(10)
.width('100%')
.height($r('app.float.bottom_navigation_barHeight'))
.hoverEffect(HoverEffect.Highlight)
.visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
... ...