zhaojunkai

Merge remote-tracking branch 'origin/main'

Showing 41 changed files with 2724 additions and 120 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
... ...
... ... @@ -56,6 +56,10 @@ export class HttpUrlUtils {
*/
static readonly INTERACT_EXECUTECOLLECTRECORD: string = "/api/rmrb-interact/interact/zh/c/collect/executeCollcetRecord";
/**
* 关注号主
*/
static readonly INTERACT_ACCENTION_OPERATION: string = "/api/rmrb-interact/interact/zh/c/attention/operation";
/**
* 用户等级/积分-APP根据业务场景动态增减成长值(APP)
*/
static readonly USERPOINT_OPERATE: string = "/api/rmrb-user-point/auth/pointLevel/zh/operate";
... ... @@ -144,12 +148,10 @@ export class HttpUrlUtils {
* 个人中心 我的关注列表
*/
static readonly OTHER_USER_FOLLOW_LIST_DATA_PATH: string = "/api/rmrb-interact/interact/zh/c/userAttention/list";
/**
* 预约操作
*/
static readonly APPOINTMENT_OPERATION_STATUS_PATH: string = "/api/live-center-message/zh/c/live/subscribe";
/**
* 点赞操作
*/
... ... @@ -169,11 +171,12 @@ 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_PRODUCT;
private static _hostUrl: string = HttpUrlUtils.HOST_UAT;
public static set hostUrl(value: string) {
HttpUrlUtils._hostUrl = value;
}
private static userId = ''
private static userType = ''
private static token = ''
... ... @@ -189,8 +192,8 @@ export class HttpUrlUtils {
headers.set('timestamp', HttpUrlUtils.getTimestamp())
headers.set('RMRB-X-TOKEN', HttpUrlUtils.getXToken())
headers.set('device_id', HttpUrlUtils.getDeviceId())
if(HttpUrlUtils.getXToken()!=''){
headers.set('cookie', 'RMRB-X-TOKEN='+HttpUrlUtils.getXToken())
if (HttpUrlUtils.getXToken() != '') {
headers.set('cookie', 'RMRB-X-TOKEN=' + HttpUrlUtils.getXToken())
}
headers.set('build_version', HttpUrlUtils.getVersion())
headers.set('adcode', HttpUrlUtils.getAdCode())
... ... @@ -271,20 +274,20 @@ export class HttpUrlUtils {
}
private static getXToken() {
if(StringUtils.isNotEmpty(HttpUrlUtils.token)){
if (StringUtils.isNotEmpty(HttpUrlUtils.token)) {
return HttpUrlUtils.token
}
HttpUrlUtils.token = SPHelper.default.getSync(SpConstants.USER_JWT_TOKEN,"") as string
if(StringUtils.isNotEmpty(HttpUrlUtils.token)) {
return HttpUrlUtils.token
HttpUrlUtils.token = SPHelper.default.getSync(SpConstants.USER_JWT_TOKEN, "") as string
if (StringUtils.isNotEmpty(HttpUrlUtils.token)) {
return HttpUrlUtils.token
}
return 'eyJhbGciOiJIUzI1NiIsImtpZCI6ImQ4WkI2QkhxSEZrdjJ2U25BNlRwZEdKRjBHcjItVzBvS2FaYzdLOUUycmcifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcwMzY0OTYwNiwidXNlcklkIjo0NTk3NzYyOTc0NzQ5NDksInVzZXJWZXJzaW9uIjoiNDU5Nzc2Mjk3NDc0OTQ5XzIiLCJ1c2VyTmFtZSI6IkJ1bGlraWtpMTgxIiwidXNlclR5cGUiOjIsImNyZWF0b3JJZCI6NDI2NTM5MH0.jhQ9kylcm3FxWf0-lBMZuLkdtIQ6XpFnAi0AFZJNwfc';
}
static getRefreshToken() {
let refreshToken = SPHelper.default.getSync(SpConstants.USER_REFRESH_TOKEN,"")
if(StringUtils.isNotEmpty(refreshToken)) {
return refreshToken as string;
static getRefreshToken() {
let refreshToken = SPHelper.default.getSync(SpConstants.USER_REFRESH_TOKEN, "")
if (StringUtils.isNotEmpty(refreshToken)) {
return refreshToken as string;
}
return '';
}
... ... @@ -347,18 +350,18 @@ export class HttpUrlUtils {
public static getUserId() {
// TODO 对接登录
if(StringUtils.isNotEmpty(HttpUrlUtils.userId)){
if (StringUtils.isNotEmpty(HttpUrlUtils.userId)) {
return HttpUrlUtils.userId
}
HttpUrlUtils.userId = SPHelper.default.getSync(SpConstants.USER_ID,"") as string
HttpUrlUtils.userId = SPHelper.default.getSync(SpConstants.USER_ID, "") as string
return HttpUrlUtils.userId;
}
public static getUserType() {
if(StringUtils.isNotEmpty(HttpUrlUtils.userType)){
public static getUserType() {
if (StringUtils.isNotEmpty(HttpUrlUtils.userType)) {
return HttpUrlUtils.userType
}
HttpUrlUtils.userType = SPHelper.default.getSync(SpConstants.USER_Type,"") as string
HttpUrlUtils.userType = SPHelper.default.getSync(SpConstants.USER_Type, "") as string
return HttpUrlUtils.userType;
}
... ...
... ... @@ -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");
}
... ...
... ... @@ -23,7 +23,7 @@ export { Pic } from './src/main/ets/bean/content/Pic'
export { InteractDataDTO } from './src/main/ets/bean/content/InteractDataDTO';
export { InteractDataStatusBean, PhotoListBean } from './src/main/ets/bean/detail/MultiPictureDetailPageDTO';
export { InteractDataStatusBean, PhotoListBean, InputMethodProperty } from './src/main/ets/bean/detail/MultiPictureDetailPageDTO';
export { InteractParam, ContentBean } from './src/main/ets/bean/content/InteractParam';
... ...
... ... @@ -17,4 +17,84 @@ export interface PhotoListBean {
width: number;
picPath: string;
picDesc: string;
}
export interface InputMethodProperty {
/**
* The name of input method
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 8
* @deprecated since 9
* @useinstead inputMethod.InputMethodProperty#name
*/
readonly packageName: string;
/**
* The id of input method
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 8
* @deprecated since 9
* @useinstead inputMethod.InputMethodProperty#id
*/
readonly methodId: string;
/**
* The name of input method
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
readonly name: string;
/**
* The id of input method
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
readonly id: string;
/**
* The label of input method
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
readonly label?: string;
/**
* The label id of input method
*
* @type { ?number }
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 10
*/
readonly labelId?: number;
/**
* The icon of input method
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
readonly icon?: string;
/**
* The icon id of input method
*
* @type { ?number }
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
readonly iconId?: number;
/**
* The extra info of input method
*
* @type { object }
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
/**
* The extra info of input method
*
* @type { ?object }
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 10
*/
extra?: object;
}
\ 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"
... ...
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 { 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) {
... ...
... ... @@ -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 { ToastUtils, Logger } from 'wdKit';
import { InputMethodProperty } from 'wdBean';
import router from '@ohos.router';
import inputMethod from '@ohos.inputMethod';
export interface OperationItem {
icon: Resource;
... ... @@ -25,7 +28,6 @@ export struct OperRowListView {
{
icon: $r('app.media.ic_collect_uncheck'),
text: "收藏",
num: 662,
},
{
icon: $r('app.media.ic_share'),
... ... @@ -54,8 +56,8 @@ export struct OperRowListView {
})
.alignItems(HorizontalAlign.Center)
.hoverEffect(HoverEffect.Scale)
.onClick((event: ClickEvent) => {
ToastUtils.showToast('体验版,本功能暂未开发', 1000);
.onClick(() => {
router.back();
})
TextInput({placeholder:'说两句...'})
.placeholderColor('#999999')
... ... @@ -71,6 +73,9 @@ export struct OperRowListView {
.width('61.5%')
.height(30)
.borderRadius(0)
.onClick(() => {
this.buildInputMethod()
})
}
.width('45.5%')
.alignItems(VerticalAlign.Center)
... ... @@ -78,7 +83,7 @@ export struct OperRowListView {
Flex({ justifyContent: FlexAlign.SpaceAround, alignItems:ItemAlign.Center }) {
ForEach(this.operationList, (item: OperationItem, index: number) => {
this.buildOperationItem(item, index)
}, (item: OperationItem, index: number) => JSON.stringify(item))
}, (item: OperationItem) => JSON.stringify(item))
}
.width('54.5%')
}
... ... @@ -95,18 +100,84 @@ export struct OperRowListView {
@Builder
buildOperationItem(item: OperationItem, index: number) {
Column() {
Image(item.icon)
.width(24)
.height(24)
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
RelativeContainer() {
Row() {
Image(item.icon)
.width(24)
.height(24)
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
}
.alignRules({
center: { anchor: '__container__', align: VerticalAlign.Center },
middle: { anchor: '__container__', align: HorizontalAlign.Center }
})
.id(`e_row1_${index}`)
if(item.num) {
Row() {
Image($r('app.media.corner_mark'))
.width(25)
.height(12)
.interpolation(ImageInterpolation.High)
}
.alignRules({
top: { anchor: `e_row1_${index}`, align: VerticalAlign.Top },
left: { anchor: `e_row1_${index}`, align: HorizontalAlign.Center }
})
.id(`e_row2_${index}`)
Row() {
Text('99+')
.fontSize(8)
.textAlign(TextAlign.Center)
.fontColor(Color.White)
.lineHeight(12)
}
.alignRules({
top: { anchor: `e_row2_${index}`, align: VerticalAlign.Top },
middle: { anchor: `e_row2_${index}`, align: HorizontalAlign.Center }
})
.id(`e_row3_${index}`)
}
}
.id(`e_icon_${index}`)
}
.margin(5)
.alignItems(HorizontalAlign.Center)
.hoverEffect(HoverEffect.Scale)
.onClick((event: ClickEvent) => {
.onClick(() => {
Logger.info(TAG, `buildOperationItem onClick event index: ${index}`);
ToastUtils.showToast('体验版,本功能暂未开发', 1000);
})
}
/**
* 输入法
*/
private buildInputMethod() {
let im = inputMethod.getCurrentInputMethod();
let prop: InputMethodProperty = {
packageName: im.packageName,
methodId: im.methodId,
name: im.name,
id: im.id,
extra: {}
}
try{
inputMethod.switchInputMethod(prop, (err, result) => {
if (err !== undefined) {
console.error('Failed to switchInputMethod: ' + JSON.stringify(err));
return;
}
if (result) {
console.info('Succeeded in switching inputmethod.');
} else {
console.error('Failed to switchInputMethod.');
}
});
} catch(err) {
console.error('Failed to switchInputMethod: ' + JSON.stringify(err));
}
}
}
\ No newline at end of file
... ...
... ... @@ -213,4 +213,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
... ...
... ... @@ -116,6 +116,16 @@ export interface postInteractBrowsOperateParams {
contentList: postInteractBrowsOperateParamsContent[]
}
export interface postInteractAccentionOperateParams {
attentionUserType: string;
attentionUserId: string;
attentionCreatorId: string;
// userType: number;
// userId: string;
status: number;
}
export class ContentDetailRequest {
static getContentDetailDataMock(context: Context): Promise<ResponseDTO<ContentDetailDTO[]>> {
Logger.info(TAG, `getContentDetailDataMock start`);
... ... @@ -191,7 +201,7 @@ export class ContentDetailRequest {
}
/**
*用户点赞、取消点赞
* 用户点赞、取消点赞
* @param params
* @returns
*/
... ... @@ -202,7 +212,7 @@ export class ContentDetailRequest {
}
/**
*用户收藏、取消收藏
* 用户收藏、取消收藏
* @param params
* @returns
*/
... ... @@ -240,4 +250,13 @@ export class ContentDetailRequest {
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post0(url, params, headers)
}
/**
* 关注号主
*/
static postInteractAccentionOperate(params: postInteractAccentionOperateParams): Promise<ResponseDTO> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_ACCENTION_OPERATION
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post0(url, params, headers)
}
}
\ No newline at end of file
... ...
... ... @@ -37,16 +37,19 @@ export struct DetailPlayShortVideoPage {
if (this.currentIndex != this.index) {
this.playerController.pause()
// if (this.index < this.currentIndex - 5 && this.playerController.getPlayer()) {
// this.playerController.release()
// }
if (this.index < this.currentIndex - 5 && this.playerController.getPlayer()) {
this.playerController.release()
}
} else {
this.queryNewsInfoOfUser()
console.log('currentIndex==== ', this.currentIndex)
if (!this.playerController.getPlayer()) {
console.error('state91111111===', this.contentDetailData?.videoInfo[0]?.videoUrl || '')
this.playerController.firstPlay(this.contentDetailData?.videoInfo[0]?.videoUrl || '');
console.error('state91111111===', this.playerController?.getPlayer()?.state)
} else {
console.error('state9===', this.playerController?.getPlayer()?.state)
this.playerController.play()
}
... ... @@ -103,7 +106,7 @@ export struct DetailPlayShortVideoPage {
}
aboutToAppear() {
console.log('开始设置setContentDetailData', JSON.stringify(this.contentDetailData))
// console.log('开始设置setContentDetailData', JSON.stringify(this.contentDetailData))
this.videoLandScape = this.contentDetailData?.videoInfo[0]?.videoLandScape
this.queryNewsInfoOfUser()
this.playerController.onCanplay = () => {
... ... @@ -136,7 +139,8 @@ export struct DetailPlayShortVideoPage {
}
aboutToDisappear(): void {
this.playerController?.pause();
console.log('aboutToDisappear', this.index)
this.playerController?.release();
// this.playerController.onCanplay = ()={}
}
... ... @@ -153,7 +157,7 @@ export struct DetailPlayShortVideoPage {
WDPlayerRenderView({
playerController: this.playerController,
onLoad: async () => {
console.log('onload==',)
// console.log('onload==', this.index)
// if (this.index === 0) {
this.playerController.firstPlay(this.contentDetailData?.videoInfo[0]?.videoUrl);
// }
... ...
... ... @@ -91,11 +91,8 @@ export struct DetailVideoListPage {
if (res.data) {
this.data = this.data.concat(res.data)
}
console.log('queryVideoList===', JSON.stringify(this.data))
// console.log('queryVideoList===', JSON.stringify(this.data))
})
}
build() {
... ...
@Entry
@Preview
@Component
export struct Test {
@Prop currentItem: string = '';
@Prop @Watch('currentIndexChange') currentIndex: number = 0;
@Prop index: number = 0;
currentIndexChange() {
console.log('currentIndexChange====', this.currentIndex);
}
build() {
Row() {
Column() {
Text('currentItem: ' + this.currentItem).fontSize(30)
Text('currentIndex: ' + this.currentIndex).fontSize(30)
Text('index: ' + this.index).fontSize(30)
}
RelativeContainer() {
Image($r('app.media.ic_like_uncheck'))
.width('100%')
.borderRadius(24)
.aspectRatio(1)
.border({ width: 1, color: Color.White, style: BorderStyle.Solid })
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.id("row1")
Image($r('app.media.ic_add'))
.width(24)
.borderRadius(12)
.alignRules({
left: { anchor: "__container__", align: HorizontalAlign.Center },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
})
.margin({ left: -12 })
.id("row2")
}.height('auto')
}
.height(58)
.width(48)
.backgroundColor(Color.Black)
}
}
\ No newline at end of file
... ...
... ... @@ -5,7 +5,8 @@ import {
ContentDetailRequest,
contentListParams,
postExecuteCollectRecordParams,
postExecuteLikeParams
postExecuteLikeParams,
postInteractAccentionOperateParams
} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
import { ToastUtils } from 'wdKit';
import { HttpUrlUtils } from 'wdNetwork/Index';
... ... @@ -30,6 +31,7 @@ export struct OperationListView {
@Consume interactData: InteractDataDTO
@Consume contentDetailData: ContentDetailDTO
@Consume newsStatusOfUser: batchLikeAndCollectResult
@Consume followStatus: string
@State operationList: OperationItem[] = [
{
icon: $r('app.media.ic_like_uncheck'),
... ... @@ -128,30 +130,73 @@ export struct OperationListView {
})
}
build() {
getImgUrl() {
return this.contentDetailData?.rmhInfo?.rmhHeadUrl || this.contentDetailData?.userInfo?.userHeadUrl
}
Column() {
this.buildUserComp()
ForEach(this.operationList, (item: OperationItem, index: number) => {
this.buildOperationItem(item, index)
}, (item: OperationItem, index: number) => JSON.stringify(item))
/**
* 关注号主
*/
handleAccention() {
// 未登录,跳转登录
if (!HttpUrlUtils.getUserId()) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
.width(48)
}
getImgUrl() {
return this.contentDetailData?.rmhInfo?.rmhHeadUrl || this.contentDetailData?.userInfo?.userHeadUrl
const params2: postInteractAccentionOperateParams = {
attentionUserType: this.contentDetailData?.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号)
attentionUserId: this.contentDetailData?.rmhInfo?.userId || '', // 被关注用户号主id
attentionCreatorId: this.contentDetailData?.rmhInfo?.rmhId || '', // 被关注用户号主id
// userType: 1,
// userId: '1',
status: 1,
}
ContentDetailRequest.postInteractAccentionOperate(params2).then(res => {
console.log('关注号主==', JSON.stringify(res.data))
if (this.followStatus == '1') {
this.followStatus = '0'
} else {
this.followStatus = '1'
}
})
}
@Builder
buildUserComp() {
Column() {
if (this.getImgUrl()) {
Image(this.getImgUrl())
.width('100%')
.borderRadius(24)
.aspectRatio(1)
.border({ width: 1, color: Color.White, style: BorderStyle.Solid })
RelativeContainer() {
Image(this.getImgUrl())
.width('100%')
.borderRadius(24)
.aspectRatio(1)
.border({ width: 1, color: Color.White, style: BorderStyle.Solid })
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.id("row1")
.onClick(() => {
// 号主页
})
if (this.followStatus == '0') {
Image($r('app.media.ic_add'))
.width(24)
.borderRadius(12)
.alignRules({
left: { anchor: "__container__", align: HorizontalAlign.Center },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
})
.margin({ left: -12 })
.id("row2")
.onClick(() => {
// 关注
this.handleAccention()
})
}
}.height(60)
}
}.margin({ bottom: 30 })
}
... ... @@ -160,7 +205,7 @@ export struct OperationListView {
buildOperationItem(item: OperationItem, index: number) {
Column() {
if (item.text === '赞') {
Image(this.newsStatusOfUser?.likeStatus == '0' ? item.icon : item.icon_check)
Image(this.newsStatusOfUser?.likeStatus == '1' ? item.icon_check : item.icon)
.width(32)
.aspectRatio(1)
.onClick(() => {
... ... @@ -175,7 +220,7 @@ export struct OperationListView {
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
} else if (item.text === '收藏') {
Image(this.newsStatusOfUser?.collectStatus == 0 ? item.icon : item.icon_check)
Image(this.newsStatusOfUser?.collectStatus == 1 ? item.icon_check : item.icon)
.width(32)
.aspectRatio(1)
.onClick(() => {
... ... @@ -193,6 +238,9 @@ export struct OperationListView {
Image(item.icon)
.width(32)
.aspectRatio(1)
.onClick((event: ClickEvent) => {
ToastUtils.showToast('评论为公共方法,待开发', 1000);
})
Text(this.interactData?.commentNum ? (this.interactData.commentNum + '') : item.text)
.width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
.fontWeight(500)
... ... @@ -205,6 +253,9 @@ export struct OperationListView {
Image(item.icon)
.width(32)
.aspectRatio(1)
.onClick((event: ClickEvent) => {
ToastUtils.showToast('分享为公共方法,待开发', 1000);
})
Text(item.text)
.width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
.fontWeight(500)
... ... @@ -216,15 +267,20 @@ export struct OperationListView {
}
}
.width(32)
// .width(48)
.margin({ bottom: 20 })
// .backgroundColor(Color.Black)
.alignItems(HorizontalAlign.Center)
.hoverEffect(HoverEffect.Scale)
// .onClick((event: ClickEvent) => {
// console.info(TAG, `buildOperationItem onClick event index: ${index}`);
// // ToastUtils.showToast('体验版,本功能暂未开发', 1000);
// })
}
build() {
Column() {
this.buildUserComp()
ForEach(this.operationList, (item: OperationItem, index: number) => {
this.buildOperationItem(item, index)
}, (item: OperationItem, index: number) => JSON.stringify(item))
}
.width(48)
}
}
\ No newline at end of file
... ...
{
"src": [
"pages/DetailVideoListPage",
"pages/Test"
"pages/DetailVideoListPage"
]
}
\ No newline at end of file
... ...
... ... @@ -2,6 +2,7 @@ import media from '@ohos.multimedia.media';
import prompt from '@ohos.promptAction';
import { Logger } from '../utils/Logger';
import { PlayerConstants, AVPlayerStatus, Events } from '../constants/PlayerConstants';
import { BusinessError } from '@ohos.base';
@Observed
export class WDPlayerController {
... ... @@ -44,7 +45,10 @@ export class WDPlayerController {
Logger.error('[PlayVideoModel] createAvPlayer fail!');
reject();
}
}).catch((error: BusinessError) => {
console.error(`AVPlayer catchCallback, error message:${error.message}`);
});
;
});
}
... ...
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
... ...
... ... @@ -9,6 +9,7 @@
"pages/detail/MultiPictureDetailPage",
"pages/launchPage/PrivacyPage",
"pages/launchPage/LaunchPage",
"pages/launchPage/LaunchAdvertisingPage"
"pages/launchPage/LaunchAdvertisingPage",
"pages/broadcast/BroadcastPage"
]
}
... ...