Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
55 changed files
with
1505 additions
and
249 deletions
Too many changes to show.
To preserve performance only 55 of 55+ files are displayed.
| @@ -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 | /* | 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 | 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 | } |
sight_harmony/features/wdComponent/src/main/ets/components/broadcast/BroadcastPageComponent.ets
0 → 100644
| 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 | } |
sight_harmony/features/wdComponent/src/main/ets/components/mine/follow/FollowSecondTabsComponent.ets
| @@ -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 }) |
-
Please register or login to post a comment