王士厅
Showing 49 changed files with 2815 additions and 133 deletions
1 import { StringUtils } from './StringUtils'; 1 import { StringUtils } from './StringUtils';
2 - 2 +import getLunar from './GetLunar'
3 /** 3 /**
4 * 日期/时间工具 4 * 日期/时间工具
5 */ 5 */
@@ -457,6 +457,15 @@ export class DateTimeUtils { @@ -457,6 +457,15 @@ export class DateTimeUtils {
457 return timeStr; 457 return timeStr;
458 } 458 }
459 459
  460 + /**
  461 + * 获取农历日期
  462 + * @param _date eg: '2024-02-01 12:12:12' or '2024-02-01' 如果不传,取当前时间
  463 + * @returns eg: '二月廿五'
  464 + * 如果后面有其他农历需求,可以引入农历插件。这个引入的getLunar文件可以删除
  465 + */
  466 + static getLunar(_date?: string) {
  467 + return getLunar(_date)
  468 + }
460 } 469 }
461 470
462 // const dateTimeUtils = new DateTimeUtils() 471 // const dateTimeUtils = new DateTimeUtils()
  1 +/**
  2 + * 获取某个日期的农历
  3 + * @parmas {newDate} 日期 年-月-日
  4 + */
  5 +export default function getLunar(newDate){
  6 + var nyear;
  7 + var nmonth;
  8 + var nday = -1;
  9 + var nwday;
  10 + var nhrs;
  11 + var nmin;
  12 + var nsec;
  13 + var newDate = newDate;
  14 +
  15 + var lmonth, lday, lleap; //农历参数
  16 +
  17 + function Draw() {
  18 + NewTick();
  19 +
  20 + //显示时间
  21 + var s = nyear + '年' + nmonth + '月' + nday + '日 ' + '星期' + cweekday(nwday) + ' ' + shapetime(nhrs, nmin, nsec);
  22 + s += " 农历" + lmonth + "月" + lday; //农历
  23 + var lunar_month_day=lmonth + "月" + lday;
  24 + return lunar_month_day;
  25 + }
  26 +
  27 +
  28 + function NewTick() {
  29 + console.warn('noww---', newDate)
  30 + var noww = newDate ? new Date(newDate) : new Date();
  31 + if (noww.getDate() != nday) {
  32 + nyear = noww.getFullYear();
  33 + nmonth = noww.getMonth() + 1;
  34 + nwday = noww.getDay();
  35 + nday = noww.getDate();
  36 +
  37 + getlunar(); //获取农历
  38 + }
  39 + nhrs = noww.getHours();
  40 + nmin = noww.getMinutes();
  41 + nsec = noww.getSeconds();
  42 + }
  43 +
  44 +
  45 + //辅助函数
  46 + var hzWeek = new Array("日", "一", "二", "三", "四", "五", "六", "日");
  47 + function cweekday(wday) {
  48 + return hzWeek[wday];
  49 + }
  50 + function shapetime(vhrs, vmin, vsec) {
  51 + if (vsec <= 9) vsec = "0" + vsec;
  52 + if (vmin <= 9) vmin = "0" + vmin;
  53 + if (vhrs <= 9) vhrs = "0" + vhrs;
  54 + return vhrs + ":" + vmin + ":" + vsec
  55 + }
  56 +
  57 + //农历函数开始
  58 + 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
  59 + 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);
  60 + function lYearDays(y) {
  61 + var i, sum = 348;
  62 + for (i = 0x8000; i > 0x8; i >>= 1) sum += (lunarInfo[y - 1900] & i) ? 1 : 0;
  63 + return (sum + leapDays(y));
  64 + }
  65 + function leapDays(y) {
  66 + if (leapMonth(y)) return ((lunarInfo[y - 1900] & 0x10000) ? 30 : 29);
  67 + else return (0);
  68 + }
  69 + function leapMonth(y) {
  70 + return (lunarInfo[y - 1900] & 0xf);
  71 + }
  72 + function monthDays(y, m) {
  73 + return ((lunarInfo[y - 1900] & (0x10000 >> m)) ? 30 : 29);
  74 + }
  75 + function Lunar(y, m, d) {
  76 + var i, leap = 0,
  77 + temp = 0;
  78 + var offset = (Date.UTC(y, m, d) - Date.UTC(1900, 0, 31)) / 86400000;
  79 + for (i = 1900; i < 2050 && offset > 0; i++) {
  80 + temp = lYearDays(i);
  81 + offset -= temp;
  82 + }
  83 + if (offset < 0) {
  84 + offset += temp;
  85 + i--;
  86 + }
  87 + this.year = i;
  88 + leap = leapMonth(i);
  89 + this.isLeap = false;
  90 + for (i = 1; i < 13 && offset > 0; i++) {
  91 + if (leap > 0 && i == (leap + 1) && this.isLeap == false) {--i;
  92 + this.isLeap = true;
  93 + temp = leapDays(this.year);
  94 + } else {
  95 + temp = monthDays(this.year, i);
  96 + }
  97 + if (this.isLeap == true && i == (leap + 1)) this.isLeap = false;
  98 + offset -= temp;
  99 + }
  100 + if (offset == 0 && leap > 0 && i == leap + 1) if (this.isLeap) {
  101 + this.isLeap = false;
  102 + } else {
  103 + this.isLeap = true; --i;
  104 + }
  105 + if (offset < 0) {
  106 + offset += temp; --i;
  107 + }
  108 + this.month = i;
  109 + this.day = offset + 1;
  110 + }
  111 + var nStr1 = new Array('', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二');
  112 + var nStr2 = new Array('初', '十', '廿', '卅', '□');
  113 + function GetcDay(d) {
  114 + var s;
  115 + switch (d) {
  116 + case 10:
  117 + s = '初十';
  118 + break;
  119 + case 20:
  120 + s = '二十';
  121 + break;
  122 + case 30:
  123 + s = '三十';
  124 + break;
  125 + default:
  126 + s = nStr2[Math.floor(d / 10)];
  127 + s += nStr1[d % 10];
  128 + break;
  129 + }
  130 + return (s);
  131 + }
  132 + function GetcMon(m) {
  133 + if (m == 1) return '正';
  134 + else return nStr1[m];
  135 + }
  136 + function getlunar() {
  137 + var lObj = new Lunar(nyear, nmonth - 1, nday);
  138 + lmonth = GetcMon(lObj.month);
  139 + lday = GetcDay(lObj.day);
  140 + lleap = lObj.isLeap;
  141 + if (lleap == 1) {
  142 + lmonth = "闰" + lmonth;
  143 + }
  144 + }
  145 + //农历函数结束
  146 + return Draw();
  147 +}
@@ -171,7 +171,7 @@ export class HttpUrlUtils { @@ -171,7 +171,7 @@ export class HttpUrlUtils {
171 * */ 171 * */
172 static readonly MORNING_EVENING_PAGE_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/pageInfo"; 172 static readonly MORNING_EVENING_PAGE_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/pageInfo";
173 static readonly MORNING_EVENING_COMP_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/compInfo"; 173 static readonly MORNING_EVENING_COMP_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/compInfo";
174 - private static _hostUrl: string = HttpUrlUtils.HOST_UAT; 174 + private static _hostUrl: string = HttpUrlUtils.HOST_PRODUCT;
175 175
176 public static set hostUrl(value: string) { 176 public static set hostUrl(value: string) {
177 HttpUrlUtils._hostUrl = value; 177 HttpUrlUtils._hostUrl = value;
@@ -73,6 +73,8 @@ export function registerRouter() { @@ -73,6 +73,8 @@ export function registerRouter() {
73 return WDRouterPage.morningEveningPaperPage 73 return WDRouterPage.morningEveningPaperPage
74 } else if (action.params?.pageID == "IMAGE_TEXT_DETAIL") { 74 } else if (action.params?.pageID == "IMAGE_TEXT_DETAIL") {
75 return WDRouterPage.imageTextDetailPage 75 return WDRouterPage.imageTextDetailPage
  76 + } else if (action.params?.pageID == "BroadcastPage") {
  77 + return WDRouterPage.broadcastPage
76 } 78 }
77 return undefined 79 return undefined
78 }) 80 })
@@ -83,4 +83,7 @@ export class WDRouterPage { @@ -83,4 +83,7 @@ export class WDRouterPage {
83 83
84 84
85 // static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview"); 85 // static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview");
  86 +
  87 + //播报页面
  88 + static broadcastPage = new WDRouterPage("phone", "ets/pages/broadcast/BroadcastPage");
86 } 89 }
@@ -28,5 +28,6 @@ export interface CompDTO { @@ -28,5 +28,6 @@ export interface CompDTO {
28 sortValue: number; 28 sortValue: number;
29 subType: string; 29 subType: string;
30 imageScale: number; // 封面图比例 1-4:3, 2-16:9, 3-3:2 30 imageScale: number; // 封面图比例 1-4:3, 2-16:9, 3-3:2
31 - audioDataList: AudioDTO[] 31 + audioDataList: AudioDTO[];
  32 + isSelect: boolean;
32 } 33 }
  1 +
  2 +export interface ChannelInfo {
  3 + channelId: string;
  4 + channelLevel: string;
  5 + channelName: string;
  6 + channelSkin: string;
  7 + channelStrategy: string;
  8 + channelStyle: string;
  9 + pageId: string;
  10 + pageTopType: string;
  11 + pcStyle: string;
  12 + webBackgroundImgUrl: string;
  13 +}
