wangliang_wd

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

* 'main' of http://192.168.1.42/developOne/harmonyPool: (25 commits)
  fix(聚合页):上拉加载更多
  fix: 16784 【穿越测试】大图卡稿件,标题超过2行,应省略号展示。
  fix: 16784 【穿越测试】大图卡稿件,标题超过2行,应省略号展示。
  fix(聚合页):增加下拉刷新功能
  fix:点赞数
  fix: 16977 功能缺陷--进入人民号-横滑卡少个更多按钮,看图
  fix: 16914 UI还原问题-频道中的文章标题,文章正文,字体大小、行距与安卓不一致
  fix: 16618 人民号主题卡字体样式鸿蒙与安卓不一致
  web组件支持长内容
  标题弹框渐变背景,直播评论返回回调
  desc:升级API 12
  fix:bug[16997] 搜索结果页-稿件发布日期展示错误
  fix: 直播预约卡预约功能debug
  fix: 直播预约卡预约功能debug
  fix:bug[16993] 搜索页面-没有配置人搜索不该展示热门搜索标识
  fix:16696 篇头跳转缺少交互
  直播评论接入
  底导双击刷新改完单击刷新
  fix: 直播预约卡预约功能
  fix:bug[16954] 定位权限弹窗未能依次弹出提示
  ...
