王士厅
Showing 49 changed files with 2815 additions and 133 deletions
import { StringUtils } from './StringUtils';
import getLunar from './GetLunar'
/**
* 日期/时间工具
*/
... ... @@ -457,6 +457,15 @@ export class DateTimeUtils {
return timeStr;
}
/**
* 获取农历日期
* @param _date eg: '2024-02-01 12:12:12' or '2024-02-01' 如果不传,取当前时间
* @returns eg: '二月廿五'
* 如果后面有其他农历需求,可以引入农历插件。这个引入的getLunar文件可以删除
*/
static getLunar(_date?: string) {
return getLunar(_date)
}
}
// const dateTimeUtils = new DateTimeUtils()
\ No newline at end of file
... ...
/**
* 获取某个日期的农历
* @parmas {newDate} 日期 年-月-日
*/
export default function getLunar(newDate){
var nyear;
var nmonth;
var nday = -1;
var nwday;
var nhrs;
var nmin;
var nsec;
var newDate = newDate;
var lmonth, lday, lleap; //农历参数
function Draw() {
NewTick();
//显示时间
var s = nyear + '年' + nmonth + '月' + nday + '日 ' + '星期' + cweekday(nwday) + ' ' + shapetime(nhrs, nmin, nsec);
s += " 农历" + lmonth + "月" + lday; //农历
var lunar_month_day=lmonth + "月" + lday;
return lunar_month_day;
}
function NewTick() {
console.warn('noww---', newDate)
var noww = newDate ? new Date(newDate) : new Date();
if (noww.getDate() != nday) {
nyear = noww.getFullYear();
nmonth = noww.getMonth() + 1;
nwday = noww.getDay();
nday = noww.getDate();
getlunar(); //获取农历
}
nhrs = noww.getHours();
nmin = noww.getMinutes();
nsec = noww.getSeconds();
}
//辅助函数
var hzWeek = new Array("日", "一", "二", "三", "四", "五", "六", "日");
function cweekday(wday) {
return hzWeek[wday];
}
function shapetime(vhrs, vmin, vsec) {
if (vsec <= 9) vsec = "0" + vsec;
if (vmin <= 9) vmin = "0" + vmin;
if (vhrs <= 9) vhrs = "0" + vhrs;
return vhrs + ":" + vmin + ":" + vsec
}
//农历函数开始
var lunarInfo = new Array(0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x055d2, 0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0, 0x14977, 0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970, 0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7, 0x0c950, 0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557, 0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5b0, 0x14573, 0x052b0, 0x0a9a8, 0x0e950, 0x06aa0, 0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0, 0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b6a0, 0x195a6, 0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570, 0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x05ac0, 0x0ab60, 0x096d5, 0x092e0, //1990
0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5, 0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930, 0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530, 0x05aa0, 0x076a3, 0x096d0, 0x04bd7, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45, 0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0, 0x14b63);
function lYearDays(y) {
var i, sum = 348;
for (i = 0x8000; i > 0x8; i >>= 1) sum += (lunarInfo[y - 1900] & i) ? 1 : 0;
return (sum + leapDays(y));
}
function leapDays(y) {
if (leapMonth(y)) return ((lunarInfo[y - 1900] & 0x10000) ? 30 : 29);
else return (0);
}
function leapMonth(y) {
return (lunarInfo[y - 1900] & 0xf);
}
function monthDays(y, m) {
return ((lunarInfo[y - 1900] & (0x10000 >> m)) ? 30 : 29);
}
function Lunar(y, m, d) {
var i, leap = 0,
temp = 0;
var offset = (Date.UTC(y, m, d) - Date.UTC(1900, 0, 31)) / 86400000;
for (i = 1900; i < 2050 && offset > 0; i++) {
temp = lYearDays(i);
offset -= temp;
}
if (offset < 0) {
offset += temp;
i--;
}
this.year = i;
leap = leapMonth(i);
this.isLeap = false;
for (i = 1; i < 13 && offset > 0; i++) {
if (leap > 0 && i == (leap + 1) && this.isLeap == false) {--i;
this.isLeap = true;
temp = leapDays(this.year);
} else {
temp = monthDays(this.year, i);
}
if (this.isLeap == true && i == (leap + 1)) this.isLeap = false;
offset -= temp;
}
if (offset == 0 && leap > 0 && i == leap + 1) if (this.isLeap) {
this.isLeap = false;
} else {
this.isLeap = true; --i;
}
if (offset < 0) {
offset += temp; --i;
}
this.month = i;
this.day = offset + 1;
}
var nStr1 = new Array('', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二');
var nStr2 = new Array('初', '十', '廿', '卅', '□');
function GetcDay(d) {
var s;
switch (d) {
case 10:
s = '初十';
break;
case 20:
s = '二十';
break;
case 30:
s = '三十';
break;
default:
s = nStr2[Math.floor(d / 10)];
s += nStr1[d % 10];
break;
}
return (s);
}
function GetcMon(m) {
if (m == 1) return '正';
else return nStr1[m];
}
function getlunar() {
var lObj = new Lunar(nyear, nmonth - 1, nday);
lmonth = GetcMon(lObj.month);
lday = GetcDay(lObj.day);
lleap = lObj.isLeap;
if (lleap == 1) {
lmonth = "闰" + lmonth;
}
}
//农历函数结束
return Draw();
}
\ No newline at end of file
... ...
... ... @@ -171,7 +171,7 @@ export class HttpUrlUtils {
* */
static readonly MORNING_EVENING_PAGE_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/pageInfo";
static readonly MORNING_EVENING_COMP_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/compInfo";
private static _hostUrl: string = HttpUrlUtils.HOST_UAT;
private static _hostUrl: string = HttpUrlUtils.HOST_PRODUCT;
public static set hostUrl(value: string) {
HttpUrlUtils._hostUrl = value;
... ...
... ... @@ -73,6 +73,8 @@ export function registerRouter() {
return WDRouterPage.morningEveningPaperPage
} else if (action.params?.pageID == "IMAGE_TEXT_DETAIL") {
return WDRouterPage.imageTextDetailPage
} else if (action.params?.pageID == "BroadcastPage") {
return WDRouterPage.broadcastPage
}
return undefined
})
... ...
... ... @@ -83,4 +83,7 @@ export class WDRouterPage {
// static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview");
//播报页面
static broadcastPage = new WDRouterPage("phone", "ets/pages/broadcast/BroadcastPage");
}
... ...
... ... @@ -28,5 +28,6 @@ export interface CompDTO {
sortValue: number;
subType: string;
imageScale: number; // 封面图比例 1-4:3, 2-16:9, 3-3:2
audioDataList: AudioDTO[]
audioDataList: AudioDTO[];
isSelect: boolean;
}
\ No newline at end of file
... ...
export interface ChannelInfo {
channelId: string;
channelLevel: string;
channelName: string;
channelSkin: string;
channelStrategy: string;
channelStyle: string;
pageId: string;
pageTopType: string;
pcStyle: string;
webBackgroundImgUrl: string;
}
\ No newline at end of file
... ...
import { Group } from './Group';
import { TopicInfo } from './TopicInfo';
import { ChannelInfo } from './ChannelInfo'
export interface PageInfoBean {
backIconUrl: string;
backgroundColor: string;
... ... @@ -8,7 +8,7 @@ export interface PageInfoBean {
baselineColor: string;
baselineCopywriting: string;
baselineShow: number;
// channelInfo?: any;
channelInfo?: ChannelInfo;
// cornersAdv?: any;
// cornersAdv2: any[];
description: string;
... ...
... ... @@ -55,3 +55,6 @@ export { ZhGridLayoutComponent } from "./src/main/ets/components/view/ZhGridLayo
export { MultiPictureDetailPageComponent } from "./src/main/ets/components/MultiPictureDetailPageComponent"
export { AudioDetailComponent } from "./src/main/ets/components/AudioDetailComponent"
export { BroadcastPageComponent } from "./src/main/ets/components/broadcast/BroadcastPageComponent"
... ...
... ... @@ -3,7 +3,8 @@ import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailView
import { ContentDetailDTO } from 'wdBean';
import media from '@ohos.multimedia.media';
import { OperRowListView } from './view/OperRowListView';
import { WDPlayerController } from 'wdPlayer';
import { WDPlayerController } from 'wdPlayer/Index';
const TAG = 'AudioDetailComponent'
interface Arr{
image:string,
... ... @@ -15,7 +16,8 @@ export struct AudioDetailComponent {
private relId: string = ''
private contentId: string = ''
private relType: string = ''
private playerController: WDPlayerController = new WDPlayerController();
private avPlayer?: media.AVPlayer;
@State playerController: WDPlayerController = new WDPlayerController();
private arr:Arr[]=[
{image:'clock',title:'定时'},
... ... @@ -26,24 +28,27 @@ export struct AudioDetailComponent {
@State contentDetailData: ContentDetailDTO[] = [] as ContentDetailDTO[]//详情
@State coverImage:string = '' //封面图
@State newsTitle:string = '' //标题
@State duration:number = 0 //时长
@State audioUrl:string = '' //音频路径
@State duration:number = 0 //时长
@State outSetValueOne:number = 40 //播放进度
@State @Watch('onIsPlayChanged')isPlay: boolean = true
onIsPlayChanged(){
if(this.isPlay){
console.log('监听播放')
// this.avPlayer.play()
}else{
console.log('监听暂停')
// this.avPlayer.pause()
}
}
@State isPlay: boolean = false
async aboutToAppear() {
await this.getContentDetailData()
this.playerController.firstPlay(this.audioUrl);
this.playerController.onCanplay = () => {
this.playerController.play()
this.isPlay = true
}
this.playerController.onTimeUpdate = (nowSeconds, totalSeconds) =>{
console.log('现在时间',nowSeconds)
console.log('总时间',totalSeconds)
this.outSetValueOne = nowSeconds
this.duration = totalSeconds
}
}
onPageHide() {
this.playerController?.pause();
}
build() {
Row() {
... ... @@ -94,10 +99,17 @@ export struct AudioDetailComponent {
Column(){
// 进度条
Row(){
Progress({ value: this.outSetValueOne, type: ProgressType.Linear })
.width('100%')
.color('#ED2800')
.backgroundColor('rgba(0,0,0,0.5)')
Slider({
value: this.outSetValueOne,
step: 1
})
.showTips(true)
.trackColor('rgba(0,0,0,0.5)')
.selectedColor('#ED2800')
.onChange((value: number, mode: SliderChangeMode) => {
console.log('滑块长度',value)
this.playerController?.setSeekTime(value, mode);
})
}
.width('100%')
.padding({left:24,right:24})
... ... @@ -126,6 +138,14 @@ export struct AudioDetailComponent {
.padding(28)
.backgroundColor('#4D5258')
.borderRadius(50)
.onClick(()=>{
if(this.isPlay){
this.playerController.pause()
}else{
this.playerController.play()
}
this.isPlay = !this.isPlay
})
Image($r('app.media.fastForward_close'))
.width(24)
.height(24)
... ... @@ -151,7 +171,6 @@ export struct AudioDetailComponent {
}
}
private async getContentDetailData() {
try {
let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType)
... ...
import router from '@ohos.router';
import { Params } from 'wdBean'
import { RecommendHeader } from './RecommendHeader';
import { RecommendTitle } from './RecommendTitle';
import { RecommendLists } from './RecommendLists'
import { SelectedColumns } from './SelectedColumns'
import { CompList, PageInfoBean, CompInfoBean } from 'wdBean';
import { DateTimeUtils, Logger } from 'wdKit/Index';
import { PaperReaderSimpleDialog } from '../../dialog/PaperReaderDialog';
import { BroadcastViewModel } from '../../viewmodel/BroadcastViewModel';
import { DateFormatUtil, PlayerConstants, WDPlayerController } from 'wdPlayer';
import { AudioDataList } from 'wdBean/src/main/ets/bean/morningevening/AudioDataList';
import { CommonConstants } from 'wdConstant/Index';
const TAG = 'BroadcastPageComponent';
@Entry
@Component
export struct BroadcastPageComponent {
@State params:Params = router.getParams() as Params;
@State pageInfoBean: PageInfoBean = {} as PageInfoBean // 播报页面信息
@State compInfoBean: CompInfoBean = {} as CompInfoBean // 组件信息
@State recommendCompInfoBean: CompInfoBean = {} as CompInfoBean // 推荐播报组件信息
@State columnsCompInfoBean: CompInfoBean = {} as CompInfoBean // 精选栏目组件信息
@State compListItem: CompList = {} as CompList
@State audioPlayUrl: string = ""
@Provide title: string = ''
@Provide subTitle: string = ''
@Provide isAudioPlaying: boolean = false
@Provide status: number = PlayerConstants.STATUS_START;
@Provide currentTime: string = "00:00";
@Provide totalTime: string = "00:00";
@Provide progressVal: number = 0;
private audioDataList: AudioDataList[] = []
private playerController: WDPlayerController = new WDPlayerController();
simpleAudioDialog: CustomDialogController = new CustomDialogController({
builder: PaperReaderSimpleDialog({
cancel: this.onCancel,
confirm: this.onConfirm,
playerController: this.playerController
}),
autoCancel: false,
customStyle: true,
alignment: DialogAlignment.CenterStart,
offset: { dx: 12, dy: -150 },
})
onCancel() {
Logger.info(TAG, "cj2024 onCancel = ")
}
/**
* 回调无用
**/
onConfirm() {
Logger.info(TAG, "cj2024 onConfirm = ")
}
// 续播判断
changeContinue() {
Logger.info(TAG, "cj2024 changeContinue = 1")
this.playerController.continue = () => {
Logger.info(TAG, "cj2024 changeContinue = 2")
this.playerController?.stop();
}
return;
}
async aboutToAppear() {
Logger.debug(TAG, `about1ToAppear`, router.getParams().toString())
const currentTime = new Date().getTime()
try {
// 获取页面信息
Logger.warn('获取页面信息')
let pageInfoBean = await BroadcastViewModel.getBroadcastViewPageInfo('21003')
Logger.warn('pageInfoBean-')
Logger.warn(pageInfoBean.groups[0].blockDesc)
this.pageInfoBean = pageInfoBean;
//TODO 根据页面中组件信息。现在默认认为后端只返回2个。第一个是播报,第二个是精选栏目
const pageId = pageInfoBean.id,
groupId_0 = pageInfoBean.groups[0]?.id,
refreshTime = currentTime + "",
topicId = pageInfoBean?.topicInfo?.topicId || '',
channelId = pageInfoBean?.channelInfo?.channelId || ''
if(pageInfoBean.groups[0]) {
this.recommendCompInfoBean = await BroadcastViewModel.getBroadcastCompInfo(pageId, groupId_0, refreshTime, topicId, channelId)
}
if(pageInfoBean.groups[1]) {
const groupId_1 = pageInfoBean.groups[1]?.id
this.columnsCompInfoBean = await BroadcastViewModel.getBroadcastCompInfo(pageId, groupId_1, refreshTime, topicId, channelId)
}
} catch (exception) {
}
}
onPageShow() {
Logger.debug(TAG, `onPageShow--`, JSON.stringify(router.getParams()))
}
onPageHide() {
this.status = PlayerConstants.STATUS_PAUSE;
this.playerController?.pause();
}
build() {
Column() {
// 顶部标题
RecommendHeader()
List() {
ListItem(){
RecommendTitle()
}
if(this.pageInfoBean.groups && this.pageInfoBean.groups[0] && this.recommendCompInfoBean.compList) {
ListItem(){
RecommendLists({
recommendCompInfoBean: this.recommendCompInfoBean
})
}
}
if(this.pageInfoBean.groups && this.pageInfoBean.groups[1] && this.columnsCompInfoBean.compList) {
ListItem() {
SelectedColumns({
columnsCompTitle: this.pageInfoBean.groups[1].blockDesc,
columnsCompInfoBean: this.columnsCompInfoBean
})
.margin({ top: 12 })
}
}
}
.layoutWeight(1)
// @ts-ignore
.onScrollFrameBegin((offset, state) => {
console.log('ccc',String(offset), state)
})
.onReachStart(() => {
console.log('onReachStart----->',)
})
}
.width(CommonConstants.FULL_WIDTH)
.backgroundImage($r('app.media.broadcast_bg'))
.backgroundImageSize({width: '100%', height: '100%'})
}
}
\ No newline at end of file
... ...
import router from '@ohos.router';
import { CommonConstants } from 'wdConstant/Index';
/**
* 今日推荐顶部标题--fixed标题
*/
@Entry
@Component
export struct RecommendHeader {
build() {
Stack() {
Image($r('app.media.icon_arrow_down_black'))
.height($r('app.float.top_arrow_size'))
.width($r('app.float.top_arrow_size'))
.onClick((event: ClickEvent) => {
router.back()
})
.zIndex(1)
Text('今日推荐')
.margin({ left: 5 })
.fontSize($r('app.float.selected_text_size'))
.fontColor($r('app.color.color_222222'))
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.textAlign(TextAlign.Center)
}
.height($r('app.float.top_bar_height'))
.padding({left: 16, right: 16})
.alignContent(Alignment.Start)
}
}
\ No newline at end of file
... ...
import { CompInfoBean, CompDTO } from 'wdBean'
import { CommonConstants } from 'wdConstant';
import { ProcessUtils } from '../../utils/ProcessUtils';
/**
* 播报--今日推荐列表
*/
@Entry
@Component
export struct RecommendLists {
@Prop recommendCompInfoBean: CompInfoBean = {} as CompInfoBean // 推荐-组件信息
build() {
Column(){
ForEach(this.recommendCompInfoBean.compList.slice(0,3), (item: CompDTO) => {
this.recommendTop3Item(item)
})
// 查看更多
if(this.recommendCompInfoBean.compList.length > 3) {
Row() {
Text("查看全部")
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_222222"))
.margin({ right: 1 })
Image($r("app.media.more"))
.width(14)
.height(14)
}
.width(CommonConstants.FULL_WIDTH)
.height(40)
.borderRadius(3)
.justifyContent(FlexAlign.Center)
.margin({top: 5})
.onClick(() => {
// console.log(1)
})
}
}
.margin({left: 16, right: 16})
.padding({left: 16, right: 16})
.backgroundColor($r('app.color.color_fff'))
.borderRadius(5)
}
@Builder
recommendTop3Item(item: CompDTO) {
Row(){
Image($r('app.media.broadcast_pause'))
.width(24)
.height(24)
.margin({right:12})
Text(item.operDataList[0].newsTitle)
.fontSize($r('app.float.font_size_16'))
.fontColor($r('app.color.color_212228'))
.maxLines(1)
.textOverflow({overflow: TextOverflow.Ellipsis})
.layoutWeight(1)
}
.width(CommonConstants.FULL_WIDTH)
.padding({top: 12, bottom: 12})
.onClick(() => {
ProcessUtils.processPage(item.operDataList[0])
})
}
@Builder
recommendListItem() {
}
}
\ No newline at end of file
... ...
import { CommonConstants } from 'wdConstant/Index'
import { DateTimeUtils } from 'wdKit';
/**
* 播报标题描述
*/
@Entry
@Component
export struct RecommendTitle {
build() {
Row(){
// 左边
Column(){
Text('每日最动听的声音')
.fontSize($r('app.float.font_size_14'))
.fontColor($r('app.color.color_222222'))
.alignSelf(ItemAlign.Start)
Image($r('app.media.broadcast_line'))
.width(147)
.margin({
top: 8, bottom: 8
})
Row(){
Column(){
Text('今推')
.fontSize($r('app.float.font_size_24'))
.fontColor($r('app.color.color_222222'))
.fontWeight(600)
Text('日荐')
.fontSize($r('app.float.font_size_24'))
.fontColor($r('app.color.color_222222'))
.fontWeight(600)
}
.margin({right: 8})
.alignSelf(ItemAlign.Start)
Column() {
Text(DateTimeUtils.getLunar())
.fontSize($r('app.float.font_size_14'))
.fontColor($r('app.color.color_222222'))
.alignSelf(ItemAlign.Start)
Text(DateTimeUtils.formatDate(new Date().getTime(), 'MM/dd'))
.fontSize($r('app.float.font_size_24'))
.fontColor($r('app.color.color_222222'))
}
}
.alignSelf(ItemAlign.Start)
}
Blank()
Image($r('app.media.broadcast_pause'))
.width(90)
.height(90)
.margin({
right: 9
})
}
.width(CommonConstants.FULL_WIDTH)
.padding({left: 16, right: 16})
.margin({bottom: 12})
}
}
\ No newline at end of file
... ...
import { CompInfoBean, CompDTO } from 'wdBean'
import { DateTimeUtils } from 'wdKit/Index'
import { CommonConstants } from 'wdConstant';
import { ProcessUtils } from '../../utils/ProcessUtils';
/**
* 精选栏目
*/
@Entry
@Component
export struct SelectedColumns {
@Prop columnsCompInfoBean: CompInfoBean = {} as CompInfoBean // 精选栏目组件信息
@Prop columnsCompTitle: string = ''
build() {
Column(){
Text(this.columnsCompTitle)
.fontSize($r('app.float.selected_text_size'))
.fontColor($r('app.color.color_222222'))
.fontWeight(500)
.width(CommonConstants.FULL_WIDTH)
ForEach(this.columnsCompInfoBean.compList, (item: CompDTO) => {
this.SelectedColumnsItem(item)
})
}
.padding({left: 16,top: 12, right: 16})
.backgroundColor($r('app.color.white'))
}
@Builder
SelectedColumnsItem(item: CompDTO) {
Row() {
Image(item.operDataList[0].coverUrl)
.height(53)
.width(80)
.objectFit(ImageFit.Cover)
.margin({right: 12})
Column({space: 4}){
Text(item.operDataList[0].newsTitle)
.fontSize($r('app.float.font_size_16'))
.fontColor($r('app.color.color_222222'))
.width(CommonConstants.FULL_WIDTH)
.maxLines(1)
.textOverflow({overflow: TextOverflow.Ellipsis})
Text(item.operDataList[0].newsSummary)
.fontSize($r('app.float.font_size_12'))
.fontColor($r('app.color.color_999999'))
.width(CommonConstants.FULL_WIDTH)
.maxLines(1)
.textOverflow({overflow: TextOverflow.Ellipsis})
Row(){
Image($r('app.media.broadcast_clock'))
.width(12)
.height(12)
.margin({right: 4})
Text(DateTimeUtils.getCommentTime(Number.parseFloat(item.operDataList[0].publishTime)))
.fontSize($r('app.float.font_size_12'))
.fontColor($r('app.color.color_999999'))
.margin({ right :24 })
Image($r('app.media.broadcast_listen'))
.width(12)
.height(12)
.margin({right: 4})
Text('0')
.fontSize($r('app.float.font_size_12'))
.fontColor($r('app.color.color_999999'))
.margin({ right :24})
}
.width(CommonConstants.FULL_WIDTH)
}
.layoutWeight(1)
}
.onClick((event: ClickEvent) => {
// TODO 跳转到音频专题页
})
.width(CommonConstants.FULL_WIDTH)
.height(73)
}
}
\ No newline at end of file
... ...
import { CustomTitleUI } from '../reusable/CustomTitleUI'
import { CustomTitleAndEditUI } from '../reusable/CustomTitleAndEditUI'
import MyCollectionViewModel from '../../viewmodel/MyCollectionViewModel';
import PageModel from '../../viewmodel/PageModel';
import { CommonConstants, ViewType } from 'wdConstant'
... ... @@ -11,20 +11,31 @@ import LoadMoreLayout from './LoadMoreLayout'
import NoMoreLayout from './NoMoreLayout'
import { CompParser } from '../CompParser'
import CustomRefreshLoadLayout from './CustomRefreshLoadLayout';
import { listTouchEvent } from '../../utils/PullDownRefresh';
import { CustomSelectUI } from '../view/CustomSelectUI';
import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI';
@Entry
@Component
struct BrowsingHistoryPage {
@State private browSingModel: PageModel = new PageModel()
isloading : boolean = false
@Provide isEditState:boolean = false
@State allDatas :CompDTO[] = [];
@State selectDatas :CompDTO[] = [];
@Provide deleteNum :number = 0;
@Provide isAllSelect:boolean = false
aboutToAppear(){
this.getData()
}
build() {
Column(){
CustomTitleUI({titleName:'浏览历史'})
CustomTitleAndEditUI({titleName:'浏览历史',isDisplayButton:true,editCallback:()=>{
this.allSelectDatas(false)
this.isAllSelect = false
this.selectDatas = []
this.deleteNum = 0
}})
if (this.browSingModel.viewType == ViewType.LOADING){
this.LoadingLayout()
}else if(this.browSingModel.viewType == ViewType.ERROR){
... ... @@ -34,16 +45,21 @@ struct BrowsingHistoryPage {
}else {
this.ListLayout()
}
if (this.isEditState){
CustomBottomFuctionUI({
selectAllCallback:(isAllSelect)=>{
this.allSelectDatas(isAllSelect)
},
confirmCallback:()=>{
this.deleteDatas()
}
})
.position({y:'92%'})
}
}
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.onTouch((event: TouchEvent | undefined) => {
if (event) {
if (this.browSingModel.viewType === ViewType.LOADED) {
listTouchEvent(this.browSingModel, event);
}
}
})
}
@Builder ListLayout() {
... ... @@ -56,11 +72,9 @@ struct BrowsingHistoryPage {
})
}
LazyForEach(this.browSingModel.compList, (compDTO: CompDTO, compIndex: number) => {
ForEach(this.allDatas, (compDTO: CompDTO, compIndex: number) => {
ListItem() {
Column() {
CompParser({ compDTO: compDTO, compIndex: compIndex });
}
this.newCompParser(compDTO,compIndex)
}
})
... ... @@ -79,6 +93,24 @@ struct BrowsingHistoryPage {
.height(CommonConstants.FULL_PARENT)
}
@Builder
newCompParser(compDTO: CompDTO, compIndex: number){
Row(){
if (this.isEditState){
CustomSelectUI({
isOn:compDTO.isSelect,
selectCallback:(isOn)=>{
this.addCompDTO(isOn,compDTO)
}
})
.margin({left:16})
}
Column() {
CompParser({ compDTO: compDTO, compIndex: compIndex })
}
}
}
@Builder LoadingLayout() {
CustomRefreshLoadLayout({ refreshBean: new RefreshLayoutBean(true,
$r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), this.browSingModel.pullDownRefreshHeight) })
... ... @@ -89,7 +121,7 @@ struct BrowsingHistoryPage {
MyCollectionViewModel.newFetchMyCollectList(2,'1',this.browSingModel.currentPage,getContext(this)).then(pageDto => {
if (pageDto && pageDto.compList && pageDto.compList.length > 0) {
this.browSingModel.viewType = ViewType.LOADED;
this.browSingModel.compList.push(...pageDto.compList)
this.allDatas.push(...pageDto.compList)
if (pageDto.compList.length === this.browSingModel.pageSize) {
this.browSingModel.currentPage++;
this.browSingModel.hasMore = true;
... ... @@ -101,4 +133,49 @@ struct BrowsingHistoryPage {
}
})
}
}
\ No newline at end of file
//数据处理
//单个选择
addCompDTO(isOn:boolean , compDTO: CompDTO){
compDTO.isSelect = isOn;
if (isOn === true){
this.selectDatas.push(compDTO)
}else {
this.selectDatas.splice(this.selectDatas.indexOf(compDTO),1)
}
this.deleteNum = this.selectDatas.length
this.isAllSelect = this.deleteNum === this.allDatas.length?true:false;
}
//全选
allSelectDatas(isOn:boolean){
let datas: CompDTO[] = [];
for (let index = 0; index < this.allDatas.length; index++) {
const compDTO = this.allDatas[index];
compDTO.isSelect = isOn
datas.push(compDTO)
}
this.selectDatas = []
this.allDatas = []
if (isOn === true) {
this.selectDatas.push(...datas)
}else {
this.selectDatas.splice(0,this.deleteNum)
}
this.allDatas.push(...datas)
this.deleteNum = this.selectDatas.length
}
//删除
deleteDatas(){
for (let index = 0; index < this.selectDatas.length; index++) {
const compDTO = this.allDatas[index];
this.allDatas.splice(this.selectDatas.indexOf(compDTO),1)
}
//重置删除状态
this.isEditState = false
this.isAllSelect = false
}
}
... ...
import { TopNavDTO } from 'wdBean';
const INDEX_SETTING_TITLE: string = '首页设置'
const INDEX_SETTING_SUBTITLE: string = '将指定频道设置为首页'
const MY_CHANNEL: string = '我的频道'
... ... @@ -11,7 +10,7 @@ const LOCAL_CHANNEL: string = '地方频道'
@CustomDialog
struct ChannelDialog {
@State indexSettingTabIndex: number = 1
@State indexSettingTabIndex: number = 0
@State isEditIng: boolean = false
@Link currentTopNavSelectedIndex: number
@Link myChannelList: TopNavDTO[]
... ... @@ -19,6 +18,9 @@ struct ChannelDialog {
@Link localChannelList: TopNavDTO[]
@Link indexSettingArray: string[]
controller?: CustomDialogController
confirm: (index: number) => void = () => {
}
changeChannelIndex : (index1:number, index2:number) => void = ()=>{}
myChannelItemEditHandle = (index: number): void => {
let item = this.myChannelList.splice(index, 1)[0]
if (item.moreChannel === '1') {
... ... @@ -29,6 +31,34 @@ struct ChannelDialog {
}
}
@Builder
pixelMapBuilder(item: TopNavDTO, index: number) { //拖拽过程样式
Row() {
Row() {
Text(item.name)
.fontSize(14)
.fontColor(this.currentTopNavSelectedIndex === index ? '#ED2800' : (item.homeChannel === '1' || item.movePermitted === 0 ? '#999999' : '#222222'))
if (this.isEditIng && item.myChannel !== '1') {
Image($r('app.media.icon_audio_close'))
.width(12)
.margin({ left: 1 })
}
}
.width('100%')
.height('100%')
.justifyContent(FlexAlign.Center)
.backgroundColor(item.homeChannel === '1' || item.movePermitted === 0 ? '#F5F5F5' : '#ffffff')
}
.width('23%')
.height(40)
.border({
width: item.homeChannel === '1' ? 0 : 1,
color: '#EDEDED',
radius: 3
})
}
build() {
Column() {
... ... @@ -43,7 +73,7 @@ struct ChannelDialog {
})
}
.width('100%')
.margin({ top: 30, bottom: 10 })
.padding({ top: 30, bottom: 10 })
List() {
... ... @@ -66,16 +96,30 @@ struct ChannelDialog {
ListItem() {
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
ForEach(this.indexSettingArray, (text: string, index: number) => {
Button(text, { type: ButtonType.Normal, stateEffect: false })
.width('48%')
.borderRadius(2)
.fontColor(index === this.indexSettingTabIndex ? '#ffffff' : '#ED2800')
.fontSize(16)
.fontWeight(400)
.backgroundColor(index === this.indexSettingTabIndex ? '#ED2800' : '#FDE9E5')
.onClick(() => {
this.indexSettingTabIndex = index
})
Stack() {
Image(this.indexSettingTabIndex === index ? $r('app.media.index_setting_button_active') : $r('app.media.index_setting_button'))
.objectFit(ImageFit.Auto)
.rotate({
angle: index === 1 ? 180 : 0
})
Row() {
if (index === 0) {
Image(this.indexSettingTabIndex === index ? $r('app.media.recommend_icon') : $r('app.media.recommend_icon_active'))
.width(20)
}
Text(text)
.textAlign(TextAlign.Center)
.fontSize(16)
.fontColor(index === this.indexSettingTabIndex ? '#ffffff' : '#ED2800')
}
.width('100%')
.justifyContent(FlexAlign.Center)
}
.alignContent(Alignment.Start)
.height(36)
.onClick(() => {
this.indexSettingTabIndex = index
})
})
}
.height(36)
... ... @@ -99,14 +143,15 @@ struct ChannelDialog {
.margin({ bottom: 12 })
}
// 我的频道列表
ListItem() {
GridRow({ columns: 4, gutter: 10 }) {
Grid() {
ForEach(this.myChannelList, (item: TopNavDTO, index: number) => {
GridCol() {
GridItem() {
Row() {
Text(item.name)
.fontSize(14)
.fontColor(this.currentTopNavSelectedIndex === index ? '#ED2800' : (item.homeChannel === '1' ? '#999999' : '#222222'))
.fontColor(this.currentTopNavSelectedIndex === index ? '#ED2800' : (item.homeChannel === '1' || item.movePermitted === 0 ? '#999999' : '#222222'))
if (this.isEditIng && item.myChannel !== '1') {
Image($r('app.media.icon_audio_close'))
... ... @@ -117,19 +162,20 @@ struct ChannelDialog {
.width('100%')
.height('100%')
.justifyContent(FlexAlign.Center)
.backgroundColor(item.homeChannel === '1' ? '#F5F5F5' : '')
.backgroundColor(item.homeChannel === '1' || item.movePermitted === 0 ? '#F5F5F5' : '')
.onClick(() => {
if (this.isEditIng) {
if (item.myChannel !== '1') {
this.myChannelItemEditHandle(index)
}
} else {
this.confirm(index)
this.currentTopNavSelectedIndex = index
this.controller?.close()
}
})
}
.width(80)
.width('23%')
.height(40)
.border({
width: item.homeChannel === '1' ? 0 : 1,
... ... @@ -140,8 +186,28 @@ struct ChannelDialog {
}
.width('100%')
.margin({ bottom: 24 })
.columnsTemplate('1fr 1fr 1fr 1fr')
.columnsGap(8)
.rowsGap(8)
.height(Math.ceil(this.myChannelList.length / 4 ) * 48)
.editMode(this.isEditIng)
.supportAnimation(true) //设置Grid是否开启拖拽补位动画
.onItemDragStart((event: ItemDragInfo, itemIndex: number) => {
if(this.myChannelList[itemIndex].headlinesOn===1 || this.myChannelList[itemIndex].movePermitted===0){
return
}else{
return this.pixelMapBuilder(this.myChannelList[itemIndex], itemIndex) //设置拖拽过程中显示的元素。
}
})
.onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { //绑定此事件的组件可作为拖拽释放目标,当在本组件范围内停止拖拽行为时,触发回调。
if (!isSuccess || insertIndex >= this.myChannelList.length || this.myChannelList[insertIndex].headlinesOn===1 || this.myChannelList[insertIndex].movePermitted===0) {
return
}
this.changeChannelIndex(itemIndex,insertIndex)
})
}
//更多频道列表
ListItem() {
Column() {
if (this.moreChannelList.length > 0) {
... ... @@ -185,6 +251,7 @@ struct ChannelDialog {
.width('100%')
}
//本地频道列表
ListItem() {
Column() {
if (this.localChannelList.length > 0) {
... ... @@ -230,34 +297,1608 @@ struct ChannelDialog {
}.width('100%').height('100%')
}
.padding(16)
.padding(15)
.backgroundColor('#ffffff')
}
}
// @Entry
@Component
struct ChannelSubscriptionLayout {
changeTab: (index: number) => void = () => {
}
@State indexSettingArray: string [] = ['推荐', '热点']
//当前选中的频道
@Link currentTopNavSelectedIndex: number;
@Link myChannelList: TopNavDTO []
@Link moreChannelList: TopNavDTO []
@Link localChannelList: TopNavDTO []
onAccept = (index: number) => {
console.log(`onAccept${index}`)
this.changeTab(index)
}
// @State currentTopNavSelectedIndex: number = 0
// @State topNavList: TopNavDTO [] = [
// {
// channelId: 2001,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 1,
// delPermitted: 0,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 0,
// myChannel: "0",
// name: "推荐",
// num: 1,
// pageId: 20011,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2002,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 1,
// delPermitted: 0,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 0,
// myChannel: "0",
// name: "热点",
// num: 2,
// pageId: 20012,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2003,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 0,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "锐评",
// num: 3,
// pageId: 20013,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2066,
// channelStrategy: 2,
// channelStyle: 3,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "播报",
// num: 4,
// pageId: 21003,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2006,
// channelStrategy: 2,
// channelStyle: 3,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 0,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "版面",
// num: 5,
// pageId: 20016,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2011,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "体育",
// num: 6,
// pageId: 20021,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2020,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "国际",
// num: 7,
// pageId: 20030,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2063,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 0,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 0,
// myChannel: "0",
// name: "两会",
// num: 8,
// pageId: 21000,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2072,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 0,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 0,
// myChannel: "0",
// name: "亚运",
// num: 9,
// pageId: 21009,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2015,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "科技",
// num: 10,
// pageId: 20025,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2004,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 0,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "云课堂",
// num: 11,
// pageId: 20014,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2005,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 0,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "文件",
// num: 12,
// pageId: 20015,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2007,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 0,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "镜头",
// num: 13,
// pageId: 20017,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2008,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 0,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "公益",
// num: 14,
// pageId: 20018,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2009,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "社会",
// num: 15,
// pageId: 20019,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2010,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "财经",
// num: 16,
// pageId: 20020,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2012,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "文化",
// num: 17,
// pageId: 20022,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2013,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "教育",
// num: 18,
// pageId: 20023,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2014,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "军事",
// num: 19,
// pageId: 20024,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2017,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "健康",
// num: 20,
// pageId: 20027,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2019,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "房产",
// num: 21,
// pageId: 20029,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2018,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "汽车",
// num: 22,
// pageId: 20028,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2065,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 0,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "三农",
// num: 24,
// pageId: 21002,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2024,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "家居",
// num: 25,
// pageId: 20034,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2021,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "法治",
// num: 27,
// pageId: 20031,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2022,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "美食",
// num: 28,
// pageId: 20032,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2025,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "育儿",
// num: 29,
// pageId: 20035,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2026,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "生态",
// num: 30,
// pageId: 20036,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2023,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "时尚",
// num: 31,
// pageId: 20033,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2027,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "北京",
// num: 32,
// pageId: 20037,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2029,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "天津",
// num: 33,
// pageId: 20039,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2030,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "河北",
// num: 34,
// pageId: 20040,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2042,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "河南",
// num: 35,
// pageId: 20052,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2041,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "山东",
// num: 36,
// pageId: 20051,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2031,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "山西",
// num: 37,
// pageId: 20041,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2032,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "内蒙古",
// num: 38,
// pageId: 20042,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2033,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "辽宁",
// num: 39,
// pageId: 20043,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2034,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "吉林",
// num: 40,
// pageId: 20044,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2035,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "黑龙江",
// num: 41,
// pageId: 20045,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2028,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "上海",
// num: 42,
// pageId: 20038,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2036,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "江苏",
// num: 43,
// pageId: 20046,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2037,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "浙江",
// num: 44,
// pageId: 20047,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2038,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "安徽",
// num: 45,
// pageId: 20048,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2039,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "福建",
// num: 46,
// pageId: 20049,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2040,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "江西",
// num: 47,
// pageId: 20050,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2045,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "广东",
// num: 48,
// pageId: 20055,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2046,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "广西",
// num: 49,
// pageId: 20056,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2048,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "重庆",
// num: 50,
// pageId: 20058,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2049,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "四川",
// num: 51,
// pageId: 20059,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2051,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "云南",
// num: 52,
// pageId: 20061,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2050,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "贵州",
// num: 53,
// pageId: 20060,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2044,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "湖南",
// num: 54,
// pageId: 20054,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2043,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "湖北",
// num: 55,
// pageId: 20053,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2052,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "西藏",
// num: 56,
// pageId: 20062,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2057,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "新疆",
// num: 57,
// pageId: 20067,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2053,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "陕西",
// num: 58,
// pageId: 20063,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2054,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "甘肃",
// num: 59,
// pageId: 20064,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2055,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "青海",
// num: 60,
// pageId: 20065,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2056,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "宁夏",
// num: 61,
// pageId: 20066,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2047,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "海南",
// num: 62,
// pageId: 20057,
// pageType: "",
// underlineCColor: ""
// }
// ]
// @State myChannelList: TopNavDTO [] = []
// @State moreChannelList: TopNavDTO [] = []
// @State localChannelList: TopNavDTO [] = []
dialogController: CustomDialogController | null = new CustomDialogController({
builder: ChannelDialog({
currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
indexSettingArray: $indexSettingArray,
myChannelList: $myChannelList,
moreChannelList: $moreChannelList,
localChannelList: $localChannelList
localChannelList: $localChannelList,
confirm: this.onAccept,
changeChannelIndex: this.changeChannelIndex
}),
alignment: DialogAlignment.TopEnd,
customStyle: true,
})
aboutToAppear() {
changeChannelIndex(index1:number, index2:number) { //交换数组中的位置
const temp = this.myChannelList[index1];
if (index1 > index2) {
this.myChannelList.splice(index2, 0, temp);
this.myChannelList.splice(index1 + 1, 1);
} else {
this.myChannelList.splice(index2 + 1, 0, temp);
this.myChannelList.splice(index1, 1);
}
}
// topNavListHandle() {
// let defaultMyChannelList: TopNavDTO[] = []
// let handledTopNavList = [...this.topNavList]
// handledTopNavList.sort((a, b) => {
// return a.num - b.num;
// });
// handledTopNavList.forEach(item => {
// if (item.defaultPermitted === 1 || item.movePermitted === 0 || item.delPermitted === 0 || item.headlinesOn === 1) {
// defaultMyChannelList.push(item);
// }
// })
// defaultMyChannelList.forEach(item => {
// item.myChannel = '1'
// if (item.defaultPermitted === 1) {
// item.homeChannel = '1'
// }
// let index = handledTopNavList.findIndex(_item => _item.channelId === item.channelId)
// if (index !== -1) {
// handledTopNavList.splice(index, 1)
// }
// })
//
// handledTopNavList.unshift(...defaultMyChannelList)
// handledTopNavList.forEach((item, index) => {
// if (item.channelType === 2) {
// item.localChannel = '1'
// }
// if (index >= 11) {
// if (item.channelType === 1) {
// item.moreChannel = '1'
// }
// } else {
// if (item.channelType === 1 && item.myChannel !== '1') {
// item.moreChannel = '1'
// }
// }
//
// if (item.myChannel === '1') {
// this.myChannelList.push(item)
// }
// if (item.moreChannel === '1') {
// this.moreChannelList.push(item)
// }
// if (item.localChannel === '1') {
// this.localChannelList.push(item)
// }
// })
// }
aboutToAppear() {
// this.topNavListHandle()
}
aboutToDisappear() {
... ... @@ -270,8 +1911,9 @@ struct ChannelSubscriptionLayout {
.width(18)
}
.width(36)
.height(30)
.height(36)
.justifyContent(FlexAlign.Center)
.padding({ bottom: 6 })
.backgroundColor('#ffffff')
.onClick(() => {
if (this.dialogController != null) {
... ...
import { CustomTitleUI } from '../reusable/CustomTitleUI';
import { EditListInfo } from '../../model/EditInfoModel';
import { EditListInfo, editModel } from '../../model/EditInfoModel';
import EditInfoViewModel from '../../viewmodel/EditInfoViewModel';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import {AreaPickerDialog} from '../view/areaPickerDialog/AreaPickerDialog'
import { AreaListModel } from '../../model/AreaListModel';
import router from '@ohos.router';
@Entry
@Component
... ... @@ -14,9 +12,15 @@ struct EditUserInfoPage {
@State listData: EditListInfo[] = []
@State headerImg: string = ''
@State dataSource: AreaListModel[] = []
@State currentUserInfo: editModel = new editModel()
dialogController: CustomDialogController = new CustomDialogController({
builder: AreaPickerDialog({dataSource:this.dataSource}),
builder: AreaPickerDialog({dataSource:this.dataSource,
confirmCallback:(area:string)=>{
this.currentUserInfo.userExtend.city = area;
this.updateEditModel()
}
}),
alignment: DialogAlignment.Bottom,
offset:{dx:0,dy:-20}
})
... ... @@ -109,25 +113,33 @@ struct EditUserInfoPage {
end:new Date(),
selected:new Date,
lunar:false,
// onAccept:(value:DatePickerResult) => {
//
// }
onAccept:(value:DatePickerResult) => {
let mon = value.month as number + 1
this.currentUserInfo.userExtend.birthday = value.year+'-'+mon.toString()+'-'+value.day;
this.updateEditModel()
}
})
}else if(i === 5){
TextPickerDialog.show({
range:['男','女'],
range:['女','男'],
selected:0,
// onAccept:(value:TextPickerResult) => {
//
// }
onAccept:(value:TextPickerResult) => {
this.currentUserInfo.userExtend.sex = value.index.toString();
this.updateEditModel()
}
})
}
})
}
updateEditModel(){
this.listData = []
this.listData.push(...EditInfoViewModel.getEditListInfo(this.currentUserInfo))
}
getAccountOwnerInfo(){
EditInfoViewModel.queryAccountOwnerInfo(1,getContext(this)).then((editModel) => {
this.headerImg = editModel.userExtend.headPhotoUrl
this.currentUserInfo = editModel;
this.listData.push(...EditInfoViewModel.getEditListInfo(editModel))
});
}
... ...
import { CustomTitleUI } from '../reusable/CustomTitleUI'
import { CustomTitleAndEditUI } from '../reusable/CustomTitleAndEditUI'
import MyCollectionViewModel from '../../viewmodel/MyCollectionViewModel';
import PageModel from '../../viewmodel/PageModel';
import { CommonConstants, ViewType } from 'wdConstant'
... ... @@ -11,20 +11,31 @@ import LoadMoreLayout from './LoadMoreLayout'
import NoMoreLayout from './NoMoreLayout'
import { CompParser } from '../CompParser'
import CustomRefreshLoadLayout from './CustomRefreshLoadLayout';
import { CustomSelectUI } from '../view/CustomSelectUI';
import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI';
@Entry
@Component
struct MyCollectionListPage {
@State private browSingModel: PageModel = new PageModel()
isloading : boolean = false
@Provide isEditState:boolean = false
@State allDatas :CompDTO[] = [];
@State selectDatas :CompDTO[] = [];
@Provide deleteNum :number = 0;
@Provide isAllSelect:boolean = false
aboutToAppear(){
this.getData()
}
build() {
Column(){
CustomTitleUI({titleName:'我的收藏'})
CustomTitleAndEditUI({titleName:'我的收藏',isDisplayButton:true,editCallback:()=>{
this.allSelectDatas(false)
this.isAllSelect = false
this.selectDatas = []
this.deleteNum = 0
}})
if (this.browSingModel.viewType == ViewType.LOADING){
this.LoadingLayout()
}else if(this.browSingModel.viewType == ViewType.ERROR){
... ... @@ -34,6 +45,18 @@ struct MyCollectionListPage {
}else {
this.ListLayout()
}
if (this.isEditState){
CustomBottomFuctionUI({
selectAllCallback:(isAllSelect)=>{
this.allSelectDatas(isAllSelect)
},
confirmCallback:()=>{
this.deleteDatas()
}
})
.position({y:'92%'})
}
}
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
... ... @@ -49,7 +72,7 @@ struct MyCollectionListPage {
})
}
LazyForEach(this.browSingModel.compList, (compDTO: CompDTO, compIndex: number) => {
ForEach(this.allDatas, (compDTO: CompDTO, compIndex: number) => {
ListItem() {
this.newCompParser(compDTO,compIndex)
}
... ... @@ -73,16 +96,17 @@ struct MyCollectionListPage {
@Builder
newCompParser(compDTO: CompDTO, compIndex: number){
Row(){
Button()
.type(ButtonType.Normal)
.width('20')
.height('20')
.backgroundColor('#ED2800')
.borderRadius(5)
.margin({left:16})
if (this.isEditState){
CustomSelectUI({
isOn:compDTO.isSelect,
selectCallback:(isOn)=>{
this.addCompDTO(isOn,compDTO)
}
})
.margin({left:16})
}
Column() {
CompParser({ compDTO: compDTO, compIndex: compIndex });
CompParser({ compDTO: compDTO, compIndex: compIndex })
}
}
}
... ... @@ -97,7 +121,7 @@ struct MyCollectionListPage {
MyCollectionViewModel.newFetchMyCollectList(1,'1',this.browSingModel.currentPage,getContext(this)).then(pageDto => {
if (pageDto && pageDto.compList && pageDto.compList.length > 0) {
this.browSingModel.viewType = ViewType.LOADED;
this.browSingModel.compList.push(...pageDto.compList)
this.allDatas.push(...pageDto.compList)
if (pageDto.compList.length === this.browSingModel.pageSize) {
this.browSingModel.currentPage++;
this.browSingModel.hasMore = true;
... ... @@ -109,4 +133,49 @@ struct MyCollectionListPage {
}
})
}
//数据处理
//单个选择
addCompDTO(isOn:boolean , compDTO: CompDTO){
compDTO.isSelect = isOn;
if (isOn === true){
this.selectDatas.push(compDTO)
}else {
this.selectDatas.splice(this.selectDatas.indexOf(compDTO),1)
}
this.deleteNum = this.selectDatas.length
this.isAllSelect = this.deleteNum === this.allDatas.length?true:false;
}
//全选
allSelectDatas(isOn:boolean){
let datas: CompDTO[] = [];
for (let index = 0; index < this.allDatas.length; index++) {
const compDTO = this.allDatas[index];
compDTO.isSelect = isOn
datas.push(compDTO)
}
this.selectDatas = []
this.allDatas = []
if (isOn === true) {
this.selectDatas.push(...datas)
}else {
this.selectDatas.splice(0,this.deleteNum)
}
this.allDatas.push(...datas)
this.deleteNum = this.selectDatas.length
}
//删除
deleteDatas(){
for (let index = 0; index < this.selectDatas.length; index++) {
const compDTO = this.allDatas[index];
this.allDatas.splice(this.selectDatas.indexOf(compDTO),1)
}
//重置删除状态
this.isEditState = false
this.isAllSelect = false
}
}
\ No newline at end of file
... ...
... ... @@ -11,6 +11,7 @@ const TAG = 'TopNavigationComponent';
*/
@Component
export struct TopNavigationComponent {
private tabsController: TabsController = new TabsController()
@Prop _currentNavIndex?: number;
// 顶导当前选中/焦点下标
@State currentTopNavSelectedIndex: number = 0;
... ... @@ -27,6 +28,7 @@ export struct TopNavigationComponent {
@State localChannelList: TopNavDTO[] = []
readonly MAX_LINE: number = 1;
//处理接口顶导数据
topNavListHandle() {
let defaultMyChannelList: TopNavDTO[] = []
let handledTopNavList = [...this.topNavList]
... ... @@ -76,8 +78,12 @@ export struct TopNavigationComponent {
})
}
isBroadcast (item: TopNavDTO) {
return item.name === '播报'
}
build() {
Column() {
// 顶部搜索、日报logo、早晚报
RelativeContainer() {
Stack({ alignContent: Alignment.Center }) {
... ... @@ -97,7 +103,6 @@ export struct TopNavigationComponent {
}
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Center)
}
.height(30)
.width(123)
... ... @@ -163,18 +168,20 @@ export struct TopNavigationComponent {
.width('100%')
.height(40)
.visibility(this._currentNavIndex == 0 ? Visibility.Visible : Visibility.None)
// 频道分类list
Stack({ alignContent: Alignment.TopEnd }) {
Tabs() {
Tabs({ controller: this.tabsController }) {
ForEach(this.myChannelList, (navItem: TopNavDTO, index: number) => {
TabContent() {
PageComponent({
currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
navIndex: index,
pageId: navItem.pageId + '',
channelId: navItem.channelId + ''
})
if(!this.isBroadcast(navItem)) {
PageComponent({
currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
navIndex: index,
pageId: navItem.pageId + '',
channelId: navItem.channelId + ''
})
}
}
.tabBar(this.tabBarBuilder(navItem, index))
}, (navItem: TopNavDTO) => JSON.stringify(navItem));
... ... @@ -184,15 +191,32 @@ export struct TopNavigationComponent {
.vertical(false)
.onChange((index: number) => {
Logger.info(TAG, `onChange index : ${index}`);
this.currentTopNavSelectedIndex = index;
if(!this.isBroadcast(this.myChannelList[index])) {
this.currentTopNavSelectedIndex = index;
} else {
// 跳转到播报页面
let taskAction: Action = {
type: 'JUMP_INNER_NEW_PAGE',
params: {
pageID: 'BroadcastPage',
id: this.myChannelList[index].pageId
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
this.tabsController.changeIndex(this.currentTopNavSelectedIndex)
}
})
// 分类列表最右侧频道设置
ChannelSubscriptionLayout({
changeTab: (index) => {
this.tabsController.changeIndex(index)
},
myChannelList: $myChannelList,
moreChannelList: $moreChannelList,
localChannelList: $localChannelList,
currentTopNavSelectedIndex: $currentTopNavSelectedIndex
})
// ChannelSubscriptionLayout()
}
}
... ... @@ -227,6 +251,7 @@ export struct TopNavigationComponent {
bottom: $r('app.float.top_tab_item_padding_bottom')
})
.id(`col_tabBar${index}`)
.margin({ right: this.myChannelList.length === index + 1 ? 36 : 0 })
}
aboutToAppear() {
... ...
import router from '@ohos.router'
@Component
export struct CustomTitleAndEditUI {
imgBack:boolean = true
titleName:string = "默认标题"
isDisplayButton:boolean = false
@Consume isEditState:boolean
editCallback: () => void = () => {
}
build() {
RelativeContainer() {
//标题栏目
if(this.imgBack){
Image($r('app.media.back_icon'))
.width('46lpx')
.height('46lpx')
.objectFit(ImageFit.Auto)
.interpolation(ImageInterpolation.High)
.id("back_icon")
.alignRules({
center: {anchor: "__container__", align: VerticalAlign.Center},
left: {anchor: "__container__", align: HorizontalAlign.Start}
})
.margin({left:'31lpx'})
.onClick(()=>{
router.back()
})
}
Text(this.titleName)
.height('42lpx')
.maxLines(1)
.id("title")
.fontSize('35lpx')
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.lineHeight('42lpx')
.alignRules({
center: {anchor: "__container__", align: VerticalAlign.Center},
middle: {anchor: "__container__", align: HorizontalAlign.Center}
})
if (this.isDisplayButton){
Button(this.isEditState === true?'取消':'编辑')
.type(ButtonType.Normal)
.fontColor($r('app.color.color_222222'))
.backgroundColor(Color.White)
.id("edit_Button")
.alignRules({
center: {anchor: "__container__", align: VerticalAlign.Center},
right: {anchor: "__container__", align: HorizontalAlign.End}
})
.margin({right:'31lpx'})
.onClick(()=>{
this.isEditState = !this.isEditState
this.editCallback()
})
}
}
.height('84lpx')
.width('100%')
.backgroundColor($r('app.color.white'))
}
}
\ No newline at end of file
... ...
... ... @@ -37,10 +37,10 @@ export struct CustomTitleUI {
center: {anchor: "__container__", align: VerticalAlign.Center},
middle: {anchor: "__container__", align: HorizontalAlign.Center}
})
}
.height('84lpx')
.width('100%')
.backgroundColor($r('app.color.white'))
}
}
\ No newline at end of file
... ...
... ... @@ -24,6 +24,7 @@ export struct CompStyle_09 {
// 大图
Image(this.compDTO.operDataList[0].coverUrl)
.width('100%')
.borderRadius({topLeft: $r('app.float.image_border_radius'), topRight: $r('app.float.image_border_radius')})
// 时间线--后端返回三个,
Column(){
ForEach(this.compDTO.operDataList[0].slideShows, (item:slideShows, index:number) => {
... ... @@ -44,7 +45,7 @@ export struct CompStyle_09 {
.backgroundColor($r('app.color.color_F5F5F5'))
.width(CommonConstants.FULL_WIDTH)
.height(40)
.borderRadius(3)
.borderRadius($r('app.float.button_border_radius'))
.justifyContent(FlexAlign.Center)
.margin({top: 5})
}
... ... @@ -103,7 +104,7 @@ export struct CompStyle_09 {
Image(item.fullColumnImgUrls[0].url)
.width(90)
.height(60)
.borderRadius(4)
.borderRadius($r('app.float.image_border_radius'))
}
}
}
... ...
... ... @@ -26,6 +26,7 @@ export struct CompStyle_10 {
// 大图
Image(this.compDTO.operDataList[0] && this.compDTO.operDataList[0].coverUrl)
.width('100%')
.borderRadius({topLeft: $r('app.float.image_border_radius'), topRight: $r('app.float.image_border_radius')})
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.compDTO?.operDataList[0])
})
... ... @@ -49,7 +50,7 @@ export struct CompStyle_10 {
.backgroundColor($r('app.color.color_F5F5F5'))
.width(CommonConstants.FULL_WIDTH)
.height(40)
.borderRadius(3)
.borderRadius($r('app.float.button_border_radius'))
.justifyContent(FlexAlign.Center)
.margin({top: 5})
.onClick((event: ClickEvent) => {
... ... @@ -105,7 +106,7 @@ export struct CompStyle_10 {
.width(117)
.height(78)
.objectFit(ImageFit.Cover)
.borderRadius(4)
.borderRadius($r('app.float.image_border_radius'))
.margin({left: 12})
}
}
... ...
@Component
export struct CustomBottomFuctionUI {
@Consume deleteNum: number
@Consume isAllSelect: boolean
selectAllCallback: (isOn: boolean) => void = () => {
}
confirmCallback: () => void = () => {
}
build() {
RelativeContainer(){
Row(){
Image(this.isAllSelect?$r("app.media.MyCollection_selected_icon"):$r("app.media.MyCollection_unselected_icon"))
.width('20')
.height('20')
.margin({right:'31lpx' })
Text(this.isAllSelect?'取消':'全选')
.fontColor($r('app.color.color_222222'))
.backgroundColor(Color.White)
}
.id("allSelect_Button")
.margin({left:'31lpx'})
.alignRules({
center: {anchor: "__container__", align: VerticalAlign.Center},
left: {anchor: "__container__", align: HorizontalAlign.Start}
})
.onClick(()=>{
this.isAllSelect = !this.isAllSelect;
this.selectAllCallback(this.isAllSelect)
})
Button('删除'+ (this.deleteNum === 0 ? '':'('+this.deleteNum.toString()+')'))
.type(ButtonType.Normal)
.fontColor(this.deleteNum === 0?$r('app.color.color_222222'):$r('app.color.color_ED2800'))
.backgroundColor(Color.White)
.id("delete_Button")
.alignRules({
center: {anchor: "__container__", align: VerticalAlign.Center},
right: {anchor: "__container__", align: HorizontalAlign.End}
})
.margin({right:'31lpx'})
.onClick(()=>{
this.confirmCallback()
})
}
.height('8%')
.width('100%')
.backgroundColor(Color.White)
}
}
\ No newline at end of file
... ...
@Component
export struct CustomSelectUI {
@State isOn: boolean = false
selectCallback: (isOn: boolean) => void = () => {
}
build() {
Button(){
Image(this.isOn?$r("app.media.MyCollection_selected_icon"):$r("app.media.MyCollection_unselected_icon"))
}
.backgroundColor(Color.White)
.type(ButtonType.Normal)
.width('20')
.height('20')
.onClick(() => {
this.isOn = !this.isOn;
this.selectCallback(this.isOn)
})
}
}
\ No newline at end of file
... ...
... ... @@ -47,7 +47,7 @@ export struct ZhGridLayoutComponent {
buildItemCard(item: ContentDTO) {
Column() {
Image(item.coverUrl)
.borderRadius(5)
.width(44)
.aspectRatio(1 / 1)
.margin(16)
Text(item.newsTitle)
... ...
... ... @@ -13,6 +13,8 @@ export struct AreaPickerDialog {
title: string = '地区选择'
@Provide dataSource: AreaListModel[] = []
result: JSON[] = [];
confirmCallback: (area:string) => void = () => {
}
build() {
Column(){
... ... @@ -35,7 +37,7 @@ export struct AreaPickerDialog {
Button('确定',{type:ButtonType.Normal})
.onClick(()=> {
this.controller.close()
Logger.info('area',this.currentFirst.label+this.currentSecondBean.label+this.currentThirdBean.label);
this.confirmCallback(this.currentFirst.label+this.currentSecondBean.label+this.currentThirdBean.label);
})
.backgroundColor(0xffffff)
.fontColor(Color.Blue)
... ...
... ... @@ -11,32 +11,37 @@ export class EditListInfo{
}
}
export interface EditInfoModel{
export class EditInfoModel{
//头像
headPhotoUrl:string
headPhotoUrl:string = ''
//简介
introduction:string
introduction:string = ''
//城市
city:string
city:string = ''
//地区
county:string
county:string = ''
//生日
birthday:string
birthday:string = ''
//性别
sex:number
sex:string = ''
airec:number
airec:number = 0
constructor(headPhotoUrl?:string , introduction?:string,city?:string , county?:string,birthday?:string , sex?:string,airec?:number) {
}
}
export interface editModel{
userName:string
export class editModel{
userName:string = ''
userNameStatus:string = ''
userNameStatus:string
phone:string = ''
phone:string
headPhotoStatus:string = ''
headPhotoStatus:string
userExtend:EditInfoModel = new EditInfoModel()
userExtend:EditInfoModel
constructor(userName?:string , userNameStatus?:string,phone?:string , headPhotoStatus?:string,userExtend?:EditInfoModel) {
}
}
\ No newline at end of file
... ...
... ... @@ -260,4 +260,29 @@ export class PageRepository {
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.get<ResponseDTO<CompInfoBean>>(url, headers)
};
}
\ No newline at end of file
/**
* 获取播报pageInfo
* */
static fetchBroadcastPageInfo(pageId: string) {
let url = PageRepository.getMorningEveningPageInfoUrl(pageId)
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.get<ResponseDTO<PageInfoBean>>(url, headers)
};
/**
* 获取播报compInfo
* https://pdapis.pdnews.cn/api/rmrb-bff-display-zh/display/zh/c/compInfo
* @param params
* @returns
* */
static fetchBroadcastCompInfo(pageId: number, groupId: number, refreshTime: string, topicId:
string, channelId: string) {
HttpUrlUtils.hostUrl = HttpUrlUtils.HOST_DEV
let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_COMP_INFO_PATH;
url = `${url}?topicId=${topicId}&channelStrategy=2&groupId=${groupId}&refreshTime=${refreshTime}&pageSize=50&recommend=0&pageId=${pageId}&loadStrategy=first_load&pageNum=1&channelId=${channelId}`
Logger.info(TAG, "getMorningEveningCompInfoUrl url = " + url)
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.get<ResponseDTO<CompInfoBean>>(url, headers)
};
}
... ...
import { CompInfoBean, PageInfoBean } from 'wdBean/Index';
import { Logger } from 'wdKit/Index';
import { ResponseDTO } from 'wdNetwork/Index';
import { PageRepository } from '../repository/PageRepository';
const TAG = 'BroadcastViewModel'
export class BroadcastViewModel {
static async getBroadcastViewPageInfo(pageId: string): Promise<PageInfoBean> {
return new Promise<PageInfoBean>((success, error) => {
Logger.info(TAG, `getBroadcastViewPageInfo pageInfo start`);
PageRepository.fetchMorningEveningPageInfo(pageId).then((resDTO: ResponseDTO<PageInfoBean>) => {
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'getBroadcastViewPageInfo then navResDTO is empty');
error('resDTO is empty');
return
}
if (resDTO.code != 0) {
Logger.error(TAG, `getBroadcastViewPageInfo then code:${resDTO.code}, message:${resDTO.message}`);
error('resDTO Response Code is failure');
return
}
// let navResStr = JSON.stringify(navResDTO);
Logger.info(TAG, "getBroadcastViewPageInfo then,navResDTO.timestamp:" + resDTO.timestamp);
success(resDTO.data);
}).catch((err: Error) => {
Logger.error(TAG, `getBroadcastViewPageInfo catch, error.name : ${err.name}, error.message:${err.message}`);
error(err);
})
})
}
// 获取播报组件信息:https://pdapis.pdnews.cn/api/rmrb-bff-display-zh/display/zh/c/compInfo?topicId=&
// channelStrategy=2&groupId=30113&refreshTime=1712023953772&pageSize=50&recommend=0&pageId=21003&loadStrategy=first_load&pageNum=1&channelId=2066
static async getBroadcastCompInfo(pageId: number, groupId: number, refreshTime: string, topicId: string, channelId: string): Promise<CompInfoBean> {
return new Promise<CompInfoBean>((success, error) => {
Logger.info(TAG, `getMorningEveningCompInfo pageInfo start`);
PageRepository.fetchBroadcastCompInfo(pageId, groupId, refreshTime, topicId, channelId)
.then((resDTO: ResponseDTO<CompInfoBean>) => {
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'getMorningEveningCompInfo then navResDTO is empty');
error('resDTO is empty');
return
}
if (resDTO.code != 0) {
Logger.error(TAG, `getMorningEveningCompInfo then code:${resDTO.code}, message:${resDTO.message}`);
error('resDTO Response Code is failure');
return
}
// let navResStr = JSON.stringify(navResDTO);
Logger.info(TAG, "getMorningEveningCompInfo then,navResDTO.timestamp:" + resDTO.timestamp);
success(resDTO.data);
})
.catch((err: Error) => {
Logger.error(TAG, `getMorningEveningCompInfo catch, error.name : ${err.name}, error.message:${err.message}`);
error(err);
})
})
}
}
\ No newline at end of file
... ...
... ... @@ -30,11 +30,11 @@ class EditInfoViewModel {
getEditListInfo(item?:editModel):EditListInfo[]{
this.editListData = [
new EditListInfo('昵称',item&&item.userName?item.userName:'待完善'),
new EditListInfo('简介',item&&item.userExtend.introduction?item.userExtend.introduction:'待完善'),
new EditListInfo('地区',item&&item.userExtend.city?item.userExtend.city:'待完善'),
new EditListInfo('生日',item&&item.userExtend.birthday?item.userExtend.birthday:'待完善'),
new EditListInfo('性别',item&&item.userExtend.sex?item.userExtend.sex===1?'男':'女':'待完善'),
new EditListInfo('昵称',item&&item.userName.length > 0?item.userName:'待完善'),
new EditListInfo('简介',item&&item.userExtend.introduction.length > 0?item.userExtend.introduction:'待完善'),
new EditListInfo('地区',item&&item.userExtend.city.length > 0?item.userExtend.city:'待完善'),
new EditListInfo('生日',item&&item.userExtend.birthday.length > 0?item.userExtend.birthday:'待完善'),
new EditListInfo('性别',item&&item.userExtend.sex.length > 0?(item.userExtend.sex=== '1'?'男':'女'):'待完善'),
]
return this.editListData
}
... ... @@ -61,7 +61,7 @@ class EditInfoViewModel {
let compRes: ResponseDTO<editModel> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<editModel>>(context,'userInfo.json');
if (!compRes || !compRes.data) {
Logger.info(TAG, `getAppointmentListDataLocal compRes is empty`);
return {} as editModel
return new editModel()
}
Logger.info(TAG, `getAppointmentListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);
return compRes.data
... ...
... ... @@ -82,7 +82,11 @@
},
{
"name": "image_border_radius",
"value": "8vp"
"value": "5vp"
},
{
"name": "button_border_radius",
"value": "3vp"
},
{
"name": "border_radius_6",
... ...
import { BroadcastPageComponent } from 'wdComponent';
import { Logger } from 'wdKit';
const TAG = 'BroadcastPageComponent';
@Entry
@Component
struct BroadcastPage {
build() {
Column() {
BroadcastPageComponent()
}
}
pageTransition() {
// 定义页面进入时的效果,从底侧滑入
PageTransitionEnter({ type: RouteType.None, duration: 300 })
.slide(SlideEffect.Bottom)
// 定义页面退出时的效果,向底侧滑出
PageTransitionExit({ type: RouteType.None, duration: 300 })
.slide(SlideEffect.Bottom)
}
aboutToAppear() {
Logger.info(TAG, 'aboutToAppear');
}
aboutToDisappear() {
Logger.info(TAG, 'aboutToDisappear');
}
onPageShow() {
Logger.info(TAG, 'onPageShow');
}
onPageHide() {
Logger.info(TAG, 'onPageHide');
}
onBackPress() {
Logger.info(TAG, 'onBackPress');
}
}
\ No newline at end of file
... ...
... ... @@ -29,8 +29,5 @@ struct AudioDetail {
this.relId = params?.extra?.relId || '';
this.relType = params?.extra?.relType || '';
this.contentId = params?.contentID || '';
Logger.info(TAG, 'aboutToAppear');
Logger.info(TAG, 'params', JSON.stringify(params));
console.log('参数',JSON.stringify(par))
}
}
\ No newline at end of file
... ...
... ... @@ -9,6 +9,7 @@
"pages/detail/MultiPictureDetailPage",
"pages/launchPage/PrivacyPage",
"pages/launchPage/LaunchPage",
"pages/launchPage/LaunchAdvertisingPage"
"pages/launchPage/LaunchAdvertisingPage",
"pages/broadcast/BroadcastPage"
]
}
... ...