1 import { Group } from './Group'; 1 import { Group } from './Group';
2 import { TopicInfo } from './TopicInfo'; 2 import { TopicInfo } from './TopicInfo';
3 - 3 +import { ChannelInfo } from './ChannelInfo'
4 export interface PageInfoBean { 4 export interface PageInfoBean {
5 backIconUrl: string; 5 backIconUrl: string;
6 backgroundColor: string; 6 backgroundColor: string;
@@ -8,7 +8,7 @@ export interface PageInfoBean { @@ -8,7 +8,7 @@ export interface PageInfoBean {
8 baselineColor: string; 8 baselineColor: string;
9 baselineCopywriting: string; 9 baselineCopywriting: string;
10 baselineShow: number; 10 baselineShow: number;
11 - // channelInfo?: any; 11 + channelInfo?: ChannelInfo;
12 // cornersAdv?: any; 12 // cornersAdv?: any;
13 // cornersAdv2: any[]; 13 // cornersAdv2: any[];
14 description: string; 14 description: string;
@@ -55,3 +55,6 @@ export { ZhGridLayoutComponent } from "./src/main/ets/components/view/ZhGridLayo @@ -55,3 +55,6 @@ export { ZhGridLayoutComponent } from "./src/main/ets/components/view/ZhGridLayo
55 export { MultiPictureDetailPageComponent } from "./src/main/ets/components/MultiPictureDetailPageComponent" 55 export { MultiPictureDetailPageComponent } from "./src/main/ets/components/MultiPictureDetailPageComponent"
56 56
57 export { AudioDetailComponent } from "./src/main/ets/components/AudioDetailComponent" 57 export { AudioDetailComponent } from "./src/main/ets/components/AudioDetailComponent"
  58 +
  59 +export { BroadcastPageComponent } from "./src/main/ets/components/broadcast/BroadcastPageComponent"
  60 +
@@ -3,7 +3,8 @@ import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailView @@ -3,7 +3,8 @@ import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailView
3 import { ContentDetailDTO } from 'wdBean'; 3 import { ContentDetailDTO } from 'wdBean';
4 import media from '@ohos.multimedia.media'; 4 import media from '@ohos.multimedia.media';
5 import { OperRowListView } from './view/OperRowListView'; 5 import { OperRowListView } from './view/OperRowListView';
6 -import { WDPlayerController } from 'wdPlayer'; 6 +import { WDPlayerController } from 'wdPlayer/Index';
  7 +
7 const TAG = 'AudioDetailComponent' 8 const TAG = 'AudioDetailComponent'
8 interface Arr{ 9 interface Arr{
9 image:string, 10 image:string,
@@ -15,7 +16,8 @@ export struct AudioDetailComponent { @@ -15,7 +16,8 @@ export struct AudioDetailComponent {
15 private relId: string = '' 16 private relId: string = ''
16 private contentId: string = '' 17 private contentId: string = ''
17 private relType: string = '' 18 private relType: string = ''
18 - private playerController: WDPlayerController = new WDPlayerController(); 19 + private avPlayer?: media.AVPlayer;
  20 + @State playerController: WDPlayerController = new WDPlayerController();
19 21
20 private arr:Arr[]=[ 22 private arr:Arr[]=[
21 {image:'clock',title:'定时'}, 23 {image:'clock',title:'定时'},
@@ -26,24 +28,27 @@ export struct AudioDetailComponent { @@ -26,24 +28,27 @@ export struct AudioDetailComponent {
26 @State contentDetailData: ContentDetailDTO[] = [] as ContentDetailDTO[]//详情 28 @State contentDetailData: ContentDetailDTO[] = [] as ContentDetailDTO[]//详情
27 @State coverImage:string = '' //封面图 29 @State coverImage:string = '' //封面图
28 @State newsTitle:string = '' //标题 30 @State newsTitle:string = '' //标题
29 - @State duration:number = 0 //时长  
30 @State audioUrl:string = '' //音频路径 31 @State audioUrl:string = '' //音频路径
  32 + @State duration:number = 0 //时长
31 @State outSetValueOne:number = 40 //播放进度 33 @State outSetValueOne:number = 40 //播放进度
32 34
33 - @State @Watch('onIsPlayChanged')isPlay: boolean = true  
34 - onIsPlayChanged(){  
35 - if(this.isPlay){  
36 - console.log('监听播放')  
37 - // this.avPlayer.play()  
38 - }else{  
39 - console.log('监听暂停')  
40 - // this.avPlayer.pause()  
41 - }  
42 - }  
43 - 35 + @State isPlay: boolean = false
44 async aboutToAppear() { 36 async aboutToAppear() {
45 await this.getContentDetailData() 37 await this.getContentDetailData()
46 this.playerController.firstPlay(this.audioUrl); 38 this.playerController.firstPlay(this.audioUrl);
  39 + this.playerController.onCanplay = () => {
  40 + this.playerController.play()
  41 + this.isPlay = true
  42 + }
  43 + this.playerController.onTimeUpdate = (nowSeconds, totalSeconds) =>{
  44 + console.log('现在时间',nowSeconds)
  45 + console.log('总时间',totalSeconds)
  46 + this.outSetValueOne = nowSeconds
  47 + this.duration = totalSeconds
  48 + }
  49 + }
  50 + onPageHide() {
  51 + this.playerController?.pause();
47 } 52 }
48 build() { 53 build() {
49 Row() { 54 Row() {
@@ -94,10 +99,17 @@ export struct AudioDetailComponent { @@ -94,10 +99,17 @@ export struct AudioDetailComponent {
94 Column(){ 99 Column(){
95 // 进度条 100 // 进度条
96 Row(){ 101 Row(){
97 - Progress({ value: this.outSetValueOne, type: ProgressType.Linear })  
98 - .width('100%')  
99 - .color('#ED2800')  
100 - .backgroundColor('rgba(0,0,0,0.5)') 102 + Slider({
  103 + value: this.outSetValueOne,
  104 + step: 1
  105 + })
  106 + .showTips(true)
  107 + .trackColor('rgba(0,0,0,0.5)')
  108 + .selectedColor('#ED2800')
  109 + .onChange((value: number, mode: SliderChangeMode) => {
  110 + console.log('滑块长度',value)
  111 + this.playerController?.setSeekTime(value, mode);
  112 + })
101 } 113 }
102 .width('100%') 114 .width('100%')
103 .padding({left:24,right:24}) 115 .padding({left:24,right:24})
@@ -126,6 +138,14 @@ export struct AudioDetailComponent { @@ -126,6 +138,14 @@ export struct AudioDetailComponent {
126 .padding(28) 138 .padding(28)
127 .backgroundColor('#4D5258') 139 .backgroundColor('#4D5258')
128 .borderRadius(50) 140 .borderRadius(50)
  141 + .onClick(()=>{
  142 + if(this.isPlay){
  143 + this.playerController.pause()
  144 + }else{
  145 + this.playerController.play()
  146 + }
  147 + this.isPlay = !this.isPlay
  148 + })
129 Image($r('app.media.fastForward_close')) 149 Image($r('app.media.fastForward_close'))
130 .width(24) 150 .width(24)
131 .height(24) 151 .height(24)
@@ -151,7 +171,6 @@ export struct AudioDetailComponent { @@ -151,7 +171,6 @@ export struct AudioDetailComponent {
151 } 171 }
152 172
153 } 173 }
154 -  
155 private async getContentDetailData() { 174 private async getContentDetailData() {
156 try { 175 try {
157 let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType) 176 let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType)
  1 +import router from '@ohos.router';
  2 +import { Params } from 'wdBean'
  3 +import { RecommendHeader } from './RecommendHeader';
  4 +import { RecommendTitle } from './RecommendTitle';
  5 +import { RecommendLists } from './RecommendLists'
  6 +import { SelectedColumns } from './SelectedColumns'
  7 +import { CompList, PageInfoBean, CompInfoBean } from 'wdBean';
  8 +import { DateTimeUtils, Logger } from 'wdKit/Index';
  9 +import { PaperReaderSimpleDialog } from '../../dialog/PaperReaderDialog';
  10 +import { BroadcastViewModel } from '../../viewmodel/BroadcastViewModel';
  11 +import { DateFormatUtil, PlayerConstants, WDPlayerController } from 'wdPlayer';
  12 +import { AudioDataList } from 'wdBean/src/main/ets/bean/morningevening/AudioDataList';
  13 +import { CommonConstants } from 'wdConstant/Index';
  14 +
  15 +const TAG = 'BroadcastPageComponent';
  16 +
  17 +@Entry
  18 +@Component
  19 +export struct BroadcastPageComponent {
  20 + @State params:Params = router.getParams() as Params;
  21 +
  22 + @State pageInfoBean: PageInfoBean = {} as PageInfoBean // 播报页面信息
  23 + @State compInfoBean: CompInfoBean = {} as CompInfoBean // 组件信息
  24 + @State recommendCompInfoBean: CompInfoBean = {} as CompInfoBean // 推荐播报组件信息
  25 + @State columnsCompInfoBean: CompInfoBean = {} as CompInfoBean // 精选栏目组件信息
  26 +
  27 + @State compListItem: CompList = {} as CompList
  28 + @State audioPlayUrl: string = ""
  29 + @Provide title: string = ''
  30 + @Provide subTitle: string = ''
  31 + @Provide isAudioPlaying: boolean = false
  32 + @Provide status: number = PlayerConstants.STATUS_START;
  33 + @Provide currentTime: string = "00:00";
  34 + @Provide totalTime: string = "00:00";
  35 + @Provide progressVal: number = 0;
  36 + private audioDataList: AudioDataList[] = []
  37 + private playerController: WDPlayerController = new WDPlayerController();
  38 + simpleAudioDialog: CustomDialogController = new CustomDialogController({
  39 + builder: PaperReaderSimpleDialog({
  40 + cancel: this.onCancel,
  41 + confirm: this.onConfirm,
  42 + playerController: this.playerController
  43 + }),
  44 + autoCancel: false,
  45 + customStyle: true,
  46 + alignment: DialogAlignment.CenterStart,
  47 + offset: { dx: 12, dy: -150 },
  48 + })
  49 +
  50 + onCancel() {
  51 + Logger.info(TAG, "cj2024 onCancel = ")
  52 + }
  53 +
  54 + /**
  55 + * 回调无用
  56 + **/
  57 + onConfirm() {
  58 + Logger.info(TAG, "cj2024 onConfirm = ")
  59 + }
  60 +
  61 + // 续播判断
  62 + changeContinue() {
  63 + Logger.info(TAG, "cj2024 changeContinue = 1")
  64 + this.playerController.continue = () => {
  65 + Logger.info(TAG, "cj2024 changeContinue = 2")
  66 + this.playerController?.stop();
  67 + }
  68 + return;
  69 + }
  70 +
  71 + async aboutToAppear() {
  72 + Logger.debug(TAG, `about1ToAppear`, router.getParams().toString())
  73 + const currentTime = new Date().getTime()
  74 + try {
  75 + // 获取页面信息
  76 + Logger.warn('获取页面信息')
  77 + let pageInfoBean = await BroadcastViewModel.getBroadcastViewPageInfo('21003')
  78 + Logger.warn('pageInfoBean-')
  79 + Logger.warn(pageInfoBean.groups[0].blockDesc)
  80 +
  81 + this.pageInfoBean = pageInfoBean;
  82 + //TODO 根据页面中组件信息。现在默认认为后端只返回2个。第一个是播报,第二个是精选栏目
  83 + const pageId = pageInfoBean.id,
  84 + groupId_0 = pageInfoBean.groups[0]?.id,
  85 + refreshTime = currentTime + "",
  86 + topicId = pageInfoBean?.topicInfo?.topicId || '',
  87 + channelId = pageInfoBean?.channelInfo?.channelId || ''
  88 + if(pageInfoBean.groups[0]) {
  89 + this.recommendCompInfoBean = await BroadcastViewModel.getBroadcastCompInfo(pageId, groupId_0, refreshTime, topicId, channelId)
  90 + }
  91 + if(pageInfoBean.groups[1]) {
  92 + const groupId_1 = pageInfoBean.groups[1]?.id
  93 + this.columnsCompInfoBean = await BroadcastViewModel.getBroadcastCompInfo(pageId, groupId_1, refreshTime, topicId, channelId)
  94 + }
  95 + } catch (exception) {
  96 +
  97 + }
  98 + }
  99 + onPageShow() {
  100 + Logger.debug(TAG, `onPageShow--`, JSON.stringify(router.getParams()))
  101 + }
  102 + onPageHide() {
  103 + this.status = PlayerConstants.STATUS_PAUSE;
  104 + this.playerController?.pause();
  105 + }
  106 +
  107 + build() {
  108 + Column() {
  109 + // 顶部标题
  110 + RecommendHeader()
  111 + List() {
  112 + ListItem(){
  113 + RecommendTitle()
  114 + }
  115 + if(this.pageInfoBean.groups && this.pageInfoBean.groups[0] && this.recommendCompInfoBean.compList) {
  116 + ListItem(){
  117 + RecommendLists({
  118 + recommendCompInfoBean: this.recommendCompInfoBean
  119 + })
  120 + }
  121 + }
  122 + if(this.pageInfoBean.groups && this.pageInfoBean.groups[1] && this.columnsCompInfoBean.compList) {
  123 + ListItem() {
  124 + SelectedColumns({
  125 + columnsCompTitle: this.pageInfoBean.groups[1].blockDesc,
  126 + columnsCompInfoBean: this.columnsCompInfoBean
  127 + })
  128 + .margin({ top: 12 })
  129 + }
  130 + }
  131 + }
  132 + .layoutWeight(1)
  133 + // @ts-ignore
  134 + .onScrollFrameBegin((offset, state) => {
  135 + console.log('ccc',String(offset), state)
  136 + })
  137 + .onReachStart(() => {
  138 + console.log('onReachStart----->',)
  139 + })
  140 + }
  141 + .width(CommonConstants.FULL_WIDTH)
  142 + .backgroundImage($r('app.media.broadcast_bg'))
  143 + .backgroundImageSize({width: '100%', height: '100%'})
  144 + }
  145 +}
  1 +import router from '@ohos.router';
  2 +import { CommonConstants } from 'wdConstant/Index';
  3 +
  4 +/**
  5 + * 今日推荐顶部标题--fixed标题
  6 + */
  7 +@Entry
  8 +@Component
  9 +export struct RecommendHeader {
  10 + build() {
  11 + Stack() {
  12 + Image($r('app.media.icon_arrow_down_black'))
  13 + .height($r('app.float.top_arrow_size'))
  14 + .width($r('app.float.top_arrow_size'))
  15 + .onClick((event: ClickEvent) => {
  16 + router.back()
  17 + })
  18 + .zIndex(1)
  19 + Text('今日推荐')
  20 + .margin({ left: 5 })
  21 + .fontSize($r('app.float.selected_text_size'))
  22 + .fontColor($r('app.color.color_222222'))
  23 + .width(CommonConstants.FULL_WIDTH)
  24 + .height(CommonConstants.FULL_HEIGHT)
  25 + .textAlign(TextAlign.Center)
  26 + }
  27 + .height($r('app.float.top_bar_height'))
  28 + .padding({left: 16, right: 16})
  29 + .alignContent(Alignment.Start)
  30 + }
  31 +}
  1 +import { CompInfoBean, CompDTO } from 'wdBean'
  2 +import { CommonConstants } from 'wdConstant';
  3 +import { ProcessUtils } from '../../utils/ProcessUtils';
  4 +
  5 +/**
  6 + * 播报--今日推荐列表
  7 + */
  8 +@Entry
  9 +@Component
  10 +export struct RecommendLists {
  11 + @Prop recommendCompInfoBean: CompInfoBean = {} as CompInfoBean // 推荐-组件信息
  12 +
  13 + build() {
  14 + Column(){
  15 + ForEach(this.recommendCompInfoBean.compList.slice(0,3), (item: CompDTO) => {
  16 + this.recommendTop3Item(item)
  17 + })
  18 + // 查看更多
  19 + if(this.recommendCompInfoBean.compList.length > 3) {
  20 + Row() {
  21 + Text("查看全部")
  22 + .fontSize($r("app.float.font_size_12"))
  23 + .fontColor($r("app.color.color_222222"))
  24 + .margin({ right: 1 })
  25 + Image($r("app.media.more"))
  26 + .width(14)
  27 + .height(14)
  28 + }
  29 + .width(CommonConstants.FULL_WIDTH)
  30 + .height(40)
  31 + .borderRadius(3)
  32 + .justifyContent(FlexAlign.Center)
  33 + .margin({top: 5})
  34 + .onClick(() => {
  35 + // console.log(1)
  36 + })
  37 + }
  38 + }
  39 + .margin({left: 16, right: 16})
  40 + .padding({left: 16, right: 16})
  41 + .backgroundColor($r('app.color.color_fff'))
  42 + .borderRadius(5)
  43 + }
  44 +
  45 + @Builder
  46 + recommendTop3Item(item: CompDTO) {
  47 + Row(){
  48 + Image($r('app.media.broadcast_pause'))
  49 + .width(24)
  50 + .height(24)
  51 + .margin({right:12})
  52 + Text(item.operDataList[0].newsTitle)
  53 + .fontSize($r('app.float.font_size_16'))
  54 + .fontColor($r('app.color.color_212228'))
  55 + .maxLines(1)
  56 + .textOverflow({overflow: TextOverflow.Ellipsis})
  57 + .layoutWeight(1)
  58 + }
  59 + .width(CommonConstants.FULL_WIDTH)
  60 + .padding({top: 12, bottom: 12})
  61 + .onClick(() => {
  62 + ProcessUtils.processPage(item.operDataList[0])
  63 + })
  64 + }
  65 +
  66 + @Builder
  67 + recommendListItem() {
  68 +
  69 + }
  70 +}
  1 +import { CommonConstants } from 'wdConstant/Index'
  2 +import { DateTimeUtils } from 'wdKit';
  3 +/**
  4 + * 播报标题描述
  5 + */
  6 +@Entry
  7 +@Component
  8 +export struct RecommendTitle {
  9 + build() {
  10 + Row(){
  11 + // 左边
  12 + Column(){
  13 + Text('每日最动听的声音')
  14 + .fontSize($r('app.float.font_size_14'))
  15 + .fontColor($r('app.color.color_222222'))
  16 + .alignSelf(ItemAlign.Start)
  17 + Image($r('app.media.broadcast_line'))
  18 + .width(147)
  19 + .margin({
  20 + top: 8, bottom: 8
  21 + })
  22 + Row(){
  23 + Column(){
  24 + Text('今推')
  25 + .fontSize($r('app.float.font_size_24'))
  26 + .fontColor($r('app.color.color_222222'))
  27 + .fontWeight(600)
  28 + Text('日荐')
  29 + .fontSize($r('app.float.font_size_24'))
  30 + .fontColor($r('app.color.color_222222'))
  31 + .fontWeight(600)
  32 + }
  33 + .margin({right: 8})
  34 + .alignSelf(ItemAlign.Start)
  35 + Column() {
  36 + Text(DateTimeUtils.getLunar())
  37 + .fontSize($r('app.float.font_size_14'))
  38 + .fontColor($r('app.color.color_222222'))
  39 + .alignSelf(ItemAlign.Start)
  40 + Text(DateTimeUtils.formatDate(new Date().getTime(), 'MM/dd'))
  41 + .fontSize($r('app.float.font_size_24'))
  42 + .fontColor($r('app.color.color_222222'))
  43 + }
  44 + }
  45 + .alignSelf(ItemAlign.Start)
  46 + }
  47 + Blank()
  48 + Image($r('app.media.broadcast_pause'))
  49 + .width(90)
  50 + .height(90)
  51 + .margin({
  52 + right: 9
  53 + })
  54 + }
  55 + .width(CommonConstants.FULL_WIDTH)
  56 + .padding({left: 16, right: 16})
  57 + .margin({bottom: 12})
  58 + }
  59 +}
  1 +import { CompInfoBean, CompDTO } from 'wdBean'
  2 +import { DateTimeUtils } from 'wdKit/Index'
  3 +import { CommonConstants } from 'wdConstant';
  4 +import { ProcessUtils } from '../../utils/ProcessUtils';
  5 +/**
  6 + * 精选栏目
  7 + */
  8 +@Entry
  9 +@Component
  10 +export struct SelectedColumns {
  11 + @Prop columnsCompInfoBean: CompInfoBean = {} as CompInfoBean // 精选栏目组件信息
  12 + @Prop columnsCompTitle: string = ''
  13 + build() {
  14 + Column(){
  15 + Text(this.columnsCompTitle)
  16 + .fontSize($r('app.float.selected_text_size'))
  17 + .fontColor($r('app.color.color_222222'))
  18 + .fontWeight(500)
  19 + .width(CommonConstants.FULL_WIDTH)
  20 + ForEach(this.columnsCompInfoBean.compList, (item: CompDTO) => {
  21 + this.SelectedColumnsItem(item)
  22 + })
  23 +
  24 + }
  25 + .padding({left: 16,top: 12, right: 16})
  26 + .backgroundColor($r('app.color.white'))
  27 + }
  28 +
  29 + @Builder
  30 + SelectedColumnsItem(item: CompDTO) {
  31 + Row() {
  32 + Image(item.operDataList[0].coverUrl)
  33 + .height(53)
  34 + .width(80)
  35 + .objectFit(ImageFit.Cover)
  36 + .margin({right: 12})
  37 + Column({space: 4}){
  38 + Text(item.operDataList[0].newsTitle)
  39 + .fontSize($r('app.float.font_size_16'))
  40 + .fontColor($r('app.color.color_222222'))
  41 + .width(CommonConstants.FULL_WIDTH)
  42 + .maxLines(1)
  43 + .textOverflow({overflow: TextOverflow.Ellipsis})
  44 + Text(item.operDataList[0].newsSummary)
  45 + .fontSize($r('app.float.font_size_12'))
  46 + .fontColor($r('app.color.color_999999'))
  47 + .width(CommonConstants.FULL_WIDTH)
  48 + .maxLines(1)
  49 + .textOverflow({overflow: TextOverflow.Ellipsis})
  50 + Row(){
  51 + Image($r('app.media.broadcast_clock'))
  52 + .width(12)
  53 + .height(12)
  54 + .margin({right: 4})
  55 + Text(DateTimeUtils.getCommentTime(Number.parseFloat(item.operDataList[0].publishTime)))
  56 + .fontSize($r('app.float.font_size_12'))
  57 + .fontColor($r('app.color.color_999999'))
  58 + .margin({ right :24 })
  59 + Image($r('app.media.broadcast_listen'))
  60 + .width(12)
  61 + .height(12)
  62 + .margin({right: 4})
  63 + Text('0')
  64 + .fontSize($r('app.float.font_size_12'))
  65 + .fontColor($r('app.color.color_999999'))
  66 + .margin({ right :24})
  67 + }
  68 + .width(CommonConstants.FULL_WIDTH)
  69 + }
  70 + .layoutWeight(1)
  71 + }
  72 + .onClick((event: ClickEvent) => {
  73 + // TODO 跳转到音频专题页
  74 + })
  75 + .width(CommonConstants.FULL_WIDTH)
  76 + .height(73)
  77 + }
  78 +}
1 -import { CustomTitleUI } from '../reusable/CustomTitleUI' 1 +import { CustomTitleAndEditUI } from '../reusable/CustomTitleAndEditUI'
2 import MyCollectionViewModel from '../../viewmodel/MyCollectionViewModel'; 2 import MyCollectionViewModel from '../../viewmodel/MyCollectionViewModel';
3 import PageModel from '../../viewmodel/PageModel'; 3 import PageModel from '../../viewmodel/PageModel';
4 import { CommonConstants, ViewType } from 'wdConstant' 4 import { CommonConstants, ViewType } from 'wdConstant'
@@ -11,20 +11,31 @@ import LoadMoreLayout from './LoadMoreLayout' @@ -11,20 +11,31 @@ import LoadMoreLayout from './LoadMoreLayout'
11 import NoMoreLayout from './NoMoreLayout' 11 import NoMoreLayout from './NoMoreLayout'
12 import { CompParser } from '../CompParser' 12 import { CompParser } from '../CompParser'
13 import CustomRefreshLoadLayout from './CustomRefreshLoadLayout'; 13 import CustomRefreshLoadLayout from './CustomRefreshLoadLayout';
14 -import { listTouchEvent } from '../../utils/PullDownRefresh'; 14 +import { CustomSelectUI } from '../view/CustomSelectUI';
  15 +import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI';
15 16
16 @Entry 17 @Entry
17 @Component 18 @Component
18 struct BrowsingHistoryPage { 19 struct BrowsingHistoryPage {
19 @State private browSingModel: PageModel = new PageModel() 20 @State private browSingModel: PageModel = new PageModel()
20 - 21 + isloading : boolean = false
  22 + @Provide isEditState:boolean = false
  23 + @State allDatas :CompDTO[] = [];
  24 + @State selectDatas :CompDTO[] = [];
  25 + @Provide deleteNum :number = 0;
  26 + @Provide isAllSelect:boolean = false
21 aboutToAppear(){ 27 aboutToAppear(){
22 this.getData() 28 this.getData()
23 } 29 }
24 30
25 build() { 31 build() {
26 Column(){ 32 Column(){
27 - CustomTitleUI({titleName:'浏览历史'}) 33 + CustomTitleAndEditUI({titleName:'浏览历史',isDisplayButton:true,editCallback:()=>{
  34 + this.allSelectDatas(false)
  35 + this.isAllSelect = false
  36 + this.selectDatas = []
  37 + this.deleteNum = 0
  38 + }})
28 if (this.browSingModel.viewType == ViewType.LOADING){ 39 if (this.browSingModel.viewType == ViewType.LOADING){
29 this.LoadingLayout() 40 this.LoadingLayout()
30 }else if(this.browSingModel.viewType == ViewType.ERROR){ 41 }else if(this.browSingModel.viewType == ViewType.ERROR){
@@ -34,16 +45,21 @@ struct BrowsingHistoryPage { @@ -34,16 +45,21 @@ struct BrowsingHistoryPage {
34 }else { 45 }else {
35 this.ListLayout() 46 this.ListLayout()
36 } 47 }
  48 +
  49 + if (this.isEditState){
  50 + CustomBottomFuctionUI({
  51 + selectAllCallback:(isAllSelect)=>{
  52 + this.allSelectDatas(isAllSelect)
  53 + },
  54 + confirmCallback:()=>{
  55 + this.deleteDatas()
  56 + }
  57 + })
  58 + .position({y:'92%'})
  59 + }
37 } 60 }
38 .width(CommonConstants.FULL_WIDTH) 61 .width(CommonConstants.FULL_WIDTH)
39 .height(CommonConstants.FULL_HEIGHT) 62 .height(CommonConstants.FULL_HEIGHT)
40 - .onTouch((event: TouchEvent | undefined) => {  
41 - if (event) {  
42 - if (this.browSingModel.viewType === ViewType.LOADED) {  
43 - listTouchEvent(this.browSingModel, event);  
44 - }  
45 - }  
46 - })  
47 } 63 }
48 64
49 @Builder ListLayout() { 65 @Builder ListLayout() {
@@ -56,11 +72,9 @@ struct BrowsingHistoryPage { @@ -56,11 +72,9 @@ struct BrowsingHistoryPage {
56 }) 72 })
57 } 73 }
58 74
59 - LazyForEach(this.browSingModel.compList, (compDTO: CompDTO, compIndex: number) => { 75 + ForEach(this.allDatas, (compDTO: CompDTO, compIndex: number) => {
60 ListItem() { 76 ListItem() {
61 - Column() {  
62 - CompParser({ compDTO: compDTO, compIndex: compIndex });  
63 - } 77 + this.newCompParser(compDTO,compIndex)
64 } 78 }
65 }) 79 })
66 80
@@ -79,6 +93,24 @@ struct BrowsingHistoryPage { @@ -79,6 +93,24 @@ struct BrowsingHistoryPage {
79 .height(CommonConstants.FULL_PARENT) 93 .height(CommonConstants.FULL_PARENT)
80 } 94 }
81 95
  96 + @Builder
  97 + newCompParser(compDTO: CompDTO, compIndex: number){
  98 + Row(){
  99 + if (this.isEditState){
  100 + CustomSelectUI({
  101 + isOn:compDTO.isSelect,
  102 + selectCallback:(isOn)=>{
  103 + this.addCompDTO(isOn,compDTO)
  104 + }
  105 + })
  106 + .margin({left:16})
  107 + }
  108 + Column() {
  109 + CompParser({ compDTO: compDTO, compIndex: compIndex })
  110 + }
  111 + }
  112 + }
  113 +
82 @Builder LoadingLayout() { 114 @Builder LoadingLayout() {
83 CustomRefreshLoadLayout({ refreshBean: new RefreshLayoutBean(true, 115 CustomRefreshLoadLayout({ refreshBean: new RefreshLayoutBean(true,
84 $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), this.browSingModel.pullDownRefreshHeight) }) 116 $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), this.browSingModel.pullDownRefreshHeight) })
@@ -89,7 +121,7 @@ struct BrowsingHistoryPage { @@ -89,7 +121,7 @@ struct BrowsingHistoryPage {
89 MyCollectionViewModel.newFetchMyCollectList(2,'1',this.browSingModel.currentPage,getContext(this)).then(pageDto => { 121 MyCollectionViewModel.newFetchMyCollectList(2,'1',this.browSingModel.currentPage,getContext(this)).then(pageDto => {
90 if (pageDto && pageDto.compList && pageDto.compList.length > 0) { 122 if (pageDto && pageDto.compList && pageDto.compList.length > 0) {
91 this.browSingModel.viewType = ViewType.LOADED; 123 this.browSingModel.viewType = ViewType.LOADED;
92 - this.browSingModel.compList.push(...pageDto.compList) 124 + this.allDatas.push(...pageDto.compList)
93 if (pageDto.compList.length === this.browSingModel.pageSize) { 125 if (pageDto.compList.length === this.browSingModel.pageSize) {
94 this.browSingModel.currentPage++; 126 this.browSingModel.currentPage++;
95 this.browSingModel.hasMore = true; 127 this.browSingModel.hasMore = true;
@@ -101,4 +133,49 @@ struct BrowsingHistoryPage { @@ -101,4 +133,49 @@ struct BrowsingHistoryPage {
101 } 133 }
102 }) 134 })
103 } 135 }
104 -}  
  136 +
  137 + //数据处理
  138 + //单个选择
  139 + addCompDTO(isOn:boolean , compDTO: CompDTO){
  140 + compDTO.isSelect = isOn;
  141 + if (isOn === true){
  142 + this.selectDatas.push(compDTO)
  143 + }else {
  144 + this.selectDatas.splice(this.selectDatas.indexOf(compDTO),1)
  145 + }
  146 + this.deleteNum = this.selectDatas.length
  147 +
  148 + this.isAllSelect = this.deleteNum === this.allDatas.length?true:false;
  149 + }
  150 +
  151 + //全选
  152 + allSelectDatas(isOn:boolean){
  153 + let datas: CompDTO[] = [];
  154 + for (let index = 0; index < this.allDatas.length; index++) {
  155 + const compDTO = this.allDatas[index];
  156 + compDTO.isSelect = isOn
  157 + datas.push(compDTO)
  158 + }
  159 + this.selectDatas = []
  160 + this.allDatas = []
  161 + if (isOn === true) {
  162 + this.selectDatas.push(...datas)
  163 + }else {
  164 + this.selectDatas.splice(0,this.deleteNum)
  165 + }
  166 + this.allDatas.push(...datas)
  167 + this.deleteNum = this.selectDatas.length
  168 + }
  169 +
  170 + //删除
  171 + deleteDatas(){
  172 + for (let index = 0; index < this.selectDatas.length; index++) {
  173 + const compDTO = this.allDatas[index];
  174 + this.allDatas.splice(this.selectDatas.indexOf(compDTO),1)
  175 + }
  176 +
  177 + //重置删除状态
  178 + this.isEditState = false
  179 + this.isAllSelect = false
  180 + }
  181 +}
1 import { TopNavDTO } from 'wdBean'; 1 import { TopNavDTO } from 'wdBean';
2 2
3 -  
4 const INDEX_SETTING_TITLE: string = '首页设置' 3 const INDEX_SETTING_TITLE: string = '首页设置'
5 const INDEX_SETTING_SUBTITLE: string = '将指定频道设置为首页' 4 const INDEX_SETTING_SUBTITLE: string = '将指定频道设置为首页'
6 const MY_CHANNEL: string = '我的频道' 5 const MY_CHANNEL: string = '我的频道'
@@ -11,7 +10,7 @@ const LOCAL_CHANNEL: string = '地方频道' @@ -11,7 +10,7 @@ const LOCAL_CHANNEL: string = '地方频道'
11 10
12 @CustomDialog 11 @CustomDialog
13 struct ChannelDialog { 12 struct ChannelDialog {
14 - @State indexSettingTabIndex: number = 1 13 + @State indexSettingTabIndex: number = 0
15 @State isEditIng: boolean = false 14 @State isEditIng: boolean = false
16 @Link currentTopNavSelectedIndex: number 15 @Link currentTopNavSelectedIndex: number
17 @Link myChannelList: TopNavDTO[] 16 @Link myChannelList: TopNavDTO[]
@@ -19,6 +18,9 @@ struct ChannelDialog { @@ -19,6 +18,9 @@ struct ChannelDialog {
19 @Link localChannelList: TopNavDTO[] 18 @Link localChannelList: TopNavDTO[]
20 @Link indexSettingArray: string[] 19 @Link indexSettingArray: string[]
21 controller?: CustomDialogController 20 controller?: CustomDialogController
  21 + confirm: (index: number) => void = () => {
  22 + }
  23 + changeChannelIndex : (index1:number, index2:number) => void = ()=>{}
22 myChannelItemEditHandle = (index: number): void => { 24 myChannelItemEditHandle = (index: number): void => {
23 let item = this.myChannelList.splice(index, 1)[0] 25 let item = this.myChannelList.splice(index, 1)[0]
24 if (item.moreChannel === '1') { 26 if (item.moreChannel === '1') {
@@ -29,6 +31,34 @@ struct ChannelDialog { @@ -29,6 +31,34 @@ struct ChannelDialog {
29 } 31 }
30 } 32 }
31 33
  34 + @Builder
  35 + pixelMapBuilder(item: TopNavDTO, index: number) { //拖拽过程样式
  36 + Row() {
  37 + Row() {
  38 + Text(item.name)
  39 + .fontSize(14)
  40 + .fontColor(this.currentTopNavSelectedIndex === index ? '#ED2800' : (item.homeChannel === '1' || item.movePermitted === 0 ? '#999999' : '#222222'))
  41 +
  42 + if (this.isEditIng && item.myChannel !== '1') {
  43 + Image($r('app.media.icon_audio_close'))
  44 + .width(12)
  45 + .margin({ left: 1 })
  46 + }
  47 + }
  48 + .width('100%')
  49 + .height('100%')
  50 + .justifyContent(FlexAlign.Center)
  51 + .backgroundColor(item.homeChannel === '1' || item.movePermitted === 0 ? '#F5F5F5' : '#ffffff')
  52 + }
  53 + .width('23%')
  54 + .height(40)
  55 + .border({
  56 + width: item.homeChannel === '1' ? 0 : 1,
  57 + color: '#EDEDED',
  58 + radius: 3
  59 + })
  60 + }
  61 +
32 build() { 62 build() {
33 Column() { 63 Column() {
34 64
@@ -43,7 +73,7 @@ struct ChannelDialog { @@ -43,7 +73,7 @@ struct ChannelDialog {
43 }) 73 })
44 } 74 }
45 .width('100%') 75 .width('100%')
46 - .margin({ top: 30, bottom: 10 }) 76 + .padding({ top: 30, bottom: 10 })
47 77
48 List() { 78 List() {
49 79
@@ -66,16 +96,30 @@ struct ChannelDialog { @@ -66,16 +96,30 @@ struct ChannelDialog {
66 ListItem() { 96 ListItem() {
67 Flex({ justifyContent: FlexAlign.SpaceBetween }) { 97 Flex({ justifyContent: FlexAlign.SpaceBetween }) {
68 ForEach(this.indexSettingArray, (text: string, index: number) => { 98 ForEach(this.indexSettingArray, (text: string, index: number) => {
69 - Button(text, { type: ButtonType.Normal, stateEffect: false })  
70 - .width('48%')  
71 - .borderRadius(2)  
72 - .fontColor(index === this.indexSettingTabIndex ? '#ffffff' : '#ED2800')  
73 - .fontSize(16)  
74 - .fontWeight(400)  
75 - .backgroundColor(index === this.indexSettingTabIndex ? '#ED2800' : '#FDE9E5')  
76 - .onClick(() => {  
77 - this.indexSettingTabIndex = index  
78 - }) 99 + Stack() {
  100 + Image(this.indexSettingTabIndex === index ? $r('app.media.index_setting_button_active') : $r('app.media.index_setting_button'))
  101 + .objectFit(ImageFit.Auto)
  102 + .rotate({
  103 + angle: index === 1 ? 180 : 0
  104 + })
  105 + Row() {
  106 + if (index === 0) {
  107 + Image(this.indexSettingTabIndex === index ? $r('app.media.recommend_icon') : $r('app.media.recommend_icon_active'))
  108 + .width(20)
  109 + }
  110 + Text(text)
  111 + .textAlign(TextAlign.Center)
  112 + .fontSize(16)
  113 + .fontColor(index === this.indexSettingTabIndex ? '#ffffff' : '#ED2800')
  114 + }
  115 + .width('100%')
  116 + .justifyContent(FlexAlign.Center)
  117 + }
  118 + .alignContent(Alignment.Start)
  119 + .height(36)
  120 + .onClick(() => {
  121 + this.indexSettingTabIndex = index
  122 + })
79 }) 123 })
80 } 124 }
81 .height(36) 125 .height(36)
@@ -99,14 +143,15 @@ struct ChannelDialog { @@ -99,14 +143,15 @@ struct ChannelDialog {
99 .margin({ bottom: 12 }) 143 .margin({ bottom: 12 })
100 } 144 }
101 145
  146 + // 我的频道列表
102 ListItem() { 147 ListItem() {
103 - GridRow({ columns: 4, gutter: 10 }) { 148 + Grid() {
104 ForEach(this.myChannelList, (item: TopNavDTO, index: number) => { 149 ForEach(this.myChannelList, (item: TopNavDTO, index: number) => {
105 - GridCol() { 150 + GridItem() {
106 Row() { 151 Row() {
107 Text(item.name) 152 Text(item.name)
108 .fontSize(14) 153 .fontSize(14)
109 - .fontColor(this.currentTopNavSelectedIndex === index ? '#ED2800' : (item.homeChannel === '1' ? '#999999' : '#222222')) 154 + .fontColor(this.currentTopNavSelectedIndex === index ? '#ED2800' : (item.homeChannel === '1' || item.movePermitted === 0 ? '#999999' : '#222222'))
110 155
111 if (this.isEditIng && item.myChannel !== '1') { 156 if (this.isEditIng && item.myChannel !== '1') {
112 Image($r('app.media.icon_audio_close')) 157 Image($r('app.media.icon_audio_close'))
@@ -117,19 +162,20 @@ struct ChannelDialog { @@ -117,19 +162,20 @@ struct ChannelDialog {
117 .width('100%') 162 .width('100%')
118 .height('100%') 163 .height('100%')
119 .justifyContent(FlexAlign.Center) 164 .justifyContent(FlexAlign.Center)
120 - .backgroundColor(item.homeChannel === '1' ? '#F5F5F5' : '') 165 + .backgroundColor(item.homeChannel === '1' || item.movePermitted === 0 ? '#F5F5F5' : '')
121 .onClick(() => { 166 .onClick(() => {
122 if (this.isEditIng) { 167 if (this.isEditIng) {
123 if (item.myChannel !== '1') { 168 if (item.myChannel !== '1') {
124 this.myChannelItemEditHandle(index) 169 this.myChannelItemEditHandle(index)
125 } 170 }
126 } else { 171 } else {
  172 + this.confirm(index)
127 this.currentTopNavSelectedIndex = index 173 this.currentTopNavSelectedIndex = index
128 this.controller?.close() 174 this.controller?.close()
129 } 175 }
130 }) 176 })
131 } 177 }
132 - .width(80) 178 + .width('23%')
133 .height(40) 179 .height(40)
134 .border({ 180 .border({
135 width: item.homeChannel === '1' ? 0 : 1, 181 width: item.homeChannel === '1' ? 0 : 1,
@@ -140,8 +186,28 @@ struct ChannelDialog { @@ -140,8 +186,28 @@ struct ChannelDialog {
140 } 186 }
141 .width('100%') 187 .width('100%')
142 .margin({ bottom: 24 }) 188 .margin({ bottom: 24 })
  189 + .columnsTemplate('1fr 1fr 1fr 1fr')
  190 + .columnsGap(8)
  191 + .rowsGap(8)
  192 + .height(Math.ceil(this.myChannelList.length / 4 ) * 48)
  193 + .editMode(this.isEditIng)
  194 + .supportAnimation(true) //设置Grid是否开启拖拽补位动画
  195 + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => {
  196 + if(this.myChannelList[itemIndex].headlinesOn===1 || this.myChannelList[itemIndex].movePermitted===0){
  197 + return
  198 + }else{
  199 + return this.pixelMapBuilder(this.myChannelList[itemIndex], itemIndex) //设置拖拽过程中显示的元素。
  200 + }
  201 + })
  202 + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { //绑定此事件的组件可作为拖拽释放目标,当在本组件范围内停止拖拽行为时,触发回调。
  203 + if (!isSuccess || insertIndex >= this.myChannelList.length || this.myChannelList[insertIndex].headlinesOn===1 || this.myChannelList[insertIndex].movePermitted===0) {
  204 + return
  205 + }
  206 + this.changeChannelIndex(itemIndex,insertIndex)
  207 + })
143 } 208 }
144 209
  210 + //更多频道列表
145 ListItem() { 211 ListItem() {
146 Column() { 212 Column() {
147 if (this.moreChannelList.length > 0) { 213 if (this.moreChannelList.length > 0) {
@@ -185,6 +251,7 @@ struct ChannelDialog { @@ -185,6 +251,7 @@ struct ChannelDialog {
185 .width('100%') 251 .width('100%')
186 } 252 }
187 253
  254 + //本地频道列表
188 ListItem() { 255 ListItem() {
189 Column() { 256 Column() {
190 if (this.localChannelList.length > 0) { 257 if (this.localChannelList.length > 0) {
@@ -230,34 +297,1608 @@ struct ChannelDialog { @@ -230,34 +297,1608 @@ struct ChannelDialog {
230 }.width('100%').height('100%') 297 }.width('100%').height('100%')
231 298
232 } 299 }
233 - .padding(16) 300 + .padding(15)
234 .backgroundColor('#ffffff') 301 .backgroundColor('#ffffff')
235 } 302 }
236 } 303 }
237 304
  305 +// @Entry
238 @Component 306 @Component
239 struct ChannelSubscriptionLayout { 307 struct ChannelSubscriptionLayout {
  308 + changeTab: (index: number) => void = () => {
  309 + }
240 @State indexSettingArray: string [] = ['推荐', '热点'] 310 @State indexSettingArray: string [] = ['推荐', '热点']
241 //当前选中的频道 311 //当前选中的频道
242 @Link currentTopNavSelectedIndex: number; 312 @Link currentTopNavSelectedIndex: number;
243 @Link myChannelList: TopNavDTO [] 313 @Link myChannelList: TopNavDTO []
244 @Link moreChannelList: TopNavDTO [] 314 @Link moreChannelList: TopNavDTO []
245 @Link localChannelList: TopNavDTO [] 315 @Link localChannelList: TopNavDTO []
246 - 316 + onAccept = (index: number) => {
  317 + console.log(`onAccept${index}`)
  318 + this.changeTab(index)
  319 + }
  320 + // @State currentTopNavSelectedIndex: number = 0
  321 + // @State topNavList: TopNavDTO [] = [
  322 + // {
  323 + // channelId: 2001,
  324 + // channelStrategy: 1,
  325 + // channelStyle: 2,
  326 + // channelType: 1,
  327 + // defaultPermitted: 1,
  328 + // delPermitted: 0,
  329 + // fontCColor: "#FFFFFF",
  330 + // fontColor: "#F9AB99",
  331 + // headlinesOn: 0,
  332 + // homeChannel: "0",
  333 + // iconCUrl: "",
  334 + // iconCUrlSize: "",
  335 + // iconUrl: "",
  336 + // iconUrlSize: "",
  337 + // localChannel: "0",
  338 + // moreChannel: "0",
  339 + // movePermitted: 0,
  340 + // myChannel: "0",
  341 + // name: "推荐",
  342 + // num: 1,
  343 + // pageId: 20011,
  344 + // pageType: "",
  345 + // underlineCColor: ""
  346 + // },
  347 + // {
  348 + // channelId: 2002,
  349 + // channelStrategy: 2,
  350 + // channelStyle: 2,
  351 + // channelType: 1,
  352 + // defaultPermitted: 1,
  353 + // delPermitted: 0,
  354 + // fontCColor: "#FFFFFF",
  355 + // fontColor: "#F9AB99",
  356 + // headlinesOn: 0,
  357 + // homeChannel: "0",
  358 + // iconCUrl: "",
  359 + // iconCUrlSize: "",
  360 + // iconUrl: "",
  361 + // iconUrlSize: "",
  362 + // localChannel: "0",
  363 + // moreChannel: "0",
  364 + // movePermitted: 0,
  365 + // myChannel: "0",
  366 + // name: "热点",
  367 + // num: 2,
  368 + // pageId: 20012,
  369 + // pageType: "",
  370 + // underlineCColor: ""
  371 + // },
  372 + // {
  373 + // channelId: 2003,
  374 + // channelStrategy: 2,
  375 + // channelStyle: 2,
  376 + // channelType: 1,
  377 + // defaultPermitted: 0,
  378 + // delPermitted: 0,
  379 + // fontCColor: "#FFFFFF",
  380 + // fontColor: "#F9AB99",
  381 + // headlinesOn: 0,
  382 + // homeChannel: "0",
  383 + // iconCUrl: "",
  384 + // iconCUrlSize: "",
  385 + // iconUrl: "",
  386 + // iconUrlSize: "",
  387 + // localChannel: "0",
  388 + // moreChannel: "0",
  389 + // movePermitted: 1,
  390 + // myChannel: "0",
  391 + // name: "锐评",
  392 + // num: 3,
  393 + // pageId: 20013,
  394 + // pageType: "",
  395 + // underlineCColor: ""
  396 + // },
  397 + // {
  398 + // channelId: 2066,
  399 + // channelStrategy: 2,
  400 + // channelStyle: 3,
  401 + // channelType: 1,
  402 + // defaultPermitted: 0,
  403 + // delPermitted: 1,
  404 + // fontCColor: "#FFFFFF",
  405 + // fontColor: "#F9AB99",
  406 + // headlinesOn: 0,
  407 + // homeChannel: "0",
  408 + // iconCUrl: "",
  409 + // iconCUrlSize: "",
  410 + // iconUrl: "",
  411 + // iconUrlSize: "",
  412 + // localChannel: "0",
  413 + // moreChannel: "0",
  414 + // movePermitted: 1,
  415 + // myChannel: "0",
  416 + // name: "播报",
  417 + // num: 4,
  418 + // pageId: 21003,
  419 + // pageType: "",
  420 + // underlineCColor: ""
  421 + // },
  422 + // {
  423 + // channelId: 2006,
  424 + // channelStrategy: 2,
  425 + // channelStyle: 3,
  426 + // channelType: 1,
  427 + // defaultPermitted: 0,
  428 + // delPermitted: 0,
  429 + // fontCColor: "#FFFFFF",
  430 + // fontColor: "#F9AB99",
  431 + // headlinesOn: 0,
  432 + // homeChannel: "0",
  433 + // iconCUrl: "",
  434 + // iconCUrlSize: "",
  435 + // iconUrl: "",
  436 + // iconUrlSize: "",
  437 + // localChannel: "0",
  438 + // moreChannel: "0",
  439 + // movePermitted: 1,
  440 + // myChannel: "0",
  441 + // name: "版面",
  442 + // num: 5,
  443 + // pageId: 20016,
  444 + // pageType: "",
  445 + // underlineCColor: ""
  446 + // },
  447 + // {
  448 + // channelId: 2011,
  449 + // channelStrategy: 2,
  450 + // channelStyle: 2,
  451 + // channelType: 1,
  452 + // defaultPermitted: 0,
  453 + // delPermitted: 1,
  454 + // fontCColor: "#FFFFFF",
  455 + // fontColor: "#F9AB99",
  456 + // headlinesOn: 0,
  457 + // homeChannel: "0",
  458 + // iconCUrl: "",
  459 + // iconCUrlSize: "",
  460 + // iconUrl: "",
  461 + // iconUrlSize: "",
  462 + // localChannel: "0",
  463 + // moreChannel: "0",
  464 + // movePermitted: 1,
  465 + // myChannel: "0",
  466 + // name: "体育",
  467 + // num: 6,
  468 + // pageId: 20021,
  469 + // pageType: "",
  470 + // underlineCColor: ""
  471 + // },
  472 + // {
  473 + // channelId: 2020,
  474 + // channelStrategy: 1,
  475 + // channelStyle: 2,
  476 + // channelType: 1,
  477 + // defaultPermitted: 0,
  478 + // delPermitted: 1,
  479 + // fontCColor: "#FFFFFF",
  480 + // fontColor: "#F9AB99",
  481 + // headlinesOn: 0,
  482 + // homeChannel: "0",
  483 + // iconCUrl: "",
  484 + // iconCUrlSize: "",
  485 + // iconUrl: "",
  486 + // iconUrlSize: "",
  487 + // localChannel: "0",
  488 + // moreChannel: "0",
  489 + // movePermitted: 1,
  490 + // myChannel: "0",
  491 + // name: "国际",
  492 + // num: 7,
  493 + // pageId: 20030,
  494 + // pageType: "",
  495 + // underlineCColor: ""
  496 + // },
  497 + // {
  498 + // channelId: 2063,
  499 + // channelStrategy: 2,
  500 + // channelStyle: 2,
  501 + // channelType: 1,
  502 + // defaultPermitted: 0,
  503 + // delPermitted: 0,
  504 + // fontCColor: "#FFFFFF",
  505 + // fontColor: "#F9AB99",
  506 + // headlinesOn: 0,
  507 + // homeChannel: "0",
  508 + // iconCUrl: "",
  509 + // iconCUrlSize: "",
  510 + // iconUrl: "",
  511 + // iconUrlSize: "",
  512 + // localChannel: "0",
  513 + // moreChannel: "0",
  514 + // movePermitted: 0,
  515 + // myChannel: "0",
  516 + // name: "两会",
  517 + // num: 8,
  518 + // pageId: 21000,
  519 + // pageType: "",
  520 + // underlineCColor: ""
  521 + // },
  522 + // {
  523 + // channelId: 2072,
  524 + // channelStrategy: 2,
  525 + // channelStyle: 2,
  526 + // channelType: 1,
  527 + // defaultPermitted: 0,
  528 + // delPermitted: 0,
  529 + // fontCColor: "#FFFFFF",
  530 + // fontColor: "#F9AB99",
  531 + // headlinesOn: 0,
  532 + // homeChannel: "0",
  533 + // iconCUrl: "",
  534 + // iconCUrlSize: "",
  535 + // iconUrl: "",
  536 + // iconUrlSize: "",
  537 + // localChannel: "0",
  538 + // moreChannel: "0",
  539 + // movePermitted: 0,
  540 + // myChannel: "0",
  541 + // name: "亚运",
  542 + // num: 9,
  543 + // pageId: 21009,
  544 + // pageType: "",
  545 + // underlineCColor: ""
  546 + // },
  547 + // {
  548 + // channelId: 2015,
  549 + // channelStrategy: 1,
  550 + // channelStyle: 2,
  551 + // channelType: 1,
  552 + // defaultPermitted: 0,
  553 + // delPermitted: 1,
  554 + // fontCColor: "#FFFFFF",
  555 + // fontColor: "#F9AB99",
  556 + // headlinesOn: 0,
  557 + // homeChannel: "0",
  558 + // iconCUrl: "",
  559 + // iconCUrlSize: "",
  560 + // iconUrl: "",
  561 + // iconUrlSize: "",
  562 + // localChannel: "0",
  563 + // moreChannel: "0",
  564 + // movePermitted: 1,
  565 + // myChannel: "0",
  566 + // name: "科技",
  567 + // num: 10,
  568 + // pageId: 20025,
  569 + // pageType: "",
  570 + // underlineCColor: ""
  571 + // },
  572 + // {
  573 + // channelId: 2004,
  574 + // channelStrategy: 2,
  575 + // channelStyle: 2,
  576 + // channelType: 1,
  577 + // defaultPermitted: 0,
  578 + // delPermitted: 0,
  579 + // fontCColor: "#FFFFFF",
  580 + // fontColor: "#F9AB99",
  581 + // headlinesOn: 0,
  582 + // homeChannel: "0",
  583 + // iconCUrl: "",
  584 + // iconCUrlSize: "",
  585 + // iconUrl: "",
  586 + // iconUrlSize: "",
  587 + // localChannel: "0",
  588 + // moreChannel: "0",
  589 + // movePermitted: 1,
  590 + // myChannel: "0",
  591 + // name: "云课堂",
  592 + // num: 11,
  593 + // pageId: 20014,
  594 + // pageType: "",
  595 + // underlineCColor: ""
  596 + // },
  597 + // {
  598 + // channelId: 2005,
  599 + // channelStrategy: 2,
  600 + // channelStyle: 2,
  601 + // channelType: 1,
  602 + // defaultPermitted: 0,
  603 + // delPermitted: 0,
  604 + // fontCColor: "#FFFFFF",
  605 + // fontColor: "#F9AB99",
  606 + // headlinesOn: 0,
  607 + // homeChannel: "0",
  608 + // iconCUrl: "",
  609 + // iconCUrlSize: "",
  610 + // iconUrl: "",
  611 + // iconUrlSize: "",
  612 + // localChannel: "0",
  613 + // moreChannel: "0",
  614 + // movePermitted: 1,
  615 + // myChannel: "0",
  616 + // name: "文件",
  617 + // num: 12,
  618 + // pageId: 20015,
  619 + // pageType: "",
  620 + // underlineCColor: ""
  621 + // },
  622 + // {
  623 + // channelId: 2007,
  624 + // channelStrategy: 1,
  625 + // channelStyle: 2,
  626 + // channelType: 1,
  627 + // defaultPermitted: 0,
  628 + // delPermitted: 0,
  629 + // fontCColor: "#FFFFFF",
  630 + // fontColor: "#F9AB99",
  631 + // headlinesOn: 0,
  632 + // homeChannel: "0",
  633 + // iconCUrl: "",
  634 + // iconCUrlSize: "",
  635 + // iconUrl: "",
  636 + // iconUrlSize: "",
  637 + // localChannel: "0",
  638 + // moreChannel: "0",
  639 + // movePermitted: 1,
  640 + // myChannel: "0",
  641 + // name: "镜头",
  642 + // num: 13,
  643 + // pageId: 20017,
  644 + // pageType: "",
  645 + // underlineCColor: ""
  646 + // },
  647 + // {
  648 + // channelId: 2008,
  649 + // channelStrategy: 2,
  650 + // channelStyle: 2,
  651 + // channelType: 1,
  652 + // defaultPermitted: 0,
  653 + // delPermitted: 0,
  654 + // fontCColor: "#FFFFFF",
  655 + // fontColor: "#F9AB99",
  656 + // headlinesOn: 0,
  657 + // homeChannel: "0",
  658 + // iconCUrl: "",
  659 + // iconCUrlSize: "",
  660 + // iconUrl: "",
  661 + // iconUrlSize: "",
  662 + // localChannel: "0",
  663 + // moreChannel: "0",
  664 + // movePermitted: 1,
  665 + // myChannel: "0",
  666 + // name: "公益",
  667 + // num: 14,
  668 + // pageId: 20018,
  669 + // pageType: "",
  670 + // underlineCColor: ""
  671 + // },
  672 + // {
  673 + // channelId: 2009,
  674 + // channelStrategy: 1,
  675 + // channelStyle: 2,
  676 + // channelType: 1,
  677 + // defaultPermitted: 0,
  678 + // delPermitted: 1,
  679 + // fontCColor: "#FFFFFF",
  680 + // fontColor: "#F9AB99",
  681 + // headlinesOn: 0,
  682 + // homeChannel: "0",
  683 + // iconCUrl: "",
  684 + // iconCUrlSize: "",
  685 + // iconUrl: "",
  686 + // iconUrlSize: "",
  687 + // localChannel: "0",
  688 + // moreChannel: "0",
  689 + // movePermitted: 1,
  690 + // myChannel: "0",
  691 + // name: "社会",
  692 + // num: 15,
  693 + // pageId: 20019,
  694 + // pageType: "",
  695 + // underlineCColor: ""
  696 + // },
  697 + // {
  698 + // channelId: 2010,
  699 + // channelStrategy: 1,
  700 + // channelStyle: 2,
  701 + // channelType: 1,
  702 + // defaultPermitted: 0,
  703 + // delPermitted: 1,
  704 + // fontCColor: "#FFFFFF",
  705 + // fontColor: "#F9AB99",
  706 + // headlinesOn: 0,
  707 + // homeChannel: "0",
  708 + // iconCUrl: "",
  709 + // iconCUrlSize: "",
  710 + // iconUrl: "",
  711 + // iconUrlSize: "",
  712 + // localChannel: "0",
  713 + // moreChannel: "0",
  714 + // movePermitted: 1,
  715 + // myChannel: "0",
  716 + // name: "财经",
  717 + // num: 16,
  718 + // pageId: 20020,
  719 + // pageType: "",
  720 + // underlineCColor: ""
  721 + // },
  722 + // {
  723 + // channelId: 2012,
  724 + // channelStrategy: 1,
  725 + // channelStyle: 2,
  726 + // channelType: 1,
  727 + // defaultPermitted: 0,
  728 + // delPermitted: 1,
  729 + // fontCColor: "#FFFFFF",
  730 + // fontColor: "#F9AB99",
  731 + // headlinesOn: 0,
  732 + // homeChannel: "0",
  733 + // iconCUrl: "",
  734 + // iconCUrlSize: "",
  735 + // iconUrl: "",
  736 + // iconUrlSize: "",
  737 + // localChannel: "0",
  738 + // moreChannel: "0",
  739 + // movePermitted: 1,
  740 + // myChannel: "0",
  741 + // name: "文化",
  742 + // num: 17,
  743 + // pageId: 20022,
  744 + // pageType: "",
  745 + // underlineCColor: ""
  746 + // },
  747 + // {
  748 + // channelId: 2013,
  749 + // channelStrategy: 1,
  750 + // channelStyle: 2,
  751 + // channelType: 1,
  752 + // defaultPermitted: 0,
  753 + // delPermitted: 1,
  754 + // fontCColor: "#FFFFFF",
  755 + // fontColor: "#F9AB99",
  756 + // headlinesOn: 0,
  757 + // homeChannel: "0",
  758 + // iconCUrl: "",
  759 + // iconCUrlSize: "",
  760 + // iconUrl: "",
  761 + // iconUrlSize: "",
  762 + // localChannel: "0",
  763 + // moreChannel: "0",
  764 + // movePermitted: 1,
  765 + // myChannel: "0",
  766 + // name: "教育",
  767 + // num: 18,
  768 + // pageId: 20023,
  769 + // pageType: "",
  770 + // underlineCColor: ""
  771 + // },
  772 + // {
  773 + // channelId: 2014,
  774 + // channelStrategy: 1,
  775 + // channelStyle: 2,
  776 + // channelType: 1,
  777 + // defaultPermitted: 0,
  778 + // delPermitted: 1,
  779 + // fontCColor: "#FFFFFF",
  780 + // fontColor: "#F9AB99",
  781 + // headlinesOn: 0,
  782 + // homeChannel: "0",
  783 + // iconCUrl: "",
  784 + // iconCUrlSize: "",
  785 + // iconUrl: "",
  786 + // iconUrlSize: "",
  787 + // localChannel: "0",
  788 + // moreChannel: "0",
  789 + // movePermitted: 1,
  790 + // myChannel: "0",
  791 + // name: "军事",
  792 + // num: 19,
  793 + // pageId: 20024,
  794 + // pageType: "",
  795 + // underlineCColor: ""
  796 + // },
  797 + // {
  798 + // channelId: 2017,
  799 + // channelStrategy: 2,
  800 + // channelStyle: 2,
  801 + // channelType: 1,
  802 + // defaultPermitted: 0,
  803 + // delPermitted: 1,
  804 + // fontCColor: "#FFFFFF",
  805 + // fontColor: "#F9AB99",
  806 + // headlinesOn: 0,
  807 + // homeChannel: "0",
  808 + // iconCUrl: "",
  809 + // iconCUrlSize: "",
  810 + // iconUrl: "",
  811 + // iconUrlSize: "",
  812 + // localChannel: "0",
  813 + // moreChannel: "0",
  814 + // movePermitted: 1,
  815 + // myChannel: "0",
  816 + // name: "健康",
  817 + // num: 20,
  818 + // pageId: 20027,
  819 + // pageType: "",
  820 + // underlineCColor: ""
  821 + // },
  822 + // {
  823 + // channelId: 2019,
  824 + // channelStrategy: 1,
  825 + // channelStyle: 2,
  826 + // channelType: 1,
  827 + // defaultPermitted: 0,
  828 + // delPermitted: 1,
  829 + // fontCColor: "#FFFFFF",
  830 + // fontColor: "#F9AB99",
  831 + // headlinesOn: 0,
  832 + // homeChannel: "0",
  833 + // iconCUrl: "",
  834 + // iconCUrlSize: "",
  835 + // iconUrl: "",
  836 + // iconUrlSize: "",
  837 + // localChannel: "0",
  838 + // moreChannel: "0",
  839 + // movePermitted: 1,
  840 + // myChannel: "0",
  841 + // name: "房产",
  842 + // num: 21,
  843 + // pageId: 20029,
  844 + // pageType: "",
  845 + // underlineCColor: ""
  846 + // },
  847 + // {
  848 + // channelId: 2018,
  849 + // channelStrategy: 1,
  850 + // channelStyle: 2,
  851 + // channelType: 1,
  852 + // defaultPermitted: 0,
  853 + // delPermitted: 1,
  854 + // fontCColor: "#FFFFFF",
  855 + // fontColor: "#F9AB99",
  856 + // headlinesOn: 0,
  857 + // homeChannel: "0",
  858 + // iconCUrl: "",
  859 + // iconCUrlSize: "",
  860 + // iconUrl: "",
  861 + // iconUrlSize: "",
  862 + // localChannel: "0",
  863 + // moreChannel: "0",
  864 + // movePermitted: 1,
  865 + // myChannel: "0",
  866 + // name: "汽车",
  867 + // num: 22,
  868 + // pageId: 20028,
  869 + // pageType: "",
  870 + // underlineCColor: ""
  871 + // },
  872 + // {
  873 + // channelId: 2065,
  874 + // channelStrategy: 2,
  875 + // channelStyle: 2,
  876 + // channelType: 1,
  877 + // defaultPermitted: 0,
  878 + // delPermitted: 0,
  879 + // fontCColor: "#FFFFFF",
  880 + // fontColor: "#F9AB99",
  881 + // headlinesOn: 0,
  882 + // homeChannel: "0",
  883 + // iconCUrl: "",
  884 + // iconCUrlSize: "",
  885 + // iconUrl: "",
  886 + // iconUrlSize: "",
  887 + // localChannel: "0",
  888 + // moreChannel: "0",
  889 + // movePermitted: 1,
  890 + // myChannel: "0",
  891 + // name: "三农",
  892 + // num: 24,
  893 + // pageId: 21002,
  894 + // pageType: "",
  895 + // underlineCColor: ""
  896 + // },
  897 + // {
  898 + // channelId: 2024,
  899 + // channelStrategy: 1,
  900 + // channelStyle: 2,
  901 + // channelType: 1,
  902 + // defaultPermitted: 0,
  903 + // delPermitted: 1,
  904 + // fontCColor: "#FFFFFF",
  905 + // fontColor: "#F9AB99",
  906 + // headlinesOn: 0,
  907 + // homeChannel: "0",
  908 + // iconCUrl: "",
  909 + // iconCUrlSize: "",
  910 + // iconUrl: "",
  911 + // iconUrlSize: "",
  912 + // localChannel: "0",
  913 + // moreChannel: "0",
  914 + // movePermitted: 1,
  915 + // myChannel: "0",
  916 + // name: "家居",
  917 + // num: 25,
  918 + // pageId: 20034,
  919 + // pageType: "",
  920 + // underlineCColor: ""
  921 + // },
  922 + // {
  923 + // channelId: 2021,
  924 + // channelStrategy: 1,
  925 + // channelStyle: 2,
  926 + // channelType: 1,
  927 + // defaultPermitted: 0,
  928 + // delPermitted: 1,
  929 + // fontCColor: "#FFFFFF",
  930 + // fontColor: "#F9AB99",
  931 + // headlinesOn: 0,
  932 + // homeChannel: "0",
  933 + // iconCUrl: "",
  934 + // iconCUrlSize: "",
  935 + // iconUrl: "",
  936 + // iconUrlSize: "",
  937 + // localChannel: "0",
  938 + // moreChannel: "0",
  939 + // movePermitted: 1,
  940 + // myChannel: "0",
  941 + // name: "法治",
  942 + // num: 27,
  943 + // pageId: 20031,
  944 + // pageType: "",
  945 + // underlineCColor: ""
  946 + // },
  947 + // {
  948 + // channelId: 2022,
  949 + // channelStrategy: 1,
  950 + // channelStyle: 2,
  951 + // channelType: 1,
  952 + // defaultPermitted: 0,
  953 + // delPermitted: 1,
  954 + // fontCColor: "#FFFFFF",
  955 + // fontColor: "#F9AB99",
  956 + // headlinesOn: 0,
  957 + // homeChannel: "0",
  958 + // iconCUrl: "",
  959 + // iconCUrlSize: "",
  960 + // iconUrl: "",
  961 + // iconUrlSize: "",
  962 + // localChannel: "0",
  963 + // moreChannel: "0",
  964 + // movePermitted: 1,
  965 + // myChannel: "0",
  966 + // name: "美食",
  967 + // num: 28,
  968 + // pageId: 20032,
  969 + // pageType: "",
  970 + // underlineCColor: ""
  971 + // },
  972 + // {
  973 + // channelId: 2025,
  974 + // channelStrategy: 1,
  975 + // channelStyle: 2,
  976 + // channelType: 1,
  977 + // defaultPermitted: 0,
  978 + // delPermitted: 1,
  979 + // fontCColor: "#FFFFFF",
  980 + // fontColor: "#F9AB99",
  981 + // headlinesOn: 0,
  982 + // homeChannel: "0",
  983 + // iconCUrl: "",
  984 + // iconCUrlSize: "",
  985 + // iconUrl: "",
  986 + // iconUrlSize: "",
  987 + // localChannel: "0",
  988 + // moreChannel: "0",
  989 + // movePermitted: 1,
  990 + // myChannel: "0",
  991 + // name: "育儿",
  992 + // num: 29,
  993 + // pageId: 20035,
  994 + // pageType: "",
  995 + // underlineCColor: ""
  996 + // },
  997 + // {
  998 + // channelId: 2026,
  999 + // channelStrategy: 1,
  1000 + // channelStyle: 2,
  1001 + // channelType: 1,
  1002 + // defaultPermitted: 0,
  1003 + // delPermitted: 1,
  1004 + // fontCColor: "#FFFFFF",
  1005 + // fontColor: "#F9AB99",
  1006 + // headlinesOn: 0,
  1007 + // homeChannel: "0",
  1008 + // iconCUrl: "",
  1009 + // iconCUrlSize: "",
  1010 + // iconUrl: "",
  1011 + // iconUrlSize: "",
  1012 + // localChannel: "0",
  1013 + // moreChannel: "0",
  1014 + // movePermitted: 1,
  1015 + // myChannel: "0",
  1016 + // name: "生态",
  1017 + // num: 30,
  1018 + // pageId: 20036,
  1019 + // pageType: "",
  1020 + // underlineCColor: ""
  1021 + // },
  1022 + // {
  1023 + // channelId: 2023,
  1024 + // channelStrategy: 1,
  1025 + // channelStyle: 2,
  1026 + // channelType: 1,
  1027 + // defaultPermitted: 0,
  1028 + // delPermitted: 1,
  1029 + // fontCColor: "#FFFFFF",
  1030 + // fontColor: "#F9AB99",
  1031 + // headlinesOn: 0,
  1032 + // homeChannel: "0",
  1033 + // iconCUrl: "",
  1034 + // iconCUrlSize: "",
  1035 + // iconUrl: "",
  1036 + // iconUrlSize: "",
  1037 + // localChannel: "0",
  1038 + // moreChannel: "0",
  1039 + // movePermitted: 1,
  1040 + // myChannel: "0",
  1041 + // name: "时尚",
  1042 + // num: 31,
  1043 + // pageId: 20033,
  1044 + // pageType: "",
  1045 + // underlineCColor: ""
  1046 + // },
  1047 + // {
  1048 + // channelId: 2027,
  1049 + // channelStrategy: 1,
  1050 + // channelStyle: 2,
  1051 + // channelType: 2,
  1052 + // defaultPermitted: 0,
  1053 + // delPermitted: 1,
  1054 + // fontCColor: "#FFFFFF",
  1055 + // fontColor: "#F9AB99",
  1056 + // headlinesOn: 0,
  1057 + // homeChannel: "0",
  1058 + // iconCUrl: "",
  1059 + // iconCUrlSize: "",
  1060 + // iconUrl: "",
  1061 + // iconUrlSize: "",
  1062 + // localChannel: "0",
  1063 + // moreChannel: "0",
  1064 + // movePermitted: 1,
  1065 + // myChannel: "0",
  1066 + // name: "北京",
  1067 + // num: 32,
  1068 + // pageId: 20037,
  1069 + // pageType: "",
  1070 + // underlineCColor: ""
  1071 + // },
  1072 + // {
  1073 + // channelId: 2029,
  1074 + // channelStrategy: 1,
  1075 + // channelStyle: 2,
  1076 + // channelType: 2,
  1077 + // defaultPermitted: 0,
  1078 + // delPermitted: 1,
  1079 + // fontCColor: "#FFFFFF",
  1080 + // fontColor: "#F9AB99",
  1081 + // headlinesOn: 0,
  1082 + // homeChannel: "0",
  1083 + // iconCUrl: "",
  1084 + // iconCUrlSize: "",
  1085 + // iconUrl: "",
  1086 + // iconUrlSize: "",
  1087 + // localChannel: "0",
  1088 + // moreChannel: "0",
  1089 + // movePermitted: 1,
  1090 + // myChannel: "0",
  1091 + // name: "天津",
  1092 + // num: 33,
  1093 + // pageId: 20039,
  1094 + // pageType: "",
  1095 + // underlineCColor: ""
  1096 + // },
  1097 + // {
  1098 + // channelId: 2030,
  1099 + // channelStrategy: 1,
  1100 + // channelStyle: 2,
  1101 + // channelType: 2,
  1102 + // defaultPermitted: 0,
  1103 + // delPermitted: 1,
  1104 + // fontCColor: "#FFFFFF",
  1105 + // fontColor: "#F9AB99",
  1106 + // headlinesOn: 0,
  1107 + // homeChannel: "0",
  1108 + // iconCUrl: "",
  1109 + // iconCUrlSize: "",
  1110 + // iconUrl: "",
  1111 + // iconUrlSize: "",
  1112 + // localChannel: "0",
  1113 + // moreChannel: "0",
  1114 + // movePermitted: 1,
  1115 + // myChannel: "0",
  1116 + // name: "河北",
  1117 + // num: 34,
  1118 + // pageId: 20040,
  1119 + // pageType: "",
  1120 + // underlineCColor: ""
  1121 + // },
  1122 + // {
  1123 + // channelId: 2042,
  1124 + // channelStrategy: 1,
  1125 + // channelStyle: 2,
  1126 + // channelType: 2,
  1127 + // defaultPermitted: 0,
  1128 + // delPermitted: 1,
  1129 + // fontCColor: "#FFFFFF",
  1130 + // fontColor: "#F9AB99",
  1131 + // headlinesOn: 0,
  1132 + // homeChannel: "0",
  1133 + // iconCUrl: "",
  1134 + // iconCUrlSize: "",
  1135 + // iconUrl: "",
  1136 + // iconUrlSize: "",
  1137 + // localChannel: "0",
  1138 + // moreChannel: "0",
  1139 + // movePermitted: 1,
  1140 + // myChannel: "0",
  1141 + // name: "河南",
  1142 + // num: 35,
  1143 + // pageId: 20052,
  1144 + // pageType: "",
  1145 + // underlineCColor: ""
  1146 + // },
  1147 + // {
  1148 + // channelId: 2041,
  1149 + // channelStrategy: 1,
  1150 + // channelStyle: 2,
  1151 + // channelType: 2,
  1152 + // defaultPermitted: 0,
  1153 + // delPermitted: 1,
  1154 + // fontCColor: "#FFFFFF",
  1155 + // fontColor: "#F9AB99",
  1156 + // headlinesOn: 0,
  1157 + // homeChannel: "0",
  1158 + // iconCUrl: "",
  1159 + // iconCUrlSize: "",
  1160 + // iconUrl: "",
  1161 + // iconUrlSize: "",
  1162 + // localChannel: "0",
  1163 + // moreChannel: "0",
  1164 + // movePermitted: 1,
  1165 + // myChannel: "0",
  1166 + // name: "山东",
  1167 + // num: 36,
  1168 + // pageId: 20051,
  1169 + // pageType: "",
  1170 + // underlineCColor: ""
  1171 + // },
  1172 + // {
  1173 + // channelId: 2031,
  1174 + // channelStrategy: 2,
  1175 + // channelStyle: 2,
  1176 + // channelType: 2,
  1177 + // defaultPermitted: 0,
  1178 + // delPermitted: 1,
  1179 + // fontCColor: "#FFFFFF",
  1180 + // fontColor: "#F9AB99",
  1181 + // headlinesOn: 0,
  1182 + // homeChannel: "0",
  1183 + // iconCUrl: "",
  1184 + // iconCUrlSize: "",
  1185 + // iconUrl: "",
  1186 + // iconUrlSize: "",
  1187 + // localChannel: "0",
  1188 + // moreChannel: "0",
  1189 + // movePermitted: 1,
  1190 + // myChannel: "0",
  1191 + // name: "山西",
  1192 + // num: 37,
  1193 + // pageId: 20041,
  1194 + // pageType: "",
  1195 + // underlineCColor: ""
  1196 + // },
  1197 + // {
  1198 + // channelId: 2032,
  1199 + // channelStrategy: 1,
  1200 + // channelStyle: 2,
  1201 + // channelType: 2,
  1202 + // defaultPermitted: 0,
  1203 + // delPermitted: 1,
  1204 + // fontCColor: "#FFFFFF",
  1205 + // fontColor: "#F9AB99",
  1206 + // headlinesOn: 0,
  1207 + // homeChannel: "0",
  1208 + // iconCUrl: "",
  1209 + // iconCUrlSize: "",
  1210 + // iconUrl: "",
  1211 + // iconUrlSize: "",
  1212 + // localChannel: "0",
  1213 + // moreChannel: "0",
  1214 + // movePermitted: 1,
  1215 + // myChannel: "0",
  1216 + // name: "内蒙古",
  1217 + // num: 38,
  1218 + // pageId: 20042,
  1219 + // pageType: "",
  1220 + // underlineCColor: ""
  1221 + // },
  1222 + // {
  1223 + // channelId: 2033,
  1224 + // channelStrategy: 1,
  1225 + // channelStyle: 2,
  1226 + // channelType: 2,
  1227 + // defaultPermitted: 0,
  1228 + // delPermitted: 1,
  1229 + // fontCColor: "#FFFFFF",
  1230 + // fontColor: "#F9AB99",
  1231 + // headlinesOn: 0,
  1232 + // homeChannel: "0",
  1233 + // iconCUrl: "",
  1234 + // iconCUrlSize: "",
  1235 + // iconUrl: "",
  1236 + // iconUrlSize: "",
  1237 + // localChannel: "0",
  1238 + // moreChannel: "0",
  1239 + // movePermitted: 1,
  1240 + // myChannel: "0",
  1241 + // name: "辽宁",
  1242 + // num: 39,
  1243 + // pageId: 20043,
  1244 + // pageType: "",
  1245 + // underlineCColor: ""
  1246 + // },
  1247 + // {
  1248 + // channelId: 2034,
  1249 + // channelStrategy: 1,
  1250 + // channelStyle: 2,
  1251 + // channelType: 2,
  1252 + // defaultPermitted: 0,
  1253 + // delPermitted: 1,
  1254 + // fontCColor: "#FFFFFF",
  1255 + // fontColor: "#F9AB99",
  1256 + // headlinesOn: 0,
  1257 + // homeChannel: "0",
  1258 + // iconCUrl: "",
  1259 + // iconCUrlSize: "",
  1260 + // iconUrl: "",
  1261 + // iconUrlSize: "",
  1262 + // localChannel: "0",
  1263 + // moreChannel: "0",
  1264 + // movePermitted: 1,
  1265 + // myChannel: "0",
  1266 + // name: "吉林",
  1267 + // num: 40,
  1268 + // pageId: 20044,
  1269 + // pageType: "",
  1270 + // underlineCColor: ""
  1271 + // },
  1272 + // {
  1273 + // channelId: 2035,
  1274 + // channelStrategy: 1,
  1275 + // channelStyle: 2,
  1276 + // channelType: 2,
  1277 + // defaultPermitted: 0,
  1278 + // delPermitted: 1,
  1279 + // fontCColor: "#FFFFFF",
  1280 + // fontColor: "#F9AB99",
  1281 + // headlinesOn: 0,
  1282 + // homeChannel: "0",
  1283 + // iconCUrl: "",
  1284 + // iconCUrlSize: "",
  1285 + // iconUrl: "",
  1286 + // iconUrlSize: "",
  1287 + // localChannel: "0",
  1288 + // moreChannel: "0",
  1289 + // movePermitted: 1,
  1290 + // myChannel: "0",
  1291 + // name: "黑龙江",
  1292 + // num: 41,
  1293 + // pageId: 20045,
  1294 + // pageType: "",
  1295 + // underlineCColor: ""
  1296 + // },
  1297 + // {
  1298 + // channelId: 2028,
  1299 + // channelStrategy: 1,
  1300 + // channelStyle: 2,
  1301 + // channelType: 2,
  1302 + // defaultPermitted: 0,
  1303 + // delPermitted: 1,
  1304 + // fontCColor: "#FFFFFF",
  1305 + // fontColor: "#F9AB99",
  1306 + // headlinesOn: 0,
  1307 + // homeChannel: "0",
  1308 + // iconCUrl: "",
  1309 + // iconCUrlSize: "",
  1310 + // iconUrl: "",
  1311 + // iconUrlSize: "",
  1312 + // localChannel: "0",
  1313 + // moreChannel: "0",
  1314 + // movePermitted: 1,
  1315 + // myChannel: "0",
  1316 + // name: "上海",
  1317 + // num: 42,
  1318 + // pageId: 20038,
  1319 + // pageType: "",
  1320 + // underlineCColor: ""
  1321 + // },
  1322 + // {
  1323 + // channelId: 2036,
  1324 + // channelStrategy: 1,
  1325 + // channelStyle: 2,
  1326 + // channelType: 2,
  1327 + // defaultPermitted: 0,
  1328 + // delPermitted: 1,
  1329 + // fontCColor: "#FFFFFF",
  1330 + // fontColor: "#F9AB99",
  1331 + // headlinesOn: 0,
  1332 + // homeChannel: "0",
  1333 + // iconCUrl: "",
  1334 + // iconCUrlSize: "",
  1335 + // iconUrl: "",
  1336 + // iconUrlSize: "",
  1337 + // localChannel: "0",
  1338 + // moreChannel: "0",
  1339 + // movePermitted: 1,
  1340 + // myChannel: "0",
  1341 + // name: "江苏",
  1342 + // num: 43,
  1343 + // pageId: 20046,
  1344 + // pageType: "",
  1345 + // underlineCColor: ""
  1346 + // },
  1347 + // {
  1348 + // channelId: 2037,
  1349 + // channelStrategy: 1,
  1350 + // channelStyle: 2,
  1351 + // channelType: 2,
  1352 + // defaultPermitted: 0,
  1353 + // delPermitted: 1,
  1354 + // fontCColor: "#FFFFFF",
  1355 + // fontColor: "#F9AB99",
  1356 + // headlinesOn: 0,
  1357 + // homeChannel: "0",
  1358 + // iconCUrl: "",
  1359 + // iconCUrlSize: "",
  1360 + // iconUrl: "",
  1361 + // iconUrlSize: "",
  1362 + // localChannel: "0",
  1363 + // moreChannel: "0",
  1364 + // movePermitted: 1,
  1365 + // myChannel: "0",
  1366 + // name: "浙江",
  1367 + // num: 44,
  1368 + // pageId: 20047,
  1369 + // pageType: "",
  1370 + // underlineCColor: ""
  1371 + // },
  1372 + // {
  1373 + // channelId: 2038,
  1374 + // channelStrategy: 1,
  1375 + // channelStyle: 2,
  1376 + // channelType: 2,
  1377 + // defaultPermitted: 0,
  1378 + // delPermitted: 1,
  1379 + // fontCColor: "#FFFFFF",
  1380 + // fontColor: "#F9AB99",
  1381 + // headlinesOn: 0,
  1382 + // homeChannel: "0",
  1383 + // iconCUrl: "",
  1384 + // iconCUrlSize: "",
  1385 + // iconUrl: "",
  1386 + // iconUrlSize: "",
  1387 + // localChannel: "0",
  1388 + // moreChannel: "0",
  1389 + // movePermitted: 1,
  1390 + // myChannel: "0",
  1391 + // name: "安徽",
  1392 + // num: 45,
  1393 + // pageId: 20048,
  1394 + // pageType: "",
  1395 + // underlineCColor: ""
  1396 + // },
  1397 + // {
  1398 + // channelId: 2039,
  1399 + // channelStrategy: 1,
  1400 + // channelStyle: 2,
  1401 + // channelType: 2,
  1402 + // defaultPermitted: 0,
  1403 + // delPermitted: 1,
  1404 + // fontCColor: "#FFFFFF",
  1405 + // fontColor: "#F9AB99",
  1406 + // headlinesOn: 0,
  1407 + // homeChannel: "0",
  1408 + // iconCUrl: "",
  1409 + // iconCUrlSize: "",
  1410 + // iconUrl: "",
  1411 + // iconUrlSize: "",
  1412 + // localChannel: "0",
  1413 + // moreChannel: "0",
  1414 + // movePermitted: 1,
  1415 + // myChannel: "0",
  1416 + // name: "福建",
  1417 + // num: 46,
  1418 + // pageId: 20049,
  1419 + // pageType: "",
  1420 + // underlineCColor: ""
  1421 + // },
  1422 + // {
  1423 + // channelId: 2040,
  1424 + // channelStrategy: 1,
  1425 + // channelStyle: 2,
  1426 + // channelType: 2,
  1427 + // defaultPermitted: 0,
  1428 + // delPermitted: 1,
  1429 + // fontCColor: "#FFFFFF",
  1430 + // fontColor: "#F9AB99",
  1431 + // headlinesOn: 0,
  1432 + // homeChannel: "0",
  1433 + // iconCUrl: "",
  1434 + // iconCUrlSize: "",
  1435 + // iconUrl: "",
  1436 + // iconUrlSize: "",
  1437 + // localChannel: "0",
  1438 + // moreChannel: "0",
  1439 + // movePermitted: 1,
  1440 + // myChannel: "0",
  1441 + // name: "江西",
  1442 + // num: 47,
  1443 + // pageId: 20050,
  1444 + // pageType: "",
  1445 + // underlineCColor: ""
  1446 + // },
  1447 + // {
  1448 + // channelId: 2045,
  1449 + // channelStrategy: 2,
  1450 + // channelStyle: 2,
  1451 + // channelType: 2,
  1452 + // defaultPermitted: 0,
  1453 + // delPermitted: 1,
  1454 + // fontCColor: "#FFFFFF",
  1455 + // fontColor: "#F9AB99",
  1456 + // headlinesOn: 0,
  1457 + // homeChannel: "0",
  1458 + // iconCUrl: "",
  1459 + // iconCUrlSize: "",
  1460 + // iconUrl: "",
  1461 + // iconUrlSize: "",
  1462 + // localChannel: "0",
  1463 + // moreChannel: "0",
  1464 + // movePermitted: 1,
  1465 + // myChannel: "0",
  1466 + // name: "广东",
  1467 + // num: 48,
  1468 + // pageId: 20055,
  1469 + // pageType: "",
  1470 + // underlineCColor: ""
  1471 + // },
  1472 + // {
  1473 + // channelId: 2046,
  1474 + // channelStrategy: 1,
  1475 + // channelStyle: 2,
  1476 + // channelType: 2,
  1477 + // defaultPermitted: 0,
  1478 + // delPermitted: 1,
  1479 + // fontCColor: "#FFFFFF",
  1480 + // fontColor: "#F9AB99",
  1481 + // headlinesOn: 0,
  1482 + // homeChannel: "0",
  1483 + // iconCUrl: "",
  1484 + // iconCUrlSize: "",
  1485 + // iconUrl: "",
  1486 + // iconUrlSize: "",
  1487 + // localChannel: "0",
  1488 + // moreChannel: "0",
  1489 + // movePermitted: 1,
  1490 + // myChannel: "0",
  1491 + // name: "广西",
  1492 + // num: 49,
  1493 + // pageId: 20056,
  1494 + // pageType: "",
  1495 + // underlineCColor: ""
  1496 + // },
  1497 + // {
  1498 + // channelId: 2048,
  1499 + // channelStrategy: 1,
  1500 + // channelStyle: 2,
  1501 + // channelType: 2,
  1502 + // defaultPermitted: 0,
  1503 + // delPermitted: 1,
  1504 + // fontCColor: "#FFFFFF",
  1505 + // fontColor: "#F9AB99",
  1506 + // headlinesOn: 0,
  1507 + // homeChannel: "0",
  1508 + // iconCUrl: "",
  1509 + // iconCUrlSize: "",
  1510 + // iconUrl: "",
  1511 + // iconUrlSize: "",
  1512 + // localChannel: "0",
  1513 + // moreChannel: "0",
  1514 + // movePermitted: 1,
  1515 + // myChannel: "0",
  1516 + // name: "重庆",
  1517 + // num: 50,
  1518 + // pageId: 20058,
  1519 + // pageType: "",
  1520 + // underlineCColor: ""
  1521 + // },
  1522 + // {
  1523 + // channelId: 2049,
  1524 + // channelStrategy: 1,
  1525 + // channelStyle: 2,
  1526 + // channelType: 2,
  1527 + // defaultPermitted: 0,
  1528 + // delPermitted: 1,
  1529 + // fontCColor: "#FFFFFF",
  1530 + // fontColor: "#F9AB99",
  1531 + // headlinesOn: 0,
  1532 + // homeChannel: "0",
  1533 + // iconCUrl: "",
  1534 + // iconCUrlSize: "",
  1535 + // iconUrl: "",
  1536 + // iconUrlSize: "",
  1537 + // localChannel: "0",
  1538 + // moreChannel: "0",
  1539 + // movePermitted: 1,
  1540 + // myChannel: "0",
  1541 + // name: "四川",
  1542 + // num: 51,
  1543 + // pageId: 20059,
  1544 + // pageType: "",
  1545 + // underlineCColor: ""
  1546 + // },
  1547 + // {
  1548 + // channelId: 2051,
  1549 + // channelStrategy: 1,
  1550 + // channelStyle: 2,
  1551 + // channelType: 2,
  1552 + // defaultPermitted: 0,
  1553 + // delPermitted: 1,
  1554 + // fontCColor: "#FFFFFF",
  1555 + // fontColor: "#F9AB99",
  1556 + // headlinesOn: 0,
  1557 + // homeChannel: "0",
  1558 + // iconCUrl: "",
  1559 + // iconCUrlSize: "",
  1560 + // iconUrl: "",
  1561 + // iconUrlSize: "",
  1562 + // localChannel: "0",
  1563 + // moreChannel: "0",
  1564 + // movePermitted: 1,
  1565 + // myChannel: "0",
  1566 + // name: "云南",
  1567 + // num: 52,
  1568 + // pageId: 20061,
  1569 + // pageType: "",
  1570 + // underlineCColor: ""
  1571 + // },
  1572 + // {
  1573 + // channelId: 2050,
  1574 + // channelStrategy: 1,
  1575 + // channelStyle: 2,
  1576 + // channelType: 2,
  1577 + // defaultPermitted: 0,
  1578 + // delPermitted: 1,
  1579 + // fontCColor: "#FFFFFF",
  1580 + // fontColor: "#F9AB99",
  1581 + // headlinesOn: 0,
  1582 + // homeChannel: "0",
  1583 + // iconCUrl: "",
  1584 + // iconCUrlSize: "",
  1585 + // iconUrl: "",
  1586 + // iconUrlSize: "",
  1587 + // localChannel: "0",
  1588 + // moreChannel: "0",
  1589 + // movePermitted: 1,
  1590 + // myChannel: "0",
  1591 + // name: "贵州",
  1592 + // num: 53,
  1593 + // pageId: 20060,
  1594 + // pageType: "",
  1595 + // underlineCColor: ""
  1596 + // },
  1597 + // {
  1598 + // channelId: 2044,
  1599 + // channelStrategy: 1,
  1600 + // channelStyle: 2,
  1601 + // channelType: 2,
  1602 + // defaultPermitted: 0,
  1603 + // delPermitted: 1,
  1604 + // fontCColor: "#FFFFFF",
  1605 + // fontColor: "#F9AB99",
  1606 + // headlinesOn: 0,
  1607 + // homeChannel: "0",
  1608 + // iconCUrl: "",
  1609 + // iconCUrlSize: "",
  1610 + // iconUrl: "",
  1611 + // iconUrlSize: "",
  1612 + // localChannel: "0",
  1613 + // moreChannel: "0",
  1614 + // movePermitted: 1,
  1615 + // myChannel: "0",
  1616 + // name: "湖南",
  1617 + // num: 54,
  1618 + // pageId: 20054,
  1619 + // pageType: "",
  1620 + // underlineCColor: ""
  1621 + // },
  1622 + // {
  1623 + // channelId: 2043,
  1624 + // channelStrategy: 1,
  1625 + // channelStyle: 2,
  1626 + // channelType: 2,
  1627 + // defaultPermitted: 0,
  1628 + // delPermitted: 1,
  1629 + // fontCColor: "#FFFFFF",
  1630 + // fontColor: "#F9AB99",
  1631 + // headlinesOn: 0,
  1632 + // homeChannel: "0",
  1633 + // iconCUrl: "",
  1634 + // iconCUrlSize: "",
  1635 + // iconUrl: "",
  1636 + // iconUrlSize: "",
  1637 + // localChannel: "0",
  1638 + // moreChannel: "0",
  1639 + // movePermitted: 1,
  1640 + // myChannel: "0",
  1641 + // name: "湖北",
  1642 + // num: 55,
  1643 + // pageId: 20053,
  1644 + // pageType: "",
  1645 + // underlineCColor: ""
  1646 + // },
  1647 + // {
  1648 + // channelId: 2052,
  1649 + // channelStrategy: 2,
  1650 + // channelStyle: 2,
  1651 + // channelType: 2,
  1652 + // defaultPermitted: 0,
  1653 + // delPermitted: 1,
  1654 + // fontCColor: "#FFFFFF",
  1655 + // fontColor: "#F9AB99",
  1656 + // headlinesOn: 0,
  1657 + // homeChannel: "0",
  1658 + // iconCUrl: "",
  1659 + // iconCUrlSize: "",
  1660 + // iconUrl: "",
  1661 + // iconUrlSize: "",
  1662 + // localChannel: "0",
  1663 + // moreChannel: "0",
  1664 + // movePermitted: 1,
  1665 + // myChannel: "0",
  1666 + // name: "西藏",
  1667 + // num: 56,
  1668 + // pageId: 20062,
  1669 + // pageType: "",
  1670 + // underlineCColor: ""
  1671 + // },
  1672 + // {
  1673 + // channelId: 2057,
  1674 + // channelStrategy: 2,
  1675 + // channelStyle: 2,
  1676 + // channelType: 2,
  1677 + // defaultPermitted: 0,
  1678 + // delPermitted: 1,
  1679 + // fontCColor: "#FFFFFF",
  1680 + // fontColor: "#F9AB99",
  1681 + // headlinesOn: 0,
  1682 + // homeChannel: "0",
  1683 + // iconCUrl: "",
  1684 + // iconCUrlSize: "",
  1685 + // iconUrl: "",
  1686 + // iconUrlSize: "",
  1687 + // localChannel: "0",
  1688 + // moreChannel: "0",
  1689 + // movePermitted: 1,
  1690 + // myChannel: "0",
  1691 + // name: "新疆",
  1692 + // num: 57,
  1693 + // pageId: 20067,
  1694 + // pageType: "",
  1695 + // underlineCColor: ""
  1696 + // },
  1697 + // {
  1698 + // channelId: 2053,
  1699 + // channelStrategy: 1,
  1700 + // channelStyle: 2,
  1701 + // channelType: 2,
  1702 + // defaultPermitted: 0,
  1703 + // delPermitted: 1,
  1704 + // fontCColor: "#FFFFFF",
  1705 + // fontColor: "#F9AB99",
  1706 + // headlinesOn: 0,
  1707 + // homeChannel: "0",
  1708 + // iconCUrl: "",
  1709 + // iconCUrlSize: "",
  1710 + // iconUrl: "",
  1711 + // iconUrlSize: "",
  1712 + // localChannel: "0",
  1713 + // moreChannel: "0",
  1714 + // movePermitted: 1,
  1715 + // myChannel: "0",
  1716 + // name: "陕西",
  1717 + // num: 58,
  1718 + // pageId: 20063,
  1719 + // pageType: "",
  1720 + // underlineCColor: ""
  1721 + // },
  1722 + // {
  1723 + // channelId: 2054,
  1724 + // channelStrategy: 1,
  1725 + // channelStyle: 2,
  1726 + // channelType: 2,
  1727 + // defaultPermitted: 0,
  1728 + // delPermitted: 1,
  1729 + // fontCColor: "#FFFFFF",
  1730 + // fontColor: "#F9AB99",
  1731 + // headlinesOn: 0,
  1732 + // homeChannel: "0",
  1733 + // iconCUrl: "",
  1734 + // iconCUrlSize: "",
  1735 + // iconUrl: "",
  1736 + // iconUrlSize: "",
  1737 + // localChannel: "0",
  1738 + // moreChannel: "0",
  1739 + // movePermitted: 1,
  1740 + // myChannel: "0",
  1741 + // name: "甘肃",
  1742 + // num: 59,
  1743 + // pageId: 20064,
  1744 + // pageType: "",
  1745 + // underlineCColor: ""
  1746 + // },
  1747 + // {
  1748 + // channelId: 2055,
  1749 + // channelStrategy: 1,
  1750 + // channelStyle: 2,
  1751 + // channelType: 2,
  1752 + // defaultPermitted: 0,
  1753 + // delPermitted: 1,
  1754 + // fontCColor: "#FFFFFF",
  1755 + // fontColor: "#F9AB99",
  1756 + // headlinesOn: 0,
  1757 + // homeChannel: "0",
  1758 + // iconCUrl: "",
  1759 + // iconCUrlSize: "",
  1760 + // iconUrl: "",
  1761 + // iconUrlSize: "",
  1762 + // localChannel: "0",
  1763 + // moreChannel: "0",
  1764 + // movePermitted: 1,
  1765 + // myChannel: "0",
  1766 + // name: "青海",
  1767 + // num: 60,
  1768 + // pageId: 20065,
  1769 + // pageType: "",
  1770 + // underlineCColor: ""
  1771 + // },
  1772 + // {
  1773 + // channelId: 2056,
  1774 + // channelStrategy: 2,
  1775 + // channelStyle: 2,
  1776 + // channelType: 2,
  1777 + // defaultPermitted: 0,
  1778 + // delPermitted: 1,
  1779 + // fontCColor: "#FFFFFF",
  1780 + // fontColor: "#F9AB99",
  1781 + // headlinesOn: 0,
  1782 + // homeChannel: "0",
  1783 + // iconCUrl: "",
  1784 + // iconCUrlSize: "",
  1785 + // iconUrl: "",
  1786 + // iconUrlSize: "",
  1787 + // localChannel: "0",
  1788 + // moreChannel: "0",
  1789 + // movePermitted: 1,
  1790 + // myChannel: "0",
  1791 + // name: "宁夏",
  1792 + // num: 61,
  1793 + // pageId: 20066,
  1794 + // pageType: "",
  1795 + // underlineCColor: ""
  1796 + // },
  1797 + // {
  1798 + // channelId: 2047,
  1799 + // channelStrategy: 1,
  1800 + // channelStyle: 2,
  1801 + // channelType: 2,
  1802 + // defaultPermitted: 0,
  1803 + // delPermitted: 1,
  1804 + // fontCColor: "#FFFFFF",
  1805 + // fontColor: "#F9AB99",
  1806 + // headlinesOn: 0,
  1807 + // homeChannel: "0",
  1808 + // iconCUrl: "",
  1809 + // iconCUrlSize: "",
  1810 + // iconUrl: "",
  1811 + // iconUrlSize: "",
  1812 + // localChannel: "0",
  1813 + // moreChannel: "0",
  1814 + // movePermitted: 1,
  1815 + // myChannel: "0",
  1816 + // name: "海南",
  1817 + // num: 62,
  1818 + // pageId: 20057,
  1819 + // pageType: "",
  1820 + // underlineCColor: ""
  1821 + // }
  1822 + // ]
  1823 + // @State myChannelList: TopNavDTO [] = []
  1824 + // @State moreChannelList: TopNavDTO [] = []
  1825 + // @State localChannelList: TopNavDTO [] = []
247 dialogController: CustomDialogController | null = new CustomDialogController({ 1826 dialogController: CustomDialogController | null = new CustomDialogController({
248 builder: ChannelDialog({ 1827 builder: ChannelDialog({
249 currentTopNavSelectedIndex: $currentTopNavSelectedIndex, 1828 currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
250 indexSettingArray: $indexSettingArray, 1829 indexSettingArray: $indexSettingArray,
251 myChannelList: $myChannelList, 1830 myChannelList: $myChannelList,
252 moreChannelList: $moreChannelList, 1831 moreChannelList: $moreChannelList,
253 - localChannelList: $localChannelList 1832 + localChannelList: $localChannelList,
  1833 + confirm: this.onAccept,
  1834 + changeChannelIndex: this.changeChannelIndex
254 }), 1835 }),
255 alignment: DialogAlignment.TopEnd, 1836 alignment: DialogAlignment.TopEnd,
256 customStyle: true, 1837 customStyle: true,
257 }) 1838 })
258 1839
259 - aboutToAppear() { 1840 + changeChannelIndex(index1:number, index2:number) { //交换数组中的位置
  1841 + const temp = this.myChannelList[index1];
  1842 + if (index1 > index2) {
  1843 + this.myChannelList.splice(index2, 0, temp);
  1844 + this.myChannelList.splice(index1 + 1, 1);
  1845 + } else {
  1846 + this.myChannelList.splice(index2 + 1, 0, temp);
  1847 + this.myChannelList.splice(index1, 1);
  1848 + }
  1849 + }
  1850 + // topNavListHandle() {
  1851 + // let defaultMyChannelList: TopNavDTO[] = []
  1852 + // let handledTopNavList = [...this.topNavList]
  1853 + // handledTopNavList.sort((a, b) => {
  1854 + // return a.num - b.num;
  1855 + // });
  1856 + // handledTopNavList.forEach(item => {
  1857 + // if (item.defaultPermitted === 1 || item.movePermitted === 0 || item.delPermitted === 0 || item.headlinesOn === 1) {
  1858 + // defaultMyChannelList.push(item);
  1859 + // }
  1860 + // })
  1861 + // defaultMyChannelList.forEach(item => {
  1862 + // item.myChannel = '1'
  1863 + // if (item.defaultPermitted === 1) {
  1864 + // item.homeChannel = '1'
  1865 + // }
  1866 + // let index = handledTopNavList.findIndex(_item => _item.channelId === item.channelId)
  1867 + // if (index !== -1) {
  1868 + // handledTopNavList.splice(index, 1)
  1869 + // }
  1870 + // })
  1871 + //
  1872 + // handledTopNavList.unshift(...defaultMyChannelList)
  1873 + // handledTopNavList.forEach((item, index) => {
  1874 + // if (item.channelType === 2) {
  1875 + // item.localChannel = '1'
  1876 + // }
  1877 + // if (index >= 11) {
  1878 + // if (item.channelType === 1) {
  1879 + // item.moreChannel = '1'
  1880 + // }
  1881 + // } else {
  1882 + // if (item.channelType === 1 && item.myChannel !== '1') {
  1883 + // item.moreChannel = '1'
  1884 + // }
  1885 + // }
  1886 + //
  1887 + // if (item.myChannel === '1') {
  1888 + // this.myChannelList.push(item)
  1889 + // }
  1890 + // if (item.moreChannel === '1') {
  1891 + // this.moreChannelList.push(item)
  1892 + // }
  1893 + // if (item.localChannel === '1') {
  1894 + // this.localChannelList.push(item)
  1895 + // }
  1896 + // })
  1897 + // }
260 1898
  1899 +
  1900 + aboutToAppear() {
  1901 + // this.topNavListHandle()
261 } 1902 }
262 1903
263 aboutToDisappear() { 1904 aboutToDisappear() {
@@ -270,8 +1911,9 @@ struct ChannelSubscriptionLayout { @@ -270,8 +1911,9 @@ struct ChannelSubscriptionLayout {
270 .width(18) 1911 .width(18)
271 } 1912 }
272 .width(36) 1913 .width(36)
273 - .height(30) 1914 + .height(36)
274 .justifyContent(FlexAlign.Center) 1915 .justifyContent(FlexAlign.Center)
  1916 + .padding({ bottom: 6 })
275 .backgroundColor('#ffffff') 1917 .backgroundColor('#ffffff')
276 .onClick(() => { 1918 .onClick(() => {
277 if (this.dialogController != null) { 1919 if (this.dialogController != null) {
1 1
2 import { CustomTitleUI } from '../reusable/CustomTitleUI'; 2 import { CustomTitleUI } from '../reusable/CustomTitleUI';
3 -import { EditListInfo } from '../../model/EditInfoModel'; 3 +import { EditListInfo, editModel } from '../../model/EditInfoModel';
4 import EditInfoViewModel from '../../viewmodel/EditInfoViewModel'; 4 import EditInfoViewModel from '../../viewmodel/EditInfoViewModel';
5 import { WDRouterPage, WDRouterRule } from 'wdRouter'; 5 import { WDRouterPage, WDRouterRule } from 'wdRouter';
6 import {AreaPickerDialog} from '../view/areaPickerDialog/AreaPickerDialog' 6 import {AreaPickerDialog} from '../view/areaPickerDialog/AreaPickerDialog'
7 import { AreaListModel } from '../../model/AreaListModel'; 7 import { AreaListModel } from '../../model/AreaListModel';
8 -import router from '@ohos.router';  
9 -  
10 8
11 @Entry 9 @Entry
12 @Component 10 @Component
@@ -14,9 +12,15 @@ struct EditUserInfoPage { @@ -14,9 +12,15 @@ struct EditUserInfoPage {
14 @State listData: EditListInfo[] = [] 12 @State listData: EditListInfo[] = []
15 @State headerImg: string = '' 13 @State headerImg: string = ''
16 @State dataSource: AreaListModel[] = [] 14 @State dataSource: AreaListModel[] = []
  15 + @State currentUserInfo: editModel = new editModel()
17 16
18 dialogController: CustomDialogController = new CustomDialogController({ 17 dialogController: CustomDialogController = new CustomDialogController({
19 - builder: AreaPickerDialog({dataSource:this.dataSource}), 18 + builder: AreaPickerDialog({dataSource:this.dataSource,
  19 + confirmCallback:(area:string)=>{
  20 + this.currentUserInfo.userExtend.city = area;
  21 + this.updateEditModel()
  22 + }
  23 + }),
20 alignment: DialogAlignment.Bottom, 24 alignment: DialogAlignment.Bottom,
21 offset:{dx:0,dy:-20} 25 offset:{dx:0,dy:-20}
22 }) 26 })
@@ -109,25 +113,33 @@ struct EditUserInfoPage { @@ -109,25 +113,33 @@ struct EditUserInfoPage {
109 end:new Date(), 113 end:new Date(),
110 selected:new Date, 114 selected:new Date,
111 lunar:false, 115 lunar:false,
112 - // onAccept:(value:DatePickerResult) => {  
113 - //  
114 - // } 116 + onAccept:(value:DatePickerResult) => {
  117 + let mon = value.month as number + 1
  118 + this.currentUserInfo.userExtend.birthday = value.year+'-'+mon.toString()+'-'+value.day;
  119 + this.updateEditModel()
  120 + }
115 }) 121 })
116 }else if(i === 5){ 122 }else if(i === 5){
117 TextPickerDialog.show({ 123 TextPickerDialog.show({
118 - range:['男','女'], 124 + range:['女','男'],
119 selected:0, 125 selected:0,
120 - // onAccept:(value:TextPickerResult) => {  
121 - //  
122 - // } 126 + onAccept:(value:TextPickerResult) => {
  127 + this.currentUserInfo.userExtend.sex = value.index.toString();
  128 + this.updateEditModel()
  129 + }
123 }) 130 })
124 } 131 }
125 }) 132 })
126 } 133 }
127 134
  135 + updateEditModel(){
  136 + this.listData = []
  137 + this.listData.push(...EditInfoViewModel.getEditListInfo(this.currentUserInfo))
  138 + }
128 getAccountOwnerInfo(){ 139 getAccountOwnerInfo(){
129 EditInfoViewModel.queryAccountOwnerInfo(1,getContext(this)).then((editModel) => { 140 EditInfoViewModel.queryAccountOwnerInfo(1,getContext(this)).then((editModel) => {
130 this.headerImg = editModel.userExtend.headPhotoUrl 141 this.headerImg = editModel.userExtend.headPhotoUrl
  142 + this.currentUserInfo = editModel;
131 this.listData.push(...EditInfoViewModel.getEditListInfo(editModel)) 143 this.listData.push(...EditInfoViewModel.getEditListInfo(editModel))
132 }); 144 });
133 } 145 }
1 -import { CustomTitleUI } from '../reusable/CustomTitleUI' 1 +import { CustomTitleAndEditUI } from '../reusable/CustomTitleAndEditUI'
2 import MyCollectionViewModel from '../../viewmodel/MyCollectionViewModel'; 2 import MyCollectionViewModel from '../../viewmodel/MyCollectionViewModel';
3 import PageModel from '../../viewmodel/PageModel'; 3 import PageModel from '../../viewmodel/PageModel';
4 import { CommonConstants, ViewType } from 'wdConstant' 4 import { CommonConstants, ViewType } from 'wdConstant'
@@ -11,20 +11,31 @@ import LoadMoreLayout from './LoadMoreLayout' @@ -11,20 +11,31 @@ import LoadMoreLayout from './LoadMoreLayout'
11 import NoMoreLayout from './NoMoreLayout' 11 import NoMoreLayout from './NoMoreLayout'
12 import { CompParser } from '../CompParser' 12 import { CompParser } from '../CompParser'
13 import CustomRefreshLoadLayout from './CustomRefreshLoadLayout'; 13 import CustomRefreshLoadLayout from './CustomRefreshLoadLayout';
  14 +import { CustomSelectUI } from '../view/CustomSelectUI';
  15 +import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI';
14 16
15 @Entry 17 @Entry
16 @Component 18 @Component
17 struct MyCollectionListPage { 19 struct MyCollectionListPage {
18 @State private browSingModel: PageModel = new PageModel() 20 @State private browSingModel: PageModel = new PageModel()
19 isloading : boolean = false 21 isloading : boolean = false
20 - 22 + @Provide isEditState:boolean = false
  23 + @State allDatas :CompDTO[] = [];
  24 + @State selectDatas :CompDTO[] = [];
  25 + @Provide deleteNum :number = 0;
  26 + @Provide isAllSelect:boolean = false
21 aboutToAppear(){ 27 aboutToAppear(){
22 this.getData() 28 this.getData()
23 } 29 }
24 30
25 build() { 31 build() {
26 Column(){ 32 Column(){
27 - CustomTitleUI({titleName:'我的收藏'}) 33 + CustomTitleAndEditUI({titleName:'我的收藏',isDisplayButton:true,editCallback:()=>{
  34 + this.allSelectDatas(false)
  35 + this.isAllSelect = false
  36 + this.selectDatas = []
  37 + this.deleteNum = 0
  38 + }})
28 if (this.browSingModel.viewType == ViewType.LOADING){ 39 if (this.browSingModel.viewType == ViewType.LOADING){
29 this.LoadingLayout() 40 this.LoadingLayout()
30 }else if(this.browSingModel.viewType == ViewType.ERROR){ 41 }else if(this.browSingModel.viewType == ViewType.ERROR){
@@ -34,6 +45,18 @@ struct MyCollectionListPage { @@ -34,6 +45,18 @@ struct MyCollectionListPage {
34 }else { 45 }else {
35 this.ListLayout() 46 this.ListLayout()
36 } 47 }
  48 +
  49 + if (this.isEditState){
  50 + CustomBottomFuctionUI({
  51 + selectAllCallback:(isAllSelect)=>{
  52 + this.allSelectDatas(isAllSelect)
  53 + },
  54 + confirmCallback:()=>{
  55 + this.deleteDatas()
  56 + }
  57 + })
  58 + .position({y:'92%'})
  59 + }
37 } 60 }
38 .width(CommonConstants.FULL_WIDTH) 61 .width(CommonConstants.FULL_WIDTH)
39 .height(CommonConstants.FULL_HEIGHT) 62 .height(CommonConstants.FULL_HEIGHT)
@@ -49,7 +72,7 @@ struct MyCollectionListPage { @@ -49,7 +72,7 @@ struct MyCollectionListPage {
49 }) 72 })
50 } 73 }
51 74
52 - LazyForEach(this.browSingModel.compList, (compDTO: CompDTO, compIndex: number) => { 75 + ForEach(this.allDatas, (compDTO: CompDTO, compIndex: number) => {
53 ListItem() { 76 ListItem() {
54 this.newCompParser(compDTO,compIndex) 77 this.newCompParser(compDTO,compIndex)
55 } 78 }
@@ -73,16 +96,17 @@ struct MyCollectionListPage { @@ -73,16 +96,17 @@ struct MyCollectionListPage {
73 @Builder 96 @Builder
74 newCompParser(compDTO: CompDTO, compIndex: number){ 97 newCompParser(compDTO: CompDTO, compIndex: number){
75 Row(){ 98 Row(){
76 - Button()  
77 - .type(ButtonType.Normal)  
78 - .width('20')  
79 - .height('20')  
80 - .backgroundColor('#ED2800')  
81 - .borderRadius(5)  
82 - .margin({left:16})  
83 - 99 + if (this.isEditState){
  100 + CustomSelectUI({
  101 + isOn:compDTO.isSelect,
  102 + selectCallback:(isOn)=>{
  103 + this.addCompDTO(isOn,compDTO)
  104 + }
  105 + })
  106 + .margin({left:16})
  107 + }
84 Column() { 108 Column() {
85 - CompParser({ compDTO: compDTO, compIndex: compIndex }); 109 + CompParser({ compDTO: compDTO, compIndex: compIndex })
86 } 110 }
87 } 111 }
88 } 112 }
@@ -97,7 +121,7 @@ struct MyCollectionListPage { @@ -97,7 +121,7 @@ struct MyCollectionListPage {
97 MyCollectionViewModel.newFetchMyCollectList(1,'1',this.browSingModel.currentPage,getContext(this)).then(pageDto => { 121 MyCollectionViewModel.newFetchMyCollectList(1,'1',this.browSingModel.currentPage,getContext(this)).then(pageDto => {
98 if (pageDto && pageDto.compList && pageDto.compList.length > 0) { 122 if (pageDto && pageDto.compList && pageDto.compList.length > 0) {
99 this.browSingModel.viewType = ViewType.LOADED; 123 this.browSingModel.viewType = ViewType.LOADED;
100 - this.browSingModel.compList.push(...pageDto.compList) 124 + this.allDatas.push(...pageDto.compList)
101 if (pageDto.compList.length === this.browSingModel.pageSize) { 125 if (pageDto.compList.length === this.browSingModel.pageSize) {
102 this.browSingModel.currentPage++; 126 this.browSingModel.currentPage++;
103 this.browSingModel.hasMore = true; 127 this.browSingModel.hasMore = true;
@@ -109,4 +133,49 @@ struct MyCollectionListPage { @@ -109,4 +133,49 @@ struct MyCollectionListPage {
109 } 133 }
110 }) 134 })
111 } 135 }
  136 +
  137 + //数据处理
  138 + //单个选择
  139 + addCompDTO(isOn:boolean , compDTO: CompDTO){
  140 + compDTO.isSelect = isOn;
  141 + if (isOn === true){
  142 + this.selectDatas.push(compDTO)
  143 + }else {
  144 + this.selectDatas.splice(this.selectDatas.indexOf(compDTO),1)
  145 + }
  146 + this.deleteNum = this.selectDatas.length
  147 +
  148 + this.isAllSelect = this.deleteNum === this.allDatas.length?true:false;
  149 + }
  150 +
  151 + //全选
  152 + allSelectDatas(isOn:boolean){
  153 + let datas: CompDTO[] = [];
  154 + for (let index = 0; index < this.allDatas.length; index++) {
  155 + const compDTO = this.allDatas[index];
  156 + compDTO.isSelect = isOn
  157 + datas.push(compDTO)
  158 + }
  159 + this.selectDatas = []
  160 + this.allDatas = []
  161 + if (isOn === true) {
  162 + this.selectDatas.push(...datas)
  163 + }else {
  164 + this.selectDatas.splice(0,this.deleteNum)
  165 + }
  166 + this.allDatas.push(...datas)
  167 + this.deleteNum = this.selectDatas.length
  168 + }
  169 +
  170 + //删除
  171 + deleteDatas(){
  172 + for (let index = 0; index < this.selectDatas.length; index++) {
  173 + const compDTO = this.allDatas[index];
  174 + this.allDatas.splice(this.selectDatas.indexOf(compDTO),1)
  175 + }
  176 +
  177 + //重置删除状态
  178 + this.isEditState = false
  179 + this.isAllSelect = false
  180 + }
112 } 181 }
@@ -11,6 +11,7 @@ const TAG = 'TopNavigationComponent'; @@ -11,6 +11,7 @@ const TAG = 'TopNavigationComponent';
11 */ 11 */
12 @Component 12 @Component
13 export struct TopNavigationComponent { 13 export struct TopNavigationComponent {
  14 + private tabsController: TabsController = new TabsController()
14 @Prop _currentNavIndex?: number; 15 @Prop _currentNavIndex?: number;
15 // 顶导当前选中/焦点下标 16 // 顶导当前选中/焦点下标
16 @State currentTopNavSelectedIndex: number = 0; 17 @State currentTopNavSelectedIndex: number = 0;
@@ -27,6 +28,7 @@ export struct TopNavigationComponent { @@ -27,6 +28,7 @@ export struct TopNavigationComponent {
27 @State localChannelList: TopNavDTO[] = [] 28 @State localChannelList: TopNavDTO[] = []
28 readonly MAX_LINE: number = 1; 29 readonly MAX_LINE: number = 1;
29 30
  31 + //处理接口顶导数据
30 topNavListHandle() { 32 topNavListHandle() {
31 let defaultMyChannelList: TopNavDTO[] = [] 33 let defaultMyChannelList: TopNavDTO[] = []
32 let handledTopNavList = [...this.topNavList] 34 let handledTopNavList = [...this.topNavList]
@@ -76,8 +78,12 @@ export struct TopNavigationComponent { @@ -76,8 +78,12 @@ export struct TopNavigationComponent {
76 }) 78 })
77 } 79 }
78 80
  81 + isBroadcast (item: TopNavDTO) {
  82 + return item.name === '播报'
  83 + }
79 build() { 84 build() {
80 Column() { 85 Column() {
  86 + // 顶部搜索、日报logo、早晚报
81 RelativeContainer() { 87 RelativeContainer() {
82 Stack({ alignContent: Alignment.Center }) { 88 Stack({ alignContent: Alignment.Center }) {
83 89
@@ -97,7 +103,6 @@ export struct TopNavigationComponent { @@ -97,7 +103,6 @@ export struct TopNavigationComponent {
97 } 103 }
98 .alignItems(VerticalAlign.Center) 104 .alignItems(VerticalAlign.Center)
99 .justifyContent(FlexAlign.Center) 105 .justifyContent(FlexAlign.Center)
100 -  
101 } 106 }
102 .height(30) 107 .height(30)
103 .width(123) 108 .width(123)
@@ -163,18 +168,20 @@ export struct TopNavigationComponent { @@ -163,18 +168,20 @@ export struct TopNavigationComponent {
163 .width('100%') 168 .width('100%')
164 .height(40) 169 .height(40)
165 .visibility(this._currentNavIndex == 0 ? Visibility.Visible : Visibility.None) 170 .visibility(this._currentNavIndex == 0 ? Visibility.Visible : Visibility.None)
166 - 171 + // 频道分类list
167 Stack({ alignContent: Alignment.TopEnd }) { 172 Stack({ alignContent: Alignment.TopEnd }) {
168 173
169 - Tabs() { 174 + Tabs({ controller: this.tabsController }) {
170 ForEach(this.myChannelList, (navItem: TopNavDTO, index: number) => { 175 ForEach(this.myChannelList, (navItem: TopNavDTO, index: number) => {
171 TabContent() { 176 TabContent() {
172 - PageComponent({  
173 - currentTopNavSelectedIndex: $currentTopNavSelectedIndex,  
174 - navIndex: index,  
175 - pageId: navItem.pageId + '',  
176 - channelId: navItem.channelId + ''  
177 - }) 177 + if(!this.isBroadcast(navItem)) {
  178 + PageComponent({
  179 + currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
  180 + navIndex: index,
  181 + pageId: navItem.pageId + '',
  182 + channelId: navItem.channelId + ''
  183 + })
  184 + }
178 } 185 }
179 .tabBar(this.tabBarBuilder(navItem, index)) 186 .tabBar(this.tabBarBuilder(navItem, index))
180 }, (navItem: TopNavDTO) => JSON.stringify(navItem)); 187 }, (navItem: TopNavDTO) => JSON.stringify(navItem));
@@ -184,15 +191,32 @@ export struct TopNavigationComponent { @@ -184,15 +191,32 @@ export struct TopNavigationComponent {
184 .vertical(false) 191 .vertical(false)
185 .onChange((index: number) => { 192 .onChange((index: number) => {
186 Logger.info(TAG, `onChange index : ${index}`); 193 Logger.info(TAG, `onChange index : ${index}`);
187 - this.currentTopNavSelectedIndex = index; 194 + if(!this.isBroadcast(this.myChannelList[index])) {
  195 + this.currentTopNavSelectedIndex = index;
  196 + } else {
  197 + // 跳转到播报页面
  198 + let taskAction: Action = {
  199 + type: 'JUMP_INNER_NEW_PAGE',
  200 + params: {
  201 + pageID: 'BroadcastPage',
  202 + id: this.myChannelList[index].pageId
  203 + } as Params,
  204 + };
  205 + WDRouterRule.jumpWithAction(taskAction)
  206 + this.tabsController.changeIndex(this.currentTopNavSelectedIndex)
  207 + }
188 }) 208 })
189 - 209 + // 分类列表最右侧频道设置
190 ChannelSubscriptionLayout({ 210 ChannelSubscriptionLayout({
  211 + changeTab: (index) => {
  212 + this.tabsController.changeIndex(index)
  213 + },
191 myChannelList: $myChannelList, 214 myChannelList: $myChannelList,
192 moreChannelList: $moreChannelList, 215 moreChannelList: $moreChannelList,
193 localChannelList: $localChannelList, 216 localChannelList: $localChannelList,
194 currentTopNavSelectedIndex: $currentTopNavSelectedIndex 217 currentTopNavSelectedIndex: $currentTopNavSelectedIndex
195 }) 218 })
  219 + // ChannelSubscriptionLayout()
196 } 220 }
197 221
198 } 222 }
@@ -227,6 +251,7 @@ export struct TopNavigationComponent { @@ -227,6 +251,7 @@ export struct TopNavigationComponent {
227 bottom: $r('app.float.top_tab_item_padding_bottom') 251 bottom: $r('app.float.top_tab_item_padding_bottom')
228 }) 252 })
229 .id(`col_tabBar${index}`) 253 .id(`col_tabBar${index}`)
  254 + .margin({ right: this.myChannelList.length === index + 1 ? 36 : 0 })
230 } 255 }
231 256
232 aboutToAppear() { 257 aboutToAppear() {
  1 +import router from '@ohos.router'
  2 +
  3 +@Component
  4 +export struct CustomTitleAndEditUI {
  5 + imgBack:boolean = true
  6 + titleName:string = "默认标题"
  7 + isDisplayButton:boolean = false
  8 + @Consume isEditState:boolean
  9 + editCallback: () => void = () => {
  10 + }
  11 + build() {
  12 + RelativeContainer() {
  13 + //标题栏目
  14 + if(this.imgBack){
  15 + Image($r('app.media.back_icon'))
  16 + .width('46lpx')
  17 + .height('46lpx')
  18 + .objectFit(ImageFit.Auto)
  19 + .interpolation(ImageInterpolation.High)
  20 + .id("back_icon")
  21 + .alignRules({
  22 + center: {anchor: "__container__", align: VerticalAlign.Center},
  23 + left: {anchor: "__container__", align: HorizontalAlign.Start}
  24 + })
  25 + .margin({left:'31lpx'})
  26 + .onClick(()=>{
  27 + router.back()
  28 + })
  29 + }
  30 +
  31 + Text(this.titleName)
  32 + .height('42lpx')
  33 + .maxLines(1)
  34 + .id("title")
  35 + .fontSize('35lpx')
  36 + .fontWeight(400)
  37 + .fontColor($r('app.color.color_222222'))
  38 + .lineHeight('42lpx')
  39 + .alignRules({
  40 + center: {anchor: "__container__", align: VerticalAlign.Center},
  41 + middle: {anchor: "__container__", align: HorizontalAlign.Center}
  42 + })
  43 +
  44 + if (this.isDisplayButton){
  45 + Button(this.isEditState === true?'取消':'编辑')
  46 + .type(ButtonType.Normal)
  47 + .fontColor($r('app.color.color_222222'))
  48 + .backgroundColor(Color.White)
  49 + .id("edit_Button")
  50 + .alignRules({
  51 + center: {anchor: "__container__", align: VerticalAlign.Center},
  52 + right: {anchor: "__container__", align: HorizontalAlign.End}
  53 + })
  54 + .margin({right:'31lpx'})
  55 + .onClick(()=>{
  56 + this.isEditState = !this.isEditState
  57 + this.editCallback()
  58 + })
  59 + }
  60 + }
  61 + .height('84lpx')
  62 + .width('100%')
  63 + .backgroundColor($r('app.color.white'))
  64 +
  65 + }
  66 +}
@@ -37,10 +37,10 @@ export struct CustomTitleUI { @@ -37,10 +37,10 @@ export struct CustomTitleUI {
37 center: {anchor: "__container__", align: VerticalAlign.Center}, 37 center: {anchor: "__container__", align: VerticalAlign.Center},
38 middle: {anchor: "__container__", align: HorizontalAlign.Center} 38 middle: {anchor: "__container__", align: HorizontalAlign.Center}
39 }) 39 })
  40 +
40 } 41 }
41 .height('84lpx') 42 .height('84lpx')
42 .width('100%') 43 .width('100%')
43 .backgroundColor($r('app.color.white')) 44 .backgroundColor($r('app.color.white'))
44 -  
45 } 45 }
46 } 46 }
@@ -24,6 +24,7 @@ export struct CompStyle_09 { @@ -24,6 +24,7 @@ export struct CompStyle_09 {
24 // 大图 24 // 大图
25 Image(this.compDTO.operDataList[0].coverUrl) 25 Image(this.compDTO.operDataList[0].coverUrl)
26 .width('100%') 26 .width('100%')
  27 + .borderRadius({topLeft: $r('app.float.image_border_radius'), topRight: $r('app.float.image_border_radius')})
27 // 时间线--后端返回三个, 28 // 时间线--后端返回三个,
28 Column(){ 29 Column(){
29 ForEach(this.compDTO.operDataList[0].slideShows, (item:slideShows, index:number) => { 30 ForEach(this.compDTO.operDataList[0].slideShows, (item:slideShows, index:number) => {
@@ -44,7 +45,7 @@ export struct CompStyle_09 { @@ -44,7 +45,7 @@ export struct CompStyle_09 {
44 .backgroundColor($r('app.color.color_F5F5F5')) 45 .backgroundColor($r('app.color.color_F5F5F5'))
45 .width(CommonConstants.FULL_WIDTH) 46 .width(CommonConstants.FULL_WIDTH)
46 .height(40) 47 .height(40)
47 - .borderRadius(3) 48 + .borderRadius($r('app.float.button_border_radius'))
48 .justifyContent(FlexAlign.Center) 49 .justifyContent(FlexAlign.Center)
49 .margin({top: 5}) 50 .margin({top: 5})
50 } 51 }
@@ -103,7 +104,7 @@ export struct CompStyle_09 { @@ -103,7 +104,7 @@ export struct CompStyle_09 {
103 Image(item.fullColumnImgUrls[0].url) 104 Image(item.fullColumnImgUrls[0].url)
104 .width(90) 105 .width(90)
105 .height(60) 106 .height(60)
106 - .borderRadius(4) 107 + .borderRadius($r('app.float.image_border_radius'))
107 } 108 }
108 } 109 }
109 } 110 }
@@ -26,6 +26,7 @@ export struct CompStyle_10 { @@ -26,6 +26,7 @@ export struct CompStyle_10 {
26 // 大图 26 // 大图
27 Image(this.compDTO.operDataList[0] && this.compDTO.operDataList[0].coverUrl) 27 Image(this.compDTO.operDataList[0] && this.compDTO.operDataList[0].coverUrl)
28 .width('100%') 28 .width('100%')
  29 + .borderRadius({topLeft: $r('app.float.image_border_radius'), topRight: $r('app.float.image_border_radius')})
29 .onClick((event: ClickEvent) => { 30 .onClick((event: ClickEvent) => {
30 ProcessUtils.processPage(this.compDTO?.operDataList[0]) 31 ProcessUtils.processPage(this.compDTO?.operDataList[0])
31 }) 32 })
@@ -49,7 +50,7 @@ export struct CompStyle_10 { @@ -49,7 +50,7 @@ export struct CompStyle_10 {
49 .backgroundColor($r('app.color.color_F5F5F5')) 50 .backgroundColor($r('app.color.color_F5F5F5'))
50 .width(CommonConstants.FULL_WIDTH) 51 .width(CommonConstants.FULL_WIDTH)
51 .height(40) 52 .height(40)
52 - .borderRadius(3) 53 + .borderRadius($r('app.float.button_border_radius'))
53 .justifyContent(FlexAlign.Center) 54 .justifyContent(FlexAlign.Center)
54 .margin({top: 5}) 55 .margin({top: 5})
55 .onClick((event: ClickEvent) => { 56 .onClick((event: ClickEvent) => {
@@ -105,7 +106,7 @@ export struct CompStyle_10 { @@ -105,7 +106,7 @@ export struct CompStyle_10 {
105 .width(117) 106 .width(117)
106 .height(78) 107 .height(78)
107 .objectFit(ImageFit.Cover) 108 .objectFit(ImageFit.Cover)
108 - .borderRadius(4) 109 + .borderRadius($r('app.float.image_border_radius'))
109 .margin({left: 12}) 110 .margin({left: 12})
110 } 111 }
111 } 112 }
  1 +
  2 +@Component
  3 +export struct CustomBottomFuctionUI {
  4 + @Consume deleteNum: number
  5 + @Consume isAllSelect: boolean
  6 + selectAllCallback: (isOn: boolean) => void = () => {
  7 + }
  8 + confirmCallback: () => void = () => {
  9 + }
  10 + build() {
  11 + RelativeContainer(){
  12 + Row(){
  13 + Image(this.isAllSelect?$r("app.media.MyCollection_selected_icon"):$r("app.media.MyCollection_unselected_icon"))
  14 + .width('20')
  15 + .height('20')
  16 + .margin({right:'31lpx' })
  17 +
  18 + Text(this.isAllSelect?'取消':'全选')
  19 + .fontColor($r('app.color.color_222222'))
  20 + .backgroundColor(Color.White)
  21 + }
  22 + .id("allSelect_Button")
  23 + .margin({left:'31lpx'})
  24 + .alignRules({
  25 + center: {anchor: "__container__", align: VerticalAlign.Center},
  26 + left: {anchor: "__container__", align: HorizontalAlign.Start}
  27 + })
  28 + .onClick(()=>{
  29 + this.isAllSelect = !this.isAllSelect;
  30 + this.selectAllCallback(this.isAllSelect)
  31 + })
  32 +
  33 +
  34 + Button('删除'+ (this.deleteNum === 0 ? '':'('+this.deleteNum.toString()+')'))
  35 + .type(ButtonType.Normal)
  36 + .fontColor(this.deleteNum === 0?$r('app.color.color_222222'):$r('app.color.color_ED2800'))
  37 + .backgroundColor(Color.White)
  38 + .id("delete_Button")
  39 + .alignRules({
  40 + center: {anchor: "__container__", align: VerticalAlign.Center},
  41 + right: {anchor: "__container__", align: HorizontalAlign.End}
  42 + })
  43 + .margin({right:'31lpx'})
  44 + .onClick(()=>{
  45 + this.confirmCallback()
  46 + })
  47 + }
  48 + .height('8%')
  49 + .width('100%')
  50 + .backgroundColor(Color.White)
  51 + }
  52 +}
  1 +
  2 +@Component
  3 +export struct CustomSelectUI {
  4 + @State isOn: boolean = false
  5 + selectCallback: (isOn: boolean) => void = () => {
  6 + }
  7 + build() {
  8 + Button(){
  9 + Image(this.isOn?$r("app.media.MyCollection_selected_icon"):$r("app.media.MyCollection_unselected_icon"))
  10 + }
  11 + .backgroundColor(Color.White)
  12 + .type(ButtonType.Normal)
  13 + .width('20')
  14 + .height('20')
  15 + .onClick(() => {
  16 + this.isOn = !this.isOn;
  17 + this.selectCallback(this.isOn)
  18 + })
  19 + }
  20 +}
@@ -47,7 +47,7 @@ export struct ZhGridLayoutComponent { @@ -47,7 +47,7 @@ export struct ZhGridLayoutComponent {
47 buildItemCard(item: ContentDTO) { 47 buildItemCard(item: ContentDTO) {
48 Column() { 48 Column() {
49 Image(item.coverUrl) 49 Image(item.coverUrl)
50 - .borderRadius(5) 50 + .width(44)
51 .aspectRatio(1 / 1) 51 .aspectRatio(1 / 1)
52 .margin(16) 52 .margin(16)
53 Text(item.newsTitle) 53 Text(item.newsTitle)
@@ -13,6 +13,8 @@ export struct AreaPickerDialog { @@ -13,6 +13,8 @@ export struct AreaPickerDialog {
13 title: string = '地区选择' 13 title: string = '地区选择'
14 @Provide dataSource: AreaListModel[] = [] 14 @Provide dataSource: AreaListModel[] = []
15 result: JSON[] = []; 15 result: JSON[] = [];
  16 + confirmCallback: (area:string) => void = () => {
  17 + }
16 18
17 build() { 19 build() {
18 Column(){ 20 Column(){
@@ -35,7 +37,7 @@ export struct AreaPickerDialog { @@ -35,7 +37,7 @@ export struct AreaPickerDialog {
35 Button('确定',{type:ButtonType.Normal}) 37 Button('确定',{type:ButtonType.Normal})
36 .onClick(()=> { 38 .onClick(()=> {
37 this.controller.close() 39 this.controller.close()
38 - Logger.info('area',this.currentFirst.label+this.currentSecondBean.label+this.currentThirdBean.label); 40 + this.confirmCallback(this.currentFirst.label+this.currentSecondBean.label+this.currentThirdBean.label);
39 }) 41 })
40 .backgroundColor(0xffffff) 42 .backgroundColor(0xffffff)
41 .fontColor(Color.Blue) 43 .fontColor(Color.Blue)
@@ -11,32 +11,37 @@ export class EditListInfo{ @@ -11,32 +11,37 @@ export class EditListInfo{
11 } 11 }
12 } 12 }
13 13
14 -export interface EditInfoModel{ 14 +export class EditInfoModel{
15 //头像 15 //头像
16 - headPhotoUrl:string 16 + headPhotoUrl:string = ''
17 //简介 17 //简介
18 - introduction:string 18 + introduction:string = ''
19 //城市 19 //城市
20 - city:string 20 + city:string = ''
21 //地区 21 //地区
22 - county:string 22 + county:string = ''
23 //生日 23 //生日
24 - birthday:string 24 + birthday:string = ''
25 //性别 25 //性别
26 - sex:number 26 + sex:string = ''
27 27
28 - airec:number 28 + airec:number = 0
29 29
  30 + constructor(headPhotoUrl?:string , introduction?:string,city?:string , county?:string,birthday?:string , sex?:string,airec?:number) {
  31 + }
30 } 32 }
31 33
32 -export interface editModel{  
33 - userName:string 34 +export class editModel{
  35 + userName:string = ''
  36 +
  37 + userNameStatus:string = ''
34 38
35 - userNameStatus:string 39 + phone:string = ''
36 40
37 - phone:string 41 + headPhotoStatus:string = ''
38 42
39 - headPhotoStatus:string 43 + userExtend:EditInfoModel = new EditInfoModel()
40 44
41 - userExtend:EditInfoModel 45 + constructor(userName?:string , userNameStatus?:string,phone?:string , headPhotoStatus?:string,userExtend?:EditInfoModel) {
  46 + }
42 } 47 }
@@ -260,4 +260,29 @@ export class PageRepository { @@ -260,4 +260,29 @@ export class PageRepository {
260 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 260 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
261 return WDHttp.get<ResponseDTO<CompInfoBean>>(url, headers) 261 return WDHttp.get<ResponseDTO<CompInfoBean>>(url, headers)
262 }; 262 };
263 -}  
  263 +
  264 + /**
  265 + * 获取播报pageInfo
  266 + * */
  267 + static fetchBroadcastPageInfo(pageId: string) {
  268 + let url = PageRepository.getMorningEveningPageInfoUrl(pageId)
  269 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  270 + return WDHttp.get<ResponseDTO<PageInfoBean>>(url, headers)
  271 + };
  272 +
  273 + /**
  274 + * 获取播报compInfo
  275 + * https://pdapis.pdnews.cn/api/rmrb-bff-display-zh/display/zh/c/compInfo
  276 + * @param params
  277 + * @returns
  278 + * */
  279 + static fetchBroadcastCompInfo(pageId: number, groupId: number, refreshTime: string, topicId:
  280 + string, channelId: string) {
  281 + HttpUrlUtils.hostUrl = HttpUrlUtils.HOST_DEV
  282 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_COMP_INFO_PATH;
  283 + url = `${url}?topicId=${topicId}&channelStrategy=2&groupId=${groupId}&refreshTime=${refreshTime}&pageSize=50&recommend=0&pageId=${pageId}&loadStrategy=first_load&pageNum=1&channelId=${channelId}`
  284 + Logger.info(TAG, "getMorningEveningCompInfoUrl url = " + url)
  285 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  286 + return WDHttp.get<ResponseDTO<CompInfoBean>>(url, headers)
  287 + };
  288 +}
  1 +import { CompInfoBean, PageInfoBean } from 'wdBean/Index';
  2 +import { Logger } from 'wdKit/Index';
  3 +import { ResponseDTO } from 'wdNetwork/Index';
  4 +import { PageRepository } from '../repository/PageRepository';
  5 +
  6 +const TAG = 'BroadcastViewModel'
  7 +
  8 +export class BroadcastViewModel {
  9 + static async getBroadcastViewPageInfo(pageId: string): Promise<PageInfoBean> {
  10 + return new Promise<PageInfoBean>((success, error) => {
  11 + Logger.info(TAG, `getBroadcastViewPageInfo pageInfo start`);
  12 + PageRepository.fetchMorningEveningPageInfo(pageId).then((resDTO: ResponseDTO<PageInfoBean>) => {
  13 + if (!resDTO || !resDTO.data) {
  14 + Logger.error(TAG, 'getBroadcastViewPageInfo then navResDTO is empty');
  15 + error('resDTO is empty');
  16 + return
  17 + }
  18 + if (resDTO.code != 0) {
  19 + Logger.error(TAG, `getBroadcastViewPageInfo then code:${resDTO.code}, message:${resDTO.message}`);
  20 + error('resDTO Response Code is failure');
  21 + return
  22 + }
  23 + // let navResStr = JSON.stringify(navResDTO);
  24 + Logger.info(TAG, "getBroadcastViewPageInfo then,navResDTO.timestamp:" + resDTO.timestamp);
  25 + success(resDTO.data);
  26 + }).catch((err: Error) => {
  27 + Logger.error(TAG, `getBroadcastViewPageInfo catch, error.name : ${err.name}, error.message:${err.message}`);
  28 + error(err);
  29 + })
  30 + })
  31 + }
  32 +
  33 + // 获取播报组件信息:https://pdapis.pdnews.cn/api/rmrb-bff-display-zh/display/zh/c/compInfo?topicId=&
  34 + // channelStrategy=2&groupId=30113&refreshTime=1712023953772&pageSize=50&recommend=0&pageId=21003&loadStrategy=first_load&pageNum=1&channelId=2066
  35 + static async getBroadcastCompInfo(pageId: number, groupId: number, refreshTime: string, topicId: string, channelId: string): Promise<CompInfoBean> {
  36 + return new Promise<CompInfoBean>((success, error) => {
  37 + Logger.info(TAG, `getMorningEveningCompInfo pageInfo start`);
  38 + PageRepository.fetchBroadcastCompInfo(pageId, groupId, refreshTime, topicId, channelId)
  39 + .then((resDTO: ResponseDTO<CompInfoBean>) => {
  40 + if (!resDTO || !resDTO.data) {
  41 + Logger.error(TAG, 'getMorningEveningCompInfo then navResDTO is empty');
  42 + error('resDTO is empty');
  43 + return
  44 + }
  45 + if (resDTO.code != 0) {
  46 + Logger.error(TAG, `getMorningEveningCompInfo then code:${resDTO.code}, message:${resDTO.message}`);
  47 + error('resDTO Response Code is failure');
  48 + return
  49 + }
  50 + // let navResStr = JSON.stringify(navResDTO);
  51 + Logger.info(TAG, "getMorningEveningCompInfo then,navResDTO.timestamp:" + resDTO.timestamp);
  52 + success(resDTO.data);
  53 + })
  54 + .catch((err: Error) => {
  55 + Logger.error(TAG, `getMorningEveningCompInfo catch, error.name : ${err.name}, error.message:${err.message}`);
  56 + error(err);
  57 + })
  58 + })
  59 + }
  60 +}
@@ -30,11 +30,11 @@ class EditInfoViewModel { @@ -30,11 +30,11 @@ class EditInfoViewModel {
30 30
31 getEditListInfo(item?:editModel):EditListInfo[]{ 31 getEditListInfo(item?:editModel):EditListInfo[]{
32 this.editListData = [ 32 this.editListData = [
33 - new EditListInfo('昵称',item&&item.userName?item.userName:'待完善'),  
34 - new EditListInfo('简介',item&&item.userExtend.introduction?item.userExtend.introduction:'待完善'),  
35 - new EditListInfo('地区',item&&item.userExtend.city?item.userExtend.city:'待完善'),  
36 - new EditListInfo('生日',item&&item.userExtend.birthday?item.userExtend.birthday:'待完善'),  
37 - new EditListInfo('性别',item&&item.userExtend.sex?item.userExtend.sex===1?'男':'女':'待完善'), 33 + new EditListInfo('昵称',item&&item.userName.length > 0?item.userName:'待完善'),
  34 + new EditListInfo('简介',item&&item.userExtend.introduction.length > 0?item.userExtend.introduction:'待完善'),
  35 + new EditListInfo('地区',item&&item.userExtend.city.length > 0?item.userExtend.city:'待完善'),
  36 + new EditListInfo('生日',item&&item.userExtend.birthday.length > 0?item.userExtend.birthday:'待完善'),
  37 + new EditListInfo('性别',item&&item.userExtend.sex.length > 0?(item.userExtend.sex=== '1'?'男':'女'):'待完善'),
38 ] 38 ]
39 return this.editListData 39 return this.editListData
40 } 40 }
@@ -61,7 +61,7 @@ class EditInfoViewModel { @@ -61,7 +61,7 @@ class EditInfoViewModel {
61 let compRes: ResponseDTO<editModel> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<editModel>>(context,'userInfo.json'); 61 let compRes: ResponseDTO<editModel> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<editModel>>(context,'userInfo.json');
62 if (!compRes || !compRes.data) { 62 if (!compRes || !compRes.data) {
63 Logger.info(TAG, `getAppointmentListDataLocal compRes is empty`); 63 Logger.info(TAG, `getAppointmentListDataLocal compRes is empty`);
64 - return {} as editModel 64 + return new editModel()
65 } 65 }
66 Logger.info(TAG, `getAppointmentListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`); 66 Logger.info(TAG, `getAppointmentListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);
67 return compRes.data 67 return compRes.data
@@ -82,7 +82,11 @@ @@ -82,7 +82,11 @@
82 }, 82 },
83 { 83 {
84 "name": "image_border_radius", 84 "name": "image_border_radius",
85 - "value": "8vp" 85 + "value": "5vp"
  86 + },
  87 + {
  88 + "name": "button_border_radius",
  89 + "value": "3vp"
86 }, 90 },
87 { 91 {
88 "name": "border_radius_6", 92 "name": "border_radius_6",
  1 +import { BroadcastPageComponent } from 'wdComponent';
  2 +import { Logger } from 'wdKit';
  3 +
  4 +const TAG = 'BroadcastPageComponent';
  5 +
  6 +@Entry
  7 +@Component
  8 +struct BroadcastPage {
  9 + build() {
  10 + Column() {
  11 + BroadcastPageComponent()
  12 + }
  13 + }
  14 +
  15 + pageTransition() {
  16 + // 定义页面进入时的效果,从底侧滑入
  17 + PageTransitionEnter({ type: RouteType.None, duration: 300 })
  18 + .slide(SlideEffect.Bottom)
  19 + // 定义页面退出时的效果,向底侧滑出
  20 + PageTransitionExit({ type: RouteType.None, duration: 300 })
  21 + .slide(SlideEffect.Bottom)
  22 + }
  23 +
  24 + aboutToAppear() {
  25 + Logger.info(TAG, 'aboutToAppear');
  26 + }
  27 +
  28 + aboutToDisappear() {
  29 + Logger.info(TAG, 'aboutToDisappear');
  30 + }
  31 +
  32 + onPageShow() {
  33 + Logger.info(TAG, 'onPageShow');
  34 + }
  35 +
  36 + onPageHide() {
  37 + Logger.info(TAG, 'onPageHide');
  38 + }
  39 +
  40 + onBackPress() {
  41 + Logger.info(TAG, 'onBackPress');
  42 + }
  43 +}
@@ -29,8 +29,5 @@ struct AudioDetail { @@ -29,8 +29,5 @@ struct AudioDetail {
29 this.relId = params?.extra?.relId || ''; 29 this.relId = params?.extra?.relId || '';
30 this.relType = params?.extra?.relType || ''; 30 this.relType = params?.extra?.relType || '';
31 this.contentId = params?.contentID || ''; 31 this.contentId = params?.contentID || '';
32 - Logger.info(TAG, 'aboutToAppear');  
33 - Logger.info(TAG, 'params', JSON.stringify(params));  
34 - console.log('参数',JSON.stringify(par))  
35 } 32 }
36 } 33 }
@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 "pages/detail/MultiPictureDetailPage", 9 "pages/detail/MultiPictureDetailPage",
10 "pages/launchPage/PrivacyPage", 10 "pages/launchPage/PrivacyPage",
11 "pages/launchPage/LaunchPage", 11 "pages/launchPage/LaunchPage",
12 - "pages/launchPage/LaunchAdvertisingPage" 12 + "pages/launchPage/LaunchAdvertisingPage",
  13 + "pages/broadcast/BroadcastPage"
13 ] 14 ]
14 } 15 }