zhangbo1_wd
Showing 121 changed files with 5380 additions and 1364 deletions
@@ -4,7 +4,7 @@ import router from '@ohos.router'; @@ -4,7 +4,7 @@ import router from '@ohos.router';
4 @Entry 4 @Entry
5 @Component 5 @Component
6 struct OtherNormalUserHomePage { 6 struct OtherNormalUserHomePage {
7 - @State userId: string = "111111111"; 7 + @State userId: string = "-1";
8 8
9 onPageShow() { 9 onPageShow() {
10 this.userId = router.getParams()?.["userId"] 10 this.userId = router.getParams()?.["userId"]
@@ -26,16 +26,16 @@ export default struct MinePageUserSimpleInfoUI { @@ -26,16 +26,16 @@ export default struct MinePageUserSimpleInfoUI {
26 .alt($r('app.media.default_head')) 26 .alt($r('app.media.default_head'))
27 .width('108lpx') 27 .width('108lpx')
28 .height('108lpx') 28 .height('108lpx')
29 - .objectFit(ImageFit.Cover) 29 + .objectFit(ImageFit.Auto)
30 .borderRadius(50) 30 .borderRadius(50)
31 31
32 Image(this.levelHead) 32 Image(this.levelHead)
33 - .width('120lpx')  
34 - .height('120lpx')  
35 - .objectFit(ImageFit.Cover) 33 + .width('130lpx')
  34 + .height('130lpx')
  35 + .objectFit(ImageFit.Auto)
36 .borderRadius(50) 36 .borderRadius(50)
37 - }.width('120lpx')  
38 - .height('120lpx') 37 + }.width('130lpx')
  38 + .height('130lpx')
39 .alignContent(Alignment.Center) 39 .alignContent(Alignment.Center)
40 .onClick(()=>{ 40 .onClick(()=>{
41 if(!this.isLogin){ 41 if(!this.isLogin){
@@ -14,10 +14,6 @@ export struct FollowFirstTabsComponent{ @@ -14,10 +14,6 @@ export struct FollowFirstTabsComponent{
14 selectedFontColor: string = '#000000' 14 selectedFontColor: string = '#000000'
15 15
16 aboutToAppear(){ 16 aboutToAppear(){
17 - // let res = JSON.parse(`{"code":"0","data":[{"children":[],"directoryName":"阅读","directoryWeight":99,"id":165,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[{"directoryName":"三二","directoryWeight":2,"id":120,"isShow":1,"level":3,"parentId":118,"rootId":117},{"directoryName":"三级","directoryWeight":1,"id":119,"isShow":1,"level":3,"parentId":118,"rootId":117}],"directoryName":"二级","directoryWeight":1,"id":118,"isShow":1,"level":2,"parentId":117,"rootId":117}],"directoryName":"幽游白书","directoryWeight":33,"id":117,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"推荐","directoryWeight":9,"id":386,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"政务","directoryWeight":9,"id":379,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"推荐","directoryWeight":0,"id":335,"isShow":1,"level":2,"parentId":320,"rootId":320}],"directoryName":"推荐","directoryWeight":9,"id":320,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"媒体","directoryWeight":8,"id":390,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"媒体","directoryWeight":8,"id":323,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"自媒体","directoryWeight":7,"id":329,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"名人","directoryWeight":6,"id":389,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"测试","directoryWeight":0,"id":338,"isShow":1,"level":2,"parentId":324,"rootId":324}],"directoryName":"名人","directoryWeight":6,"id":324,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"2级目录","directoryWeight":0,"id":340,"isShow":1,"level":2,"parentId":312,"rootId":312},{"children":[{"directoryName":"3级测试","directoryWeight":0,"id":368,"isShow":1,"level":3,"parentId":339,"rootId":312}],"directoryName":"二级目录","directoryWeight":0,"id":339,"isShow":1,"level":2,"parentId":312,"rootId":312},{"children":[{"directoryName":"企业","directoryWeight":1,"id":348,"isShow":1,"level":3,"parentId":336,"rootId":312},{"directoryName":"部委","directoryWeight":0,"id":344,"isShow":1,"level":3,"parentId":336,"rootId":312},{"directoryName":"地方","directoryWeight":0,"id":341,"isShow":1,"level":3,"parentId":336,"rootId":312}],"directoryName":"类型","directoryWeight":0,"id":336,"isShow":1,"level":2,"parentId":312,"rootId":312},{"children":[{"directoryName":"贵州省","directoryWeight":0,"id":378,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"西藏自治区","directoryWeight":0,"id":377,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"四川省","directoryWeight":0,"id":376,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"重庆市","directoryWeight":0,"id":375,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"湖南省","directoryWeight":0,"id":374,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"云南省","directoryWeight":0,"id":373,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"广西壮族自治区","directoryWeight":0,"id":372,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"宁夏回族自治区","directoryWeight":0,"id":371,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"湖北省","directoryWeight":0,"id":370,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"青海省","directoryWeight":0,"id":369,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"陕西省","directoryWeight":0,"id":367,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"甘肃省","directoryWeight":0,"id":366,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"吉林省","directoryWeight":0,"id":365,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"广东省","directoryWeight":0,"id":364,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"海南省","directoryWeight":0,"id":363,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"辽宁省","directoryWeight":0,"id":362,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"江苏省","directoryWeight":0,"id":361,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"新疆维吾尔族自治区","directoryWeight":0,"id":360,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"福建省","directoryWeight":0,"id":359,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"山东省","directoryWeight":0,"id":358,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"河南省","directoryWeight":0,"id":357,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"浙江省","directoryWeight":0,"id":356,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"安徽省","directoryWeight":0,"id":355,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"上海市","directoryWeight":0,"id":354,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"河北省","directoryWeight":0,"id":353,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"黑龙江省","directoryWeight":0,"id":352,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"江西省","directoryWeight":0,"id":351,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"内蒙古自治区","directoryWeight":0,"id":350,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"北京市","directoryWeight":0,"id":349,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"山西省","directoryWeight":0,"id":346,"isShow":1,"level":3,"parentId":332,"rootId":312}],"directoryName":"地域","directoryWeight":0,"id":332,"isShow":1,"level":2,"parentId":312,"rootId":312}],"directoryName":"政务","directoryWeight":5,"id":312,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"学校","directoryWeight":4,"id":331,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"机构","directoryWeight":3,"id":330,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[{"directoryName":"新闻联播","directoryWeight":3,"id":79,"isShow":1,"level":3,"parentId":75,"rootId":74},{"directoryName":"第三季","directoryWeight":2,"id":78,"isShow":1,"level":3,"parentId":75,"rootId":74},{"directoryName":"三级","directoryWeight":1,"id":76,"isShow":1,"level":3,"parentId":75,"rootId":74}],"directoryName":"短视频","directoryWeight":1,"id":75,"isShow":1,"level":2,"parentId":74,"rootId":74}],"directoryName":"创作","directoryWeight":3,"id":74,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"教学","directoryWeight":2,"id":72,"isShow":1,"level":2,"parentId":64,"rootId":64},{"children":[],"directoryName":"热门","directoryWeight":1,"id":73,"isShow":1,"level":2,"parentId":64,"rootId":64},{"children":[],"directoryName":"赛事","directoryWeight":1,"id":71,"isShow":1,"level":2,"parentId":64,"rootId":64}],"directoryName":"游戏","directoryWeight":2,"id":64,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"新闻","directoryWeight":1,"id":315,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"趣闻","directoryWeight":6,"id":70,"isShow":1,"level":2,"parentId":63,"rootId":63},{"children":[],"directoryName":"时政","directoryWeight":5,"id":69,"isShow":1,"level":2,"parentId":63,"rootId":63},{"children":[],"directoryName":"农业","directoryWeight":3,"id":68,"isShow":1,"level":2,"parentId":63,"rootId":63},{"children":[],"directoryName":"娱乐","directoryWeight":3,"id":67,"isShow":1,"level":2,"parentId":63,"rootId":63},{"children":[],"directoryName":"科技","directoryWeight":2,"id":66,"isShow":1,"level":2,"parentId":63,"rootId":63},{"children":[],"directoryName":"国际","directoryWeight":1,"id":65,"isShow":1,"level":2,"parentId":63,"rootId":63}],"directoryName":"新闻","directoryWeight":1,"id":63,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"公安","directoryWeight":0,"id":388,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"dddd","directoryWeight":0,"id":387,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"健康","directoryWeight":0,"id":384,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"综合","directoryWeight":0,"id":328,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"房产","directoryWeight":0,"id":327,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"健康","directoryWeight":0,"id":318,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"历史","directoryWeight":0,"id":310,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"dddd","directoryWeight":0,"id":309,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"aaaa","directoryWeight":1,"id":333,"isShow":1,"level":2,"parentId":308,"rootId":308},{"children":[],"directoryName":"qqq","directoryWeight":0,"id":334,"isShow":1,"level":2,"parentId":308,"rootId":308}],"directoryName":"dddd","directoryWeight":0,"id":308,"isShow":1,"level":1,"parentId":0,"rootId":0}],"message":"Success","success":true,"timestamp":1710741803593}`) as ResponseDTO<FollowListItem[]>  
18 - // res.data.forEach(element => {  
19 - // this.data.push(element)  
20 - // });  
21 MinePageDatasModel.getFollowListData(getContext(this)).then((value)=>{ 17 MinePageDatasModel.getFollowListData(getContext(this)).then((value)=>{
22 this.data.push(new FollowListItem("我的")) 18 this.data.push(new FollowListItem("我的"))
23 value.forEach((element)=>{ 19 value.forEach((element)=>{
@@ -85,7 +81,7 @@ export struct FollowFirstTabsComponent{ @@ -85,7 +81,7 @@ export struct FollowFirstTabsComponent{
85 this.currentIndex = index 81 this.currentIndex = index
86 }) 82 })
87 .width('100%') 83 .width('100%')
88 - .height('100%') 84 + .layoutWeight(1)
89 }.width('100%') 85 }.width('100%')
90 } 86 }
91 } 87 }
@@ -70,7 +70,7 @@ export struct FollowListDetailUI{ @@ -70,7 +70,7 @@ export struct FollowListDetailUI{
70 //我的关注列表 70 //我的关注列表
71 if (this.creatorDirectoryId === -1){ 71 if (this.creatorDirectoryId === -1){
72 if(this.hasMore){ 72 if(this.hasMore){
73 - let object = new FollowListDetailRequestItem(20,this.curPageNum) 73 + let object = new FollowListDetailRequestItem(-1,20,this.curPageNum)
74 74
75 MinePageDatasModel.getMineFollowListData(object,getContext(this)).then((value)=>{ 75 MinePageDatasModel.getMineFollowListData(object,getContext(this)).then((value)=>{
76 if (!this.data || value.list.length == 0){ 76 if (!this.data || value.list.length == 0){
@@ -23,14 +23,13 @@ export struct FollowSecondTabsComponent{ @@ -23,14 +23,13 @@ export struct FollowSecondTabsComponent{
23 23
24 if(this.data != null){ 24 if(this.data != null){
25 if(this.data[this.firstIndex].children == null || this.data[this.firstIndex].children.length == 0){ 25 if(this.data[this.firstIndex].children == null || this.data[this.firstIndex].children.length == 0){
26 - FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].id}) 26 + FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].id}).layoutWeight(1)
27 }else{ 27 }else{
28 this.FollowSecondUI() 28 this.FollowSecondUI()
29 } 29 }
30 } 30 }
31 - } 31 + }.layoutWeight(1)
32 .width('100%') 32 .width('100%')
33 - .height('100%')  
34 } 33 }
35 34
36 @Builder FollowSecondUI(){ 35 @Builder FollowSecondUI(){
1 -import { LazyDataSource, StringUtils } from 'wdKit'; 1 +import { DateTimeUtils, LazyDataSource, StringUtils } from 'wdKit';
2 import MinePageDatasModel from '../../../../model/MinePageDatasModel'; 2 import MinePageDatasModel from '../../../../model/MinePageDatasModel';
3 import { HttpUrlUtils } from '../../../../network/HttpUrlUtils'; 3 import { HttpUrlUtils } from '../../../../network/HttpUrlUtils';
4 import RouteManager from '../../../../utils/RouteManager'; 4 import RouteManager from '../../../../utils/RouteManager';
@@ -33,8 +33,32 @@ export struct HomePageBottomComponent{ @@ -33,8 +33,32 @@ export struct HomePageBottomComponent{
33 .backgroundColor($r('app.color.color_EDEDED')) 33 .backgroundColor($r('app.color.color_EDEDED'))
34 34
35 if(this.count === 0){ 35 if(this.count === 0){
36 - ListHasNoMoreDataUI({style:2})  
37 - .height('100%') 36 + if(this.style === 1){
  37 + Row(){
  38 + Text("关注更多人民号")
  39 + .fontWeight('400lpx')
  40 + .fontColor($r('app.color.color_222222'))
  41 + .lineHeight('38lpx')
  42 + .fontSize('27lpx')
  43 + .textAlign(TextAlign.Center)
  44 + .margin({right:'4lpx'})
  45 + Image($r('app.media.arrow_icon_right'))
  46 + .objectFit(ImageFit.Auto)
  47 + .width('27lpx')
  48 + .height('27lpx')
  49 + }.height('69lpx')
  50 + .width('659lpx')
  51 + .alignItems(VerticalAlign.Center)
  52 + .justifyContent(FlexAlign.Center)
  53 + .backgroundColor($r('app.color.color_F5F5F5'))
  54 + .margin({top:'31lpx',bottom:'4lpx'})
  55 + .onClick(()=>{
  56 + RouteManager.jumpNewPage("pages/FollowListPage",new RouterObject('',1))
  57 + })
  58 + }else{
  59 + ListHasNoMoreDataUI({style:2})
  60 + .layoutWeight(1)
  61 + }
38 }else{ 62 }else{
39 if(this.style === 1){ 63 if(this.style === 1){
40 List({ space: 3 }) { 64 List({ space: 3 }) {
@@ -129,6 +153,8 @@ export struct HomePageBottomComponent{ @@ -129,6 +153,8 @@ export struct HomePageBottomComponent{
129 } 153 }
130 } 154 }
131 .width('100%') 155 .width('100%')
  156 + .height('100%')
  157 + .justifyContent(FlexAlign.Start)
132 } 158 }
133 159
134 160
@@ -145,7 +171,7 @@ export struct HomePageBottomComponent{ @@ -145,7 +171,7 @@ export struct HomePageBottomComponent{
145 //我的关注列表 171 //我的关注列表
146 if (this.style === 1){ 172 if (this.style === 1){
147 if(this.hasMore){ 173 if(this.hasMore){
148 - let object = new FollowListDetailRequestItem(20,this.curPageNum) 174 + let object = new FollowListDetailRequestItem(-1,20,this.curPageNum)
149 175
150 MinePageDatasModel.getMineFollowListData(object,getContext(this)).then((value)=>{ 176 MinePageDatasModel.getMineFollowListData(object,getContext(this)).then((value)=>{
151 if (!this.data_follow || value.list.length == 0){ 177 if (!this.data_follow || value.list.length == 0){
@@ -170,9 +196,11 @@ export struct HomePageBottomComponent{ @@ -170,9 +196,11 @@ export struct HomePageBottomComponent{
170 } 196 }
171 }else if(this.style === 0){ 197 }else if(this.style === 0){
172 if(this.hasMore){ 198 if(this.hasMore){
173 - let object = new FollowListDetailRequestItem(20,this.curPageNum) 199 + let time = encodeURI(DateTimeUtils.getCurDate(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN))
  200 + let object = new FollowListDetailRequestItem(-1,20,this.curPageNum)
  201 +
174 202
175 - MinePageDatasModel.getMineCommentListData(object,getContext(this)).then((value)=>{ 203 + MinePageDatasModel.getMineCommentListData(time,object,getContext(this)).then((value)=>{
176 if (!this.data_comment || value.list.length == 0){ 204 if (!this.data_comment || value.list.length == 0){
177 this.hasMore = false 205 this.hasMore = false
178 }else{ 206 }else{
@@ -55,18 +55,20 @@ export struct MyHomeComponent { @@ -55,18 +55,20 @@ export struct MyHomeComponent {
55 Stack(){ 55 Stack(){
56 Image(this.headPhotoUrl) 56 Image(this.headPhotoUrl)
57 .alt($r('app.media.default_head')) 57 .alt($r('app.media.default_head'))
58 - .width('115lpx')  
59 - .height('115lpx')  
60 - .objectFit(ImageFit.Cover) 58 + .width('100lpx')
  59 + .height('100lpx')
  60 + .objectFit(ImageFit.Auto)
61 .borderRadius(50) 61 .borderRadius(50)
62 Image(this.levelHead) 62 Image(this.levelHead)
63 .width('130lpx') 63 .width('130lpx')
64 .height('130lpx') 64 .height('130lpx')
65 .objectFit(ImageFit.Cover) 65 .objectFit(ImageFit.Cover)
66 - .borderRadius(50)  
67 }.onClick(()=>{ 66 }.onClick(()=>{
  67 + //531267787833221
68 RouteManager.jumpNewPage("pages/OtherNormalUserHomePage",new RouterObject('512157124138245',0)) 68 RouteManager.jumpNewPage("pages/OtherNormalUserHomePage",new RouterObject('512157124138245',0))
69 - }) 69 + }).width('135lpx')
  70 + .height('135lpx')
  71 +
70 Column() { 72 Column() {
71 Row() { 73 Row() {
72 Text(`${this.userName}`) 74 Text(`${this.userName}`)
@@ -6,6 +6,7 @@ import MinePageDatasModel from '../../../../model/MinePageDatasModel'; @@ -6,6 +6,7 @@ import MinePageDatasModel from '../../../../model/MinePageDatasModel';
6 import { MineCommentListDetailItem } from '../../../../viewmodel/MineCommentListDetailItem'; 6 import { MineCommentListDetailItem } from '../../../../viewmodel/MineCommentListDetailItem';
7 import { OtherUserCommentLikeStatusRequestItem } from '../../../../viewmodel/OtherUserCommentLikeStatusRequestItem'; 7 import { OtherUserCommentLikeStatusRequestItem } from '../../../../viewmodel/OtherUserCommentLikeStatusRequestItem';
8 import { CommentLikeOperationRequestItem } from '../../../../viewmodel/CommentLikeOperationRequestItem'; 8 import { CommentLikeOperationRequestItem } from '../../../../viewmodel/CommentLikeOperationRequestItem';
  9 +import { HttpUrlUtils } from '../../../../network/HttpUrlUtils';
9 10
10 const TAG = "HomePageBottomComponent" 11 const TAG = "HomePageBottomComponent"
11 @Component 12 @Component
@@ -17,6 +18,7 @@ export struct OtherHomePageBottomCommentComponent{ @@ -17,6 +18,7 @@ export struct OtherHomePageBottomCommentComponent{
17 curPageNum:number = 1; 18 curPageNum:number = 1;
18 @State count:number = 0; 19 @State count:number = 0;
19 @Prop levelHead:string 20 @Prop levelHead:string
  21 + @Link commentNum:number
20 22
21 aboutToAppear(){ 23 aboutToAppear(){
22 this.getNewPageData() 24 this.getNewPageData()
@@ -122,6 +124,7 @@ export struct OtherHomePageBottomCommentComponent{ @@ -122,6 +124,7 @@ export struct OtherHomePageBottomCommentComponent{
122 this.data_comment.notifyDataReload() 124 this.data_comment.notifyDataReload()
123 125
124 this.count = this.data_comment.totalCount() 126 this.count = this.data_comment.totalCount()
  127 + this.commentNum = value.totalCount
125 if (this.data_comment.totalCount() < value.totalCount) { 128 if (this.data_comment.totalCount() < value.totalCount) {
126 this.curPageNum++ 129 this.curPageNum++
127 }else { 130 }else {
@@ -104,7 +104,7 @@ export struct OtherHomePageBottomFollowComponent{ @@ -104,7 +104,7 @@ export struct OtherHomePageBottomFollowComponent{
104 104
105 getNewPageData(){ 105 getNewPageData(){
106 this.isLoading = true 106 this.isLoading = true
107 - //我的关注列表 107 + //关注列表
108 if(this.hasMore){ 108 if(this.hasMore){
109 let object = new UserFollowListRequestItem(Number(this.curUserId),20,this.curPageNum,"1") 109 let object = new UserFollowListRequestItem(Number(this.curUserId),20,this.curPageNum,"1")
110 110
@@ -164,47 +164,6 @@ struct ChildFollowComponent { @@ -164,47 +164,6 @@ struct ChildFollowComponent {
164 .textOverflow({ overflow: TextOverflow.Ellipsis }) 164 .textOverflow({ overflow: TextOverflow.Ellipsis })
165 }.layoutWeight(1) 165 }.layoutWeight(1)
166 .alignItems(HorizontalAlign.Start) 166 .alignItems(HorizontalAlign.Start)
167 -  
168 - if(this.data.status == "1"){  
169 - Row(){  
170 - Text(`已关注`)  
171 - .fontColor($r('app.color.color_CCCCCC'))  
172 - .fontSize('23lpx')  
173 - .fontWeight('500lpx')  
174 - .lineHeight('35lpx')  
175 - }.backgroundColor($r('app.color.color_F5F5F5'))  
176 - .borderRadius('6lpx')  
177 - .borderColor($r('app.color.color_F5F5F5'))  
178 - .borderWidth('2lpx')  
179 - .justifyContent(FlexAlign.Center)  
180 - .width('100lpx')  
181 - .height('46lpx')  
182 - .margin({left:'4lpx',top:'23lpx'})  
183 - .onClick(()=>{  
184 - this.data.status = "0"  
185 - })  
186 - }else{  
187 - Row(){  
188 - Image($r('app.media.follow_icon'))  
189 - .margin({right:'4lpx'})  
190 - .width('23lpx')  
191 - .height('23lpx')  
192 - Text(`关注`)  
193 - .fontColor($r('app.color.color_ED2800'))  
194 - .fontSize('23lpx')  
195 - .fontWeight('500lpx')  
196 - .lineHeight('35lpx')  
197 - }.borderColor($r('app.color.color_1AED2800'))  
198 - .borderRadius('6lpx')  
199 - .borderWidth('2lpx')  
200 - .justifyContent(FlexAlign.Center)  
201 - .width('100lpx')  
202 - .height('46lpx')  
203 - .margin({left:'4lpx',top:'23lpx'})  
204 - .onClick(()=>{  
205 - this.data.status = "1"  
206 - })  
207 - }  
208 }.alignItems(VerticalAlign.Top) 167 }.alignItems(VerticalAlign.Top)
209 .width('100%') 168 .width('100%')
210 .layoutWeight(1) 169 .layoutWeight(1)
@@ -9,7 +9,7 @@ const TAG = "OtherUserHomeComponent" @@ -9,7 +9,7 @@ const TAG = "OtherUserHomeComponent"
9 9
10 @Component 10 @Component
11 export struct OtherUserHomeComponent { 11 export struct OtherUserHomeComponent {
12 - @Prop curUserId: string 12 + @Watch('change') @Prop curUserId: string
13 13
14 @State tileOpacity: number = 0; 14 @State tileOpacity: number = 0;
15 firstPositionY:number = 0; 15 firstPositionY:number = 0;
@@ -27,6 +27,12 @@ export struct OtherUserHomeComponent { @@ -27,6 +27,12 @@ export struct OtherUserHomeComponent {
27 @State attentionNum:number = 0//关注数 27 @State attentionNum:number = 0//关注数
28 @State desc:string = "" 28 @State desc:string = ""
29 29
  30 + change(){
  31 + this.getUserInfo()
  32 + this.getUserLevel()
  33 + }
  34 +
  35 +
30 aboutToAppear(){ 36 aboutToAppear(){
31 this.getUserInfo() 37 this.getUserInfo()
32 this.getUserLevel() 38 this.getUserLevel()
@@ -52,8 +58,8 @@ export struct OtherUserHomeComponent { @@ -52,8 +58,8 @@ export struct OtherUserHomeComponent {
52 Stack(){ 58 Stack(){
53 Image(this.headPhotoUrl) 59 Image(this.headPhotoUrl)
54 .alt($r('app.media.default_head')) 60 .alt($r('app.media.default_head'))
55 - .width('115lpx')  
56 - .height('115lpx') 61 + .width('100lpx')
  62 + .height('100lpx')
57 .objectFit(ImageFit.Cover) 63 .objectFit(ImageFit.Cover)
58 .borderRadius(50) 64 .borderRadius(50)
59 Image(this.levelHead) 65 Image(this.levelHead)
@@ -165,7 +171,7 @@ export struct OtherUserHomeComponent { @@ -165,7 +171,7 @@ export struct OtherUserHomeComponent {
165 //tab 页面 171 //tab 页面
166 Tabs({controller: this.controller}) { 172 Tabs({controller: this.controller}) {
167 TabContent() { 173 TabContent() {
168 - OtherHomePageBottomCommentComponent({curUserId:this.curUserId,levelHead:this.levelHead}) 174 + OtherHomePageBottomCommentComponent({curUserId:this.curUserId,levelHead:this.levelHead,commentNum:$commentNum})
169 }.tabBar(this.TabBuilder(0,"评论")) 175 }.tabBar(this.TabBuilder(0,"评论"))
170 TabContent() { 176 TabContent() {
171 OtherHomePageBottomFollowComponent({curUserId:this.curUserId}) 177 OtherHomePageBottomFollowComponent({curUserId:this.curUserId})
@@ -295,6 +301,9 @@ export struct OtherUserHomeComponent { @@ -295,6 +301,9 @@ export struct OtherUserHomeComponent {
295 301
296 302
297 getUserInfo(){ 303 getUserInfo(){
  304 + if(this.curUserId === "-1" ){
  305 + return
  306 + }
298 let item = new OtherUserDetailRequestItem("","1",this.curUserId) 307 let item = new OtherUserDetailRequestItem("","1",this.curUserId)
299 MinePageDatasModel.getOtherUserDetailData(item,getContext(this)).then((value)=>{ 308 MinePageDatasModel.getOtherUserDetailData(item,getContext(this)).then((value)=>{
300 if(value!=null){ 309 if(value!=null){
@@ -312,6 +321,9 @@ export struct OtherUserHomeComponent { @@ -312,6 +321,9 @@ export struct OtherUserHomeComponent {
312 }) 321 })
313 } 322 }
314 getUserLevel(){ 323 getUserLevel(){
  324 + if(this.curUserId === "-1" ){
  325 + return
  326 + }
315 MinePageDatasModel.getOtherUserLevelData([this.curUserId],getContext(this)).then((value)=>{ 327 MinePageDatasModel.getOtherUserLevelData([this.curUserId],getContext(this)).then((value)=>{
316 if(value!=null){ 328 if(value!=null){
317 this.levelHead = value[0].levelHead 329 this.levelHead = value[0].levelHead
@@ -324,10 +324,10 @@ class MinePageDatasModel{ @@ -324,10 +324,10 @@ class MinePageDatasModel{
324 * @param context 324 * @param context
325 * @returns 325 * @returns
326 */ 326 */
327 - getMineCommentListData(params:FollowListDetailRequestItem,context: Context): Promise<MineCommentListDetailItem> { 327 + getMineCommentListData(time:string,params:FollowListDetailRequestItem,context: Context): Promise<MineCommentListDetailItem> {
328 return new Promise<MineCommentListDetailItem>((success, error) => { 328 return new Promise<MineCommentListDetailItem>((success, error) => {
329 Logger.info(TAG, `getAppointmentList start`); 329 Logger.info(TAG, `getAppointmentList start`);
330 - this.fetchMineCommentListData(params).then((navResDTO: ResponseDTO<MineCommentListDetailItem>) => { 330 + this.fetchMineCommentListData(time,params).then((navResDTO: ResponseDTO<MineCommentListDetailItem>) => {
331 if (!navResDTO || navResDTO.code != 0) { 331 if (!navResDTO || navResDTO.code != 0) {
332 success(this.getMineCommentListDataLocal(context)) 332 success(this.getMineCommentListDataLocal(context))
333 return 333 return
@@ -342,8 +342,8 @@ class MinePageDatasModel{ @@ -342,8 +342,8 @@ class MinePageDatasModel{
342 }) 342 })
343 } 343 }
344 344
345 - fetchMineCommentListData(object:FollowListDetailRequestItem) {  
346 - let url = HttpUrlUtils.getMineCommentListDataUrl()+`?pageSize=${object.pageSize}&pageNum=${object.pageNum}` 345 + fetchMineCommentListData(time:string,object:FollowListDetailRequestItem) {
  346 + let url = HttpUrlUtils.getMineCommentListDataUrl()+`?pageSize=${object.pageSize}&pageNum=${object.pageNum}&time=${time}`
347 let headers: HashMap<string, string> = HttpUrlUtils.getYcgCommonHeaders(); 347 let headers: HashMap<string, string> = HttpUrlUtils.getYcgCommonHeaders();
348 return WDHttp.get<ResponseDTO<MineCommentListDetailItem>>(url, headers) 348 return WDHttp.get<ResponseDTO<MineCommentListDetailItem>>(url, headers)
349 }; 349 };
@@ -581,7 +581,7 @@ class MinePageDatasModel{ @@ -581,7 +581,7 @@ class MinePageDatasModel{
581 } 581 }
582 582
583 fetchOtherUserCommentLikeStatusData(object:OtherUserCommentLikeStatusRequestItem) { 583 fetchOtherUserCommentLikeStatusData(object:OtherUserCommentLikeStatusRequestItem) {
584 - let url = HttpUrlUtils.getFollowListStatusDataUrl() 584 + let url = HttpUrlUtils.getCommentListStatusDataUrl()
585 let headers: HashMap<string, string> = HttpUrlUtils.getYcgCommonHeaders(); 585 let headers: HashMap<string, string> = HttpUrlUtils.getYcgCommonHeaders();
586 return WDHttp.post<ResponseDTO<QueryCommentListIsLikedItem[]>>(url,object, headers) 586 return WDHttp.post<ResponseDTO<QueryCommentListIsLikedItem[]>>(url,object, headers)
587 }; 587 };
@@ -74,6 +74,11 @@ export class HttpUrlUtils { @@ -74,6 +74,11 @@ export class HttpUrlUtils {
74 static readonly FOLLOW_LIST_STATUS_DATA_PATH: string = "/api/rmrb-interact/interact/zh/c/batchAttention/status"; 74 static readonly FOLLOW_LIST_STATUS_DATA_PATH: string = "/api/rmrb-interact/interact/zh/c/batchAttention/status";
75 75
76 /** 76 /**
  77 + * 个人中心 启用用户 有没有被当前用户点赞状态
  78 + */
  79 + static readonly COMMENT_LIST_STATUS_DATA_PATH: string = "/api/rmrb-comment/comment/zh/c/batchCommentStatus";
  80 +
  81 + /**
77 * 个人中心 我的评论列表 82 * 个人中心 我的评论列表
78 */ 83 */
79 static readonly MINE_COMMENT_LIST_DATA_PATH: string = "/api/rmrb-comment/comment/zh/c/myCommentList"; 84 static readonly MINE_COMMENT_LIST_DATA_PATH: string = "/api/rmrb-comment/comment/zh/c/myCommentList";
@@ -238,6 +243,11 @@ export class HttpUrlUtils { @@ -238,6 +243,11 @@ export class HttpUrlUtils {
238 return url 243 return url
239 } 244 }
240 245
  246 + static getCommentListStatusDataUrl() {
  247 + let url = HttpUrlUtils.hostUrl + HttpUrlUtils.COMMENT_LIST_STATUS_DATA_PATH
  248 + return url
  249 + }
  250 +
241 static getMineCommentListDataUrl() { 251 static getMineCommentListDataUrl() {
242 let url = HttpUrlUtils.HOST_SIT + HttpUrlUtils.MINE_COMMENT_LIST_DATA_PATH 252 let url = HttpUrlUtils.HOST_SIT + HttpUrlUtils.MINE_COMMENT_LIST_DATA_PATH
243 return url 253 return url
@@ -290,13 +300,13 @@ export class HttpUrlUtils { @@ -290,13 +300,13 @@ export class HttpUrlUtils {
290 300
291 301
292 /** 302 /**
293 - * 预约操作 303 + * 点赞操作
294 */ 304 */
295 static readonly COMMENT_LIKE_OPERATION_PATH: string = "/api/rmrb-comment/comment/zh/c/commentLike"; 305 static readonly COMMENT_LIKE_OPERATION_PATH: string = "/api/rmrb-comment/comment/zh/c/commentLike";
296 /** 306 /**
297 * 关注操作 307 * 关注操作
298 */ 308 */
299 - static readonly FOLLOW_OPERATION_PATH: string = "https://pd-apis-sit.pdnews.cn/api/rmrb-interact/interact/zh/c/attention/operation"; 309 + static readonly FOLLOW_OPERATION_PATH: string = "/api/rmrb-interact/interact/zh/c/attention/operation";
300 310
301 static getYcgCommonHeaders(): HashMap<string, string> { 311 static getYcgCommonHeaders(): HashMap<string, string> {
302 let headers: HashMap<string, string> = new HashMap<string, string>() 312 let headers: HashMap<string, string> = new HashMap<string, string>()
  1 +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g style="opacity:0.20000000298023224;"><g><path d="M6.29805,13.2927L19.701900000000002,20.8323C19.8353,20.9073,20,20.811,20,20.658L20,3.34197C20,3.189004,19.8353,3.0926614,19.701900000000002,3.167654L6.29805,10.70735C6.1647300000000005,10.78234,6,10.686,6,10.53303L6,3.2C6,3.0895431,5.9104600000000005,3,5.8,3L4.2,3C4.0895431,3,4,3.0895431,4,3.2L4,20.6764C4,20.8251,4.156463,20.9218,4.289443,20.8553L5.8894400000000005,20.0553C5.9572,20.0214,6,19.9521,6,19.8764L6,13.467C6,13.314,6.1647300000000005,13.2177,6.29805,13.2927" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g></g></svg>
  1 +<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1712047709053" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11870" width="28" height="28" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M878.885769 568.138291c0 201.397023-163.248995 364.646017-364.646017 364.646017S149.485359 769.535314 149.485359 568.138291c0-192.076766 148.582234-349.076131 336.901997-363.309391 0-0.4335-0.252875-0.903126-0.252875-1.408876V147.353983h-112.168207c-15.497636 0-28.033021-12.535384-28.033021-28.105271 0-15.497636 12.535384-28.033021 28.033021-28.03302h280.51083c15.461511 0 28.105271 12.535384 28.105271 28.03302 0 15.569886-12.643759 28.105271-28.105271 28.105271h-112.168207V203.383899c0 0.541875-0.252875 0.975376-0.252875 1.408876 188.247513 14.269385 336.829747 171.26875 336.829747 363.345516zM514.239752 259.52219c-170.437875 0-308.616101 138.142101-308.616101 308.616101s138.142101 308.616101 308.616101 308.616101c170.365625 0 308.507726-138.142101 308.507726-308.616101s-138.142101-308.616101-308.507726-308.616101z m0 392.787413c-46.529034 0-84.171312-37.714528-84.171312-84.171312 0-36.558527 23.481267-67.445424 56.029916-79.005433V343.693502c0-15.497636 12.535384-28.033021 28.105271-28.033021 15.497636 0 28.033021 12.535384 28.03302 28.033021v145.439356c32.657024 11.560008 56.138291 42.446906 56.138291 79.005433 0 46.456784-37.714528 84.171312-84.135186 84.171312z" fill="#4D5258" p-id="11871"></path></svg>
  1 +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><defs><clipPath id="master_svg0_13448_089636"><rect x="0" y="0" width="24" height="24" rx="0"/></clipPath></defs><g style="opacity:0.20000000298023224;" clip-path="url(#master_svg0_13448_089636)"><g><path d="M10.67639,4L3.2,4C3.0895431,4,3,4.0895431,3,4.2L3,20.8C3,20.9105,3.0895431,21,3.2,21L20.8,21C20.9105,21,21,20.9105,21,20.8L21,5.12361C21,5.04785,20.9572,4.9786,20.8894,4.944721L19.2894,4.144721C19.1565,4.0782313,19,4.17493,19,4.323607L19,19L5,19L5,6L9.87639,6C9.95215,6,10.0214,5.9572,10.05528,5.8894400000000005L10.85528,4.289443C10.92177,4.156463,10.82507,4,10.67639,4" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g><g><path d="M11.5,3.0706476L11.5,6.52935C11.5,6.56044,11.5339189,6.57965,11.5605798,6.56365L14.44283,4.8343C14.46873,4.81876,14.46873,4.78124,14.44283,4.7657L11.5605798,3.0363479C11.5339189,3.0203513,11.5,3.0395558,11.5,3.0706476" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g><g><path d="M15,3.0706476L15,6.52935C15,6.56044,15.0339189,6.57965,15.0605798,6.56365L17.94283,4.8343C17.96873,4.81876,17.96873,4.78124,17.94283,4.7657L15.0605798,3.0363479C15.0339189,3.0203513,15,3.0395558,15,3.0706476" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g><g><path d="M8.916,11.64L8.916,16L9.964,16L9.964,10.48L8.916,10.48L7.9879999999999995,11.176L7.9879999999999995,12.312000000000001L8.916,11.64ZM10.788,14.864L10.788,16L11.9,16L11.9,14.864L10.788,14.864ZM13.008,15.612C13.27725,15.9294,13.692,16.0881,14.251999999999999,16.088C14.812000000000001,16.088,15.22663,15.928,15.496,15.608C15.76525,15.2881,15.9,14.81338,15.9,14.184L15.9,12.232C15.9,11.623999999999999,15.76525,11.16537,15.496,10.856C15.22663,10.54675,14.812000000000001,10.392,14.251999999999999,10.392C13.71325,10.392,13.304,10.548,13.024000000000001,10.86C12.744,11.172,12.604,11.62937,12.604,12.232L12.604,14.184C12.604,14.81875,12.73863,15.2948,13.008,15.612ZM14.728,14.932C14.64525,15.0947,14.48663,15.176,14.251999999999999,15.176C14.02262,15.176,13.866620000000001,15.0947,13.783999999999999,14.932C13.70125,14.76937,13.66,14.49075,13.66,14.096L13.66,12.384C13.66,11.989370000000001,13.7,11.712,13.780000000000001,11.552C13.86,11.392,14.01725,11.312000000000001,14.251999999999999,11.312000000000001C14.48663,11.312000000000001,14.64525,11.392,14.728,11.552C14.81063,11.712,14.852,11.989370000000001,14.852,12.384L14.852,14.096C14.852,14.49075,14.81063,14.76937,14.728,14.932Z" fill="#4D5258" fill-opacity="1"/></g></g></svg>
  1 +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g style="opacity:0.20000000298023224;"><g><path d="M17.701900000000002,13.2927L4.298053,20.8323C4.164731,20.9073,4,20.811,4,20.658L4,3.34197C4,3.189004,4.164731,3.0926614,4.298052,3.167654L17.701900000000002,10.70735C17.8353,10.78234,18,10.686,18,10.53303L18,3.2C18,3.0895431,18.0895,3,18.2,3L19.8,3C19.9105,3,20,3.0895431,20,3.2L20,20.6764C20,20.8251,19.8435,20.9218,19.7106,20.8553L18.110599999999998,20.0553C18.0428,20.0214,18,19.9521,18,19.8764L18,13.467C18,13.314,17.8353,13.2177,17.701900000000002,13.2927" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g></g></svg>
  1 +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="28" height="28" viewBox="0 0 28 28"><g style="opacity:0.20000000298023224;"><g><path d="M3.5,4.31780565625L3.5,6.18447265625Q3.5,6.2308826562499995,3.5177614,6.27376265625Q3.5355229,6.31664265625,3.5683417,6.34946265625Q3.601161,6.38228265625,3.644041,6.40004265625Q3.68692,6.41780265625,3.733333,6.41780265625L24.2667,6.41780265625Q24.3131,6.41780265625,24.356,6.40004265625Q24.3988,6.38228265625,24.4317,6.34946265625Q24.4645,6.31664265625,24.4822,6.27376265625Q24.5,6.2308826562499995,24.5,6.18447265625L24.5,4.31780565625Q24.5,4.27139265625,24.4822,4.22851365625Q24.4645,4.18563365625,24.4317,4.15281435625Q24.3988,4.11999555625,24.356,4.10223405625Q24.3131,4.08447265625,24.2667,4.08447265625L3.733333,4.08447265625Q3.68692,4.08447265625,3.644041,4.10223405625Q3.601161,4.11999555625,3.5683417,4.15281435625Q3.5355229,4.18563365625,3.5177614,4.22851365625Q3.5,4.27139265625,3.5,4.31780565625ZM10.20878,13.80699265625L3.862763,9.57631265625C3.707701,9.47294265625,3.5,9.58410265625,3.5,9.77046265625L3.5,18.23177265625C3.5,18.41817265625,3.707701,18.52937265625,3.862763,18.42597265625L10.20878,14.19527265625C10.34732,14.10297265625,10.34732,13.89935265625,10.20878,13.80699265625ZM24.2667,12.83349265625L13.5609,12.83349265625C13.47249,12.83349265625,13.3917,12.88343265625,13.35217,12.96248265625L12.41884,14.82917265625C12.34127,14.98427265625,12.45409,15.16687265625,12.62754,15.16687265625L24.2667,15.16687265625C24.3955,15.16687265625,24.5,15.06237265625,24.5,14.93347265625L24.5,13.06683265625C24.5,12.93796265625,24.3955,12.83349265625,24.2667,12.83349265625ZM3.5,21.81777265625L3.5,23.68447265625Q3.5,23.73087265625,3.5177614,23.77377265625Q3.5355229,23.81667265625,3.5683417,23.84947265625Q3.601161,23.88227265625,3.644041,23.90007265625Q3.68692,23.91777265625,3.733333,23.91777265625L24.2667,23.91777265625Q24.3131,23.91777265625,24.356,23.90007265625Q24.3988,23.88227265625,24.4317,23.84947265625Q24.4645,23.81667265625,24.4822,23.77377265625Q24.5,23.73087265625,24.5,23.68447265625L24.5,21.81777265625Q24.5,21.77137265625,24.4822,21.72847265625Q24.4645,21.68567265625,24.4317,21.65277265625Q24.3988,21.61997265625,24.356,21.60227265625Q24.3131,21.58447265625,24.2667,21.58447265625L3.733333,21.58447265625Q3.68692,21.58447265625,3.644041,21.60227265625Q3.601161,21.61997265625,3.5683417,21.65277265625Q3.5355229,21.68567265625,3.5177614,21.72847265625Q3.5,21.77137265625,3.5,21.81777265625Z" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g></g></svg>
  1 +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g style="opacity:0.20000000298023224;"><g><path d="M16.61255231628418,0.6909312143875121L15.48135231628418,1.8221886143875121C15.40315231628418,1.9003386143875123,15.40325231628418,2.0270586143875122,15.48145231628418,2.105148614387512L16.87945231628418,3.5008286143875122L2.19995231628418,3.5008286143875122C2.0894953162841796,3.5008286143875122,1.9999523162841797,3.5903786143875123,1.9999523162841797,3.7008286143875124L1.9999523162841797,14.377268614387512C1.9999523162841797,14.452968614387512,2.0427528162841795,14.522268614387512,2.1105093162841797,14.556068614387513L3.7105123162841798,15.356068614387512C3.8434923162841796,15.422568614387512,3.9999523162841797,15.325868614387511,3.9999523162841797,15.177268614387513L3.9999523162841797,5.500828614387512L18.99995231628418,5.500828614387512L18.99995231628418,5.499258614387513L21.22095231628418,5.499258614387513C21.39905231628418,5.499258614387513,21.48835231628418,5.283828614387512,21.36235231628418,5.157838614387512L16.895452316284178,0.6909312143875121C16.81735231628418,0.6128262143875122,16.69065231628418,0.6128263143875122,16.61255231628418,0.6909312143875121ZM19.99995231628418,8.823458614387512L19.99995231628418,18.499868614387513L5.11660231628418,18.499868614387513L5.115252316284179,18.498468614387512L2.7755723162841797,18.498468614387512C2.5973913162841797,18.498468614387512,2.50815731628418,18.71396861438751,2.6341503162841797,18.839968614387512L7.101052316284179,23.30686861438751C7.17916231628418,23.384968614387514,7.30579231628418,23.384968614387514,7.383902316284179,23.30686861438751L8.51515231628418,22.17556861438751C8.59330231628418,22.097468614387513,8.593252316284179,21.970668614387513,8.51503231628418,21.89256861438751L7.11995231628418,20.499868614387513L21.79995231628418,20.499868614387513C21.91045231628418,20.499868614387513,21.99995231628418,20.410268614387512,21.99995231628418,20.299868614387513L21.99995231628418,9.623458614387513C21.99995231628418,9.547708614387512,21.95715231628418,9.478458614387511,21.889352316284178,9.444578614387511L20.28935231628418,8.644578614387513C20.15645231628418,8.578088614387513,19.99995231628418,8.674788614387513,19.99995231628418,8.823458614387512Z" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g></g></svg>
1 -<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g><g><path d="M6.915255046875,4.7314907592749025L11.848588046875001,5.964826319274902C11.937618046875,5.987086319274902,12.000078046875,6.067076319274903,12.000078046875,6.158856319274903L12.000078046875,28.413216319274902C12.000078046875,28.5433163192749,11.877808046875,28.638816319274902,11.751578046875,28.6072163192749L6.818241046875,27.3739163192749C6.729207546875,27.351616319274903,6.666748046875,27.2716163192749,6.666748046875,27.179916319274902L6.666748046875,4.925519319274902C6.666748046875,4.795405019274902,6.789026046875,4.6999334192749025,6.915255046875,4.7314907592749025M20.248548046875,4.7314907592749025L25.181848046875,5.964826319274902C25.270848046875,5.987086319274902,25.333348046875,6.067076319274903,25.333348046875,6.158856319274903L25.333348046875,28.413216319274902C25.333348046875,28.5433163192749,25.211048046875,28.638816319274902,25.084848046875,28.6072163192749L20.151448046875,27.3739163192749C20.062448046874998,27.351616319274903,20.000048046875,27.2716163192749,20.000048046875,27.179916319274902L20.000048046875,4.925519319274902C20.000048046875,4.795405019274902,20.122248046875,4.6999334192749025,20.248548046875,4.7314907592749025" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g></g></svg>  
  1 +<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1712048425819" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="13530" width="32" height="32" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M893.035 463.821679C839.00765 429.699141 210.584253 28.759328 179.305261 8.854514 139.495634-16.737389 99.686007 17.385148 99.686007 57.194775v909.934329c0 45.496716 42.653172 68.245075 76.775709 48.340262 45.496716-28.435448 676.763657-429.375262 716.573284-454.967165 34.122537-22.748358 34.122537-76.775709 0-96.680522z" fill="#FFFFFF" p-id="13531"></path></svg>
  1 +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="32" height="32" viewBox="0 0 32 32"><g><g><path d="M6.915255046875,4.7314907592749025L11.848588046875001,5.964826319274902C11.937618046875,5.987086319274902,12.000078046875,6.067076319274903,12.000078046875,6.158856319274903L12.000078046875,28.413216319274902C12.000078046875,28.5433163192749,11.877808046875,28.638816319274902,11.751578046875,28.6072163192749L6.818241046875,27.3739163192749C6.729207546875,27.351616319274903,6.666748046875,27.2716163192749,6.666748046875,27.179916319274902L6.666748046875,4.925519319274902C6.666748046875,4.795405019274902,6.789026046875,4.6999334192749025,6.915255046875,4.7314907592749025M20.248548046875,4.7314907592749025L25.181848046875,5.964826319274902C25.270848046875,5.987086319274902,25.333348046875,6.067076319274903,25.333348046875,6.158856319274903L25.333348046875,28.413216319274902C25.333348046875,28.5433163192749,25.211048046875,28.638816319274902,25.084848046875,28.6072163192749L20.151448046875,27.3739163192749C20.062448046874998,27.351616319274903,20.000048046875,27.2716163192749,20.000048046875,27.179916319274902L20.000048046875,4.925519319274902C20.000048046875,4.795405019274902,20.122248046875,4.6999334192749025,20.248548046875,4.7314907592749025" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g></g></svg>
  1 +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="28.000001907348633" height="28.000001907348633" viewBox="0 0 28.000001907348633 28.000001907348633"><g style="opacity:0.20000000298023224;"><g></g><g><path d="M3.5,25.08349609375L3.5,2.91682909375Q3.5,2.85937609375,3.5112086,2.80302709375Q3.5224172,2.74667709375,3.5444036,2.6935970937500002Q3.56639,2.6405170937499998,3.5983094,2.59274709375Q3.630229,2.54497609375,3.670854,2.50435009375Q3.71148,2.46372509375,3.759251,2.43180549375Q3.8070209999999998,2.39988609375,3.8601010000000002,2.37789969375Q3.913181,2.35591329375,3.969531,2.34470469375Q4.02588,2.33349609375,4.083333,2.33349609375L23.9167,2.33349609375Q23.9741,2.33349609375,24.0305,2.34470469375Q24.0868,2.35591329375,24.1399,2.37789969375Q24.193,2.39988609375,24.2407,2.43180549375Q24.2885,2.46372509375,24.3291,2.50435009375Q24.3698,2.54497609375,24.4017,2.59274709375Q24.4336,2.6405170937499998,24.4556,2.6935970937500002Q24.4776,2.74667709375,24.4888,2.80302709375Q24.5,2.85937609375,24.5,2.91682909375L24.5,15.16649609375L22.1666,15.16649609375L22.1666,4.66650609375L5.83325,4.66650609375L5.83325,23.33319609375L14,23.33319609375L14,25.66679609375L4.083333,25.66679609375Q4.02588,25.66679609375,3.969531,25.65559609375Q3.913181,25.64439609375,3.8601010000000002,25.62239609375Q3.8070209999999998,25.60039609375,3.759251,25.56849609375Q3.71148,25.53659609375,3.670854,25.49599609375Q3.630229,25.45539609375,3.5983094,25.40759609375Q3.56639,25.35979609375,3.5444036,25.30669609375Q3.5224172,25.25369609375,3.5112086,25.19729609375Q3.5,25.14099609375,3.5,25.08349609375Z" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g><g><path d="M9.333251953125,11.43447265625C9.333251953125,11.56334265625,9.437718953125,11.66780265625,9.566584953125,11.66780265625L17.355711953125002,11.66780265625C17.444091953125,11.66780265625,17.524881953125,11.61787265625,17.564411953125,11.53882265625L18.497741953125,9.67215565625C18.575311953125002,9.51701265625,18.462501953125,9.33447265625,18.289041953125,9.33447265625L9.566584953125,9.33447265625C9.437718953125,9.33447265625,9.333251953125,9.43893965625,9.333251953125,9.56780565625L9.333251953125,11.43447265625Z" fill="#4D5258" fill-opacity="1"/></g><g><path d="M9.333251953125,16.68203125C9.333251953125,16.81090125,9.437718953125,16.91536125,9.566584953125,16.91536125L14.439041953124999,16.91536125C14.527421953125,16.91536125,14.608221953125,16.86543125,14.647741953125,16.786381249999998L15.581081953125,14.91971425C15.658651953125,14.76457125,15.545831953124999,14.58203125,15.372381953125,14.58203125L9.566584953125,14.58203125C9.437718953125,14.58203125,9.333251953125,14.68649825,9.333251953125,14.81536425L9.333251953125,16.68203125Z" fill="#4D5258" fill-opacity="1"/></g><g><path d="M17.588956390625,19.15734328125L20.566870390625,19.16774328125L20.548890390625,24.31857328125L19.458060390625,24.314763281250002L19.471360390625,20.50559328125C19.471810390625,20.37673328125,19.367710390625,20.27190328125,19.238840390625,20.27145328125L18.346340390625,20.26833328125C18.217470390625,20.26788328125,18.112640390625,20.37198328125,18.112190390625,20.50085328125L18.098890390625,24.31002328125L17.054726390625,24.30637328125C16.925861390625,24.30592328125,16.821030110625,24.410023281249998,16.820580290625,24.53889328125L16.817464871625,25.43139328125C16.817015045625,25.560263281250002,16.921116390625,25.66509328125,17.049982390625,25.66554328125L24.933730390625,25.693063281249998C25.062600390625,25.69351328125,25.167430390625,25.58941328125,25.167880390625,25.46054328125L25.171000390625,24.56804328125C25.171450390624997,24.43917328125,25.067340390625,24.33434328125,24.938480390625,24.33389328125L21.934310390625,24.323413281249998L21.941450390625,22.27882328125L24.105620390625,22.28638328125C24.234480390625002,22.28683328125,24.339310390625002,22.18272328125,24.339760390625,22.05386328125L24.342820390625,21.17886328125C24.343270390625,21.04999328125,24.239170390625,20.94516328125,24.110300390625,20.94471328125L21.946130390625,20.93716328125L21.952290390625002,19.17257328125L24.588960390625,19.18178328125C24.717820390625,19.18223328125,24.822660390625,19.07812328125,24.823100390625,18.94926328125L24.826220390625,18.05675828125C24.826670390625,17.92789328125,24.722570390625002,17.82306218125,24.593700390625,17.82261228125L17.593700390625,17.79817776225C17.464835390625,17.79772793625,17.360004390625,17.90182928125,17.359554390625,18.03069528125L17.356439390625,18.92320328125C17.355989390625,19.05206328125,17.460090390625,19.15689328125,17.588956390625,19.15734328125Z" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g></g></svg>
@@ -5,13 +5,13 @@ @@ -5,13 +5,13 @@
5 "name": "default", 5 "name": "default",
6 "type": "HarmonyOS", 6 "type": "HarmonyOS",
7 "material": { 7 "material": {
8 - "certpath": "/Users/jrl/.ohos/config/auto_debug_sight_harmony_com.wondertek.sight_2850086000431478878.cer",  
9 - "storePassword": "0000001B1B59DAB22B389A8BCD25A2C43C89DE581FD6AC3EEE1D3FC227D46727A7763AAE553A50B5E81310", 8 + "certpath": "C:\\Users\\pc\\.ohos\\config\\default_sight_harmony_l75MehGV9G3TUayEtL68-EIWqyYDqfVXfu9D-DPJ7I0=.cer",
  9 + "storePassword": "0000001AB256FAF47AA4D68E4841C95D357490DE9FBB26A3A9161AD3069E31B3623E25CB49409CCA9CF7",
10 "keyAlias": "debugKey", 10 "keyAlias": "debugKey",
11 - "keyPassword": "0000001B2B0EDD642E43906A1B9A6B72A79F40316E908829B79DD96467FE5C3A8D1DF9E40957DA733DF77F",  
12 - "profile": "/Users/jrl/.ohos/config/auto_debug_sight_harmony_com.wondertek.sight_2850086000431478878.p7b", 11 + "keyPassword": "0000001AFB06818C2BC8DC275326668AAC62B91EBF7D3F84E8BE0F156D02623AA0F4F8C6B73F362CB371",
  12 + "profile": "C:\\Users\\pc\\.ohos\\config\\default_sight_harmony_l75MehGV9G3TUayEtL68-EIWqyYDqfVXfu9D-DPJ7I0=.p7b",
13 "signAlg": "SHA256withECDSA", 13 "signAlg": "SHA256withECDSA",
14 - "storeFile": "/Users/jrl/.ohos/config/auto_debug_sight_harmony_com.wondertek.sight_2850086000431478878.p12" 14 + "storeFile": "C:\\Users\\pc\\.ohos\\config\\default_sight_harmony_l75MehGV9G3TUayEtL68-EIWqyYDqfVXfu9D-DPJ7I0=.p12"
15 } 15 }
16 } 16 }
17 ], 17 ],
@@ -32,4 +32,6 @@ export { SystemUtils } from './src/main/ets/utils/SystemUtils' @@ -32,4 +32,6 @@ export { SystemUtils } from './src/main/ets/utils/SystemUtils'
32 32
33 export { PermissionUtil } from './src/main/ets/utils/PermissionUtil' 33 export { PermissionUtil } from './src/main/ets/utils/PermissionUtil'
34 34
35 -export { UserDataLocal } from './src/main/ets/utils/UserDataLocal'  
  35 +export { UserDataLocal } from './src/main/ets/utils/UserDataLocal'
  36 +
  37 +export { NumberFormatterUtils } from './src/main/ets/utils/NumberFormatterUtils'
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 +}
  1 +
  2 +export class NumberFormatterUtils {
  3 +
  4 + /**
  5 + * 数据小于一万返回原数据,大于一万保留小数点后一位,加上万字
  6 + * @param num
  7 + * @returns
  8 + */
  9 + static formatNumberWithWan(inputNumber: number | String): string {
  10 + const num = typeof inputNumber === 'number' ? inputNumber : Number(inputNumber);
  11 + if (isNaN(num) || num < 10000) {
  12 + return num.toString();
  13 + } else {
  14 + const wanUnit = num / 10000;
  15 + return `${wanUnit.toFixed(1)}万`;
  16 + }
  17 + }
  18 +}
@@ -41,13 +41,33 @@ export class HttpUrlUtils { @@ -41,13 +41,33 @@ export class HttpUrlUtils {
41 /** 41 /**
42 * 批查接口,查询互动相关数据,如收藏数、评论数等 42 * 批查接口,查询互动相关数据,如收藏数、评论数等
43 */ 43 */
44 - static readonly INTERACT_DATA_PATH: string = "/api/rmrb-contact/contact/zh/c/v2/content/interactData"; 44 + static readonly INTERACT_DATA_PATH: string = "/api/rmrb-contact/contact/zh/c/content/interactData";
45 // 多图(图集)详情页 45 // 多图(图集)详情页
46 /** 46 /**
47 * 批量查询内容当前用户点赞、收藏状态 47 * 批量查询内容当前用户点赞、收藏状态
48 */ 48 */
49 static readonly INTERACT_DATA_STATUS: string = "/api/rmrb-interact/interact/zh/c/batchLikeAndCollect/status"; 49 static readonly INTERACT_DATA_STATUS: string = "/api/rmrb-interact/interact/zh/c/batchLikeAndCollect/status";
50 /** 50 /**
  51 + * 点赞、取消点赞
  52 + */
  53 + static readonly INTERACT_EXECUTELIKE: string = "/api/rmrb-interact/interact/zh/c/like/executeLike";
  54 + /**
  55 + * 收藏、取消收藏
  56 + */
  57 + static readonly INTERACT_EXECUTECOLLECTRECORD: string = "/api/rmrb-interact/interact/zh/c/collect/executeCollcetRecord";
  58 + /**
  59 + * 关注号主
  60 + */
  61 + static readonly INTERACT_ACCENTION_OPERATION: string = "/api/rmrb-interact/interact/zh/c/attention/operation";
  62 + /**
  63 + * 用户等级/积分-APP根据业务场景动态增减成长值(APP)
  64 + */
  65 + static readonly USERPOINT_OPERATE: string = "/api/rmrb-user-point/auth/pointLevel/zh/operate";
  66 + /**
  67 + * 评论发布
  68 + */
  69 + static readonly COMMENT_PUBLISH: string = "/api/rmrb-comment/comment/zh/c/publish";
  70 + /**
51 * 沉浸式視頻批量查詢20條數據 71 * 沉浸式視頻批量查詢20條數據
52 */ 72 */
53 static readonly RECOMMEND_VIDEOLIST: string = "/api/rmrb-bff-display-zh/recommend/zh/c/videoList"; 73 static readonly RECOMMEND_VIDEOLIST: string = "/api/rmrb-bff-display-zh/recommend/zh/c/videoList";
@@ -76,6 +96,14 @@ export class HttpUrlUtils { @@ -76,6 +96,14 @@ export class HttpUrlUtils {
76 */ 96 */
77 static readonly APPOINTMENT_QueryUserDetail_PATH: string = "/api/rmrb-user-center/user/zh/c/queryUserDetail"; 97 static readonly APPOINTMENT_QueryUserDetail_PATH: string = "/api/rmrb-user-center/user/zh/c/queryUserDetail";
78 /** 98 /**
  99 + * 资料编辑 更新普通用户信息
  100 + */
  101 + static readonly APPOINTMENT_editUserDetail_PATH: string = "/api/rmrb-user-center/user/zh/c/editUserDetail";
  102 + /**
  103 + * 资料编辑 更新普通用户名
  104 + */
  105 + static readonly APPOINTMENT_editUserDetail1_PATH: string = "/api/rmrb-user-center/user/zh/c/completeUserInfo";
  106 + /**
79 /** 107 /**
80 * 个人中心 关注列表详情 108 * 个人中心 关注列表详情
81 */ 109 */
@@ -128,12 +156,10 @@ export class HttpUrlUtils { @@ -128,12 +156,10 @@ export class HttpUrlUtils {
128 * 个人中心 我的关注列表 156 * 个人中心 我的关注列表
129 */ 157 */
130 static readonly OTHER_USER_FOLLOW_LIST_DATA_PATH: string = "/api/rmrb-interact/interact/zh/c/userAttention/list"; 158 static readonly OTHER_USER_FOLLOW_LIST_DATA_PATH: string = "/api/rmrb-interact/interact/zh/c/userAttention/list";
131 -  
132 /** 159 /**
133 * 预约操作 160 * 预约操作
134 */ 161 */
135 static readonly APPOINTMENT_OPERATION_STATUS_PATH: string = "/api/live-center-message/zh/c/live/subscribe"; 162 static readonly APPOINTMENT_OPERATION_STATUS_PATH: string = "/api/live-center-message/zh/c/live/subscribe";
136 -  
137 /** 163 /**
138 * 点赞操作 164 * 点赞操作
139 */ 165 */
@@ -153,7 +179,12 @@ export class HttpUrlUtils { @@ -153,7 +179,12 @@ export class HttpUrlUtils {
153 * */ 179 * */
154 static readonly MORNING_EVENING_PAGE_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/pageInfo"; 180 static readonly MORNING_EVENING_PAGE_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/pageInfo";
155 static readonly MORNING_EVENING_COMP_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/compInfo"; 181 static readonly MORNING_EVENING_COMP_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/compInfo";
156 - private static hostUrl: string = HttpUrlUtils.HOST_PRODUCT; 182 + private static _hostUrl: string = HttpUrlUtils.HOST_PRODUCT;
  183 +
  184 + public static set hostUrl(value: string) {
  185 + HttpUrlUtils._hostUrl = value;
  186 + }
  187 +
157 private static userId = '' 188 private static userId = ''
158 private static userType = '' 189 private static userType = ''
159 private static token = '' 190 private static token = ''
@@ -169,8 +200,8 @@ export class HttpUrlUtils { @@ -169,8 +200,8 @@ export class HttpUrlUtils {
169 headers.set('timestamp', HttpUrlUtils.getTimestamp()) 200 headers.set('timestamp', HttpUrlUtils.getTimestamp())
170 headers.set('RMRB-X-TOKEN', HttpUrlUtils.getXToken()) 201 headers.set('RMRB-X-TOKEN', HttpUrlUtils.getXToken())
171 headers.set('device_id', HttpUrlUtils.getDeviceId()) 202 headers.set('device_id', HttpUrlUtils.getDeviceId())
172 - if(HttpUrlUtils.getXToken()!=''){  
173 - headers.set('cookie', 'RMRB-X-TOKEN='+HttpUrlUtils.getXToken()) 203 + if (HttpUrlUtils.getXToken() != '') {
  204 + headers.set('cookie', 'RMRB-X-TOKEN=' + HttpUrlUtils.getXToken())
174 } 205 }
175 headers.set('build_version', HttpUrlUtils.getVersion()) 206 headers.set('build_version', HttpUrlUtils.getVersion())
176 headers.set('adcode', HttpUrlUtils.getAdCode()) 207 headers.set('adcode', HttpUrlUtils.getAdCode())
@@ -199,7 +230,7 @@ export class HttpUrlUtils { @@ -199,7 +230,7 @@ export class HttpUrlUtils {
199 } 230 }
200 231
201 static addSpecialHeaders(headers: HashMap<string, string>) { 232 static addSpecialHeaders(headers: HashMap<string, string>) {
202 - switch (HttpUrlUtils.hostUrl) { 233 + switch (HttpUrlUtils._hostUrl) {
203 case HttpUrlUtils.HOST_UAT: 234 case HttpUrlUtils.HOST_UAT:
204 // TODO 待优化到常量类里 235 // TODO 待优化到常量类里
205 headers.set('X-Ca-Stage', 'PRE'); 236 headers.set('X-Ca-Stage', 'PRE');
@@ -227,7 +258,7 @@ export class HttpUrlUtils { @@ -227,7 +258,7 @@ export class HttpUrlUtils {
227 } 258 }
228 259
229 static getHost() { 260 static getHost() {
230 - return HttpUrlUtils.hostUrl; 261 + return HttpUrlUtils._hostUrl;
231 } 262 }
232 263
233 private static getCity() { 264 private static getCity() {
@@ -251,20 +282,20 @@ export class HttpUrlUtils { @@ -251,20 +282,20 @@ export class HttpUrlUtils {
251 } 282 }
252 283
253 private static getXToken() { 284 private static getXToken() {
254 - if(StringUtils.isNotEmpty(HttpUrlUtils.token)){ 285 + if (StringUtils.isNotEmpty(HttpUrlUtils.token)) {
255 return HttpUrlUtils.token 286 return HttpUrlUtils.token
256 } 287 }
257 - HttpUrlUtils.token = SPHelper.default.getSync(SpConstants.USER_JWT_TOKEN,"") as string  
258 - if(StringUtils.isNotEmpty(HttpUrlUtils.token)) {  
259 - return HttpUrlUtils.token 288 + HttpUrlUtils.token = SPHelper.default.getSync(SpConstants.USER_JWT_TOKEN, "") as string
  289 + if (StringUtils.isNotEmpty(HttpUrlUtils.token)) {
  290 + return HttpUrlUtils.token
260 } 291 }
261 return 'eyJhbGciOiJIUzI1NiIsImtpZCI6ImQ4WkI2QkhxSEZrdjJ2U25BNlRwZEdKRjBHcjItVzBvS2FaYzdLOUUycmcifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcwMzY0OTYwNiwidXNlcklkIjo0NTk3NzYyOTc0NzQ5NDksInVzZXJWZXJzaW9uIjoiNDU5Nzc2Mjk3NDc0OTQ5XzIiLCJ1c2VyTmFtZSI6IkJ1bGlraWtpMTgxIiwidXNlclR5cGUiOjIsImNyZWF0b3JJZCI6NDI2NTM5MH0.jhQ9kylcm3FxWf0-lBMZuLkdtIQ6XpFnAi0AFZJNwfc'; 292 return 'eyJhbGciOiJIUzI1NiIsImtpZCI6ImQ4WkI2QkhxSEZrdjJ2U25BNlRwZEdKRjBHcjItVzBvS2FaYzdLOUUycmcifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcwMzY0OTYwNiwidXNlcklkIjo0NTk3NzYyOTc0NzQ5NDksInVzZXJWZXJzaW9uIjoiNDU5Nzc2Mjk3NDc0OTQ5XzIiLCJ1c2VyTmFtZSI6IkJ1bGlraWtpMTgxIiwidXNlclR5cGUiOjIsImNyZWF0b3JJZCI6NDI2NTM5MH0.jhQ9kylcm3FxWf0-lBMZuLkdtIQ6XpFnAi0AFZJNwfc';
262 } 293 }
263 294
264 - static getRefreshToken() {  
265 - let refreshToken = SPHelper.default.getSync(SpConstants.USER_REFRESH_TOKEN,"")  
266 - if(StringUtils.isNotEmpty(refreshToken)) {  
267 - return refreshToken as string; 295 + static getRefreshToken() {
  296 + let refreshToken = SPHelper.default.getSync(SpConstants.USER_REFRESH_TOKEN, "")
  297 + if (StringUtils.isNotEmpty(refreshToken)) {
  298 + return refreshToken as string;
268 } 299 }
269 return ''; 300 return '';
270 } 301 }
@@ -327,55 +358,55 @@ export class HttpUrlUtils { @@ -327,55 +358,55 @@ export class HttpUrlUtils {
327 358
328 public static getUserId() { 359 public static getUserId() {
329 // TODO 对接登录 360 // TODO 对接登录
330 - if(StringUtils.isNotEmpty(HttpUrlUtils.userId)){ 361 + if (StringUtils.isNotEmpty(HttpUrlUtils.userId)) {
331 return HttpUrlUtils.userId 362 return HttpUrlUtils.userId
332 } 363 }
333 - HttpUrlUtils.userId = SPHelper.default.getSync(SpConstants.USER_ID,"") as string 364 + HttpUrlUtils.userId = SPHelper.default.getSync(SpConstants.USER_ID, "") as string
334 return HttpUrlUtils.userId; 365 return HttpUrlUtils.userId;
335 } 366 }
336 367
337 - public static getUserType() {  
338 - if(StringUtils.isNotEmpty(HttpUrlUtils.userType)){ 368 + public static getUserType() {
  369 + if (StringUtils.isNotEmpty(HttpUrlUtils.userType)) {
339 return HttpUrlUtils.userType 370 return HttpUrlUtils.userType
340 } 371 }
341 - HttpUrlUtils.userType = SPHelper.default.getSync(SpConstants.USER_Type,"") as string 372 + HttpUrlUtils.userType = SPHelper.default.getSync(SpConstants.USER_Type, "") as string
342 return HttpUrlUtils.userType; 373 return HttpUrlUtils.userType;
343 } 374 }
344 375
345 static getVerifyCodeUrl() { 376 static getVerifyCodeUrl() {
346 - let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/auth/zh/c/sendVerifyCode"; 377 + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/auth/zh/c/sendVerifyCode";
347 return url; 378 return url;
348 } 379 }
349 380
350 static getVerifyCodeByTokenUrl() { 381 static getVerifyCodeByTokenUrl() {
351 - let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/auth/zh/c/sendVerifyCodeByToken"; 382 + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/auth/zh/c/sendVerifyCodeByToken";
352 return url; 383 return url;
353 } 384 }
354 385
355 386
356 static getForgetPasswordUrl() { 387 static getForgetPasswordUrl() {
357 - let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/user/zh/c/forgotPassword"; 388 + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/forgotPassword";
358 return url; 389 return url;
359 } 390 }
360 391
361 static getLogoutUrl() { 392 static getLogoutUrl() {
362 - let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/user/zh/c/logout"; 393 + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/logout";
363 return url; 394 return url;
364 } 395 }
365 396
366 397
367 static getResetPassworddUrl() { 398 static getResetPassworddUrl() {
368 - let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/user/zh/c/resetPassword"; 399 + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/resetPassword";
369 return url; 400 return url;
370 } 401 }
371 402
372 static queryUserDetail() { 403 static queryUserDetail() {
373 - let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/user/zh/c/queryUserDetail"; 404 + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/queryUserDetail";
374 return url; 405 return url;
375 } 406 }
376 407
377 static editUserDetail() { 408 static editUserDetail() {
378 - let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/user/zh/c/editUserDetail"; 409 + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/editUserDetail";
379 return url; 410 return url;
380 } 411 }
381 412
@@ -385,17 +416,17 @@ export class HttpUrlUtils { @@ -385,17 +416,17 @@ export class HttpUrlUtils {
385 } 416 }
386 417
387 static getCheckVerifyCodeUrl() { 418 static getCheckVerifyCodeUrl() {
388 - let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/auth/zh/c/checkVerifyCode"; 419 + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/auth/zh/c/checkVerifyCode";
389 return url; 420 return url;
390 } 421 }
391 422
392 static getCheckVerifyByTokenCodeUrl() { 423 static getCheckVerifyByTokenCodeUrl() {
393 - let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/auth/zh/c/checkVerifyCodeByToken"; 424 + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/auth/zh/c/checkVerifyCodeByToken";
394 return url; 425 return url;
395 } 426 }
396 427
397 static getAppointmentListDataUrl() { 428 static getAppointmentListDataUrl() {
398 - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.APPOINTMENT_LIST_DATA_PATH 429 + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.APPOINTMENT_LIST_DATA_PATH
399 return url 430 return url
400 } 431 }
401 432
@@ -405,77 +436,77 @@ export class HttpUrlUtils { @@ -405,77 +436,77 @@ export class HttpUrlUtils {
405 } 436 }
406 437
407 static getFollowListDetailDataUrl() { 438 static getFollowListDetailDataUrl() {
408 - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.FOLLOW_LIST_DETAIL_DATA_PATH 439 + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.FOLLOW_LIST_DETAIL_DATA_PATH
409 return url 440 return url
410 } 441 }
411 442
412 static getFollowListDataUrl() { 443 static getFollowListDataUrl() {
413 - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.FOLLOW_LIST_DATA_PATH 444 + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.FOLLOW_LIST_DATA_PATH
414 return url 445 return url
415 } 446 }
416 447
417 static getMineFollowListDataUrl() { 448 static getMineFollowListDataUrl() {
418 - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.MINE_FOLLOW_LIST_DATA_PATH 449 + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.MINE_FOLLOW_LIST_DATA_PATH
419 return url 450 return url
420 } 451 }
421 452
422 static getFollowListStatusDataUrl() { 453 static getFollowListStatusDataUrl() {
423 - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH 454 + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH
424 return url 455 return url
425 } 456 }
426 457
427 static getCommentListStatusDataUrl() { 458 static getCommentListStatusDataUrl() {
428 - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.COMMENT_LIST_STATUS_DATA_PATH 459 + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.COMMENT_LIST_STATUS_DATA_PATH
429 return url 460 return url
430 } 461 }
431 462
432 static getMineCommentListDataUrl() { 463 static getMineCommentListDataUrl() {
433 - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.MINE_COMMENT_LIST_DATA_PATH 464 + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.MINE_COMMENT_LIST_DATA_PATH
434 return url 465 return url
435 } 466 }
436 467
437 static getMineUserLevelDataUrl() { 468 static getMineUserLevelDataUrl() {
438 - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.MINE_USER_LEVEL_DATA_PATH 469 + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.MINE_USER_LEVEL_DATA_PATH
439 return url 470 return url
440 } 471 }
441 472
442 static getOtherUserLevelDataUrl() { 473 static getOtherUserLevelDataUrl() {
443 - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.OTHER_USER_LEVEL_DATA_PATH 474 + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.OTHER_USER_LEVEL_DATA_PATH
444 return url 475 return url
445 } 476 }
446 477
447 static getMineUserDetailDataUrl() { 478 static getMineUserDetailDataUrl() {
448 - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.MINE_USER_DETAIL_DATA_PATH 479 + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.MINE_USER_DETAIL_DATA_PATH
449 return url 480 return url
450 } 481 }
451 482
452 static getOtherUserDetailDataUrl() { 483 static getOtherUserDetailDataUrl() {
453 - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.OTHER_USER_DETAIL_DATA_PATH 484 + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.OTHER_USER_DETAIL_DATA_PATH
454 return url 485 return url
455 } 486 }
456 487
457 static getOtherCommentListDataUrl() { 488 static getOtherCommentListDataUrl() {
458 - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.OTHER_COMMENT_LIST_DATA_PATH 489 + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.OTHER_COMMENT_LIST_DATA_PATH
459 return url 490 return url
460 } 491 }
461 492
462 static getOtherUserFollowListDataUrl() { 493 static getOtherUserFollowListDataUrl() {
463 - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.OTHER_USER_FOLLOW_LIST_DATA_PATH 494 + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.OTHER_USER_FOLLOW_LIST_DATA_PATH
464 return url 495 return url
465 } 496 }
466 497
467 static getAppointmentOperationUrl() { 498 static getAppointmentOperationUrl() {
468 - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.APPOINTMENT_OPERATION_STATUS_PATH 499 + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.APPOINTMENT_OPERATION_STATUS_PATH
469 return url 500 return url
470 } 501 }
471 502
472 static getCommentLikeOperationUrl() { 503 static getCommentLikeOperationUrl() {
473 - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.COMMENT_LIKE_OPERATION_PATH 504 + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.COMMENT_LIKE_OPERATION_PATH
474 return url 505 return url
475 } 506 }
476 507
477 static getFollowOperationUrl() { 508 static getFollowOperationUrl() {
478 - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.FOLLOW_OPERATION_PATH 509 + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.FOLLOW_OPERATION_PATH
479 return url 510 return url
480 } 511 }
481 512
@@ -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 }
@@ -23,7 +23,19 @@ export { Pic } from './src/main/ets/bean/content/Pic' @@ -23,7 +23,19 @@ export { Pic } from './src/main/ets/bean/content/Pic'
23 23
24 export { InteractDataDTO } from './src/main/ets/bean/content/InteractDataDTO'; 24 export { InteractDataDTO } from './src/main/ets/bean/content/InteractDataDTO';
25 25
26 -export { InteractDataStatusBean, PhotoListBean } from './src/main/ets/bean/detail/MultiPictureDetailPageDTO'; 26 +export {
  27 + PhotoListBean,
  28 + InputMethodProperty,
  29 + batchLikeAndCollectParams,
  30 + postBatchAttentionStatusParams,
  31 + postInteractBrowsOperateParams,
  32 + postBatchAttentionStatusResult,
  33 + batchLikeAndCollectResult,
  34 + postExecuteLikeParams,
  35 + postExecuteCollectRecordParams,
  36 + contentListParams,
  37 + postInteractAccentionOperateParams
  38 +} from './src/main/ets/bean/detail/MultiPictureDetailPageDTO';
27 39
28 export { InteractParam, ContentBean } from './src/main/ets/bean/content/InteractParam'; 40 export { InteractParam, ContentBean } from './src/main/ets/bean/content/InteractParam';
29 41
@@ -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 }
@@ -2,11 +2,11 @@ @@ -2,11 +2,11 @@
2 * 批查接口查询互动相关数据,返回数据bean 2 * 批查接口查询互动相关数据,返回数据bean
3 */ 3 */
4 export interface InteractDataDTO { 4 export interface InteractDataDTO {
5 - collectNum: number;  
6 - commentNum: number; 5 + collectNum: number | String;
  6 + commentNum: number | String;
7 contentId: string; 7 contentId: string;
8 contentType: number; 8 contentType: number;
9 - likeNum: number; 9 + likeNum: number | String;
10 readNum: number; 10 readNum: number;
11 shareNum: number; 11 shareNum: number;
12 } 12 }
  1 +/**
  2 + * 点赞、已读、分享数量
  3 + */
  4 +export interface InteractDataDTO {
  5 + collectNum: number;
  6 + commentNum: number;
  7 + contentType: number;
  8 + likeNum: number;
  9 + readNum: number;
  10 + shareNum: number;
  11 + contentId: string;
  12 +}
1 /* 1 /*
2 * 多图(图集)详情 2 * 多图(图集)详情
3 * */ 3 * */
4 -// 批量查询内容当前用户点赞、收藏状态  
5 -export interface InteractDataStatusBean {  
6 - contentId: string;  
7 - contentType: number;  
8 - contentRelId: string;  
9 - relType: number;  
10 - likeStatus: number;  
11 - collectStatus: number;  
12 -}  
13 4
14 // 【图文、图集稿件正文图片】图片信息数组 5 // 【图文、图集稿件正文图片】图片信息数组
15 export interface PhotoListBean { 6 export interface PhotoListBean {
@@ -17,4 +8,173 @@ export interface PhotoListBean { @@ -17,4 +8,173 @@ export interface PhotoListBean {
17 width: number; 8 width: number;
18 picPath: string; 9 picPath: string;
19 picDesc: string; 10 picDesc: string;
  11 +}
  12 +
  13 +export interface InputMethodProperty {
  14 + /**
  15 + * The name of input method
  16 + *
  17 + * @syscap SystemCapability.MiscServices.InputMethodFramework
  18 + * @since 8
  19 + * @deprecated since 9
  20 + * @useinstead inputMethod.InputMethodProperty#name
  21 + */
  22 + readonly packageName: string;
  23 + /**
  24 + * The id of input method
  25 + *
  26 + * @syscap SystemCapability.MiscServices.InputMethodFramework
  27 + * @since 8
  28 + * @deprecated since 9
  29 + * @useinstead inputMethod.InputMethodProperty#id
  30 + */
  31 + readonly methodId: string;
  32 + /**
  33 + * The name of input method
  34 + *
  35 + * @syscap SystemCapability.MiscServices.InputMethodFramework
  36 + * @since 9
  37 + */
  38 + readonly name: string;
  39 + /**
  40 + * The id of input method
  41 + *
  42 + * @syscap SystemCapability.MiscServices.InputMethodFramework
  43 + * @since 9
  44 + */
  45 + readonly id: string;
  46 + /**
  47 + * The label of input method
  48 + *
  49 + * @syscap SystemCapability.MiscServices.InputMethodFramework
  50 + * @since 9
  51 + */
  52 + readonly label?: string;
  53 + /**
  54 + * The label id of input method
  55 + *
  56 + * @type { ?number }
  57 + * @syscap SystemCapability.MiscServices.InputMethodFramework
  58 + * @since 10
  59 + */
  60 + readonly labelId?: number;
  61 + /**
  62 + * The icon of input method
  63 + *
  64 + * @syscap SystemCapability.MiscServices.InputMethodFramework
  65 + * @since 9
  66 + */
  67 + readonly icon?: string;
  68 + /**
  69 + * The icon id of input method
  70 + *
  71 + * @type { ?number }
  72 + * @syscap SystemCapability.MiscServices.InputMethodFramework
  73 + * @since 9
  74 + */
  75 + readonly iconId?: number;
  76 + /**
  77 + * The extra info of input method
  78 + *
  79 + * @type { object }
  80 + * @syscap SystemCapability.MiscServices.InputMethodFramework
  81 + * @since 9
  82 + */
  83 + /**
  84 + * The extra info of input method
  85 + *
  86 + * @type { ?object }
  87 + * @syscap SystemCapability.MiscServices.InputMethodFramework
  88 + * @since 10
  89 + */
  90 + extra?: object;
  91 +}
  92 +
  93 +export interface IStatusContentList {
  94 + contentId: string;
  95 +
  96 + // relType: string;
  97 + contentType: string;
  98 + // contentRelId: string;
  99 +}
  100 +export interface batchLikeAndCollectParams {
  101 + // userType: number;
  102 + // userId: string;
  103 + contentList: IStatusContentList[]
  104 +}
  105 +
  106 +export interface postBatchAttentionStatusParamsItem {
  107 + creatorId: string;
  108 +}
  109 +
  110 +export interface postBatchAttentionStatusParams {
  111 + creatorIds: postBatchAttentionStatusParamsItem[]
  112 +}
  113 +
  114 +export interface postInteractBrowsOperateParamsContent {
  115 + browseTime: string;
  116 + contentId: string;
  117 + contentType: number;
  118 +}
  119 +
  120 +export interface postInteractBrowsOperateParams {
  121 + delStatus: number;
  122 + contentList: postInteractBrowsOperateParamsContent[]
  123 +}
  124 +
  125 +export interface postBatchAttentionStatusResult {
  126 + creatorId: string;
  127 + status: string;
  128 + userId: string;
  129 +}
  130 +
  131 +export interface batchLikeAndCollectResult {
  132 + collectStatus: number;
  133 + contentType: string;
  134 + likeStatus: string;
  135 + relType: string;
  136 + contentId: string;
  137 + contentRelId: string;
  138 +}
  139 +
  140 +export interface postExecuteLikeParams {
  141 + status: string;
  142 + contentId: string;
  143 + contentType: string;
  144 + relType?: string;
  145 + userName?: string;
  146 + title?: string;
  147 + contentRelId?: string;
  148 + userHeaderUrl?: string;
  149 + channelId?: string;
  150 +}
  151 +export interface postExecuteCollectRecordParamsItem {
  152 + contentId: string;
  153 + contentType: string;
  154 + relType?: string;
  155 + contentRelId?: string;
  156 +}
  157 +
  158 +export interface postExecuteCollectRecordParams {
  159 + status: string;
  160 + contentList: postExecuteCollectRecordParamsItem[]
  161 +}
  162 +
  163 +interface contentListItem {
  164 + contentId: string;
  165 + contentType: number;
  166 +}
  167 +
  168 +export interface contentListParams {
  169 + contentList: contentListItem[];
  170 +}
  171 +
  172 +export interface postInteractAccentionOperateParams {
  173 + attentionUserType: string;
  174 + attentionUserId: string;
  175 + attentionCreatorId: string;
  176 +
  177 + // userType: number;
  178 + // userId: string;
  179 + status: number;
20 } 180 }
  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;
@@ -53,3 +53,8 @@ export { HeadPictureCardComponent } from "./src/main/ets/components/view/HeadPic @@ -53,3 +53,8 @@ export { HeadPictureCardComponent } from "./src/main/ets/components/view/HeadPic
53 export { ZhGridLayoutComponent } from "./src/main/ets/components/view/ZhGridLayoutComponent" 53 export { ZhGridLayoutComponent } from "./src/main/ets/components/view/ZhGridLayoutComponent"
54 54
55 export { MultiPictureDetailPageComponent } from "./src/main/ets/components/MultiPictureDetailPageComponent" 55 export { MultiPictureDetailPageComponent } from "./src/main/ets/components/MultiPictureDetailPageComponent"
  56 +
  57 +export { AudioDetailComponent } from "./src/main/ets/components/AudioDetailComponent"
  58 +
  59 +export { BroadcastPageComponent } from "./src/main/ets/components/broadcast/BroadcastPageComponent"
  60 +
  1 +import { Logger } from 'wdKit';
  2 +import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
  3 +import { ContentDetailDTO } from 'wdBean';
  4 +import media from '@ohos.multimedia.media';
  5 +import { OperRowListView } from './view/OperRowListView';
  6 +import { WDPlayerController } from 'wdPlayer/Index';
  7 +
  8 +const TAG = 'AudioDetailComponent'
  9 +interface Arr{
  10 + image:string,
  11 + title:string
  12 +}
  13 +
  14 +@Component
  15 +export struct AudioDetailComponent {
  16 + private relId: string = ''
  17 + private contentId: string = ''
  18 + private relType: string = ''
  19 + private avPlayer?: media.AVPlayer;
  20 + @State playerController: WDPlayerController = new WDPlayerController();
  21 +
  22 + private arr:Arr[]=[
  23 + {image:'clock',title:'定时'},
  24 + {image:'theOriginal',title:'原文'},
  25 + {image:'list',title:'列表'},
  26 + ]
  27 +
  28 + @State contentDetailData: ContentDetailDTO[] = [] as ContentDetailDTO[]//详情
  29 + @State coverImage:string = '' //封面图
  30 + @State newsTitle:string = '' //标题
  31 + @State audioUrl:string = '' //音频路径
  32 + @State duration:number = 0 //时长
  33 + @State outSetValueOne:number = 40 //播放进度
  34 +
  35 + @State isPlay: boolean = false
  36 + async aboutToAppear() {
  37 + await this.getContentDetailData()
  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();
  52 + }
  53 + build() {
  54 + Row() {
  55 + Column() {
  56 + // 封面
  57 + Row() {
  58 + Image(this.coverImage)
  59 + .width(240)
  60 + .height(160)
  61 + .borderRadius('0')
  62 + }
  63 + .justifyContent(FlexAlign.Center)
  64 + .width('100%')
  65 + .margin({ top: 64 })
  66 + // 标题
  67 + Row() {
  68 + Text(this.newsTitle)
  69 + .fontSize(20)
  70 + .fontWeight(FontWeight.Bold)
  71 + .fontColor('#ffffff')
  72 + .textAlign(TextAlign.Center)
  73 + .lineHeight(28)
  74 + .fontFamily('PingFang SC, PingFang SC')
  75 + }
  76 + .padding({ left: 34, right: 34 })
  77 + .margin({ top: 32 })
  78 + // 操作矩阵
  79 + Row() {
  80 + ForEach(this.arr,(item:Arr)=>{
  81 + Column() {
  82 + Image(item.image=='clock'?$r('app.media.clock_close'):item.image=='theOriginal'?$r('app.media.theOriginal_close'):item.image=='list'?$r('app.media.list_close'):'')
  83 + .width(28)
  84 + .height(28)
  85 + Text(item.title)
  86 + .fontColor('#4D5258')
  87 + .fontSize(12)
  88 + .lineHeight(16)
  89 + .margin(2)
  90 + }
  91 + })
  92 +
  93 + }
  94 + .width('100%')
  95 + .padding({ left: 49, right: 49 })
  96 + .justifyContent(FlexAlign.SpaceBetween)
  97 + .margin({ top: 60 })
  98 +
  99 + Column(){
  100 + // 进度条
  101 + Row(){
  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 + })
  113 + }
  114 + .width('100%')
  115 + .padding({left:24,right:24})
  116 + .margin({top:110})
  117 + // 播放按钮
  118 + Row(){
  119 + Column(){
  120 + Image($r('app.media.loop_close'))
  121 + .width(24)
  122 + .height(24)
  123 + Text('循环')
  124 + .fontColor('#4D5258')
  125 + .fontSize(12)
  126 + .lineHeight(16)
  127 + .margin(2)
  128 + }
  129 +
  130 + Image($r('app.media.Backward_close'))
  131 + .width(24)
  132 + .height(24)
  133 + Stack({ alignContent: Alignment.Center }){
  134 + Image(this.isPlay?$r('app.media.suspend'):$r('app.media.playicon'))
  135 + .width(32)
  136 + .height(32)
  137 + }
  138 + .padding(28)
  139 + .backgroundColor('#4D5258')
  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 + })
  149 + Image($r('app.media.fastForward_close'))
  150 + .width(24)
  151 + .height(24)
  152 + Column(){
  153 + Image($r('app.media.doubleSpeed_close'))
  154 + .width(24)
  155 + .height(24)
  156 + Text('倍速')
  157 + .fontColor('#4D5258')
  158 + .fontSize(12)
  159 + .lineHeight(16)
  160 + .margin(2)
  161 + }
  162 + }
  163 + .width('100%')
  164 + .justifyContent(FlexAlign.SpaceBetween)
  165 + .margin({top:56})
  166 + .padding({left:32,right:32})
  167 + }
  168 + .layoutWeight(1)
  169 + OperRowListView()
  170 + }
  171 + }
  172 +
  173 + }
  174 + private async getContentDetailData() {
  175 + try {
  176 + let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType)
  177 + this.contentDetailData = data;
  178 + console.log('音乐详情',JSON.stringify(this.contentDetailData))
  179 + this.newsTitle = this.contentDetailData[0].newsTitle
  180 + console.log('标题',JSON.stringify(this.newsTitle))
  181 + this.coverImage = this.contentDetailData[0].fullColumnImgUrls[0].url
  182 + console.log('封面图',JSON.stringify(this.coverImage))
  183 + this.duration = this.contentDetailData[0].audioList[0].duration
  184 + console.log('音频时长',JSON.stringify(this.duration))
  185 + this.audioUrl = this.contentDetailData[0].audioList[0].audioUrl
  186 + console.log('音频时长',JSON.stringify(this.audioUrl))
  187 + } catch (exception) {
  188 + console.log('请求失败',JSON.stringify(exception))
  189 + }
  190 + }
  191 +}
@@ -229,6 +229,7 @@ export struct MorningEveningPaperComponent { @@ -229,6 +229,7 @@ export struct MorningEveningPaperComponent {
229 // console.info(TAG, `onClick listen_right_bg`); 229 // console.info(TAG, `onClick listen_right_bg`);
230 }) 230 })
231 } 231 }
  232 + .margin({ left: 12, right: 12 })
232 // .width('100%') 233 // .width('100%')
233 .height(56) 234 .height(56)
234 .alignItems(VerticalAlign.Center) 235 .alignItems(VerticalAlign.Center)
@@ -33,17 +33,20 @@ export struct topicInfoView { @@ -33,17 +33,20 @@ export struct topicInfoView {
33 33
34 Row() { 34 Row() {
35 Text("查看详情") 35 Text("查看详情")
36 - .fontSize(16) 36 + .fontSize(14)
37 .fontColor($r('app.color.white')) 37 .fontColor($r('app.color.white'))
38 .maxLines(1) 38 .maxLines(1)
39 - .backgroundColor($r('app.color.color_99636363'))  
40 .borderRadius(2) 39 .borderRadius(2)
  40 + .padding({ left: 6, top: 4, bottom: 4 })
41 41
42 - Image($r('app.media.more'))  
43 - .height($r('app.float.top_arrow_size'))  
44 - .width(20) 42 + Image($r('app.media.more'))// .height($r('app.float.top_arrow_size'))
  43 + .width(12)
  44 + .height(12)
  45 + .margin({ left: 4, right: 7 })
45 } 46 }
46 - .margin({ top: 10, left: 16, right: 16 }) 47 + .backgroundColor($r('app.color.color_99636363'))
  48 + .margin({ top: 8, left: 16, right: 16, bottom: 16 })
  49 + .borderRadius(2)
47 // .backgroundColor(Color.Red) 50 // .backgroundColor(Color.Red)
48 .alignRules({ 51 .alignRules({
49 left: { anchor: "__container__", align: HorizontalAlign.Start }, 52 left: { anchor: "__container__", align: HorizontalAlign.Start },
@@ -61,6 +64,7 @@ export struct topicInfoView { @@ -61,6 +64,7 @@ export struct topicInfoView {
61 left: { anchor: "__container__", align: HorizontalAlign.Start }, 64 left: { anchor: "__container__", align: HorizontalAlign.Start },
62 bottom: { anchor: "row_detail", align: VerticalAlign.Top } 65 bottom: { anchor: "row_detail", align: VerticalAlign.Top }
63 }) 66 })
  67 + .margin({ left: 16, right: 16 })
64 .id('txt_summary') 68 .id('txt_summary')
65 69
66 Text(this.frontLinkObject?.title ?? "") 70 Text(this.frontLinkObject?.title ?? "")
@@ -71,6 +75,7 @@ export struct topicInfoView { @@ -71,6 +75,7 @@ export struct topicInfoView {
71 left: { anchor: "__container__", align: HorizontalAlign.Start }, 75 left: { anchor: "__container__", align: HorizontalAlign.Start },
72 bottom: { anchor: "txt_summary", align: VerticalAlign.Top } 76 bottom: { anchor: "txt_summary", align: VerticalAlign.Top }
73 }) 77 })
  78 + .margin({ left: 16, right: 16, bottom: 8 })
74 .id('txt_title') 79 .id('txt_title')
75 } 80 }
76 .width("100%") 81 .width("100%")
@@ -5,9 +5,6 @@ const TAG = 'MultiPictureDetailPageComponent'; @@ -5,9 +5,6 @@ const TAG = 'MultiPictureDetailPageComponent';
5 5
6 @Component 6 @Component
7 export struct MultiPictureDetailItemComponent { 7 export struct MultiPictureDetailItemComponent {
8 - private photoListLength: number = 1;  
9 - private index: number = 1;  
10 - private newsTitle: string = '';  
11 private MultiPictureDetailItem: PhotoListBean = {} as PhotoListBean 8 private MultiPictureDetailItem: PhotoListBean = {} as PhotoListBean
12 9
13 10
@@ -23,49 +20,11 @@ export struct MultiPictureDetailItemComponent { @@ -23,49 +20,11 @@ export struct MultiPictureDetailItemComponent {
23 .width('100%') 20 .width('100%')
24 .aspectRatio(this.MultiPictureDetailItem.width / this.MultiPictureDetailItem.height) 21 .aspectRatio(this.MultiPictureDetailItem.width / this.MultiPictureDetailItem.height)
25 .objectFit(ImageFit.Fill) 22 .objectFit(ImageFit.Fill)
  23 + .interpolation(ImageInterpolation.High)
26 } 24 }
27 .height('100%') 25 .height('100%')
28 .width('100%') 26 .width('100%')
29 27
30 -  
31 - Row() {  
32 - Flex({  
33 - direction: FlexDirection.Column,  
34 - justifyContent: FlexAlign.Start  
35 - }) {  
36 - Text() {  
37 - Span(`${this.index + 1}`).fontSize(24).fontFamily('PingFang SC-Medium').fontWeight(500).lineHeight(28)  
38 - Span(`/${this.photoListLength}`).fontSize(14).fontFamily('PingFang SC-Medium').fontWeight(500).lineHeight(19)  
39 - }.fontColor(Color.White).margin(4)  
40 -  
41 - Text(`${this.newsTitle}`).fontColor(Color.White).fontSize(16).fontFamily('PingFang SC-Semibold')  
42 - .fontWeight(600).lineHeight(24)  
43 - .margin ({  
44 - top: 4,  
45 - left: 0,  
46 - bottom: 4,  
47 - right: 0  
48 - })  
49 - Text(`${this.MultiPictureDetailItem.picDesc}`).fontColor(Color.White)  
50 - .fontSize(14).fontFamily('PingFang SC-Regular').fontWeight(400).lineHeight(22)  
51 - .textOverflow({ overflow: TextOverflow.Ellipsis })  
52 - .margin ({  
53 - top: 4,  
54 - left: 0,  
55 - bottom: 4,  
56 - right: 18  
57 - })  
58 - }  
59 - }  
60 - .width('100%')  
61 - .height(178)  
62 - .margin ({  
63 - top: 8,  
64 - left: 18,  
65 - bottom: 8,  
66 - right: 18  
67 - })  
68 -  
69 } 28 }
70 .backgroundColor(Color.Black) 29 .backgroundColor(Color.Black)
71 .width('100%') 30 .width('100%')
1 import { Logger } from 'wdKit'; 1 import { Logger } from 'wdKit';
2 -import { ContentDetailDTO, PhotoListBean } from 'wdBean'; 2 +import {
  3 + ContentDetailDTO,
  4 + PhotoListBean,
  5 + postInteractBrowsOperateParams,
  6 + postBatchAttentionStatusParams,
  7 + postInteractAccentionOperateParams
  8 +} from 'wdBean';
3 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; 9 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
4 import display from '@ohos.display'; 10 import display from '@ohos.display';
5 import font from '@ohos.font'; 11 import font from '@ohos.font';
6 import { OperRowListView } from './view/OperRowListView'; 12 import { OperRowListView } from './view/OperRowListView';
7 import { MultiPictureDetailItemComponent } from './MultiPictureDetailItemComponent'; 13 import { MultiPictureDetailItemComponent } from './MultiPictureDetailItemComponent';
  14 +import { DateTimeUtils } from 'wdKit/Index';
  15 +import { HttpUrlUtils } from 'wdNetwork/Index';
  16 +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
  17 +import { PageRepository } from '../repository/PageRepository';
8 18
9 const TAG = 'MultiPictureDetailPageComponent'; 19 const TAG = 'MultiPictureDetailPageComponent';
10 20
@@ -17,10 +27,11 @@ export struct MultiPictureDetailPageComponent { @@ -17,10 +27,11 @@ export struct MultiPictureDetailPageComponent {
17 private screenWidth: number = 0 27 private screenWidth: number = 0
18 private picWidth: number = 0 28 private picWidth: number = 0
19 @State picHeight: number = 0 29 @State picHeight: number = 0
20 - @State contentDetailData: ContentDetailDTO[] = [] as ContentDetailDTO[] 30 + @State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
21 @Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01' 31 @Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01'
22 private swiperController: SwiperController = new SwiperController() 32 private swiperController: SwiperController = new SwiperController()
23 @State swiperIndex: number = 0; 33 @State swiperIndex: number = 0;
  34 + @Provide followStatus: string = '0' // 关注状态
24 35
25 //watch监听页码回调 36 //watch监听页码回调
26 onCurrentPageNumUpdated(): void { 37 onCurrentPageNumUpdated(): void {
@@ -43,6 +54,10 @@ export struct MultiPictureDetailPageComponent { @@ -43,6 +54,10 @@ export struct MultiPictureDetailPageComponent {
43 familySrc: $rawfile('font/BebasNeue_Regular.otf') 54 familySrc: $rawfile('font/BebasNeue_Regular.otf')
44 }) 55 })
45 this.getContentDetailData() 56 this.getContentDetailData()
  57 + if (HttpUrlUtils.getUserId()) {
  58 + this.getInteractBrowsOperate()
  59 + this.getBatchAttentionStatus()
  60 + }
46 } 61 }
47 62
48 aboutToDisappear() { 63 aboutToDisappear() {
@@ -51,10 +66,10 @@ export struct MultiPictureDetailPageComponent { @@ -51,10 +66,10 @@ export struct MultiPictureDetailPageComponent {
51 66
52 build() { 67 build() {
53 RelativeContainer() { 68 RelativeContainer() {
54 - if (this.contentDetailData && this.contentDetailData.length > 0 && this.contentDetailData[0].photoList && this.contentDetailData[0].photoList?.length > 0) { 69 + if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) {
55 Swiper(this.swiperController) { 70 Swiper(this.swiperController) {
56 - ForEach(this.contentDetailData[0].photoList, (item: PhotoListBean, index: number) => {  
57 - MultiPictureDetailItemComponent({ photoListLength: this.contentDetailData[0].photoList?.length , index: index, newsTitle: this.contentDetailData[0].newsTitle, MultiPictureDetailItem: item }) 71 + ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => {
  72 + MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })
58 }) 73 })
59 } 74 }
60 .index(this.swiperIndex) 75 .index(this.swiperIndex)
@@ -73,16 +88,140 @@ export struct MultiPictureDetailPageComponent { @@ -73,16 +88,140 @@ export struct MultiPictureDetailPageComponent {
73 .onChange((index: number) => { 88 .onChange((index: number) => {
74 this.swiperIndex = index 89 this.swiperIndex = index
75 }) 90 })
  91 + if(this.contentDetailData.rmhPlatform == 1) {
  92 + Row() {
  93 + Row(){
  94 + Row({space: 8}) {
  95 + Image(this.contentDetailData?.rmhInfo?.rmhHeadUrl)
  96 + .borderRadius('50%')
  97 + .alt($r('app.media.picture_loading'))
  98 + .width(36)
  99 + .height(36)
  100 + .objectFit(ImageFit.Fill)
  101 + .interpolation(ImageInterpolation.High)
  102 + }
  103 + .width('13%')
  104 + .height('100%')
  105 + Row() {
  106 + Flex({
  107 + direction: FlexDirection.Column,
  108 + justifyContent: FlexAlign.Start
  109 + }) {
  110 + Text(`${this.contentDetailData?.rmhInfo?.rmhName}`)
  111 + .fontColor(Color.White)
  112 + .fontSize(14)
  113 + .fontFamily('PingFang PingFang SC-Medium')
  114 + .fontWeight(500)
  115 + .lineHeight(17)
  116 + .margin(0)
  117 + Text(`${this.contentDetailData?.rmhInfo?.rmhDesc}`)
  118 + .fontColor('#676767')
  119 + .fontSize(12)
  120 + .fontFamily('PingFang SC-Regular')
  121 + .fontWeight(400)
  122 + .lineHeight(14)
  123 + .textOverflow({ overflow: TextOverflow.Clip })
  124 + .margin (0)
  125 + }
  126 + }
  127 + .width('81%')
  128 + .height('100%')
  129 + }
  130 + .width('74.4%')
  131 + .height('100%')
  132 + .margin({
  133 + top: 0,
  134 + bottom: 0,
  135 + left: 16,
  136 + right:0
  137 + })
  138 + if(this.followStatus == '0') {
  139 + Row(){
  140 + Button('+关注', { type: ButtonType.Normal, stateEffect: true })
  141 + .borderRadius(4)
  142 + .backgroundColor('#ED2800')
  143 + .width(48)
  144 + .height(24)
  145 + .onClick(() => {
  146 + this.handleAccention()
  147 + })
  148 + .margin({
  149 + top: 10,
  150 + bottom: 10,
  151 + left: 16,
  152 + right:16
  153 + })
  154 + .fontSize(12)
  155 + .fontColor(Color.White)
  156 + }
  157 + .width('21.6%')
  158 + .height('100%')
  159 + }
  160 + }
  161 + .width('100%')
  162 + .height(44)
  163 + .alignRules({
  164 + top: { anchor: "e_swiper_content", align: VerticalAlign.Top },
  165 + middle: { anchor: "e_swiper_content", align: HorizontalAlign.Center }
  166 + })
  167 + .id('e_attention')
  168 + }
  169 +
  170 + Row() {
  171 + Flex({
  172 + direction: FlexDirection.Column,
  173 + justifyContent: FlexAlign.Start
  174 + }) {
  175 + Text() {
  176 + Span(`${this.swiperIndex + 1}`).fontSize(24).fontFamily('PingFang SC-Medium').fontWeight(500).lineHeight(28)
  177 + Span(`/${this.contentDetailData.photoList.length}`).fontSize(14).fontFamily('PingFang SC-Medium').fontWeight(500).lineHeight(19)
  178 + }.fontColor(Color.White).margin(4)
  179 +
  180 + Text(`${this.contentDetailData.newsTitle}`).fontColor(Color.White).fontSize(16).fontFamily('PingFang SC-Semibold')
  181 + .fontWeight(600).lineHeight(24)
  182 + .margin ({
  183 + top: 4,
  184 + left: 0,
  185 + bottom: 4,
  186 + right: 0
  187 + })
  188 + Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`).fontColor(Color.White)
  189 + .fontSize(14).fontFamily('PingFang SC-Regular').fontWeight(400).lineHeight(22)
  190 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  191 + .margin ({
  192 + top: 4,
  193 + left: 0,
  194 + bottom: 4,
  195 + right: 18
  196 + })
  197 + .maxLines(3)
  198 + }
  199 + }
  200 + .width('100%')
  201 + .height(178)
  202 + .margin ({
  203 + top: 8,
  204 + left: 18,
  205 + bottom: 8,
  206 + right: 18
  207 + })
  208 + .id('e_swiper_titles')
  209 + .alignRules({
  210 + bottom: { anchor: "e_swiper_content", align: VerticalAlign.Bottom },
  211 + middle: { anchor: "e_swiper_content", align: HorizontalAlign.Center }
  212 + })
  213 +
  214 + OperRowListView({
  215 + contentDetailData: this.contentDetailData,
  216 + })
  217 + .alignRules({
  218 + bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
  219 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
  220 + })
  221 + .width('100%').height(56).margin(16)
  222 + .border({ width: {top: 0.5}, color: '#FFFFFF' })
  223 + .id('e_oper_row')
76 } 224 }
77 - OperRowListView()  
78 - .alignRules({  
79 - bottom: { anchor: "__container__", align: VerticalAlign.Bottom },  
80 - middle: { anchor: "__container__", align: HorizontalAlign.Center }  
81 - })  
82 - .width('100%')  
83 - .height(56)  
84 - .border({ width: {top: 0.5}, color: '#FFFFFF' })  
85 - .id('e_oper_row')  
86 } 225 }
87 .width('100%') 226 .width('100%')
88 .height('100%') 227 .height('100%')
@@ -93,10 +232,70 @@ export struct MultiPictureDetailPageComponent { @@ -93,10 +232,70 @@ export struct MultiPictureDetailPageComponent {
93 private async getContentDetailData() { 232 private async getContentDetailData() {
94 try { 233 try {
95 let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType) 234 let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType)
96 - this.contentDetailData = data; 235 + this.contentDetailData = data?.[0];
97 Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`) 236 Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`)
98 } catch (exception) { 237 } catch (exception) {
99 238
100 } 239 }
101 } 240 }
  241 +
  242 + // 记录浏览历史
  243 + private getInteractBrowsOperate() {
  244 + try {
  245 + const params: postInteractBrowsOperateParams = {
  246 + delStatus: 0,
  247 + contentList: [{
  248 + browseTime: DateTimeUtils.getCurDate(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN),
  249 + contentId: this.contentDetailData?.newsId + '',
  250 + contentType: this.contentDetailData?.newsType || 0,
  251 + }]
  252 + }
  253 + MultiPictureDetailViewModel.getInteractBrowsOperate(params).then(res => {
  254 + console.log(TAG, '记录浏览历史==', JSON.stringify(res.data))
  255 + })
  256 + } catch (exception) {
  257 +
  258 + }
  259 + }
  260 +
  261 + // 已登录->批量查作品是否被号主关注
  262 + private async getBatchAttentionStatus() {
  263 + try {
  264 + const params: postBatchAttentionStatusParams = {
  265 + creatorIds: [{ creatorId: this.contentDetailData?.rmhInfo?.rmhId ?? '' }]
  266 + }
  267 + let data = await MultiPictureDetailViewModel.getBatchAttentionStatus(params)
  268 + this.followStatus = data[0]?.status;
  269 + Logger.info(TAG, `followStatus:${JSON.stringify(this.followStatus)}`)
  270 + } catch (exception) {
  271 +
  272 + }
  273 + }
  274 + /**
  275 + * 关注号主
  276 + */
  277 + handleAccention() {
  278 + // 未登录,跳转登录
  279 + if (!HttpUrlUtils.getUserId()) {
  280 + WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
  281 + return
  282 + }
  283 +
  284 + const params: postInteractAccentionOperateParams = {
  285 + attentionUserType: this.contentDetailData?.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号)
  286 + attentionUserId: this.contentDetailData?.rmhInfo?.userId || '', // 被关注用户号主id
  287 + attentionCreatorId: this.contentDetailData?.rmhInfo?.rmhId || '', // 被关注用户号主id
  288 + // userType: 1,
  289 + // userId: '1',
  290 + status: 1,
  291 + }
  292 + PageRepository.postInteractAccentionOperate(params).then(res => {
  293 + console.log(TAG, '关注号主==', JSON.stringify(res.data))
  294 + if (this.followStatus == '1') {
  295 + this.followStatus = '0'
  296 + } else {
  297 + this.followStatus = '1'
  298 + }
  299 + })
  300 + }
102 } 301 }
  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 +}
@@ -30,17 +30,18 @@ export default struct MinePageUserSimpleInfoUI { @@ -30,17 +30,18 @@ export default struct MinePageUserSimpleInfoUI {
30 build(){ 30 build(){
31 Row(){ 31 Row(){
32 //头像 32 //头像
33 - Stack({alignContent: Alignment.Center}){ 33 + Stack(){
34 Image(this.headPhotoUrl) 34 Image(this.headPhotoUrl)
35 .alt($r('app.media.default_head')) 35 .alt($r('app.media.default_head'))
36 .width('108lpx') 36 .width('108lpx')
37 .height('108lpx') 37 .height('108lpx')
38 - .objectFit(ImageFit.Auto) 38 + .objectFit(ImageFit.Cover)
39 .borderRadius(50) 39 .borderRadius(50)
40 Image(this.levelHead) 40 Image(this.levelHead)
41 .width('130lpx') 41 .width('130lpx')
42 .height('130lpx') 42 .height('130lpx')
43 - .objectFit(ImageFit.Auto) 43 + .objectFit(ImageFit.Cover)
  44 + .borderRadius(50)
44 }.width('130lpx') 45 }.width('130lpx')
45 .height('130lpx') 46 .height('130lpx')
46 .alignContent(Alignment.Center) 47 .alignContent(Alignment.Center)
@@ -80,7 +80,7 @@ export struct FollowFirstTabsComponent{ @@ -80,7 +80,7 @@ export struct FollowFirstTabsComponent{
80 this.currentIndex = index 80 this.currentIndex = index
81 }) 81 })
82 .width('100%') 82 .width('100%')
83 - .height('100%') 83 + .layoutWeight(1)
84 }.width('100%') 84 }.width('100%')
85 } 85 }
86 } 86 }
@@ -23,14 +23,14 @@ export struct FollowSecondTabsComponent{ @@ -23,14 +23,14 @@ export struct FollowSecondTabsComponent{
23 23
24 if(this.data != null){ 24 if(this.data != null){
25 if(this.data[this.firstIndex].children == null || this.data[this.firstIndex].children.length == 0){ 25 if(this.data[this.firstIndex].children == null || this.data[this.firstIndex].children.length == 0){
26 - FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].id}) 26 + FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].id}).layoutWeight(1)
27 }else{ 27 }else{
28 this.FollowSecondUI() 28 this.FollowSecondUI()
29 } 29 }
30 } 30 }
31 } 31 }
32 .width('100%') 32 .width('100%')
33 - .height('100%') 33 + .layoutWeight(1)
34 } 34 }
35 35
36 @Builder FollowSecondUI(){ 36 @Builder FollowSecondUI(){
@@ -128,7 +128,7 @@ export struct HomePageBottomComponent{ @@ -128,7 +128,7 @@ export struct HomePageBottomComponent{
128 List({ space: 3 }) { 128 List({ space: 3 }) {
129 LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => { 129 LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => {
130 ListItem() { 130 ListItem() {
131 - ChildCommentComponent({data: item}) 131 + ChildCommentComponent({data: item,isLastItem:index===this.data_comment.totalCount()-1})
132 } 132 }
133 .onClick(() => { 133 .onClick(() => {
134 }) 134 })
@@ -158,7 +158,7 @@ export struct HomePageBottomComponent{ @@ -158,7 +158,7 @@ export struct HomePageBottomComponent{
158 }) 158 })
159 } 159 }
160 } 160 }
161 - }.height('100%') 161 + }.layoutWeight(1)
162 .justifyContent(FlexAlign.Start) 162 .justifyContent(FlexAlign.Start)
163 .width('100%') 163 .width('100%')
164 } 164 }
@@ -334,6 +334,7 @@ struct ChildFollowComponent { @@ -334,6 +334,7 @@ struct ChildFollowComponent {
334 @Component 334 @Component
335 struct ChildCommentComponent { 335 struct ChildCommentComponent {
336 @ObjectLink data: CommentListItem 336 @ObjectLink data: CommentListItem
  337 + isLastItem: boolean = false
337 338
338 build() { 339 build() {
339 Column(){ 340 Column(){
@@ -408,10 +409,12 @@ struct ChildCommentComponent { @@ -408,10 +409,12 @@ struct ChildCommentComponent {
408 .backgroundColor($r('app.color.color_F5F5F5')) 409 .backgroundColor($r('app.color.color_F5F5F5'))
409 .margin({top:'19lpx',bottom:'31lpx'}) 410 .margin({top:'19lpx',bottom:'31lpx'})
410 411
411 - Divider().width('100%')  
412 - .height('12lpx')  
413 - .strokeWidth('12lpx')  
414 - .backgroundColor($r('app.color.color_F5F5F5')) 412 + if(!this.isLastItem){
  413 + Divider().width('100%')
  414 + .height('12lpx')
  415 + .strokeWidth('12lpx')
  416 + .color($r('app.color.color_F5F5F5'))
  417 + }
415 418
416 } 419 }
417 .justifyContent(FlexAlign.Center) 420 .justifyContent(FlexAlign.Center)
@@ -37,7 +37,7 @@ export struct OtherHomePageBottomCommentComponent{ @@ -37,7 +37,7 @@ export struct OtherHomePageBottomCommentComponent{
37 List({ space: 3 }) { 37 List({ space: 3 }) {
38 LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => { 38 LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => {
39 ListItem() { 39 ListItem() {
40 - ChildCommentComponent({data: item,levelHead:this.levelHead}) 40 + ChildCommentComponent({data: item,levelHead:this.levelHead,isLastItem:index===this.data_comment.totalCount()-1})
41 } 41 }
42 .onClick(() => { 42 .onClick(() => {
43 }) 43 })
@@ -68,6 +68,8 @@ export struct OtherHomePageBottomCommentComponent{ @@ -68,6 +68,8 @@ export struct OtherHomePageBottomCommentComponent{
68 } 68 }
69 } 69 }
70 .width('100%') 70 .width('100%')
  71 + .layoutWeight(1)
  72 + .justifyContent(FlexAlign.Start)
71 } 73 }
72 74
73 75
@@ -143,6 +145,7 @@ export struct OtherHomePageBottomCommentComponent{ @@ -143,6 +145,7 @@ export struct OtherHomePageBottomCommentComponent{
143 struct ChildCommentComponent { 145 struct ChildCommentComponent {
144 @ObjectLink data: CommentListItem 146 @ObjectLink data: CommentListItem
145 @Prop levelHead:string 147 @Prop levelHead:string
  148 + isLastItem: boolean = false
146 149
147 build() { 150 build() {
148 Column(){ 151 Column(){
@@ -234,10 +237,12 @@ struct ChildCommentComponent { @@ -234,10 +237,12 @@ struct ChildCommentComponent {
234 .backgroundColor($r('app.color.color_F5F5F5')) 237 .backgroundColor($r('app.color.color_F5F5F5'))
235 .margin({top:'19lpx',bottom:'31lpx'}) 238 .margin({top:'19lpx',bottom:'31lpx'})
236 239
237 - Divider().width('100%')  
238 - .height('12lpx')  
239 - .strokeWidth('12lpx')  
240 - .backgroundColor($r('app.color.color_F5F5F5')) 240 + if(!this.isLastItem){
  241 + Divider().width('100%')
  242 + .height('12lpx')
  243 + .strokeWidth('12lpx')
  244 + .color($r('app.color.color_F5F5F5'))
  245 + }
241 246
242 } 247 }
243 .justifyContent(FlexAlign.Center) 248 .justifyContent(FlexAlign.Center)
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 +}
@@ -25,7 +25,7 @@ export struct CarouselLayout01CardView { @@ -25,7 +25,7 @@ export struct CarouselLayout01CardView {
25 .width(CommonConstants.FULL_PARENT) 25 .width(CommonConstants.FULL_PARENT)
26 .height(CommonConstants.FULL_PARENT) 26 .height(CommonConstants.FULL_PARENT)
27 .objectFit(ImageFit.Cover) 27 .objectFit(ImageFit.Cover)
28 - .borderRadius($r("app.float.border_radius_6")) 28 + // .borderRadius($r("app.float.border_radius_6"))
29 .alignRules({ 29 .alignRules({
30 top: { anchor: '__container__', align: VerticalAlign.Top }, 30 top: { anchor: '__container__', align: VerticalAlign.Top },
31 left: { anchor: '__container__', align: HorizontalAlign.Start } 31 left: { anchor: '__container__', align: HorizontalAlign.Start }
@@ -45,7 +45,7 @@ export struct CarouselLayout01CardView { @@ -45,7 +45,7 @@ export struct CarouselLayout01CardView {
45 // .id('img_corner_top_Left') 45 // .id('img_corner_top_Left')
46 // } 46 // }
47 47
48 - Text(this.item.title) 48 + Text(this.item.newsTitle)
49 .width(CommonConstants.FULL_PARENT) 49 .width(CommonConstants.FULL_PARENT)
50 .height(39) 50 .height(39)
51 .padding({ left: 8, right: 69, bottom: 8 }) 51 .padding({ left: 8, right: 69, bottom: 8 })
1 import { TopNavDTO } from 'wdBean'; 1 import { TopNavDTO } from 'wdBean';
2 - 2 +import curves from '@ohos.curves';
3 3
4 const INDEX_SETTING_TITLE: string = '首页设置' 4 const INDEX_SETTING_TITLE: string = '首页设置'
5 const INDEX_SETTING_SUBTITLE: string = '将指定频道设置为首页' 5 const INDEX_SETTING_SUBTITLE: string = '将指定频道设置为首页'
6 const MY_CHANNEL: string = '我的频道' 6 const MY_CHANNEL: string = '我的频道'
7 const EDIT_TEXT: string = '编辑' 7 const EDIT_TEXT: string = '编辑'
8 const EDIT_DOWN: string = '完成' 8 const EDIT_DOWN: string = '完成'
  9 +const MY_CHANNEL_TIP1: string = '点击进入频道'
  10 +const MY_CHANNEL_TIP2: string = '拖动调整频道顺序'
9 const MORE_CHANNEL: string = '更多频道' 11 const MORE_CHANNEL: string = '更多频道'
10 const LOCAL_CHANNEL: string = '地方频道' 12 const LOCAL_CHANNEL: string = '地方频道'
11 13
  14 +
12 @CustomDialog 15 @CustomDialog
13 struct ChannelDialog { 16 struct ChannelDialog {
14 - @State indexSettingTabIndex: number = 1 17 + @State dragItem: number = -1
  18 + @State item: number = -1
  19 + private dragRefOffsetX: number = 0
  20 + private dragRefOffsetY: number = 0
  21 + @State offsetX: number = 0
  22 + @State offsetY: number = 0
  23 + private FIX_VP_X: number = 80
  24 + private FIX_VP_Y: number = 48
  25 + @State indexSettingTabIndex: number = 0
15 @State isEditIng: boolean = false 26 @State isEditIng: boolean = false
16 - @Link currentTopNavSelectedIndex : number  
17 - @Link myChannelList: Array<TopNavDTO>  
18 - @Link moreChannelList: Array<TopNavDTO>  
19 - @Link localChannelList: Array<TopNavDTO>  
20 - @Link indexSettingArray: Array<string>  
21 - @Link topNavList: Array<TopNavDTO>  
22 - myChannelItemEditHandle = (index: number): void => {  
23 - let item = this.myChannelList.splice(index, 1)[0]  
24 - console.info(`itemitemitem${JSON.stringify(item)}`)  
25 - if (item.moreChannel === '1') {  
26 - this.moreChannelList.unshift(item) 27 + @State currentTopNavSelectedItem: TopNavDTO = {} as TopNavDTO
  28 + @Link currentTopNavSelectedIndex: number
  29 + @Link myChannelList: TopNavDTO[]
  30 + @Link moreChannelList: TopNavDTO[]
  31 + @Link localChannelList: TopNavDTO[]
  32 + @Link indexSettingArray: string[]
  33 + controller?: CustomDialogController
  34 + confirm: (index: number) => void = () => {
  35 + }
  36 + changeChannelIndex: (index1: number, index2: number) => void = () => {
  37 + }
  38 + delChannelItem: (index: number) => void = () => {
  39 + }
  40 + addChannelItem: (item: TopNavDTO) => void = () => {
  41 + }
  42 +
  43 + aboutToAppear() {
  44 + this.currentTopNavSelectedItem = this.myChannelList[this.currentTopNavSelectedIndex]
  45 + }
  46 +
  47 + itemMove(index: number, newIndex: number): void {
  48 + let targetItem = this.myChannelList[newIndex]
  49 + if (!(targetItem?.headlinesOn === 1 || targetItem?.movePermitted === 0 || targetItem?.homeChannel === '1')) {
  50 + this.changeChannelIndex(index, newIndex)
  51 + if (index <= this.currentTopNavSelectedIndex || newIndex <= this.currentTopNavSelectedIndex) {
  52 + // this.currentTopNavSelectedIndex = this.myChannelList.findIndex(ele => ele.channelId === currentTopNavSelectedItem.channelId)
  53 + }
27 } 54 }
28 - if (item.localChannel === '1') {  
29 - this.localChannelList.unshift(item) 55 + }
  56 +
  57 + //向下滑
  58 + down(index: number): void {
  59 + console.info(`向下滑`)
  60 + this.offsetY -= this.FIX_VP_Y
  61 + this.dragRefOffsetY += this.FIX_VP_Y
  62 + this.itemMove(index, index + 4)
  63 + }
  64 +
  65 + //向下滑(右下角为空)
  66 + down2(index: number): void {
  67 + this.offsetY -= this.FIX_VP_Y
  68 + this.dragRefOffsetY += this.FIX_VP_Y
  69 + this.itemMove(index, index + 4)
  70 + }
  71 +
  72 + //向上滑
  73 + up(index: number): void {
  74 + console.info(`向上滑`)
  75 + this.offsetY += this.FIX_VP_Y
  76 + this.dragRefOffsetY -= this.FIX_VP_Y
  77 + this.itemMove(index, index - 4)
  78 + }
  79 +
  80 + //向左滑
  81 + left(index: number): void {
  82 + console.info(`向左滑`)
  83 + this.offsetX += this.FIX_VP_X
  84 + this.dragRefOffsetX -= this.FIX_VP_X
  85 + this.itemMove(index, index - 1)
  86 + }
  87 +
  88 + //向右滑
  89 + right(index: number): void {
  90 + console.info(`向右滑`)
  91 + this.offsetX -= this.FIX_VP_X
  92 + this.dragRefOffsetX += this.FIX_VP_X
  93 + this.itemMove(index, index + 1)
  94 + }
  95 +
  96 + //向右下滑
  97 + lowerRight(index: number): void {
  98 + console.info(`向右下滑`)
  99 + this.offsetX -= this.FIX_VP_X
  100 + this.dragRefOffsetX += this.FIX_VP_X
  101 + this.offsetY -= this.FIX_VP_Y
  102 + this.dragRefOffsetY += this.FIX_VP_Y
  103 + this.itemMove(index, index + 5)
  104 + }
  105 +
  106 + //向右上滑
  107 + upperRight(index: number): void {
  108 + console.info(`向右上滑`)
  109 + this.offsetX -= this.FIX_VP_X
  110 + this.dragRefOffsetX += this.FIX_VP_X
  111 + this.offsetY += this.FIX_VP_Y
  112 + this.dragRefOffsetY -= this.FIX_VP_Y
  113 + this.itemMove(index, index - 3)
  114 + }
  115 +
  116 + //向左下滑
  117 + lowerLeft(index: number): void {
  118 + console.info(`向左下滑`)
  119 + this.offsetX += this.FIX_VP_X
  120 + this.dragRefOffsetX -= this.FIX_VP_X
  121 + this.offsetY -= this.FIX_VP_Y
  122 + this.dragRefOffsetY += this.FIX_VP_Y
  123 + this.itemMove(index, index + 3)
  124 + }
  125 +
  126 + //向左上滑
  127 + upperLeft(index: number): void {
  128 + console.info(`向左上滑`)
  129 + this.offsetX += this.FIX_VP_X
  130 + this.dragRefOffsetX -= this.FIX_VP_X
  131 + this.offsetY += this.FIX_VP_Y
  132 + this.dragRefOffsetY -= this.FIX_VP_Y
  133 + this.itemMove(index, index - 5)
  134 + }
  135 +
  136 + handleAnimationTo(item: TopNavDTO, event: GestureEvent) {
  137 + let index = this.myChannelList.findIndex(ele => ele.num === this.dragItem)
  138 + if (!(item.headlinesOn === 1 || item.movePermitted === 0 || item.homeChannel === '1') && this.isEditIng) {
  139 + this.offsetY = event.offsetY - this.dragRefOffsetY
  140 + this.offsetX = event.offsetX - this.dragRefOffsetX
  141 + if (this.offsetY >= this.FIX_VP_Y / 2 && (this.offsetX <= 44 && this.offsetX >= -44)
  142 + ) {
  143 + //向下滑
  144 + this.down(index)
  145 + } else if (this.offsetY <= -this.FIX_VP_Y / 2 && (this.offsetX <= 44 && this.offsetX >= -44)
  146 + ) {
  147 + //向上滑
  148 + this.up(index)
  149 + } else if (this.offsetX >= this.FIX_VP_X / 2 && (this.offsetY <= 20 && this.offsetY >= -20)
  150 + ) {
  151 + //向右滑
  152 + this.right(index)
  153 + } else if (this.offsetX <= -this.FIX_VP_X / 2 && (this.offsetY <= 20 && this.offsetY >= -20)
  154 + ) {
  155 + //向左滑
  156 + this.left(index)
  157 + } else if (this.offsetX >= this.FIX_VP_X / 2 && this.offsetY >= this.FIX_VP_Y / 2
  158 + ) {
  159 + //向右下滑
  160 + this.lowerRight(index)
  161 + } else if (this.offsetX >= this.FIX_VP_X / 2 && this.offsetY <= -this.FIX_VP_Y / 2
  162 + ) {
  163 + //向右上滑
  164 + this.upperRight(index)
  165 + } else if (this.offsetX <= -this.FIX_VP_X / 2 && this.offsetY >= this.FIX_VP_Y / 2
  166 + ) {
  167 + //向左下滑
  168 + this.lowerLeft(index)
  169 + } else if (this.offsetX <= -this.FIX_VP_X / 2 && this.offsetY <= -this.FIX_VP_Y / 2
  170 + ) {
  171 + //向左上滑
  172 + this.upperLeft(index)
  173 + } else if (this.offsetX >= this.FIX_VP_X / 2 && this.offsetY >= this.FIX_VP_Y / 2
  174 + ) {
  175 + //向右下滑(右下角为空)
  176 + this.down2(index)
  177 + }
30 } 178 }
31 } 179 }
32 - controller?: CustomDialogController  
33 180
34 build() { 181 build() {
35 Column() { 182 Column() {
36 -  
37 Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { 183 Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
38 Image($r('app.media.icon_ren_min_ri_bao')) 184 Image($r('app.media.icon_ren_min_ri_bao'))
39 .width(72) 185 .width(72)
@@ -45,7 +191,7 @@ struct ChannelDialog { @@ -45,7 +191,7 @@ struct ChannelDialog {
45 }) 191 })
46 } 192 }
47 .width('100%') 193 .width('100%')
48 - .margin({ top: 30, bottom: 10 }) 194 + .padding({ bottom: 10 })
49 195
50 List() { 196 List() {
51 197
@@ -59,6 +205,7 @@ struct ChannelDialog { @@ -59,6 +205,7 @@ struct ChannelDialog {
59 Text(INDEX_SETTING_SUBTITLE) 205 Text(INDEX_SETTING_SUBTITLE)
60 .fontSize(12) 206 .fontSize(12)
61 .fontWeight(400) 207 .fontWeight(400)
  208 + .fontColor('#222222')
62 } 209 }
63 .width('100%') 210 .width('100%')
64 .margin({ top: 22, bottom: 16 }) 211 .margin({ top: 22, bottom: 16 })
@@ -68,16 +215,30 @@ struct ChannelDialog { @@ -68,16 +215,30 @@ struct ChannelDialog {
68 ListItem() { 215 ListItem() {
69 Flex({ justifyContent: FlexAlign.SpaceBetween }) { 216 Flex({ justifyContent: FlexAlign.SpaceBetween }) {
70 ForEach(this.indexSettingArray, (text: string, index: number) => { 217 ForEach(this.indexSettingArray, (text: string, index: number) => {
71 - Button(text, { type: ButtonType.Normal, stateEffect: false })  
72 - .width('48%')  
73 - .borderRadius(2)  
74 - .fontColor(index === this.indexSettingTabIndex ? '#ffffff' : '#ED2800')  
75 - .fontSize(16)  
76 - .fontWeight(400)  
77 - .backgroundColor(index === this.indexSettingTabIndex ? '#ED2800' : '#FDE9E5')  
78 - .onClick(() => {  
79 - this.indexSettingTabIndex = index  
80 - }) 218 + Stack() {
  219 + Image(this.indexSettingTabIndex === index ? $r('app.media.index_setting_button_active') : $r('app.media.index_setting_button'))
  220 + .objectFit(ImageFit.Auto)
  221 + .rotate({
  222 + angle: index === 1 ? 180 : 0
  223 + })
  224 + Row() {
  225 + if (index === 0) {
  226 + Image(this.indexSettingTabIndex === index ? $r('app.media.recommend_icon') : $r('app.media.recommend_icon_active'))
  227 + .width(20)
  228 + }
  229 + Text(text)
  230 + .textAlign(TextAlign.Center)
  231 + .fontSize(16)
  232 + .fontColor(index === this.indexSettingTabIndex ? '#ffffff' : '#ED2800')
  233 + }
  234 + .width('100%')
  235 + .justifyContent(FlexAlign.Center)
  236 + }
  237 + .alignContent(Alignment.Start)
  238 + .height(36)
  239 + .onClick(() => {
  240 + this.indexSettingTabIndex = index
  241 + })
81 }) 242 })
82 } 243 }
83 .height(36) 244 .height(36)
@@ -86,9 +247,17 @@ struct ChannelDialog { @@ -86,9 +247,17 @@ struct ChannelDialog {
86 247
87 ListItem() { 248 ListItem() {
88 Row() { 249 Row() {
89 - Text(MY_CHANNEL)  
90 - .fontSize(16)  
91 - .fontWeight(600) 250 + Row() {
  251 + Text(MY_CHANNEL)
  252 + .fontSize(16)
  253 + .fontWeight(600)
  254 + .margin({ right: 4 })
  255 + Text(!this.isEditIng ? MY_CHANNEL_TIP1 : MY_CHANNEL_TIP2)
  256 + .fontSize(12)
  257 + .fontWeight(400)
  258 + .fontColor('#222222')
  259 + }
  260 +
92 Text(this.isEditIng ? EDIT_DOWN : EDIT_TEXT) 261 Text(this.isEditIng ? EDIT_DOWN : EDIT_TEXT)
93 .fontSize(14) 262 .fontSize(14)
94 .fontColor('#ED2800') 263 .fontColor('#ED2800')
@@ -101,14 +270,15 @@ struct ChannelDialog { @@ -101,14 +270,15 @@ struct ChannelDialog {
101 .margin({ bottom: 12 }) 270 .margin({ bottom: 12 })
102 } 271 }
103 272
  273 + // 我的频道列表
104 ListItem() { 274 ListItem() {
105 - GridRow({ columns: 4, gutter: 10 }) { 275 + Grid() {
106 ForEach(this.myChannelList, (item: TopNavDTO, index: number) => { 276 ForEach(this.myChannelList, (item: TopNavDTO, index: number) => {
107 - GridCol() { 277 + GridItem() {
108 Row() { 278 Row() {
109 Text(item.name) 279 Text(item.name)
110 .fontSize(14) 280 .fontSize(14)
111 - .fontColor( this.currentTopNavSelectedIndex === index ? '#ED2800' : (item.homeChannel === '1' ? '#999999' : '#222222')) 281 + .fontColor(this.currentTopNavSelectedItem.channelId === item.channelId ? '#ED2800' : (item.homeChannel === '1' || item.movePermitted === 0 ? '#999999' : '#222222'))
112 282
113 if (this.isEditIng && item.myChannel !== '1') { 283 if (this.isEditIng && item.myChannel !== '1') {
114 Image($r('app.media.icon_audio_close')) 284 Image($r('app.media.icon_audio_close'))
@@ -119,30 +289,63 @@ struct ChannelDialog { @@ -119,30 +289,63 @@ struct ChannelDialog {
119 .width('100%') 289 .width('100%')
120 .height('100%') 290 .height('100%')
121 .justifyContent(FlexAlign.Center) 291 .justifyContent(FlexAlign.Center)
122 - .backgroundColor(item.homeChannel === '1' ? '#F5F5F5' : '') 292 + .backgroundColor(item.homeChannel === '1' || item.movePermitted === 0 ? '#F5F5F5' : '#ffffff')
123 .onClick(() => { 293 .onClick(() => {
124 if (this.isEditIng) { 294 if (this.isEditIng) {
125 - if(item.myChannel !== '1'){  
126 - this.myChannelItemEditHandle(index) 295 + if (item.myChannel !== '1') {
  296 + this.delChannelItem(index)
127 } 297 }
128 - }else{ 298 + } else {
  299 + this.confirm(index)
129 this.controller?.close() 300 this.controller?.close()
130 } 301 }
131 }) 302 })
132 } 303 }
133 - .width(80) 304 + .width('23%')
134 .height(40) 305 .height(40)
135 .border({ 306 .border({
136 width: item.homeChannel === '1' ? 0 : 1, 307 width: item.homeChannel === '1' ? 0 : 1,
137 color: '#EDEDED', 308 color: '#EDEDED',
138 radius: 3 309 radius: 3
139 }) 310 })
  311 + .zIndex(this.dragItem == item.num ? 1 : 0)
  312 + .translate(this.dragItem == item.num ? { x: this.offsetX, y: this.offsetY } : { x: 0, y: 0 })
  313 + .gesture(
  314 + GestureGroup(GestureMode.Sequence,
  315 + PanGesture({ fingers: 1, direction: null, distance: 0 })
  316 + .onActionStart((event: GestureEvent) => {
  317 + this.dragItem = item.num
  318 + this.dragRefOffsetX = 0
  319 + this.dragRefOffsetY = 0
  320 + })
  321 + .onActionUpdate((event: GestureEvent) => {
  322 + animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
  323 + this.handleAnimationTo(item, event)
  324 + })
  325 + })
  326 + .onActionEnd((event: GestureEvent) => {
  327 + animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
  328 + this.dragItem = -1
  329 + })
  330 + })
  331 + )
  332 + .onCancel(() => {
  333 + animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
  334 + this.dragItem = -1
  335 + })
  336 + }))
  337 +
140 }, (item: TopNavDTO) => JSON.stringify(item)) 338 }, (item: TopNavDTO) => JSON.stringify(item))
141 } 339 }
142 .width('100%') 340 .width('100%')
143 .margin({ bottom: 24 }) 341 .margin({ bottom: 24 })
  342 + .columnsTemplate('1fr 1fr 1fr 1fr')
  343 + .columnsGap(8)
  344 + .rowsGap(8)
  345 + .height(Math.ceil(this.myChannelList.length / 4) * 48)
144 } 346 }
145 347
  348 + //更多频道列表
146 ListItem() { 349 ListItem() {
147 Column() { 350 Column() {
148 if (this.moreChannelList.length > 0) { 351 if (this.moreChannelList.length > 0) {
@@ -168,7 +371,7 @@ struct ChannelDialog { @@ -168,7 +371,7 @@ struct ChannelDialog {
168 .width('100%').height('100%') 371 .width('100%').height('100%')
169 .justifyContent(FlexAlign.Center) 372 .justifyContent(FlexAlign.Center)
170 .onClick(() => { 373 .onClick(() => {
171 - this.myChannelList.push(this.moreChannelList.splice(index, 1)[0]) 374 + this.addChannelItem(this.moreChannelList.splice(index, 1)[0])
172 }) 375 })
173 } 376 }
174 .width(80) 377 .width(80)
@@ -186,6 +389,7 @@ struct ChannelDialog { @@ -186,6 +389,7 @@ struct ChannelDialog {
186 .width('100%') 389 .width('100%')
187 } 390 }
188 391
  392 + //本地频道列表
189 ListItem() { 393 ListItem() {
190 Column() { 394 Column() {
191 if (this.localChannelList.length > 0) { 395 if (this.localChannelList.length > 0) {
@@ -211,7 +415,7 @@ struct ChannelDialog { @@ -211,7 +415,7 @@ struct ChannelDialog {
211 .width('100%').height('100%') 415 .width('100%').height('100%')
212 .justifyContent(FlexAlign.Center) 416 .justifyContent(FlexAlign.Center)
213 .onClick(() => { 417 .onClick(() => {
214 - this.myChannelList.push(this.localChannelList.splice(index, 1)[0]) 418 + this.addChannelItem(this.localChannelList.splice(index, 1)[0])
215 }) 419 })
216 } 420 }
217 .width(80) 421 .width(80)
@@ -229,311 +433,1634 @@ struct ChannelDialog { @@ -229,311 +433,1634 @@ struct ChannelDialog {
229 } 433 }
230 434
231 }.width('100%').height('100%') 435 }.width('100%').height('100%')
232 -  
233 } 436 }
234 - .padding(16) 437 + .padding({ top: 40, right: 15, bottom: 20, left: 15 })
235 .backgroundColor('#ffffff') 438 .backgroundColor('#ffffff')
236 } 439 }
237 -  
238 - onTopNavigationDataUpdated() {  
239 - }  
240 } 440 }
241 441
242 -@Entry 442 +// @Entry
243 @Component 443 @Component
244 struct ChannelSubscriptionLayout { 444 struct ChannelSubscriptionLayout {
  445 + @State indexSettingArray: string [] = ['推荐', '热点']
245 //当前选中的频道 446 //当前选中的频道
246 - @Prop currentTopNavSelectedIndex?: number;  
247 -  
248 - @State indexSettingArray: Array<string> = ['推荐', '热点']  
249 - @State myChannelList: Array<TopNavDTO> = [  
250 - // {  
251 - // channelId: 0,  
252 - // channelStyle: 1,  
253 - // channelType: 1,  
254 - // defaultPermitted: 1,  
255 - // delPermitted: 1,  
256 - // fontCColor: '#000000',  
257 - // fontColor: '#000000',  
258 - // headlinesOn: 0,  
259 - // homeChannel: '1',  
260 - // iconCUrl: '',  
261 - // iconCUrlSize: '',  
262 - // iconUrl: '',  
263 - // iconUrlSize: '',  
264 - // localChannel: '',  
265 - // moreChannel: '',  
266 - // movePermitted: 0,  
267 - // myChannel: '1',  
268 - // name: '推荐',  
269 - // num: 0,  
270 - // pageId: 21212,  
271 - // pageType: '',  
272 - // underlineCColor: ''  
273 - // },  
274 - // {  
275 - // channelId: 1,  
276 - // channelStyle: 1,  
277 - // channelType: 1,  
278 - // defaultPermitted: 1,  
279 - // delPermitted: 1,  
280 - // fontCColor: '#000000',  
281 - // fontColor: '#000000',  
282 - // headlinesOn: 0,  
283 - // homeChannel: '1',  
284 - // iconCUrl: '',  
285 - // iconCUrlSize: '',  
286 - // iconUrl: '',  
287 - // iconUrlSize: '',  
288 - // localChannel: '',  
289 - // moreChannel: '',  
290 - // movePermitted: 0,  
291 - // myChannel: '1',  
292 - // name: '热点',  
293 - // num: 0,  
294 - // pageId: 21212,  
295 - // pageType: '',  
296 - // underlineCColor: ''  
297 - // },  
298 - // {  
299 - // channelId: 2,  
300 - // channelStyle: 1,  
301 - // channelType: 1,  
302 - // defaultPermitted: 1,  
303 - // delPermitted: 1,  
304 - // fontCColor: '#000000',  
305 - // fontColor: '#000000',  
306 - // headlinesOn: 0,  
307 - // homeChannel: '',  
308 - // iconCUrl: '',  
309 - // iconCUrlSize: '',  
310 - // iconUrl: '',  
311 - // iconUrlSize: '',  
312 - // localChannel: '',  
313 - // moreChannel: '',  
314 - // movePermitted: 0,  
315 - // myChannel: '1',  
316 - // name: '视频',  
317 - // num: 0,  
318 - // pageId: 21212,  
319 - // pageType: '',  
320 - // underlineCColor: ''  
321 - // },  
322 - // {  
323 - // channelId: 3,  
324 - // channelStyle: 1,  
325 - // channelType: 1,  
326 - // defaultPermitted: 1,  
327 - // delPermitted: 1,  
328 - // fontCColor: '#000000',  
329 - // fontColor: '#000000',  
330 - // headlinesOn: 0,  
331 - // homeChannel: '',  
332 - // iconCUrl: '',  
333 - // iconCUrlSize: '',  
334 - // iconUrl: '',  
335 - // iconUrlSize: '',  
336 - // localChannel: '',  
337 - // moreChannel: '',  
338 - // movePermitted: 0,  
339 - // myChannel: '1',  
340 - // name: '云课堂',  
341 - // num: 0,  
342 - // pageId: 21212,  
343 - // pageType: '',  
344 - // underlineCColor: ''  
345 - // },  
346 - ]  
347 - @State moreChannelList: Array<TopNavDTO> = [  
348 - // {  
349 - // channelId: 4,  
350 - // channelStyle: 1,  
351 - // channelType: 1,  
352 - // defaultPermitted: 1,  
353 - // delPermitted: 1,  
354 - // fontCColor: '#000000',  
355 - // fontColor: '#000000',  
356 - // headlinesOn: 0,  
357 - // homeChannel: '',  
358 - // iconCUrl: '',  
359 - // iconCUrlSize: '',  
360 - // iconUrl: '',  
361 - // iconUrlSize: '',  
362 - // localChannel: '',  
363 - // moreChannel: '1',  
364 - // movePermitted: 0,  
365 - // myChannel: '',  
366 - // name: '房产',  
367 - // num: 0,  
368 - // pageId: 21212,  
369 - // pageType: '',  
370 - // underlineCColor: ''  
371 - // },  
372 - // {  
373 - // channelId: 5,  
374 - // channelStyle: 1,  
375 - // channelType: 1,  
376 - // defaultPermitted: 1,  
377 - // delPermitted: 1,  
378 - // fontCColor: '#000000',  
379 - // fontColor: '#000000',  
380 - // headlinesOn: 0,  
381 - // homeChannel: '',  
382 - // iconCUrl: '',  
383 - // iconCUrlSize: '',  
384 - // iconUrl: '',  
385 - // iconUrlSize: '',  
386 - // localChannel: '',  
387 - // moreChannel: '1',  
388 - // movePermitted: 0,  
389 - // myChannel: '',  
390 - // name: '生态',  
391 - // num: 0,  
392 - // pageId: 21212,  
393 - // pageType: '',  
394 - // underlineCColor: ''  
395 - // },  
396 - // {  
397 - // channelId: 6,  
398 - // channelStyle: 1,  
399 - // channelType: 1,  
400 - // defaultPermitted: 1,  
401 - // delPermitted: 1,  
402 - // fontCColor: '#000000',  
403 - // fontColor: '#000000',  
404 - // headlinesOn: 0,  
405 - // homeChannel: '',  
406 - // iconCUrl: '',  
407 - // iconCUrlSize: '',  
408 - // iconUrl: '',  
409 - // iconUrlSize: '',  
410 - // localChannel: '',  
411 - // moreChannel: '1',  
412 - // movePermitted: 0,  
413 - // myChannel: '',  
414 - // name: '健康',  
415 - // num: 0,  
416 - // pageId: 21212,  
417 - // pageType: '',  
418 - // underlineCColor: ''  
419 - // }  
420 - ]  
421 - @State localChannelList: Array<TopNavDTO> = [  
422 - // {  
423 - // channelId: 7,  
424 - // channelStyle: 1,  
425 - // channelType: 1,  
426 - // defaultPermitted: 1,  
427 - // delPermitted: 1,  
428 - // fontCColor: '#000000',  
429 - // fontColor: '#000000',  
430 - // headlinesOn: 0,  
431 - // homeChannel: '',  
432 - // iconCUrl: '',  
433 - // iconCUrlSize: '',  
434 - // iconUrl: '',  
435 - // iconUrlSize: '',  
436 - // localChannel: '1',  
437 - // moreChannel: '',  
438 - // movePermitted: 0,  
439 - // myChannel: '',  
440 - // name: '北京',  
441 - // num: 0,  
442 - // pageId: 21212,  
443 - // pageType: '',  
444 - // underlineCColor: ''  
445 - // },  
446 - // {  
447 - // channelId: 8,  
448 - // channelStyle: 1,  
449 - // channelType: 1,  
450 - // defaultPermitted: 1,  
451 - // delPermitted: 1,  
452 - // fontCColor: '#000000',  
453 - // fontColor: '#000000',  
454 - // headlinesOn: 0,  
455 - // homeChannel: '',  
456 - // iconCUrl: '',  
457 - // iconCUrlSize: '',  
458 - // iconUrl: '',  
459 - // iconUrlSize: '',  
460 - // localChannel: '1',  
461 - // moreChannel: '',  
462 - // movePermitted: 0,  
463 - // myChannel: '',  
464 - // name: '上海',  
465 - // num: 0,  
466 - // pageId: 21212,  
467 - // pageType: '',  
468 - // underlineCColor: ''  
469 - // },  
470 - // {  
471 - // channelId: 9,  
472 - // channelStyle: 1,  
473 - // channelType: 1,  
474 - // defaultPermitted: 1,  
475 - // delPermitted: 1,  
476 - // fontCColor: '#000000',  
477 - // fontColor: '#000000',  
478 - // headlinesOn: 0,  
479 - // homeChannel: '',  
480 - // iconCUrl: '',  
481 - // iconCUrlSize: '',  
482 - // iconUrl: '',  
483 - // iconUrlSize: '',  
484 - // localChannel: '1',  
485 - // moreChannel: '',  
486 - // movePermitted: 0,  
487 - // myChannel: '',  
488 - // name: '江苏',  
489 - // num: 0,  
490 - // pageId: 21212,  
491 - // pageType: '',  
492 - // underlineCColor: ''  
493 - // }  
494 - ]  
495 - // 顶导数据  
496 - @State topNavList: TopNavDTO[] = [] 447 + @Link currentTopNavSelectedIndex: number;
  448 + @Link myChannelList: TopNavDTO []
  449 + @Link moreChannelList: TopNavDTO []
  450 + @Link localChannelList: TopNavDTO []
  451 + @Link @Watch('onChannelIdsUpdate') channelIds: number []
  452 + changeTab: (index: number) => void = () => {
  453 + }
  454 + //频道弹窗点击切换频道
  455 + onAccept = (index: number) => {
  456 + this.changeTab(index)
  457 + }
  458 + //交换我的频道数组中的位置
  459 + changeChannelIndex = (index1: number, index2: number) => {
  460 + let tmp = this.myChannelList.splice(index1, 1)
  461 + let channelIdTmp = this.channelIds.splice(index1, 1)
  462 + this.myChannelList.splice(index2, 0, tmp[0])
  463 + this.channelIds.splice(index2, 0, channelIdTmp[0])
  464 + }
  465 + //删除频道
  466 + delChannelItem = (index: number) => {
  467 + let item = this.myChannelList.splice(index, 1)[0]
  468 + this.channelIds.splice(index, 1)
  469 + if (item.moreChannel === '1') {
  470 + this.moreChannelList.unshift(item)
  471 + }
  472 + if (item.localChannel === '1') {
  473 + this.localChannelList.unshift(item)
  474 + }
  475 + }
  476 + // 添加频道
  477 + addChannelItem = (item: TopNavDTO) => {
  478 + this.channelIds.push(item.channelId)
  479 + this.myChannelList.push(item)
  480 + }
  481 + // @State currentTopNavSelectedIndex: number = 0
  482 + // @State topNavList: TopNavDTO [] = [
  483 + // {
  484 + // channelId: 2001,
  485 + // channelStrategy: 1,
  486 + // channelStyle: 2,
  487 + // channelType: 1,
  488 + // defaultPermitted: 1,
  489 + // delPermitted: 0,
  490 + // fontCColor: "#FFFFFF",
  491 + // fontColor: "#F9AB99",
  492 + // headlinesOn: 0,
  493 + // homeChannel: "0",
  494 + // iconCUrl: "",
  495 + // iconCUrlSize: "",
  496 + // iconUrl: "",
  497 + // iconUrlSize: "",
  498 + // localChannel: "0",
  499 + // moreChannel: "0",
  500 + // movePermitted: 0,
  501 + // myChannel: "0",
  502 + // name: "推荐",
  503 + // num: 1,
  504 + // pageId: 20011,
  505 + // pageType: "",
  506 + // underlineCColor: ""
  507 + // },
  508 + // {
  509 + // channelId: 2002,
  510 + // channelStrategy: 2,
  511 + // channelStyle: 2,
  512 + // channelType: 1,
  513 + // defaultPermitted: 1,
  514 + // delPermitted: 0,
  515 + // fontCColor: "#FFFFFF",
  516 + // fontColor: "#F9AB99",
  517 + // headlinesOn: 0,
  518 + // homeChannel: "0",
  519 + // iconCUrl: "",
  520 + // iconCUrlSize: "",
  521 + // iconUrl: "",
  522 + // iconUrlSize: "",
  523 + // localChannel: "0",
  524 + // moreChannel: "0",
  525 + // movePermitted: 0,
  526 + // myChannel: "0",
  527 + // name: "热点",
  528 + // num: 2,
  529 + // pageId: 20012,
  530 + // pageType: "",
  531 + // underlineCColor: ""
  532 + // },
  533 + // {
  534 + // channelId: 2003,
  535 + // channelStrategy: 2,
  536 + // channelStyle: 2,
  537 + // channelType: 1,
  538 + // defaultPermitted: 0,
  539 + // delPermitted: 0,
  540 + // fontCColor: "#FFFFFF",
  541 + // fontColor: "#F9AB99",
  542 + // headlinesOn: 0,
  543 + // homeChannel: "0",
  544 + // iconCUrl: "",
  545 + // iconCUrlSize: "",
  546 + // iconUrl: "",
  547 + // iconUrlSize: "",
  548 + // localChannel: "0",
  549 + // moreChannel: "0",
  550 + // movePermitted: 1,
  551 + // myChannel: "0",
  552 + // name: "锐评",
  553 + // num: 3,
  554 + // pageId: 20013,
  555 + // pageType: "",
  556 + // underlineCColor: ""
  557 + // },
  558 + // {
  559 + // channelId: 2066,
  560 + // channelStrategy: 2,
  561 + // channelStyle: 3,
  562 + // channelType: 1,
  563 + // defaultPermitted: 0,
  564 + // delPermitted: 1,
  565 + // fontCColor: "#FFFFFF",
  566 + // fontColor: "#F9AB99",
  567 + // headlinesOn: 0,
  568 + // homeChannel: "0",
  569 + // iconCUrl: "",
  570 + // iconCUrlSize: "",
  571 + // iconUrl: "",
  572 + // iconUrlSize: "",
  573 + // localChannel: "0",
  574 + // moreChannel: "0",
  575 + // movePermitted: 1,
  576 + // myChannel: "0",
  577 + // name: "播报",
  578 + // num: 4,
  579 + // pageId: 21003,
  580 + // pageType: "",
  581 + // underlineCColor: ""
  582 + // },
  583 + // {
  584 + // channelId: 2006,
  585 + // channelStrategy: 2,
  586 + // channelStyle: 3,
  587 + // channelType: 1,
  588 + // defaultPermitted: 0,
  589 + // delPermitted: 0,
  590 + // fontCColor: "#FFFFFF",
  591 + // fontColor: "#F9AB99",
  592 + // headlinesOn: 0,
  593 + // homeChannel: "0",
  594 + // iconCUrl: "",
  595 + // iconCUrlSize: "",
  596 + // iconUrl: "",
  597 + // iconUrlSize: "",
  598 + // localChannel: "0",
  599 + // moreChannel: "0",
  600 + // movePermitted: 1,
  601 + // myChannel: "0",
  602 + // name: "版面",
  603 + // num: 5,
  604 + // pageId: 20016,
  605 + // pageType: "",
  606 + // underlineCColor: ""
  607 + // },
  608 + // {
  609 + // channelId: 2011,
  610 + // channelStrategy: 2,
  611 + // channelStyle: 2,
  612 + // channelType: 1,
  613 + // defaultPermitted: 0,
  614 + // delPermitted: 1,
  615 + // fontCColor: "#FFFFFF",
  616 + // fontColor: "#F9AB99",
  617 + // headlinesOn: 0,
  618 + // homeChannel: "0",
  619 + // iconCUrl: "",
  620 + // iconCUrlSize: "",
  621 + // iconUrl: "",
  622 + // iconUrlSize: "",
  623 + // localChannel: "0",
  624 + // moreChannel: "0",
  625 + // movePermitted: 1,
  626 + // myChannel: "0",
  627 + // name: "体育",
  628 + // num: 6,
  629 + // pageId: 20021,
  630 + // pageType: "",
  631 + // underlineCColor: ""
  632 + // },
  633 + // {
  634 + // channelId: 2020,
  635 + // channelStrategy: 1,
  636 + // channelStyle: 2,
  637 + // channelType: 1,
  638 + // defaultPermitted: 0,
  639 + // delPermitted: 1,
  640 + // fontCColor: "#FFFFFF",
  641 + // fontColor: "#F9AB99",
  642 + // headlinesOn: 0,
  643 + // homeChannel: "0",
  644 + // iconCUrl: "",
  645 + // iconCUrlSize: "",
  646 + // iconUrl: "",
  647 + // iconUrlSize: "",
  648 + // localChannel: "0",
  649 + // moreChannel: "0",
  650 + // movePermitted: 1,
  651 + // myChannel: "0",
  652 + // name: "国际",
  653 + // num: 7,
  654 + // pageId: 20030,
  655 + // pageType: "",
  656 + // underlineCColor: ""
  657 + // },
  658 + // {
  659 + // channelId: 2063,
  660 + // channelStrategy: 2,
  661 + // channelStyle: 2,
  662 + // channelType: 1,
  663 + // defaultPermitted: 0,
  664 + // delPermitted: 0,
  665 + // fontCColor: "#FFFFFF",
  666 + // fontColor: "#F9AB99",
  667 + // headlinesOn: 0,
  668 + // homeChannel: "0",
  669 + // iconCUrl: "",
  670 + // iconCUrlSize: "",
  671 + // iconUrl: "",
  672 + // iconUrlSize: "",
  673 + // localChannel: "0",
  674 + // moreChannel: "0",
  675 + // movePermitted: 0,
  676 + // myChannel: "0",
  677 + // name: "两会",
  678 + // num: 8,
  679 + // pageId: 21000,
  680 + // pageType: "",
  681 + // underlineCColor: ""
  682 + // },
  683 + // {
  684 + // channelId: 2072,
  685 + // channelStrategy: 2,
  686 + // channelStyle: 2,
  687 + // channelType: 1,
  688 + // defaultPermitted: 0,
  689 + // delPermitted: 0,
  690 + // fontCColor: "#FFFFFF",
  691 + // fontColor: "#F9AB99",
  692 + // headlinesOn: 0,
  693 + // homeChannel: "0",
  694 + // iconCUrl: "",
  695 + // iconCUrlSize: "",
  696 + // iconUrl: "",
  697 + // iconUrlSize: "",
  698 + // localChannel: "0",
  699 + // moreChannel: "0",
  700 + // movePermitted: 0,
  701 + // myChannel: "0",
  702 + // name: "亚运",
  703 + // num: 9,
  704 + // pageId: 21009,
  705 + // pageType: "",
  706 + // underlineCColor: ""
  707 + // },
  708 + // {
  709 + // channelId: 2015,
  710 + // channelStrategy: 1,
  711 + // channelStyle: 2,
  712 + // channelType: 1,
  713 + // defaultPermitted: 0,
  714 + // delPermitted: 1,
  715 + // fontCColor: "#FFFFFF",
  716 + // fontColor: "#F9AB99",
  717 + // headlinesOn: 0,
  718 + // homeChannel: "0",
  719 + // iconCUrl: "",
  720 + // iconCUrlSize: "",
  721 + // iconUrl: "",
  722 + // iconUrlSize: "",
  723 + // localChannel: "0",
  724 + // moreChannel: "0",
  725 + // movePermitted: 1,
  726 + // myChannel: "0",
  727 + // name: "科技",
  728 + // num: 10,
  729 + // pageId: 20025,
  730 + // pageType: "",
  731 + // underlineCColor: ""
  732 + // },
  733 + // {
  734 + // channelId: 2004,
  735 + // channelStrategy: 2,
  736 + // channelStyle: 2,
  737 + // channelType: 1,
  738 + // defaultPermitted: 0,
  739 + // delPermitted: 0,
  740 + // fontCColor: "#FFFFFF",
  741 + // fontColor: "#F9AB99",
  742 + // headlinesOn: 0,
  743 + // homeChannel: "0",
  744 + // iconCUrl: "",
  745 + // iconCUrlSize: "",
  746 + // iconUrl: "",
  747 + // iconUrlSize: "",
  748 + // localChannel: "0",
  749 + // moreChannel: "0",
  750 + // movePermitted: 1,
  751 + // myChannel: "0",
  752 + // name: "云课堂",
  753 + // num: 11,
  754 + // pageId: 20014,
  755 + // pageType: "",
  756 + // underlineCColor: ""
  757 + // },
  758 + // {
  759 + // channelId: 2005,
  760 + // channelStrategy: 2,
  761 + // channelStyle: 2,
  762 + // channelType: 1,
  763 + // defaultPermitted: 0,
  764 + // delPermitted: 0,
  765 + // fontCColor: "#FFFFFF",
  766 + // fontColor: "#F9AB99",
  767 + // headlinesOn: 0,
  768 + // homeChannel: "0",
  769 + // iconCUrl: "",
  770 + // iconCUrlSize: "",
  771 + // iconUrl: "",
  772 + // iconUrlSize: "",
  773 + // localChannel: "0",
  774 + // moreChannel: "0",
  775 + // movePermitted: 1,
  776 + // myChannel: "0",
  777 + // name: "文件",
  778 + // num: 12,
  779 + // pageId: 20015,
  780 + // pageType: "",
  781 + // underlineCColor: ""
  782 + // },
  783 + // {
  784 + // channelId: 2007,
  785 + // channelStrategy: 1,
  786 + // channelStyle: 2,
  787 + // channelType: 1,
  788 + // defaultPermitted: 0,
  789 + // delPermitted: 0,
  790 + // fontCColor: "#FFFFFF",
  791 + // fontColor: "#F9AB99",
  792 + // headlinesOn: 0,
  793 + // homeChannel: "0",
  794 + // iconCUrl: "",
  795 + // iconCUrlSize: "",
  796 + // iconUrl: "",
  797 + // iconUrlSize: "",
  798 + // localChannel: "0",
  799 + // moreChannel: "0",
  800 + // movePermitted: 1,
  801 + // myChannel: "0",
  802 + // name: "镜头",
  803 + // num: 13,
  804 + // pageId: 20017,
  805 + // pageType: "",
  806 + // underlineCColor: ""
  807 + // },
  808 + // {
  809 + // channelId: 2008,
  810 + // channelStrategy: 2,
  811 + // channelStyle: 2,
  812 + // channelType: 1,
  813 + // defaultPermitted: 0,
  814 + // delPermitted: 0,
  815 + // fontCColor: "#FFFFFF",
  816 + // fontColor: "#F9AB99",
  817 + // headlinesOn: 0,
  818 + // homeChannel: "0",
  819 + // iconCUrl: "",
  820 + // iconCUrlSize: "",
  821 + // iconUrl: "",
  822 + // iconUrlSize: "",
  823 + // localChannel: "0",
  824 + // moreChannel: "0",
  825 + // movePermitted: 1,
  826 + // myChannel: "0",
  827 + // name: "公益",
  828 + // num: 14,
  829 + // pageId: 20018,
  830 + // pageType: "",
  831 + // underlineCColor: ""
  832 + // },
  833 + // {
  834 + // channelId: 2009,
  835 + // channelStrategy: 1,
  836 + // channelStyle: 2,
  837 + // channelType: 1,
  838 + // defaultPermitted: 0,
  839 + // delPermitted: 1,
  840 + // fontCColor: "#FFFFFF",
  841 + // fontColor: "#F9AB99",
  842 + // headlinesOn: 0,
  843 + // homeChannel: "0",
  844 + // iconCUrl: "",
  845 + // iconCUrlSize: "",
  846 + // iconUrl: "",
  847 + // iconUrlSize: "",
  848 + // localChannel: "0",
  849 + // moreChannel: "0",
  850 + // movePermitted: 1,
  851 + // myChannel: "0",
  852 + // name: "社会",
  853 + // num: 15,
  854 + // pageId: 20019,
  855 + // pageType: "",
  856 + // underlineCColor: ""
  857 + // },
  858 + // {
  859 + // channelId: 2010,
  860 + // channelStrategy: 1,
  861 + // channelStyle: 2,
  862 + // channelType: 1,
  863 + // defaultPermitted: 0,
  864 + // delPermitted: 1,
  865 + // fontCColor: "#FFFFFF",
  866 + // fontColor: "#F9AB99",
  867 + // headlinesOn: 0,
  868 + // homeChannel: "0",
  869 + // iconCUrl: "",
  870 + // iconCUrlSize: "",
  871 + // iconUrl: "",
  872 + // iconUrlSize: "",
  873 + // localChannel: "0",
  874 + // moreChannel: "0",
  875 + // movePermitted: 1,
  876 + // myChannel: "0",
  877 + // name: "财经",
  878 + // num: 16,
  879 + // pageId: 20020,
  880 + // pageType: "",
  881 + // underlineCColor: ""
  882 + // },
  883 + // {
  884 + // channelId: 2012,
  885 + // channelStrategy: 1,
  886 + // channelStyle: 2,
  887 + // channelType: 1,
  888 + // defaultPermitted: 0,
  889 + // delPermitted: 1,
  890 + // fontCColor: "#FFFFFF",
  891 + // fontColor: "#F9AB99",
  892 + // headlinesOn: 0,
  893 + // homeChannel: "0",
  894 + // iconCUrl: "",
  895 + // iconCUrlSize: "",
  896 + // iconUrl: "",
  897 + // iconUrlSize: "",
  898 + // localChannel: "0",
  899 + // moreChannel: "0",
  900 + // movePermitted: 1,
  901 + // myChannel: "0",
  902 + // name: "文化",
  903 + // num: 17,
  904 + // pageId: 20022,
  905 + // pageType: "",
  906 + // underlineCColor: ""
  907 + // },
  908 + // {
  909 + // channelId: 2013,
  910 + // channelStrategy: 1,
  911 + // channelStyle: 2,
  912 + // channelType: 1,
  913 + // defaultPermitted: 0,
  914 + // delPermitted: 1,
  915 + // fontCColor: "#FFFFFF",
  916 + // fontColor: "#F9AB99",
  917 + // headlinesOn: 0,
  918 + // homeChannel: "0",
  919 + // iconCUrl: "",
  920 + // iconCUrlSize: "",
  921 + // iconUrl: "",
  922 + // iconUrlSize: "",
  923 + // localChannel: "0",
  924 + // moreChannel: "0",
  925 + // movePermitted: 1,
  926 + // myChannel: "0",
  927 + // name: "教育",
  928 + // num: 18,
  929 + // pageId: 20023,
  930 + // pageType: "",
  931 + // underlineCColor: ""
  932 + // },
  933 + // {
  934 + // channelId: 2014,
  935 + // channelStrategy: 1,
  936 + // channelStyle: 2,
  937 + // channelType: 1,
  938 + // defaultPermitted: 0,
  939 + // delPermitted: 1,
  940 + // fontCColor: "#FFFFFF",
  941 + // fontColor: "#F9AB99",
  942 + // headlinesOn: 0,
  943 + // homeChannel: "0",
  944 + // iconCUrl: "",
  945 + // iconCUrlSize: "",
  946 + // iconUrl: "",
  947 + // iconUrlSize: "",
  948 + // localChannel: "0",
  949 + // moreChannel: "0",
  950 + // movePermitted: 1,
  951 + // myChannel: "0",
  952 + // name: "军事",
  953 + // num: 19,
  954 + // pageId: 20024,
  955 + // pageType: "",
  956 + // underlineCColor: ""
  957 + // },
  958 + // {
  959 + // channelId: 2017,
  960 + // channelStrategy: 2,
  961 + // channelStyle: 2,
  962 + // channelType: 1,
  963 + // defaultPermitted: 0,
  964 + // delPermitted: 1,
  965 + // fontCColor: "#FFFFFF",
  966 + // fontColor: "#F9AB99",
  967 + // headlinesOn: 0,
  968 + // homeChannel: "0",
  969 + // iconCUrl: "",
  970 + // iconCUrlSize: "",
  971 + // iconUrl: "",
  972 + // iconUrlSize: "",
  973 + // localChannel: "0",
  974 + // moreChannel: "0",
  975 + // movePermitted: 1,
  976 + // myChannel: "0",
  977 + // name: "健康",
  978 + // num: 20,
  979 + // pageId: 20027,
  980 + // pageType: "",
  981 + // underlineCColor: ""
  982 + // },
  983 + // {
  984 + // channelId: 2019,
  985 + // channelStrategy: 1,
  986 + // channelStyle: 2,
  987 + // channelType: 1,
  988 + // defaultPermitted: 0,
  989 + // delPermitted: 1,
  990 + // fontCColor: "#FFFFFF",
  991 + // fontColor: "#F9AB99",
  992 + // headlinesOn: 0,
  993 + // homeChannel: "0",
  994 + // iconCUrl: "",
  995 + // iconCUrlSize: "",
  996 + // iconUrl: "",
  997 + // iconUrlSize: "",
  998 + // localChannel: "0",
  999 + // moreChannel: "0",
  1000 + // movePermitted: 1,
  1001 + // myChannel: "0",
  1002 + // name: "房产",
  1003 + // num: 21,
  1004 + // pageId: 20029,
  1005 + // pageType: "",
  1006 + // underlineCColor: ""
  1007 + // },
  1008 + // {
  1009 + // channelId: 2018,
  1010 + // channelStrategy: 1,
  1011 + // channelStyle: 2,
  1012 + // channelType: 1,
  1013 + // defaultPermitted: 0,
  1014 + // delPermitted: 1,
  1015 + // fontCColor: "#FFFFFF",
  1016 + // fontColor: "#F9AB99",
  1017 + // headlinesOn: 0,
  1018 + // homeChannel: "0",
  1019 + // iconCUrl: "",
  1020 + // iconCUrlSize: "",
  1021 + // iconUrl: "",
  1022 + // iconUrlSize: "",
  1023 + // localChannel: "0",
  1024 + // moreChannel: "0",
  1025 + // movePermitted: 1,
  1026 + // myChannel: "0",
  1027 + // name: "汽车",
  1028 + // num: 22,
  1029 + // pageId: 20028,
  1030 + // pageType: "",
  1031 + // underlineCColor: ""
  1032 + // },
  1033 + // {
  1034 + // channelId: 2065,
  1035 + // channelStrategy: 2,
  1036 + // channelStyle: 2,
  1037 + // channelType: 1,
  1038 + // defaultPermitted: 0,
  1039 + // delPermitted: 0,
  1040 + // fontCColor: "#FFFFFF",
  1041 + // fontColor: "#F9AB99",
  1042 + // headlinesOn: 0,
  1043 + // homeChannel: "0",
  1044 + // iconCUrl: "",
  1045 + // iconCUrlSize: "",
  1046 + // iconUrl: "",
  1047 + // iconUrlSize: "",
  1048 + // localChannel: "0",
  1049 + // moreChannel: "0",
  1050 + // movePermitted: 1,
  1051 + // myChannel: "0",
  1052 + // name: "三农",
  1053 + // num: 24,
  1054 + // pageId: 21002,
  1055 + // pageType: "",
  1056 + // underlineCColor: ""
  1057 + // },
  1058 + // {
  1059 + // channelId: 2024,
  1060 + // channelStrategy: 1,
  1061 + // channelStyle: 2,
  1062 + // channelType: 1,
  1063 + // defaultPermitted: 0,
  1064 + // delPermitted: 1,
  1065 + // fontCColor: "#FFFFFF",
  1066 + // fontColor: "#F9AB99",
  1067 + // headlinesOn: 0,
  1068 + // homeChannel: "0",
  1069 + // iconCUrl: "",
  1070 + // iconCUrlSize: "",
  1071 + // iconUrl: "",
  1072 + // iconUrlSize: "",
  1073 + // localChannel: "0",
  1074 + // moreChannel: "0",
  1075 + // movePermitted: 1,
  1076 + // myChannel: "0",
  1077 + // name: "家居",
  1078 + // num: 25,
  1079 + // pageId: 20034,
  1080 + // pageType: "",
  1081 + // underlineCColor: ""
  1082 + // },
  1083 + // {
  1084 + // channelId: 2021,
  1085 + // channelStrategy: 1,
  1086 + // channelStyle: 2,
  1087 + // channelType: 1,
  1088 + // defaultPermitted: 0,
  1089 + // delPermitted: 1,
  1090 + // fontCColor: "#FFFFFF",
  1091 + // fontColor: "#F9AB99",
  1092 + // headlinesOn: 0,
  1093 + // homeChannel: "0",
  1094 + // iconCUrl: "",
  1095 + // iconCUrlSize: "",
  1096 + // iconUrl: "",
  1097 + // iconUrlSize: "",
  1098 + // localChannel: "0",
  1099 + // moreChannel: "0",
  1100 + // movePermitted: 1,
  1101 + // myChannel: "0",
  1102 + // name: "法治",
  1103 + // num: 27,
  1104 + // pageId: 20031,
  1105 + // pageType: "",
  1106 + // underlineCColor: ""
  1107 + // },
  1108 + // {
  1109 + // channelId: 2022,
  1110 + // channelStrategy: 1,
  1111 + // channelStyle: 2,
  1112 + // channelType: 1,
  1113 + // defaultPermitted: 0,
  1114 + // delPermitted: 1,
  1115 + // fontCColor: "#FFFFFF",
  1116 + // fontColor: "#F9AB99",
  1117 + // headlinesOn: 0,
  1118 + // homeChannel: "0",
  1119 + // iconCUrl: "",
  1120 + // iconCUrlSize: "",
  1121 + // iconUrl: "",
  1122 + // iconUrlSize: "",
  1123 + // localChannel: "0",
  1124 + // moreChannel: "0",
  1125 + // movePermitted: 1,
  1126 + // myChannel: "0",
  1127 + // name: "美食",
  1128 + // num: 28,
  1129 + // pageId: 20032,
  1130 + // pageType: "",
  1131 + // underlineCColor: ""
  1132 + // },
  1133 + // {
  1134 + // channelId: 2025,
  1135 + // channelStrategy: 1,
  1136 + // channelStyle: 2,
  1137 + // channelType: 1,
  1138 + // defaultPermitted: 0,
  1139 + // delPermitted: 1,
  1140 + // fontCColor: "#FFFFFF",
  1141 + // fontColor: "#F9AB99",
  1142 + // headlinesOn: 0,
  1143 + // homeChannel: "0",
  1144 + // iconCUrl: "",
  1145 + // iconCUrlSize: "",
  1146 + // iconUrl: "",
  1147 + // iconUrlSize: "",
  1148 + // localChannel: "0",
  1149 + // moreChannel: "0",
  1150 + // movePermitted: 1,
  1151 + // myChannel: "0",
  1152 + // name: "育儿",
  1153 + // num: 29,
  1154 + // pageId: 20035,
  1155 + // pageType: "",
  1156 + // underlineCColor: ""
  1157 + // },
  1158 + // {
  1159 + // channelId: 2026,
  1160 + // channelStrategy: 1,
  1161 + // channelStyle: 2,
  1162 + // channelType: 1,
  1163 + // defaultPermitted: 0,
  1164 + // delPermitted: 1,
  1165 + // fontCColor: "#FFFFFF",
  1166 + // fontColor: "#F9AB99",
  1167 + // headlinesOn: 0,
  1168 + // homeChannel: "0",
  1169 + // iconCUrl: "",
  1170 + // iconCUrlSize: "",
  1171 + // iconUrl: "",
  1172 + // iconUrlSize: "",
  1173 + // localChannel: "0",
  1174 + // moreChannel: "0",
  1175 + // movePermitted: 1,
  1176 + // myChannel: "0",
  1177 + // name: "生态",
  1178 + // num: 30,
  1179 + // pageId: 20036,
  1180 + // pageType: "",
  1181 + // underlineCColor: ""
  1182 + // },
  1183 + // {
  1184 + // channelId: 2023,
  1185 + // channelStrategy: 1,
  1186 + // channelStyle: 2,
  1187 + // channelType: 1,
  1188 + // defaultPermitted: 0,
  1189 + // delPermitted: 1,
  1190 + // fontCColor: "#FFFFFF",
  1191 + // fontColor: "#F9AB99",
  1192 + // headlinesOn: 0,
  1193 + // homeChannel: "0",
  1194 + // iconCUrl: "",
  1195 + // iconCUrlSize: "",
  1196 + // iconUrl: "",
  1197 + // iconUrlSize: "",
  1198 + // localChannel: "0",
  1199 + // moreChannel: "0",
  1200 + // movePermitted: 1,
  1201 + // myChannel: "0",
  1202 + // name: "时尚",
  1203 + // num: 31,
  1204 + // pageId: 20033,
  1205 + // pageType: "",
  1206 + // underlineCColor: ""
  1207 + // },
  1208 + // {
  1209 + // channelId: 2027,
  1210 + // channelStrategy: 1,
  1211 + // channelStyle: 2,
  1212 + // channelType: 2,
  1213 + // defaultPermitted: 0,
  1214 + // delPermitted: 1,
  1215 + // fontCColor: "#FFFFFF",
  1216 + // fontColor: "#F9AB99",
  1217 + // headlinesOn: 0,
  1218 + // homeChannel: "0",
  1219 + // iconCUrl: "",
  1220 + // iconCUrlSize: "",
  1221 + // iconUrl: "",
  1222 + // iconUrlSize: "",
  1223 + // localChannel: "0",
  1224 + // moreChannel: "0",
  1225 + // movePermitted: 1,
  1226 + // myChannel: "0",
  1227 + // name: "北京",
  1228 + // num: 32,
  1229 + // pageId: 20037,
  1230 + // pageType: "",
  1231 + // underlineCColor: ""
  1232 + // },
  1233 + // {
  1234 + // channelId: 2029,
  1235 + // channelStrategy: 1,
  1236 + // channelStyle: 2,
  1237 + // channelType: 2,
  1238 + // defaultPermitted: 0,
  1239 + // delPermitted: 1,
  1240 + // fontCColor: "#FFFFFF",
  1241 + // fontColor: "#F9AB99",
  1242 + // headlinesOn: 0,
  1243 + // homeChannel: "0",
  1244 + // iconCUrl: "",
  1245 + // iconCUrlSize: "",
  1246 + // iconUrl: "",
  1247 + // iconUrlSize: "",
  1248 + // localChannel: "0",
  1249 + // moreChannel: "0",
  1250 + // movePermitted: 1,
  1251 + // myChannel: "0",
  1252 + // name: "天津",
  1253 + // num: 33,
  1254 + // pageId: 20039,
  1255 + // pageType: "",
  1256 + // underlineCColor: ""
  1257 + // },
  1258 + // {
  1259 + // channelId: 2030,
  1260 + // channelStrategy: 1,
  1261 + // channelStyle: 2,
  1262 + // channelType: 2,
  1263 + // defaultPermitted: 0,
  1264 + // delPermitted: 1,
  1265 + // fontCColor: "#FFFFFF",
  1266 + // fontColor: "#F9AB99",
  1267 + // headlinesOn: 0,
  1268 + // homeChannel: "0",
  1269 + // iconCUrl: "",
  1270 + // iconCUrlSize: "",
  1271 + // iconUrl: "",
  1272 + // iconUrlSize: "",
  1273 + // localChannel: "0",
  1274 + // moreChannel: "0",
  1275 + // movePermitted: 1,
  1276 + // myChannel: "0",
  1277 + // name: "河北",
  1278 + // num: 34,
  1279 + // pageId: 20040,
  1280 + // pageType: "",
  1281 + // underlineCColor: ""
  1282 + // },
  1283 + // {
  1284 + // channelId: 2042,
  1285 + // channelStrategy: 1,
  1286 + // channelStyle: 2,
  1287 + // channelType: 2,
  1288 + // defaultPermitted: 0,
  1289 + // delPermitted: 1,
  1290 + // fontCColor: "#FFFFFF",
  1291 + // fontColor: "#F9AB99",
  1292 + // headlinesOn: 0,
  1293 + // homeChannel: "0",
  1294 + // iconCUrl: "",
  1295 + // iconCUrlSize: "",
  1296 + // iconUrl: "",
  1297 + // iconUrlSize: "",
  1298 + // localChannel: "0",
  1299 + // moreChannel: "0",
  1300 + // movePermitted: 1,
  1301 + // myChannel: "0",
  1302 + // name: "河南",
  1303 + // num: 35,
  1304 + // pageId: 20052,
  1305 + // pageType: "",
  1306 + // underlineCColor: ""
  1307 + // },
  1308 + // {
  1309 + // channelId: 2041,
  1310 + // channelStrategy: 1,
  1311 + // channelStyle: 2,
  1312 + // channelType: 2,
  1313 + // defaultPermitted: 0,
  1314 + // delPermitted: 1,
  1315 + // fontCColor: "#FFFFFF",
  1316 + // fontColor: "#F9AB99",
  1317 + // headlinesOn: 0,
  1318 + // homeChannel: "0",
  1319 + // iconCUrl: "",
  1320 + // iconCUrlSize: "",
  1321 + // iconUrl: "",
  1322 + // iconUrlSize: "",
  1323 + // localChannel: "0",
  1324 + // moreChannel: "0",
  1325 + // movePermitted: 1,
  1326 + // myChannel: "0",
  1327 + // name: "山东",
  1328 + // num: 36,
  1329 + // pageId: 20051,
  1330 + // pageType: "",
  1331 + // underlineCColor: ""
  1332 + // },
  1333 + // {
  1334 + // channelId: 2031,
  1335 + // channelStrategy: 2,
  1336 + // channelStyle: 2,
  1337 + // channelType: 2,
  1338 + // defaultPermitted: 0,
  1339 + // delPermitted: 1,
  1340 + // fontCColor: "#FFFFFF",
  1341 + // fontColor: "#F9AB99",
  1342 + // headlinesOn: 0,
  1343 + // homeChannel: "0",
  1344 + // iconCUrl: "",
  1345 + // iconCUrlSize: "",
  1346 + // iconUrl: "",
  1347 + // iconUrlSize: "",
  1348 + // localChannel: "0",
  1349 + // moreChannel: "0",
  1350 + // movePermitted: 1,
  1351 + // myChannel: "0",
  1352 + // name: "山西",
  1353 + // num: 37,
  1354 + // pageId: 20041,
  1355 + // pageType: "",
  1356 + // underlineCColor: ""
  1357 + // },
  1358 + // {
  1359 + // channelId: 2032,
  1360 + // channelStrategy: 1,
  1361 + // channelStyle: 2,
  1362 + // channelType: 2,
  1363 + // defaultPermitted: 0,
  1364 + // delPermitted: 1,
  1365 + // fontCColor: "#FFFFFF",
  1366 + // fontColor: "#F9AB99",
  1367 + // headlinesOn: 0,
  1368 + // homeChannel: "0",
  1369 + // iconCUrl: "",
  1370 + // iconCUrlSize: "",
  1371 + // iconUrl: "",
  1372 + // iconUrlSize: "",
  1373 + // localChannel: "0",
  1374 + // moreChannel: "0",
  1375 + // movePermitted: 1,
  1376 + // myChannel: "0",
  1377 + // name: "内蒙古",
  1378 + // num: 38,
  1379 + // pageId: 20042,
  1380 + // pageType: "",
  1381 + // underlineCColor: ""
  1382 + // },
  1383 + // {
  1384 + // channelId: 2033,
  1385 + // channelStrategy: 1,
  1386 + // channelStyle: 2,
  1387 + // channelType: 2,
  1388 + // defaultPermitted: 0,
  1389 + // delPermitted: 1,
  1390 + // fontCColor: "#FFFFFF",
  1391 + // fontColor: "#F9AB99",
  1392 + // headlinesOn: 0,
  1393 + // homeChannel: "0",
  1394 + // iconCUrl: "",
  1395 + // iconCUrlSize: "",
  1396 + // iconUrl: "",
  1397 + // iconUrlSize: "",
  1398 + // localChannel: "0",
  1399 + // moreChannel: "0",
  1400 + // movePermitted: 1,
  1401 + // myChannel: "0",
  1402 + // name: "辽宁",
  1403 + // num: 39,
  1404 + // pageId: 20043,
  1405 + // pageType: "",
  1406 + // underlineCColor: ""
  1407 + // },
  1408 + // {
  1409 + // channelId: 2034,
  1410 + // channelStrategy: 1,
  1411 + // channelStyle: 2,
  1412 + // channelType: 2,
  1413 + // defaultPermitted: 0,
  1414 + // delPermitted: 1,
  1415 + // fontCColor: "#FFFFFF",
  1416 + // fontColor: "#F9AB99",
  1417 + // headlinesOn: 0,
  1418 + // homeChannel: "0",
  1419 + // iconCUrl: "",
  1420 + // iconCUrlSize: "",
  1421 + // iconUrl: "",
  1422 + // iconUrlSize: "",
  1423 + // localChannel: "0",
  1424 + // moreChannel: "0",
  1425 + // movePermitted: 1,
  1426 + // myChannel: "0",
  1427 + // name: "吉林",
  1428 + // num: 40,
  1429 + // pageId: 20044,
  1430 + // pageType: "",
  1431 + // underlineCColor: ""
  1432 + // },
  1433 + // {
  1434 + // channelId: 2035,
  1435 + // channelStrategy: 1,
  1436 + // channelStyle: 2,
  1437 + // channelType: 2,
  1438 + // defaultPermitted: 0,
  1439 + // delPermitted: 1,
  1440 + // fontCColor: "#FFFFFF",
  1441 + // fontColor: "#F9AB99",
  1442 + // headlinesOn: 0,
  1443 + // homeChannel: "0",
  1444 + // iconCUrl: "",
  1445 + // iconCUrlSize: "",
  1446 + // iconUrl: "",
  1447 + // iconUrlSize: "",
  1448 + // localChannel: "0",
  1449 + // moreChannel: "0",
  1450 + // movePermitted: 1,
  1451 + // myChannel: "0",
  1452 + // name: "黑龙江",
  1453 + // num: 41,
  1454 + // pageId: 20045,
  1455 + // pageType: "",
  1456 + // underlineCColor: ""
  1457 + // },
  1458 + // {
  1459 + // channelId: 2028,
  1460 + // channelStrategy: 1,
  1461 + // channelStyle: 2,
  1462 + // channelType: 2,
  1463 + // defaultPermitted: 0,
  1464 + // delPermitted: 1,
  1465 + // fontCColor: "#FFFFFF",
  1466 + // fontColor: "#F9AB99",
  1467 + // headlinesOn: 0,
  1468 + // homeChannel: "0",
  1469 + // iconCUrl: "",
  1470 + // iconCUrlSize: "",
  1471 + // iconUrl: "",
  1472 + // iconUrlSize: "",
  1473 + // localChannel: "0",
  1474 + // moreChannel: "0",
  1475 + // movePermitted: 1,
  1476 + // myChannel: "0",
  1477 + // name: "上海",
  1478 + // num: 42,
  1479 + // pageId: 20038,
  1480 + // pageType: "",
  1481 + // underlineCColor: ""
  1482 + // },
  1483 + // {
  1484 + // channelId: 2036,
  1485 + // channelStrategy: 1,
  1486 + // channelStyle: 2,
  1487 + // channelType: 2,
  1488 + // defaultPermitted: 0,
  1489 + // delPermitted: 1,
  1490 + // fontCColor: "#FFFFFF",
  1491 + // fontColor: "#F9AB99",
  1492 + // headlinesOn: 0,
  1493 + // homeChannel: "0",
  1494 + // iconCUrl: "",
  1495 + // iconCUrlSize: "",
  1496 + // iconUrl: "",
  1497 + // iconUrlSize: "",
  1498 + // localChannel: "0",
  1499 + // moreChannel: "0",
  1500 + // movePermitted: 1,
  1501 + // myChannel: "0",
  1502 + // name: "江苏",
  1503 + // num: 43,
  1504 + // pageId: 20046,
  1505 + // pageType: "",
  1506 + // underlineCColor: ""
  1507 + // },
  1508 + // {
  1509 + // channelId: 2037,
  1510 + // channelStrategy: 1,
  1511 + // channelStyle: 2,
  1512 + // channelType: 2,
  1513 + // defaultPermitted: 0,
  1514 + // delPermitted: 1,
  1515 + // fontCColor: "#FFFFFF",
  1516 + // fontColor: "#F9AB99",
  1517 + // headlinesOn: 0,
  1518 + // homeChannel: "0",
  1519 + // iconCUrl: "",
  1520 + // iconCUrlSize: "",
  1521 + // iconUrl: "",
  1522 + // iconUrlSize: "",
  1523 + // localChannel: "0",
  1524 + // moreChannel: "0",
  1525 + // movePermitted: 1,
  1526 + // myChannel: "0",
  1527 + // name: "浙江",
  1528 + // num: 44,
  1529 + // pageId: 20047,
  1530 + // pageType: "",
  1531 + // underlineCColor: ""
  1532 + // },
  1533 + // {
  1534 + // channelId: 2038,
  1535 + // channelStrategy: 1,
  1536 + // channelStyle: 2,
  1537 + // channelType: 2,
  1538 + // defaultPermitted: 0,
  1539 + // delPermitted: 1,
  1540 + // fontCColor: "#FFFFFF",
  1541 + // fontColor: "#F9AB99",
  1542 + // headlinesOn: 0,
  1543 + // homeChannel: "0",
  1544 + // iconCUrl: "",
  1545 + // iconCUrlSize: "",
  1546 + // iconUrl: "",
  1547 + // iconUrlSize: "",
  1548 + // localChannel: "0",
  1549 + // moreChannel: "0",
  1550 + // movePermitted: 1,
  1551 + // myChannel: "0",
  1552 + // name: "安徽",
  1553 + // num: 45,
  1554 + // pageId: 20048,
  1555 + // pageType: "",
  1556 + // underlineCColor: ""
  1557 + // },
  1558 + // {
  1559 + // channelId: 2039,
  1560 + // channelStrategy: 1,
  1561 + // channelStyle: 2,
  1562 + // channelType: 2,
  1563 + // defaultPermitted: 0,
  1564 + // delPermitted: 1,
  1565 + // fontCColor: "#FFFFFF",
  1566 + // fontColor: "#F9AB99",
  1567 + // headlinesOn: 0,
  1568 + // homeChannel: "0",
  1569 + // iconCUrl: "",
  1570 + // iconCUrlSize: "",
  1571 + // iconUrl: "",
  1572 + // iconUrlSize: "",
  1573 + // localChannel: "0",
  1574 + // moreChannel: "0",
  1575 + // movePermitted: 1,
  1576 + // myChannel: "0",
  1577 + // name: "福建",
  1578 + // num: 46,
  1579 + // pageId: 20049,
  1580 + // pageType: "",
  1581 + // underlineCColor: ""
  1582 + // },
  1583 + // {
  1584 + // channelId: 2040,
  1585 + // channelStrategy: 1,
  1586 + // channelStyle: 2,
  1587 + // channelType: 2,
  1588 + // defaultPermitted: 0,
  1589 + // delPermitted: 1,
  1590 + // fontCColor: "#FFFFFF",
  1591 + // fontColor: "#F9AB99",
  1592 + // headlinesOn: 0,
  1593 + // homeChannel: "0",
  1594 + // iconCUrl: "",
  1595 + // iconCUrlSize: "",
  1596 + // iconUrl: "",
  1597 + // iconUrlSize: "",
  1598 + // localChannel: "0",
  1599 + // moreChannel: "0",
  1600 + // movePermitted: 1,
  1601 + // myChannel: "0",
  1602 + // name: "江西",
  1603 + // num: 47,
  1604 + // pageId: 20050,
  1605 + // pageType: "",
  1606 + // underlineCColor: ""
  1607 + // },
  1608 + // {
  1609 + // channelId: 2045,
  1610 + // channelStrategy: 2,
  1611 + // channelStyle: 2,
  1612 + // channelType: 2,
  1613 + // defaultPermitted: 0,
  1614 + // delPermitted: 1,
  1615 + // fontCColor: "#FFFFFF",
  1616 + // fontColor: "#F9AB99",
  1617 + // headlinesOn: 0,
  1618 + // homeChannel: "0",
  1619 + // iconCUrl: "",
  1620 + // iconCUrlSize: "",
  1621 + // iconUrl: "",
  1622 + // iconUrlSize: "",
  1623 + // localChannel: "0",
  1624 + // moreChannel: "0",
  1625 + // movePermitted: 1,
  1626 + // myChannel: "0",
  1627 + // name: "广东",
  1628 + // num: 48,
  1629 + // pageId: 20055,
  1630 + // pageType: "",
  1631 + // underlineCColor: ""
  1632 + // },
  1633 + // {
  1634 + // channelId: 2046,
  1635 + // channelStrategy: 1,
  1636 + // channelStyle: 2,
  1637 + // channelType: 2,
  1638 + // defaultPermitted: 0,
  1639 + // delPermitted: 1,
  1640 + // fontCColor: "#FFFFFF",
  1641 + // fontColor: "#F9AB99",
  1642 + // headlinesOn: 0,
  1643 + // homeChannel: "0",
  1644 + // iconCUrl: "",
  1645 + // iconCUrlSize: "",
  1646 + // iconUrl: "",
  1647 + // iconUrlSize: "",
  1648 + // localChannel: "0",
  1649 + // moreChannel: "0",
  1650 + // movePermitted: 1,
  1651 + // myChannel: "0",
  1652 + // name: "广西",
  1653 + // num: 49,
  1654 + // pageId: 20056,
  1655 + // pageType: "",
  1656 + // underlineCColor: ""
  1657 + // },
  1658 + // {
  1659 + // channelId: 2048,
  1660 + // channelStrategy: 1,
  1661 + // channelStyle: 2,
  1662 + // channelType: 2,
  1663 + // defaultPermitted: 0,
  1664 + // delPermitted: 1,
  1665 + // fontCColor: "#FFFFFF",
  1666 + // fontColor: "#F9AB99",
  1667 + // headlinesOn: 0,
  1668 + // homeChannel: "0",
  1669 + // iconCUrl: "",
  1670 + // iconCUrlSize: "",
  1671 + // iconUrl: "",
  1672 + // iconUrlSize: "",
  1673 + // localChannel: "0",
  1674 + // moreChannel: "0",
  1675 + // movePermitted: 1,
  1676 + // myChannel: "0",
  1677 + // name: "重庆",
  1678 + // num: 50,
  1679 + // pageId: 20058,
  1680 + // pageType: "",
  1681 + // underlineCColor: ""
  1682 + // },
  1683 + // {
  1684 + // channelId: 2049,
  1685 + // channelStrategy: 1,
  1686 + // channelStyle: 2,
  1687 + // channelType: 2,
  1688 + // defaultPermitted: 0,
  1689 + // delPermitted: 1,
  1690 + // fontCColor: "#FFFFFF",
  1691 + // fontColor: "#F9AB99",
  1692 + // headlinesOn: 0,
  1693 + // homeChannel: "0",
  1694 + // iconCUrl: "",
  1695 + // iconCUrlSize: "",
  1696 + // iconUrl: "",
  1697 + // iconUrlSize: "",
  1698 + // localChannel: "0",
  1699 + // moreChannel: "0",
  1700 + // movePermitted: 1,
  1701 + // myChannel: "0",
  1702 + // name: "四川",
  1703 + // num: 51,
  1704 + // pageId: 20059,
  1705 + // pageType: "",
  1706 + // underlineCColor: ""
  1707 + // },
  1708 + // {
  1709 + // channelId: 2051,
  1710 + // channelStrategy: 1,
  1711 + // channelStyle: 2,
  1712 + // channelType: 2,
  1713 + // defaultPermitted: 0,
  1714 + // delPermitted: 1,
  1715 + // fontCColor: "#FFFFFF",
  1716 + // fontColor: "#F9AB99",
  1717 + // headlinesOn: 0,
  1718 + // homeChannel: "0",
  1719 + // iconCUrl: "",
  1720 + // iconCUrlSize: "",
  1721 + // iconUrl: "",
  1722 + // iconUrlSize: "",
  1723 + // localChannel: "0",
  1724 + // moreChannel: "0",
  1725 + // movePermitted: 1,
  1726 + // myChannel: "0",
  1727 + // name: "云南",
  1728 + // num: 52,
  1729 + // pageId: 20061,
  1730 + // pageType: "",
  1731 + // underlineCColor: ""
  1732 + // },
  1733 + // {
  1734 + // channelId: 2050,
  1735 + // channelStrategy: 1,
  1736 + // channelStyle: 2,
  1737 + // channelType: 2,
  1738 + // defaultPermitted: 0,
  1739 + // delPermitted: 1,
  1740 + // fontCColor: "#FFFFFF",
  1741 + // fontColor: "#F9AB99",
  1742 + // headlinesOn: 0,
  1743 + // homeChannel: "0",
  1744 + // iconCUrl: "",
  1745 + // iconCUrlSize: "",
  1746 + // iconUrl: "",
  1747 + // iconUrlSize: "",
  1748 + // localChannel: "0",
  1749 + // moreChannel: "0",
  1750 + // movePermitted: 1,
  1751 + // myChannel: "0",
  1752 + // name: "贵州",
  1753 + // num: 53,
  1754 + // pageId: 20060,
  1755 + // pageType: "",
  1756 + // underlineCColor: ""
  1757 + // },
  1758 + // {
  1759 + // channelId: 2044,
  1760 + // channelStrategy: 1,
  1761 + // channelStyle: 2,
  1762 + // channelType: 2,
  1763 + // defaultPermitted: 0,
  1764 + // delPermitted: 1,
  1765 + // fontCColor: "#FFFFFF",
  1766 + // fontColor: "#F9AB99",
  1767 + // headlinesOn: 0,
  1768 + // homeChannel: "0",
  1769 + // iconCUrl: "",
  1770 + // iconCUrlSize: "",
  1771 + // iconUrl: "",
  1772 + // iconUrlSize: "",
  1773 + // localChannel: "0",
  1774 + // moreChannel: "0",
  1775 + // movePermitted: 1,
  1776 + // myChannel: "0",
  1777 + // name: "湖南",
  1778 + // num: 54,
  1779 + // pageId: 20054,
  1780 + // pageType: "",
  1781 + // underlineCColor: ""
  1782 + // },
  1783 + // {
  1784 + // channelId: 2043,
  1785 + // channelStrategy: 1,
  1786 + // channelStyle: 2,
  1787 + // channelType: 2,
  1788 + // defaultPermitted: 0,
  1789 + // delPermitted: 1,
  1790 + // fontCColor: "#FFFFFF",
  1791 + // fontColor: "#F9AB99",
  1792 + // headlinesOn: 0,
  1793 + // homeChannel: "0",
  1794 + // iconCUrl: "",
  1795 + // iconCUrlSize: "",
  1796 + // iconUrl: "",
  1797 + // iconUrlSize: "",
  1798 + // localChannel: "0",
  1799 + // moreChannel: "0",
  1800 + // movePermitted: 1,
  1801 + // myChannel: "0",
  1802 + // name: "湖北",
  1803 + // num: 55,
  1804 + // pageId: 20053,
  1805 + // pageType: "",
  1806 + // underlineCColor: ""
  1807 + // },
  1808 + // {
  1809 + // channelId: 2052,
  1810 + // channelStrategy: 2,
  1811 + // channelStyle: 2,
  1812 + // channelType: 2,
  1813 + // defaultPermitted: 0,
  1814 + // delPermitted: 1,
  1815 + // fontCColor: "#FFFFFF",
  1816 + // fontColor: "#F9AB99",
  1817 + // headlinesOn: 0,
  1818 + // homeChannel: "0",
  1819 + // iconCUrl: "",
  1820 + // iconCUrlSize: "",
  1821 + // iconUrl: "",
  1822 + // iconUrlSize: "",
  1823 + // localChannel: "0",
  1824 + // moreChannel: "0",
  1825 + // movePermitted: 1,
  1826 + // myChannel: "0",
  1827 + // name: "西藏",
  1828 + // num: 56,
  1829 + // pageId: 20062,
  1830 + // pageType: "",
  1831 + // underlineCColor: ""
  1832 + // },
  1833 + // {
  1834 + // channelId: 2057,
  1835 + // channelStrategy: 2,
  1836 + // channelStyle: 2,
  1837 + // channelType: 2,
  1838 + // defaultPermitted: 0,
  1839 + // delPermitted: 1,
  1840 + // fontCColor: "#FFFFFF",
  1841 + // fontColor: "#F9AB99",
  1842 + // headlinesOn: 0,
  1843 + // homeChannel: "0",
  1844 + // iconCUrl: "",
  1845 + // iconCUrlSize: "",
  1846 + // iconUrl: "",
  1847 + // iconUrlSize: "",
  1848 + // localChannel: "0",
  1849 + // moreChannel: "0",
  1850 + // movePermitted: 1,
  1851 + // myChannel: "0",
  1852 + // name: "新疆",
  1853 + // num: 57,
  1854 + // pageId: 20067,
  1855 + // pageType: "",
  1856 + // underlineCColor: ""
  1857 + // },
  1858 + // {
  1859 + // channelId: 2053,
  1860 + // channelStrategy: 1,
  1861 + // channelStyle: 2,
  1862 + // channelType: 2,
  1863 + // defaultPermitted: 0,
  1864 + // delPermitted: 1,
  1865 + // fontCColor: "#FFFFFF",
  1866 + // fontColor: "#F9AB99",
  1867 + // headlinesOn: 0,
  1868 + // homeChannel: "0",
  1869 + // iconCUrl: "",
  1870 + // iconCUrlSize: "",
  1871 + // iconUrl: "",
  1872 + // iconUrlSize: "",
  1873 + // localChannel: "0",
  1874 + // moreChannel: "0",
  1875 + // movePermitted: 1,
  1876 + // myChannel: "0",
  1877 + // name: "陕西",
  1878 + // num: 58,
  1879 + // pageId: 20063,
  1880 + // pageType: "",
  1881 + // underlineCColor: ""
  1882 + // },
  1883 + // {
  1884 + // channelId: 2054,
  1885 + // channelStrategy: 1,
  1886 + // channelStyle: 2,
  1887 + // channelType: 2,
  1888 + // defaultPermitted: 0,
  1889 + // delPermitted: 1,
  1890 + // fontCColor: "#FFFFFF",
  1891 + // fontColor: "#F9AB99",
  1892 + // headlinesOn: 0,
  1893 + // homeChannel: "0",
  1894 + // iconCUrl: "",
  1895 + // iconCUrlSize: "",
  1896 + // iconUrl: "",
  1897 + // iconUrlSize: "",
  1898 + // localChannel: "0",
  1899 + // moreChannel: "0",
  1900 + // movePermitted: 1,
  1901 + // myChannel: "0",
  1902 + // name: "甘肃",
  1903 + // num: 59,
  1904 + // pageId: 20064,
  1905 + // pageType: "",
  1906 + // underlineCColor: ""
  1907 + // },
  1908 + // {
  1909 + // channelId: 2055,
  1910 + // channelStrategy: 1,
  1911 + // channelStyle: 2,
  1912 + // channelType: 2,
  1913 + // defaultPermitted: 0,
  1914 + // delPermitted: 1,
  1915 + // fontCColor: "#FFFFFF",
  1916 + // fontColor: "#F9AB99",
  1917 + // headlinesOn: 0,
  1918 + // homeChannel: "0",
  1919 + // iconCUrl: "",
  1920 + // iconCUrlSize: "",
  1921 + // iconUrl: "",
  1922 + // iconUrlSize: "",
  1923 + // localChannel: "0",
  1924 + // moreChannel: "0",
  1925 + // movePermitted: 1,
  1926 + // myChannel: "0",
  1927 + // name: "青海",
  1928 + // num: 60,
  1929 + // pageId: 20065,
  1930 + // pageType: "",
  1931 + // underlineCColor: ""
  1932 + // },
  1933 + // {
  1934 + // channelId: 2056,
  1935 + // channelStrategy: 2,
  1936 + // channelStyle: 2,
  1937 + // channelType: 2,
  1938 + // defaultPermitted: 0,
  1939 + // delPermitted: 1,
  1940 + // fontCColor: "#FFFFFF",
  1941 + // fontColor: "#F9AB99",
  1942 + // headlinesOn: 0,
  1943 + // homeChannel: "0",
  1944 + // iconCUrl: "",
  1945 + // iconCUrlSize: "",
  1946 + // iconUrl: "",
  1947 + // iconUrlSize: "",
  1948 + // localChannel: "0",
  1949 + // moreChannel: "0",
  1950 + // movePermitted: 1,
  1951 + // myChannel: "0",
  1952 + // name: "宁夏",
  1953 + // num: 61,
  1954 + // pageId: 20066,
  1955 + // pageType: "",
  1956 + // underlineCColor: ""
  1957 + // },
  1958 + // {
  1959 + // channelId: 2047,
  1960 + // channelStrategy: 1,
  1961 + // channelStyle: 2,
  1962 + // channelType: 2,
  1963 + // defaultPermitted: 0,
  1964 + // delPermitted: 1,
  1965 + // fontCColor: "#FFFFFF",
  1966 + // fontColor: "#F9AB99",
  1967 + // headlinesOn: 0,
  1968 + // homeChannel: "0",
  1969 + // iconCUrl: "",
  1970 + // iconCUrlSize: "",
  1971 + // iconUrl: "",
  1972 + // iconUrlSize: "",
  1973 + // localChannel: "0",
  1974 + // moreChannel: "0",
  1975 + // movePermitted: 1,
  1976 + // myChannel: "0",
  1977 + // name: "海南",
  1978 + // num: 62,
  1979 + // pageId: 20057,
  1980 + // pageType: "",
  1981 + // underlineCColor: ""
  1982 + // }
  1983 + // ]
  1984 + // @State myChannelList: TopNavDTO [] = []
  1985 + // @State moreChannelList: TopNavDTO [] = []
  1986 + // @State localChannelList: TopNavDTO [] = []
497 dialogController: CustomDialogController | null = new CustomDialogController({ 1987 dialogController: CustomDialogController | null = new CustomDialogController({
498 builder: ChannelDialog({ 1988 builder: ChannelDialog({
499 - currentTopNavSelectedIndex:this.currentTopNavSelectedIndex,  
500 - indexSettingArray: this.indexSettingArray,  
501 - topNavList: this.topNavList,  
502 - myChannelList: this.myChannelList,  
503 - moreChannelList: this.moreChannelList,  
504 - localChannelList: this.localChannelList, 1989 + currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
  1990 + indexSettingArray: $indexSettingArray,
  1991 + myChannelList: $myChannelList,
  1992 + moreChannelList: $moreChannelList,
  1993 + localChannelList: $localChannelList,
  1994 + confirm: this.onAccept,
  1995 + changeChannelIndex: this.changeChannelIndex,
  1996 + delChannelItem: this.delChannelItem,
  1997 + addChannelItem: this.addChannelItem
505 }), 1998 }),
506 - cancel: this.exitApp,  
507 alignment: DialogAlignment.TopEnd, 1999 alignment: DialogAlignment.TopEnd,
508 customStyle: true, 2000 customStyle: true,
509 }) 2001 })
510 - aboutToAppear() {  
511 - this.topNavList.forEach((item,index)=>{  
512 - if(item.myChannel === '1'){  
513 - this.myChannelList.push(item)  
514 - }  
515 - if(item.moreChannel === '1'){  
516 - this.moreChannelList.push(item)  
517 - }  
518 - if(item.localChannel === '1'){  
519 - this.localChannelList.push(item)  
520 - }  
521 - })  
522 - }  
523 - aboutToDisappear() {  
524 - this.dialogController = null // 将dialogController置空  
525 - }  
526 2002
527 - onCancel() {  
528 - console.info('Callback when the first button is clicked') 2003 + // topNavListHandle() {
  2004 + // let defaultMyChannelList: TopNavDTO[] = []
  2005 + // let handledTopNavList = [...this.topNavList]
  2006 + // handledTopNavList.sort((a, b) => {
  2007 + // return a.num - b.num;
  2008 + // });
  2009 + // handledTopNavList.forEach(item => {
  2010 + // if (item.defaultPermitted === 1 || item.movePermitted === 0 || item.delPermitted === 0 || item.headlinesOn === 1) {
  2011 + // defaultMyChannelList.push(item);
  2012 + // }
  2013 + // })
  2014 + // defaultMyChannelList.forEach(item => {
  2015 + // item.myChannel = '1'
  2016 + // if (item.defaultPermitted === 1) {
  2017 + // item.homeChannel = '1'
  2018 + // }
  2019 + // let index = handledTopNavList.findIndex(_item => _item.channelId === item.channelId)
  2020 + // if (index !== -1) {
  2021 + // handledTopNavList.splice(index, 1)
  2022 + // }
  2023 + // })
  2024 + //
  2025 + // handledTopNavList.unshift(...defaultMyChannelList)
  2026 + // handledTopNavList.forEach((item, index) => {
  2027 + // if (item.channelType === 2) {
  2028 + // item.localChannel = '1'
  2029 + // }
  2030 + // if (index >= 11) {
  2031 + // if (item.channelType === 1) {
  2032 + // item.moreChannel = '1'
  2033 + // }
  2034 + // } else {
  2035 + // if (item.channelType === 1 && item.myChannel !== '1') {
  2036 + // item.moreChannel = '1'
  2037 + // }
  2038 + // }
  2039 + //
  2040 + // if (item.myChannel === '1') {
  2041 + // this.myChannelList.push(item)
  2042 + // }
  2043 + // if (item.moreChannel === '1') {
  2044 + // this.moreChannelList.push(item)
  2045 + // }
  2046 + // if (item.localChannel === '1') {
  2047 + // this.localChannelList.push(item)
  2048 + // }
  2049 + // })
  2050 + // }
  2051 +
  2052 + onChannelIdsUpdate(){
  2053 + AppStorage.SetOrCreate('channelIds', this.channelIds.join(','));
  2054 + console.log(`AppStorage.get('channelIds')${AppStorage.get('channelIds')}`)
529 } 2055 }
530 2056
531 - onAccept() {  
532 - console.info('Callback when the second button is clicked') 2057 + aboutToAppear() {
  2058 + console.log(`myChannelListzz${this.channelIds}}`)
  2059 + // this.topNavListHandle()
533 } 2060 }
534 2061
535 - exitApp() {  
536 - console.info('Click the callback in the blank area') 2062 + aboutToDisappear() {
  2063 + this.dialogController = null // 将dialogController置空
537 } 2064 }
538 2065
539 build() { 2066 build() {
@@ -542,8 +2069,9 @@ struct ChannelSubscriptionLayout { @@ -542,8 +2069,9 @@ struct ChannelSubscriptionLayout {
542 .width(18) 2069 .width(18)
543 } 2070 }
544 .width(36) 2071 .width(36)
545 - .height(30) 2072 + .height(36)
546 .justifyContent(FlexAlign.Center) 2073 .justifyContent(FlexAlign.Center)
  2074 + .padding({ bottom: 6 })
547 .backgroundColor('#ffffff') 2075 .backgroundColor('#ffffff')
548 .onClick(() => { 2076 .onClick(() => {
549 if (this.dialogController != null) { 2077 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, editModelParams, WDEditDataModelType } 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 - 8 +import router from '@ohos.router';
9 9
10 @Entry 10 @Entry
11 @Component 11 @Component
@@ -13,9 +13,16 @@ struct EditUserInfoPage { @@ -13,9 +13,16 @@ struct EditUserInfoPage {
13 @State listData: EditListInfo[] = [] 13 @State listData: EditListInfo[] = []
14 @State headerImg: string = '' 14 @State headerImg: string = ''
15 @State dataSource: AreaListModel[] = [] 15 @State dataSource: AreaListModel[] = []
  16 + @State currentUserInfo: editModel = new editModel()
16 17
17 dialogController: CustomDialogController = new CustomDialogController({ 18 dialogController: CustomDialogController = new CustomDialogController({
18 - builder: AreaPickerDialog({dataSource:this.dataSource}), 19 + builder: AreaPickerDialog({dataSource:this.dataSource,
  20 + confirmCallback:(area:string)=>{
  21 + this.currentUserInfo.userExtend.city = area;
  22 + this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_region
  23 + this.updateEditModel()
  24 + }
  25 + }),
19 alignment: DialogAlignment.Bottom, 26 alignment: DialogAlignment.Bottom,
20 offset:{dx:0,dy:-20} 27 offset:{dx:0,dy:-20}
21 }) 28 })
@@ -25,6 +32,10 @@ struct EditUserInfoPage { @@ -25,6 +32,10 @@ struct EditUserInfoPage {
25 this.getAreaList() 32 this.getAreaList()
26 } 33 }
27 34
  35 + onPageShow(){
  36 + this.updateUserNameAndIntroduction()
  37 + }
  38 +
28 build() { 39 build() {
29 Row() { 40 Row() {
30 Column() { 41 Column() {
@@ -89,14 +100,15 @@ struct EditUserInfoPage { @@ -89,14 +100,15 @@ struct EditUserInfoPage {
89 .width('100%') 100 .width('100%')
90 .onClick(()=>{ 101 .onClick(()=>{
91 if (i === 1){ 102 if (i === 1){
92 - // WDRouterRule.jumpWithPage(WDRouterPage.editUserInfoPage)  
93 - WDRouterRule.jumpWithPage(WDRouterPage.editUserNikeNamePage) 103 + let params: editModelParams = {
  104 + editContent: this.currentUserInfo.userName
  105 + }
  106 + WDRouterRule.jumpWithPage(WDRouterPage.editUserNikeNamePage,params)
94 }else if (i === 2){ 107 }else if (i === 2){
95 - WDRouterRule.jumpWithPage(WDRouterPage.editUserIntroductionPage)  
96 - // router.pushUrl({  
97 - // url:'pages/EditUserInstoductionPage',  
98 - // params:{pageNum:i}  
99 - // }) 108 + let params: editModelParams = {
  109 + editContent: this.currentUserInfo.userExtend.introduction
  110 + }
  111 + WDRouterRule.jumpWithPage(WDRouterPage.editUserIntroductionPage,params)
100 }else if (i === 3){ 112 }else if (i === 3){
101 this.dialogController.open() 113 this.dialogController.open()
102 } else if (i === 4) { 114 } else if (i === 4) {
@@ -105,25 +117,57 @@ struct EditUserInfoPage { @@ -105,25 +117,57 @@ struct EditUserInfoPage {
105 end:new Date(), 117 end:new Date(),
106 selected:new Date, 118 selected:new Date,
107 lunar:false, 119 lunar:false,
108 - // onAccept:(value:DatePickerResult) => {  
109 - //  
110 - // } 120 + onAccept:(value:DatePickerResult) => {
  121 + let mon = value.month as number + 1
  122 + this.currentUserInfo.userExtend.birthday = value.year+'-'+mon.toString()+'-'+value.day;
  123 + this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_birthday
  124 + this.updateEditModel()
  125 + }
111 }) 126 })
112 }else if(i === 5){ 127 }else if(i === 5){
113 TextPickerDialog.show({ 128 TextPickerDialog.show({
114 - range:['男','女'], 129 + range:['女','男'],
115 selected:0, 130 selected:0,
116 - // onAccept:(value:TextPickerResult) => {  
117 - //  
118 - // } 131 + onAccept:(value:TextPickerResult) => {
  132 + this.currentUserInfo.userExtend.sex = value.index.toString();
  133 + this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_sex
  134 + this.updateEditModel()
  135 + }
119 }) 136 })
120 } 137 }
121 }) 138 })
122 } 139 }
123 140
  141 + updateUserNameAndIntroduction(){
  142 + let backParams:editModelParams = router.getParams() as editModelParams;
  143 + if (backParams) {
  144 + let userName = backParams.userName as string ///昵称
  145 + let introduction = backParams.introduction as string ///简介
  146 +
  147 + if (userName) {
  148 + if (userName != this.currentUserInfo.userName) {
  149 + this.currentUserInfo.userName = userName;
  150 + this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_nickname
  151 + this.updateEditModel()
  152 + }
  153 + } else if (introduction){
  154 + if (introduction != this.currentUserInfo.userExtend.introduction ) {
  155 + this.currentUserInfo.userExtend.introduction = introduction;
  156 + this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_intro
  157 + this.updateEditModel()
  158 + }
  159 + }
  160 + }
  161 + }
  162 +
  163 + updateEditModel(){
  164 + this.listData = []
  165 + this.listData.push(...EditInfoViewModel.getEditListInfo(this.currentUserInfo))
  166 + }
124 getAccountOwnerInfo(){ 167 getAccountOwnerInfo(){
125 EditInfoViewModel.queryAccountOwnerInfo(1,getContext(this)).then((editModel) => { 168 EditInfoViewModel.queryAccountOwnerInfo(1,getContext(this)).then((editModel) => {
126 this.headerImg = editModel.userExtend.headPhotoUrl 169 this.headerImg = editModel.userExtend.headPhotoUrl
  170 + this.currentUserInfo = editModel;
127 this.listData.push(...EditInfoViewModel.getEditListInfo(editModel)) 171 this.listData.push(...EditInfoViewModel.getEditListInfo(editModel))
128 }); 172 });
129 } 173 }
1 import { CustomTitleUI } from '../reusable/CustomTitleUI' 1 import { CustomTitleUI } from '../reusable/CustomTitleUI'
  2 +import router from '@ohos.router'
  3 +import { editModelParams } from '../../model/EditInfoModel'
2 4
3 @Entry 5 @Entry
4 @Component 6 @Component
5 struct EditUserIntroductionPage { 7 struct EditUserIntroductionPage {
6 @State numCount: number = 0 8 @State numCount: number = 0
7 @State textColor : string = '#222222' 9 @State textColor : string = '#222222'
8 - 10 + @State introduction: string = ''
  11 + @State params:editModelParams = router.getParams() as editModelParams;
9 build() { 12 build() {
10 Column(){ 13 Column(){
11 CustomTitleUI({titleName:'修改简介'}) 14 CustomTitleUI({titleName:'修改简介'})
12 15
13 Row(){ 16 Row(){
14 - TextInput({placeholder:'请输入简介'}) 17 + TextInput({placeholder:'请输入简介',text:this.params.editContent})
15 .maxLength(60) 18 .maxLength(60)
16 .width('100%') 19 .width('100%')
17 .height(80) 20 .height(80)
@@ -23,6 +26,7 @@ struct EditUserIntroductionPage { @@ -23,6 +26,7 @@ struct EditUserIntroductionPage {
23 }else { 26 }else {
24 this.textColor = '#222222' 27 this.textColor = '#222222'
25 } 28 }
  29 + this.introduction = value
26 }) 30 })
27 31
28 Text(this.numCount.toString() + '/60') 32 Text(this.numCount.toString() + '/60')
@@ -46,6 +50,15 @@ struct EditUserIntroductionPage { @@ -46,6 +50,15 @@ struct EditUserIntroductionPage {
46 .backgroundColor('#ED2800') 50 .backgroundColor('#ED2800')
47 .borderRadius(5) 51 .borderRadius(5)
48 .margin(30) 52 .margin(30)
  53 + .onClick(()=>{
  54 + let params: editModelParams = {
  55 + introduction: this.introduction
  56 + }
  57 + router.back({
  58 + url:'',
  59 + params:params
  60 + })
  61 + })
49 } 62 }
50 } 63 }
51 } 64 }
1 import { CustomTitleUI } from '../reusable/CustomTitleUI' 1 import { CustomTitleUI } from '../reusable/CustomTitleUI'
  2 +import router from '@ohos.router'
  3 +import { editModelParams } from '../../model/EditInfoModel'
2 4
3 @Entry 5 @Entry
4 @Component 6 @Component
@@ -6,13 +8,14 @@ struct EditUserNikeNamePage { @@ -6,13 +8,14 @@ struct EditUserNikeNamePage {
6 ///接收传参 8 ///接收传参
7 @State numCount: number = 0 9 @State numCount: number = 0
8 @State textColor : string = '#222222' 10 @State textColor : string = '#222222'
9 - 11 + @State nikeName: string = ''
  12 + @State params:editModelParams = router.getParams() as editModelParams;
10 build() { 13 build() {
11 Column(){ 14 Column(){
12 CustomTitleUI({titleName:'修改昵称'}) 15 CustomTitleUI({titleName:'修改昵称'})
13 16
14 Row(){ 17 Row(){
15 - TextInput({placeholder:'请输入昵称'}) 18 + TextInput({placeholder:'请输入昵称',text:this.params.editContent})
16 .width('100%') 19 .width('100%')
17 .maxLength(16) 20 .maxLength(16)
18 .height(50) 21 .height(50)
@@ -24,6 +27,7 @@ struct EditUserNikeNamePage { @@ -24,6 +27,7 @@ struct EditUserNikeNamePage {
24 }else { 27 }else {
25 this.textColor = '#222222' 28 this.textColor = '#222222'
26 } 29 }
  30 + this.nikeName = value
27 }) 31 })
28 32
29 Text(this.numCount.toString() + '/16') 33 Text(this.numCount.toString() + '/16')
@@ -46,6 +50,15 @@ struct EditUserNikeNamePage { @@ -46,6 +50,15 @@ struct EditUserNikeNamePage {
46 .backgroundColor('#ED2800') 50 .backgroundColor('#ED2800')
47 .borderRadius(5) 51 .borderRadius(5)
48 .margin(30) 52 .margin(30)
  53 + .onClick(()=>{
  54 + let params: editModelParams = {
  55 + userName: this.nikeName
  56 + }
  57 + router.back({
  58 + url:'',
  59 + params:params
  60 + })
  61 + })
49 } 62 }
50 } 63 }
51 } 64 }
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,11 +72,9 @@ struct MyCollectionListPage { @@ -49,11 +72,9 @@ 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 - Column() {  
55 - CompParser({ compDTO: compDTO, compIndex: compIndex });  
56 - } 77 + this.newCompParser(compDTO,compIndex)
57 } 78 }
58 }) 79 })
59 80
@@ -72,6 +93,24 @@ struct MyCollectionListPage { @@ -72,6 +93,24 @@ struct MyCollectionListPage {
72 .height(CommonConstants.FULL_PARENT) 93 .height(CommonConstants.FULL_PARENT)
73 } 94 }
74 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 +
75 @Builder LoadingLayout() { 114 @Builder LoadingLayout() {
76 CustomRefreshLoadLayout({ refreshBean: new RefreshLayoutBean(true, 115 CustomRefreshLoadLayout({ refreshBean: new RefreshLayoutBean(true,
77 $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) })
@@ -82,7 +121,7 @@ struct MyCollectionListPage { @@ -82,7 +121,7 @@ struct MyCollectionListPage {
82 MyCollectionViewModel.newFetchMyCollectList(1,'1',this.browSingModel.currentPage,getContext(this)).then(pageDto => { 121 MyCollectionViewModel.newFetchMyCollectList(1,'1',this.browSingModel.currentPage,getContext(this)).then(pageDto => {
83 if (pageDto && pageDto.compList && pageDto.compList.length > 0) { 122 if (pageDto && pageDto.compList && pageDto.compList.length > 0) {
84 this.browSingModel.viewType = ViewType.LOADED; 123 this.browSingModel.viewType = ViewType.LOADED;
85 - this.browSingModel.compList.push(...pageDto.compList) 124 + this.allDatas.push(...pageDto.compList)
86 if (pageDto.compList.length === this.browSingModel.pageSize) { 125 if (pageDto.compList.length === this.browSingModel.pageSize) {
87 this.browSingModel.currentPage++; 126 this.browSingModel.currentPage++;
88 this.browSingModel.hasMore = true; 127 this.browSingModel.hasMore = true;
@@ -94,4 +133,49 @@ struct MyCollectionListPage { @@ -94,4 +133,49 @@ struct MyCollectionListPage {
94 } 133 }
95 }) 134 })
96 } 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 + }
97 } 181 }
@@ -101,6 +101,7 @@ export struct PageComponent { @@ -101,6 +101,7 @@ export struct PageComponent {
101 } 101 }
102 102
103 onChange() { 103 onChange() {
  104 + Logger.info(TAG, `onChangezz id: ${this.pageId} , ${this.channelId} , ${this.navIndex} , navIndex: ${this.currentTopNavSelectedIndex}`);
104 if (this.navIndex === this.currentTopNavSelectedIndex) { 105 if (this.navIndex === this.currentTopNavSelectedIndex) {
105 this.getData(); 106 this.getData();
106 } 107 }
@@ -11,56 +11,81 @@ const TAG = 'TopNavigationComponent'; @@ -11,56 +11,81 @@ 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;
17 // 顶导数据 18 // 顶导数据
18 @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = [] 19 @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = []
19 @State compList: LazyDataSource<CompDTO> = new LazyDataSource(); 20 @State compList: LazyDataSource<CompDTO> = new LazyDataSource();
20 - @State handledTopNavList: TopNavDTO[] = [] 21 + //我的频道id缓存列表
  22 + @State channelIds: number[] = []
  23 + // 我的频道列表
  24 + @State myChannelList: TopNavDTO[] = []
  25 + // 更多频道列表
  26 + @State moreChannelList: TopNavDTO[] = []
  27 + // 地方频道列表
  28 + @State localChannelList: TopNavDTO[] = []
21 readonly MAX_LINE: number = 1; 29 readonly MAX_LINE: number = 1;
22 30
  31 + //处理接口顶导数据
23 topNavListHandle() { 32 topNavListHandle() {
24 let defaultMyChannelList: TopNavDTO[] = [] 33 let defaultMyChannelList: TopNavDTO[] = []
25 - this.handledTopNavList = [...this.topNavList]  
26 - this.handledTopNavList.sort((a, b) => { 34 + let handledTopNavList = [...this.topNavList]
  35 + handledTopNavList.sort((a, b) => {
27 return a.num - b.num; 36 return a.num - b.num;
28 }); 37 });
29 - Logger.info(TAG, `aboutToAppear this.handledTopNavListsort : ${JSON.stringify(this.handledTopNavList)}`);  
30 - for (let i = 0; i < this.handledTopNavList.length; i++) {  
31 - if (this.handledTopNavList[i].defaultPermitted === 0 || this.handledTopNavList[i].movePermitted === 0 || this.handledTopNavList[i].delPermitted === 0 || this.handledTopNavList[i].headlinesOn === 1) {  
32 - defaultMyChannelList.push(this.handledTopNavList.splice(i, 1)[0]); 38 + handledTopNavList.forEach(item => {
  39 + if (item.defaultPermitted === 1 || item.movePermitted === 0 || item.delPermitted === 0 || item.headlinesOn === 1) {
  40 + defaultMyChannelList.push(item);
33 } 41 }
34 - } 42 + })
  43 + defaultMyChannelList.forEach(item => {
  44 + item.myChannel = '1'
  45 + if (item.defaultPermitted === 1) {
  46 + item.homeChannel = '1'
  47 + }
  48 + let index = handledTopNavList.findIndex(_item => _item.channelId === item.channelId)
  49 + if (index !== -1) {
  50 + handledTopNavList.splice(index, 1)
  51 + }
  52 + })
35 53
36 - Logger.info(TAG, `aboutToAppear defaultMyChannelListsort : ${JSON.stringify(defaultMyChannelList)}`); 54 + handledTopNavList.unshift(...defaultMyChannelList)
  55 + handledTopNavList.forEach((item, index) => {
  56 + if (item.channelType === 2) {
  57 + item.localChannel = '1'
  58 + }
  59 + if (index >= 11) {
  60 + if (item.channelType === 1) {
  61 + item.moreChannel = '1'
  62 + }
  63 + } else {
  64 + if (item.channelType === 1 && item.myChannel !== '1') {
  65 + item.moreChannel = '1'
  66 + }
  67 + }
37 68
38 - for (const element of defaultMyChannelList) {  
39 - element.myChannel = '1'  
40 - if (element.defaultPermitted === 1) {  
41 - element.homeChannel = '1' 69 + if (item.myChannel === '1') {
  70 + this.myChannelList.push(item)
  71 + this.channelIds.push(item.channelId)
42 } 72 }
43 - }  
44 - this.handledTopNavList.unshift(...defaultMyChannelList)  
45 - for (let i = 0; i < this.handledTopNavList.length; i++) {  
46 - if(this.handledTopNavList[i].channelType === 2){  
47 - this.handledTopNavList[i].localChannel = '1' 73 + if (item.moreChannel === '1') {
  74 + this.moreChannelList.push(item)
48 } 75 }
49 - if(i>=11){  
50 - if(this.handledTopNavList[i].channelType === 1){  
51 - this.handledTopNavList[i].moreChannel = '1'  
52 - }  
53 - }else{  
54 - if(this.handledTopNavList[i].channelType === 1 && this.handledTopNavList[i].myChannel !== '1'){  
55 - this.handledTopNavList[i].moreChannel = '1'  
56 - } 76 + if (item.localChannel === '1') {
  77 + this.localChannelList.push(item)
57 } 78 }
58 - }  
59 - console.info(`handledTopNavList:${JSON.stringify(this.handledTopNavList)}`) 79 + })
  80 + }
  81 +
  82 + isBroadcast (item: TopNavDTO) {
  83 + return item.name === '播报'
60 } 84 }
61 85
62 build() { 86 build() {
63 Column() { 87 Column() {
  88 + // 顶部搜索、日报logo、早晚报
64 RelativeContainer() { 89 RelativeContainer() {
65 Stack({ alignContent: Alignment.Center }) { 90 Stack({ alignContent: Alignment.Center }) {
66 91
@@ -80,7 +105,6 @@ export struct TopNavigationComponent { @@ -80,7 +105,6 @@ export struct TopNavigationComponent {
80 } 105 }
81 .alignItems(VerticalAlign.Center) 106 .alignItems(VerticalAlign.Center)
82 .justifyContent(FlexAlign.Center) 107 .justifyContent(FlexAlign.Center)
83 -  
84 } 108 }
85 .height(30) 109 .height(30)
86 .width(123) 110 .width(123)
@@ -146,18 +170,20 @@ export struct TopNavigationComponent { @@ -146,18 +170,20 @@ export struct TopNavigationComponent {
146 .width('100%') 170 .width('100%')
147 .height(40) 171 .height(40)
148 .visibility(this._currentNavIndex == 0 ? Visibility.Visible : Visibility.None) 172 .visibility(this._currentNavIndex == 0 ? Visibility.Visible : Visibility.None)
149 - 173 + // 频道分类list
150 Stack({ alignContent: Alignment.TopEnd }) { 174 Stack({ alignContent: Alignment.TopEnd }) {
151 175
152 - Tabs() {  
153 - ForEach(this.handledTopNavList, (navItem: TopNavDTO, index: number) => { 176 + Tabs({ controller: this.tabsController }) {
  177 + ForEach(this.myChannelList, (navItem: TopNavDTO, index: number) => {
154 TabContent() { 178 TabContent() {
155 - PageComponent({  
156 - currentTopNavSelectedIndex: $currentTopNavSelectedIndex,  
157 - navIndex: index,  
158 - pageId: navItem.pageId + '',  
159 - channelId: navItem.channelId + ''  
160 - }) 179 + if(!this.isBroadcast(navItem)) {
  180 + PageComponent({
  181 + currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
  182 + navIndex: index,
  183 + pageId: navItem.pageId + '',
  184 + channelId: navItem.channelId + ''
  185 + })
  186 + }
161 } 187 }
162 .tabBar(this.tabBarBuilder(navItem, index)) 188 .tabBar(this.tabBarBuilder(navItem, index))
163 }, (navItem: TopNavDTO) => JSON.stringify(navItem)); 189 }, (navItem: TopNavDTO) => JSON.stringify(navItem));
@@ -167,12 +193,31 @@ export struct TopNavigationComponent { @@ -167,12 +193,31 @@ export struct TopNavigationComponent {
167 .vertical(false) 193 .vertical(false)
168 .onChange((index: number) => { 194 .onChange((index: number) => {
169 Logger.info(TAG, `onChange index : ${index}`); 195 Logger.info(TAG, `onChange index : ${index}`);
170 - this.currentTopNavSelectedIndex = index; 196 + if(!this.isBroadcast(this.myChannelList[index])) {
  197 + this.currentTopNavSelectedIndex = index;
  198 + } else {
  199 + // 跳转到播报页面
  200 + let taskAction: Action = {
  201 + type: 'JUMP_INNER_NEW_PAGE',
  202 + params: {
  203 + pageID: 'BroadcastPage',
  204 + id: this.myChannelList[index].pageId
  205 + } as Params,
  206 + };
  207 + WDRouterRule.jumpWithAction(taskAction)
  208 + this.tabsController.changeIndex(this.currentTopNavSelectedIndex)
  209 + }
171 }) 210 })
172 - 211 + // 分类列表最右侧频道设置
173 ChannelSubscriptionLayout({ 212 ChannelSubscriptionLayout({
174 - topNavList: this.handledTopNavList,  
175 - currentTopNavSelectedIndex: this.currentTopNavSelectedIndex 213 + currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
  214 + myChannelList: $myChannelList,
  215 + moreChannelList: $moreChannelList,
  216 + localChannelList: $localChannelList,
  217 + channelIds: $channelIds,
  218 + changeTab: (index) => {
  219 + this.tabsController.changeIndex(index)
  220 + }
176 }) 221 })
177 } 222 }
178 223
@@ -208,7 +253,7 @@ export struct TopNavigationComponent { @@ -208,7 +253,7 @@ export struct TopNavigationComponent {
208 bottom: $r('app.float.top_tab_item_padding_bottom') 253 bottom: $r('app.float.top_tab_item_padding_bottom')
209 }) 254 })
210 .id(`col_tabBar${index}`) 255 .id(`col_tabBar${index}`)
211 - 256 + .margin({ right: this.myChannelList.length === index + 1 ? 36 : 0 })
212 } 257 }
213 258
214 aboutToAppear() { 259 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 }
1 import { Action, CompDTO, Params } from 'wdBean'; 1 import { Action, CompDTO, Params } from 'wdBean';
2 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; 2 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO';
  3 +import { CommonConstants } from 'wdConstant/Index';
3 import { DateTimeUtils, Logger } from 'wdKit'; 4 import { DateTimeUtils, Logger } from 'wdKit';
4 import { WDRouterRule } from 'wdRouter'; 5 import { WDRouterRule } from 'wdRouter';
5 6
@@ -23,15 +24,12 @@ export struct AlbumCardComponent { @@ -23,15 +24,12 @@ export struct AlbumCardComponent {
23 .fontColor(0x222222) 24 .fontColor(0x222222)
24 .lineHeight(25) 25 .lineHeight(25)
25 .maxLines(3) 26 .maxLines(3)
26 - .margin({ top: 6,  
27 - left: 16,  
28 - right: 16 })  
29 - .width(343) 27 + .width(CommonConstants.FULL_WIDTH)
30 28
31 RelativeContainer() { 29 RelativeContainer() {
32 Image(this.compDTO.operDataList[0].fullColumnImgUrls[0].url) 30 Image(this.compDTO.operDataList[0].fullColumnImgUrls[0].url)
33 - .width(229)  
34 - .height(154) 31 + .width('66.6%')
  32 + .aspectRatio(16/9)
35 .alignRules({ 33 .alignRules({
36 top: { anchor: "__container__", align: VerticalAlign.Top }, 34 top: { anchor: "__container__", align: VerticalAlign.Top },
37 left: { anchor: "__container__", align: HorizontalAlign.Start } 35 left: { anchor: "__container__", align: HorizontalAlign.Start }
@@ -39,8 +37,8 @@ export struct AlbumCardComponent { @@ -39,8 +37,8 @@ export struct AlbumCardComponent {
39 .id('mainImage') 37 .id('mainImage')
40 38
41 Image(this.compDTO.operDataList[0].fullColumnImgUrls[1].url) 39 Image(this.compDTO.operDataList[0].fullColumnImgUrls[1].url)
42 - .width(112)  
43 - .height(76) 40 + .width('33%')
  41 + .aspectRatio(16/9)
44 .alignRules({ 42 .alignRules({
45 top: { anchor: "__container__", align: VerticalAlign.Top }, 43 top: { anchor: "__container__", align: VerticalAlign.Top },
46 right: { anchor: "__container__", align: HorizontalAlign.End } 44 right: { anchor: "__container__", align: HorizontalAlign.End }
@@ -48,14 +46,14 @@ export struct AlbumCardComponent { @@ -48,14 +46,14 @@ export struct AlbumCardComponent {
48 .id('subTopImage') 46 .id('subTopImage')
49 47
50 Image(this.compDTO.operDataList[0].fullColumnImgUrls[2].url) 48 Image(this.compDTO.operDataList[0].fullColumnImgUrls[2].url)
51 - .width(112)  
52 - .height(76) 49 + .width('33%')
  50 + .aspectRatio(16/9)
53 .alignRules({ 51 .alignRules({
54 right: { anchor: "__container__", align: HorizontalAlign.End }, 52 right: { anchor: "__container__", align: HorizontalAlign.End },
55 bottom: { anchor: "__container__", align: VerticalAlign.Bottom } 53 bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
56 }) 54 })
57 .id('subBottomImage') 55 .id('subBottomImage')
58 - 56 + // 下面是渲染右下角图标
59 Shape() { 57 Shape() {
60 Rect().width(33).height(18) 58 Rect().width(33).height(18)
61 } 59 }
@@ -97,8 +95,8 @@ export struct AlbumCardComponent { @@ -97,8 +95,8 @@ export struct AlbumCardComponent {
97 .width(17) 95 .width(17)
98 .height(17) 96 .height(17)
99 } 97 }
100 - .width(343)  
101 - .height(154) 98 + .width(CommonConstants.FULL_WIDTH)
  99 + .aspectRatio(24/9)
102 .onClick((event: ClickEvent) => { 100 .onClick((event: ClickEvent) => {
103 let taskAction: Action = { 101 let taskAction: Action = {
104 type: 'JUMP_DETAIL_PAGE', 102 type: 'JUMP_DETAIL_PAGE',
@@ -134,13 +132,17 @@ export struct AlbumCardComponent { @@ -134,13 +132,17 @@ export struct AlbumCardComponent {
134 .margin({ 132 .margin({
135 left: 6 133 left: 6
136 }) 134 })
137 - }.margin({ left: 24 })  
138 - .width(375) 135 + }
  136 + .width(CommonConstants.FULL_WIDTH)
139 .height(16) 137 .height(16)
140 .id('label') 138 .id('label')
141 } 139 }
142 - .width(375)  
143 -  
144 - // .backgroundColor(0x000000) 140 + .width(CommonConstants.FULL_WIDTH)
  141 + .padding({
  142 + top: 14,
  143 + left: 16,
  144 + right: 16,
  145 + bottom: 14
  146 + })
145 } 147 }
146 } 148 }
@@ -49,6 +49,7 @@ export struct BannerComponent { @@ -49,6 +49,7 @@ export struct BannerComponent {
49 } 49 }
50 .margin({ left: $r('app.float.main_margin'), right: $r('app.float.main_margin') }) 50 .margin({ left: $r('app.float.main_margin'), right: $r('app.float.main_margin') })
51 .padding({ bottom: 14 }) 51 .padding({ bottom: 14 })
  52 + .borderRadius($r('app.float.image_border_radius'))
52 .displayCount(this.buildDisplayCount()) // 仅展示1个图片 53 .displayCount(this.buildDisplayCount()) // 仅展示1个图片
53 .cachedCount(2) 54 .cachedCount(2)
54 .index(1) // The default index of Swiper. 55 .index(1) // The default index of Swiper.
@@ -22,8 +22,18 @@ export struct CompStyle_09 { @@ -22,8 +22,18 @@ export struct CompStyle_09 {
22 .margin({ bottom: 19 }) 22 .margin({ bottom: 19 })
23 } 23 }
24 // 大图 24 // 大图
25 - Image(this.compDTO.operDataList[0].coverUrl)  
26 - .width('100%') 25 + Stack(){
  26 + Image(this.compDTO.operDataList[0].coverUrl)
  27 + .width('100%')
  28 + .borderRadius({topLeft: $r('app.float.image_border_radius'), topRight: $r('app.float.image_border_radius')})
  29 + Text('专题')
  30 + .fontSize($r('app.float.font_size_12'))
  31 + .padding({left: 8, right: 8, top: 3, bottom: 3})
  32 + .backgroundColor(Color.Red)
  33 + .fontColor(Color.White)
  34 + .borderRadius($r('app.float.button_border_radius'))
  35 + .margin({left: 5, bottom: 5})
  36 + }.alignContent(Alignment.BottomStart)
27 // 时间线--后端返回三个, 37 // 时间线--后端返回三个,
28 Column(){ 38 Column(){
29 ForEach(this.compDTO.operDataList[0].slideShows, (item:slideShows, index:number) => { 39 ForEach(this.compDTO.operDataList[0].slideShows, (item:slideShows, index:number) => {
@@ -44,7 +54,7 @@ export struct CompStyle_09 { @@ -44,7 +54,7 @@ export struct CompStyle_09 {
44 .backgroundColor($r('app.color.color_F5F5F5')) 54 .backgroundColor($r('app.color.color_F5F5F5'))
45 .width(CommonConstants.FULL_WIDTH) 55 .width(CommonConstants.FULL_WIDTH)
46 .height(40) 56 .height(40)
47 - .borderRadius(3) 57 + .borderRadius($r('app.float.button_border_radius'))
48 .justifyContent(FlexAlign.Center) 58 .justifyContent(FlexAlign.Center)
49 .margin({top: 5}) 59 .margin({top: 5})
50 } 60 }
@@ -67,20 +77,27 @@ export struct CompStyle_09 { @@ -67,20 +77,27 @@ export struct CompStyle_09 {
67 Column(){ 77 Column(){
68 Stack() { 78 Stack() {
69 if(index < this.compDTO.operDataList[0].slideShows.length - 1) { 79 if(index < this.compDTO.operDataList[0].slideShows.length - 1) {
70 - Line()  
71 - .width(1)  
72 - .startPoint([4, index > 0 ? 0 : 20])  
73 - .endPoint([4, 100])  
74 - .stroke($r('app.color.color_EDEDED')) 80 + Divider()
  81 + .vertical(true)
  82 + .color($r('app.color.color_EDEDED'))
75 .strokeWidth(1) 83 .strokeWidth(1)
76 - .strokeLineCap(LineCapStyle.Butt) 84 + .margin({top: index > 0 ? 0 : 16, left: 4})
77 } 85 }
  86 + if(index > 0 && index == this.compDTO.operDataList[0].slideShows.length - 1) {
  87 + Divider()
  88 + .vertical(true)
  89 + .color($r('app.color.color_EDEDED'))
  90 + .strokeWidth(1)
  91 + .height(16)
  92 + .margin({left: 4})
  93 + }
  94 +
78 Column(){ 95 Column(){
79 Row() { 96 Row() {
80 // 标题 97 // 标题
81 Image($r("app.media.point_icon")) 98 Image($r("app.media.point_icon"))
82 .width(9) 99 .width(9)
83 - .height(6) 100 + .height(9)
84 .margin({ right: 5 }) 101 .margin({ right: 5 })
85 Text(DateTimeUtils.formatDate(item.publishTime, "MM月dd日 HH:mm")) 102 Text(DateTimeUtils.formatDate(item.publishTime, "MM月dd日 HH:mm"))
86 .fontSize($r('app.float.font_size_12')) 103 .fontSize($r('app.float.font_size_12'))
@@ -89,6 +106,7 @@ export struct CompStyle_09 { @@ -89,6 +106,7 @@ export struct CompStyle_09 {
89 } 106 }
90 .width(CommonConstants.FULL_WIDTH) 107 .width(CommonConstants.FULL_WIDTH)
91 .height(32) 108 .height(32)
  109 + .alignItems(VerticalAlign.Center)
92 Row() { 110 Row() {
93 Text(item.newsTitle) 111 Text(item.newsTitle)
94 .fontSize($r('app.float.font_size_17')) 112 .fontSize($r('app.float.font_size_17'))
@@ -103,13 +121,14 @@ export struct CompStyle_09 { @@ -103,13 +121,14 @@ export struct CompStyle_09 {
103 Image(item.fullColumnImgUrls[0].url) 121 Image(item.fullColumnImgUrls[0].url)
104 .width(90) 122 .width(90)
105 .height(60) 123 .height(60)
106 - .borderRadius(4) 124 + .borderRadius($r('app.float.image_border_radius'))
107 } 125 }
108 } 126 }
109 } 127 }
110 } 128 }
111 - .alignContent(Alignment.Start) 129 + .alignContent(Alignment.TopStart)
112 } 130 }
113 .height(item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url ? 100 : 78) 131 .height(item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url ? 100 : 78)
  132 + .alignItems(HorizontalAlign.Start)
114 } 133 }
115 } 134 }
@@ -24,11 +24,21 @@ export struct CompStyle_10 { @@ -24,11 +24,21 @@ export struct CompStyle_10 {
24 .margin({ bottom: 19 }) 24 .margin({ bottom: 19 })
25 } 25 }
26 // 大图 26 // 大图
27 - Image(this.compDTO.operDataList[0] && this.compDTO.operDataList[0].coverUrl)  
28 - .width('100%')  
29 - .onClick((event: ClickEvent) => {  
30 - ProcessUtils.processPage(this.compDTO?.operDataList[0])  
31 - }) 27 + Stack(){
  28 + Image(this.compDTO.operDataList[0] && this.compDTO.operDataList[0].coverUrl)
  29 + .width('100%')
  30 + .borderRadius({topLeft: $r('app.float.image_border_radius'), topRight: $r('app.float.image_border_radius')})
  31 + .onClick((event: ClickEvent) => {
  32 + ProcessUtils.processPage(this.compDTO?.operDataList[0])
  33 + })
  34 + Text('专题')
  35 + .fontSize($r('app.float.font_size_12'))
  36 + .padding({left: 8, right: 8, top: 3, bottom: 3})
  37 + .backgroundColor(Color.Red)
  38 + .fontColor(Color.White)
  39 + .borderRadius($r('app.float.button_border_radius'))
  40 + .margin({left: 5, bottom: 5})
  41 + }.alignContent(Alignment.BottomStart)
32 // 专题列表--后端返回三个, 42 // 专题列表--后端返回三个,
33 Column(){ 43 Column(){
34 ForEach(this.compDTO.operDataList[0].slideShows, (item:slideShows, index:number) => { 44 ForEach(this.compDTO.operDataList[0].slideShows, (item:slideShows, index:number) => {
@@ -49,7 +59,7 @@ export struct CompStyle_10 { @@ -49,7 +59,7 @@ export struct CompStyle_10 {
49 .backgroundColor($r('app.color.color_F5F5F5')) 59 .backgroundColor($r('app.color.color_F5F5F5'))
50 .width(CommonConstants.FULL_WIDTH) 60 .width(CommonConstants.FULL_WIDTH)
51 .height(40) 61 .height(40)
52 - .borderRadius(3) 62 + .borderRadius($r('app.float.button_border_radius'))
53 .justifyContent(FlexAlign.Center) 63 .justifyContent(FlexAlign.Center)
54 .margin({top: 5}) 64 .margin({top: 5})
55 .onClick((event: ClickEvent) => { 65 .onClick((event: ClickEvent) => {
@@ -105,7 +115,7 @@ export struct CompStyle_10 { @@ -105,7 +115,7 @@ export struct CompStyle_10 {
105 .width(117) 115 .width(117)
106 .height(78) 116 .height(78)
107 .objectFit(ImageFit.Cover) 117 .objectFit(ImageFit.Cover)
108 - .borderRadius(4) 118 + .borderRadius($r('app.float.image_border_radius'))
109 .margin({left: 12}) 119 .margin({left: 12})
110 } 120 }
111 } 121 }
  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 +}
@@ -10,8 +10,8 @@ export struct HeadPictureCardComponent { @@ -10,8 +10,8 @@ export struct HeadPictureCardComponent {
10 Stack() { 10 Stack() {
11 Image(this.compDTO.operDataList[0].coverUrl) 11 Image(this.compDTO.operDataList[0].coverUrl)
12 .width(CommonConstants.FULL_WIDTH) 12 .width(CommonConstants.FULL_WIDTH)
13 - .height(CommonConstants.FULL_HEIGHT)  
14 .autoResize(true) 13 .autoResize(true)
  14 + .borderRadius($r('app.float.image_border_radius'))
15 if (this.compDTO.operDataList[0].newsTitle) { 15 if (this.compDTO.operDataList[0].newsTitle) {
16 Row() 16 Row()
17 .width(CommonConstants.FULL_WIDTH) 17 .width(CommonConstants.FULL_WIDTH)
@@ -38,7 +38,6 @@ export struct HeadPictureCardComponent { @@ -38,7 +38,6 @@ export struct HeadPictureCardComponent {
38 } 38 }
39 .alignContent(Alignment.Bottom) 39 .alignContent(Alignment.Bottom)
40 .width(CommonConstants.FULL_WIDTH) 40 .width(CommonConstants.FULL_WIDTH)
41 - .height(200)  
42 .padding( 41 .padding(
43 { top: 16, bottom: 16, left: 14, right: 14 }) 42 { top: 16, bottom: 16, left: 14, right: 14 })
44 .onClick((event: ClickEvent) => { 43 .onClick((event: ClickEvent) => {
1 -import { ToastUtils, Logger } from 'wdKit'; 1 +import { ToastUtils, Logger, NumberFormatterUtils } from 'wdKit';
  2 +import {
  3 + InputMethodProperty,
  4 + batchLikeAndCollectResult,
  5 + batchLikeAndCollectParams,
  6 + ContentDetailDTO,
  7 + postExecuteLikeParams,
  8 + contentListParams,
  9 + InteractDataDTO,
  10 + postExecuteCollectRecordParams
  11 +} from 'wdBean';
  12 +import router from '@ohos.router';
  13 +import inputMethod from '@ohos.inputMethod';
  14 +import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel';
  15 +import { HttpUrlUtils } from 'wdNetwork/Index';
  16 +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
  17 +import { PageRepository } from '../../repository/PageRepository';
2 18
3 export interface OperationItem { 19 export interface OperationItem {
4 icon: Resource; 20 icon: Resource;
  21 + icon_check?: Resource;
5 text: string | Resource; 22 text: string | Resource;
6 num?: number; // 个数 23 num?: number; // 个数
7 } 24 }
8 25
9 const TAG = 'OperRowListView'; 26 const TAG = 'OperRowListView';
10 27
  28 +@Preview
11 @Component 29 @Component
12 export struct OperRowListView { 30 export struct OperRowListView {
  31 + private contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
  32 + @State interactData: InteractDataDTO = {} as InteractDataDTO
  33 + @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
  34 +
13 @State operationList: OperationItem[] = [ 35 @State operationList: OperationItem[] = [
14 { 36 {
  37 + icon: $r('app.media.ic_comment'),
  38 + text: "评论",
  39 + },
  40 + {
15 icon: $r('app.media.ic_like_uncheck'), 41 icon: $r('app.media.ic_like_uncheck'),
  42 + icon_check: $r('app.media.ic_like_check'),
16 text: "点赞", 43 text: "点赞",
17 - num: 6622  
18 }, 44 },
19 { 45 {
20 icon: $r('app.media.ic_collect_uncheck'), 46 icon: $r('app.media.ic_collect_uncheck'),
  47 + icon_check: $r('app.media.ic_collect_check'),
21 text: "收藏", 48 text: "收藏",
22 - num: 662,  
23 - },  
24 - {  
25 - icon: $r('app.media.ic_comment'),  
26 - text: "评论",  
27 - num: 500,  
28 }, 49 },
29 { 50 {
30 icon: $r('app.media.ic_share'), 51 icon: $r('app.media.ic_share'),
@@ -33,19 +54,64 @@ export struct OperRowListView { @@ -33,19 +54,64 @@ export struct OperRowListView {
33 ] 54 ]
34 55
35 aboutToAppear() { 56 aboutToAppear() {
  57 + if (HttpUrlUtils.getUserId()) {
  58 + this.getInteractDataStatus()
  59 + }
  60 + this.queryContentInteractCount()
36 } 61 }
37 62
38 build() { 63 build() {
39 -  
40 - Row() {  
41 - ForEach(this.operationList, (item: OperationItem, index: number) => {  
42 - this.buildOperationItem(item, index)  
43 - }, (item: OperationItem, index: number) => JSON.stringify(item)) 64 + Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems:ItemAlign.Center }){
  65 + Row() {
  66 + Column() {
  67 + Image($r('app.media.icon_arrow_left_white'))
  68 + .width(24)
  69 + .height(24)
  70 + .aspectRatio(1)
  71 + .interpolation(ImageInterpolation.High)
  72 + }
  73 + .margin({
  74 + top: 0,
  75 + left: 8,
  76 + right: 8,
  77 + bottom: 0
  78 + })
  79 + .alignItems(HorizontalAlign.Center)
  80 + .hoverEffect(HoverEffect.Scale)
  81 + .onClick(() => {
  82 + router.back();
  83 + })
  84 + TextInput({placeholder:'说两句...'})
  85 + .placeholderColor('#999999')
  86 + .placeholderFont(
  87 + {
  88 + size: 12,
  89 + weight: 400,
  90 + family: 'PingFang SC-Regular'
  91 + }
  92 + )
  93 + .caretColor('#1A1A1A')
  94 + .backgroundColor('#1A1A1A')
  95 + .width('61.5%')
  96 + .height(30)
  97 + .borderRadius(0)
  98 + .onClick(() => {
  99 + this.buildInputMethod()
  100 + })
  101 + }
  102 + .width('45.5%')
  103 + .alignItems(VerticalAlign.Center)
  104 + .justifyContent(FlexAlign.Start)
  105 + Flex({ justifyContent: FlexAlign.SpaceAround, alignItems:ItemAlign.Center }) {
  106 + ForEach(this.operationList, (item: OperationItem, index: number) => {
  107 + this.buildOperationItem(item, index)
  108 + }, (item: OperationItem) => JSON.stringify(item))
  109 + }
  110 + .width('54.5%')
44 } 111 }
45 .width('100%') 112 .width('100%')
46 - .height('100%')  
47 - .alignItems(VerticalAlign.Center)  
48 - .justifyContent(FlexAlign.Center) 113 + .height(56)
  114 + .backgroundColor(Color.Black)
49 } 115 }
50 116
51 /** 117 /**
@@ -56,17 +122,288 @@ export struct OperRowListView { @@ -56,17 +122,288 @@ export struct OperRowListView {
56 @Builder 122 @Builder
57 buildOperationItem(item: OperationItem, index: number) { 123 buildOperationItem(item: OperationItem, index: number) {
58 Column() { 124 Column() {
59 - Image(item.icon)  
60 - .width(24)  
61 - .height(24)  
62 - .aspectRatio(1) 125 + if (item.text === '点赞') {
  126 + RelativeContainer() {
  127 + Row() {
  128 + Image(this.newsStatusOfUser?.likeStatus == '1' ? item.icon_check : item.icon)
  129 + .width(24)
  130 + .height(24)
  131 + .aspectRatio(1)
  132 + .interpolation(ImageInterpolation.High)
  133 + .onClick(() => {
  134 + this.toggleLikeStatus()
  135 + })
  136 + }
  137 + .alignRules({
  138 + center: { anchor: '__container__', align: VerticalAlign.Center },
  139 + middle: { anchor: '__container__', align: HorizontalAlign.Center }
  140 + })
  141 + .id(`e_row1_${index}`)
  142 + if(this.interactData?.likeNum > 0) {
  143 + Row() {
  144 + Image($r('app.media.corner_mark'))
  145 + .width(25)
  146 + .height(12)
  147 + .interpolation(ImageInterpolation.High)
  148 + }
  149 + .alignRules({
  150 + top: { anchor: `e_row1_${index}`, align: VerticalAlign.Top },
  151 + left: { anchor: `e_row1_${index}`, align: HorizontalAlign.Center }
  152 + })
  153 + .id(`e_row2_${index}`)
  154 +
  155 + Row() {
  156 + Text(`${this.interactData?.likeNum}`)
  157 + .fontSize(8)
  158 + .textAlign(TextAlign.Center)
  159 + .fontColor(Color.White)
  160 + .lineHeight(12)
  161 + }
  162 + .alignRules({
  163 + top: { anchor: `e_row2_${index}`, align: VerticalAlign.Top },
  164 + middle: { anchor: `e_row2_${index}`, align: HorizontalAlign.Center }
  165 + })
  166 + .id(`e_row3_${index}`)
  167 + }
  168 + }
  169 + .id(`e_icon_${index}`)
  170 + } else if (item.text === '收藏') {
  171 + RelativeContainer() {
  172 + Row() {
  173 + Image(this.newsStatusOfUser?.collectStatus == 1 ? item.icon_check : item.icon)
  174 + .width(24)
  175 + .height(24)
  176 + .aspectRatio(1)
  177 + .interpolation(ImageInterpolation.High)
  178 + .onClick(() => {
  179 + this.toggleCollectStatus()
  180 + })
  181 + }
  182 + .alignRules({
  183 + center: { anchor: '__container__', align: VerticalAlign.Center },
  184 + middle: { anchor: '__container__', align: HorizontalAlign.Center }
  185 + })
  186 + .id(`e_row1_${index}`)
  187 + if(this.interactData?.collectNum > 0) {
  188 + Row() {
  189 + Image($r('app.media.corner_mark'))
  190 + .width(25)
  191 + .height(12)
  192 + .interpolation(ImageInterpolation.High)
  193 + }
  194 + .alignRules({
  195 + top: { anchor: `e_row1_${index}`, align: VerticalAlign.Top },
  196 + left: { anchor: `e_row1_${index}`, align: HorizontalAlign.Center }
  197 + })
  198 + .id(`e_row2_${index}`)
  199 +
  200 + Row() {
  201 + Text(`${this.interactData?.collectNum}`)
  202 + .fontSize(8)
  203 + .textAlign(TextAlign.Center)
  204 + .fontColor(Color.White)
  205 + .lineHeight(12)
  206 + }
  207 + .alignRules({
  208 + top: { anchor: `e_row2_${index}`, align: VerticalAlign.Top },
  209 + middle: { anchor: `e_row2_${index}`, align: HorizontalAlign.Center }
  210 + })
  211 + .id(`e_row3_${index}`)
  212 + }
  213 + }
  214 + .id(`e_icon_${index}`)
  215 + } else if (item.text === '评论') {
  216 + RelativeContainer() {
  217 + Row() {
  218 + Image(item.icon)
  219 + .width(24)
  220 + .height(24)
  221 + .aspectRatio(1)
  222 + .interpolation(ImageInterpolation.High)
  223 + .onClick((event: ClickEvent) => {
  224 + ToastUtils.showToast('评论为公共方法,待开发', 1000);
  225 + })
  226 + }
  227 + .alignRules({
  228 + center: { anchor: '__container__', align: VerticalAlign.Center },
  229 + middle: { anchor: '__container__', align: HorizontalAlign.Center }
  230 + })
  231 + .id(`e_row1_${index}`)
  232 + if(this.interactData?.commentNum > 0) {
  233 + Row() {
  234 + Image($r('app.media.corner_mark'))
  235 + .width(25)
  236 + .height(12)
  237 + .interpolation(ImageInterpolation.High)
  238 + }
  239 + .alignRules({
  240 + top: { anchor: `e_row1_${index}`, align: VerticalAlign.Top },
  241 + left: { anchor: `e_row1_${index}`, align: HorizontalAlign.Center }
  242 + })
  243 + .id(`e_row2_${index}`)
  244 +
  245 + Row() {
  246 + Text(`${this.interactData?.commentNum}`)
  247 + .fontSize(8)
  248 + .textAlign(TextAlign.Center)
  249 + .fontColor(Color.White)
  250 + .lineHeight(12)
  251 + }
  252 + .alignRules({
  253 + top: { anchor: `e_row2_${index}`, align: VerticalAlign.Top },
  254 + middle: { anchor: `e_row2_${index}`, align: HorizontalAlign.Center }
  255 + })
  256 + .id(`e_row3_${index}`)
  257 + }
  258 + }
  259 + .id(`e_icon_${index}`)
  260 + } else {
  261 + RelativeContainer() {
  262 + Row() {
  263 + Image(item.icon)
  264 + .width(24)
  265 + .height(24)
  266 + .aspectRatio(1)
  267 + .interpolation(ImageInterpolation.High)
  268 + .onClick((event: ClickEvent) => {
  269 + ToastUtils.showToast('分享为公共方法,待开发', 1000);
  270 + })
  271 + }
  272 + .alignRules({
  273 + center: { anchor: '__container__', align: VerticalAlign.Center },
  274 + middle: { anchor: '__container__', align: HorizontalAlign.Center }
  275 + })
  276 + .id(`e_row1_${index}`)
  277 + }
  278 + .id(`e_icon_${index}`)
  279 + }
  280 +
63 } 281 }
64 .margin(5) 282 .margin(5)
65 .alignItems(HorizontalAlign.Center) 283 .alignItems(HorizontalAlign.Center)
66 .hoverEffect(HoverEffect.Scale) 284 .hoverEffect(HoverEffect.Scale)
67 - .onClick((event: ClickEvent) => {  
68 - Logger.info(TAG, `buildOperationItem onClick event index: ${index}`);  
69 - ToastUtils.showToast('体验版,本功能暂未开发', 1000); 285 + }
  286 +
  287 + /**
  288 + * 输入法
  289 + */
  290 +
  291 + private buildInputMethod() {
  292 + let im = inputMethod.getCurrentInputMethod();
  293 + let prop: InputMethodProperty = {
  294 + packageName: im.packageName,
  295 + methodId: im.methodId,
  296 + name: im.name,
  297 + id: im.id,
  298 + extra: {}
  299 + }
  300 + try{
  301 + inputMethod.switchInputMethod(prop, (err, result) => {
  302 + if (err !== undefined) {
  303 + console.error('Failed to switchInputMethod: ' + JSON.stringify(err));
  304 + return;
  305 + }
  306 + if (result) {
  307 + console.info('Succeeded in switching inputmethod.');
  308 + } else {
  309 + console.error('Failed to switchInputMethod.');
  310 + }
  311 + });
  312 + } catch(err) {
  313 + console.error('Failed to switchInputMethod: ' + JSON.stringify(err));
  314 + }
  315 + }
  316 +
  317 + // 已登录->查询用户对作品点赞、收藏状态
  318 + private async getInteractDataStatus() {
  319 + try {
  320 + const params: batchLikeAndCollectParams = {
  321 + contentList: [
  322 + {
  323 + contentId: this.contentDetailData?.newsId + '',
  324 + contentType: this.contentDetailData?.newsType + '',
  325 + }
  326 + ]
  327 + }
  328 + console.error(TAG, JSON.stringify(this.contentDetailData))
  329 + let data = await MultiPictureDetailViewModel.getInteractDataStatus(params)
  330 + console.error(TAG, '查询用户对作品点赞、收藏状态', JSON.stringify(data))
  331 + this.newsStatusOfUser = data[0];
  332 + Logger.info(TAG, `newsStatusOfUser:${JSON.stringify(this.newsStatusOfUser)}`)
  333 + } catch (exception) {
  334 + console.error(TAG, JSON.stringify(exception))
  335 + }
  336 + }
  337 +
  338 + /**
  339 + * 点赞、取消点赞
  340 + */
  341 + toggleLikeStatus() {
  342 + // 未登录,跳转登录
  343 + if (!HttpUrlUtils.getUserId()) {
  344 + WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
  345 + return
  346 + }
  347 + const params: postExecuteLikeParams = {
  348 + status: this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1',
  349 + contentId: this.contentDetailData?.newsId + '',
  350 + contentType: this.contentDetailData?.newsType + '',
  351 + }
  352 + PageRepository.postExecuteLike(params).then(res => {
  353 + console.log(TAG, '点赞、取消点赞', 'toggleLikeStatus==',)
  354 + if (this.newsStatusOfUser) {
  355 + this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1'
  356 + this.queryContentInteractCount()
  357 + }
  358 +
  359 + })
  360 + }
  361 + /**
  362 + * 收藏、取消收藏
  363 + */
  364 + toggleCollectStatus() {
  365 + // 未登录,跳转登录
  366 + if (!HttpUrlUtils.getUserId()) {
  367 + WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
  368 + return
  369 + }
  370 + const params: postExecuteCollectRecordParams = {
  371 + status: this.newsStatusOfUser?.collectStatus === 1 ? '0' : '1',
  372 + contentList: [{
  373 + contentId: this.contentDetailData?.newsId + '',
  374 + contentType: this.contentDetailData?.newsType + '',
  375 + }],
  376 +
  377 + }
  378 + PageRepository.postExecuteCollectRecord(params).then(res => {
  379 + console.log(TAG, '收藏、取消收藏','toggleLikeStatus==',)
  380 + if (this.newsStatusOfUser) {
  381 + this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
  382 + this.queryContentInteractCount()
  383 + }
  384 + })
  385 +
  386 + }
  387 +
  388 + /**
  389 + * 查询点赞、收藏数量
  390 + */
  391 + queryContentInteractCount() {
  392 + console.error(TAG,'contentDetailData2222', JSON.stringify(this.contentDetailData))
  393 + const params: contentListParams = {
  394 + contentList: [{
  395 + contentId: this.contentDetailData?.newsId + '',
  396 + contentType: this.contentDetailData?.newsType,
  397 + }]
  398 + }
  399 + PageRepository.getContentInteract(params).then(res => {
  400 + if (res.data) {
  401 + this.interactData.likeNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.likeNum)
  402 + this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum)
  403 + this.interactData.commentNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.commentNum)
  404 + }
  405 + console.log(TAG, '获取互动点赞等数据===', JSON.stringify(res))
  406 + console.log(TAG, 'this.interactData', JSON.stringify(this.interactData))
70 }) 407 })
71 } 408 }
72 } 409 }
@@ -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)
  1 +import { Logger } from 'wdKit';
1 import { AreaListManageModel, AreaListModel } from '../../../model/AreaListModel'; 2 import { AreaListManageModel, AreaListModel } from '../../../model/AreaListModel';
2 import EditInfoViewModel from '../../../viewmodel/EditInfoViewModel'; 3 import EditInfoViewModel from '../../../viewmodel/EditInfoViewModel';
3 import { FirstLevelComponent } from './FirstLevelComponent'; 4 import { FirstLevelComponent } from './FirstLevelComponent';
@@ -12,11 +13,7 @@ export struct AreaPickerDialog { @@ -12,11 +13,7 @@ export struct AreaPickerDialog {
12 title: string = '地区选择' 13 title: string = '地区选择'
13 @Provide dataSource: AreaListModel[] = [] 14 @Provide dataSource: AreaListModel[] = []
14 result: JSON[] = []; 15 result: JSON[] = [];
15 -  
16 - aboutToAppear(){  
17 - this.currentFirst = EditInfoViewModel.getAreaListManageModel(this.dataSource[0])  
18 - this.currentSecondBean = EditInfoViewModel.getAreaListManageModel(this.dataSource[0].children[0])  
19 - this.currentThirdBean = EditInfoViewModel.getAreaListManageModel(this.dataSource[0].children[0].children[0]) 16 + confirmCallback: (area:string) => void = () => {
20 } 17 }
21 18
22 build() { 19 build() {
@@ -39,7 +36,8 @@ export struct AreaPickerDialog { @@ -39,7 +36,8 @@ export struct AreaPickerDialog {
39 36
40 Button('确定',{type:ButtonType.Normal}) 37 Button('确定',{type:ButtonType.Normal})
41 .onClick(()=> { 38 .onClick(()=> {
42 - 39 + this.controller.close()
  40 + this.confirmCallback(this.currentFirst.label+this.currentSecondBean.label+this.currentThirdBean.label);
43 }) 41 })
44 .backgroundColor(0xffffff) 42 .backgroundColor(0xffffff)
45 .fontColor(Color.Blue) 43 .fontColor(Color.Blue)
@@ -12,6 +12,7 @@ export struct FirstLevelComponent { @@ -12,6 +12,7 @@ export struct FirstLevelComponent {
12 const element = this.dataSource[index]; 12 const element = this.dataSource[index];
13 this.labelList.push(element.label) 13 this.labelList.push(element.label)
14 } 14 }
  15 + this.currentFirst = EditInfoViewModel.getAreaListManageModel(this.dataSource[this.select])
15 } 16 }
16 17
17 build() { 18 build() {
@@ -21,10 +22,10 @@ export struct FirstLevelComponent { @@ -21,10 +22,10 @@ export struct FirstLevelComponent {
21 Text('暂无数据').fontSize(20) 22 Text('暂无数据').fontSize(20)
22 }else { 23 }else {
23 TextPicker({range:this.labelList,selected:this.select}) 24 TextPicker({range:this.labelList,selected:this.select})
24 - // .onChange((value:string,index:number) => {  
25 - // this.select = index  
26 - // this.currentFirst = EditInfoViewModel.getAreaListManageModel(this.dataSource[index])  
27 - // }) 25 + .onChange((value: string | string[], index: number | number[]) => {
  26 + this.select = index as number
  27 + this.currentFirst = EditInfoViewModel.getAreaListManageModel(this.dataSource[index as number])
  28 + })
28 .backgroundColor(Color.White) 29 .backgroundColor(Color.White)
29 .border({color:'#e2e2e2',width:{right:0.5}}) 30 .border({color:'#e2e2e2',width:{right:0.5}})
30 .width('100%') 31 .width('100%')
1 import { AreaListManageModel, AreaListModel } from '../../../model/AreaListModel'; 1 import { AreaListManageModel, AreaListModel } from '../../../model/AreaListModel';
2 - 2 +import EditInfoViewModel from '../../../viewmodel/EditInfoViewModel';
3 @Component 3 @Component
4 export struct SecondLevelComponent { 4 export struct SecondLevelComponent {
5 @State mTip: string = '暂无数据' 5 @State mTip: string = '暂无数据'
@@ -8,13 +8,6 @@ export struct SecondLevelComponent { @@ -8,13 +8,6 @@ export struct SecondLevelComponent {
8 @Consume @Watch('onFirstChange') currentFirst: AreaListManageModel; 8 @Consume @Watch('onFirstChange') currentFirst: AreaListManageModel;
9 @Consume currentSecondBean: AreaListManageModel 9 @Consume currentSecondBean: AreaListManageModel
10 10
11 - aboutToAppear(){  
12 - for (let index = 0; index < this.currentFirst.children.length; index++) {  
13 - const element = this.currentFirst.children[index];  
14 - this.labelList.push(element.label)  
15 - }  
16 - }  
17 -  
18 build() { 11 build() {
19 Column(){ 12 Column(){
20 Column(){ 13 Column(){
@@ -22,10 +15,10 @@ export struct SecondLevelComponent { @@ -22,10 +15,10 @@ export struct SecondLevelComponent {
22 Text(this.mTip).fontSize(20) 15 Text(this.mTip).fontSize(20)
23 }else { 16 }else {
24 TextPicker({range:this.labelList,selected:this.select}) 17 TextPicker({range:this.labelList,selected:this.select})
25 - // .onChange((value:string,index:number) => {  
26 - // this.select = index  
27 - // this.currentSecondBean = this.currentFirst.children[index]  
28 - // }) 18 + .onChange((value: string | string[], index: number | number[]) => {
  19 + this.select = index as number
  20 + this.currentSecondBean = EditInfoViewModel.getAreaListManageModel(this.currentFirst.children[index as number])
  21 + })
29 .backgroundColor(Color.White) 22 .backgroundColor(Color.White)
30 .border({color:'#e2e2e2',width:{right:0.5}}) 23 .border({color:'#e2e2e2',width:{right:0.5}})
31 .width('100%') 24 .width('100%')
@@ -47,7 +40,7 @@ export struct SecondLevelComponent { @@ -47,7 +40,7 @@ export struct SecondLevelComponent {
47 const element = this.currentFirst.children[index]; 40 const element = this.currentFirst.children[index];
48 this.labelList.push(element.label) 41 this.labelList.push(element.label)
49 } 42 }
50 - // this.currentSecondBean = this.currentFirst.children[this.select] 43 + this.currentSecondBean = EditInfoViewModel.getAreaListManageModel(this.currentFirst.children[this.select])
51 } 44 }
52 } 45 }
53 } 46 }
1 import { AreaListManageModel, AreaListModel } from '../../../model/AreaListModel'; 1 import { AreaListManageModel, AreaListModel } from '../../../model/AreaListModel';
2 - 2 +import EditInfoViewModel from '../../../viewmodel/EditInfoViewModel';
3 @Component 3 @Component
4 export struct ThirdLevelComponent { 4 export struct ThirdLevelComponent {
5 @State mTip: string = '暂无数据' 5 @State mTip: string = '暂无数据'
@@ -9,13 +9,6 @@ export struct ThirdLevelComponent { @@ -9,13 +9,6 @@ export struct ThirdLevelComponent {
9 @Consume @Watch('onSecondChange') currentSecondBean: AreaListManageModel; 9 @Consume @Watch('onSecondChange') currentSecondBean: AreaListManageModel;
10 @Consume currentThirdBean: AreaListManageModel 10 @Consume currentThirdBean: AreaListManageModel
11 11
12 - aboutToAppear(){  
13 - for (let index = 0; index < this.currentSecondBean.children.length; index++) {  
14 - const element = this.currentSecondBean.children[index];  
15 - this.labelList.push(element.label)  
16 - }  
17 - }  
18 -  
19 build() { 12 build() {
20 Column(){ 13 Column(){
21 Column(){ 14 Column(){
@@ -23,10 +16,10 @@ export struct ThirdLevelComponent { @@ -23,10 +16,10 @@ export struct ThirdLevelComponent {
23 Text(this.mTip).fontSize(20) 16 Text(this.mTip).fontSize(20)
24 }else { 17 }else {
25 TextPicker({range:this.labelList,selected:this.select}) 18 TextPicker({range:this.labelList,selected:this.select})
26 - // .onChange((value:string,index:number) => {  
27 - // this.select = index  
28 - // this.currentThirdBean = this.currentSecondBean.children[index]  
29 - // }) 19 + .onChange((value: string | string[], index: number | number[]) => {
  20 + this.select = index as number
  21 + this.currentThirdBean = EditInfoViewModel.getAreaListManageModel(this.currentSecondBean.children[index as number])
  22 + })
30 .backgroundColor(Color.White) 23 .backgroundColor(Color.White)
31 .border({color:'#e2e2e2',width:{right:0.5}}) 24 .border({color:'#e2e2e2',width:{right:0.5}})
32 .width('100%') 25 .width('100%')
@@ -52,7 +45,7 @@ export struct ThirdLevelComponent { @@ -52,7 +45,7 @@ export struct ThirdLevelComponent {
52 const element = this.currentSecondBean.children[index]; 45 const element = this.currentSecondBean.children[index];
53 this.labelList.push(element.label) 46 this.labelList.push(element.label)
54 } 47 }
55 - // this.currentThirdBean = this.currentSecondBean.children[this.select] 48 + this.currentThirdBean = EditInfoViewModel.getAreaListManageModel(this.currentSecondBean.children[this.select])
56 } 49 }
57 } 50 }
58 } 51 }
1 1
  2 +/**
  3 + * WDEditDataModelType 更新资料类型
  4 + */
  5 +export const enum WDEditDataModelType {
  6 + WDEditDataModelType_default, //默认不修改
  7 + WDEditDataModelType_head, //头像
  8 + WDEditDataModelType_nickname, //昵称
  9 + WDEditDataModelType_intro, //简介
  10 + WDEditDataModelType_sex, //性别
  11 + WDEditDataModelType_birthday, //生日
  12 + WDEditDataModelType_region, //地址
  13 +}
  14 +
2 export class EditListInfo{ 15 export class EditListInfo{
3 //标题 16 //标题
4 title:string 17 title:string
@@ -11,32 +24,57 @@ export class EditListInfo{ @@ -11,32 +24,57 @@ export class EditListInfo{
11 } 24 }
12 } 25 }
13 26
14 -export interface EditInfoModel{ 27 +export class EditInfoModel{
15 //头像 28 //头像
16 - headPhotoUrl:string 29 + headPhotoUrl:string = ''
17 //简介 30 //简介
18 - introduction:string 31 + introduction:string = ''
19 //城市 32 //城市
20 - city:string 33 + city:string = ''
21 //地区 34 //地区
22 - county:string 35 + county:string = ''
23 //生日 36 //生日
24 - birthday:string 37 + birthday:string = ''
25 //性别 38 //性别
26 - sex:number 39 + sex:string = ''
27 40
28 - airec:number 41 + airec:number = 0
29 42
  43 + constructor(headPhotoUrl?:string , introduction?:string,city?:string , county?:string,birthday?:string , sex?:string,airec?:number) {
  44 + }
30 } 45 }
31 46
32 -export interface editModel{  
33 - userName:string 47 +export class editModel{
  48 + userName:string = ''
  49 +
  50 + userNameStatus:string = ''
34 51
35 - userNameStatus:string 52 + phone:string = ''
36 53
37 - phone:string 54 + headPhotoStatus:string = ''
38 55
39 - headPhotoStatus:string 56 + userExtend:EditInfoModel = new EditInfoModel()
  57 +
  58 + editDataType:WDEditDataModelType = 0
  59 +
  60 + constructor(userName?:string , userNameStatus?:string,phone?:string , headPhotoStatus?:string,userExtend?:EditInfoModel,editDataType?:WDEditDataModelType) {
  61 + }
  62 +}
40 63
41 - userExtend:EditInfoModel 64 +export interface editModelParams {
  65 + editContent?: string;
  66 +
  67 + userName?: string;
  68 +
  69 + introduction?: string;
  70 +
  71 + //地区
  72 + city?:string;
  73 + county?:string;
  74 + province?:string;
  75 +
  76 + //生日
  77 + birthday?:string;
  78 + //性别
  79 + sex?:string;
42 } 80 }
@@ -197,16 +197,15 @@ struct MineHomePage { @@ -197,16 +197,15 @@ struct MineHomePage {
197 this.currentIndex = index 197 this.currentIndex = index
198 }) 198 })
199 .vertical(false) 199 .vertical(false)
200 - .height("100%")  
201 }.width("100%") 200 }.width("100%")
202 } 201 }
203 .edgeEffect(EdgeEffect.None) 202 .edgeEffect(EdgeEffect.None)
204 .scrollBar(BarState.Off) 203 .scrollBar(BarState.Off)
205 .width('100%') 204 .width('100%')
206 - .height('100%') 205 + .layoutWeight(1)
207 } 206 }
208 }.width('100%') 207 }.width('100%')
209 - .height('100%') 208 + .layoutWeight(1)
210 209
211 } 210 }
212 @Builder MineHomeTitleTransparent() { 211 @Builder MineHomeTitleTransparent() {
@@ -190,16 +190,15 @@ struct OtherNormalUserHomePage { @@ -190,16 +190,15 @@ struct OtherNormalUserHomePage {
190 this.currentIndex = index 190 this.currentIndex = index
191 }) 191 })
192 .vertical(false) 192 .vertical(false)
193 - .height("100%")  
194 }.width("100%") 193 }.width("100%")
195 } 194 }
196 .edgeEffect(EdgeEffect.None) 195 .edgeEffect(EdgeEffect.None)
197 .scrollBar(BarState.Off) 196 .scrollBar(BarState.Off)
198 .width('100%') 197 .width('100%')
199 - .height('100%') 198 + .layoutWeight(1)
200 } 199 }
201 }.width('100%') 200 }.width('100%')
202 - .height('100%') 201 + .layoutWeight(1)
203 202
204 } 203 }
205 @Builder MineHomeTitleTransparent() { 204 @Builder MineHomeTitleTransparent() {
@@ -5,13 +5,19 @@ import { @@ -5,13 +5,19 @@ import {
5 CompInfoBean, 5 CompInfoBean,
6 ContentDetailDTO, 6 ContentDetailDTO,
7 InteractDataDTO, 7 InteractDataDTO,
8 - InteractDataStatusBean, 8 + batchLikeAndCollectResult,
9 MorningEveningPaperDTO, 9 MorningEveningPaperDTO,
10 NavigationBodyDTO, 10 NavigationBodyDTO,
11 NewspaperListBean, 11 NewspaperListBean,
12 NewspaperTimeInfoBean, 12 NewspaperTimeInfoBean,
13 PageDTO, 13 PageDTO,
14 - PageInfoBean 14 + PageInfoBean,
  15 + postBatchAttentionStatusParams,
  16 + postBatchAttentionStatusResult,
  17 + postExecuteLikeParams,
  18 + postExecuteCollectRecordParams,
  19 + contentListParams,
  20 + postInteractAccentionOperateParams
15 } from 'wdBean'; 21 } from 'wdBean';
16 22
17 const TAG = 'HttpRequest'; 23 const TAG = 'HttpRequest';
@@ -99,7 +105,7 @@ export class PageRepository { @@ -99,7 +105,7 @@ export class PageRepository {
99 } 105 }
100 106
101 /** 107 /**
102 - * 早晚报pageInfo请求 TODO 现网无数据写死测试环境 108 + * 早晚报pageInfo请求
103 * */ 109 * */
104 static getMorningEveningPageInfoUrl(pageId: string) { 110 static getMorningEveningPageInfoUrl(pageId: string) {
105 let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_PAGE_INFO_PATH; 111 let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_PAGE_INFO_PATH;
@@ -118,7 +124,7 @@ export class PageRepository { @@ -118,7 +124,7 @@ export class PageRepository {
118 * 124 *
119 * 可选 125 * 可选
120 * channelId:频道id 126 * channelId:频道id
121 - * channelStrategy:频道策略 TODO 现网无数据写死测试环境 127 + * channelStrategy:频道策略
122 * topicId:专题id 128 * topicId:专题id
123 * */ 129 * */
124 static getMorningEveningCompInfoUrl(pageId: number, groupId: number, refreshTime: string, topicId: string, pageNum: number, pageSize: number) { 130 static getMorningEveningCompInfoUrl(pageId: number, groupId: number, refreshTime: string, topicId: string, pageNum: number, pageSize: number) {
@@ -172,9 +178,41 @@ export class PageRepository { @@ -172,9 +178,41 @@ export class PageRepository {
172 static fetchInteractDataStatus(param: object) { 178 static fetchInteractDataStatus(param: object) {
173 let url = PageRepository.getInteractDataStatusUrl() 179 let url = PageRepository.getInteractDataStatusUrl()
174 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 180 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
175 - return WDHttp.post<ResponseDTO<InteractDataStatusBean[]>>(url, param, headers) 181 + return WDHttp.post<ResponseDTO<batchLikeAndCollectResult[]>>(url, param, headers)
176 }; 182 };
177 183
  184 + /**
  185 + * 用户点赞、取消点赞
  186 + * @param params
  187 + * @returns
  188 + */
  189 + static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> {
  190 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE
  191 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  192 + return WDHttp.post0(url, params, headers)
  193 + }
  194 +
  195 + /**
  196 + * 用户收藏、取消收藏
  197 + * @param params
  198 + * @returns
  199 + */
  200 + static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> {
  201 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTECOLLECTRECORD
  202 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  203 + return WDHttp.post0(url, params, headers)
  204 + }
  205 +
  206 + /**
  207 + *
  208 + * @returns
  209 + */
  210 + static getContentInteract(params: contentListParams): Promise<ResponseDTO<InteractDataDTO[]>> {
  211 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH
  212 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  213 + return WDHttp.post0(url, params, headers)
  214 + }
  215 +
178 // 浏览历史新增、删除接口 216 // 浏览历史新增、删除接口
179 static fetchInteractBrowsOperate(param: object) { 217 static fetchInteractBrowsOperate(param: object) {
180 let url = PageRepository.getInteractBrowsOperateUrl() 218 let url = PageRepository.getInteractBrowsOperateUrl()
@@ -182,6 +220,25 @@ export class PageRepository { @@ -182,6 +220,25 @@ export class PageRepository {
182 return WDHttp.post<ResponseDTO<null>>(url, param, headers) 220 return WDHttp.post<ResponseDTO<null>>(url, param, headers)
183 }; 221 };
184 222
  223 + /**
  224 + * 批量查号主是否为用户关注
  225 + * @returns
  226 + */
  227 + static fetchBatchAttentionStatus(params: postBatchAttentionStatusParams): Promise<ResponseDTO<postBatchAttentionStatusResult[]>> {
  228 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH
  229 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  230 + return WDHttp.post0(url, params, headers)
  231 + }
  232 +
  233 + /**
  234 + * 关注号主
  235 + */
  236 + static postInteractAccentionOperate(params: postInteractAccentionOperateParams): Promise<ResponseDTO> {
  237 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_ACCENTION_OPERATION
  238 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  239 + return WDHttp.post0(url, params, headers)
  240 + }
  241 +
185 static fetchNewspaperInfo(date: string) { 242 static fetchNewspaperInfo(date: string) {
186 let url = PageRepository.getNewspaperInfoUrl(date) 243 let url = PageRepository.getNewspaperInfoUrl(date)
187 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 244 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
@@ -211,4 +268,28 @@ export class PageRepository { @@ -211,4 +268,28 @@ export class PageRepository {
211 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 268 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
212 return WDHttp.get<ResponseDTO<CompInfoBean>>(url, headers) 269 return WDHttp.get<ResponseDTO<CompInfoBean>>(url, headers)
213 }; 270 };
214 -}  
  271 +
  272 + /**
  273 + * 获取播报pageInfo
  274 + * */
  275 + static fetchBroadcastPageInfo(pageId: string) {
  276 + let url = PageRepository.getMorningEveningPageInfoUrl(pageId)
  277 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  278 + return WDHttp.get<ResponseDTO<PageInfoBean>>(url, headers)
  279 + };
  280 +
  281 + /**
  282 + * 获取播报compInfo
  283 + * https://pdapis.pdnews.cn/api/rmrb-bff-display-zh/display/zh/c/compInfo
  284 + * @param params
  285 + * @returns
  286 + * */
  287 + static fetchBroadcastCompInfo(pageId: number, groupId: number, refreshTime: string, topicId:
  288 + string, channelId: string) {
  289 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_COMP_INFO_PATH;
  290 + url = `${url}?topicId=${topicId}&channelStrategy=2&groupId=${groupId}&refreshTime=${refreshTime}&pageSize=50&recommend=0&pageId=${pageId}&loadStrategy=first_load&pageNum=1&channelId=${channelId}`
  291 + Logger.info(TAG, "getMorningEveningCompInfoUrl url = " + url)
  292 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  293 + return WDHttp.get<ResponseDTO<CompInfoBean>>(url, headers)
  294 + };
  295 +}
  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 +}
1 1
2 -import { EditInfoModel, EditListInfo, editModel } from '../model/EditInfoModel'; 2 +import { EditInfoModel, EditListInfo, editModel, editModelParams, WDEditDataModelType } from '../model/EditInfoModel';
3 import HashMap from '@ohos.util.HashMap'; 3 import HashMap from '@ohos.util.HashMap';
4 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; 4 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
5 import { Logger, ResourcesUtils } from 'wdKit'; 5 import { Logger, ResourcesUtils } from 'wdKit';
@@ -27,15 +27,20 @@ class EditInfoViewModel { @@ -27,15 +27,20 @@ class EditInfoViewModel {
27 return WDHttp.get<ResponseDTO>(requestUrl,headers) 27 return WDHttp.get<ResponseDTO>(requestUrl,headers)
28 } 28 }
29 29
  30 + BasePOSTRequest(requestUrl:string){
  31 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders()
  32 + requestUrl = HttpUrlUtils.HOST_SIT + requestUrl
  33 + return WDHttp.post<ResponseDTO>(requestUrl,headers)
  34 + }
  35 +
30 36
31 getEditListInfo(item?:editModel):EditListInfo[]{ 37 getEditListInfo(item?:editModel):EditListInfo[]{
32 this.editListData = [ 38 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?'男':'女':'待完善'),  
38 - ] 39 + new EditListInfo('昵称',item&&item.userName.length > 0?item.userName:'待完善'),
  40 + new EditListInfo('简介',item&&item.userExtend.introduction.length > 0?item.userExtend.introduction:'待完善'),
  41 + new EditListInfo('地区',item&&item.userExtend.city.length > 0?item.userExtend.city:'待完善'),
  42 + new EditListInfo('生日',item&&item.userExtend.birthday.length > 0?item.userExtend.birthday:'待完善'),
  43 + new EditListInfo('性别',item&&item.userExtend.sex.length > 0?(item.userExtend.sex=== '1'?'男':'女'):'待完善'),]
39 return this.editListData 44 return this.editListData
40 } 45 }
41 46
@@ -51,7 +56,6 @@ class EditInfoViewModel { @@ -51,7 +56,6 @@ class EditInfoViewModel {
51 }).catch((error: Error) => { 56 }).catch((error: Error) => {
52 Logger.info('EditInfoViewModel','EditInfoViewModel','EditInfoViewModel') 57 Logger.info('EditInfoViewModel','EditInfoViewModel','EditInfoViewModel')
53 success(this.GetqueryAccountOwnerLocal(context)) 58 success(this.GetqueryAccountOwnerLocal(context))
54 -  
55 }) 59 })
56 })) 60 }))
57 } 61 }
@@ -61,14 +65,14 @@ class EditInfoViewModel { @@ -61,14 +65,14 @@ class EditInfoViewModel {
61 let compRes: ResponseDTO<editModel> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<editModel>>(context,'userInfo.json'); 65 let compRes: ResponseDTO<editModel> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<editModel>>(context,'userInfo.json');
62 if (!compRes || !compRes.data) { 66 if (!compRes || !compRes.data) {
63 Logger.info(TAG, `getAppointmentListDataLocal compRes is empty`); 67 Logger.info(TAG, `getAppointmentListDataLocal compRes is empty`);
64 - return {} as editModel 68 + return new editModel()
65 } 69 }
66 Logger.info(TAG, `getAppointmentListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`); 70 Logger.info(TAG, `getAppointmentListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);
67 return compRes.data 71 return compRes.data
68 } 72 }
69 73
70 getAreaList(context: Context):PromiseLike<AreaListModel[]>{ 74 getAreaList(context: Context):PromiseLike<AreaListModel[]>{
71 - return new Promise(((success, error) => { 75 + return new Promise((success, error) => {
72 success(this.getAreaListLocal(context)) 76 success(this.getAreaListLocal(context))
73 // this.BaseGetRequest(HttpUrlUtils.APPOINTMENT_AccountOwner_PATH).then((navResDTO:ResponseDTO) =>{ 77 // this.BaseGetRequest(HttpUrlUtils.APPOINTMENT_AccountOwner_PATH).then((navResDTO:ResponseDTO) =>{
74 // if (navResDTO.code == 200) { 78 // if (navResDTO.code == 200) {
@@ -81,7 +85,7 @@ class EditInfoViewModel { @@ -81,7 +85,7 @@ class EditInfoViewModel {
81 // success(this.GetqueryAccountOwnerLocal(context)) 85 // success(this.GetqueryAccountOwnerLocal(context))
82 // 86 //
83 // }) 87 // })
84 - })) 88 + })
85 } 89 }
86 90
87 async getAreaListLocal(context: Context): Promise<AreaListModel[]> { 91 async getAreaListLocal(context: Context): Promise<AreaListModel[]> {
@@ -99,9 +103,33 @@ class EditInfoViewModel { @@ -99,9 +103,33 @@ class EditInfoViewModel {
99 return new AreaListManageModel(item.code,item.id,item.label,item.children) 103 return new AreaListManageModel(item.code,item.id,item.label,item.children)
100 } 104 }
101 105
102 - updateUserInfo(){  
103 -  
104 - } 106 + // updateUserInfo(item?:editModel):Promise<ResponseDTO> {
  107 + // let params: editModelParams = {};
  108 + // if (item.editDataType === WDEditDataModelType.WDEditDataModelType_head) {
  109 + // // params =
  110 + // } else if (item.editDataType === WDEditDataModelType.WDEditDataModelType_nickname) {
  111 + // params = { userName: item.userName }
  112 + // } else if (item.editDataType === WDEditDataModelType.WDEditDataModelType_intro) {
  113 + // params = { introduction: item.userExtend.introduction }
  114 + // } else if (item.editDataType === WDEditDataModelType.WDEditDataModelType_sex) {
  115 + // params = { sex: item.userExtend.sex }
  116 + // } else if (item.editDataType === WDEditDataModelType.WDEditDataModelType_birthday) {
  117 + // params = { birthday: item.userExtend.birthday }
  118 + // } else if (item.editDataType === WDEditDataModelType.WDEditDataModelType_region) {
  119 + // params = { county: item.userExtend.county }
  120 + // } else {
  121 + // }
  122 + // return new Promise((success, error) => {
  123 + // this.BasePOSTRequest(HttpUrlUtils.APPOINTMENT_editUserDetail_PATH)
  124 + // .then((navResDTO: ResponseDTO) => {
  125 + // if (navResDTO.code == 200) {
  126 + // }
  127 + // })
  128 + // .catch((error: Error) => {
  129 + //
  130 + // })
  131 + // })
  132 + // }
105 133
106 } 134 }
107 135
1 import { Logger } from 'wdKit'; 1 import { Logger } from 'wdKit';
2 import { ResponseDTO } from 'wdNetwork'; 2 import { ResponseDTO } from 'wdNetwork';
3 -import { ContentDetailDTO } from 'wdBean'; 3 +import { ContentDetailDTO,
  4 + batchLikeAndCollectParams,
  5 + batchLikeAndCollectResult,
  6 + postBatchAttentionStatusParams,
  7 + postBatchAttentionStatusResult,
  8 + postInteractBrowsOperateParams
  9 +} from 'wdBean';
4 import { PageRepository } from '../repository/PageRepository'; 10 import { PageRepository } from '../repository/PageRepository';
5 11
6 const TAG = 'MultiPictureDetailViewModel'; 12 const TAG = 'MultiPictureDetailViewModel';
7 13
8 export class MultiPictureDetailViewModel { 14 export class MultiPictureDetailViewModel {
9 15
10 - /*fetchDetailData  
11 - fetchInteractData  
12 - fetchInteractDataStatus  
13 - fetchInteractBrowsOperate*/  
14 -  
15 static async getDetailData(relId: string, contentId: string, relType: string): Promise<ContentDetailDTO[]> { 16 static async getDetailData(relId: string, contentId: string, relType: string): Promise<ContentDetailDTO[]> {
16 return new Promise<ContentDetailDTO[]>((success, error) => { 17 return new Promise<ContentDetailDTO[]>((success, error) => {
17 Logger.info(TAG, `fetchDetailData start`); 18 Logger.info(TAG, `fetchDetailData start`);
@@ -34,4 +35,75 @@ export class MultiPictureDetailViewModel { @@ -34,4 +35,75 @@ export class MultiPictureDetailViewModel {
34 }) 35 })
35 }) 36 })
36 } 37 }
  38 +
  39 + /**
  40 + * 批量查询作品查询点赞、收藏状态
  41 + * @returns
  42 + */
  43 + static async getInteractDataStatus(params:batchLikeAndCollectParams): Promise<batchLikeAndCollectResult[]> {
  44 + return new Promise<batchLikeAndCollectResult[]>((success, error) => {
  45 + Logger.info(TAG, `fetchInteractDataStatus start`);
  46 + PageRepository.fetchInteractDataStatus(params).then((resDTO: ResponseDTO<batchLikeAndCollectResult[]>) => {
  47 + if (!resDTO || !resDTO.data) {
  48 + Logger.error(TAG, 'fetchInteractDataStatus is empty');
  49 + error('resDTO is empty');
  50 + return
  51 + }
  52 + if (resDTO.code != 0) {
  53 + Logger.error(TAG, `fetchInteractDataStatus then code:${resDTO.code}, message:${resDTO.message}`);
  54 + error('resDTO Response Code is failure');
  55 + return
  56 + }
  57 + Logger.info(TAG, "fetchInteractDataStatus then,navResDTO.timestamp:" + resDTO.timestamp);
  58 + success(resDTO.data);
  59 + }).catch((err: Error) => {
  60 + Logger.error(TAG, `fetchInteractDataStatus catch, error.name : ${err.name}, error.message:${err.message}`);
  61 + error(err);
  62 + })
  63 + })
  64 + }
  65 +
  66 + // 已登录->批量查作品是否被号主关注
  67 + static async getBatchAttentionStatus(params: postBatchAttentionStatusParams): Promise<postBatchAttentionStatusResult[]> {
  68 + return new Promise<postBatchAttentionStatusResult[]>((success, error) => {
  69 + Logger.info(TAG, `fetchBatchAttentionStatus start`);
  70 + PageRepository.fetchBatchAttentionStatus(params).then((resDTO: ResponseDTO<postBatchAttentionStatusResult[]>) => {
  71 + if (!resDTO || !resDTO.data) {
  72 + Logger.error(TAG, 'fetchBatchAttentionStatus is empty');
  73 + error('resDTO is empty');
  74 + return
  75 + }
  76 + if (resDTO.code != 0) {
  77 + Logger.error(TAG, `fetchBatchAttentionStatus then code:${resDTO.code}, message:${resDTO.message}`);
  78 + error('resDTO Response Code is failure');
  79 + return
  80 + }
  81 + Logger.info(TAG, "fetchBatchAttentionStatus then,navResDTO.timestamp:" + resDTO.timestamp);
  82 + success(resDTO.data);
  83 + }).catch((err: Error) => {
  84 + Logger.error(TAG, `fetchBatchAttentionStatus catch, error.name : ${err.name}, error.message:${err.message}`);
  85 + error(err);
  86 + })
  87 + })
  88 + }
  89 +
  90 + // 记录浏览历史
  91 + static async getInteractBrowsOperate(params: postInteractBrowsOperateParams): Promise<ResponseDTO<null>> {
  92 + return new Promise<ResponseDTO<null>>((success, error) => {
  93 + Logger.info(TAG, `fetchInteractBrowsOperate start`);
  94 + PageRepository.fetchInteractBrowsOperate(params).then((resDTO: ResponseDTO<null>) => {
  95 + if (resDTO.code != 0) {
  96 + Logger.error(TAG, `fetchInteractBrowsOperate then code:${resDTO.code}, message:${resDTO.message}`);
  97 + error('resDTO Response Code is failure');
  98 + return
  99 + }
  100 + Logger.info(TAG, "fetchInteractBrowsOperate then,navResDTO.timestamp:" + resDTO.timestamp);
  101 + success(resDTO);
  102 + }).catch((err: Error) => {
  103 + Logger.error(TAG, `fetchInteractBrowsOperate catch, error.name : ${err.name}, error.message:${err.message}`);
  104 + error(err);
  105 + })
  106 + })
  107 + }
  108 +
37 } 109 }
@@ -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 { Logger, ResourcesUtils } from 'wdKit'; 1 import { Logger, ResourcesUtils } from 'wdKit';
2 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; 2 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
3 -import { ContentDetailDTO } from 'wdBean'; 3 +import { ContentDetailDTO, InteractDataDTO } from 'wdBean';
4 import HashMap from '@ohos.util.HashMap'; 4 import HashMap from '@ohos.util.HashMap';
5 5
6 const TAG = 'ContentDetailRequest'; 6 const TAG = 'ContentDetailRequest';
@@ -13,11 +13,118 @@ export interface ContentDetailRequestParams { @@ -13,11 +13,118 @@ export interface ContentDetailRequestParams {
13 relType: string 13 relType: string
14 } 14 }
15 15
16 -export interface recommentVideoListParame { 16 +export interface recommentVideoListParams {
17 pageSize: number; 17 pageSize: number;
18 refreshCnt: number; 18 refreshCnt: number;
19 } 19 }
20 - 20 +
  21 +interface contentListItem {
  22 + contentId: string;
  23 + contentType: number;
  24 +}
  25 +
  26 +export interface contentListParams {
  27 + contentList: contentListItem[];
  28 +}
  29 +
  30 +export interface IStatusContentList {
  31 + contentId: string;
  32 +
  33 + // relType: string;
  34 + contentType: string;
  35 + // contentRelId: string;
  36 +}
  37 +
  38 +export interface batchLikeAndCollectParams {
  39 + // userType: number;
  40 + // userId: string;
  41 + contentList: IStatusContentList[]
  42 +}
  43 +
  44 +export interface batchLikeAndCollectResult {
  45 + collectStatus: number;
  46 + contentType: string;
  47 + likeStatus: string;
  48 + relType: string;
  49 + contentId: string;
  50 + contentRelId: string;
  51 +}
  52 +
  53 +export interface postBatchAttentionStatusParamsItem {
  54 + creatorId: string;
  55 +}
  56 +
  57 +export interface postBatchAttentionStatusParams {
  58 + creatorIds: postBatchAttentionStatusParamsItem[]
  59 +}
  60 +
  61 +export interface postBatchAttentionStatusResult {
  62 + creatorId: string;
  63 + status: string;
  64 + userId: string;
  65 +}
  66 +
  67 +
  68 +export interface postExecuteLikeParams {
  69 + status: string;
  70 + contentId: string;
  71 + contentType: string;
  72 + relType?: string;
  73 + userName?: string;
  74 + title?: string;
  75 + contentRelId?: string;
  76 + userHeaderUrl?: string;
  77 + channelId?: string;
  78 +}
  79 +
  80 +export interface postExecuteCollectRecordParamsItem {
  81 + contentId: string;
  82 + contentType: string;
  83 + relType?: string;
  84 + contentRelId?: string;
  85 +}
  86 +
  87 +export interface postExecuteCollectRecordParams {
  88 + status: string;
  89 + contentList: postExecuteCollectRecordParamsItem[]
  90 +}
  91 +
  92 +export interface postPointLevelOperateParams {
  93 + operateType: number;
  94 +}
  95 +
  96 +export interface postCommentPublishParams {
  97 + targetId: string;
  98 + keyArticle: string;
  99 + commentPics: string;
  100 + targetTitle: string;
  101 + commentType: string;
  102 + targetType: string;
  103 + commentContent: string;
  104 + parentId: string;
  105 + rootCommentId: string;
  106 +}
  107 +
  108 +export interface postInteractBrowsOperateParamsContent {
  109 + browseTime: string;
  110 + contentId: string;
  111 + contentType: number;
  112 +}
  113 +
  114 +export interface postInteractBrowsOperateParams {
  115 + delStatus: number;
  116 + contentList: postInteractBrowsOperateParamsContent[]
  117 +}
  118 +
  119 +export interface postInteractAccentionOperateParams {
  120 + attentionUserType: string;
  121 + attentionUserId: string;
  122 + attentionCreatorId: string;
  123 +
  124 + // userType: number;
  125 + // userId: string;
  126 + status: number;
  127 +}
21 128
22 export class ContentDetailRequest { 129 export class ContentDetailRequest {
23 static getContentDetailDataMock(context: Context): Promise<ResponseDTO<ContentDetailDTO[]>> { 130 static getContentDetailDataMock(context: Context): Promise<ResponseDTO<ContentDetailDTO[]>> {
@@ -55,30 +162,30 @@ export class ContentDetailRequest { @@ -55,30 +162,30 @@ export class ContentDetailRequest {
55 * 162 *
56 * @returns 163 * @returns
57 */ 164 */
58 - static getContentInteract() { 165 + static getContentInteract(params: contentListParams): Promise<ResponseDTO<InteractDataDTO[]>> {
59 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH 166 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH
60 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 167 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
61 - return WDHttp.get(url, headers) 168 + return WDHttp.post0(url, params, headers)
62 } 169 }
63 170
64 /** 171 /**
65 - * 172 + * 批量查询作品查询点赞、收藏状态
66 * @returns 173 * @returns
67 */ 174 */
68 - static postBatchLikeAndCollectStatus() { 175 + static postBatchLikeAndCollectStatus(params: batchLikeAndCollectParams): Promise<ResponseDTO<batchLikeAndCollectResult[]>> {
69 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_STATUS 176 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_STATUS
70 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 177 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
71 - return WDHttp.post(url, headers) 178 + return WDHttp.post0(url, params, headers)
72 } 179 }
73 180
74 /** 181 /**
75 - * 182 + * 批量查号主是否为用户关注
76 * @returns 183 * @returns
77 */ 184 */
78 - static postBatchAttentionStatus() { 185 + static postBatchAttentionStatus(params: postBatchAttentionStatusParams): Promise<ResponseDTO<postBatchAttentionStatusResult[]>> {
79 let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH 186 let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH
80 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 187 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
81 - return WDHttp.post(url, headers) 188 + return WDHttp.post0(url, params, headers)
82 } 189 }
83 190
84 191
@@ -87,9 +194,69 @@ export class ContentDetailRequest { @@ -87,9 +194,69 @@ export class ContentDetailRequest {
87 * @returns 194 * @returns
88 */ 195 */
89 196
90 - static postRecommendVideoList(params: recommentVideoListParame): Promise<ResponseDTO<ContentDetailDTO[]>> { 197 + static postRecommendVideoList(params: recommentVideoListParams): Promise<ResponseDTO<ContentDetailDTO[]>> {
91 let url = HttpUrlUtils.getHost() + HttpUrlUtils.RECOMMEND_VIDEOLIST 198 let url = HttpUrlUtils.getHost() + HttpUrlUtils.RECOMMEND_VIDEOLIST
92 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 199 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
93 return WDHttp.post0(url, params, headers) 200 return WDHttp.post0(url, params, headers)
94 } 201 }
  202 +
  203 + /**
  204 + * 用户点赞、取消点赞
  205 + * @param params
  206 + * @returns
  207 + */
  208 + static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> {
  209 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE
  210 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  211 + return WDHttp.post0(url, params, headers)
  212 + }
  213 +
  214 + /**
  215 + * 用户收藏、取消收藏
  216 + * @param params
  217 + * @returns
  218 + */
  219 + static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> {
  220 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTECOLLECTRECORD
  221 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  222 + return WDHttp.post0(url, params, headers)
  223 + }
  224 +
  225 + /**
  226 + *用户等级/积分-APP根据业务场景动态增减成长值(APP)
  227 + * 操作类型:1阅读 2评论 3回复(积分任务同评论) 4分享 5点赞 6关注 7打开客户端 8上传头像 9打开推送开关
  228 + */
  229 + static postPointLevelOperate(params: postPointLevelOperateParams): Promise<ResponseDTO> {
  230 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.USERPOINT_OPERATE
  231 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  232 + return WDHttp.post0(url, params, headers)
  233 + }
  234 +
  235 + /**
  236 + * 评论发布
  237 + */
  238 + static postCommentPublish(params: postCommentPublishParams): Promise<ResponseDTO> {
  239 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.COMMENT_PUBLISH
  240 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  241 + return WDHttp.post0(url, params, headers)
  242 + }
  243 +
  244 +
  245 + /**
  246 + * 浏览历史新增、删除接口
  247 + */
  248 + static postInteractBrowsOperate(params: postInteractBrowsOperateParams): Promise<ResponseDTO> {
  249 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_BROWS_OPERATE
  250 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  251 + return WDHttp.post0(url, params, headers)
  252 + }
  253 +
  254 + /**
  255 + * 关注号主
  256 + */
  257 + static postInteractAccentionOperate(params: postInteractAccentionOperateParams): Promise<ResponseDTO> {
  258 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_ACCENTION_OPERATION
  259 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  260 + return WDHttp.post0(url, params, headers)
  261 + }
95 } 262 }
1 -import router from '@ohos.router';  
2 import mediaquery from '@ohos.mediaquery'; 1 import mediaquery from '@ohos.mediaquery';
3 -import window from '@ohos.window';  
4 -import { Action, ContentDetailDTO, RmhInfoDTO, UserInfoDTO } from 'wdBean';  
5 -import { Logger, SPHelper, WindowModel } from 'wdKit';  
6 -import { PlayerConstants, WDPlayerController, WDPlayerRenderView } from 'wdPlayer';  
7 -import { devicePLSensorManager } from 'wdDetailPlayApi'; 2 +import { ContentDetailDTO, InteractDataDTO } from 'wdBean';
  3 +import { WDPlayerController, WDPlayerRenderView } from 'wdPlayer';
  4 +import { ContentDetailRequest, devicePLSensorManager } from 'wdDetailPlayApi';
8 import { PlayControlViewContainer } from '../view/PlayControlViewContainer'; 5 import { PlayControlViewContainer } from '../view/PlayControlViewContainer';
9 import { PlayerDetailContainer } from '../view/PlayerDetailContainer'; 6 import { PlayerDetailContainer } from '../view/PlayerDetailContainer';
10 -import { PlayViewModel } from '../viewmodel/PlayViewModel';  
11 import { DetailContainer } from '../view/DetailContainer'; 7 import { DetailContainer } from '../view/DetailContainer';
  8 +import {
  9 + batchLikeAndCollectParams,
  10 + batchLikeAndCollectResult,
  11 + postBatchAttentionStatusParams,
  12 + postInteractBrowsOperateParams
  13 +} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
  14 +import { HttpUrlUtils } from 'wdNetwork/Index';
  15 +import { DateTimeUtils } from 'wdKit/Index';
12 16
13 const TAG = 'DetailPlayShortVideoPage'; 17 const TAG = 'DetailPlayShortVideoPage';
14 18
@@ -18,73 +22,104 @@ const TAG = 'DetailPlayShortVideoPage'; @@ -18,73 +22,104 @@ const TAG = 'DetailPlayShortVideoPage';
18 22
19 @Component 23 @Component
20 export struct DetailPlayShortVideoPage { 24 export struct DetailPlayShortVideoPage {
21 - private contentId?: string = undefined  
22 - private relId?: string = undefined  
23 - private relType?: string = undefined  
24 - private contentDetailData: ContentDetailDTO | undefined = undefined 25 + @Prop index: number = 0
25 @Prop @Watch('currentIndexChange') currentIndex: number = 0 26 @Prop @Watch('currentIndexChange') currentIndex: number = 0
26 - private index: number = 0  
27 - private playerController: WDPlayerController = new WDPlayerController();  
28 - @Watch("urlChanged") @State url?: string = undefined  
29 - @Watch('changeContinue') @Provide nextContId?: string = '';  
30 - @Watch('getPlayHistory') @Provide curContId?: string = undefined;  
31 - @Watch("playVMChanged") @Provide playVM: PlayViewModel = new PlayViewModel(); 27 + @State playerController: WDPlayerController = new WDPlayerController();
  28 + @Provide contentDetailData: ContentDetailDTO | undefined = undefined
  29 + @Provide interactData: InteractDataDTO | undefined = undefined
32 @Provide isFullScreen: boolean = false; 30 @Provide isFullScreen: boolean = false;
33 - @Provide canStart?: boolean = false;  
34 - @Provide status: number = PlayerConstants.STATUS_START;  
35 - @Provide userId: string = '';  
36 - @Provide newsSourceName?: string = ''  
37 - @Provide newsTitle?: string = ''  
38 - @Provide editorName?: string = ''  
39 - @Provide rmhInfo?: RmhInfoDTO | null = null  
40 - @Provide userInfo?: UserInfoDTO | null = null  
41 - @Provide message?: string = ''  
42 - @Provide newsSummary?: string = ''  
43 @Provide progressVal: number = 0; 31 @Provide progressVal: number = 0;
44 @Provide videoLandScape?: number = 1; // 视频朝向, 横屏视频:1;竖屏视频:2 32 @Provide videoLandScape?: number = 1; // 视频朝向, 横屏视频:1;竖屏视频:2
45 -  
46 - playVMChanged() {  
47 - this.url = this.playVM.url  
48 - this.newsSourceName = this.playVM.newsSourceName  
49 - this.newsTitle = this.playVM.newsTitle  
50 - this.editorName = this.playVM.editorName  
51 - this.newsSummary = this.playVM.newsSummary  
52 - this.videoLandScape = this.playVM.videoLandScape ?? 1  
53 - this.curContId = this.playVM.contentId  
54 - this.nextContId = this.playVM.nextContId  
55 - this.canStart = this.playVM.canStart;  
56 - this.message = this.playVM.message  
57 - this.rmhInfo = this.playVM.rmhInfo  
58 - this.userInfo = this.playVM.userInfo  
59 - } 33 + @Provide newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
  34 + @Provide followStatus: string = '0' // 关注状态
60 35
61 currentIndexChange() { 36 currentIndexChange() {
62 - console.log('currentIndexChange====', this.currentIndex)  
63 if (this.currentIndex != this.index) { 37 if (this.currentIndex != this.index) {
64 this.playerController.pause() 38 this.playerController.pause()
  39 +
  40 + if (this.index < this.currentIndex - 5 && this.playerController.getPlayer()) {
  41 + this.playerController.release()
  42 + }
  43 +
65 } else { 44 } else {
66 - console.log('currentIndexChange====1', this.playerController)  
67 - this.playerController.switchPlayOrPause() 45 + this.queryNewsInfoOfUser()
  46 + console.log('currentIndex==== ', this.currentIndex)
  47 + if (!this.playerController.getPlayer()) {
  48 + console.error('state91111111===', this.contentDetailData?.videoInfo[0]?.videoUrl || '')
  49 + this.playerController.firstPlay(this.contentDetailData?.videoInfo[0]?.videoUrl || '');
  50 + console.error('state91111111===', this.playerController?.getPlayer()?.state)
  51 + } else {
  52 + console.error('state9===', this.playerController?.getPlayer()?.state)
  53 + this.playerController.play()
  54 + }
  55 +
68 } 56 }
69 } 57 }
70 58
71 - aboutToAppear() {  
72 - console.log('开始设置setContentDetailData', JSON.stringify(this.contentDetailData)) 59 + /**
  60 + * 查询用户点赞、收藏、关注等状态
  61 + */
  62 + queryNewsInfoOfUser() {
  63 + if (HttpUrlUtils.getUserId()) {
  64 + const params: batchLikeAndCollectParams = {
  65 + contentList: [
  66 + {
  67 + contentId: this.contentDetailData?.newsId + '',
  68 + contentType: this.contentDetailData?.newsType + '',
  69 + }
  70 + ]
  71 + }
  72 + // 已登录->查询用户对作品点赞、收藏状态
  73 + ContentDetailRequest.postBatchLikeAndCollectStatus(params).then(res => {
  74 + console.log('查询点赞、收藏状态==', JSON.stringify(res.data))
  75 + if (res.data) {
  76 + this.newsStatusOfUser = res.data[0]
  77 + }
  78 + })
73 79
74 - this.playVM.setContentDetailData(this.contentDetailData) 80 + const params1: postBatchAttentionStatusParams = {
  81 + creatorIds: [{ creatorId: this.contentDetailData?.rmhInfo?.rmhId ?? '' }]
  82 + }
  83 + // 已登录->批量查作品是否被号主关注
  84 + ContentDetailRequest.postBatchAttentionStatus(params1).then(res => {
  85 + console.log('批量查号主是否为用户关注==', JSON.stringify(res.data))
  86 + if (res.data) {
  87 + this.followStatus = res.data[0]?.status
  88 + }
  89 + })
75 90
76 - let action: Action = router.getParams() as Action  
77 - Logger.info(TAG, "action", JSON.stringify(action))  
78 - if (action) {  
79 - this.contentId = action.params?.contentID  
80 - if (action.params && action.params.extra) {  
81 - this.relId = action.params.extra.relId  
82 - this.relType = action.params.extra.relType 91 + // 记录浏览历史
  92 + const params2: postInteractBrowsOperateParams = {
  93 + delStatus: 0,
  94 + contentList: [{
  95 + browseTime: DateTimeUtils.getCurDate(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN),
  96 + contentId: this.contentDetailData?.newsId + '',
  97 + contentType: this.contentDetailData?.newsType || 0,
  98 + }]
83 } 99 }
  100 + ContentDetailRequest.postInteractBrowsOperate(params2).then(res => {
  101 + console.log('记录浏览历史==', JSON.stringify(res.data))
  102 +
  103 + })
  104 + }
  105 +
  106 + }
  107 +
  108 + aboutToAppear() {
  109 + // console.log('开始设置setContentDetailData', JSON.stringify(this.contentDetailData))
  110 + this.videoLandScape = this.contentDetailData?.videoInfo[0]?.videoLandScape
  111 + this.queryNewsInfoOfUser()
  112 + this.playerController.onCanplay = () => {
  113 + if (this.index == 0 || this.currentIndex === this.index) {
  114 + this.playerController.play()
  115 + }
  116 + }
  117 +
  118 + this.playerController.onTimeUpdate = (position, duration) => {
  119 + this.progressVal = Math.floor(position * 100 / duration);
84 } 120 }
85 121
86 // 设置播放地址 122 // 设置播放地址
87 - // this.url = 'https://media.w3.org/2010/05/sintel/trailer.mp4'  
88 let listener = mediaquery.matchMediaSync('(orientation: landscape)'); 123 let listener = mediaquery.matchMediaSync('(orientation: landscape)');
89 listener.on("change", (mediaQueryResult) => { 124 listener.on("change", (mediaQueryResult) => {
90 if (mediaQueryResult.matches) { 125 if (mediaQueryResult.matches) {
@@ -94,29 +129,25 @@ export struct DetailPlayShortVideoPage { @@ -94,29 +129,25 @@ export struct DetailPlayShortVideoPage {
94 this.isFullScreen = false 129 this.isFullScreen = false
95 console.log("横屏 no") 130 console.log("横屏 no")
96 } 131 }
97 - WindowModel.shared.setMainWindowFullScreen(this.isFullScreen) 132 + // WindowModel.shared.setMainWindowFullScreen(this.isFullScreen)
98 }) 133 })
99 - console.error('111,', this.index, this.currentIndex)  
100 - if (this.index == 0 && this.currentIndex === this.index) {  
101 - setTimeout(() => {  
102 - this.playerController.play()  
103 - }, 2000)  
104 134
105 - }  
106 } 135 }
107 136
108 onPageShow() { 137 onPageShow() {
109 - WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED); 138 + // WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED);
110 } 139 }
111 140
112 aboutToDisappear(): void { 141 aboutToDisappear(): void {
113 - this.playerController?.pause(); 142 + console.log('aboutToDisappear', this.index)
  143 + this.playerController?.release();
  144 + // this.playerController.onCanplay = ()={}
114 } 145 }
115 146
116 onPageHide() { 147 onPageHide() {
117 - WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT); 148 + // WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT);
118 devicePLSensorManager.devicePLSensorOff(); 149 devicePLSensorManager.devicePLSensorOff();
119 - this.status = PlayerConstants.STATUS_PAUSE; 150 + // this.status = PlayerConstants.STATUS_PAUSE;
120 this.playerController?.pause(); 151 this.playerController?.pause();
121 } 152 }
122 153
@@ -126,10 +157,10 @@ export struct DetailPlayShortVideoPage { @@ -126,10 +157,10 @@ export struct DetailPlayShortVideoPage {
126 WDPlayerRenderView({ 157 WDPlayerRenderView({
127 playerController: this.playerController, 158 playerController: this.playerController,
128 onLoad: async () => { 159 onLoad: async () => {
129 - console.log('onload==', this.contentId, this.relId, this.relType)  
130 - // this.playVM.playWithContentId(this.contentId ?? "846899373")  
131 - this.playVM.playWithIds(this.contentId,  
132 - this.relId, this.relType) 160 + // console.log('onload==', this.index)
  161 + // if (this.index === 0) {
  162 + this.playerController.firstPlay(this.contentDetailData?.videoInfo[0]?.videoUrl);
  163 + // }
133 } 164 }
134 }) 165 })
135 .height('100%') 166 .height('100%')
@@ -176,49 +207,6 @@ export struct DetailPlayShortVideoPage { @@ -176,49 +207,6 @@ export struct DetailPlayShortVideoPage {
176 } 207 }
177 .height('100%') 208 .height('100%')
178 .width('100%') 209 .width('100%')
179 -  
180 .backgroundColor(Color.Black) 210 .backgroundColor(Color.Black)
181 } 211 }
182 -  
183 - // 续播判断  
184 - changeContinue() {  
185 - if (this.nextContId) {  
186 - this.playerController.continue = () => {  
187 - this.playerController?.stop();  
188 - this.playVM.playWithContentId(this.nextContId ?? '');  
189 - }  
190 - return;  
191 - }  
192 - this.playerController.continue = undefined;  
193 - }  
194 -  
195 - urlChanged() {  
196 - if (this.url) {  
197 - console.log("url:" + this.url);  
198 - this.status = PlayerConstants.STATUS_START;  
199 - this.playerController.firstPlay(this.url);  
200 - }  
201 - }  
202 -  
203 - getPlayHistory() {  
204 - SPHelper.default.get('playHistory', '').then((str) => {  
205 - let result = str.toString();  
206 - let time = 0;  
207 - if (result != null && result != "") {  
208 - let playHistory: Record<string, Record<string, number>> = JSON.parse(result);  
209 - let userData: Record<string, number> = {};  
210 - if (this.userId) {  
211 - userData = playHistory[this.userId] ?? {};  
212 - }  
213 - if (this.curContId) {  
214 - time = userData?.[this.curContId] ?? 0;  
215 - }  
216 - }  
217 - this.playerController?.setStartTime(time);  
218 - }).catch((err: Error) => {  
219 - // Error: Inner error. Error code 15500000  
220 - Logger.error(TAG, 'catch err:' + JSON.stringify(err));  
221 - this.playerController?.setStartTime(0);  
222 - });  
223 - }  
224 } 212 }
1 -import { Action, ContentDetailDTO } from 'wdBean/Index'; 1 +import { Action, ContentDetailDTO, InteractDataDTO } from 'wdBean/Index';
2 import { ContentDetailRequest } from 'wdDetailPlayApi/Index' 2 import { ContentDetailRequest } from 'wdDetailPlayApi/Index'
3 import { ResponseDTO } from 'wdNetwork/Index'; 3 import { ResponseDTO } from 'wdNetwork/Index';
4 import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage' 4 import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage'
5 import { Test } from './Test' 5 import { Test } from './Test'
6 import router from '@ohos.router'; 6 import router from '@ohos.router';
7 import window from '@ohos.window'; 7 import window from '@ohos.window';
  8 +import { contentListParams } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
  9 +
8 10
9 @Entry 11 @Entry
10 @Component 12 @Component
@@ -16,9 +18,9 @@ export struct DetailVideoListPage { @@ -16,9 +18,9 @@ export struct DetailVideoListPage {
16 @State data: ContentDetailDTO[] = [] 18 @State data: ContentDetailDTO[] = []
17 @State testData: string[] = ['111', '222', '333'] 19 @State testData: string[] = ['111', '222', '333']
18 @State currentIndex: number = 0 20 @State currentIndex: number = 0
  21 + @State interactDataList: InteractDataDTO[] = []
19 22
20 async aboutToAppear(): Promise<void> { 23 async aboutToAppear(): Promise<void> {
21 - console.error('=================',)  
22 let data: ContentDetailDTO[] = [] 24 let data: ContentDetailDTO[] = []
23 let action: Action = router.getParams() as Action 25 let action: Action = router.getParams() as Action
24 if (action) { 26 if (action) {
@@ -34,28 +36,63 @@ export struct DetailVideoListPage { @@ -34,28 +36,63 @@ export struct DetailVideoListPage {
34 }).then((resDTO: ResponseDTO<ContentDetailDTO[]>) => { 36 }).then((resDTO: ResponseDTO<ContentDetailDTO[]>) => {
35 console.error('resDTO==', JSON.stringify(resDTO.data)) 37 console.error('resDTO==', JSON.stringify(resDTO.data))
36 if (resDTO.data) { 38 if (resDTO.data) {
37 - data.push(resDTO.data[0]) 39 + this.data.push(resDTO.data[0])
38 } 40 }
39 41
40 }) 42 })
41 } 43 }
42 44
  45 + await this.queryVideoList()
  46 +
  47 + // await ContentDetailRequest.postRecommendVideoList({
  48 + // pageSize: 5,
  49 + // refreshCnt: 1
  50 + // }).then(res => {
  51 + // if (res.data) {
  52 + // data = data.concat(res.data)
  53 + // }
  54 + // console.log('res1===', JSON.stringify(res))
  55 + // console.log('res==' + this.data)
  56 + // })
  57 +
  58 +
  59 + if (this.data.length > 0) {
  60 + const params: contentListParams = {
  61 + contentList: []
  62 + }
  63 + this.data.map(item => {
  64 + params.contentList.push({
  65 + contentId: item.newsId + '',
  66 + contentType: item.newsType
  67 + })
  68 + })
  69 + // 批量查询内容当前用户点赞、收藏状态
  70 + await ContentDetailRequest.getContentInteract(params).then(res => {
  71 + if (res.data) {
  72 + this.interactDataList = res.data || []
  73 + }
  74 + console.log('获取互动点赞等数据===', JSON.stringify(res))
  75 + })
  76 + // 查询各类型内容动态数据接口V2
  77 +
  78 + }
  79 +
  80 + // this.data = data
  81 + console.error('aboutToAppear===', this.data.length)
  82 +
  83 +
  84 + }
  85 +
  86 + async queryVideoList() {
43 await ContentDetailRequest.postRecommendVideoList({ 87 await ContentDetailRequest.postRecommendVideoList({
44 - pageSize: 10, 88 + pageSize: 5,
45 refreshCnt: 1 89 refreshCnt: 1
46 }).then(res => { 90 }).then(res => {
47 if (res.data) { 91 if (res.data) {
48 - data = data.concat(res.data) 92 + this.data = this.data.concat(res.data)
49 } 93 }
50 - // this.data = res.data || []  
51 - console.log('res1===', JSON.stringify(res))  
52 - console.log('res==' + this.data) 94 + // console.log('queryVideoList===', JSON.stringify(this.data))
53 }) 95 })
54 -  
55 - this.data = data  
56 - console.error('aboutToAppear===', this.data.length)  
57 -  
58 -  
59 } 96 }
60 97
61 build() { 98 build() {
@@ -67,7 +104,8 @@ export struct DetailVideoListPage { @@ -67,7 +104,8 @@ export struct DetailVideoListPage {
67 DetailPlayShortVideoPage({ 104 DetailPlayShortVideoPage({
68 contentDetailData: item, 105 contentDetailData: item,
69 currentIndex: this.currentIndex, 106 currentIndex: this.currentIndex,
70 - index: index 107 + index: index,
  108 + interactData: this.interactDataList[index]
71 }) 109 })
72 }.width('100%') 110 }.width('100%')
73 .height('100%') 111 .height('100%')
@@ -82,7 +120,7 @@ export struct DetailVideoListPage { @@ -82,7 +120,7 @@ export struct DetailVideoListPage {
82 // }, (item: string) => item) 120 // }, (item: string) => item)
83 121
84 } 122 }
85 - .cachedCount(0) 123 + .cachedCount(-1)
86 .indicator(false) 124 .indicator(false)
87 .vertical(true) 125 .vertical(true)
88 .loop(false) 126 .loop(false)
@@ -92,6 +130,10 @@ export struct DetailVideoListPage { @@ -92,6 +130,10 @@ export struct DetailVideoListPage {
92 .onChange((index: number) => { 130 .onChange((index: number) => {
93 this.currentIndex = index 131 this.currentIndex = index
94 console.info('onChange==', index.toString()) 132 console.info('onChange==', index.toString())
  133 +
  134 + if (this.currentIndex === this.data.length - 1) {
  135 + this.queryVideoList()
  136 + }
95 }) 137 })
96 138
97 }.width('100%').height('100%') 139 }.width('100%').height('100%')
1 -@Entry 1 +@Preview
2 @Component 2 @Component
3 export struct Test { 3 export struct Test {
4 - @Prop currentItem: string = '';  
5 - @Prop @Watch('currentIndexChange') currentIndex: number = 0;  
6 - @Prop index: number = 0;  
7 -  
8 - currentIndexChange() {  
9 - console.log('currentIndexChange====', this.currentIndex);  
10 - }  
11 -  
12 build() { 4 build() {
13 Row() { 5 Row() {
14 - Column() {  
15 - Text('currentItem: ' + this.currentItem).fontSize(30)  
16 - Text('currentIndex: ' + this.currentIndex).fontSize(30)  
17 - Text('index: ' + this.index).fontSize(30)  
18 - } 6 +
  7 + RelativeContainer() {
  8 + Image($r('app.media.ic_like_uncheck'))
  9 + .width('100%')
  10 + .borderRadius(24)
  11 + .aspectRatio(1)
  12 + .border({ width: 1, color: Color.White, style: BorderStyle.Solid })
  13 + .alignRules({
  14 + top: { anchor: "__container__", align: VerticalAlign.Top },
  15 + left: { anchor: "__container__", align: HorizontalAlign.Start }
  16 + })
  17 + .id("row1")
  18 +
  19 + Image($r('app.media.ic_add'))
  20 + .width(24)
  21 + .borderRadius(12)
  22 + .alignRules({
  23 + left: { anchor: "__container__", align: HorizontalAlign.Center },
  24 + bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
  25 + })
  26 + .margin({ left: -12 })
  27 + .id("row2")
  28 + }.height('auto')
  29 +
19 } 30 }
  31 + .height(58)
  32 + .width(48)
  33 + .backgroundColor(Color.Black)
  34 +
20 } 35 }
21 } 36 }
  1 +@CustomDialog
  2 +export struct DetailDialog {
  3 + controller: CustomDialogController
  4 + @Prop name: string
  5 + @Prop title: string
  6 + @Prop summary: string
  7 + @Link isOpen: boolean
  8 +
  9 + build() {
  10 + Column() {
  11 + if (this.name + '1222222') {
  12 + Text(`@${this.name}` + '1222222')
  13 + .fontColor(Color.White)
  14 + .fontSize(14)
  15 + .fontWeight(600)
  16 + .lineHeight(17)
  17 + }
  18 +
  19 + if (this.title) {
  20 + Text(this.title)
  21 + .fontColor(Color.White)
  22 + .fontSize(16)
  23 + .fontWeight(600)
  24 + .margin({ top: 8 })
  25 + .lineHeight(24)
  26 + }
  27 +
  28 + Text(this.summary)
  29 + .fontColor(Color.White)
  30 + .fontSize(14)
  31 + .fontWeight(400)
  32 + .margin({ top: 8 })
  33 + .lineHeight(21)
  34 +
  35 + Row() {
  36 + Image($r('app.media.ic_close'))
  37 + .height(24).margin({ top: 20 }).onClick(() => {
  38 + this.controller.close()
  39 + if (this.isOpen) {
  40 + this.isOpen = !this.isOpen
  41 + }
  42 + })
  43 + }.width('100%').justifyContent(FlexAlign.Center)
  44 +
  45 + }
  46 + .width('100%')
  47 + .alignItems(HorizontalAlign.Start)
  48 + .backgroundColor(Color.Gray)
  49 + // .linearGradient({
  50 + // direction: GradientDirection.Top, // 渐变方向
  51 + // repeating: false, // 渐变颜色是否重复
  52 + // colors: [['rgba(0, 0, 0, 0.1)', 0.0], ['rgba(0, 0, 0, 0)', 1.0]] // 数组末尾元素占比小于1时满足重复着色效果
  53 + // })
  54 + .padding({ top: 20, bottom: 30, left: 16, right: 16 })
  55 + }
  56 +}
1 -import { RmhInfoDTO, UserInfoDTO } from 'wdBean/Index'; 1 +import { ContentDetailDTO, InteractDataDTO, RmhInfoDTO, UserInfoDTO } from 'wdBean/Index';
  2 +import {
  3 + batchLikeAndCollectParams,
  4 + batchLikeAndCollectResult,
  5 + ContentDetailRequest,
  6 + contentListParams,
  7 + postExecuteCollectRecordParams,
  8 + postExecuteLikeParams,
  9 + postInteractAccentionOperateParams
  10 +} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
2 import { ToastUtils } from 'wdKit'; 11 import { ToastUtils } from 'wdKit';
  12 +import { HttpUrlUtils } from 'wdNetwork/Index';
  13 +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
3 14
4 export interface OperationItem { 15 export interface OperationItem {
5 icon: Resource; 16 icon: Resource;
  17 + icon_check?: Resource;
6 18
7 // icon_selected: Resource; 19 // icon_selected: Resource;
8 text: string | Resource; 20 text: string | Resource;
@@ -13,25 +25,30 @@ const FULL_PARENT: string = '100%'; @@ -13,25 +25,30 @@ const FULL_PARENT: string = '100%';
13 25
14 const TAG = 'OperationListView'; 26 const TAG = 'OperationListView';
15 27
  28 +@Preview
16 @Component 29 @Component
17 export struct OperationListView { 30 export struct OperationListView {
18 - @Consume rmhInfo?: RmhInfoDTO  
19 - @Consume userInfo?: UserInfoDTO 31 + @Consume interactData: InteractDataDTO
  32 + @Consume contentDetailData: ContentDetailDTO
  33 + @Consume newsStatusOfUser: batchLikeAndCollectResult
  34 + @Consume followStatus: string
20 @State operationList: OperationItem[] = [ 35 @State operationList: OperationItem[] = [
21 { 36 {
22 icon: $r('app.media.ic_like_uncheck'), 37 icon: $r('app.media.ic_like_uncheck'),
  38 + icon_check: $r('app.media.ic_like_check'),
23 text: "赞", 39 text: "赞",
24 - num: 6622 40 + // num: 6622
25 }, 41 },
26 { 42 {
27 icon: $r('app.media.ic_collect_uncheck'), 43 icon: $r('app.media.ic_collect_uncheck'),
  44 + icon_check: $r('app.media.ic_collect_check'),
28 text: "收藏", 45 text: "收藏",
29 - num: 662, 46 + // num: 662,
30 }, 47 },
31 { 48 {
32 icon: $r('app.media.ic_comment'), 49 icon: $r('app.media.ic_comment'),
33 - text: "评论",  
34 - num: 500, 50 + text: "抢首评",
  51 + // num: 500,
35 }, 52 },
36 { 53 {
37 icon: $r('app.media.ic_share'), 54 icon: $r('app.media.ic_share'),
@@ -42,76 +59,228 @@ export struct OperationListView { @@ -42,76 +59,228 @@ export struct OperationListView {
42 aboutToAppear() { 59 aboutToAppear() {
43 } 60 }
44 61
45 - build() {  
46 - // List({ space: 0, initialIndex: 0 }) {  
47 - // ForEach(this.operationList, (item: OperationItem, index: number) => {  
48 - // ListItem() {  
49 - // this.buildOperationItem(item, index)  
50 - // }  
51 - // }, (item: OperationItem, index: number) => JSON.stringify(item))  
52 - // }  
53 - // .width(48)  
54 - // .height(250)  
55 - // // .margin({ bottom: 100 })  
56 - // .backgroundColor(Color.Red)  
57 - // // .listDirection(Axis.Vertical) // 默认值:Axis.Vertical  
58 - // // .lanes(this.buildLanes()) // 行/列数,一列 // 默认值:1  
59 - // .cachedCount(2)  
60 - // .scrollBar(BarState.Off)  
61 - // .nestedScroll({  
62 - // scrollForward: NestedScrollMode.PARENT_FIRST,  
63 - // scrollBackward: NestedScrollMode.SELF_FIRST  
64 - // }) 62 + /**
  63 + * 点赞、取消点赞
  64 + */
  65 + toggleLikeStatus() {
  66 + // 未登录,跳转登录
  67 + if (!HttpUrlUtils.getUserId()) {
  68 + WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
  69 + return
  70 + }
  71 + const params: postExecuteLikeParams = {
  72 + status: this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1',
  73 + contentId: this.contentDetailData?.newsId + '',
  74 + contentType: this.contentDetailData?.newsType + '',
  75 + }
  76 + ContentDetailRequest.postExecuteLike(params).then(res => {
  77 + console.log('toggleLikeStatus==',)
  78 + if (this.newsStatusOfUser) {
  79 + this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1'
  80 + this.queryContentInteractCount()
  81 + }
65 82
66 - Column() {  
67 - this.buildUserComp()  
68 - ForEach(this.operationList, (item: OperationItem, index: number) => {  
69 - this.buildOperationItem(item, index)  
70 - }, (item: OperationItem, index: number) => JSON.stringify(item)) 83 + })
  84 + }
  85 +
  86 + /**
  87 + * 收藏、取消收藏
  88 + */
  89 + toggleCollectStatus() {
  90 + // 未登录,跳转登录
  91 + if (!HttpUrlUtils.getUserId()) {
  92 + WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
  93 + return
71 } 94 }
72 - .width(48) 95 + const params: postExecuteCollectRecordParams = {
  96 + status: this.newsStatusOfUser?.collectStatus === 1 ? '0' : '1',
  97 + contentList: [{
  98 + contentId: this.contentDetailData?.newsId + '',
  99 + contentType: this.contentDetailData?.newsType + '',
  100 + }],
  101 +
  102 + }
  103 + ContentDetailRequest.postExecuteCollectRecord(params).then(res => {
  104 + console.log('toggleLikeStatus==',)
  105 + if (this.newsStatusOfUser) {
  106 + this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
  107 + this.queryContentInteractCount()
  108 + }
  109 + })
  110 +
73 } 111 }
74 112
75 - @Builder  
76 - buildUserComp() {  
77 - Column() {  
78 - Image(this.rmhInfo?.rmhHeadUrl || this.userInfo?.userHeadUrl)  
79 - .width(48)  
80 - .borderRadius(24)  
81 - .aspectRatio(1)  
82 - // .margin(18) 113 + /**
  114 + * 查询点赞、收藏数量
  115 + */
  116 + queryContentInteractCount() {
  117 + const params: contentListParams = {
  118 + contentList: [{
  119 + contentId: this.contentDetailData?.newsId + '',
  120 + contentType: this.contentDetailData?.newsType,
  121 + }]
83 } 122 }
  123 + ContentDetailRequest.getContentInteract(params).then(res => {
  124 + if (res.data && this.interactData) {
  125 + this.interactData.likeNum = res.data[0]?.likeNum
  126 + this.interactData.collectNum = res.data[0]?.collectNum
  127 + this.interactData.commentNum = res.data[0]?.commentNum
  128 + }
  129 + console.log('获取互动点赞等数据===', JSON.stringify(res))
  130 + })
  131 + }
  132 +
  133 + getImgUrl() {
  134 + return this.contentDetailData?.rmhInfo?.rmhHeadUrl || this.contentDetailData?.userInfo?.userHeadUrl
84 } 135 }
85 136
86 /** 137 /**
87 - * 组件项  
88 - *  
89 - * @param programmeBean item 组件项 138 + * 关注号主
90 */ 139 */
  140 + handleAccention() {
  141 + // 未登录,跳转登录
  142 + if (!HttpUrlUtils.getUserId()) {
  143 + WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
  144 + return
  145 + }
  146 +
  147 + const params2: postInteractAccentionOperateParams = {
  148 + attentionUserType: this.contentDetailData?.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号)
  149 + attentionUserId: this.contentDetailData?.rmhInfo?.userId || '', // 被关注用户号主id
  150 + attentionCreatorId: this.contentDetailData?.rmhInfo?.rmhId || '', // 被关注用户号主id
  151 + // userType: 1,
  152 + // userId: '1',
  153 + status: 1,
  154 + }
  155 + ContentDetailRequest.postInteractAccentionOperate(params2).then(res => {
  156 + console.log('关注号主==', JSON.stringify(res.data))
  157 + if (this.followStatus == '1') {
  158 + this.followStatus = '0'
  159 + } else {
  160 + this.followStatus = '1'
  161 + }
  162 + })
  163 + }
  164 +
  165 + @Builder
  166 + buildUserComp() {
  167 + Column() {
  168 + if (this.getImgUrl()) {
  169 + RelativeContainer() {
  170 + Image(this.getImgUrl())
  171 + .width('100%')
  172 + .borderRadius(24)
  173 + .aspectRatio(1)
  174 + .border({ width: 1, color: Color.White, style: BorderStyle.Solid })
  175 + .alignRules({
  176 + top: { anchor: "__container__", align: VerticalAlign.Top },
  177 + left: { anchor: "__container__", align: HorizontalAlign.Start }
  178 + })
  179 + .id("row1")
  180 + .onClick(() => {
  181 + // 号主页
  182 + })
  183 + if (this.followStatus == '0') {
  184 + Image($r('app.media.ic_add'))
  185 + .width(24)
  186 + .borderRadius(12)
  187 + .alignRules({
  188 + left: { anchor: "__container__", align: HorizontalAlign.Center },
  189 + bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
  190 + })
  191 + .margin({ left: -12 })
  192 + .id("row2")
  193 + .onClick(() => {
  194 + // 关注
  195 + this.handleAccention()
  196 + })
  197 + }
  198 +
  199 + }.height(60)
  200 + }
  201 + }.margin({ bottom: 18 })
  202 + }
  203 +
91 @Builder 204 @Builder
92 buildOperationItem(item: OperationItem, index: number) { 205 buildOperationItem(item: OperationItem, index: number) {
93 Column() { 206 Column() {
94 - Image(item.icon)  
95 - .width('100%')  
96 - .aspectRatio(1)  
97 - // .borderRadius(6)  
98 -  
99 - Text(item.text)  
100 - .width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)  
101 - .fontWeight(FontWeight.Normal)  
102 - .textAlign(TextAlign.Center)  
103 - .fontSize(13)  
104 - .fontColor('#FFFFFF')  
105 - .maxLines(1)  
106 - .textOverflow({ overflow: TextOverflow.Ellipsis }) 207 + if (item.text === '赞') {
  208 + Image(this.newsStatusOfUser?.likeStatus == '1' ? item.icon_check : item.icon)
  209 + .width(32)
  210 + .aspectRatio(1)
  211 + .onClick(() => {
  212 + this.toggleLikeStatus()
  213 + })
  214 + Text(this.interactData?.likeNum ? (this.interactData.likeNum + '') : item.text)
  215 + .width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
  216 + .fontWeight(500)
  217 + .textAlign(TextAlign.Center)
  218 + .fontSize(13)
  219 + .fontColor('#FFFFFF')
  220 + .maxLines(1)
  221 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  222 + } else if (item.text === '收藏') {
  223 + Image(this.newsStatusOfUser?.collectStatus == 1 ? item.icon_check : item.icon)
  224 + .width(32)
  225 + .aspectRatio(1)
  226 + .onClick(() => {
  227 + this.toggleCollectStatus()
  228 + })
  229 + Text(this.interactData?.collectNum ? (this.interactData.collectNum + '') : item.text)
  230 + .width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
  231 + .fontWeight(500)
  232 + .textAlign(TextAlign.Center)
  233 + .fontSize(13)
  234 + .fontColor('#FFFFFF')
  235 + .maxLines(1)
  236 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  237 + } else if (item.text === '抢首评') {
  238 + Image(item.icon)
  239 + .width(32)
  240 + .aspectRatio(1)
  241 + .onClick((event: ClickEvent) => {
  242 + ToastUtils.showToast('评论为公共方法,待开发', 1000);
  243 + })
  244 + Text(this.interactData?.commentNum ? (this.interactData.commentNum + '') : item.text)
  245 + .width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
  246 + .fontWeight(500)
  247 + .textAlign(TextAlign.Center)
  248 + .fontSize(13)
  249 + .fontColor('#FFFFFF')
  250 + .maxLines(1)
  251 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  252 + } else {
  253 + Image(item.icon)
  254 + .width(32)
  255 + .aspectRatio(1)
  256 + .onClick((event: ClickEvent) => {
  257 + ToastUtils.showToast('分享为公共方法,待开发', 1000);
  258 + })
  259 + Text(item.text)
  260 + .width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
  261 + .fontWeight(500)
  262 + .textAlign(TextAlign.Center)
  263 + .fontSize(13)
  264 + .fontColor('#FFFFFF')
  265 + .maxLines(1)
  266 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  267 + }
  268 +
107 } 269 }
108 - .margin(5)  
109 - // .backgroundColor(Color.Black) 270 + // .width(48)
  271 + .margin({ bottom: 20 })
110 .alignItems(HorizontalAlign.Center) 272 .alignItems(HorizontalAlign.Center)
111 .hoverEffect(HoverEffect.Scale) 273 .hoverEffect(HoverEffect.Scale)
112 - .onClick((event: ClickEvent) => {  
113 - console.info(TAG, `buildOperationItem onClick event index: ${index}`);  
114 - // ToastUtils.showToast('体验版,本功能暂未开发', 1000);  
115 - }) 274 +
  275 + }
  276 +
  277 + build() {
  278 + Column() {
  279 + this.buildUserComp()
  280 + ForEach(this.operationList, (item: OperationItem, index: number) => {
  281 + this.buildOperationItem(item, index)
  282 + }, (item: OperationItem, index: number) => JSON.stringify(item))
  283 + }
  284 + .width(48)
116 } 285 }
117 } 286 }
@@ -5,80 +5,119 @@ import { WindowModel } from 'wdKit'; @@ -5,80 +5,119 @@ import { WindowModel } from 'wdKit';
5 import { WDPlayerController } from 'wdPlayer'; 5 import { WDPlayerController } from 'wdPlayer';
6 import { devicePLSensorManager } from 'wdDetailPlayApi'; 6 import { devicePLSensorManager } from 'wdDetailPlayApi';
7 import { OperationListView } from './OperationListView'; 7 import { OperationListView } from './OperationListView';
8 -import { RmhInfoDTO, UserInfoDTO } from 'wdBean/Index'; 8 +import { ContentDetailDTO, RmhInfoDTO, UserInfoDTO } from 'wdBean/Index';
  9 +import { DetailDialog } from './DetailDialog';
9 10
10 @Component 11 @Component
11 export struct PlayerTitleComment { 12 export struct PlayerTitleComment {
12 private playerController?: WDPlayerController; 13 private playerController?: WDPlayerController;
13 - @Consume newsSourceName?: string  
14 - @Consume newsTitle?: string  
15 - @Consume editorName?: string  
16 - @Consume newsSummary?: string;  
17 @State @Watch('watchSpeed') playSpeed: number = 1; 14 @State @Watch('watchSpeed') playSpeed: number = 1;
18 - @Consume isFullScreen: boolean;  
19 @State comment: string = ''; 15 @State comment: string = '';
  16 + @Consume contentDetailData: ContentDetailDTO | undefined
  17 + @Consume isFullScreen: boolean;
20 @Consume progressVal: number; 18 @Consume progressVal: number;
21 @Consume videoLandScape?: number 19 @Consume videoLandScape?: number
  20 + @State isOpen: boolean = false
  21 + dialogController: CustomDialogController = new CustomDialogController({
  22 + builder: DetailDialog({
  23 + name: this.getName(),
  24 + title: this.getTitle(),
  25 + summary: this.getSummary(),
  26 + isOpen: this.isOpen
  27 +
  28 + }),
  29 + autoCancel: false,
  30 + customStyle: true,
  31 + alignment: DialogAlignment.Bottom
  32 + })
22 33
23 aboutToAppear() { 34 aboutToAppear() {
  35 +
24 } 36 }
25 37
26 watchSpeed() { 38 watchSpeed() {
27 this.playerController?.setSpeed(this.playSpeed); 39 this.playerController?.setSpeed(this.playSpeed);
28 } 40 }
29 41
  42 + getName() {
  43 + return this.contentDetailData?.newsSourceName || this.contentDetailData?.editorName || ''
  44 + }
  45 +
  46 + getTitle() {
  47 + return this.contentDetailData?.newsTitle || this.contentDetailData?.newsSummary || ''
  48 + }
  49 +
  50 + getSummary() {
  51 + return this.contentDetailData?.newsSummary || ''
  52 + }
  53 +
30 build() { 54 build() {
31 Column() { 55 Column() {
32 - // Column() {  
33 - // Row() {  
34 - // Image($r('app.media.ic_switch_orientation'))  
35 - // .width(34)  
36 - // .aspectRatio(1)  
37 - // .objectFit(ImageFit.Contain)  
38 - // .padding({ left: 10, right: 5 })  
39 - // Text("全屏观看")  
40 - // .fontColor(Color.White)  
41 - // .fontSize('14fp')  
42 - // .maxLines(2)  
43 - // .layoutWeight(1)  
44 - // }  
45 - // .width(100)  
46 - // .backgroundColor(Color.Gray)  
47 - // .borderRadius(10)  
48 - // .alignItems(VerticalAlign.Center)  
49 - // .visibility(this.videoLandScape == 2 ? Visibility.Hidden : Visibility.Visible)  
50 - // .onClick(() => {  
51 - // this.isFullScreen = !this.isFullScreen;  
52 - // WindowModel.shared.setPreferredOrientation(window.Orientation.LANDSCAPE);  
53 - // devicePLSensorManager.devicePLSensorOn(window.Orientation.LANDSCAPE);  
54 - // })  
55 - // }  
56 - // .width('100%')  
57 - // // .margin({ bottom: 120 })  
58 - // .alignItems(HorizontalAlign.Center) 56 +
  57 + if (this.contentDetailData?.videoInfo[0]?.videoLandScape === 1) {
  58 + Column() {
  59 + Row() {
  60 + Image($r('app.media.ic_switch_orientation'))
  61 + .width(34)
  62 + .aspectRatio(1)
  63 + .objectFit(ImageFit.Contain)
  64 + .padding({ left: 10, right: 5 })
  65 + Text("全屏观看")
  66 + .fontColor(Color.White)
  67 + .fontSize('14fp')
  68 + .maxLines(2)
  69 + .layoutWeight(1)
  70 + }
  71 + .width(100)
  72 + .backgroundColor(Color.Gray)
  73 + .borderRadius(10)
  74 + .alignItems(VerticalAlign.Center)
  75 + .visibility(this.videoLandScape == 2 ? Visibility.Hidden : Visibility.Visible)
  76 + .onClick(() => {
  77 + this.isFullScreen = !this.isFullScreen;
  78 + WindowModel.shared.setPreferredOrientation(window.Orientation.LANDSCAPE);
  79 + devicePLSensorManager.devicePLSensorOn(window.Orientation.LANDSCAPE);
  80 + })
  81 + }
  82 + .width('100%')
  83 + // .margin({ bottom: 120 })
  84 + .alignItems(HorizontalAlign.Center)
  85 + }
  86 +
59 87
60 Row() { 88 Row() {
61 Column() { 89 Column() {
62 - if (this.newsSourceName || this.editorName) {  
63 - Text("@" + (this.newsSourceName || this.editorName)) 90 + if (this.getName()) {
  91 + Text("@" + this.getName())
64 .fontColor(Color.White) 92 .fontColor(Color.White)
65 .fontSize(15) 93 .fontSize(15)
66 .maxLines(1) 94 .maxLines(1)
67 .textOverflow({ overflow: TextOverflow.Ellipsis }) 95 .textOverflow({ overflow: TextOverflow.Ellipsis })
68 } 96 }
69 - if (this.newsTitle || this.newsSummary) {  
70 - Text(this.newsTitle || this.newsSummary) 97 + if (this.getTitle()) {
  98 + Text(this.getTitle())
71 .fontColor(Color.White) 99 .fontColor(Color.White)
72 .fontSize(15) 100 .fontSize(15)
73 .maxLines(3) 101 .maxLines(3)
74 .textOverflow({ overflow: TextOverflow.Ellipsis }) 102 .textOverflow({ overflow: TextOverflow.Ellipsis })
75 } 103 }
76 104
77 - Text('查看详情 > ')  
78 - .margin({ top: 5 })  
79 - .fontColor(Color.White)  
80 - .fontSize(12)  
81 - .maxLines(2) 105 +
  106 + if (this.contentDetailData?.newsSummary) {
  107 + Text('查看详情 > ')
  108 + .margin({ top: 8 })
  109 + .padding(6)
  110 + .borderRadius(2)
  111 + .backgroundColor('#636363')
  112 + .fontColor(Color.White)
  113 + .fontSize(12)
  114 + .onClick(() => {
  115 + console.log('click===', this.dialogController?.open)
  116 + this.isOpen = true
  117 + this.dialogController?.open()
  118 + })
  119 + }
  120 +
82 } 121 }
83 .layoutWeight(1) 122 .layoutWeight(1)
84 .alignItems(HorizontalAlign.Start) 123 .alignItems(HorizontalAlign.Start)
@@ -112,29 +151,10 @@ export struct PlayerTitleComment { @@ -112,29 +151,10 @@ export struct PlayerTitleComment {
112 .height(24) 151 .height(24)
113 .aspectRatio(1) 152 .aspectRatio(1)
114 .onClick(() => { 153 .onClick(() => {
115 - if (this.isFullScreen) {  
116 - if (deviceInfo.deviceType != "phone") {  
117 - WindowModel.shared.getWindowSize().then((size) => {  
118 - if (size.width > size.height) {  
119 - router.back();  
120 - } else {  
121 - this.isFullScreen = !this.isFullScreen;  
122 - WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT);  
123 - devicePLSensorManager.devicePLSensorOn(window.Orientation.PORTRAIT);  
124 - }  
125 - })  
126 - } else {  
127 - this.isFullScreen = !this.isFullScreen;  
128 - WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT);  
129 - devicePLSensorManager.devicePLSensorOn(window.Orientation.PORTRAIT);  
130 - }  
131 - } else {  
132 - router.back();  
133 - } 154 + router.back();
134 }) 155 })
135 156
136 TextInput({ placeholder: '说两句...', text: this.comment }) 157 TextInput({ placeholder: '说两句...', text: this.comment })
137 -  
138 .placeholderColor(Color.White) 158 .placeholderColor(Color.White)
139 .placeholderFont({ size: 14 }) 159 .placeholderFont({ size: 14 })
140 .fontColor(Color.White) 160 .fontColor(Color.White)
@@ -154,5 +174,8 @@ export struct PlayerTitleComment { @@ -154,5 +174,8 @@ export struct PlayerTitleComment {
154 .width('100%') 174 .width('100%')
155 // .height('40%') 175 // .height('40%')
156 .alignItems(HorizontalAlign.Start) 176 .alignItems(HorizontalAlign.Start)
  177 + .opacity(this.isOpen ? 0 : 1)
  178 + .animation({ duration: 200 })
157 } 179 }
158 -}  
  180 +}
  181 +
1 { 1 {
2 "src": [ 2 "src": [
3 - "pages/DetailVideoListPage",  
4 - "pages/Test" 3 + "pages/DetailVideoListPage"
5 ] 4 ]
6 } 5 }
@@ -2,6 +2,7 @@ import media from '@ohos.multimedia.media'; @@ -2,6 +2,7 @@ import media from '@ohos.multimedia.media';
2 import prompt from '@ohos.promptAction'; 2 import prompt from '@ohos.promptAction';
3 import { Logger } from '../utils/Logger'; 3 import { Logger } from '../utils/Logger';
4 import { PlayerConstants, AVPlayerStatus, Events } from '../constants/PlayerConstants'; 4 import { PlayerConstants, AVPlayerStatus, Events } from '../constants/PlayerConstants';
  5 +import { BusinessError } from '@ohos.base';
5 6
6 @Observed 7 @Observed
7 export class WDPlayerController { 8 export class WDPlayerController {
@@ -20,6 +21,7 @@ export class WDPlayerController { @@ -20,6 +21,7 @@ export class WDPlayerController {
20 public onTimeUpdate?: (position: number, duration: number) => void; 21 public onTimeUpdate?: (position: number, duration: number) => void;
21 public onVolumeUpdate?: (volume: number) => void; 22 public onVolumeUpdate?: (volume: number) => void;
22 public continue?: () => void; 23 public continue?: () => void;
  24 + public onCanplay?: () => void;
23 25
24 constructor() { 26 constructor() {
25 Logger.error("初始化") 27 Logger.error("初始化")
@@ -43,7 +45,10 @@ export class WDPlayerController { @@ -43,7 +45,10 @@ export class WDPlayerController {
43 Logger.error('[PlayVideoModel] createAvPlayer fail!'); 45 Logger.error('[PlayVideoModel] createAvPlayer fail!');
44 reject(); 46 reject();
45 } 47 }
  48 + }).catch((error: BusinessError) => {
  49 + console.error(`AVPlayer catchCallback, error message:${error.message}`);
46 }); 50 });
  51 + ;
47 }); 52 });
48 } 53 }
49 54
@@ -74,6 +79,9 @@ export class WDPlayerController { @@ -74,6 +79,9 @@ export class WDPlayerController {
74 } 79 }
75 // this.avPlayer.play(); 80 // this.avPlayer.play();
76 this.duration = this.avPlayer.duration; 81 this.duration = this.avPlayer.duration;
  82 + if (this.onCanplay) {
  83 + this.onCanplay()
  84 + }
77 break; 85 break;
78 case AVPlayerStatus.PLAYING: 86 case AVPlayerStatus.PLAYING:
79 this.setBright(); 87 this.setBright();
@@ -143,13 +151,15 @@ export class WDPlayerController { @@ -143,13 +151,15 @@ export class WDPlayerController {
143 } 151 }
144 152
145 async release() { 153 async release() {
146 - if (this.avPlayer == null) {  
147 - await this.initPromise;  
148 - } 154 + // if (this.avPlayer == null) {
  155 + // await this.initPromise;
  156 + // }
149 if (this.avPlayer == null) { 157 if (this.avPlayer == null) {
150 return 158 return
151 } 159 }
152 - this.avPlayer.release(); 160 + this.avPlayer.release()
  161 + this.avPlayer = undefined
  162 +
153 } 163 }
154 164
155 async pause() { 165 async pause() {
@@ -171,7 +181,7 @@ export class WDPlayerController { @@ -171,7 +181,7 @@ export class WDPlayerController {
171 } 181 }
172 this.avPlayer.play(); 182 this.avPlayer.play();
173 } 183 }
174 - 184 +
175 async stop() { 185 async stop() {
176 if (this.avPlayer == null) { 186 if (this.avPlayer == null) {
177 await this.initPromise; 187 await this.initPromise;
@@ -250,6 +260,10 @@ export class WDPlayerController { @@ -250,6 +260,10 @@ export class WDPlayerController {
250 return this.status; 260 return this.status;
251 } 261 }
252 262
  263 + getPlayer() {
  264 + return this.avPlayer;
  265 + }
  266 +
253 initProgress(time: number) { 267 initProgress(time: number) {
254 let nowSeconds = Math.floor(time / 1000); 268 let nowSeconds = Math.floor(time / 1000);
255 let totalSeconds = Math.floor(this.duration / 1000); 269 let totalSeconds = Math.floor(this.duration / 1000);
@@ -74,7 +74,7 @@ export struct WDPlayerRenderView { @@ -74,7 +74,7 @@ export struct WDPlayerRenderView {
74 Row() { 74 Row() {
75 // 设置为“surface“类型时XComponent组件可以和其他组件一起进行布局和渲染。 75 // 设置为“surface“类型时XComponent组件可以和其他组件一起进行布局和渲染。
76 XComponent({ 76 XComponent({
77 - id: 'xComponentId112233', 77 + id: 'xComponentId',
78 type: 'surface', 78 type: 'surface',
79 controller: this.xComponentController 79 controller: this.xComponentController
80 }) 80 })
1 -@Component  
2 -export struct AVPlayer {  
3 - @State outSetValueOne:number = 40  
4 -  
5 - build() {  
6 - Column(){  
7 - // 进度条  
8 - Row(){  
9 - Slider({  
10 - value: this.outSetValueOne,  
11 - min: 0,  
12 - max: 100,  
13 - style: SliderStyle.OutSet  
14 - })  
15 - .trackColor('rgba(0,0,0,0.5)')  
16 - .selectedColor('#ED2800')  
17 - .showTips(true)  
18 - .onChange((value: number, mode: SliderChangeMode) => {  
19 - this.outSetValueOne = value  
20 - console.info('value:' + value + 'mode:' + mode.toString())  
21 - })  
22 - }  
23 - .width('100%')  
24 - .padding({left:24,right:24})  
25 - .margin({top:110})  
26 - // 播放按钮  
27 - Row(){  
28 - Image($r('app.media.loop'))  
29 - .width(24)  
30 - .height(24)  
31 - Image($r('app.media.Backward'))  
32 - .width(24)  
33 - .height(24)  
34 - Stack(){  
35 - Image($r("app.media.playicon"))  
36 - .width(32)  
37 - .height(32)  
38 - }  
39 - .backgroundColor('rgba(255,255,255,0.1)')  
40 - .width(60)  
41 - .height(60)  
42 - .padding(14)  
43 - .borderRadius(50)  
44 - .onClick(()=>{  
45 - // this.avPlayerUrl()  
46 - })  
47 -  
48 - Image($r('app.media.fastForward'))  
49 - .width(24)  
50 - .height(24)  
51 - Image($r('app.media.doubleSpeed'))  
52 - .width(24)  
53 - .height(24)  
54 - }  
55 - .width('100%')  
56 - .justifyContent(FlexAlign.SpaceBetween)  
57 - .margin({top:56})  
58 - .padding({left:32,right:32})  
59 - }  
60 -  
61 - }  
62 -}  
  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 +}
1 -import media from '@ohos.multimedia.media';  
2 -import { Song } from '../viewModel/Song'  
3 -import { AVPlayer } from '../../components/AVPlayer'  
4 - 1 +import { Logger } from 'wdKit';
  2 +import { AudioDetailComponent } from 'wdComponent';
  3 +import router from '@ohos.router';
  4 +import { Params, Action } from 'wdBean';
  5 +const TAG = 'AudioDetail';
5 @Entry 6 @Entry
6 @Component 7 @Component
7 struct AudioDetail { 8 struct AudioDetail {
8 - @State message: string = '大自然的奇迹展览在中国国家博物馆拉开帷幕';  
9 - @State iocClock: string = '定时';  
10 - @State iconTheOriginal: string = '原文';  
11 - @State iconList: string = '列表';  
12 - @State text: string = ''  
13 - @State showList: boolean = false  
14 - controller: TextInputController = new TextInputController()  
15 - // 音频  
16 - @State songs: Song[] = []  
17 -  
18 - // private avPlayer:media.AVPlayer  
19 -  
20 - async aboutToAppear() {  
21 - //加载音乐列表  
22 - // let response = await axios({  
23 - // method:'get',  
24 - // url:''  
25 - // })  
26 - // //创建avPlayer实例对象  
27 - // this.avPlayer = await media.createAVPlayer()  
28 - // //创建状态机变化回调函数  
29 - // this.setAVPlayerCallback()  
30 - // // this.avPlayer.url =  
31 - }  
32 9
33 - // 注册avplayer回调函数  
34 - // setAVPlayerCallback() {  
35 - // // seek操作结果回调函数  
36 - // this.avPlayer.on('seekDone', (seekDoneTime) => {  
37 - // console.info(`AVPlayer seek succeeded, seek time is ${seekDoneTime}`);  
38 - // })  
39 - // // error回调监听函数,当avPlayer在操作过程中出现错误时调用reset接口触发重置流程  
40 - // this.avPlayer.on('error', (err) => {  
41 - // console.error(`Invoke avPlayer failed, code is ${err.code}, message is ${err.message}`);  
42 - // this.avPlayer.reset(); // 调用reset重置资源,触发idle状态  
43 - // })  
44 - // // 状态机变化回调函数  
45 - // this.avPlayer.on('stateChange', async (state, reason) => {  
46 - // switch (state) {  
47 - // case 'idle': // 成功调用reset接口后触发该状态机上报  
48 - // console.info('AVPlayer state idle called.');  
49 - // this.avPlayer.release(); // 调用release接口销毁实例对象  
50 - // break;  
51 - // case 'initialized': // avplayer 设置播放源后触发该状态上报  
52 - // console.info('AVPlayerstate initialized called.');  
53 - // this.avPlayer.prepare().then(() => {  
54 - // console.info('AVPlayer prepare succeeded.');  
55 - // })  
56 - // break;  
57 - // case 'prepared': // prepare调用成功后上报该状态机  
58 - // console.info('AVPlayer state prepared called.');  
59 - // this.avPlayer.play(); // 调用播放接口开始播放  
60 - // break;  
61 - // case 'playing': // play成功调用后触发该状态机上报  
62 - // console.info('AVPlayer state playing called.');  
63 - // break;  
64 - // case 'paused': // pause成功调用后触发该状态机上报  
65 - // console.info('AVPlayer state paused called.');  
66 - // this.avPlayer.play(); // 再次播放接口开始播放  
67 - // break;  
68 - // case 'completed': // 播放结束后触发该状态机上报  
69 - // console.info('AVPlayer state completed called.');  
70 - // this.avPlayer.stop(); //调用播放结束接口  
71 - // break;  
72 - // case 'stopped': // stop接口成功调用后触发该状态机上报  
73 - // console.info('AVPlayer state stopped called.');  
74 - // this.avPlayer.reset(); // 调用reset接口初始化avplayer状态  
75 - // break;  
76 - // case 'released':  
77 - // console.info('AVPlayer state released called.');  
78 - // break;  
79 - // default:  
80 - // console.info('AVPlayer state unknown called.');  
81 - // break;  
82 - // }  
83 - // })  
84 - // } 10 + @State relId: string = ''
  11 + @State contentId: string = ''
  12 + @State relType: string = ''
85 13
86 build() { 14 build() {
87 Column() { 15 Column() {
88 - Row() {  
89 - Column() {  
90 - // 封面  
91 - Row() {  
92 - Image($r('app.media.audio'))  
93 - .width(240)  
94 - .height(160)  
95 - .borderRadius('0.00vp')  
96 - }  
97 - .justifyContent(FlexAlign.Center)  
98 - .width('100%')  
99 - .margin({ top: 64 })  
100 -  
101 - // 标题  
102 - Row() {  
103 - Text(this.message)  
104 - .fontSize(20)  
105 - .fontWeight(FontWeight.Bold)  
106 - .fontColor('#ffffff')  
107 - .textAlign(TextAlign.Center)  
108 - .lineHeight(28)  
109 - .fontFamily('PingFang SC, PingFang SC')  
110 - }  
111 - .padding({ left: 34, right: 34 })  
112 - .margin({ top: 32 })  
113 -  
114 - // 操作矩阵  
115 - Row() {  
116 - // 定时  
117 - Column() {  
118 - Image($r('app.media.clock'))  
119 - .width(28)  
120 - .height(28)  
121 - Text(this.iocClock)  
122 - .fontColor('#fff')  
123 - .fontSize(12)  
124 - .lineHeight(16)  
125 - .margin(2)  
126 - }  
127 -  
128 - // 原文  
129 - Column() {  
130 - Image($r('app.media.theOriginal'))  
131 - .width(28)  
132 - .height(28)  
133 - Text(this.iconTheOriginal)  
134 - .fontColor('#fff')  
135 - .fontSize(12)  
136 - .lineHeight(16)  
137 - .margin(2)  
138 - }  
139 -  
140 - // 列表  
141 - Column() {  
142 - Image($r('app.media.list'))  
143 - .width(28)  
144 - .height(28)  
145 - Text(this.iconList)  
146 - .fontColor('#fff')  
147 - .fontSize(12)  
148 - .lineHeight(16)  
149 - .margin(2)  
150 - }  
151 - .onClick(() => {  
152 - this.showList = !this.showList  
153 - console.log('列表', this.showList)  
154 - })  
155 - }  
156 - .width('100%')  
157 - .padding({ left: 49, right: 49 })  
158 - .justifyContent(FlexAlign.SpaceBetween)  
159 - .margin({ top: 60 })  
160 -  
161 - AVPlayer()  
162 - }  
163 - }  
164 - .height('100%-56')  
165 -  
166 - Row() {  
167 - Image($r('app.media.leftArrow'))  
168 - .width(24)  
169 - .height(24)  
170 - TextInput({ text: this.text, placeholder: 'input your word...', controller: this.controller })  
171 - .placeholderColor('#999999')  
172 - .placeholderFont({ size: 12, weight: 400 })  
173 - .caretColor(Color.White)  
174 - .height(30)  
175 - .width(115)  
176 - .fontSize(12)  
177 - .fontColor('#999999')  
178 - .backgroundColor('rgba(255,255,255,0.1)')  
179 - .borderRadius(0)  
180 - .backgroundColor('[UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:1.0].CGColor')  
181 - .onChange((value: string) => {  
182 - this.text = value  
183 - })  
184 - // 消息  
185 - Badge({  
186 - count: 100,  
187 - style: { fontSize: 12, badgeColor: '#FA2A2D' },  
188 - }) {  
189 - Image($r('app.media.news'))  
190 - .width(24)  
191 - .height(24)  
192 - }  
193 -  
194 - // 点赞  
195 - Badge({  
196 - count: 100,  
197 - style: { fontSize: 12, badgeColor: '#FA2A2D' },  
198 - }) {  
199 - Image($r('app.media.like'))  
200 - .width(24)  
201 - .height(24)  
202 - }  
203 -  
204 - // 收藏  
205 - Image($r('app.media.collection'))  
206 - .width(24)  
207 - .height(24)  
208 - // 分享  
209 - Image($r('app.media.share'))  
210 - .width(24)  
211 - .height(24)  
212 - }  
213 - .height(56)  
214 - .width('100%')  
215 - .padding(13)  
216 - .justifyContent(FlexAlign.SpaceBetween)  
217 -  
218 - // 播放列表 16 + AudioDetailComponent({
  17 + relId: this.relId,
  18 + contentId: this.contentId,
  19 + relType: this.relType
  20 + })
219 } 21 }
220 .height('100%') 22 .height('100%')
  23 + .width('100%')
221 .backgroundColor('#20272E') 24 .backgroundColor('#20272E')
222 - .justifyContent(FlexAlign.SpaceBetween)  
223 - 25 + }
  26 + aboutToAppear() {
  27 + let par:Action = router.getParams() as Action;
  28 + let params = par?.params;
  29 + this.relId = params?.extra?.relId || '';
  30 + this.relType = params?.extra?.relType || '';
  31 + this.contentId = params?.contentID || '';
224 } 32 }
225 } 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 }