yangsunyue_wd
Showing 69 changed files with 659 additions and 236 deletions
... ... @@ -12,6 +12,8 @@ export class ContentConstants {
* 2:直播
*/
static readonly TYPE_LIVE: string = "2";
static readonly TYPE_FOUR: string = "4";
/**
* 5:专题详情
*/
... ...
... ... @@ -17,6 +17,14 @@ export enum EmitterEventId {
// 关注,取消关注
PEOPLE_SHIP_ATTENTION = 7,
// 我的关注 为null
MY_FOLLOW_EMPTY = 8,
// 登录成功
LOGIN_SUCCESS = 8,
// 换绑成功
PHONE_CHANGE_SUCCESS = 9,
// App回到前台
APP_ENTER_FOREGROUD = 100,
... ...
... ... @@ -441,6 +441,12 @@ export class HttpUrlUtils {
return url;
}
//游客评论合并
static visitorMergeComment() {
let url = HttpUrlUtils.getHost() + "/api/rmrb-comment/comment/zh/c/visitorMerge";
return url;
}
static getAppointmentListDataUrl() {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_LIST_DATA_PATH
return url
... ...
... ... @@ -100,6 +100,9 @@ export class ProcessUtils {
case ContentConstants.TYPE_LIVE:
ProcessUtils.gotoLive(content)
break
case ContentConstants.TYPE_FOUR:
ProcessUtils.gotoDefaultWeb(content);
break
case ContentConstants.TYPE_AUDIO:
ProcessUtils.gotoAudio(content)
break;
... ...
... ... @@ -9,13 +9,17 @@ import router from '@ohos.router';
import Url from '@ohos.url'
import { ContentDTO, PhotoListBean } from 'wdBean';
import { handleJsCallAppService } from './JsCallAppService'
import { HttpUtils } from 'wdNetwork/Index';
const TAG = 'JsBridgeBiz'
class AppInfo {
plat: string = ''
system: string = ''
networkStatus: number = 1
screenStatusBarHeight: number = 40 // TODO 这里需要动态获取
screenTabbarSafeHeight: number = 42 // TODO 这里需要动态获取
imei: string = HttpUtils.getImei()
device_id: string = HttpUtils.getDeviceId()
// TODO 完善
}
... ...
... ... @@ -80,4 +80,6 @@ export interface ContentDTO {
commentInfo?: commentInfo
//底部导航栏 id(用于频道跳转)
bottomNavId:string;
// 链接类型: 0:无链接;1:内链(文章);2:外链
openType:string
}
\ No newline at end of file
... ...
... ... @@ -18,4 +18,5 @@ export interface RmhInfoDTO {
rmhName: string;
userId: string;
userType: string;
honoraryIcon:string;
}
... ...
... ... @@ -44,7 +44,7 @@ export struct CompParser {
@Builder
componentBuilder(compDTO: CompDTO, compIndex: number) {
// if (compDTO.operDataList[0]?.objectType !== '3' && compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口
//if (compDTO.operDataList[0]?.objectType !== '3' && compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口
if (compDTO.compStyle === CompStyle.Label_03) {
LabelComponent({ compDTO: compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
... ... @@ -77,8 +77,8 @@ export struct CompParser {
ZhSingleRow04({ compDTO: compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (compDTO.compStyle === CompStyle.Zh_Single_Row_05) {
ZhSingleRow05({ compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
// ZhSingleRow05({ compDTO })
// Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (compDTO.compStyle === CompStyle.Zh_Single_Row_06) {
ZhSingleRow06({ compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
... ...
import { AccountManagerUtils, Logger, DateTimeUtils, SPHelper, NumberFormatterUtils } from 'wdKit';
import { AccountManagerUtils, Logger, DateTimeUtils, SPHelper, NumberFormatterUtils, DisplayUtils } from 'wdKit';
import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
import { ContentDetailDTO,postBatchAttentionStatusParams,
PhotoListBean,
... ... @@ -53,7 +53,7 @@ export struct DynamicDetailComponent {
//跳转
private mJumpInfo: ContentDTO = {} as ContentDTO;
@State publishCommentModel: publishCommentModel = new publishCommentModel()
async aboutToAppear() {
await this.getContentDetailData()
... ... @@ -83,7 +83,7 @@ export struct DynamicDetailComponent {
Image($r('app.media.ic_news_detail_division'))
.width('100%')
.height($r('app.float.margin_7'))
.margin({left: $r('app.float.margin_16'), right: $r('app.float.margin_16')} )
.padding({left: $r('app.float.margin_16'), right: $r('app.float.margin_16')} )
Stack({ alignContent: Alignment.Bottom }) {
Scroll(this.scroller) {
Column() {
... ... @@ -97,15 +97,29 @@ export struct DynamicDetailComponent {
.height($r('app.float.margin_32'))
.objectFit(ImageFit.Cover)
.borderRadius($r('app.float.margin_16'))
Image($r('app.media.icon_border_test'))
Image(this.contentDetailData.rmhInfo?.honoraryIcon)
.width($r('app.float.margin_48'))
.height($r('app.float.margin_48'))
.objectFit(ImageFit.Cover)
.borderRadius($r('app.float.margin_24'))
if(!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)){
Stack() {
Image(this.contentDetailData.rmhInfo?.authIcon)
.width($r('app.float.vp_12'))
.height($r('app.float.vp_12'))
.objectFit(ImageFit.Cover)
}
.width($r('app.float.margin_48'))
.height($r('app.float.margin_48'))
.alignContent(Alignment.BottomEnd)
}
}
.width($r('app.float.margin_48'))
.height($r('app.float.margin_48'))
.alignContent(Alignment.Center)
.onClick(() => {
ProcessUtils.gotoPeopleShipHomePage(this.contentDetailData.rmhInfo == null ?"":this.contentDetailData.rmhInfo.rmhId)
})
Column(){
//昵称
Text(this.contentDetailData.rmhInfo?.rmhName)
... ... @@ -128,7 +142,7 @@ export struct DynamicDetailComponent {
.margin({right: $r('app.float.margin_6')})
if(!StringUtils.isEmpty(this.followStatus)){
if (this.followStatus == '0') {
Text('关注')
Text('+关注')
.width($r('app.float.margin_54'))
.height($r('app.float.margin_24'))
.textAlign(TextAlign.Center)
... ... @@ -275,8 +289,8 @@ export struct DynamicDetailComponent {
Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)?
this.contentDetailData.fullColumnImgUrls[0].url:
this.contentDetailData.videoInfo[0].firstFrameImageUri)
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(16 / 9)
.width(DisplayUtils.getDeviceWidth()- 32)
.height((DisplayUtils.getDeviceWidth()-32)* 9 / 16)
.borderRadius($r('app.float.image_border_radius'))
CardMediaInfo({ contentDTO: this.mJumpInfo })
}
... ... @@ -291,7 +305,8 @@ export struct DynamicDetailComponent {
Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)?
this.contentDetailData.fullColumnImgUrls[0].url:
this.contentDetailData.videoInfo[0].firstFrameImageUri)
.width(CommonConstants.FULL_WIDTH)
.width(DisplayUtils.getDeviceWidth()/2)
.height(DisplayUtils.getDeviceWidth()/2* 4 / 3)
.borderRadius($r('app.float.image_border_radius'))
CardMediaInfo({ contentDTO: this.mJumpInfo })
}
... ... @@ -299,7 +314,7 @@ export struct DynamicDetailComponent {
}
}
}
.margin({ left: $r('app.float.margin_16'),right: $r('app.float.margin_16'),top: $r('app.float.margin_8')})
.padding({ left: this.contentDetailData.videoInfo[0].videoLandScape === 1?0: 25,top: $r('app.float.margin_8')})
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.mJumpInfo)
})
... ... @@ -311,8 +326,8 @@ export struct DynamicDetailComponent {
.fontSize($r('app.float.font_size_12'))
.lineHeight($r('app.float.margin_16'))
.margin({ top: $r('app.float.margin_16')
,left: $r('app.float.margin_16')
,right: $r('app.float.margin_16') })
,left: $r('app.float.vp_12')
,right: $r('app.float.vp_12') })
//微信/朋友圈/微博
Row(){
Image($r('app.media.xxhdpi_pic_wechat'))
... ... @@ -362,9 +377,17 @@ export struct DynamicDetailComponent {
})
// 评论
if (this.contentDetailData?.openComment) {
Divider().strokeWidth(6).color('#f5f5f5')
Divider().strokeWidth(6).color('#f5f5f5').margin({top:$r('app.float.margin_24')})
CommentComponent({
publishCommentModel: this.publishCommentModel
publishCommentModel: {
targetId: String(this.contentDetailData?.newsId || ''),
targetRelId: this.contentDetailData?.reLInfo?.relId,
targetTitle: this.contentDetailData?.newsTitle,
targetRelType: this.contentDetailData?.reLInfo?.relType,
targetRelObjectId: String(this.contentDetailData?.reLInfo?.relObjectId),
keyArticle: String(this.contentDetailData?.keyArticle),
targetType: String(this.contentDetailData?.newsType),
} as publishCommentModel
})
}
Blank().layoutWeight(1)
... ... @@ -379,7 +402,15 @@ export struct DynamicDetailComponent {
OperRowListView({ contentDetailData: this.contentDetailData
,interactData:this.interactDataDTO
,newsStatusOfUser:this.newsStatusOfUser
,publishCommentModel: this.publishCommentModel
,publishCommentModel: {
targetId: String(this.contentDetailData?.newsId || ''),
targetRelId: this.contentDetailData?.reLInfo?.relId,
targetTitle: this.contentDetailData?.newsTitle,
targetRelType: this.contentDetailData?.reLInfo?.relType,
targetRelObjectId: String(this.contentDetailData?.reLInfo?.relObjectId),
keyArticle: String(this.contentDetailData?.keyArticle),
targetType: String(this.contentDetailData?.newsType),
} as publishCommentModel
,needLike:false})
}
}
... ... @@ -399,17 +430,6 @@ export struct DynamicDetailComponent {
} catch (exception) {
console.log('请求失败',JSON.stringify(exception))
}
if (this.contentDetailData.openComment) {
this.publishCommentModel = {
targetId: String(this.contentDetailData?.newsId || ''),
targetRelId: this.contentDetailData?.reLInfo?.relId,
targetTitle: this.contentDetailData?.newsTitle,
targetRelType: this.contentDetailData?.reLInfo?.relType,
targetRelObjectId: String(this.contentDetailData?.reLInfo?.relObjectId),
keyArticle: String(this.contentDetailData?.keyArticle),
targetType: String(this.contentDetailData?.newsType),
} as publishCommentModel
}
this.getBatchAttentionStatus()
this.getInteractDataStatus()
this.makeJumpInfo()
... ...
... ... @@ -21,7 +21,7 @@ export struct CardMediaInfo {
Row() {
Image($r('app.media.card_play'))
.mediaLogo()
if(this.contentDTO.videoInfo!=null){
if (this.contentDTO.videoInfo != null) {
Text(DateTimeUtils.getFormattedDuration(this.contentDTO.videoInfo.videoDuration * 1000))
.mediaText()
}
... ... @@ -30,7 +30,7 @@ export struct CardMediaInfo {
// liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
// 显示直播信息
Row() {
if(this.contentDTO.liveInfo.liveState === 'wait') {
if (this.contentDTO.liveInfo.liveState === 'wait') {
Image($r('app.media.card_wait'))
.mediaLogo()
Text('预约')
... ... @@ -45,7 +45,7 @@ export struct CardMediaInfo {
.mediaLogo()
Text('回看')
.mediaText()
} else if(this.contentDTO.liveInfo.liveState === 'end' && this.contentDTO.liveInfo
} else if (this.contentDTO.liveInfo.liveState === 'end' && this.contentDTO.liveInfo
.replayUri) {
// Image($r('app.media.card_live'))
// .mediaLogo()
... ... @@ -69,6 +69,15 @@ export struct CardMediaInfo {
Text(DateTimeUtils.getFormattedDuration(this.contentDTO.voiceInfo.voiceDuration * 1000))
.mediaText()
}
} else if (this.contentDTO.objectType === '4') {//广告标签
Text($r('app.string.comp_advertisement'))
.fontSize('10fp')
.fontColor($r('app.color.white'))
.width(28)
.height(16)
.backgroundColor('#4D000000')
.borderRadius(3)
.textAlign(TextAlign.Center)
}
}
.margin(6)
... ...
... ... @@ -20,14 +20,12 @@ export struct CardAdvBigImageComponent {
aboutToAppear(): void {
console.error('ZZZXXXXX', '----大图卡----aboutToAppear-----')
}
aboutToDisappear(): void {
console.error('ZZZXXXXX', '---大图卡-----aboutToDisappear-----')
}
build() {
... ...
... ... @@ -25,8 +25,6 @@ export struct CardAdvGanMiComponent {
aboutToAppear(): void {
console.error('ZZZXXXXX', '--冠名广告------aboutToAppear-----')
let extraData = this.compDTO.matInfo.extraData
let labelDTO = JSON.parse(extraData) as AdvExtraData
this.advExtraData = labelDTO
... ... @@ -37,7 +35,6 @@ export struct CardAdvGanMiComponent {
aboutToDisappear(): void {
console.error('ZZZXXXXX', '--冠名广告------aboutToDisappear-----')
}
build() {
... ...
... ... @@ -26,14 +26,12 @@ export struct CardAdvLongImageComponent {
aboutToAppear(): void {
console.error('ZZZXXXXX', '--长通栏广告 和 顶部长通栏广告------aboutToAppear-----')
this.haveTitle = this.compDTO.matInfo.advSubType === CompStyle.Card_Adv_7;
}
aboutToDisappear(): void {
console.error('ZZZXXXXX', '--长通栏广告 和 顶部长通栏广告------aboutToDisappear-----')
}
build() {
... ... @@ -42,7 +40,7 @@ export struct CardAdvLongImageComponent {
//新闻标题
if(this.haveTitle ){
Text(this.compDTO.matInfo.advTitle).bottomTextStyle().margin({ bottom: 8, })
Text(this.compDTO.matInfo.advTitle).width('100%').bottomTextStyle().margin({ bottom: 8, })
}
//长图
... ...
... ... @@ -23,7 +23,6 @@ export struct CardAdvSmallImageComponent {
aboutToAppear(): void {
console.error('ZZZXXXXX', '----小图卡----aboutToAppear-----')
// 计算标题文本行数
let screenWith = DisplayUtils.getDeviceWidth();
screenWith = screenWith * 0.62
... ... @@ -33,7 +32,6 @@ export struct CardAdvSmallImageComponent {
aboutToDisappear(): void {
console.error('ZZZXXXXX', '---小图卡-----aboutToDisappear-----')
}
build() {
... ...
... ... @@ -22,12 +22,10 @@ export struct CardAdvThreeImageComponent {
aboutToAppear(): void {
console.error('ZZZXXXXX', '---三图卡-----aboutToAppear-----')
}
aboutToDisappear(): void {
console.error('ZZZXXXXX', '----三图卡----aboutToDisappear-----')
}
build() {
... ...
... ... @@ -22,8 +22,6 @@ export struct CardAdvVideoComponent {
@State contentDTO: ContentDTO = {} as ContentDTO
aboutToAppear(): void {
console.error('ZZZXXXXX', '--视频广告------aboutToAppear-----')
// this.contentDTO.objectType = '1'
// this.contentDTO.videoInfo = { videoDuration: 1000 } as VideoInfoDTO
... ... @@ -31,7 +29,6 @@ export struct CardAdvVideoComponent {
aboutToDisappear(): void {
console.error('ZZZXXXXX', '---视频广告-----aboutToDisappear-----')
}
build() {
... ...
... ... @@ -21,7 +21,6 @@ export struct CardAdvVideoExComponent {
aboutToAppear(): void {
console.error('ZZZXXXXX', '--展会广告------aboutToAppear-----')
let extraData = this.compDTO.matInfo.extraData
let labelDTO = JSON.parse(extraData) as AdvExtraData
... ... @@ -30,7 +29,6 @@ export struct CardAdvVideoExComponent {
aboutToDisappear(): void {
console.error('ZZZXXXXX', '----展会广告----aboutToDisappear-----')
}
build() {
... ...
import { ContentDTO, slideShows } from 'wdBean';
import { CommonConstants } from 'wdConstant'
import { DateTimeUtils } from 'wdKit';
import { CommonConstants } from 'wdConstant';
import { ProcessUtils } from 'wdRouter';
import { CardSourceInfo } from '../cardCommon/CardSourceInfo'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
/**
* 大专题卡--CompStyle: 10
... ... @@ -25,6 +23,9 @@ export struct Card10Component {
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({ bottom: 19 })
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.contentDTO)
})
}
// 大图
Stack() {
... ...
import { ContentDTO, slideShows } from 'wdBean';
import { CommonConstants } from 'wdConstant'
import { CommonConstants } from 'wdConstant';
import { DateTimeUtils } from 'wdKit';
import { ProcessUtils } from 'wdRouter';
... ... @@ -104,10 +104,12 @@ export struct Card9Component {
Column() {
Row() {
// 标题
Image($r("app.media.timeline_rect"))
Image($r("app.media.timeAxis"))
.width(9)
.height(9)
.margin({ right: 5 })
.fillColor(item.newsTitleColor)
Text(DateTimeUtils.formatDate(item.publishTime, "MM月dd日 HH:mm"))
.fontSize($r('app.float.font_size_12'))
.fontColor($r('app.color.color_222222'))
... ...
... ... @@ -180,7 +180,7 @@ struct CarouselLayout01CardView {
})
Column() {
// 这里用于展示轮播图右上角信息,这里只对直播类型的展示
if (this.item.objectType === '2') {
if (this.item.objectType === '2' || this.item.objectType ==='4') {
CardMediaInfo({ contentDTO: this.item })
.width(CommonConstants.FULL_PARENT)
}
... ...
... ... @@ -19,7 +19,7 @@ export struct FollowChildComponent{
Row() {
Row(){
Stack({alignContent: Alignment.Bottom}){
Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl)
Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.icon_default_head_mater'):this.data.headPhotoUrl)
.objectFit(ImageFit.Auto)
.width('92lpx')
.height('92lpx')
... ... @@ -128,7 +128,7 @@ export struct FollowChildComponent{
Row() {
Row(){
Stack({alignContent: Alignment.Bottom}){
Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl)
Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.icon_default_head_mater'):this.data.headPhotoUrl)
.objectFit(ImageFit.Auto)
.width('92lpx')
.height('92lpx')
... ...
import { EmitterUtils, EmitterEventId, Logger } from 'wdKit/Index'
import MinePageDatasModel from '../../../model/MinePageDatasModel'
import { FollowListItem } from '../../../viewmodel/FollowListItem'
import { CustomTitleUI } from '../../reusable/CustomTitleUI'
... ... @@ -20,17 +21,27 @@ export struct FollowFirstTabsComponent{
})
if(this.controller != null && this.data.length>1 && this.changeIndex === 1){
this.jumpFollowNextPage()
}
}).catch((err:Error)=>{
console.log(TAG,JSON.stringify(err))
})
EmitterUtils.receiveEvent(EmitterEventId.MY_FOLLOW_EMPTY, (() => {
if(this.controller != null && this.data.length>1 ){
this.jumpFollowNextPage()
}
}))
}
jumpFollowNextPage(){
//个人主页 跳转 关注页 tab 2
let intervalID = setInterval(() => {
this.currentIndex = this.changeIndex
this.currentIndex = 1
this.controller.changeIndex(this.currentIndex)
clearInterval(intervalID);
}, 500);
}
}).catch((err:Error)=>{
console.log(TAG,JSON.stringify(err))
})
}
@Builder TabBuilder(index: number, item: FollowListItem) {
Stack(){
... ...
import { LazyDataSource, SPHelper, UserDataLocal } from 'wdKit';
import { EmitterEventId, EmitterUtils, LazyDataSource, SPHelper, UserDataLocal } from 'wdKit';
import MinePageDatasModel from '../../../model/MinePageDatasModel';
import SearcherAboutDataModel from '../../../model/SearcherAboutDataModel';
import { CreatorDetailRequestItem } from '../../../viewmodel/CreatorDetailRequestItem';
... ... @@ -70,7 +70,7 @@ export struct FollowListDetailUI {
Column() {
if (this.count === 0) {
if (this.isGetRequest == true) {
EmptyComponent({ emptyType: 14 })
EmptyComponent({ emptyType: 14,emptyHeight:"100%" })
.layoutWeight(1)
.width('100%')
}
... ... @@ -156,10 +156,12 @@ export struct FollowListDetailUI {
}
this.isLoading = false
this.isGetRequest = true
this.sendFollowMessage()
}).catch((err: Error) => {
console.log(TAG, "请求失败")
this.isGetRequest = true
this.isLoading = false
this.sendFollowMessage()
})
} else {
this.isLoading = false
... ... @@ -167,6 +169,12 @@ export struct FollowListDetailUI {
}
}
sendFollowMessage(){
if(this.count === 0){
EmitterUtils.sendEvent(EmitterEventId.MY_FOLLOW_EMPTY)
}
}
getNewPageData() {
//我的关注列表
if (this.creatorDirectoryId === -1) {
... ... @@ -179,6 +187,7 @@ export struct FollowListDetailUI {
if (!this.data || value.list.length == 0) {
this.hasMore = false
this.isLoading = false
this.isGetRequest = true
} else {
this.getFollowListStatus(value)
}
... ... @@ -226,6 +235,8 @@ export struct FollowListDetailUI {
})
})
this.getFollowStatus(data_temp, result.totalCount)
}else{
this.isGetRequest = true
}
}).catch((err: Error) => {
console.log(TAG, JSON.stringify(err))
... ...
... ... @@ -146,7 +146,7 @@ export struct HomePageBottomComponent{
LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => {
ListItem() {
FollowChildComponent({data: item,type:1})
FollowChildComponent({data: item,type:2})
}
.onClick(() => {
})
... ... @@ -284,6 +284,7 @@ export struct HomePageBottomComponent{
if (!this.data_comment || value.list.length == 0){
this.hasMore = false
this.isLoading = false
this.isGetRequest = true
}else{
this.getCommentListStatus(value)
}
... ...
... ... @@ -101,6 +101,7 @@ export struct OtherHomePageBottomCommentComponent {
if (!this.data_comment || value.list.length == 0) {
this.hasMore = false
this.isLoading = false
this.isGetRequest = true
} else {
this.getCommentListStatus(value)
}
... ...
... ... @@ -449,7 +449,7 @@ struct ChannelDialog {
}.width('100%').height('100%')
.scrollBar(BarState.Off)
}
.padding({ top: 40, right: 15, bottom: 20, left: 15 })
.padding({ top: 40, right: 15, bottom: 40, left: 15 })
.backgroundColor('#ffffff')
}
}
... ... @@ -526,10 +526,9 @@ struct ChannelSubscriptionLayout {
.width(18)
}
.width(36)
.height(36)
.height(40)
.justifyContent(FlexAlign.Center)
.padding({ bottom: 6 })
.backgroundColor('#ffffff')
.backgroundColor(Color.White)
.onClick(() => {
if (this.dialogController != null) {
this.dialogController.open()
... ...
... ... @@ -8,6 +8,7 @@ import MinePageMoreFunctionUI from '../mine/MinePageMoreFunctionUI'
import { SPHelper, StringUtils } from 'wdKit'
import { SpConstants } from 'wdConstant'
import dataPreferences from '@ohos.data.preferences';
import { MergeRecordDialog } from '../../dialog/MergeRecordDialog'
const TAG = 'MinePageComponent';
... ... @@ -30,9 +31,23 @@ export struct MinePageComponent {
this.isLogin = false
}else {
this.isLogin = true
this.addRecordDialog()
}
}
}
mergeDialogController: CustomDialogController = new CustomDialogController({
builder: MergeRecordDialog({
cancel: () => {
this.clearMergeRecord()
},
confirm: () => {
this.dealMergeRecordData()
}
}),
customStyle: true,
alignment: DialogAlignment.Center,
autoCancel: false
})
aboutToAppear(){
this.getUserLogin()
... ... @@ -112,5 +127,29 @@ export struct MinePageComponent {
}
}
addRecordDialog() {
setTimeout(() => {
this.dealMergeRecordDialog()
}, 300)
}
dealMergeRecordDialog() {
let commentTime = SPHelper.default.getSync(SpConstants.FIRSTCOMMENTTIME, "")
if (StringUtils.isNotEmpty(commentTime)) {
this.mergeDialogController.open()
}
}
dealMergeRecordData() {
MinePageDatasModel.visitorMergeComment().then(() => {
this.mergeDialogController.close()
}).catch(() => {
this.mergeDialogController.close()
})
}
clearMergeRecord(){
SPHelper.default.saveSync(SpConstants.FIRSTCOMMENTTIME, "")
}
}
... ...
... ... @@ -5,12 +5,15 @@ import { RefreshConstants } from '../../utils/RefreshConstants'
*/
@Component
export default struct NoMoreLayout {
build() {
Row() {
Column() {
Text($r('app.string.footer_text'))
.margin({ left: RefreshConstants.NoMoreLayoutConstant_NORMAL_PADDING })
.fontSize(RefreshConstants.NoMoreLayoutConstant_TITLE_FONT)
.textAlign(TextAlign.Center)
.fontColor('#CCCCCC')
.margin({bottom:40})
}
.width(RefreshConstants.FULL_WIDTH)
.justifyContent(FlexAlign.Center)
... ...
... ... @@ -246,6 +246,7 @@ export struct PageComponent {
this.pageModel.groupId = this.pageId;
this.pageModel.channelId = this.channelId;
this.pageModel.currentPage = 1;
this.pageModel.pageTotalCompSize = 0;
PageHelper.getInitData(this.pageModel, this.pageAdvModel)
}
}
... ...
... ... @@ -99,8 +99,12 @@ struct PeopleShipHomePage {
}
async aboutToAppear() {
aboutToAppear() {
this.getData()
}
private async getData() {
try {
// 获取页面信息
this.detailModel = await PeopleShipHomePageDataModel.getPeopleShipHomePageDetailInfo(this.creatorId, '', '')
... ... @@ -117,8 +121,6 @@ struct PeopleShipHomePage {
} catch (exception) {
}
}
findFollowStata(followList: QueryListIsFollowedItem[]) {
... ... @@ -156,8 +158,10 @@ struct PeopleShipHomePage {
PageRepository.postInteractAccentionOperate(params).then(res => {
if (this.isAttention == '1') {
this.isAttention = '0'
this.detailModel.fansNum -= 1
} else {
this.isAttention = '1'
this.detailModel.fansNum += 1
}
this.isLoadingAttention = false
})
... ...
... ... @@ -7,6 +7,7 @@ import { FirstTabTopSearchComponent } from '../search/FirstTabTopSearchComponent
import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index';
import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils';
import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent';
import { WDRouterPage, WDRouterRule } from 'wdRouter'
const TAG = 'TopNavigationComponent';
... ... @@ -63,6 +64,8 @@ export struct TopNavigationComponent {
@State indicatorLeftMargin: number = 0
@State indicatorWidth: number = 0
private tabsWidth: number = 0
//定时器延时处理切换至版面、播报tab时 返回上一个tab
@State tabTimmer: number = 0
topOrBottomNavChange() {
if (this.currentBottomNavName === this.currentBottomNavInfo?.name) {
... ... @@ -260,6 +263,9 @@ export struct TopNavigationComponent {
})
.animationDuration(this.animationDuration)
.onChange((index: number) => {
if(this.tabTimmer){
clearTimeout(this.tabTimmer)
}
this.currentTopNavName =
this._currentNavIndex === 0 ? this.myChannelList[index].name : this.topNavList[index].name
Logger.info(TAG, `onChange index : ${index}`);
... ... @@ -271,11 +277,15 @@ export struct TopNavigationComponent {
if (this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) {
// 跳转到播报页面
ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId)
this.tabTimmer = setTimeout(() => {
this.tabsController.changeIndex(this.currentTopNavSelectedIndex)
}, 500)
}
if (this.isLayout(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) {
ProcessUtils.gotoENewsPaper()
this.tabTimmer = setTimeout(() => {
this.tabsController.changeIndex(this.currentTopNavSelectedIndex)
}, 500)
}
})
.onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => {
... ... @@ -326,6 +336,20 @@ export struct TopNavigationComponent {
this.tabsController.changeIndex(index)
}
})
}else {
Row() {
Image($r('app.media.icon_search'))
.width('24vp')
.height('24vp')
}
.height('40vp')
.width('40vp')
.margin({ right: 10 })
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Center)
.onClick(() => {
WDRouterRule.jumpWithPage(WDRouterPage.searchPage)
})
}
}
}
... ...
... ... @@ -24,7 +24,7 @@ import PageAdModel from '../../viewmodel/PageAdvModel';
import PageHelper from '../../viewmodel/PageHelper';
import { PeopleShipAttentionContentListTopComponent } from './PeopleShipAttentionContentListTopComponent'
import { CardParser } from '../CardParser'
import NoMoreLayout from '../page/NoMoreLayout';
import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData';
@Preview
@Component
... ... @@ -161,7 +161,7 @@ export struct PeopleShipMainComponent {
// 加载更多
ListItem() {
if (!this.hasMore && !this.isLoading) {
NoMoreLayout()
PeopleShipNoMoreData()
}
}
}
... ... @@ -280,6 +280,7 @@ export struct PeopleShipMainComponent {
//批量查询各类型内容动态数据接口
this.checkContentInteractData(listData.list, resolve)
} else {
this.hasMore = false;
this.resolveEnd(true, resolve)
}
... ...
import { PeopleShipRecommendHeadComponent } from './PeopleShipRecommendHeadComponent'
import { RmhRecommendDTO } from 'wdBean';
import { Logger } from 'wdKit/Index';
import NoMoreLayout from '../page/NoMoreLayout';
import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData';
@Component
export struct PeopleShipRecommendComponent {
... ... @@ -87,7 +86,8 @@ export struct PeopleShipRecommendComponent {
// 为你推荐
Button(this.rmhSelectedList.length == 0 ? '一键关注' : `一键关注 (${this.rmhSelectedList.length})`, { type: ButtonType.Normal, stateEffect: this.rmhSelectedList.length != 0 })
.margin({
top: '24vp'
top: '24vp',
bottom: '10vp'
})
.width('120vp')
.height('36vp')
... ... @@ -104,7 +104,7 @@ export struct PeopleShipRecommendComponent {
}
})
// 没有更多
NoMoreLayout()
PeopleShipNoMoreData()
}
.width('100%')
}
... ...
... ... @@ -25,12 +25,27 @@ export struct PeopleShipRecommendHeadComponent {
})
}.margin({ top: 12, bottom: 8 })
Row() {
Text(this.rmhInfo.userName)
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.vp_14'))
.fontWeight(600)
.maxLines(1)
.textOverflow({overflow: TextOverflow.Ellipsis})
if (this.rmhInfo.authIcon) {
Image(this.rmhInfo.authIcon)
.width('12vp')
.height('12vp')
.borderRadius(6)
.objectFit(ImageFit.Cover)
.margin({
left: '2vp'
})
}
}
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Center)
Text(this.rmhInfo.introduction)
.fontColor($r('app.color.color_B0B0B0'))
... ...
... ... @@ -18,9 +18,9 @@ import { CardParser } from '../CardParser'
import { PageRepository } from '../../repository/PageRepository'
import { RefreshLayoutBean } from '../page/RefreshLayoutBean'
import CustomRefreshLoadLayout from '../page/CustomRefreshLoadLayout'
import { ErrorComponent } from '../view/ErrorComponent';
import NoMoreLayout from '../page/NoMoreLayout';
import { ErrorComponent } from '../view/ErrorComponent'
import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'
import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData'
const TAG = 'PeopleShipHomeArticleListComponent';
... ... @@ -104,7 +104,7 @@ export struct PeopleShipHomeArticleListComponent {
// 加载更多
ListItem() {
if (!this.hasMore && !this.isLoading) {
NoMoreLayout()
PeopleShipNoMoreData()
}
}
}
... ...
... ... @@ -24,7 +24,7 @@ export struct PeopleShipHomeListComponent {
// 列表
else if (this.publishCount == 0) {
// 无数据展示
EmptyComponent({emptyType: 13}).height(DisplayUtils.getDeviceHeight() - this.topHeight)
EmptyComponent({emptyType: 12}).height(DisplayUtils.getDeviceHeight() - this.topHeight)
} else {
Column() {
Column() {
... ...
import router from '@ohos.router'
import { PeopleShipUserDetailData } from 'wdBean'
import { PeopleShipHomePageHeadComponent } from './PeopleShipHomePageHeadComponent'
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
@Component
export struct PeopleShipHomePageNavComponent {
... ... @@ -38,8 +39,13 @@ export struct PeopleShipHomePageNavComponent {
iconDiameter: 10,
headPhotoUrl: (this.detailModel.headPhotoUrl && this.detailModel.headPhotoUrl.length > 0 ) ? this.detailModel.headPhotoUrl : $r('app.media.WDAccountOwnerHedaerDefaultIcon'),
authIcon: this.detailModel.authIcon
})
.margin({
}).onClick(()=>{
let params = {
'headPhotoUrl': this.detailModel.headPhotoUrl,
'headType': '1'
} as Record<string, string>;
WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage,params)
}).margin({
left: '10vp',
})
.visibility((this.topOpacity > 0.5 ? Visibility.Visible : Visibility.Hidden))
... ... @@ -56,7 +62,7 @@ export struct PeopleShipHomePageNavComponent {
if (this.isAttention == '0') {
// 关注
Button('+关注', { type: ButtonType.Normal, stateEffect: true })
Button('+ 关注', { type: ButtonType.Normal, stateEffect: true })
.borderRadius(4)
.backgroundColor($r('app.color.color_ED2800'))
.width('54vp')
... ...
... ... @@ -9,6 +9,7 @@ export struct PeopleShipHomePageHeadComponent {
Stack({ alignContent: Alignment.BottomEnd }) {
// 头像
Image( this.headPhotoUrl )
.alt($r('app.media.WDAccountOwnerHedaerDefaultIcon'))
.width(this.diameter)
.height(this.diameter)
.borderRadius(this.diameter/2)
... ...
... ... @@ -7,6 +7,7 @@ import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageD
import { InfluenceData, PeopleShipUserDetailData } from 'wdBean'
import { PeopleShipHomeAttentionComponent } from './PeopleShipHomeAttentionComponent'
import { HWLocationUtils } from 'wdHwAbility'
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
@Component
... ... @@ -51,6 +52,12 @@ export struct PeopleShipHomePageTopComponent {
}).margin({
left: '10vp',
bottom: '20vp'
}).onClick(()=>{
let params = {
'headPhotoUrl': this.detailModel.headPhotoUrl,
'headType': '1'
} as Record<string, string>;
WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage,params)
})
... ...
@Component
export struct PeopleShipNoMoreData{
@State title: string = '已显示全部内容'
build(){
Row(){
Text("已显示全部内容")
.fontColor($r('app.color.color_999999'))
.fontWeight(400)
.fontSize('14vp')
}
.justifyContent(FlexAlign.Center)
.alignItems(VerticalAlign.Center)
.width('100%')
.margin({top:'24vp',bottom:'24vp'})
}
}
\ No newline at end of file
... ...
... ... @@ -29,11 +29,19 @@ export struct FirstTabTopSearchComponent {
if (value != null) {
this.searchTextData = value
}
this.setDefaultHitData()
}).catch((err: Error) => {
console.log(TAG, JSON.stringify(err))
this.setDefaultHitData()
})
}
setDefaultHitData(){
if(this.searchTextData.length === 0){
this.searchTextData.push("搜索")
}
}
build() {
Row() {
Image($r('app.media.icon_search'))
... ...
... ... @@ -13,14 +13,18 @@ const TAG = "SearchComponent"
@Component
export struct SearchComponent {
@State searchTextData: string[] = []
@State hasNoSearchTextData: boolean = false
@State curHintSearchData: string = ""
@State hasInputContent: boolean = false
@State hasChooseSearch: boolean = false
@State isClickedHistory: boolean = false
@State isClickedHot: boolean = false
@State isClickedRelated: boolean = false
@State isClickedHistorySearch: boolean = false
@State isClickedHotSearch: boolean = false
@State isClickedRelatedSearch: boolean = false
@State isClickedInputSearch: boolean = false
@State isClickedHintSearch: boolean = false
private swiperController: SwiperController = new SwiperController()
@State searchText: string = ''
controller: TextInputController = new TextInputController()
controller: SearchController = new SearchController()
@State searchHistoryData: SearchHistoryItem[] = []
@State relatedSearchContentsData: SearchRelatedItem[] = []
scroller: Scroller = new Scroller()
... ... @@ -30,6 +34,8 @@ export struct SearchComponent {
aboutToAppear() {
//获取提示滚动
this.getSearchHint()
//清除缓存
SearcherAboutDataModel.searchHistoryData = []
//获取搜索历史
this.getSearchHistoryData()
}
... ... @@ -75,10 +81,18 @@ export struct SearchComponent {
if (value != null) {
this.searchTextData = value
}
this.setDefaultHitData()
}).catch((err: Error) => {
console.log(TAG, JSON.stringify(err))
this.setDefaultHitData()
})
}
setDefaultHitData(){
if(this.searchTextData.length === 0){
this.hasNoSearchTextData = true
this.searchTextData.push("搜索感兴趣的内容")
}
}
getSearchHistoryData() {
this.searchHistoryData = SearcherAboutDataModel.getSearchHistoryData()
... ... @@ -131,7 +145,7 @@ export struct SearchComponent {
getSearchHistoryResData(content:string,index:number){
//删除单条记录
SearcherAboutDataModel.delSearchSingleHistoryData(index)
this.isClickedHistory = true
this.isClickedHistorySearch = true
this.searchResData(content)
}
... ... @@ -148,6 +162,16 @@ export struct SearchComponent {
//查询 操作 TODO
this.hasChooseSearch = true
this.getSearchResultCountData()
this.controller.stopEditing()
}
/**
* 点击hint搜索列表回调
* @param content
*/
getSearchHintResData(content:string){
this.isClickedHintSearch = true
this.searchResData(content)
}
/**
... ... @@ -155,7 +179,7 @@ export struct SearchComponent {
* @param content
*/
getSearchRelatedResData(content:string){
this.isClickedRelated = true
this.isClickedRelatedSearch = true
this.searchResData(content)
}
... ... @@ -164,10 +188,18 @@ export struct SearchComponent {
* @param content
*/
getSearchHotResData(content:string){
this.isClickedHot = true
this.isClickedHotSearch = true
this.searchResData(content)
}
/**
* 点击输入法搜索搜索列表回调
* @param content
*/
getSearchInputResData(content:string){
this.isClickedInputSearch = true
this.searchResData(content)
}
//搜索框
@Builder searchInputComponent() {
... ... @@ -185,7 +217,7 @@ export struct SearchComponent {
.textAlign(TextAlign.Start)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Clip })
.margin({ left: '40lpx' })
.margin({ left: '70lpx' })
})
}
.loop(true)
... ... @@ -195,42 +227,57 @@ export struct SearchComponent {
.vertical(true)
.enabled(false)
.focusable(false)
.onChange((index: number) => {
this.curHintSearchData = this.searchTextData[index]
})
}
Row(){
TextInput({ text: this.searchText, placeholder: '', controller: this.controller })
.caretColor(Color.Pink)
.fontSize('27lpx')
Search({ value: this.searchText, placeholder: '', controller: this.controller})
.layoutWeight(1)
.fontColor(Color.Black)
.height('69lpx')
.backgroundColor($r('app.color.color_transparent'))
.textFont({ size: "27lpx", weight: "400lpx" })
.defaultFocus(true)
.caretStyle({color:Color.Pink})
.onSubmit((value: string) => {
if(StringUtils.isNotEmpty(this.searchText)){
SearcherAboutDataModel.putSearchHistoryData(this.searchText)
this.getSearchHistoryData()
this.getSearchInputResData(this.searchText)
}else{
if(!this.hasNoSearchTextData){
if(StringUtils.isEmpty(this.curHintSearchData)){
this.curHintSearchData = this.searchTextData[0]
}
this.getSearchHintResData(this.curHintSearchData)
}else{
ToastUtils.shortToast("请输入搜索关键词")
}
}
})
.onChange((value: string) => {
this.searchText = value
if(this.isClickedHistorySearch || this.isClickedHotSearch || this.isClickedRelatedSearch || this.isClickedInputSearch|| this.isClickedHintSearch){
this.hasChooseSearch = true
}else{
this.hasChooseSearch = false
}
if (this.searchText.length > 0) {
this.hasInputContent = true
} else {
this.hasInputContent = false
}
if(this.isClickedHistory || this.isClickedHot || this.isClickedRelated){
this.isClickedHistory = false
this.isClickedHot = false
this.isClickedRelated = false
if(this.isClickedHistorySearch || this.isClickedHotSearch || this.isClickedRelatedSearch || this.isClickedInputSearch|| this.isClickedHintSearch){
this.resetSearch()
}else{
if(this.hasInputContent){
this.getRelatedSearchContent()
}
})
.backgroundColor($r('app.color.color_transparent'))
.defaultFocus(true)
if(this.hasInputContent){
Image($r('app.media.search_input_del_icon'))
.width('31lpx')
.height('31lpx')
.objectFit(ImageFit.Cover)
.interpolation(ImageInterpolation.High)
.onClick(()=>{
this.searchText = ""
this.hasInputContent = false
this.hasChooseSearch = false
})
}
})
}.padding({right:'30lpx'})
.layoutWeight(1)
}
... ... @@ -241,7 +288,7 @@ export struct SearchComponent {
//TODO 需要修改输入法 换行
//右
Text(this.hasInputContent?"搜索":"取消")
Text("取消")
.textAlign(TextAlign.Center)
.fontWeight('400lpx')
.fontSize('31lpx')
... ... @@ -250,16 +297,7 @@ export struct SearchComponent {
.width('125lpx')
.height('58lpx')
.onClick(() => {
if(this.hasInputContent){
if(StringUtils.isNotEmpty(this.searchText)){
SearcherAboutDataModel.putSearchHistoryData(this.searchText)
this.getSearchHistoryData()
this.getSearchHotResData(this.searchText)
}
}else{
router.back()
}
})
}
.height('85lpx')
... ... @@ -289,9 +327,19 @@ export struct SearchComponent {
}
}
this.isGetRequest = true
this.resetSearch()
}).catch((err: Error) => {
console.log(TAG, JSON.stringify(err))
this.isGetRequest = true
this.resetSearch()
})
}
resetSearch(){
this.isClickedHistorySearch = false
this.isClickedHotSearch = false
this.isClickedRelatedSearch = false
this.isClickedInputSearch = false
this.isClickedHintSearch = false
}
}
\ No newline at end of file
... ...
... ... @@ -135,6 +135,6 @@ export struct SearchHistoryComponent{
}
getCategoryViewHeight() {
return `${46 * this.getCategoryRowCount()}lpx`;
return `${50 * this.getCategoryRowCount()}lpx`;
}
}
\ No newline at end of file
... ...
... ... @@ -80,7 +80,7 @@ export struct SearchHotsComponent{
.fontWeight('400lpx')
.lineHeight('42lpx')
}.layoutWeight(1)
if(item.mark!=0){
if(item.mark===1 || item.mark===2){
Image(item.mark===1?$r('app.media.search_hots_mark1'):$r('app.media.search_hots_mark2'))
.width('42lpx')
.height('31lpx')
... ...
... ... @@ -194,6 +194,7 @@ export struct SearchResultContentComponent{
isSearch: true,
publishTimestamp:"",
bottomNavId:'',
openType:''
}
this.data.push(contentDTO)
... ...
import { Params } from 'wdBean';
import { AppUtils, StringUtils } from 'wdKit/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import { CustomTitleUI } from '../reusable/CustomTitleUI';
import { EnvironmentCustomDialog } from './EnvironmentCustomDialog';
const TAG = 'AboutPageUI';
... ... @@ -23,11 +24,11 @@ export struct AboutPageUI {
})
build() {
Navigation() {
// Navigation() {
//滑动区域
this.aboutUi()
}.titleMode(NavigationTitleMode.Mini)
.title('关于')
// }.titleMode(NavigationTitleMode.Mini)
// .title('关于')
}
aboutToAppear() {
... ... @@ -42,6 +43,8 @@ export struct AboutPageUI {
@Builder
aboutUi() {
Column() {
CustomTitleUI({titleName:'关于'})
Image($r('app.media.setting_about_logo'))
.width('278lpx')
.height('154lpx')
... ...
... ... @@ -76,7 +76,7 @@ export struct AccountAndSecurityLayout {
addEmitEvent(){
// 定义一个eventId为1的事件
let event: emitter.InnerEvent = {
eventId: 10010
eventId: EmitterEventId.PHONE_CHANGE_SUCCESS
};
// 收到eventId为1的事件后执行该回调
... ...
... ... @@ -197,7 +197,7 @@ export struct EmptyComponent {
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) {
contentString = '网络出小差了,请检查网络后重试'
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) {
contentString = '获取内容失败请重试'
contentString = '获取内容失败请重试'
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCreation) {
contentString = '暂无作品'
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoBooking) {
... ... @@ -235,7 +235,7 @@ export struct EmptyComponent {
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) {
imageString = $r('app.media.icon_no_content')
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCreation) {
imageString = $r('app.media.icon_no_appointmentMade')
imageString = $r('app.media.icon_no_works1')
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoBooking) {
imageString = $r('app.media.icon_no_appointmentMade')
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NetworkFailed) {
... ...
@CustomDialog
export struct MergeRecordDialog {
controller: CustomDialogController
cancel: () => void = () => {
}
confirm: () => void = () => {
}
build() {
Column() {
Text("合并游客记录到当前账号,可避免信息丢失")
.fontColor("#222222")
.fontSize(18)
.width("100%")
.fontWeight(FontWeight.Bold)
.textAlign(TextAlign.Center)
.margin({ top: 20 })
Divider().color("#999999").width("100%").margin({ top: 20 }).height('1vp')
Row() {
Text('取消')
.fontSize(16)
.fontColor("#648DF2")
.layoutWeight(1)
.fontWeight(FontWeight.Medium)
.textAlign(TextAlign.Center)
.onClick(() => {
this.controller.close()
if (this.cancel) {
this.cancel()
}
})
.height('100%')
// Divider().color("#999999").height('100%').width('0.5vp')
Text('一键合并')
.fontSize(16)
.fontColor("#648DF2")
.layoutWeight(1)
.fontWeight(FontWeight.Medium)
.textAlign(TextAlign.Center)
.border({
width: { left: 1 },
color: "#999999",
style: { left: BorderStyle.Solid }
})
.onClick(() => {
this.controller.close()
if (this.confirm) {
this.confirm()
}
})
.height('100%')
}.layoutWeight(1).justifyContent(FlexAlign.Center)
}.height(140).backgroundColor(Color.White).borderRadius(10).width('74%')
}
}
\ No newline at end of file
... ...
... ... @@ -4,7 +4,7 @@ import MinePageCreatorFunctionsItem from '../viewmodel/MinePageCreatorFunctionsI
import MinePageMoreFunctionModel from '../viewmodel/MinePageMoreFunctionModel';
import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO, WDHttp } from 'wdNetwork';
import { MineAppointmentListItem } from '../viewmodel/MineAppointmentListItem';
import { Logger, StringUtils, EmitterUtils, EmitterEventId } from 'wdKit';
import { Logger, StringUtils, EmitterUtils, EmitterEventId, SPHelper } from 'wdKit';
import { MineFollowListDetailItem } from '../viewmodel/MineFollowListDetailItem';
import { FollowListDetailRequestItem } from '../viewmodel/FollowListDetailRequestItem';
import { FollowListItem } from '../viewmodel/FollowListItem';
... ... @@ -22,6 +22,7 @@ import { UserFollowListRequestItem } from '../viewmodel/UserFollowListRequestIte
import { AppointmentOperationRequestItem } from '../viewmodel/AppointmentOperationRequestItem';
import { CommentLikeOperationRequestItem } from '../viewmodel/CommentLikeOperationRequestItem';
import { FollowOperationRequestItem } from '../viewmodel/FollowOperationRequestItem';
import { SpConstants } from 'wdConstant/Index';
const TAG = "MinePageDatasModel"
... ... @@ -559,7 +560,26 @@ class MinePageDatasModel{
return WDHttp.post<ResponseDTO>(url,object)
};
visitorMergeComment() {
let bean: Record<string, string> = {};
bean['time'] = SPHelper.default.getSync(SpConstants.FIRSTCOMMENTTIME, "") as string
bean['deviceId'] = HttpUtils.getDeviceId();
return new Promise<object>((success, error) => {
// Logger.info(TAG, `visitorMergeComment`);
HttpBizUtil.post<ResponseDTO<object>>(HttpUrlUtils.visitorMergeComment(), bean).then((data: ResponseDTO<object>) => {
if (!data) {
error()
}
if (data.code != 0) {
error()
}
SPHelper.default.save(SpConstants.FIRSTCOMMENTTIME, "")
success(data)
}).catch(() => {
error()
})
})
}
}
const minePageDatasModel = MinePageDatasModel.getInstance()
... ...
import { Logger, SPHelper, UserDataLocal } from 'wdKit';
import { Logger, SPHelper, StringUtils, UserDataLocal } from 'wdKit';
import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
import { SearchHistoryItem } from '../viewmodel/SearchHistoryItem';
import { SearchHotContentItem } from '../viewmodel/SearchHotContentItem';
... ... @@ -18,7 +18,7 @@ const TAG = "SearcherAboutDataModel"
class SearcherAboutDataModel{
private static instance: SearcherAboutDataModel;
public searchHistoryData:SearchHistoryItem[] = []
public SEARCH_HISTORY_KEY:string = "SEARCH_HISTORY_KEY" + UserDataLocal.getUserId()
public SEARCH_HISTORY_KEY:string = "SEARCH_HISTORY_KEY"
private constructor() { }
... ... @@ -37,7 +37,7 @@ class SearcherAboutDataModel{
* 插入搜索记录(单个)
*/
public async putSearchHistoryData(content:string){
let history = SPHelper.default.getSync(this.SEARCH_HISTORY_KEY,"[]") as string
let history = SPHelper.default.getSync(this.generationSearchKey(),"[]") as string
this.searchHistoryData = JSON.parse(history)
this.searchHistoryData.forEach((element,index) => {
if (element.searchContent == content) {
... ... @@ -45,14 +45,14 @@ class SearcherAboutDataModel{
}
});
this.searchHistoryData.splice(0,0,new SearchHistoryItem(content))
await SPHelper.default.saveSync(this.SEARCH_HISTORY_KEY, JSON.stringify(this.searchHistoryData));
await SPHelper.default.saveSync(this.generationSearchKey(), JSON.stringify(this.searchHistoryData));
}
/**
* 删除搜索记录(所有)
*/
public async delSearchHistoryData(){
SPHelper.default.deleteSync(this.SEARCH_HISTORY_KEY)
SPHelper.default.deleteSync(this.generationSearchKey())
this.searchHistoryData = []
}
/**
... ... @@ -62,11 +62,11 @@ class SearcherAboutDataModel{
if(this.searchHistoryData!=null && this.searchHistoryData.length>0){
this.searchHistoryData.splice(index,1)
}else{
let history = SPHelper.default.getSync(this.SEARCH_HISTORY_KEY,"[]") as string
let history = SPHelper.default.getSync(this.generationSearchKey(),"[]") as string
this.searchHistoryData = JSON.parse(history)
this.searchHistoryData.splice(index,1)
}
SPHelper.default.saveSync(this.SEARCH_HISTORY_KEY, JSON.stringify(this.searchHistoryData))
SPHelper.default.saveSync(this.generationSearchKey(), JSON.stringify(this.searchHistoryData))
}
/**
... ... @@ -79,7 +79,7 @@ class SearcherAboutDataModel{
}
return this.searchHistoryData
}
let history = SPHelper.default.getSync(this.SEARCH_HISTORY_KEY,"[]") as string
let history = SPHelper.default.getSync(this.generationSearchKey(),"[]") as string
this.searchHistoryData = JSON.parse(history)
if(this.searchHistoryData.length>10){
... ... @@ -91,6 +91,15 @@ class SearcherAboutDataModel{
return this.searchHistoryData
}
public generationSearchKey():string{
let userId = UserDataLocal.getUserId()
if(StringUtils.isEmpty(userId)){
return this.SEARCH_HISTORY_KEY + "_" + "0000111122223333"
}else{
return this.SEARCH_HISTORY_KEY + "_" + userId
}
}
/**
* 首页 搜索提示滚动内容
*/
... ...
... ... @@ -4,16 +4,18 @@ import { router } from '@kit.ArkUI';
@Component
struct ShowUserHeaderPage {
@State headPhotoUrl: string = '';
@State headType: string = ''
@State params:Record<string, string> = router.getParams() as Record<string, string>;
onPageShow() {
this.headPhotoUrl = this.params?.['headPhotoUrl'];
this.headType = this.params?.['headType'] ?? '';
}
build() {
Row() {
Image(this.headPhotoUrl)
.alt($r('app.media.default_head'))
.alt(this.headType.length > 0 ? $r('app.media.WDAccountOwnerHedaerDefaultIcon') : $r('app.media.default_head'))
.width('720lpx')
.height('720lpx')
.objectFit(ImageFit.Auto)
... ...
... ... @@ -34,7 +34,7 @@ export class RefreshConstants {
/**
* The refresh and load height.
*/
static readonly CUSTOM_LAYOUT_HEIGHT: number = 90;
static readonly CUSTOM_LAYOUT_HEIGHT: number = 80;
/**
* Full the width.
*/
... ...
import { CompDTO, ContentDTO, PageDTO, PageInfoDTO } from 'wdBean';
import { CompStyle, ViewType } from 'wdConstant/Index';
import { CollectionUtils, DateTimeUtils, Logger, NetworkUtil } from 'wdKit';
import { CollectionUtils, DateTimeUtils, Logger, NetworkUtil, StringUtils } from 'wdKit';
import { closeRefresh } from '../utils/PullDownRefresh';
import PageModel from './PageModel';
import PageViewModel from './PageViewModel';
... ... @@ -9,6 +9,7 @@ import { CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean';
import PageAdModel from './PageAdvModel';
import { ArrayList } from '@kit.ArkTS';
import { WDViewDefaultType } from '../components/view/EmptyComponent';
import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean';
const TAG = 'PageHelper';
... ... @@ -21,6 +22,7 @@ export class PageHelper {
*/
async refreshUI(pageModel: PageModel, pageAdvModel: PageAdModel) {
pageModel.loadStrategy = 2
pageModel.pageTotalCompSize = 0;
this.getPageInfo(pageModel, pageAdvModel)
}
... ... @@ -52,7 +54,7 @@ export class PageHelper {
PageViewModel.getPageInfo(pageModel.pageId).then(pageInfo => {
if (pageInfo == null) {
pageModel.viewType = ViewType.EMPTY;
pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoListContent;
pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1;
return;
}
pageModel.pageInfo = pageInfo;
... ... @@ -94,7 +96,7 @@ export class PageHelper {
// 没数据,展示空页面
Logger.debug(TAG, 'aboutToAppear, data response page ' + pageModel.pageId + ', comp list is empty.');
pageModel.viewType = ViewType.EMPTY;
pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoListContent;
pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1;
}
}
... ... @@ -147,7 +149,7 @@ export class PageHelper {
* 处理页面中的广告组件信息
* @param pageDto
*/
private handlePageCompAdvPostion(pageCompList: ArrayList<CompDTO>, pageDto: PageDTO) {
private handlePageCompAdvPostion(pageCompList: ArrayList<CompDTO>, pageModel: PageModel, pageDto: PageDTO) {
let compAdvList = pageDto.compAdList
... ... @@ -159,17 +161,20 @@ export class PageHelper {
flag = false
}
let pageCompSize = pageCompList.length // 信息流组件业务数量
console.error("ZZZXXXXX", " start--->" + pageCompSize);
// console.error("ZZZXXXXX", " start--->" + pageCompSize);
if (pageCompSize == 0) {
flag = false
}
if (flag) {
let bannerAdvIndex = 0; // banner组件展示数据投放
let layoutAdvIndex = 0; //稿件投放统计
// 升序排序
compAdvList.sort((a: CompAdvBean, b: CompAdvBean) => a.slotInfo.position - b.slotInfo.position)
console.error("ZZZXXXXX", " 排序后的广告--->" + JSON.stringify(compAdvList));
// console.error("ZZZXXXXX", " 排序后的广告--->" + JSON.stringify(compAdvList));
//当前日期
let serverTimeLong: number = DateTimeUtils.getTimeStamp();
for (let advBean of compAdvList) {
... ... @@ -192,14 +197,91 @@ export class PageHelper {
// 插入轮播组件的广告
if (4 == advSubType) {
let position = slotInfo.position - 1;
// 检测newCompList 集合中是否有轮播组件资源
let adCompId = slotInfo.compId;
if (!StringUtils.isEmpty(adCompId)) {
for (let compBean of pageCompList) {
if (StringUtils.isEmpty(compBean.id)) {
continue
}
let compId = compBean.id.toString();
//匹配组件
if (adCompId == compId) {
// 运营位数据
let dataList = compBean.operDataList;
if (dataList != null) {
// 数组转成 ArrayList
let changeArrayList = (dataList: ContentDTO[]) => {
let compOperData: ArrayList<ContentDTO> = new ArrayList()
for (let dataListBean of dataList) {
compOperData.add(dataListBean)
}
return compOperData
}
let compOperData = changeArrayList(dataList)
// 轮播组件广告数据转 业务信息
let changeContentDTO = (matInfo: CompAdvMatInfoBean) => {
let advContentBean: ContentDTO = {} as ContentDTO;
advContentBean.newsTitle = matInfo.advTitle
advContentBean.objectType = matInfo.advType == "0" ? matInfo.advType : "4"
advContentBean.coverUrl = matInfo.matImageUrl[0]
advContentBean.linkUrl = matInfo.linkUrl
advContentBean.openType = matInfo.linkType
advContentBean.corner = ''
return advContentBean
}
let advContentBean = changeContentDTO(matInfo)
let dataListSize = dataList.length;
if (position < dataListSize) {
//dataList.add(position + bannerAdvIndex, advContentBean);
compOperData.insert(advContentBean, position + bannerAdvIndex)
} else {
compOperData.add(advContentBean);
}
bannerAdvIndex = bannerAdvIndex + 1;
// ArrayList转成 数组
compBean.operDataList = compOperData.convertToArray()
}
}
}
}
} else {
let advPosition = slotInfo.position //广告位置,从1开始
// 页面的comp总数 - 这次请求的comp总数 = 剩余comp总数
advPosition = advPosition - 1
let a = pageModel.pageTotalCompSize - pageCompSize
if (advPosition <= pageModel.pageTotalCompSize && advPosition >= a) {
let b = advPosition - a;
console.error('ZZZXXXXX', matInfo.advSubType + '-------------' + matInfo.advTitle + " " + advPosition + " " + a + " " + b)
if (b <= pageCompSize && b >= 0) {
let advComp: CompDTO = {
compStyle: CompStyle.Card_Comp_Adv,
matInfo: matInfo
} as CompDTO;
pageCompList.insert(advComp, 0)
if (pageCompSize == slotInfo.position) {
pageCompList.add(advComp)
} else {
pageCompList.insert(advComp, b + layoutAdvIndex)
}
layoutAdvIndex = layoutAdvIndex + 1;
}
}
}
}
}
... ... @@ -207,7 +289,7 @@ export class PageHelper {
}
}
console.error("ZZZXXXXX", " end--->" + pageCompList.length);
// console.error("ZZZXXXXX", " end--->" + pageCompList.length);
}
... ... @@ -228,19 +310,21 @@ export class PageHelper {
//移除音频 和 活动
this.collectPageComp(pageModel, data)
//
// pageModel.compList.push(...data.compList)
PageViewModel.getInteractData(data.compList).then((data: CompDTO[]) => {
// 刷新,替换所有数据
pageModel.compList.updateItems(sizeBefore, data)
pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()
})
// 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 });
})
}
/**
* 移除comp
*/
... ... @@ -256,11 +340,22 @@ export class PageHelper {
if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) {
Logger.debug(TAG, 'getGroupData 移除音频 和 活动');
} else {
// 暂时屏蔽活动和音频详情入口
if (element.operDataList[0]?.objectType === '3' || element.operDataList[0]?.objectType === '13') {
} else {
pageCompList.add(element)
}
}
}
// 记录
pageModel.pageTotalCompSize = pageCompList.length + pageModel.pageTotalCompSize
// console.error("ZZZXXXXX", " collectPageComp--->" + pageModel.pageTotalCompSize);
// 处理页面广告数据,投放到页面的位置
//this.handlePageCompAdvPostion(pageCompList, pageDto);
this.handlePageCompAdvPostion(pageCompList, pageModel, pageDto);
//遍历所有组件和稿件数据 push到页面
for (let element of pageCompList) {
... ...
... ... @@ -54,6 +54,9 @@ export default class PageModel {
timestamp: String = '1';
// 记录已经展示的稿件和组件数量
pageTotalCompSize: number = 0;
/**
* 简单复制业务数据
*/
... ...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="9" height="6" viewBox="0 0 9 6"><g><g><path d="M2.63066,0.5L7.79156,0.5C8.13703,0.5,8.3784,0.8420000000000001,8.26266,1.167505L6.84044,5.1675C6.76957,5.36684,6.5809,5.5,6.36934,5.5L1.208442,5.5C0.862974,5.5,0.6216,5.158,0.737335,4.8325L2.15956,0.832495C2.23043,0.633155,2.4191000000000003,0.5,2.63066,0.5" fill-rule="evenodd" fill="#ED2800" fill-opacity="1"/></g></g></svg>
\ No newline at end of file
... ...
... ... @@ -58,10 +58,10 @@ export struct TabLiveComponent {
// 加载更多
ListItem() {
if (this.pageModel.hasMore) {
LoadMoreLayout({
refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage,
this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight)
})
// LoadMoreLayout({
// refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage,
// this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight)
// })
} else {
ListHasNoMoreDataUI()
}
... ... @@ -89,7 +89,7 @@ export struct TabLiveComponent {
if (data.barrageResponses && data.barrageResponses.length > 0) {
/**
* 在直播聊天添加一条新内容逻辑:
判断 oldNewsId:迁移id空 且 直播状态不是预约:"wait"
判断 oldNewsId:迁移id空 且 直播状态不是预约:"wait"
消息内容:
1.头像固定:APP默认头像
2.名称固定:人民日报主持人
... ... @@ -105,6 +105,25 @@ export struct TabLiveComponent {
if (StringUtils.isEmpty(this.liveDetailsBean.oldNewsId)
&& this.liveDetailsBean
&& this.liveDetailsBean.liveInfo.liveState != 'wait') {
this.updateLiveListData()
}
}
} else {
if (StringUtils.isEmpty(this.liveDetailsBean.oldNewsId)
&& this.liveDetailsBean
&& this.liveDetailsBean.liveInfo.liveState != 'wait') {
this.updateLiveListData()
} else {
this.pageModel.viewType = ViewType.EMPTY;
}
}
},
() => {
})
}
updateLiveListData() {
let liveRoomItemBeanTemp: LiveRoomItemBean = {} as LiveRoomItemBean
liveRoomItemBeanTemp.text = this.liveDetailsBean.newIntroduction
liveRoomItemBeanTemp.senderUserName = '人民日报主持人'
... ... @@ -118,15 +137,6 @@ export struct TabLiveComponent {
}
this.liveList.push(liveRoomItemBeanTemp)
}
}
} else {
this.pageModel.viewType = ViewType.EMPTY;
}
},
() => {
})
}
aboutToDisappear(): void {
}
... ...
... ... @@ -7,7 +7,7 @@ import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/
import { WDRouterRule, WDRouterPage } from 'wdRouter';
import { SettingPasswordParams } from './SettingPasswordLayout'
import { Router } from '@ohos.arkui.UIContext'
import { SPHelper, ToastUtils } from 'wdKit/Index'
import { EmitterEventId, EmitterUtils, SPHelper, ToastUtils } from 'wdKit/Index'
import { SpConstants } from 'wdConstant/Index'
import { emitter } from '@kit.BasicServicesKit'
... ... @@ -189,7 +189,7 @@ struct ForgetPasswordPage {
sendEmitEvent(){
// 定义一个eventId为1的事件,事件优先级为Low
let event: emitter.InnerEvent = {
eventId: 10010,
eventId: EmitterEventId.PHONE_CHANGE_SUCCESS,
priority: emitter.EventPriority.LOW
};
... ...
... ... @@ -60,7 +60,7 @@ export class LoginModel {
let bean: Record<string, Object> = {};
bean['phone'] = phone
bean['loginType'] = loginType
bean['deviceId'] = '60da5af6-9c59-3566-8622-8c6c00710994'
bean['deviceId'] = HttpUtils.getDeviceId()
bean['verificationCode'] = verificationCode
return new Promise<LoginBean>((success, fail) => {
HttpRequest.post<ResponseDTO<LoginBean>>(HttpUrlUtils.getAppLoginUrl(), bean).then((data: ResponseDTO<LoginBean>) => {
... ... @@ -90,7 +90,7 @@ export class LoginModel {
bean['userName'] = phone
}
bean['loginType'] = loginType
bean['deviceId'] = '60da5af6-9c59-3566-8622-8c6c00710994'
bean['deviceId'] = HttpUtils.getDeviceId()
bean['password'] = password
bean['oldPassword'] = oldPassword
return new Promise<LoginBean>((success, fail) => {
... ...
import { Logger } from 'wdKit/src/main/ets/utils/Logger'
import { LoginModel } from './LoginModel'
import { LoginBean } from './LoginBean'
import { SPHelper, StringUtils } from 'wdKit'
import { EmitterEventId, EmitterUtils, SPHelper, StringUtils, UserDataLocal } from 'wdKit'
import { CheckVerifyBean } from './CheckVerifyBean'
import cryptoFramework from '@ohos.security.cryptoFramework'
import buffer from '@ohos.buffer'
... ... @@ -55,6 +55,7 @@ export class LoginViewModel {
SPHelper.default.saveSync(SpConstants.USER_STATUS, data.status)
SPHelper.default.saveSync(SpConstants.USER_Type, data.userType)
SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName)
EmitterUtils.sendEmptyEvent(EmitterEventId.LOGIN_SUCCESS)
success(data)
}).catch((error:string) => {
fail(error)
... ... @@ -82,6 +83,7 @@ export class LoginViewModel {
SPHelper.default.saveSync(SpConstants.USER_STATUS, data.status)
SPHelper.default.saveSync(SpConstants.USER_Type, data.userType)
SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName)
EmitterUtils.sendEmptyEvent(EmitterEventId.LOGIN_SUCCESS)
success(data)
}).catch((value: string) => {
fail(value)
... ... @@ -157,6 +159,7 @@ export class LoginViewModel {
SPHelper.default.saveSync(SpConstants.USER_STATUS, '')
SPHelper.default.saveSync(SpConstants.USER_Type, '')
SPHelper.default.saveSync(SpConstants.USER_NAME, '')
UserDataLocal.clearUserData()
success(data)
}).catch((message: string) => {
fail(message)
... ...
import { Action } from 'wdBean';
import { SpacialTopicPageComponent } from 'wdComponent'
import { CommonConstants } from 'wdConstant'
import { Logger } from 'wdKit'
import { Logger, WindowModel } from 'wdKit'
import router from '@ohos.router';
const TAG = 'SpacialTopicPage';
... ... @@ -27,6 +27,7 @@ struct SpacialTopicPage {
}
aboutToAppear() {
WindowModel.shared.setWindowLayoutFullScreen(true)
Logger.info(TAG, 'aboutToAppear');
let action: Action = router.getParams() as Action
this.action = action
... ... @@ -34,6 +35,7 @@ struct SpacialTopicPage {
aboutToDisappear() {
Logger.info(TAG, 'aboutToDisappear');
WindowModel.shared.setWindowLayoutFullScreen(false)
}
onPageShow() {
... ...
... ... @@ -181,12 +181,12 @@ struct LaunchAdvertisingPage {
//端外打开
ProcessUtils.jumpExternalWebPage(this.model.launchAdInfo[0].matInfo.linkUrl)
clearInterval(this.timer)
//clearInterval(this.timer)
}else {
//端内打开
ProcessUtils.gotoDefaultWebPage(this.model.launchAdInfo[0].matInfo.linkUrl)
clearInterval(this.timer)
//clearInterval(this.timer)
}
}
... ...
... ... @@ -35,7 +35,7 @@ struct LaunchPage {
alignment: DialogAlignment.Center,
offset: { dx: 0, dy: '-24' },
customStyle: true,
autoCancel: false
autoCancel: false,
});
onCancel() {
... ... @@ -110,6 +110,9 @@ struct LaunchPage {
if (dataModel.launchAdInfo.length) {
//跳转广告页
this.jumpToAdvertisingPage();
//WDRouterRule.jumpWithReplacePage(WDRouterPage.privacyPage)
}else {
//直接跳转首页
WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
... ... @@ -156,7 +159,7 @@ struct LaunchPage {
build(){
Stack({alignContent:Alignment.Bottom}){
Image($r('app.media.app_icon'))
Image($r('app.media.LaunchPage_logo'))
.width('278lpx')
.height('154lpx')
.margin({
... ...
... ... @@ -3,59 +3,35 @@ import webview from '@ohos.web.webview';
import router from '@ohos.router';
import { GlobalContext } from '../../utils/GlobalContext'
import { WDRouterRule } from 'wdRouter';
import { LikeComponent } from 'wdComponent'
@Entry
@Component
struct PrivacyPage {
@State message: string = 'Hello World'
webController: webview.WebviewController = new webview.WebviewController();
//@State params: object = router.getParams();
model: Record<string, string> = {}
aboutToAppear(): void {
this.model['contentId'] = '30044572938' //必须
this.model['userName'] = '人民日报网友5MbdHk'
this.model['contentType'] = '8' //必须
this.model['title'] = '“神器”还是“安慰剂”?中学生“体考神器”调查'
this.model['userHeaderUrl'] = ""
this.model['channelId'] = "2002" //必须
//this.model['status'] = "1" //必须
}
build() {
Row() {
Column() {
// Web component loading H5.
Web({ src: 'https://www.baidu.com', controller: this.webController })
.zoomAccess(false)
.width('100%')
.height('100%')
.aspectRatio(1)
// .onConfirm((event) => {
// AlertDialog.show({
// message: Const.WEB_ALERT_DIALOG_TEXT_VALUE + event?.message,
// confirm: {
// value: $r('app.string.web_alert_dialog_button_value'),
// action: () => {
// event?.result.handleConfirm();
// }
// },
// cancel: () => {
// event?.result.handleCancel();
// }
// });
// return true;
// })
// .onErrorReceive((event) => {
// if (event?.error.getErrorInfo() === 'ERR_INTERNET_DISCONNECTED') {
// prompt.showToast({
// message: $r('app.string.internet_err'),
// duration: Const.WebConstant_DURATION
// })
// }
// if (event?.error.getErrorInfo() === 'ERR_CONNECTION_TIMED_OUT') {
// prompt.showToast({
// message: $r('app.string.internet_err'),
// duration: Const.WebConstant_DURATION
// })
// }
// })
// .onProgressChange((event) => {
// if (event?.newProgress === Const.WebConstant_PROGRESS_MAX) {
// this.isLoading = false;
// clearInterval(this.intervalLoading);
// this.intervalLoading = -1;
// }
// })
LikeComponent({data: this.model,componentType:1})
}
.width('100%')
}
... ...
... ... @@ -134,7 +134,7 @@ export default struct CustomDialogComponent {
Text($r('app.string.dialog_text_privacy_statement'))
.width('90%')
.fontColor($r('app.color.dialog_text_color'))
.fontSize(13).margin({top:20})
.fontSize(14).margin({top:20})
Row() {
Text($r('app.string.dialog_button_disagree'))
.fancy()
... ...
... ... @@ -3,8 +3,9 @@ import { WdWebComponent } from 'wdWebComponent';
import router from '@ohos.router';
import { CommonConstants } from 'wdConstant'
import { BridgeWebViewControl } from 'wdJsBridge';
import { detailedSkeleton } from 'wdComponent/src/main/ets/components/skeleton/detailSkeleton'
const TAG = 'DefaultWebPage'
@Entry
@Component
struct DefaultWebPage {
... ... @@ -16,9 +17,6 @@ struct DefaultWebPage {
build() {
Column() {
if (!this.isPageEnd) {
detailedSkeleton()
}
Stack({ alignContent: Alignment.Bottom }) {
Column() {
WdWebComponent({
... ...