Showing 49 changed files with 837 additions and 430 deletions
... ... @@ -34,8 +34,8 @@
{
"name": "default",
"signingConfig": "default",
"compileSdkVersion": "4.1.0(11)",
"compatibleSdkVersion": "4.1.0(11)",
"compileSdkVersion": "5.0.0(12)",
"compatibleSdkVersion": "5.0.0(12)",
"runtimeOS": "HarmonyOS",
}
],
... ...
... ... @@ -155,9 +155,15 @@ function buildErrorMsg(httpStatus: number): string {
case HttpStatusCode.HttpVersionNotSupported:
message = "HTTP版本不受支持(505)";
break;
default:
// 网络连接故障
message = `连接出错(${httpStatus})!`;
default:{
// 网络连接故障
if(httpStatus != undefined){
message = `连接出错(${httpStatus})!`;
}else{
message = `连接出错!`;
}
}
}
return message;
}
... ...
... ... @@ -244,7 +244,6 @@ export class HttpUrlUtils {
* first_load&refreshTime=1710829610144&pageId=28927&channelStrategy=2&groupId=40621&
* pageSize=20&pageNum=1&topicId=10000009445
* */
static readonly MORNING_EVENING_PAGE_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/pageInfo";
/**
* 直播回顾
* */
... ...
... ... @@ -38,6 +38,17 @@ class AppLoginAuthInfo {
Authorization: string = ''
}
interface IDataJson {
jumpType:number
jumpUrl:string
newsId:string
newsObjectLevel:string
newsObjectType:number
newsRelId:string
newsTitle:string
pageId:string
}
/**
* h5调用native代码
* @param data
... ... @@ -121,6 +132,16 @@ function handleJsCallReceiveH5Data(data: Message) {
case '5':
ProcessUtils.processPage(JSON.parse(data?.data?.dataJson || '{}'))
break;
case '6':
let contentJson: IDataJson = JSON.parse(data?.data?.dataJson || '{}')
let content: ContentDTO = {
objectId: contentJson?.newsId,
relId: contentJson?.newsRelId,
pageId: contentJson?.pageId,
objectType: String(contentJson?.newsObjectType)
} as ContentDTO
ProcessUtils.processPage(content)
break;
default:
break;
}
... ... @@ -134,7 +155,8 @@ function handleJsCallAppInnerLinkMethod(data: Message) {
relId: urlParams.get('relId') || '',
relType: urlParams.get('relType') || '',
pageId: urlParams.get('pageId') || '',
objectType: ''
objectType: '',
linkUrl: urlParams.get('url') || ''
} as ContentDTO
if (urlParams.get('skipType') === '1') {
... ...
... ... @@ -48,8 +48,8 @@ export struct WdWebLocalComponent {
Row() {
RelativeContainer() {
// Web({ src: this.webResource, controller: this.webviewControl, renderMode: RenderMode.SYNC_RENDER })
Web({ src: this.webResource, controller: this.webviewControl})
Web({ src: this.webResource, controller: this.webviewControl, renderMode: RenderMode.SYNC_RENDER })
// Web({ src: this.webResource, controller: this.webviewControl})
.domStorageAccess(true)
.databaseAccess(true)
.javaScriptAccess(true)
... ... @@ -57,9 +57,9 @@ export struct WdWebLocalComponent {
.mixedMode(MixedMode.All)
.onlineImageAccess(true)
.enableNativeEmbedMode(true)
// .layoutMode(WebLayoutMode.FIT_CONTENT)
.layoutMode(WebLayoutMode.FIT_CONTENT)
// .nestedScroll({ scrollForward: NestedScrollMode.SELF_FIRST, scrollBackward: NestedScrollMode.PARENT_FIRST })
.height(this.webHeight)
// .height(this.webHeight)
.onPageBegin((event) => {
this.onPageBegin(event?.url);
})
... ...
import { CompAdvMatInfoBean } from '../adv/CompAdvInfoBean';
import { AudioDTO } from '../content/AudioDTO';
import { ContentDTO } from '../content/ContentDTO';
export interface BaseDTO {
}
\ No newline at end of file
... ...
import { CompAdvMatInfoBean } from '../adv/CompAdvInfoBean';
import { AudioDTO } from '../content/AudioDTO';
import { ContentDTO } from '../content/ContentDTO';
import { BaseDTO } from './BaseDTO';
export interface CompDTO {
export interface CompDTO extends BaseDTO{
backgroundColor: string;
backgroundImgUrl: string;
cityCode: string;
... ...
... ... @@ -6,8 +6,9 @@ import { slideShows } from '../morningevening/slideShows';
import { VoiceInfoDTO } from '../detail/VoiceInfoDTO';
import { RmhInfoDTO } from '../detail/RmhInfoDTO';
import { commentInfo } from './commentInfo';
import { BaseDTO } from '../component/BaseDTO';
export interface ContentDTO {
export interface ContentDTO extends BaseDTO {
appStyle: string;
cityCode: string;
coverSize: string;
... ...
... ... @@ -18,7 +18,8 @@
"wdRouter": "file:../../commons/wdRouter",
"wdNetwork": "file:../../commons/wdNetwork",
"wdJsBridge": "file:../../commons/wdJsBridge",
"wdDetailPlayApi":"file:../../features/wdDetailPlayApi",
"wdHwAbility": "file:../../features/wdHwAbility"
"wdDetailPlayApi": "file:../../features/wdDetailPlayApi",
"wdHwAbility": "file:../../features/wdHwAbility",
"wdShare": "file:../../features/wdShare"
}
}
... ...
... ... @@ -50,7 +50,7 @@ export struct ImageAndTextPageComponent {
@State operationButtonList: string[] = ['comment', 'collect', 'share']
@State isNetConnected: boolean = true
@State info: Area | null = null
@State likeNum: number = 0
build() {
Column() {
// 发布时间
... ... @@ -105,13 +105,13 @@ export struct ImageAndTextPageComponent {
$r('app.media.icon_candle')))
.width(24)
.height(24)
.margin({ right: 5 })
}
if (this.interactData?.likeNum > 0) {
Text(NumberFormatterUtils.formatNumberWithWan(this.interactData?.likeNum))
if (this.likeNum > 0) {
Text(NumberFormatterUtils.formatNumberWithWan(this.likeNum))
.fontSize(16)
.fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999')
.fontWeight(500)
.margin({ left: 5 })
}
}
.width(154)
... ... @@ -303,7 +303,7 @@ export struct ImageAndTextPageComponent {
}
PageRepository.getContentInteract(params).then(res => {
if (res.data) {
this.interactData =res.data[0]
this.likeNum = Number(res.data[0]?.likeNum) || 0
}
})
}
... ...
... ... @@ -211,12 +211,13 @@ export struct MorningEveningPaperComponent {
}
.height('100%')
PaperTitleComponent().margin({
top: this.topSafeHeight
})
PaperTitleComponent()
}
.width('100%')
.height('100%')
.padding({
top: this.topSafeHeight
})
// .backgroundColor(Color.Black)
// .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black)
.backgroundColor(this.mixedBgColor ?? Color.Black)
... ...
... ... @@ -47,8 +47,10 @@ export struct MultiPictureDetailPageComponent {
@State publishCommentModel: publishCommentModel = new publishCommentModel()
@State operationButtonList: string[] = ['comment', 'like', 'collect', 'share']
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number;
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') as number;
@State windowHeight: number = AppStorage.get<number>('windowHeight') as number;
@State currentOffset:number = 0
@State duration:number = 0
//watch监听页码回调
onCurrentPageNumUpdated(): void {
... ... @@ -81,6 +83,7 @@ export struct MultiPictureDetailPageComponent {
}
}
aboutToDisappear() {
}
... ... @@ -98,130 +101,135 @@ export struct MultiPictureDetailPageComponent {
@Builder
init() {
if (this.contentDetailData.rmhPlatform == 1) {
Row() {
Row({ space: 8 }) {
if (this.getImgUrl()){
Row() {
Stack() {
Image(this.getImgUrl())
.borderRadius(18)
.aspectRatio(1)
.border({ width: 1, color: Color.White, style: BorderStyle.Solid })
.width(36)
.height(36)
.objectFit(ImageFit.Fill)
.interpolation(ImageInterpolation.High)
if(!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)){
Stack() {
Image(this.contentDetailData.rmhInfo?.authIcon)
.width($r('app.float.vp_13'))
.height($r('app.float.vp_13'))
.objectFit(ImageFit.Cover)
if(!this.showDownload) {
Row() {
Row({ space: 8 }) {
if (this.getImgUrl()){
Row() {
Stack() {
Image(this.getImgUrl())
.borderRadius(18)
.aspectRatio(1)
.border({ width: 1, color: Color.White, style: BorderStyle.Solid })
.width(36)
.height(36)
.objectFit(ImageFit.Fill)
.interpolation(ImageInterpolation.High)
if(!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)){
Stack() {
Image(this.contentDetailData.rmhInfo?.authIcon)
.width($r('app.float.vp_13'))
.height($r('app.float.vp_13'))
.objectFit(ImageFit.Cover)
}
.width(36)
.height(36)
.alignContent(Alignment.BottomEnd)
}
.width(36)
.height(36)
.alignContent(Alignment.BottomEnd)
}
}
.width(36)
.height(36)
.alignContent(Alignment.Center)
.onClick(() => {
if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
// 号主页
const params: Params = {
creatorId: this.contentDetailData.rmhInfo.rmhId,
pageID: ''
.width(36)
.height(36)
.alignContent(Alignment.Center)
.onClick(() => {
if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
// 号主页
const params: Params = {
creatorId: this.contentDetailData.rmhInfo.rmhId,
pageID: ''
}
WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
}
WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
}
})
})
}
.width('13%')
.height('100%')
}
Row() {
Flex({
direction: FlexDirection.Column,
justifyContent: FlexAlign.SpaceAround,
alignItems: ItemAlign.Start
}) {
Text(`${this.contentDetailData?.rmhInfo?.rmhName}`)
.fontColor(Color.White)
.fontSize(14)
.fontFamily('PingFang PingFang SC-Medium')
.fontWeight(500)
.lineHeight(17)
.margin(0)
.height(17)
Text(`${this.contentDetailData?.rmhInfo?.rmhDesc}`)
.fontColor(Color.White)
.fontSize(12)
.fontFamily('PingFang SC-Regular')
.fontWeight(400)
.lineHeight(14)
.height(14)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin(0)
.maxLines(1)
}
}
.width('13%')
.width('81%')
.height('100%')
}
.width('74.4%')
.height('100%')
.margin({
top: 0,
bottom: 0,
left: 16,
right: 0
})
Row() {
Flex({
direction: FlexDirection.Column,
justifyContent: FlexAlign.SpaceAround,
alignItems: ItemAlign.Start
}) {
Text(`${this.contentDetailData?.rmhInfo?.rmhName}`)
.fontColor(Color.White)
.fontSize(14)
.fontFamily('PingFang PingFang SC-Medium')
.fontWeight(500)
.lineHeight(17)
.margin(0)
.height(17)
Text(`${this.contentDetailData?.rmhInfo?.rmhDesc}`)
.fontColor(Color.White)
.fontSize(12)
.fontFamily('PingFang SC-Regular')
.fontWeight(400)
.lineHeight(14)
.height(14)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin(0)
.maxLines(1)
if (this.followStatus == '0') {
Button({ type: ButtonType.Normal, stateEffect: true }) {
Row() {
Text('+关注').fontSize(12).fontColor(0xffffff)
}.alignItems(VerticalAlign.Center)
}
.borderRadius(4)
.backgroundColor('#ED2800')
.width(48)
.height(24)
.onClick(() => {
this.handleAccention()
})
} else {
Button({ type: ButtonType.Normal, stateEffect: true }) {
Row() {
Text('已关注').fontSize(12).fontColor(0xffffff)
}.alignItems(VerticalAlign.Center)
}
.borderRadius(4)
.backgroundColor('#333333')
.width(54)
.height(24)
}
}
.width('81%')
.justifyContent(FlexAlign.Center)
.alignItems(VerticalAlign.Center)
.width('21.6%')
.height('100%')
}
.width('74.4%')
.height('100%')
.margin({
top: 0,
bottom: 0,
left: 16,
right: 0
.width('100%')
.height(44)
.zIndex(10)
.margin({top:`${this.topSafeHeight + 12}px`})
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
Row() {
if (this.followStatus == '0') {
Button({ type: ButtonType.Normal, stateEffect: true }) {
Row() {
Text('+关注').fontSize(12).fontColor(0xffffff)
}.alignItems(VerticalAlign.Center)
}
.borderRadius(4)
.backgroundColor('#ED2800')
.width(48)
.height(24)
.onClick(() => {
this.handleAccention()
})
} else {
Button({ type: ButtonType.Normal, stateEffect: true }) {
Row() {
Text('已关注').fontSize(12).fontColor(0xffffff)
}.alignItems(VerticalAlign.Center)
}
.borderRadius(4)
.backgroundColor('#333333')
.width(54)
.height(24)
}
}
.justifyContent(FlexAlign.Center)
.alignItems(VerticalAlign.Center)
.width('21.6%')
.height('100%')
.id('e_attention')
.transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(
TransitionEffect.translate({ x: 0, y: `-${this.topSafeHeight + 12}px` })
))
}
.width('100%')
.height(44)
.zIndex(10)
.margin({top:`${this.topSafeHeight + 12}px`})
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.id('e_attention')
.visibility(!this.showDownload ? Visibility.Visible : Visibility.None)
}
if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) {
Swiper(this.swiperController) {
... ... @@ -241,6 +249,9 @@ export struct MultiPictureDetailPageComponent {
this.currentOffset = Math.abs(extraInfo.currentOffset)
})
.onTouch((event: TouchEvent) => {
if(this.duration === 0) {
this.duration = 500
}
if(event.type === 1) {
// if(this.currentOffset > px2vp((this.windowHeight - item.height)/2 - 100)) {
if(this.currentOffset > 160) {
... ... @@ -285,113 +296,121 @@ export struct MultiPictureDetailPageComponent {
})
}
Column(){
Column(){
Row() {
Scroll(this.scroller) {
Row() {
Flex({
direction: FlexDirection.Column,
justifyContent: FlexAlign.Start
}) {
if(this.contentDetailData?.photoList?.length) {
Text() {
Span(`${this.swiperIndex + 1}`)
.fontSize(24)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(28)
Span(`/${this.contentDetailData?.photoList?.length}`)
if(!this.showDownload) {
Column(){
Row() {
Scroll(this.scroller) {
Row() {
Flex({
direction: FlexDirection.Column,
justifyContent: FlexAlign.Start
}) {
if(this.contentDetailData?.photoList?.length) {
Text() {
Span(`${this.swiperIndex + 1}`)
.fontSize(24)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(28)
Span(`/${this.contentDetailData?.photoList?.length}`)
.fontSize(14)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(19)
}
.fontColor(Color.White)
.margin(4)
}
if(this.contentDetailData.newsTitle) {
Text(`${this.contentDetailData.newsTitle}`)
.fontColor(Color.White)
.fontSize(16)
.fontFamily('PingFang SC-Semibold')
.fontWeight(600)
.lineHeight(24)
.margin({
top: 4,
left: 0,
bottom: 4,
right: 0
})
}
if(this.contentDetailData.photoList?.[this.swiperIndex].picDesc) {
Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`)
.fontColor(Color.White)
.fontSize(14)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(19)
.fontFamily('PingFang SC-Regular')
.fontWeight(400)
.lineHeight(22)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({
top: 4,
left: 0,
bottom: 4,
right: 18
})
.maxLines(32)
}
.fontColor(Color.White)
.margin(4)
}
if(this.contentDetailData.newsTitle) {
Text(`${this.contentDetailData.newsTitle}`)
.fontColor(Color.White)
.fontSize(16)
.fontFamily('PingFang SC-Semibold')
.fontWeight(600)
.lineHeight(24)
.margin({
top: 4,
left: 0,
bottom: 4,
right: 0
})
}
if(this.contentDetailData.photoList?.[this.swiperIndex].picDesc) {
Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`)
.fontColor(Color.White)
.fontSize(14)
.fontFamily('PingFang SC-Regular')
.fontWeight(400)
.lineHeight(22)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({
top: 4,
left: 0,
bottom: 4,
right: 18
})
.maxLines(32)
}
}
.width('100%')
}
.width('100%')
.scrollable(ScrollDirection.Vertical)
.scrollBarWidth(0)
.height(px2vp(this.titleHeight))
.align(Alignment.Bottom)
}
.scrollable(ScrollDirection.Vertical)
.scrollBarWidth(0)
.height(px2vp(this.titleHeight))
.align(Alignment.Bottom)
OperRowListView({
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
})
}
OperRowListView({
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
})
.transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(
TransitionEffect.translate({ x: 0, y: `-${this.bottomSafeHeight}px` })
))
}
.visibility(!this.showDownload ? Visibility.Visible : Visibility.None)
Column(){
Row() {
Flex({
direction: FlexDirection.Row,
justifyContent: FlexAlign.SpaceBetween
}) {
if(this.contentDetailData?.photoList?.length) {
Text() {
Span(`${this.swiperIndex + 1}`)
.fontSize(24)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(28)
Span(`/${this.contentDetailData?.photoList?.length}`)
.fontSize(14)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(19)
if(this.showDownload) {
Column(){
Row() {
Flex({
direction: FlexDirection.Row,
justifyContent: FlexAlign.SpaceBetween
}) {
if(this.contentDetailData?.photoList?.length) {
Text() {
Span(`${this.swiperIndex + 1}`)
.fontSize(24)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(28)
Span(`/${this.contentDetailData?.photoList?.length}`)
.fontSize(14)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(19)
}
.fontColor(Color.White)
.margin(4)
}
.fontColor(Color.White)
.margin(4)
}
if(this.contentDetailData.photoList?.[this.swiperIndex].picPath) {
ImageDownloadComponent({ url: this.contentDetailData.photoList?.[this.swiperIndex].picPath })
.margin({
top: 8,
left: 18,
bottom: 24,
right: 18
})
if(this.contentDetailData.photoList?.[this.swiperIndex].picPath) {
ImageDownloadComponent({ url: this.contentDetailData.photoList?.[this.swiperIndex].picPath })
.margin({
top: 8,
left: 18,
bottom: 24,
right: 18
})
}
}
}
.width('100%')
}
.width('100%')
.transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(
TransitionEffect.translate({ x: 0, y: `${this.bottomSafeHeight}px` })
))
}
.visibility(this.showDownload ? Visibility.Visible : Visibility.None)
}
.zIndex(10)
.id('e_swiper_bottom')
... ...
... ... @@ -53,7 +53,7 @@ export struct CardAdvBottom {
let a = this.compDTO;
let currentIndex = -1
for (let i = 0; i < this.pageModel.compList.size(); i++) {
let b = this.pageModel.compList.getData(i)
let b = this.pageModel.compList.getData(i) as CompDTO
if (a.compStyle === b.compStyle && a.matInfo === b.matInfo) {
currentIndex = i
break;
... ...
... ... @@ -65,7 +65,7 @@ export struct CardAdvTop {
let a = this.compDTO;
let currentIndex = -1
for (let i = 0; i < this.pageModel.compList.size(); i++) {
let b = this.pageModel.compList.getData(i)
let b = this.pageModel.compList.getData(i) as CompDTO
if (a.compStyle === b.compStyle && a.matInfo === b.matInfo) {
currentIndex = i
break;
... ...
... ... @@ -59,6 +59,7 @@ export struct Card20Component {
.width(CommonConstants.FULL_WIDTH)
.textOverflowStyle(2)
.margin({ bottom: 8 })
.lineHeight(20)
}
if (this.contentDTO.fullColumnImgUrls[0]) {
createImg({ contentDTO: this.contentDTO })
... ...
... ... @@ -38,7 +38,7 @@ export struct Card2Component {
Text(this.contentDTO.newsTitle)
.fontSize($r('app.float.font_size_17'))
.fontColor($r('app.color.color_222222'))
.maxLines(3)
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.align(Alignment.Start)
//大图
... ...
... ... @@ -57,7 +57,7 @@ export struct ZhSingleColumn04 {
.width(12)
.margin({ left: 12, right: 8 })
Text(item.newsTitle)
.fontSizeColorWeight($r('app.float.font_size_12'), $r('app.color.color_222222'), 400)
.fontSizeColorWeight($r('app.float.font_size_17'), $r('app.color.color_222222'), 400)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.layoutWeight(1)
... ... @@ -67,19 +67,19 @@ export struct ZhSingleColumn04 {
.borderRadius(4)
.fontSizeColorWeight($r('app.float.vp_12'), '#F07E46', 500)
.backgroundColor('rgba(240, 126, 70, 0.2)')
.margin({ right: 18 })
.margin({ right: 21 })
} else if (item.tagWord === 2) {
Text('新')
.padding(3)
.borderRadius(4)
.fontSizeColorWeight($r('app.float.vp_12'), '#468DF0', 500)
.backgroundColor('rgba(70, 141, 240, 0.2)')
.margin({ right: 18 })
.margin({ right: 21 })
}
}
.width(CommonConstants.FULL_WIDTH)
.height(32)
.margin({ bottom: 4 })
.margin({ bottom: 8 })
.backgroundImage($r('app.media.rmh_theme_bg'))
.backgroundImageSize({ width: CommonConstants.FULL_WIDTH, height: CommonConstants.FULL_WIDTH })
.onClick(() => {
... ...
... ... @@ -5,6 +5,8 @@ import { PageRepository } from '../../repository/PageRepository';
import { ProcessUtils } from 'wdRouter';
import { HttpUtils } from 'wdNetwork/Index';
import { DateTimeUtils } from 'wdKit';
import { LiveModel } from '../../viewmodel/LiveModel'
import { Logger, ToastUtils } from 'wdKit';
/**
* 直播预约卡
... ... @@ -12,13 +14,62 @@ import { DateTimeUtils } from 'wdKit';
*/
const TAG = 'Zh_Single_Row-03'
interface reserveItem {
liveId: number,
relationId: string,
subscribe: boolean
}
interface reserveReqItem {
liveId: string,
relationId: string,
}
@Entry
@Component
export struct ZhSingleRow03 {
@State compDTO: CompDTO = {} as CompDTO
@State isEndEdge: boolean = false;
// @State reserveStatus: reserveItem[] = []
@State reservedIds: string[] = [];
scroller: Scroller = new Scroller()
aboutToAppear(): void {
this.getReserveState();
}
// 请求所有预约状态
async getReserveState() {
const reserveBean: reserveReqItem[] = this.compDTO.operDataList.map((item: ContentDTO) => {
const reqItem: reserveReqItem = {
liveId: item.objectId,
relationId: item.relId
}
return reqItem;
})
const res = await LiveModel.getAppointmentStatus(reserveBean);
// this.reserveStatus = res;
res.map((item: reserveItem) => {
if (item.subscribe) {
this.reservedIds.push(item.liveId.toString())
}
})
}
// 判断是否预约
isReserved(liveId: number) {
return this.reservedIds.includes(liveId.toString())
}
// 预约/取消预约
async bookAndCancel(relationId: string, liveId: string, isSubscribe: boolean) {
const res = await LiveModel.liveAppointment(relationId.toString(), liveId.toString(), isSubscribe);
if (res.code == 0) {
ToastUtils.shortToast(isSubscribe ? '预约成功' : '取消预约成功')
this.getReserveState();
}
}
format(timeNum: number) {
const todayDate = new Date().setHours(0,0,0,0)
const parseDate = new Date(timeNum).setHours(0,0,0,0);
... ... @@ -44,64 +95,7 @@ export struct ZhSingleRow03 {
Scroll(this.scroller){
Row() {
ForEach(this.compDTO.operDataList, (item: ContentDTO) => {
Column() {
Row() {
Image(item.coverUrl)
.width(106)
.height(60)
.margin({right: 12})
Text(item.newsTitle)
.width(154)
.height(60)
.maxLines(3)
.textOverflow({overflow: TextOverflow.Ellipsis})
}
.margin({bottom: 16})
Row() {
Flex({justifyContent: FlexAlign.SpaceBetween}){
Row() {
Text(this.format(new Date(item.liveInfo.liveStartTime).getTime()))
.margin({right: 6})
.fontColor(0x000000)
.fontSize(13)
.textAlign(TextAlign.Start)
Image($r('app.media.timeline_rect'))
.width(4)
.height(3)
.margin({right: 6})
Text(item.liveInfo.liveStartTime.split(' ')[1].slice(0, 5))
.margin({right: 6})
.fontColor(0x000000)
.fontSize(13)
Text('开始直播')
.fontColor(0xC8C8C8)
.fontSize(13)
}
Row() {
Text('预约')
.width(48)
.height(24)
.backgroundColor(0xED2800)
.fontColor(0xffffff)
.fontSize(12)
.textAlign(TextAlign.Center)
.borderRadius(3)
}
.margin({top: -5})
}
}
}
.width(298)
.height(116)
.padding({top: 12, bottom: 12, left: 12, right: 12})
.backgroundColor(0xf9f9f9)
.margin({right: 8})
.onClick(() => {
ProcessUtils.processPage(item)
})
this.ItemCard(item)
})
}
}
... ... @@ -131,6 +125,73 @@ export struct ZhSingleRow03 {
}
@Builder
ItemCard(item: ContentDTO) {
Column() {
Row() {
Image(item.coverUrl)
.width(106)
.height(60)
.margin({right: 12})
Text(item.newsTitle)
.width(154)
.height(60)
.maxLines(3)
.textOverflow({overflow: TextOverflow.Ellipsis})
}
.margin({bottom: 16})
Row() {
Flex({justifyContent: FlexAlign.SpaceBetween}){
Row() {
Text(this.format(new Date(item.liveInfo.liveStartTime).getTime()))
.margin({right: 6})
.fontColor(0x000000)
.fontSize(13)
.textAlign(TextAlign.Start)
Image($r('app.media.timeline_rect'))
.width(4)
.height(3)
.margin({right: 6})
Text(item.liveInfo.liveStartTime.split(' ')[1].slice(0, 5))
.margin({right: 6})
.fontColor(0x000000)
.fontSize(13)
Text('开始直播')
.fontColor(0xC8C8C8)
.fontSize(13)
}
Row() {
Text(this.isReserved(Number(item.objectId)) ? '已预约' : '预约')
.width(48)
.height(24)
.backgroundColor(this.isReserved(Number(item.objectId)) ? 0xffffff : 0xED2800)
.fontColor(this.isReserved(Number(item.objectId)) ? 0xC8C8C8 : 0xffffff)
.fontSize(12)
.textAlign(TextAlign.Center)
.borderRadius(3)
.onClick(() => {
this.bookAndCancel(item.relId, item.objectId, !this.isReserved(Number(item.objectId)))
})
}
.margin({top: -5})
}
}
}
.width(298)
.height(116)
.padding({top: 12, bottom: 12, left: 12, right: 12})
.backgroundColor(0xf9f9f9)
.margin({right: 8})
.onClick(() => {
ProcessUtils.processPage(item)
})
}
@Builder
CompHeader(item: CompDTO) {
Row() {
Row() {
... ...
... ... @@ -115,15 +115,6 @@ export struct BottomNavigationComponent {
.height(CommonConstants.FULL_PARENT)
.padding({ bottom: 15, left: 10, right: 10, top: 2 })
.aspectRatio(this.ASPECT_RATIO_1_1)
.gesture(
TapGesture({ count: 2 })
.onAction((event: GestureEvent) => {
if (this.currentNavIndex === index) {
// 当前tab,双击事件
this.autoRefresh++
}
})
)
Text(navItem.name)
.margin({ bottom: $r('app.float.bottom_navigation_margin_bottom') })
... ... @@ -140,7 +131,13 @@ export struct BottomNavigationComponent {
this.barBackgroundColor = Color.White
this.currentBottomNavInfo = {} as BottomNavDTO
} else {
this.currentBottomNavInfo = navItem
if (this.currentNavIndex === index) {
// 当前tab,单击事件
this.autoRefresh++
} else {
// 切换tab
this.currentBottomNavInfo = navItem
}
}
this.currentNavIndex = index;
... ... @@ -186,21 +183,4 @@ export struct BottomNavigationComponent {
this.assignChannel.bottomNavId = assignChannel.bottomNavId
}, 20)
}
/**
* 双击实现
*/
// doubleClickTime: number = 0
/**
* 双击实现
*/
// private doubleClick(fun: () => void) {
// let now = DateTimeUtils.getTimeStamp()
// if (now - this.doubleClickTime < 200) {
// fun()
// } else {
// this.doubleClickTime = now
// }
// }
}
\ No newline at end of file
... ...
... ... @@ -83,7 +83,7 @@ struct ReserveMorePage {
this.reserveBean = this.transformToLiveDetailsBeans(liveReviewDTO.list)
const apointMentStatus = await LiveModel.getAppointmentStatus(this.reserveBean)
console.info(`cj2024 ${apointMentStatus.code}`)
// console.info(`cj2024 ${apointMentStatus.code}`)
})
... ...
import { ContentDTO , Action,GoldenPositionExtraBean} from 'wdBean';
import { CommonConstants ,ViewType} from 'wdConstant';
import PageViewModel from '../../viewmodel/PageViewModel';
import RefreshLayout from '../page/RefreshLayout';
import { RefreshLayoutBean } from '../page/RefreshLayoutBean';
import PageModel from '../../viewmodel/PageModel';
import { DateTimeUtils, LazyDataSource } from 'wdKit/Index';
import router from '@ohos.router';
... ... @@ -10,6 +8,12 @@ import { CardParser } from '../CardParser';
import { channelSkeleton } from '../skeleton/channelSkeleton'
import { ErrorComponent } from '../view/ErrorComponent';
import { EmptyComponent } from '../view/EmptyComponent';
import { listTouchEvent } from '../../utils/PullDownRefresh';
import PageAdModel from '../../viewmodel/PageAdvModel';
import { RefreshLayoutBean } from '../refresh/RefreshLayoutBean';
import RefreshLayout from '../refresh/RefreshLayout';
import PageNoMoreLayout from './PageNoMoreLayout';
import { NoMoreBean } from './NoMoreBean';
const TAG: string = 'ThemeListPage';
... ... @@ -17,22 +21,26 @@ const TAG: string = 'ThemeListPage';
@Component
struct ThemeListPage {
@State private pageModel: PageModel = new PageModel();
@State data: LazyDataSource<ContentDTO> = new LazyDataSource();
sort: number = 1;
currentPage: number = 1;
pageSize: number = 20;
title: string = '金刚位聚合页'
extra: string = ''
@State private pageAdvModel: PageAdModel = new PageAdModel();
aboutToAppear(): void {
let par:Action = router.getParams() as Action;
let params = par?.params;
this.extra = params?.extra?.extra || '';
this.title = params?.extra?.title || '';
PageViewModel.postThemeList(this.sort, this.currentPage, this.pageSize,this.extra).then((liveReviewDTO) => {
this.pageModel.pageType = 1;
this.pageModel.extra = this.extra;
PageViewModel.postThemeList(this.currentPage, this.pageSize,this.extra).then((liveReviewDTO) => {
console.log(`postThemeList${JSON.stringify(liveReviewDTO)}`)
this.data.push(...liveReviewDTO.list)
if(this.data.getDataArray().length > 0){
this.pageModel.compList.addItems(liveReviewDTO.list)
if(this.pageModel.compList.getDataArray().length > 0){
this.pageModel.viewType = ViewType.LOADED;
}else{
this.pageModel.viewType = ViewType.EMPTY
... ... @@ -56,6 +64,13 @@ struct ThemeListPage {
.padding({
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onTouch((event: TouchEvent | undefined) => {
if (event) {
if (this.pageModel.viewType === ViewType.LOADED) {
listTouchEvent(this.pageModel, this.pageAdvModel, event);
}
}
})
}
@Builder
LoadingLayout() {
... ... @@ -105,12 +120,12 @@ struct ThemeListPage {
// 下拉刷新
ListItem() {
RefreshLayout({
refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullDown, this.pageModel.pullDownRefreshImage,
this.pageModel.pullDownRefreshText, this.pageModel.pullDownRefreshHeight)
refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullDown, this.pageModel.load,
this.pageModel.offsetY)
})
}
LazyForEach(this.data, (contentDTO: ContentDTO, contentIndex: number) => {
LazyForEach(this.pageModel.compList, (contentDTO: ContentDTO, contentIndex: number) => {
ListItem() {
Column() {
CardParser({ contentDTO });
... ... @@ -119,6 +134,17 @@ struct ThemeListPage {
},
(contentDTO: ContentDTO, contentIndex: number) => contentDTO.pageId + contentIndex.toString()
)
// 加载更多
ListItem() {
if (this.pageModel.hasMore) {
// LoadMoreLayout({
// refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage,
// this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight)
// })
} else if (!this.pageModel.contentNeedScroll) {
PageNoMoreLayout({ noMoreBean: new NoMoreBean(this.pageModel.pageInfo.baselineCopywriting) })
}
}
}
.scrollBar(BarState.Off)
.cachedCount(8)
... ...
... ... @@ -31,24 +31,26 @@ export struct SearchHotsComponent{
build(){
Column(){
Row() {
Image($r('app.media.search_hot_icon'))
.width('46lpx')
.height('46lpx')
.objectFit(ImageFit.Auto)
.margin({right:'8lpx'})
.interpolation(ImageInterpolation.Medium)
if(this.searchHotsData.length>0){
Row() {
Image($r('app.media.search_hot_icon'))
.width('46lpx')
.height('46lpx')
.objectFit(ImageFit.Auto)
.margin({right:'8lpx'})
.interpolation(ImageInterpolation.Medium)
Text("热门搜索")
.textAlign(TextAlign.Center)
.fontWeight(FontWeight.Bold)
.fontSize('33lpx')
.lineHeight('46lpx')
.fontColor($r('app.color.color_222222'))
.height('46lpx')
Text("热门搜索")
.textAlign(TextAlign.Center)
.fontWeight(FontWeight.Bold)
.fontSize('33lpx')
.lineHeight('46lpx')
.fontColor($r('app.color.color_222222'))
.height('46lpx')
}
.width('100%')
.margin({bottom:"15lpx"})
}
.width('100%')
.margin({bottom:"15lpx"})
List(){
ForEach(this.searchHotsData,(item:SearchHotContentItem,index:number)=>{
... ...
... ... @@ -172,7 +172,7 @@ export struct SearchResultContentComponent{
relId: value.data.relId,
relType: value.data.relType,
newsTitle: value.data.titleLiteral,
publishTime: value.data.publishTime,
publishTime: StringUtils.isNotEmpty(value.data.firstPublishTime)?value.data.firstPublishTime:value.data.publishTime,
visitorComment: -1,
fullColumnImgUrls: photos,
newsSummary: "",
... ...
... ... @@ -41,7 +41,7 @@ export struct BigPicCardComponent {
Text(this.compDTO.operDataList[0].newsTitle)
.fontSize(17)
.fontColor('#222222')
.maxLines(3)
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.align(Alignment.Start)
//大图
... ...
... ... @@ -70,6 +70,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
.textAlign(TextAlign.Start)
.margin({ top: 8 })
.width(150)
.lineHeight(17)
}
}
.padding({ left: (index == 0) ? 16 : 0, right: (index == this.compDTO.operDataList.length - 1) ? 16 : 0 })
... ...
... ... @@ -27,7 +27,7 @@ export struct LiveHorizontalCardComponent {
.fontWeight(600)
}
if (this.compDTO.dataSourceType === 'LIVE_HORIZONTAL_CARD' || this.compDTO.dataSourceType === 'LIVE_MONTHLY_RANKING') {
if (this.compDTO.dataSourceType === 'LIVE_HORIZONTAL_CARD' || this.compDTO.dataSourceType === 'LIVE_MONTHLY_RANKING' || this.compDTO.dataSourceType === 'OBJECT_POS') {
Row() {
Text("更多")
.fontSize($r("app.float.font_size_14"))
... ...
... ... @@ -22,6 +22,7 @@ import { HttpUrlUtils } from 'wdNetwork/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { PageRepository } from '../../repository/PageRepository';
import { SpConstants } from 'wdConstant/Index';
import { WDShare } from 'wdShare/Index';
const TAG = 'OperRowListView';
... ... @@ -42,6 +43,8 @@ const TAG = 'OperRowListView';
@Preview
@Component
export struct OperRowListView {
private onBack: () => void = () => {
}
@Prop @Watch('onDetailUpdated') contentDetailData: ContentDetailDTO // 稿件详情
@State operationButtonList: string[] = ['comment', 'collect', 'share'] // 组件展示条件
@ObjectLink publishCommentModel: publishCommentModel
... ... @@ -49,13 +52,16 @@ export struct OperRowListView {
@State interactData: InteractDataDTO = {} as InteractDataDTO
@State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
@State likeBean: Record<string, string> = {}
@State audioUrl: string= ''
@State audioUrl: string = ''
@State bgColor: ResourceColor = Color.White
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
needLike: boolean = true
// async aboutToAppear() {
async onDetailUpdated() {
if (!this.contentDetailData) return
if (!this.contentDetailData) {
return
}
const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
if (user_id) {
this.getInteractDataStatus()
... ... @@ -98,6 +104,9 @@ export struct OperRowListView {
}
.hoverEffect(HoverEffect.Scale)
.onClick(() => {
if (this.onBack) {
this.onBack()
}
router.back();
})
.width(42)
... ... @@ -123,7 +132,7 @@ export struct OperRowListView {
.justifyContent(FlexAlign.Start)
}
.width('100%')
.backgroundColor(Color.White)
.backgroundColor(this.bgColor)
.padding({
top: 10,
// bottom: `${this.bottomSafeHeight}px`
... ... @@ -173,7 +182,8 @@ export struct OperRowListView {
builderCollect() {
Column() {
Stack({ alignContent: Alignment.TopEnd }) {
Image(this.newsStatusOfUser?.collectStatus == 1 ? $r('app.media.ic_collect_check') : $r('app.media.iv_live_comment_collect_un'))
Image(this.newsStatusOfUser?.collectStatus == 1 ? $r('app.media.ic_collect_check') :
$r('app.media.iv_live_comment_collect_un'))
.width(24)
.height(24)
.interpolation(ImageInterpolation.High)
... ... @@ -225,12 +235,17 @@ export struct OperRowListView {
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
.onClick((event: ClickEvent) => {
ToastUtils.showToast('分享为公共方法,待开发', 1000);
// ToastUtils.showToast('分享为公共方法,待开发', 1000);
this.share()
})
}
.width(42)
}
share() {
WDShare.shareContent(this.contentDetailData)
}
// 已登录->查询用户对作品收藏状态
private async getInteractDataStatus() {
try {
... ... @@ -273,7 +288,7 @@ export struct OperRowListView {
PageRepository.postExecuteCollectRecord(params).then(res => {
if (this.newsStatusOfUser) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
if(this.newsStatusOfUser.collectStatus === 1){
if (this.newsStatusOfUser.collectStatus === 1) {
promptAction.showToast({ message: '收藏成功' })
}
this.queryContentInteractCount()
... ... @@ -299,7 +314,8 @@ export struct OperRowListView {
this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum)
this.interactData.commentNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.commentNum)
// 评论组件需要数据
if (Number.parseInt(this.interactData.commentNum) > Number.parseInt(this.publishCommentModel.totalCommentNumer)) {
if (Number.parseInt(this.interactData.commentNum) >
Number.parseInt(this.publishCommentModel.totalCommentNumer)) {
this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + '' || '0'
}
}
... ...
... ... @@ -180,7 +180,7 @@ export class PageRepository {
* 早晚报pageInfo请求
* */
static getMorningEveningPageInfoUrl(pageId: string) {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_PAGE_INFO_PATH;
let url = HttpUrlUtils.getHost() + HttpUrlUtils.PAGE_INFO_PATH;
url = url + "?pageId=" + pageId;
Logger.info(TAG, "getMorningEveningPageInfoUrl url = " + url)
return url;
... ...
... ... @@ -4,7 +4,7 @@ import PageModel from '../viewmodel/PageModel';
import PageHelper from '../viewmodel/PageHelper';
import PageAdModel from '../viewmodel/PageAdvModel';
import { LoadStatus } from '../components/refresh/RefreshLayoutBean';
//下拉刷新上拉加载更多组件
export function listTouchEvent(pageModel: PageModel, pageAdvModel: PageAdModel, event: TouchEvent) {
switch (event.type) {
case TouchType.Down:
... ...
... ... @@ -5,6 +5,17 @@ import { LiveDetailsBean, ReserveBean } from 'wdBean/Index';
const TAG = 'LiveModel'
interface ReserveRes {
code: string | number,
data: ReserveItem[]
}
interface ReserveItem {
liveId: number,
relationId: string,
subscribe: boolean
}
export class LiveModel {
/**
* 直播内容详情
... ... @@ -46,6 +57,9 @@ export class LiveModel {
params['relationId'] = relationId
params['liveId'] = liveId
params['isSubscribe'] = `${isSubscribe}`
Logger.info('relationId', relationId)
Logger.info('liveId', liveId)
Logger.info('isSubscribe', typeof isSubscribe)
return new Promise<ResponseDTO<string>>((success, fail) => {
HttpRequest.post<ResponseDTO<string>>(
HttpUrlUtils.getLiveAppointmentUrl(),
... ... @@ -74,17 +88,21 @@ export class LiveModel {
static getAppointmentStatus(reserveBean: ReserveBean[]) {
// let params: Record<string, ArrayList<ReserveBean>> = {};
// params = reserveBean
return new Promise<ResponseDTO<string>>((success, fail) => {
HttpRequest.post<ResponseDTO<string>>(
return new Promise<Array<ReserveItem>>((success, fail) => {
HttpRequest.post<ResponseDTO<Array<ReserveItem>>>(
HttpUrlUtils.getAppointmentStatusUrl(),
reserveBean,
).then((data: ResponseDTO<string>) => {
).then((data: ResponseDTO<Array<ReserveItem>>) => {
if (!data || !data.data) {
fail("数据为空")
return
}
if (data.code != 0) {
fail(data.message)
ToastUtils.shortToast(data.message)
return
}
success(data)
success(data.data)
}, (error: Error) => {
fail(error.message)
Logger.debug(TAG + ":error ", error.toString())
... ...
... ... @@ -51,20 +51,36 @@ export class PageHelper {
getPageInfo(pageModel: PageModel, pageAdvModel: PageAdModel) {
pageModel.currentPage = 1;
PageViewModel.getPageInfo(pageModel.pageId).then(pageInfo => {
if (pageInfo == null) {
if(pageModel.pageType == 1){
PageViewModel.postThemeList(pageModel.currentPage, pageModel.pageSize,pageModel.extra).then((liveReviewDTO) => {
if(liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0){
pageModel.viewType = ViewType.EMPTY;
pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1;
return;
}else{
//更新数据
pageModel.compList.addItems(liveReviewDTO.list);
closeRefresh(pageModel, true);
}
}).catch((err: string | Resource) => {
promptAction.showToast({ message: err });
})
}else{
PageViewModel.getPageInfo(pageModel.pageId).then(pageInfo => {
if (pageInfo == null) {
pageModel.viewType = ViewType.EMPTY;
pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1;
return;
}
pageModel.pageInfo = pageInfo;
//解析广告资源
pageAdvModel.analysisAdvSource(pageInfo);
this.parseGroup(pageModel)
}).catch(() => {
pageModel.viewType = ViewType.EMPTY;
pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1;
return;
}
pageModel.pageInfo = pageInfo;
//解析广告资源
pageAdvModel.analysisAdvSource(pageInfo);
this.parseGroup(pageModel)
}).catch(() => {
pageModel.viewType = ViewType.EMPTY;
pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_ContentFailed;
})
pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_ContentFailed;
})
}
}
... ... @@ -292,31 +308,50 @@ export class PageHelper {
* comp加载更多,分页加载
*/
private compLoadMore(pageModel: PageModel) {
PageViewModel.getPageData(pageModel.bizCopy())
.then((data: PageDTO) => {
pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()
if (data == null || data.compList == null || data.compList.length == 0) {
//聚合页
if(pageModel.pageType == 1){
PageViewModel.postThemeList(pageModel.currentPage, pageModel.pageSize,pageModel.extra).then((liveReviewDTO) => {
if(liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0){
pageModel.hasMore = false;
} else {
return;
}else{
//更新数据
pageModel.compList.addItems(liveReviewDTO.list);
// 直接认为有分页,一直加载分页。直到没有数据,再停止
pageModel.currentPage++;
pageModel.hasMore = true;
let sizeBefore: number = pageModel.compList.size();
//移除音频 和 活动
this.collectPageComp(pageModel, data)
// pageModel.compList.push(...data.compList)
// TODO 暂时屏蔽,此处代码会造成 广告逻辑错乱,只有第一页有广告数据,随着加载更多,第二页也会出现广告数据
// PageViewModel.getInteractData(data.compList).then((data: CompDTO[]) => {
// // 刷新,替换所有数据
// pageModel.compList.updateItems(sizeBefore, data)
// pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()
// })
pageModel.pageTotalCompSize = liveReviewDTO.list.length + pageModel.pageTotalCompSize
}
}).catch((err: string | Resource) => {
promptAction.showToast({ message: err });
})
promptAction.showToast({ message: err });
})
}else{
PageViewModel.getPageData(pageModel.bizCopy())
.then((data: PageDTO) => {
pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()
if (data == null || data.compList == null || data.compList.length == 0) {
pageModel.hasMore = false;
} else {
// 直接认为有分页,一直加载分页。直到没有数据,再停止
pageModel.currentPage++;
pageModel.hasMore = true;
let sizeBefore: number = pageModel.compList.size();
//移除音频 和 活动
this.collectPageComp(pageModel, data)
// pageModel.compList.push(...data.compList)
// TODO 暂时屏蔽,此处代码会造成 广告逻辑错乱,只有第一页有广告数据,随着加载更多,第二页也会出现广告数据
// PageViewModel.getInteractData(data.compList).then((data: CompDTO[]) => {
// // 刷新,替换所有数据
// pageModel.compList.updateItems(sizeBefore, data)
// pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()
// })
}
}).catch((err: string | Resource) => {
promptAction.showToast({ message: err });
})
}
}
... ...
... ... @@ -7,6 +7,7 @@ import { GroupInfoDTO, PageInfoDTO } from 'wdBean/src/main/ets/bean/navigation/P
import { AdvRuleBean, CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean';
import { WDViewDefaultType } from '../components/view/EmptyComponent';
import { LoadStatus } from '../components/refresh/RefreshLayoutBean';
import { BaseDTO } from 'wdBean/src/main/ets/bean/component/BaseDTO';
/**
* 页面下拉刷新、上拉加载数据bean。
... ... @@ -22,7 +23,7 @@ export default class PageModel {
groupList: GroupInfoDTO[] = [];
// 当前请求数据的group
groupData: GroupInfoDTO = {} as GroupInfoDTO;
compList: LazyDataSource<CompDTO> = new LazyDataSource();
compList: LazyDataSource<BaseDTO> = new LazyDataSource();
// 是否comp自己处理分页加载;默认是最后一个comp下的content有分页数据,需要节目内容的分页加载
// (如:首页-视频tab-直播tab,最后一个comp是直播回看列表,视频内容需要分页加载)
contentNeedScroll: boolean = false;
... ... @@ -58,7 +59,10 @@ export default class PageModel {
// 记录已经展示的稿件和组件数量
pageTotalCompSize: number = 0;
//0默认信息流,1聚合页
pageType: number = 0;
extra: string = ''
/**
* 简单复制业务数据
*/
... ...
... ... @@ -380,7 +380,7 @@ export class PageViewModel extends BaseViewModel {
})
}
async postThemeList(sort: number, pageNum: number, pageSize: number,extra: string) : Promise<LiveReviewDTO> {
async postThemeList(pageNum: number, pageSize: number,extra: string) : Promise<LiveReviewDTO> {
let bean: GoldenPositionExtraBean = JSON.parse(extra)
bean.pageNum = pageNum
bean.pageSize = pageSize
... ...
... ... @@ -43,6 +43,8 @@ export struct DetailPlayLiveCommon {
}
.height('100%')
.width('100%')
.backgroundColor(Color.Black)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
getLiveDetails() {
... ...
import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index';
import { ContentDetailDTO, LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index';
import { LiveViewModel } from '../viewModel/LiveViewModel';
import { TabComponent } from '../widgets/details/TabComponent';
import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet';
... ... @@ -9,6 +9,9 @@ import { router, window } from '@kit.ArkUI';
import { devicePLSensorManager } from 'wdDetailPlayApi/Index';
import { LiveCommentComponent } from 'wdComponent/Index';
import { WDPlayerController } from 'wdPlayer/Index';
import { OperRowListView } from 'wdComponent/src/main/ets/components/view/OperRowListView';
import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
import { ResponseDTO } from 'wdNetwork/Index';
let TAG: string = 'DetailPlayLivePage';
... ... @@ -29,6 +32,8 @@ export struct DetailPlayLivePage {
@Consume @Watch('onPageShowCus') pageShow: number
@Consume @Watch('onPageHideCus') pageHide: number
@Consume @Watch('onBackPressCus') pageBackPress: number
@State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
@State publishCommentModel: publishCommentModel = new publishCommentModel()
aboutToAppear(): void {
Logger.info(TAG, `wyj-aboutToAppear`)
... ... @@ -43,6 +48,7 @@ export struct DetailPlayLivePage {
})
this.getLiveDetails()
this.getLiveRoomData()
this.getContentDetail()
}
build() {
... ... @@ -52,8 +58,17 @@ export struct DetailPlayLivePage {
TabComponent({ tabs: this.tabs })
.layoutWeight(503)
.visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum })
OperRowListView({
operationButtonList: ['comment', 'collect', 'share', 'like'],
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
})
.visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
// LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum })
// .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
}
.height('100%')
.width('100%')
... ... @@ -91,6 +106,28 @@ export struct DetailPlayLivePage {
return true
}
/**
* 查询视频详情用于评论展示
*/
getContentDetail() {
this.liveViewModel.getContentDetail(this.contentId, this.relId, this.relType)
.then((data: Array<ContentDetailDTO>) => {
console.log(TAG, 'getContentDetail:', JSON.stringify(data))
if (data) {
this.contentDetailData = data?.[0];
if (this.contentDetailData?.openComment) {
this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId)
this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType)
this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId)
this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle)
this.publishCommentModel.targetType = String(this.contentDetailData?.newsType)
}
}
})
}
getLiveDetails() {
this.liveViewModel.getLiveDetails(this.contentId, this.relId, this.relType)
.then(
... ...
... ... @@ -86,7 +86,6 @@ export struct DetailPlayVLivePage {
.width(40)
.aspectRatio(1)
.visibility(this.swiperIndex === 0 ? Visibility.Visible : Visibility.Hidden)
.animation({ duration: 500 })
.position({ x: '100%', y: '100%' })
.markAnchor({ x: 56, y: 56 })
.onClick(() => {
... ... @@ -107,7 +106,8 @@ export struct DetailPlayVLivePage {
(data) => {
if (data.length > 0) {
this.liveDetailsBean = data[0]
this.liveState = this.liveDetailsBean.liveInfo?.liveState //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
this.liveState =
this.liveDetailsBean.liveInfo?.liveState //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) {
this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url
}
... ...
import { HttpUrlUtils, ResponseDTO } from 'wdNetwork';
import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
import { Logger, ToastUtils } from 'wdKit';
import { LiveDetailsBean, LiveRoomBean, LiveRoomDataBean } from 'wdBean/Index';
import { ContentDetailDTO, LiveDetailsBean, LiveRoomBean, LiveRoomDataBean } from 'wdBean/Index';
import { ContentDetailRequest } from 'wdDetailPlayApi/Index';
const TAG = 'LiveModel'
export class LiveModel {
getContentDetail(contentId: string, relId: string, relType: string) {
return new Promise<Array<ContentDetailDTO>>((success, fail) => {
ContentDetailRequest.getContentDetail({
contentId: contentId,
relId: relId,
relType: relType
}).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
if (resDTO.data) {
success(resDTO.data)
}
}).catch(() => {
fail("数据为空")
})
})
}
/**
* 直播内容详情
* @param contentId
... ...
import { LiveDetailsBean, LiveRoomBean, LiveRoomDataBean } from 'wdBean/Index'
import { ContentDetailDTO, LiveDetailsBean, LiveRoomBean, LiveRoomDataBean } from 'wdBean/Index'
import { ResponseDTO } from 'wdNetwork/Index'
import { LiveModel } from './LiveModel'
... ... @@ -11,6 +12,45 @@ export class LiveViewModel {
this.liveModel = new LiveModel()
}
// 视频信息
getContentDetail(contentId: string, relId: string, relType: string) {
return new Promise<Array<ContentDetailDTO>>((success, fail) => {
this.liveModel.getContentDetail(contentId, relId, relType).then((data) => {
success(data)
}).catch((message: string) => {
fail(message)
})
})
}
// async getContentDetail(contentId: string, relId: string, relType: string) {
// return ContentDetailRequest.getContentDetail({
// contentId: contentId,
// relId: relId,
// relType: relType
// }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
// console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
// if (resDTO.data) {
//
// this.contentDetailData = resDTO.data?.[0];
//
// if (this.contentDetailData?.openComment) {
// this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
// this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId)
// this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
// this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType)
// this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId)
// this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle)
// this.publishCommentModel.targetType = String(this.contentDetailData?.newsType)
// }
//
//
// }
// })
// }
//直播详情
getLiveDetails(contentId: string, relId: string, relType: string) {
return new Promise<Array<LiveDetailsBean>>((success, fail) => {
... ...
import { LiveDetailsBean, LiveRoomDataBean, LiveRoomItemBean } from 'wdBean/Index'
import { Action, ContentDetailDTO, LiveDetailsBean, LiveRoomDataBean, LiveRoomItemBean } from 'wdBean/Index'
import { LiveCommentComponent } from 'wdComponent/Index'
import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'
import { OperRowListView } from 'wdComponent/src/main/ets/components/view/OperRowListView'
import PageModel from 'wdComponent/src/main/ets/viewmodel/PageModel'
import { DisplayDirection, ViewType } from 'wdConstant/Index'
import { ContentDetailRequest } from 'wdDetailPlayApi/Index'
import { ResponseDTO } from 'wdNetwork/Index'
import { LiveViewModel } from '../../viewModel/LiveViewModel'
import { ChartItemCompereComponent } from './ChartItemCompereComponent'
import { ChatItemComponent } from './ChartItemComponent'
import { router } from '@kit.ArkUI'
import { WindowModel } from 'wdKit/Index'
const TAG = "PlayerCommentComponent"
@Component
export struct PlayerCommentComponent {
... ... @@ -15,10 +22,25 @@ export struct PlayerCommentComponent {
@Consume displayDirection: DisplayDirection
@State private pageModel: PageModel = new PageModel()
@State liveChatList: Array<LiveRoomItemBean> = []
@State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
@State publishCommentModel: publishCommentModel = new publishCommentModel()
@State contentId: string = ''
@State relId: string = ''
@State relType: string = ''
scroller: Scroller = new Scroller()
aboutToAppear(): void {
this.getLiveChatList()
const action: Action = router.getParams() as Action
if (action) {
this.contentId = action.params?.contentID || ''
if (action.params && action.params.extra) {
this.relId = action.params.extra.relId || ''
this.relType = action.params.extra.relType || ''
}
this.getContentDetail(this.contentId, this.relId, this.relType)
}
}
liveDetailsBeanChange() {
... ... @@ -58,6 +80,32 @@ export struct PlayerCommentComponent {
})
}
async getContentDetail(contentId: string, relId: string, relType: string) {
await ContentDetailRequest.getContentDetail({
contentId: contentId,
relId: relId,
relType: relType
}).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
if (resDTO.data) {
this.contentDetailData = resDTO.data?.[0];
if (this.contentDetailData?.openComment) {
this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId)
this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType)
this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId)
this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle)
this.publishCommentModel.targetType = String(this.contentDetailData?.newsType)
}
}
})
}
build() {
Column() {
List({ scroller: this.scroller }) {
... ... @@ -76,9 +124,21 @@ export struct PlayerCommentComponent {
.scrollBar(BarState.Off)
.margin({ bottom: 20 })
LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum })
OperRowListView({
bgColor: Color.Transparent,
operationButtonList: ['comment', 'collect', 'share', 'like'],
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
onBack: () => {
WindowModel.shared.setWindowLayoutFullScreen(false)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}
})
.visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
.backgroundColor(Color.Black)
// LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum })
// .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
// .backgroundColor(Color.Black)
}.alignItems(HorizontalAlign.Start)
}
... ...
... ... @@ -10,6 +10,8 @@ export struct PlayerComponent {
@Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean
@Consume @Watch('pageShowChange') pageShow: number
@Consume @Watch('pageHideChange') pageHide: number
@Consume isShowControl: boolean
@Consume liveState: string
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State imgUrl: string = ''
... ... @@ -36,8 +38,7 @@ export struct PlayerComponent {
}
aboutToDisappear(): void {
this.playerController.onCanplay = () => {
}
this.playerController?.pause()
this.playerController?.stop()
this.playerController?.release()
... ... @@ -92,6 +93,11 @@ export struct PlayerComponent {
.width('100%')
.align(Alignment.Top)
.alignContent(Alignment.Top)
.onClick(() => {
if (this.liveState === 'end') {
this.isShowControl = !this.isShowControl
}
})
}
.height('100%')
.width('100%')
... ...
... ... @@ -26,11 +26,11 @@ export struct PlayerInfoComponent {
.width('100%')
.height('100%')
.index(this.swiperIndex)
.onClick(() => {
if (this.liveState === 'end') {
this.isShowControl = !this.isShowControl
}
})
// .onClick(() => {
// if (this.liveState === 'end') {
// this.isShowControl = !this.isShowControl
// }
// })
.onChange((index) => {
this.swiperIndex = index
})
... ...
... ... @@ -29,7 +29,7 @@ export struct VideoChannelDetail {
private groupId: string = '' // 楼层id
private pageId: string = '' //页面id
private pageNum: number = 1
private pageSize: number = 10
private pageSize: number = 5
private loadStrategy: string = 'first_load' // 首次加载: first_load, 上推刷新: push_up, 下拉刷新: pull_down
private refreshTime: number = new Date().getTime() // 第一页刷新时间,用于频道分页排序时过滤,查询时携带【首刷、下拉取当前最新时间;其他的都使用首刷的时间】
private channelId: string = '' // 频道id
... ...
... ... @@ -56,11 +56,11 @@ export struct DetailDialog {
.width('100%')
.alignItems(HorizontalAlign.Start)
// .backgroundColor('#80000000')
// .linearGradient({
// direction: GradientDirection.Top, // 渐变方向
// repeating: false, // 渐变颜色是否重复
// colors: [['rgba(0, 0, 0, 0.1)', 0.0], ['rgba(0, 0, 0, 0)', 1.0]] // 数组末尾元素占比小于1时满足重复着色效果
// })
.linearGradient({
direction: GradientDirection.Bottom, // 渐变方向
colors: [['rgba(0,0,0,0)', 0.1], ['#000000', 0.66],
['#000000', 1.0]] // 数组末尾元素占比小于1时满足重复着色效果
})
.padding({
top: 20,
bottom: 30,
... ...
... ... @@ -5,7 +5,7 @@ import router from '@ohos.router'
import { WDRouterRule, WDRouterPage } from 'wdRouter';
import { SettingPasswordParams } from './SettingPasswordLayout'
import { Router } from '@ohos.arkui.UIContext'
import { CustomToast, EmitterEventId, EmitterUtils, SPHelper, ToastUtils } from 'wdKit/Index'
import { CustomToast, EmitterEventId, EmitterUtils, NetworkUtil, SPHelper, ToastUtils } from 'wdKit/Index'
import { SpConstants } from 'wdConstant/Index'
import { emitter } from '@kit.BasicServicesKit'
... ... @@ -128,7 +128,12 @@ struct ForgetPasswordPage {
this.isCodeSend=false
Logger.debug(TAG, "sendVerifyCode: " + verifyCode)
}).catch((message: string)=>{
this.showToastTip(message)
let netStatus = NetworkUtil.isNetConnected()
if (netStatus) {
this.showToastTip(message)
} else {
this.showToastTip("验证码获取失败,请重新尝试")
}
this.codeStateSuccess=false
this.isCodeSend=false
})
... ...
... ... @@ -13,12 +13,25 @@ export struct LoginInputComponent {
pageType?:number; //0、登录->忘记密码 1、设置->重置密码 2、设置->更换手机号页面1 3、设置->更换手机号页面2
lastTime: number = 0
@Link @Watch('startCount') codeStateSuccess: boolean //验证码获取成功与否回调 成功显示倒计时
@Watch('onCheckChange') @Prop protocolState: boolean = false //协议勾选状态
@State isNeedProtocol:boolean = false
build() {
Column() {
this.addCodeLayout()
}.width('100%').padding({ left: 25, right: 25 })
}
onCheckChange(){
if(this.isNeedProtocol){
if(this.protocolState && this.phoneContent.length >= 11){
this.codeBtnState = true
}else{
this.codeBtnState = false
}
}
}
async aboutToAppear(){
if (this.pageType == 1) {
this.phoneContent = await SPHelper.default.get(SpConstants.USER_PHONE,"") as string;
... ... @@ -27,7 +40,7 @@ export struct LoginInputComponent {
@Builder
addCodeLayout() {
if (this.pageType == 1){
TextInput({ placeholder: this.securityPhone(this.phoneContent) })
TextInput({ text: this.securityPhone(this.phoneContent) })
.placeholderColor("#CCCCCC")
.fontSize(16)
.height(48)
... ... @@ -59,10 +72,19 @@ export struct LoginInputComponent {
.onChange((content) => {
this.phoneContent = content
this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 4)
if (content.length >= 11) {
this.codeBtnState = true
} else {
this.codeBtnState = false
if(this.isNeedProtocol){
if (content.length >= 11 && this.protocolState) {
this.codeBtnState = true
} else {
this.codeBtnState = false
}
}else{
if (content.length >= 11 ) {
this.codeBtnState = true
} else {
this.codeBtnState = false
}
}
})
}
... ... @@ -97,6 +119,12 @@ export struct LoginInputComponent {
if (this.phoneContent.length < 11) {
return
}
if(this.isNeedProtocol){
if (!this.protocolState ) {
return
}
}
let currentTime = DateTimeUtils.getTimeStamp()
if (currentTime - this.lastTime < 500) {
return
... ...
import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils,CustomToast, StringUtils } from 'wdKit'
import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils,CustomToast, StringUtils, NetworkUtil } from 'wdKit'
import { CustomProtocolDialog } from './CustomProtocolDialog'
import router from '@ohos.router'
import { LoginViewModel } from './LoginViewModel'
... ... @@ -106,7 +106,9 @@ struct LoginPage {
codeContent: $codeContent,
isSubmit: $isSubmit,
isCodeSend: $isCodeSend,
codeStateSuccess:$codeStateSuccess
codeStateSuccess:$codeStateSuccess,
protocolState:this.protocolState,
isNeedProtocol:true
})
} else {
this.addPassword()
... ... @@ -347,7 +349,12 @@ struct LoginPage {
this.codeStateSuccess=true
this.isCodeSend=false
}).catch((message:string)=>{
this.showToastTip(message)
let netStatus = NetworkUtil.isNetConnected()
if (netStatus) {
this.showToastTip(message)
} else {
this.showToastTip("验证码获取失败,请重新尝试")
}
this.codeStateSuccess=false
this.isCodeSend=false
Logger.debug(TAG, "sendVerifyCode: " + message)
... ...
{
"hvigorVersion": "file:../dependencies/hvigor-4.1.2.tgz",
"hvigorVersion": "file:../dependencies/hvigor-4.3.0.tgz",
"dependencies": {
"@ohos/hvigor-ohos-plugin": "file:../dependencies/hvigor-ohos-plugin-4.1.2.tgz",
"@ohos/hvigor-ohos-plugin": "file:../dependencies/hvigor-ohos-plugin-4.3.0.tgz",
"rollup": "file:../dependencies/rollup.tgz",
},
"execution": {
... ...
... ... @@ -21,7 +21,7 @@ struct MainPage {
}
aboutToAppear() {
HWLocationUtils.startLocationService()
this.breakpointSystem.register()
let context = getContext(this) as common.UIAbilityContext
... ... @@ -31,6 +31,7 @@ struct MainPage {
// WDPushNotificationManager.getInstance().sendLocalNotification()
}
HWLocationUtils.startLocationService()
})
Logger.info(TAG, `aboutToAppear `);
... ...
... ... @@ -17,7 +17,7 @@ struct MorningEveningPaperPage {
pageTransition() {
// 定义页面进入时的效果,从底侧滑入
PageTransitionEnter({ type: RouteType.None, duration: 300 })
PageTransitionEnter({ type: RouteType.Push, duration: 300 })
.slide(SlideEffect.Bottom).onEnter((type: RouteType, progress: number) => {
if (progress >= 0.99) {
WindowModel.shared.setWindowLayoutFullScreen(true)
... ... @@ -25,7 +25,7 @@ struct MorningEveningPaperPage {
}
})
// 定义页面退出时的效果,向底侧滑出
PageTransitionExit({ type: RouteType.None, duration: 300 })
PageTransitionExit({ type: RouteType.Pop, duration: 300 })
.slide(SlideEffect.Bottom)
}
... ...