Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
49 changed files
with
1999 additions
and
981 deletions
| @@ -556,6 +556,24 @@ export class HttpUrlUtils { | @@ -556,6 +556,24 @@ export class HttpUrlUtils { | ||
| 556 | return url | 556 | return url |
| 557 | } | 557 | } |
| 558 | 558 | ||
| 559 | + /*评论状态*/ | ||
| 560 | + static getBatchCommentStatusUrl() { | ||
| 561 | + let url = HttpUrlUtils._hostUrl + "/api/rmrb-comment/comment/zh/c/batchCommentStatus" | ||
| 562 | + return url | ||
| 563 | + } | ||
| 564 | + | ||
| 565 | + /*levleIcon*/ | ||
| 566 | + static getBatchUserUrl() { | ||
| 567 | + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-point/auth/level/zh/c/batchUser" | ||
| 568 | + return url | ||
| 569 | + } | ||
| 570 | + | ||
| 571 | + /*authIcon 20个一次上限*/ | ||
| 572 | + static getDetailListUrl() { | ||
| 573 | + let url = HttpUrlUtils._hostUrl + "/api/rmrb-contact/contact/zh/c/master/detailList" | ||
| 574 | + return url | ||
| 575 | + } | ||
| 576 | + | ||
| 559 | 577 | ||
| 560 | //账户注销 | 578 | //账户注销 |
| 561 | static accountLogoutUrl() { | 579 | static accountLogoutUrl() { |
| @@ -756,6 +774,12 @@ export class HttpUrlUtils { | @@ -756,6 +774,12 @@ export class HttpUrlUtils { | ||
| 756 | return url | 774 | return url |
| 757 | } | 775 | } |
| 758 | 776 | ||
| 777 | + //点赞 | ||
| 778 | + static executeLike() { | ||
| 779 | + let url = HttpUrlUtils._hostUrl + "/api/rmrb-interact/interact/zh/c/like/executeLike"; | ||
| 780 | + return url; | ||
| 781 | + } | ||
| 782 | + | ||
| 759 | // static getYcgCommonHeaders(): HashMap<string, string> { | 783 | // static getYcgCommonHeaders(): HashMap<string, string> { |
| 760 | // let headers: HashMap<string, string> = new HashMap<string, string>() | 784 | // let headers: HashMap<string, string> = new HashMap<string, string>() |
| 761 | // | 785 | // |
| @@ -83,6 +83,8 @@ export class WDRouterPage { | @@ -83,6 +83,8 @@ export class WDRouterPage { | ||
| 83 | static privacySettingPage = new WDRouterPage("wdComponent", "ets/components/page/PrivacySettingPage"); | 83 | static privacySettingPage = new WDRouterPage("wdComponent", "ets/components/page/PrivacySettingPage"); |
| 84 | // 关于页 | 84 | // 关于页 |
| 85 | static aboutPage = new WDRouterPage("wdComponent", "ets/components/page/SettingAboutPage"); | 85 | static aboutPage = new WDRouterPage("wdComponent", "ets/components/page/SettingAboutPage"); |
| 86 | + // 精选评论页 | ||
| 87 | + static QualityCommentsPage = new WDRouterPage("wdComponent", "ets/components/page/QualityCommentsPage"); | ||
| 86 | // 设置页 | 88 | // 设置页 |
| 87 | static settingPage = new WDRouterPage("wdComponent", "ets/components/page/SettingPage"); | 89 | static settingPage = new WDRouterPage("wdComponent", "ets/components/page/SettingPage"); |
| 88 | // 设置页 | 90 | // 设置页 |
| @@ -18,6 +18,7 @@ import { CardParser } from './CardParser'; | @@ -18,6 +18,7 @@ import { CardParser } from './CardParser'; | ||
| 18 | import { LiveHorizontalReservationComponent } from './view/LiveHorizontalReservationComponent'; | 18 | import { LiveHorizontalReservationComponent } from './view/LiveHorizontalReservationComponent'; |
| 19 | import { ZhGridLayout02 } from './compview/ZhGridLayout02'; | 19 | import { ZhGridLayout02 } from './compview/ZhGridLayout02'; |
| 20 | import { Card5Component } from './cardview/Card5Component' | 20 | import { Card5Component } from './cardview/Card5Component' |
| 21 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 21 | 22 | ||
| 22 | /** | 23 | /** |
| 23 | * comp适配器. | 24 | * comp适配器. |
| @@ -72,6 +73,14 @@ export struct CompParser { | @@ -72,6 +73,14 @@ export struct CompParser { | ||
| 72 | } | 73 | } |
| 73 | else { | 74 | else { |
| 74 | // todo:组件未实现 / Component Not Implemented | 75 | // todo:组件未实现 / Component Not Implemented |
| 76 | + Text(compDTO.compStyle) | ||
| 77 | + .width(CommonConstants.FULL_PARENT) | ||
| 78 | + .padding(10) | ||
| 79 | + .onClick(()=>{ | ||
| 80 | + if (compDTO.compStyle === CompStyle.Zh_Single_Row_06) {//精选评论 | ||
| 81 | + WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage) | ||
| 82 | + } | ||
| 83 | + }) | ||
| 75 | // Text(compDTO.compStyle) | 84 | // Text(compDTO.compStyle) |
| 76 | // .width(CommonConstants.FULL_PARENT) | 85 | // .width(CommonConstants.FULL_PARENT) |
| 77 | // .padding(10) | 86 | // .padding(10) |
| @@ -8,6 +8,7 @@ import { ENewspaperCalendarDialog } from '../dialog/ENewspaperCalendarDialog'; | @@ -8,6 +8,7 @@ import { ENewspaperCalendarDialog } from '../dialog/ENewspaperCalendarDialog'; | ||
| 8 | import font from '@ohos.font'; | 8 | import font from '@ohos.font'; |
| 9 | import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog'; | 9 | import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog'; |
| 10 | import { RMCalendarBean } from './calendar/RMCalendarBean'; | 10 | import { RMCalendarBean } from './calendar/RMCalendarBean'; |
| 11 | +import { newsSkeleton } from './skeleton/newsSkeleton'; | ||
| 11 | 12 | ||
| 12 | @Component | 13 | @Component |
| 13 | export struct ENewspaperPageComponent { | 14 | export struct ENewspaperPageComponent { |
| @@ -63,13 +64,15 @@ export struct ENewspaperPageComponent { | @@ -63,13 +64,15 @@ export struct ENewspaperPageComponent { | ||
| 63 | customStyle: true, | 64 | customStyle: true, |
| 64 | }) | 65 | }) |
| 65 | //文字报纸弹框 | 66 | //文字报纸弹框 |
| 66 | - listDialogController: CustomDialogController = new CustomDialogController({ | ||
| 67 | - builder: ENewspaperListDialog({ | ||
| 68 | - newspaperListBean: this.newspaperListBean | ||
| 69 | - }), | ||
| 70 | - alignment: DialogAlignment.Bottom, | ||
| 71 | - offset: { dx: 0, dy: 0 } | ||
| 72 | - }) | 67 | + @State isOpenListDialog: boolean = false |
| 68 | + | ||
| 69 | + // listDialogController: CustomDialogController = new CustomDialogController({ | ||
| 70 | + // builder: ENewspaperListDialog({ | ||
| 71 | + // newspaperListBean: this.newspaperListBean | ||
| 72 | + // }), | ||
| 73 | + // alignment: DialogAlignment.Bottom, | ||
| 74 | + // offset: { dx: 0, dy: 0 } | ||
| 75 | + // }) | ||
| 73 | 76 | ||
| 74 | async aboutToAppear() { | 77 | async aboutToAppear() { |
| 75 | //获取宽高尺寸 | 78 | //获取宽高尺寸 |
| @@ -95,184 +98,207 @@ export struct ENewspaperPageComponent { | @@ -95,184 +98,207 @@ export struct ENewspaperPageComponent { | ||
| 95 | } | 98 | } |
| 96 | 99 | ||
| 97 | build() { | 100 | build() { |
| 98 | - RelativeContainer() { | 101 | + Stack() { |
| 99 | RelativeContainer() { | 102 | RelativeContainer() { |
| 100 | - Image($r('app.media.icon_arrow_down')) | ||
| 101 | - .height($r('app.float.top_arrow_size')) | ||
| 102 | - .width($r('app.float.top_arrow_size')) | 103 | + RelativeContainer() { |
| 104 | + Image($r('app.media.icon_arrow_down')) | ||
| 105 | + .height($r('app.float.top_arrow_size')) | ||
| 106 | + .width($r('app.float.top_arrow_size')) | ||
| 107 | + .alignRules({ | ||
| 108 | + left: { anchor: "__container__", align: HorizontalAlign.Start }, | ||
| 109 | + center: { anchor: "__container__", align: VerticalAlign.Center } | ||
| 110 | + }) | ||
| 111 | + .id('e_newspaper_back') | ||
| 112 | + .onClick((event: ClickEvent) => { | ||
| 113 | + router.back() | ||
| 114 | + }) | ||
| 115 | + | ||
| 116 | + Row() { | ||
| 117 | + Text(this.calendarDate?.replace('-', '.')?.replace('-', '.')) | ||
| 118 | + .fontSize($r('app.float.font_size_20')) | ||
| 119 | + .fontColor($r('app.color.white')) | ||
| 120 | + .fontFamily('BebasNeue_Regular') | ||
| 121 | + .fontWeight(FontWeight.Regular) | ||
| 122 | + | ||
| 123 | + Image($r('app.media.icon_triangle')) | ||
| 124 | + .width($r('app.float.border_radius_6')) | ||
| 125 | + .height($r('app.float.border_radius_6')) | ||
| 126 | + .margin({ left: 2, bottom: 5 }) | ||
| 127 | + } | ||
| 128 | + .alignItems(VerticalAlign.Bottom) | ||
| 103 | .alignRules({ | 129 | .alignRules({ |
| 104 | - left: { anchor: "__container__", align: HorizontalAlign.Start }, | 130 | + middle: { anchor: "__container__", align: HorizontalAlign.Center }, |
| 105 | center: { anchor: "__container__", align: VerticalAlign.Center } | 131 | center: { anchor: "__container__", align: VerticalAlign.Center } |
| 106 | }) | 132 | }) |
| 107 | - .id('e_newspaper_back') | 133 | + .id('e_newspaper_date') |
| 134 | + .onClick(() => { | ||
| 135 | + this.calendarDialogShow = !this.calendarDialogShow | ||
| 136 | + if (this.calendarDialogShow) { | ||
| 137 | + this.calendarDialogController.open() | ||
| 138 | + } else { | ||
| 139 | + this.calendarDialogController.close() | ||
| 140 | + } | ||
| 141 | + }) | ||
| 142 | + | ||
| 143 | + Image($r('app.media.icon_share')) | ||
| 144 | + .height($r('app.float.top_arrow_size')) | ||
| 145 | + .width($r('app.float.top_arrow_size')) | ||
| 146 | + .alignRules({ | ||
| 147 | + right: { anchor: "__container__", align: HorizontalAlign.End }, | ||
| 148 | + center: { anchor: "__container__", align: VerticalAlign.Center } | ||
| 149 | + }) | ||
| 150 | + .id('e_newspaper_share') | ||
| 151 | + } | ||
| 152 | + .margin({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') }) | ||
| 153 | + .height($r('app.float.top_bar_height')) | ||
| 154 | + .alignRules({ | ||
| 155 | + top: { anchor: '__container__', align: VerticalAlign.Top }, | ||
| 156 | + left: { anchor: '__container__', align: HorizontalAlign.Start }, | ||
| 157 | + right: { anchor: '__container__', align: HorizontalAlign.End } | ||
| 158 | + }) | ||
| 159 | + .id('e_newspaper_top') | ||
| 160 | + | ||
| 161 | + if (!this.newspaperListBean || !this.newspaperListBean.list || this.newspaperListBean.list.length == 0) { | ||
| 162 | + newsSkeleton() | ||
| 163 | + .alignRules({ | ||
| 164 | + top: { anchor: "e_newspaper_top", align: VerticalAlign.Bottom }, | ||
| 165 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 166 | + }) | ||
| 167 | + .id('news_skeleton_id') | ||
| 168 | + .width('100%') | ||
| 169 | + .height(px2vp(this.picHeight) + 32) | ||
| 170 | + .margin({ top: 35, left: 10, right: 10 }) | ||
| 171 | + } | ||
| 172 | + | ||
| 173 | + if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { | ||
| 174 | + Swiper(this.swiperController) { | ||
| 175 | + ForEach(this.newspaperListBean?.list, (item: NewspaperListItemBean, index: number) => { | ||
| 176 | + ENewspaperItemComponent({ newspaperListItemBean: item }) | ||
| 177 | + }) | ||
| 178 | + } | ||
| 179 | + .index(this.swiperIndex) | ||
| 180 | + .width('100%') | ||
| 181 | + .height(px2vp(this.picHeight) + 32) | ||
| 182 | + .vertical(true) | ||
| 183 | + .autoPlay(false) | ||
| 184 | + .cachedCount(3) | ||
| 185 | + .indicator(false) | ||
| 186 | + .loop(false) | ||
| 187 | + .displayCount(1) | ||
| 188 | + .margin({ top: 35, left: 10, right: 10 }) | ||
| 189 | + .id('e_newspaper_content') | ||
| 190 | + .alignRules({ | ||
| 191 | + top: { anchor: "e_newspaper_top", align: VerticalAlign.Bottom }, | ||
| 192 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 193 | + }) | ||
| 194 | + .onChange((index: number) => { | ||
| 195 | + this.currentPageNum = this.newspaperListBean?.list[index]?.pageNum | ||
| 196 | + this.swiperIndex = index | ||
| 197 | + }) | ||
| 198 | + | ||
| 199 | + Image($r('app.media.newspaper_shadow')) | ||
| 200 | + .height($r('app.float.vp_12')) | ||
| 201 | + .margin({ left: 20, right: 20, top: -1 }) | ||
| 202 | + .objectFit(ImageFit.Contain) | ||
| 203 | + .alignRules({ | ||
| 204 | + top: { anchor: "e_newspaper_content", align: VerticalAlign.Bottom }, | ||
| 205 | + left: { anchor: 'e_newspaper_content', align: HorizontalAlign.Start }, | ||
| 206 | + right: { anchor: 'e_newspaper_content', align: HorizontalAlign.End } | ||
| 207 | + }) | ||
| 208 | + .id('e_newspaper_shadow') | ||
| 209 | + | ||
| 210 | + Row() { | ||
| 211 | + Text(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? '已到底部,可以选择其他日期' : '滑动查看下一版') | ||
| 212 | + .fontColor(Color.White) | ||
| 213 | + .fontSize($r('app.float.font_size_14')) | ||
| 214 | + Image($r('app.media.icon_next_page')) | ||
| 215 | + .width($r('app.float.vp_16')) | ||
| 216 | + .height($r('app.float.vp_16')) | ||
| 217 | + .visibility(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? Visibility.None : Visibility.Visible) | ||
| 218 | + } | ||
| 219 | + .justifyContent(FlexAlign.Center) | ||
| 220 | + .margin({ top: $r('app.float.margin_16') }) | ||
| 221 | + .alignRules({ | ||
| 222 | + top: { anchor: "e_newspaper_shadow", align: VerticalAlign.Bottom }, | ||
| 223 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 224 | + }) | ||
| 225 | + .id('e_newspaper_next') | ||
| 108 | .onClick((event: ClickEvent) => { | 226 | .onClick((event: ClickEvent) => { |
| 109 | - router.back() | 227 | + this.swiperController.showNext() |
| 110 | }) | 228 | }) |
| 229 | + } | ||
| 111 | 230 | ||
| 112 | Row() { | 231 | Row() { |
| 113 | - Text(this.calendarDate?.replace('-', '.')?.replace('-', '.')) | ||
| 114 | - .fontSize($r('app.float.font_size_20')) | 232 | + Text(this.currentPageNum) |
| 233 | + .fontSize($r('app.float.font_size_36')) | ||
| 115 | .fontColor($r('app.color.white')) | 234 | .fontColor($r('app.color.white')) |
| 116 | .fontFamily('BebasNeue_Regular') | 235 | .fontFamily('BebasNeue_Regular') |
| 117 | - .fontWeight(FontWeight.Regular) | 236 | + Text('版') |
| 237 | + .fontSize($r('app.float.font_size_16')) | ||
| 238 | + .fontColor($r('app.color.white')) | ||
| 239 | + .margin({ bottom: 6 }) | ||
| 118 | 240 | ||
| 119 | Image($r('app.media.icon_triangle')) | 241 | Image($r('app.media.icon_triangle')) |
| 120 | .width($r('app.float.border_radius_6')) | 242 | .width($r('app.float.border_radius_6')) |
| 121 | .height($r('app.float.border_radius_6')) | 243 | .height($r('app.float.border_radius_6')) |
| 122 | - .margin({ left: 2, bottom: 5 }) | 244 | + .margin({ left: 2, bottom: 6 }) |
| 123 | } | 245 | } |
| 124 | .alignItems(VerticalAlign.Bottom) | 246 | .alignItems(VerticalAlign.Bottom) |
| 247 | + .margin({ left: $r('app.float.margin_16'), bottom: $r('app.float.top_tab_bar_height') }) | ||
| 125 | .alignRules({ | 248 | .alignRules({ |
| 126 | - middle: { anchor: "__container__", align: HorizontalAlign.Center }, | ||
| 127 | - center: { anchor: "__container__", align: VerticalAlign.Center } | 249 | + bottom: { anchor: '__container__', align: VerticalAlign.Bottom }, |
| 250 | + left: { anchor: '__container__', align: HorizontalAlign.Start } | ||
| 128 | }) | 251 | }) |
| 129 | - .id('e_newspaper_date') | ||
| 130 | - .onClick(() => { | ||
| 131 | - this.calendarDialogShow = !this.calendarDialogShow | ||
| 132 | - if (this.calendarDialogShow) { | ||
| 133 | - this.calendarDialogController.open() | 252 | + .id('e_newspaper_page_num') |
| 253 | + .onClick((event: ClickEvent) => { | ||
| 254 | + this.pageDialogShow = !this.pageDialogShow | ||
| 255 | + if (this.pageDialogShow) { | ||
| 256 | + this.pageDialogController.open() | ||
| 134 | } else { | 257 | } else { |
| 135 | - this.calendarDialogController.close() | 258 | + this.pageDialogController.close() |
| 136 | } | 259 | } |
| 137 | }) | 260 | }) |
| 138 | 261 | ||
| 139 | - Image($r('app.media.icon_share')) | ||
| 140 | - .height($r('app.float.top_arrow_size')) | ||
| 141 | - .width($r('app.float.top_arrow_size')) | ||
| 142 | - .alignRules({ | ||
| 143 | - right: { anchor: "__container__", align: HorizontalAlign.End }, | ||
| 144 | - center: { anchor: "__container__", align: VerticalAlign.Center } | ||
| 145 | - }) | ||
| 146 | - .id('e_newspaper_share') | ||
| 147 | - } | ||
| 148 | - .margin({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') }) | ||
| 149 | - .height($r('app.float.top_bar_height')) | ||
| 150 | - .alignRules({ | ||
| 151 | - top: { anchor: '__container__', align: VerticalAlign.Top }, | ||
| 152 | - left: { anchor: '__container__', align: HorizontalAlign.Start }, | ||
| 153 | - right: { anchor: '__container__', align: HorizontalAlign.End } | ||
| 154 | - }) | ||
| 155 | - .id('e_newspaper_top') | ||
| 156 | - | ||
| 157 | - if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { | ||
| 158 | - Swiper(this.swiperController) { | ||
| 159 | - ForEach(this.newspaperListBean?.list, (item: NewspaperListItemBean, index: number) => { | ||
| 160 | - ENewspaperItemComponent({ newspaperListItemBean: item }) | ||
| 161 | - }) | ||
| 162 | - } | ||
| 163 | - .index(this.swiperIndex) | ||
| 164 | - .width('100%') | ||
| 165 | - .height(px2vp(this.picHeight) + 32) | ||
| 166 | - .vertical(true) | ||
| 167 | - .autoPlay(false) | ||
| 168 | - .cachedCount(3) | ||
| 169 | - .indicator(false) | ||
| 170 | - .loop(false) | ||
| 171 | - .displayCount(1) | ||
| 172 | - .margin({ top: 35, left: 10, right: 10 }) | ||
| 173 | - .id('e_newspaper_content') | ||
| 174 | - .alignRules({ | ||
| 175 | - top: { anchor: "e_newspaper_top", align: VerticalAlign.Bottom }, | ||
| 176 | - middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 177 | - }) | ||
| 178 | - .onChange((index: number) => { | ||
| 179 | - this.currentPageNum = this.newspaperListBean?.list[index]?.pageNum | ||
| 180 | - this.swiperIndex = index | ||
| 181 | - }) | ||
| 182 | - | ||
| 183 | - Image($r('app.media.newspaper_shadow')) | ||
| 184 | - .height($r('app.float.vp_12')) | ||
| 185 | - .margin({ left: 20, right: 20, top: -1 }) | ||
| 186 | - .objectFit(ImageFit.Contain) | ||
| 187 | - .alignRules({ | ||
| 188 | - top: { anchor: "e_newspaper_content", align: VerticalAlign.Bottom }, | ||
| 189 | - left: { anchor: 'e_newspaper_content', align: HorizontalAlign.Start }, | ||
| 190 | - right: { anchor: 'e_newspaper_content', align: HorizontalAlign.End } | ||
| 191 | - }) | ||
| 192 | - .id('e_newspaper_shadow') | 262 | + // .bindPopup(this.pageNumPopup, { |
| 263 | + // builder: this.popupBuilder, | ||
| 264 | + // placement: Placement.Top, | ||
| 265 | + // popupColor: Color.White | ||
| 266 | + // }) | ||
| 193 | 267 | ||
| 194 | Row() { | 268 | Row() { |
| 195 | - Text(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? '已到底部,可以选择其他日期' : '滑动查看下一版') | ||
| 196 | - .fontColor(Color.White) | 269 | + Image($r('app.media.icon_read_paper')) |
| 270 | + .width($r('app.float.vp_20')) | ||
| 271 | + .height($r('app.float.vp_20')) | ||
| 272 | + .margin({ right: $r('app.float.vp_3') }) | ||
| 273 | + Text('读报纸') | ||
| 197 | .fontSize($r('app.float.font_size_14')) | 274 | .fontSize($r('app.float.font_size_14')) |
| 198 | - Image($r('app.media.icon_next_page')) | ||
| 199 | - .width($r('app.float.vp_16')) | ||
| 200 | - .height($r('app.float.vp_16')) | ||
| 201 | - .visibility(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? Visibility.None : Visibility.Visible) | 275 | + .fontColor($r('app.color.white')) |
| 202 | } | 276 | } |
| 203 | - .justifyContent(FlexAlign.Center) | ||
| 204 | - .margin({ top: $r('app.float.margin_16') }) | 277 | + .alignItems(VerticalAlign.Center) |
| 278 | + .margin({ right: $r('app.float.margin_16'), bottom: $r('app.float.top_tab_bar_height') }) | ||
| 205 | .alignRules({ | 279 | .alignRules({ |
| 206 | - top: { anchor: "e_newspaper_shadow", align: VerticalAlign.Bottom }, | ||
| 207 | - middle: { anchor: "__container__", align: HorizontalAlign.Center } | 280 | + bottom: { anchor: '__container__', align: VerticalAlign.Bottom }, |
| 281 | + right: { anchor: '__container__', align: HorizontalAlign.End } | ||
| 208 | }) | 282 | }) |
| 209 | - .id('e_newspaper_next') | 283 | + .id('e_newspaper_read') |
| 210 | .onClick((event: ClickEvent) => { | 284 | .onClick((event: ClickEvent) => { |
| 211 | - this.swiperController.showNext() | 285 | + this.isOpenListDialog = true |
| 212 | }) | 286 | }) |
| 213 | } | 287 | } |
| 288 | + .width('100%') | ||
| 289 | + .height('100%') | ||
| 290 | + .backgroundColor($r('app.color.color_80000000')) | ||
| 291 | + .id('e_newspaper_container') | ||
| 214 | 292 | ||
| 215 | - Row() { | ||
| 216 | - Text(this.currentPageNum) | ||
| 217 | - .fontSize($r('app.float.font_size_36')) | ||
| 218 | - .fontColor($r('app.color.white')) | ||
| 219 | - .fontFamily('BebasNeue_Regular') | ||
| 220 | - Text('版') | ||
| 221 | - .fontSize($r('app.float.font_size_16')) | ||
| 222 | - .fontColor($r('app.color.white')) | ||
| 223 | - .margin({ bottom: 6 }) | ||
| 224 | - | ||
| 225 | - Image($r('app.media.icon_triangle')) | ||
| 226 | - .width($r('app.float.border_radius_6')) | ||
| 227 | - .height($r('app.float.border_radius_6')) | ||
| 228 | - .margin({ left: 2, bottom: 6 }) | ||
| 229 | - } | ||
| 230 | - .alignItems(VerticalAlign.Bottom) | ||
| 231 | - .margin({ left: $r('app.float.margin_16'), bottom: $r('app.float.top_tab_bar_height') }) | ||
| 232 | - .alignRules({ | ||
| 233 | - bottom: { anchor: '__container__', align: VerticalAlign.Bottom }, | ||
| 234 | - left: { anchor: '__container__', align: HorizontalAlign.Start } | ||
| 235 | - }) | ||
| 236 | - .id('e_newspaper_page_num') | ||
| 237 | - .onClick((event: ClickEvent) => { | ||
| 238 | - this.pageDialogShow = !this.pageDialogShow | ||
| 239 | - if (this.pageDialogShow) { | ||
| 240 | - this.pageDialogController.open() | ||
| 241 | - } else { | ||
| 242 | - this.pageDialogController.close() | 293 | + ENewspaperListDialog({ |
| 294 | + newspaperListBean: this.newspaperListBean, | ||
| 295 | + closeDialog: () => { | ||
| 296 | + this.isOpenListDialog = false | ||
| 243 | } | 297 | } |
| 244 | }) | 298 | }) |
| 245 | - | ||
| 246 | - // .bindPopup(this.pageNumPopup, { | ||
| 247 | - // builder: this.popupBuilder, | ||
| 248 | - // placement: Placement.Top, | ||
| 249 | - // popupColor: Color.White | ||
| 250 | - // }) | ||
| 251 | - | ||
| 252 | - Row() { | ||
| 253 | - Image($r('app.media.icon_read_paper')) | ||
| 254 | - .width($r('app.float.vp_20')) | ||
| 255 | - .height($r('app.float.vp_20')) | ||
| 256 | - .margin({ right: $r('app.float.vp_3') }) | ||
| 257 | - Text('读报纸') | ||
| 258 | - .fontSize($r('app.float.font_size_14')) | ||
| 259 | - .fontColor($r('app.color.white')) | ||
| 260 | - } | ||
| 261 | - .alignItems(VerticalAlign.Center) | ||
| 262 | - .margin({ right: $r('app.float.margin_16'), bottom: $r('app.float.top_tab_bar_height') }) | ||
| 263 | - .alignRules({ | ||
| 264 | - bottom: { anchor: '__container__', align: VerticalAlign.Bottom }, | ||
| 265 | - right: { anchor: '__container__', align: HorizontalAlign.End } | ||
| 266 | - }) | ||
| 267 | - .id('e_newspaper_read') | ||
| 268 | - .onClick((event: ClickEvent) => { | ||
| 269 | - this.listDialogController.open() | ||
| 270 | - }) | 299 | + .visibility(this.isOpenListDialog ? Visibility.Visible : Visibility.None) |
| 271 | } | 300 | } |
| 272 | - .width('100%') | ||
| 273 | - .height('100%') | ||
| 274 | - .backgroundColor($r('app.color.color_80000000')) | ||
| 275 | - .id('e_newspaper_container') | 301 | + |
| 276 | } | 302 | } |
| 277 | 303 | ||
| 278 | private async getNewspaperTime() { | 304 | private async getNewspaperTime() { |
| @@ -7,10 +7,14 @@ import { photoAccessHelper } from '@kit.MediaLibraryKit'; | @@ -7,10 +7,14 @@ import { photoAccessHelper } from '@kit.MediaLibraryKit'; | ||
| 7 | import fs from '@ohos.file.fs'; | 7 | import fs from '@ohos.file.fs'; |
| 8 | 8 | ||
| 9 | const PERMISSIONS: Array<Permissions> = [ | 9 | const PERMISSIONS: Array<Permissions> = [ |
| 10 | - 'ohos.permission.READ_MEDIA', | ||
| 11 | - 'ohos.permission.WRITE_MEDIA' | 10 | + 'ohos.permission.READ_IMAGEVIDEO', |
| 11 | + 'ohos.permission.WRITE_IMAGEVIDEO' | ||
| 12 | ]; | 12 | ]; |
| 13 | 13 | ||
| 14 | +/* | ||
| 15 | + * saveButton参考文档 | ||
| 16 | + * https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/savebutton-0000001820999677 | ||
| 17 | + * */ | ||
| 14 | @Component | 18 | @Component |
| 15 | export struct ImageDownloadComponent { | 19 | export struct ImageDownloadComponent { |
| 16 | @State image: PixelMap | undefined = undefined; | 20 | @State image: PixelMap | undefined = undefined; |
| @@ -20,12 +24,8 @@ export struct ImageDownloadComponent { | @@ -20,12 +24,8 @@ export struct ImageDownloadComponent { | ||
| 20 | 24 | ||
| 21 | build() { | 25 | build() { |
| 22 | Column() { | 26 | Column() { |
| 23 | - Image($r('app.media.icon_arrow_left_white')) | ||
| 24 | - .width(24) | ||
| 25 | - .height(24) | ||
| 26 | - .aspectRatio(1) | ||
| 27 | - .interpolation(ImageInterpolation.High) | ||
| 28 | - .rotate({ angle: -90 }) | 27 | + SaveButton({ icon: SaveIconStyle.LINES }) |
| 28 | + .iconColor(Color.White) | ||
| 29 | .onClick(async () => { | 29 | .onClick(async () => { |
| 30 | console.info(`cj2024 onClick ${this.imageBuffer}`) | 30 | console.info(`cj2024 onClick ${this.imageBuffer}`) |
| 31 | if (this.imageBuffer !== undefined) { | 31 | if (this.imageBuffer !== undefined) { |
| @@ -33,9 +33,17 @@ export class commentListModel extends PageModel{ | @@ -33,9 +33,17 @@ export class commentListModel extends PageModel{ | ||
| 33 | totalCount: number = 0 | 33 | totalCount: number = 0 |
| 34 | hasNext: number = 0 | 34 | hasNext: number = 0 |
| 35 | list: commentItemModel[] = [] | 35 | list: commentItemModel[] = [] |
| 36 | +} | ||
| 36 | 37 | ||
| 38 | +export class commentStatusListModel extends PageModel{ | ||
| 39 | + pageNum: number = 0 | ||
| 40 | + pageSize: number = 0 | ||
| 41 | + totalCount: number = 0 | ||
| 42 | + hasNext: number = 0 | ||
| 43 | + list: commentStatusModel[] = [] | ||
| 37 | } | 44 | } |
| 38 | 45 | ||
| 46 | + | ||
| 39 | @Observed | 47 | @Observed |
| 40 | export class commentItemModel { | 48 | export class commentItemModel { |
| 41 | authorLike: string = '' | 49 | authorLike: string = '' |
| @@ -94,9 +102,17 @@ export class commentItemModel { | @@ -94,9 +102,17 @@ export class commentItemModel { | ||
| 94 | targetType:string = ''; | 102 | targetType:string = ''; |
| 95 | visitorComment:string = ''; | 103 | visitorComment:string = ''; |
| 96 | shareInfo:commentItemShareInfoModel = new commentItemShareInfoModel; | 104 | shareInfo:commentItemShareInfoModel = new commentItemShareInfoModel; |
| 97 | - // targetId:string = ''; | ||
| 98 | - // targetId:string = ''; | ||
| 99 | - // targetId:string = ''; | 105 | + |
| 106 | + api_commentId:string = ''; | ||
| 107 | + api_status:string = ''; | ||
| 108 | + | ||
| 109 | + api_level:string = ''; | ||
| 110 | + api_levelHead:string = 'http'; | ||
| 111 | + api_userId:string = ''; | ||
| 112 | + | ||
| 113 | + api_creatorId:string = ''; | ||
| 114 | + api_userType:string = ''; | ||
| 115 | + api_authIcon:string = ''; | ||
| 100 | 116 | ||
| 101 | } | 117 | } |
| 102 | 118 | ||
| @@ -105,4 +121,19 @@ export class commentItemShareInfoModel { | @@ -105,4 +121,19 @@ export class commentItemShareInfoModel { | ||
| 105 | shareSummary: string = '' | 121 | shareSummary: string = '' |
| 106 | shareTitle: string = '' | 122 | shareTitle: string = '' |
| 107 | shareUrl: string = '' | 123 | shareUrl: string = '' |
| 108 | -} | ||
| 124 | +} | ||
| 125 | + | ||
| 126 | +export class commentStatusModel { | ||
| 127 | + commentId:string = ''; | ||
| 128 | + status:string = ''; | ||
| 129 | + | ||
| 130 | + level:string = ''; | ||
| 131 | + levelHead:string = ''; | ||
| 132 | + userId:string = ''; | ||
| 133 | + | ||
| 134 | + | ||
| 135 | + creatorId:string = ''; | ||
| 136 | + userType:string = ''; | ||
| 137 | + authIcon:string = ''; | ||
| 138 | + | ||
| 139 | +} |
| @@ -6,6 +6,13 @@ import { commentItemModel, commentListModel, WDPublicUserType } from '../model/C | @@ -6,6 +6,13 @@ import { commentItemModel, commentListModel, WDPublicUserType } from '../model/C | ||
| 6 | import commentViewModel from '../viewmodel/CommentViewModel' | 6 | import commentViewModel from '../viewmodel/CommentViewModel' |
| 7 | import { CommentText } from './CommentText'; | 7 | import { CommentText } from './CommentText'; |
| 8 | import measure from '@ohos.measure' | 8 | import measure from '@ohos.measure' |
| 9 | +import {CommentCustomDialog} from './CommentCustomDialog' | ||
| 10 | + | ||
| 11 | +const TAG = 'CommentComponent'; | ||
| 12 | + | ||
| 13 | + | ||
| 14 | + | ||
| 15 | + | ||
| 9 | 16 | ||
| 10 | @Entry | 17 | @Entry |
| 11 | @Preview | 18 | @Preview |
| @@ -13,10 +20,19 @@ import measure from '@ohos.measure' | @@ -13,10 +20,19 @@ import measure from '@ohos.measure' | ||
| 13 | export struct CommentComponent { | 20 | export struct CommentComponent { |
| 14 | @State private browSingModel: commentListModel = new commentListModel() | 21 | @State private browSingModel: commentListModel = new commentListModel() |
| 15 | isloading: boolean = false | 22 | isloading: boolean = false |
| 16 | - // @State allDatas :commentItemModel[] = []; | ||
| 17 | - | ||
| 18 | @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource(); | 23 | @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource(); |
| 19 | 24 | ||
| 25 | + dialogController: CustomDialogController = new CustomDialogController({ | ||
| 26 | + builder: CommentCustomDialog(), | ||
| 27 | + autoCancel: true, | ||
| 28 | + alignment: DialogAlignment.Bottom, | ||
| 29 | + customStyle: true, | ||
| 30 | + offset: { | ||
| 31 | + dx: 0, | ||
| 32 | + dy: -20 | ||
| 33 | + } | ||
| 34 | + }) | ||
| 35 | + | ||
| 20 | aboutToAppear() { | 36 | aboutToAppear() { |
| 21 | this.getData(); | 37 | this.getData(); |
| 22 | this.getData(); | 38 | this.getData(); |
| @@ -59,7 +75,7 @@ export struct CommentComponent { | @@ -59,7 +75,7 @@ export struct CommentComponent { | ||
| 59 | .height('32') | 75 | .height('32') |
| 60 | .objectFit(ImageFit.Cover) | 76 | .objectFit(ImageFit.Cover) |
| 61 | .borderRadius(16) | 77 | .borderRadius(16) |
| 62 | - Image($r('app.media.icon_border_test')) | 78 | + Image(item.api_levelHead) |
| 63 | .width('48') | 79 | .width('48') |
| 64 | .height('48') | 80 | .height('48') |
| 65 | .objectFit(ImageFit.Cover) | 81 | .objectFit(ImageFit.Cover) |
| @@ -167,7 +183,6 @@ export struct CommentComponent { | @@ -167,7 +183,6 @@ export struct CommentComponent { | ||
| 167 | // ///1天~2天:1天前 | 183 | // ///1天~2天:1天前 |
| 168 | // ///2天~:日期隐藏 | 184 | // ///2天~:日期隐藏 |
| 169 | 185 | ||
| 170 | - | ||
| 171 | Text(DateTimeUtils.getCommentTime(Number.parseFloat(item.createTime))) | 186 | Text(DateTimeUtils.getCommentTime(Number.parseFloat(item.createTime))) |
| 172 | .fontColor($r('app.color.color_B0B0B0')) | 187 | .fontColor($r('app.color.color_B0B0B0')) |
| 173 | .fontSize(12) | 188 | .fontSize(12) |
| @@ -212,6 +227,10 @@ export struct CommentComponent { | @@ -212,6 +227,10 @@ export struct CommentComponent { | ||
| 212 | 227 | ||
| 213 | List() { | 228 | List() { |
| 214 | ListItemGroup({ header: this.titleHeader() }) | 229 | ListItemGroup({ header: this.titleHeader() }) |
| 230 | + .onClick(()=>{ | ||
| 231 | + console.log(TAG) | ||
| 232 | + this.dialogController.open() | ||
| 233 | + }) | ||
| 215 | LazyForEach(this.allDatas, (item: commentItemModel, index: number) => { | 234 | LazyForEach(this.allDatas, (item: commentItemModel, index: number) => { |
| 216 | if (item.hasMore) { | 235 | if (item.hasMore) { |
| 217 | ListItemGroup({ header: this.CommentHeaderItem(item), footer: this.GroupFooterView(item) }) { | 236 | ListItemGroup({ header: this.CommentHeaderItem(item), footer: this.GroupFooterView(item) }) { |
| @@ -219,6 +238,9 @@ export struct CommentComponent { | @@ -219,6 +238,9 @@ export struct CommentComponent { | ||
| 219 | ListItem() { | 238 | ListItem() { |
| 220 | ChildCommentItem(); | 239 | ChildCommentItem(); |
| 221 | } | 240 | } |
| 241 | + .onClick(()=>{ | ||
| 242 | + console.log(TAG) | ||
| 243 | + }) | ||
| 222 | }) | 244 | }) |
| 223 | } | 245 | } |
| 224 | }else { | 246 | }else { |
| @@ -227,6 +249,9 @@ export struct CommentComponent { | @@ -227,6 +249,9 @@ export struct CommentComponent { | ||
| 227 | ListItem() { | 249 | ListItem() { |
| 228 | ChildCommentItem(); | 250 | ChildCommentItem(); |
| 229 | } | 251 | } |
| 252 | + .onClick(()=>{ | ||
| 253 | + console.log(TAG) | ||
| 254 | + }) | ||
| 230 | }) | 255 | }) |
| 231 | } | 256 | } |
| 232 | } | 257 | } |
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentCustomDialog.ets
0 → 100644
| 1 | +@Preview | ||
| 2 | +@CustomDialog | ||
| 3 | +export struct CommentCustomDialog { | ||
| 4 | + controller: CustomDialogController = new CustomDialogController({ | ||
| 5 | + builder: CommentCustomDialog(), | ||
| 6 | + autoCancel: true, | ||
| 7 | + alignment: DialogAlignment.Bottom, | ||
| 8 | + customStyle: true, | ||
| 9 | + }) | ||
| 10 | + | ||
| 11 | + build() { | ||
| 12 | + Column() { | ||
| 13 | + Row() { | ||
| 14 | + TextArea({ placeholder: '优质评论会获得最佳评论人的称号' }) | ||
| 15 | + .height('100%') | ||
| 16 | + .width('100%') | ||
| 17 | + .backgroundColor($r('app.color.color_transparent')) | ||
| 18 | + } | ||
| 19 | + .backgroundColor('#F9F9F9') | ||
| 20 | + // .width('100%') | ||
| 21 | + .margin({ top: 12,right: 12, left: 12, bottom: 10 }) | ||
| 22 | + .height(80) | ||
| 23 | + .borderRadius(4) | ||
| 24 | + | ||
| 25 | + Row(){ | ||
| 26 | + Row() { | ||
| 27 | + Row({ space: 12 }) { | ||
| 28 | + //语音暂时不做,隐藏 | ||
| 29 | + // Image($r('app.media.WDInput_voice')).width(30).height(30) | ||
| 30 | + | ||
| 31 | + Image($r('app.media.WDInput_keyboardImage')).width(30).height(30) | ||
| 32 | + } | ||
| 33 | + // Blank() | ||
| 34 | + | ||
| 35 | + Row() { | ||
| 36 | + Text('发布') | ||
| 37 | + .backgroundColor('#F89381') | ||
| 38 | + .width(80) | ||
| 39 | + .height(30) | ||
| 40 | + .fontSize(15) | ||
| 41 | + .fontColor(Color.White) | ||
| 42 | + .textAlign(TextAlign.Center) | ||
| 43 | + .borderRadius(4) | ||
| 44 | + } | ||
| 45 | + }.justifyContent(FlexAlign.SpaceBetween) | ||
| 46 | + .width('100%') | ||
| 47 | + .height(60) | ||
| 48 | + // .margin({ right: 12, left: 12 }) | ||
| 49 | + // .backgroundColor(Color.Red) | ||
| 50 | + }.padding({left:12, right:12}) | ||
| 51 | + }.backgroundColor(Color.White) | ||
| 52 | + .width('100%') | ||
| 53 | + .offset({ | ||
| 54 | + y: 20 | ||
| 55 | + }) | ||
| 56 | + } | ||
| 57 | +} | ||
| 58 | + | ||
| 59 | + | ||
| 60 | + | ||
| 61 | + |
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/QualityCommentsComponent.ets
| @@ -2,7 +2,8 @@ import { ViewType } from 'wdConstant/Index' | @@ -2,7 +2,8 @@ import { ViewType } from 'wdConstant/Index' | ||
| 2 | import { DateTimeUtils, LazyDataSource, WindowModel } from 'wdKit/Index' | 2 | import { DateTimeUtils, LazyDataSource, WindowModel } from 'wdKit/Index' |
| 3 | import { commentItemModel, commentListModel } from '../model/CommentModel' | 3 | import { commentItemModel, commentListModel } from '../model/CommentModel' |
| 4 | import commentViewModel from '../viewmodel/CommentViewModel' | 4 | import commentViewModel from '../viewmodel/CommentViewModel' |
| 5 | -import { window } from '@kit.ArkUI' | 5 | +import { router, window } from '@kit.ArkUI' |
| 6 | +import { CustomTitleUI } from '../../reusable/CustomTitleUI' | ||
| 6 | 7 | ||
| 7 | const TAG = 'QualityCommentsComponent'; | 8 | const TAG = 'QualityCommentsComponent'; |
| 8 | 9 | ||
| @@ -10,11 +11,14 @@ const TAG = 'QualityCommentsComponent'; | @@ -10,11 +11,14 @@ const TAG = 'QualityCommentsComponent'; | ||
| 10 | @Preview | 11 | @Preview |
| 11 | @Component | 12 | @Component |
| 12 | export struct QualityCommentsComponent { | 13 | export struct QualityCommentsComponent { |
| 14 | + @State tileOpacity: number = 0; | ||
| 15 | + firstPositionY: number = 0; | ||
| 13 | bottomSafeHeight: string = AppStorage.get<number>('bottomSafeHeight') + 'px'; | 16 | bottomSafeHeight: string = AppStorage.get<number>('bottomSafeHeight') + 'px'; |
| 17 | + topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number; | ||
| 14 | @State private browSingModel: commentListModel = new commentListModel() | 18 | @State private browSingModel: commentListModel = new commentListModel() |
| 15 | isloading: boolean = false | 19 | isloading: boolean = false |
| 16 | - lastWindowColor:string = '#ffffff' | ||
| 17 | - currentWindowColor:string = '#FF4202' | 20 | + lastWindowColor: string = '#ffffff' |
| 21 | + currentWindowColor: string = '#FF4202' | ||
| 18 | @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource(); | 22 | @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource(); |
| 19 | 23 | ||
| 20 | aboutToDisappear(): void { | 24 | aboutToDisappear(): void { |
| @@ -32,25 +36,25 @@ export struct QualityCommentsComponent { | @@ -32,25 +36,25 @@ export struct QualityCommentsComponent { | ||
| 32 | this.fullScreen(); | 36 | this.fullScreen(); |
| 33 | 37 | ||
| 34 | 38 | ||
| 35 | - commentViewModel.fetchQualityCommentListLocal(getContext()).then(commentListModel => { | ||
| 36 | - this.allDatas.push(...commentListModel.list) | ||
| 37 | - }) | ||
| 38 | - | ||
| 39 | - // commentViewModel.fetchQualityCommentList('1').then((commentListModel) => { | ||
| 40 | - // if (commentListModel && commentListModel.list && commentListModel.list.length > 0) { | ||
| 41 | - // // commentListModel.hasMore = true; | ||
| 42 | - // // this.browSingModel.viewType = ViewType.LOADED; | ||
| 43 | - // this.allDatas.push(...commentListModel.list) | ||
| 44 | - // // if (commentListModel.list.length === this.browSingModel.pageSize) { | ||
| 45 | - // // this.browSingModel.currentPage++; | ||
| 46 | - // // this.browSingModel.hasMore = true; | ||
| 47 | - // // } else { | ||
| 48 | - // // this.browSingModel.hasMore = false; | ||
| 49 | - // // } | ||
| 50 | - // } else { | ||
| 51 | - // this.browSingModel.viewType = ViewType.EMPTY; | ||
| 52 | - // } | 39 | + // commentViewModel.fetchQualityCommentListLocal(getContext()).then(commentListModel => { |
| 40 | + // this.allDatas.push(...commentListModel.list) | ||
| 53 | // }) | 41 | // }) |
| 42 | + | ||
| 43 | + commentViewModel.fetchQualityCommentList('1').then((commentListModel) => { | ||
| 44 | + if (commentListModel && commentListModel.list && commentListModel.list.length > 0) { | ||
| 45 | + // commentListModel.hasMore = true; | ||
| 46 | + // this.browSingModel.viewType = ViewType.LOADED; | ||
| 47 | + this.allDatas.push(...commentListModel.list) | ||
| 48 | + // if (commentListModel.list.length === this.browSingModel.pageSize) { | ||
| 49 | + // this.browSingModel.currentPage++; | ||
| 50 | + // this.browSingModel.hasMore = true; | ||
| 51 | + // } else { | ||
| 52 | + // this.browSingModel.hasMore = false; | ||
| 53 | + // } | ||
| 54 | + } else { | ||
| 55 | + this.browSingModel.viewType = ViewType.EMPTY; | ||
| 56 | + } | ||
| 57 | + }) | ||
| 54 | } | 58 | } |
| 55 | 59 | ||
| 56 | fullScreen() { | 60 | fullScreen() { |
| @@ -69,30 +73,143 @@ export struct QualityCommentsComponent { | @@ -69,30 +73,143 @@ export struct QualityCommentsComponent { | ||
| 69 | @Builder | 73 | @Builder |
| 70 | titleHeader() { | 74 | titleHeader() { |
| 71 | Row() { | 75 | Row() { |
| 72 | - Image($r('app.media.comment_img_banner')).width('100%').aspectRatio(375 / 283); | 76 | + Image($r('app.media.comment_img_banner')).width('100%') |
| 77 | + .height(283) | ||
| 78 | + // .aspectRatio(375 / 283); | ||
| 73 | } | 79 | } |
| 80 | + .onAreaChange((oldValue: Area, newValue: Area) => { | ||
| 81 | + | ||
| 82 | + let persent = Math.abs(Number(newValue.globalPosition.y)) / 150 | ||
| 83 | + if (persent > 1) { | ||
| 84 | + persent = 1 | ||
| 85 | + } | ||
| 86 | + this.tileOpacity = persent | ||
| 87 | + | ||
| 88 | + }) | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + /*透明导航栏*/ | ||
| 92 | + @Builder | ||
| 93 | + TabbarTransparent() { | ||
| 94 | + RelativeContainer() { | ||
| 95 | + //标题栏目 | ||
| 96 | + Image($r('app.media.icon_arrow_left_white')) | ||
| 97 | + .width(24) | ||
| 98 | + .height(24) | ||
| 99 | + .objectFit(ImageFit.Auto) | ||
| 100 | + .id("back_icon") | ||
| 101 | + .alignRules({ | ||
| 102 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 103 | + left: { anchor: "__container__", align: HorizontalAlign.Start } | ||
| 104 | + }) | ||
| 105 | + .offset({ | ||
| 106 | + y: (this.topSafeHeight / 2) + 'px' | ||
| 107 | + }) | ||
| 108 | + .margin({ left: 16 }) | ||
| 109 | + .onClick(() => { | ||
| 110 | + router.back() | ||
| 111 | + }) | ||
| 112 | + } | ||
| 113 | + .visibility(this.tileOpacity > 0 ? 1 : 0) | ||
| 114 | + .height(this.topSafeHeight + vp2px(44) + 'px') | ||
| 115 | + .width('100%') | ||
| 116 | + .backgroundColor($r('app.color.color_transparent')) | ||
| 117 | + } | ||
| 118 | + | ||
| 119 | + /*导航栏*/ | ||
| 120 | + @Builder | ||
| 121 | + TabbarNormal() { | ||
| 122 | + RelativeContainer() { | ||
| 123 | + //标题栏目 | ||
| 124 | + Image($r('app.media.icon_arrow_left')) | ||
| 125 | + .width(24) | ||
| 126 | + .height(24) | ||
| 127 | + .objectFit(ImageFit.Auto) | ||
| 128 | + .id("back_icon") | ||
| 129 | + .alignRules({ | ||
| 130 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 131 | + left: { anchor: "__container__", align: HorizontalAlign.Start } | ||
| 132 | + }) | ||
| 133 | + .offset({ | ||
| 134 | + y: (this.topSafeHeight / 2) + 'px' | ||
| 135 | + }) | ||
| 136 | + .margin({ left: 16 }) | ||
| 137 | + .onClick(() => { | ||
| 138 | + router.back() | ||
| 139 | + }) | ||
| 140 | + | ||
| 141 | + Text('精选评论') | ||
| 142 | + // .height('42lpx') | ||
| 143 | + .maxLines(1) | ||
| 144 | + .id("title") | ||
| 145 | + .fontSize('35lpx') | ||
| 146 | + .fontWeight(400) | ||
| 147 | + .fontColor($r('app.color.color_222222')) | ||
| 148 | + .lineHeight('42lpx') | ||
| 149 | + .alignRules({ | ||
| 150 | + center: {anchor: "__container__", align: VerticalAlign.Center}, | ||
| 151 | + middle: {anchor: "__container__", align: HorizontalAlign.Center} | ||
| 152 | + }) | ||
| 153 | + .offset({ | ||
| 154 | + y: (this.topSafeHeight / 2) + 'px' | ||
| 155 | + }) | ||
| 156 | + } | ||
| 157 | + .visibility(this.tileOpacity > 0 ? 0 : 1) | ||
| 158 | + .opacity(this.tileOpacity) | ||
| 159 | + .height(this.topSafeHeight + vp2px(44) + 'px') | ||
| 160 | + .width('100%') | ||
| 161 | + .backgroundColor($r('app.color.white')) | ||
| 74 | } | 162 | } |
| 75 | 163 | ||
| 76 | build() { | 164 | build() { |
| 77 | Column() { | 165 | Column() { |
| 78 | - // this.titleHeader() | ||
| 79 | - List({ space: 28 }) { | ||
| 80 | - ListItemGroup({ header: this.titleHeader() }) | 166 | + Stack({ alignContent: Alignment.Top }) { |
| 167 | + | ||
| 168 | + Scroll() { | ||
| 169 | + Column() { | ||
| 170 | + Stack() { | ||
| 171 | + this.titleHeader() | ||
| 172 | + | ||
| 173 | + List({ space: 12 }) { | ||
| 174 | + // ListItemGroup({ header: this.titleHeader() }) | ||
| 175 | + LazyForEach(this.allDatas, (item: commentItemModel, index: number) => { | ||
| 176 | + ListItem() { | ||
| 177 | + QualityCommentItem({ item: item }).margin({ left: 12, right: 12 }) | ||
| 178 | + } | ||
| 179 | + }) | ||
| 180 | + ListItem() { | ||
| 181 | + | ||
| 182 | + }.height(this.bottomSafeHeight) | ||
| 183 | + } | ||
| 184 | + .margin({ top: 196 }) | ||
| 185 | + .height("100%") | ||
| 186 | + .width("100%") | ||
| 187 | + .edgeEffect(EdgeEffect.Spring) | ||
| 188 | + .nestedScroll({ | ||
| 189 | + scrollForward: NestedScrollMode.PARENT_FIRST, | ||
| 190 | + scrollBackward: NestedScrollMode.SELF_FIRST | ||
| 191 | + }) | ||
| 192 | + | ||
| 193 | + // .margin({ bottom: this.bottomSafeHeight }) | ||
| 194 | + | ||
| 195 | + // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) | ||
| 196 | + }.alignContent(Alignment.Top) | ||
| 197 | + }.backgroundColor(this.currentWindowColor).width('100%') | ||
| 198 | + } | ||
| 199 | + .friction(0.6) | ||
| 200 | + .scrollBar(BarState.Off) | ||
| 201 | + .edgeEffect(EdgeEffect.None) | ||
| 202 | + .width('100%') | ||
| 203 | + .height('100%') | ||
| 204 | + | ||
| 205 | + this.TabbarTransparent() | ||
| 206 | + this.TabbarNormal() | ||
| 207 | + | ||
| 81 | 208 | ||
| 82 | - LazyForEach(this.allDatas, (item: commentItemModel, index: number) => { | ||
| 83 | - ListItem() { | ||
| 84 | - QualityCommentItem({ item: item }).margin({ left: 12, right: 12 }) | ||
| 85 | - } | ||
| 86 | - // .offset({ | ||
| 87 | - // y:-87 | ||
| 88 | - // }) | ||
| 89 | - }) | ||
| 90 | } | 209 | } |
| 91 | - // .contentStartOffset(- 87) | ||
| 92 | - .edgeEffect(EdgeEffect.Spring) | ||
| 93 | - .margin({bottom:this.bottomSafeHeight}) | ||
| 94 | - // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) | ||
| 95 | - }.backgroundColor(this.currentWindowColor).height('100%').width('100%') | 210 | + |
| 211 | + } | ||
| 212 | + | ||
| 96 | } | 213 | } |
| 97 | } | 214 | } |
| 98 | 215 | ||
| @@ -103,104 +220,120 @@ struct QualityCommentItem { | @@ -103,104 +220,120 @@ struct QualityCommentItem { | ||
| 103 | 220 | ||
| 104 | build() { | 221 | build() { |
| 105 | Column() { | 222 | Column() { |
| 106 | - /*头像以及昵称*/ | ||
| 107 | - RelativeContainer() { | ||
| 108 | - Image(this.item.fromUserHeader) | ||
| 109 | - .width(50) | ||
| 110 | - .height(50) | ||
| 111 | - .borderRadius(25) | ||
| 112 | - .borderWidth(2) | ||
| 113 | - .borderColor(Color.White) | ||
| 114 | - .id('image1') | ||
| 115 | - .alignRules({ | ||
| 116 | - top: { anchor: "__container__", align: VerticalAlign.Top }, | ||
| 117 | - left: { anchor: "__container__", align: HorizontalAlign.Start } | ||
| 118 | - }) | ||
| 119 | - .offset( | ||
| 120 | - { | ||
| 121 | - y: -16 | ||
| 122 | - } | ||
| 123 | - ) | ||
| 124 | - Text(this.item.fromUserName) | ||
| 125 | - .fontSize(14) | ||
| 126 | - .fontColor('#222222') | ||
| 127 | - .fontWeight(FontWeight.Medium) | ||
| 128 | - .id('text1') | ||
| 129 | - .alignRules({ | ||
| 130 | - bottom: { anchor: "image1", align: VerticalAlign.Bottom }, | ||
| 131 | - left: { anchor: "image1", align: HorizontalAlign.End } | ||
| 132 | - }) | ||
| 133 | - .offset( | ||
| 134 | - { | ||
| 135 | - x: 6, | ||
| 136 | - y: -6 - 16 | ||
| 137 | - } | ||
| 138 | - ) | ||
| 139 | - }.height(42) | ||
| 140 | - | 223 | + Column().height(16).width('100%').opacity(0) |
| 141 | Column() { | 224 | Column() { |
| 142 | - /*评论内容*/ | ||
| 143 | - Text() { | ||
| 144 | - ImageSpan($r('app.media.WDBestCommentTitleDotIcon')) | ||
| 145 | - .width(12) | ||
| 146 | - .height(12) | ||
| 147 | - .objectFit(ImageFit.Fill) | ||
| 148 | - .offset({ | ||
| 149 | - y: -6 | 225 | + /*头像以及昵称*/ |
| 226 | + RelativeContainer() { | ||
| 227 | + | ||
| 228 | + Image(this.item.fromUserHeader) | ||
| 229 | + .width(50) | ||
| 230 | + .height(50) | ||
| 231 | + .borderRadius(25) | ||
| 232 | + .borderWidth(2) | ||
| 233 | + .borderColor(Color.White) | ||
| 234 | + .id('image1') | ||
| 235 | + .alignRules({ | ||
| 236 | + top: { anchor: "__container__", align: VerticalAlign.Top }, | ||
| 237 | + left: { anchor: "__container__", align: HorizontalAlign.Start } | ||
| 150 | }) | 238 | }) |
| 151 | - Span(' ' + this.item.commentContent) | ||
| 152 | - .fontSize(16) | 239 | + .offset( |
| 240 | + { | ||
| 241 | + y: -16 | ||
| 242 | + } | ||
| 243 | + ) | ||
| 244 | + Text(this.item.fromUserName) | ||
| 245 | + .fontSize(14) | ||
| 153 | .fontColor('#222222') | 246 | .fontColor('#222222') |
| 154 | .fontWeight(FontWeight.Medium) | 247 | .fontWeight(FontWeight.Medium) |
| 155 | - }.margin({ top: 10 }) | ||
| 156 | - | ||
| 157 | - /*分割线*/ | ||
| 158 | - Row() { | 248 | + .id('text1') |
| 249 | + .alignRules({ | ||
| 250 | + bottom: { anchor: "image1", align: VerticalAlign.Bottom }, | ||
| 251 | + left: { anchor: "image1", align: HorizontalAlign.End } | ||
| 252 | + }) | ||
| 253 | + .offset( | ||
| 254 | + { | ||
| 255 | + x: 6, | ||
| 256 | + y: -6 - 16 | ||
| 257 | + } | ||
| 258 | + ) | ||
| 259 | + }.height(42) | ||
| 260 | + | ||
| 261 | + Column() { | ||
| 262 | + /*评论内容*/ | ||
| 263 | + Text() { | ||
| 264 | + ImageSpan($r('app.media.WDBestCommentTitleDotIcon')) | ||
| 265 | + .width(12) | ||
| 266 | + .height(12) | ||
| 267 | + .objectFit(ImageFit.Fill) | ||
| 268 | + .offset({ | ||
| 269 | + y: -6 | ||
| 270 | + }) | ||
| 271 | + Span(' ' + this.item.commentContent) | ||
| 272 | + .fontSize(16) | ||
| 273 | + .fontColor('#222222') | ||
| 274 | + .fontWeight(FontWeight.Medium) | ||
| 275 | + }.margin({ top: 10 }) | ||
| 276 | + | ||
| 277 | + /*分割线*/ | ||
| 278 | + Row() { | ||
| 159 | 279 | ||
| 160 | - }.width('100%').margin({ top: 10, left: 0, right: 0 }).backgroundColor('#EDEDED').height(2.5); | 280 | + }.width('100%').margin({ top: 10, left: 0, right: 0 }).backgroundColor('#EDEDED').height(2.5); |
| 161 | 281 | ||
| 162 | - /*文章或者评论*/ | ||
| 163 | - Row() { | 282 | + /*文章或者评论*/ |
| 164 | Row() { | 283 | Row() { |
| 165 | - Image($r('app.media.comment_img_link')).width(16).height(16) | ||
| 166 | - Text(this.item.shareInfo.shareTitle) | ||
| 167 | - .fontSize(14) | ||
| 168 | - .fontColor('#666666') | ||
| 169 | - .margin({ left: 6, right: 12 }) | ||
| 170 | - .maxLines(1) | ||
| 171 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 172 | - }.height(40).layoutWeight(1) | 284 | + Row() { |
| 285 | + Image($r('app.media.comment_img_link')).width(16).height(16) | ||
| 286 | + Text(this.item.shareInfo.shareTitle) | ||
| 287 | + .fontSize(14) | ||
| 288 | + .fontColor('#666666') | ||
| 289 | + .margin({ left: 6, right: 12 }) | ||
| 290 | + .maxLines(1) | ||
| 291 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 292 | + }.height(40).layoutWeight(1) | ||
| 173 | 293 | ||
| 174 | - Image($r('app.media.more')).width(12).height(12) | 294 | + Image($r('app.media.more')).width(12).height(12) |
| 175 | 295 | ||
| 176 | - }.width('100%').height(40).justifyContent(FlexAlign.SpaceBetween) | 296 | + }.width('100%').height(40).justifyContent(FlexAlign.SpaceBetween) |
| 177 | 297 | ||
| 178 | - } | ||
| 179 | - .backgroundColor('#F9F9F9') | ||
| 180 | - .width('100%') | ||
| 181 | - .alignItems(HorizontalAlign.Start) | ||
| 182 | - .borderRadius(4) | ||
| 183 | - .padding({ left: 12, right: 12 }) | 298 | + } |
| 299 | + .backgroundColor('#F9F9F9') | ||
| 300 | + .width('100%') | ||
| 301 | + .alignItems(HorizontalAlign.Start) | ||
| 302 | + .borderRadius(4) | ||
| 303 | + .padding({ left: 12, right: 12 }) | ||
| 184 | 304 | ||
| 185 | - /*时间 点赞评论*/ | ||
| 186 | - Row() { | 305 | + /*时间 点赞评论*/ |
| 306 | + Row() { | ||
| 187 | 307 | ||
| 188 | - Text(DateTimeUtils.getCommentTime(DateTimeUtils.getDateTimestamp(this.item.createTime))).fontSize(14).fontColor('#999999') | 308 | + Text(DateTimeUtils.getCommentTime(DateTimeUtils.getDateTimestamp(this.item.createTime))) |
| 309 | + .fontSize(14) | ||
| 310 | + .fontColor('#999999') | ||
| 189 | 311 | ||
| 190 | - Row({space:16}){ | ||
| 191 | - Row(){ | ||
| 192 | - Image($r('app.media.comment_icon_pinglun')).width(16).height(16) | ||
| 193 | - } | 312 | + Row({ space: 16 }) { |
| 313 | + Row() { | ||
| 314 | + Image($r('app.media.comment_icon_pinglun')).width(16).height(16) | ||
| 315 | + } | ||
| 194 | 316 | ||
| 195 | - Row(){ | ||
| 196 | - //comment_like_select | ||
| 197 | - Image($r(this.item.likeNum?'app.media.comment_like_select':'app.media.comment_like_normal')).width(16).height(16) | ||
| 198 | - if (this.item.likeNum){Text(this.item.likeNum).fontColor(this.item.isLike?'#ED2800':'#999999').fontSize(14).margin({left:3})} | 317 | + Row() { |
| 318 | + //comment_like_select | ||
| 319 | + Image($r(this.item.likeNum ? 'app.media.comment_like_select' : 'app.media.comment_like_normal')) | ||
| 320 | + .width(16) | ||
| 321 | + .height(16) | ||
| 322 | + if (this.item.likeNum) { | ||
| 323 | + Text(this.item.likeNum) | ||
| 324 | + .fontColor(this.item.isLike ? '#ED2800' : '#999999') | ||
| 325 | + .fontSize(14) | ||
| 326 | + .margin({ left: 3 }) | ||
| 327 | + } | ||
| 328 | + } | ||
| 199 | } | 329 | } |
| 200 | - } | ||
| 201 | - }.height(38).width('100%').justifyContent(FlexAlign.SpaceBetween) | 330 | + }.height(38).width('100%').justifyContent(FlexAlign.SpaceBetween) |
| 202 | 331 | ||
| 203 | - }.backgroundColor('#FFFFFF').padding({ top: 0, left: 16, right: 16 }).borderRadius(4) | 332 | + }.backgroundColor('#FFFFFF').padding({ top: 0, left: 16, right: 16 }).borderRadius(4) |
| 333 | + } | ||
| 204 | 334 | ||
| 205 | } | 335 | } |
| 206 | -} | ||
| 336 | +} | ||
| 337 | + | ||
| 338 | + | ||
| 339 | + |
| 1 | import { Logger, ResourcesUtils } from 'wdKit/Index'; | 1 | import { Logger, ResourcesUtils } from 'wdKit/Index'; |
| 2 | -import { HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index'; | 2 | +import { HttpBizUtil, HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index'; |
| 3 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; | 3 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; |
| 4 | -import { commentItemModel, commentListModel } from '../model/CommentModel'; | 4 | +import { commentItemModel, commentListModel, commentStatusListModel, commentStatusModel } from '../model/CommentModel'; |
| 5 | import HashMap from '@ohos.util.HashMap'; | 5 | import HashMap from '@ohos.util.HashMap'; |
| 6 | +import { ifaa } from '@kit.OnlineAuthenticationKit'; | ||
| 6 | 7 | ||
| 7 | const TAG = "CommentViewModel" | 8 | const TAG = "CommentViewModel" |
| 8 | 9 | ||
| 9 | class CommentViewModel { | 10 | class CommentViewModel { |
| 10 | private static instance: CommentViewModel | 11 | private static instance: CommentViewModel |
| 12 | + | ||
| 11 | /** | 13 | /** |
| 12 | * 单例模式 | 14 | * 单例模式 |
| 13 | * @returns | 15 | * @returns |
| @@ -19,35 +21,34 @@ class CommentViewModel { | @@ -19,35 +21,34 @@ class CommentViewModel { | ||
| 19 | return CommentViewModel.instance; | 21 | return CommentViewModel.instance; |
| 20 | } | 22 | } |
| 21 | 23 | ||
| 22 | - | ||
| 23 | /*获取本地mock数据*/ | 24 | /*获取本地mock数据*/ |
| 24 | async getCommentLocal(context: Context): Promise<commentListModel> { | 25 | async getCommentLocal(context: Context): Promise<commentListModel> { |
| 25 | Logger.info(TAG, `getBottomNavDataMock start`); | 26 | Logger.info(TAG, `getBottomNavDataMock start`); |
| 26 | - let compRes: ResponseDTO<commentListModel> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<commentListModel>>(context,'comment_local.json' ); | 27 | + let compRes: ResponseDTO<commentListModel> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<commentListModel>>(context, 'comment_local.json'); |
| 27 | if (!compRes || !compRes.data) { | 28 | if (!compRes || !compRes.data) { |
| 28 | Logger.info(TAG, `getAppointmentListDataLocal compRes is empty`); | 29 | Logger.info(TAG, `getAppointmentListDataLocal compRes is empty`); |
| 29 | return new commentListModel() | 30 | return new commentListModel() |
| 30 | } | 31 | } |
| 31 | Logger.info(TAG, `getAppointmentListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`); | 32 | Logger.info(TAG, `getAppointmentListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`); |
| 32 | - return compRes.data | 33 | + return this.fetchCommentStatusAndConfigAuthIcon(compRes.data) |
| 34 | + // this.fetchCommentStatusAndConfigAuthIcon(compRes.data) | ||
| 35 | + // return compRes.data | ||
| 33 | } | 36 | } |
| 34 | 37 | ||
| 35 | - /*获取本地mock数据*/ | 38 | + /*获取热门评论本地mock数据*/ |
| 36 | async fetchQualityCommentListLocal(context: Context): Promise<commentListModel> { | 39 | async fetchQualityCommentListLocal(context: Context): Promise<commentListModel> { |
| 37 | Logger.info(TAG, `getBottomNavDataMock start`); | 40 | Logger.info(TAG, `getBottomNavDataMock start`); |
| 38 | - let compRes: ResponseDTO<commentListModel> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<commentListModel>>(context,'qualityComment_local.json' ); | 41 | + let compRes: ResponseDTO<commentListModel> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<commentListModel>>(context, 'qualityComment_local.json'); |
| 39 | if (!compRes || !compRes.data) { | 42 | if (!compRes || !compRes.data) { |
| 40 | Logger.info(TAG, `getAppointmentListDataLocal compRes is empty`); | 43 | Logger.info(TAG, `getAppointmentListDataLocal compRes is empty`); |
| 41 | return new commentListModel() | 44 | return new commentListModel() |
| 42 | } | 45 | } |
| 43 | Logger.info(TAG, `getAppointmentListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`); | 46 | Logger.info(TAG, `getAppointmentListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`); |
| 44 | - return compRes.data | 47 | + return this.fetchCommentStatusAndConfigAuthIcon(compRes.data) |
| 45 | } | 48 | } |
| 46 | 49 | ||
| 47 | - | ||
| 48 | - | ||
| 49 | - //qualityComment_local.json | ||
| 50 | - fetchQualityCommentList(pageNum: string) { | 50 | + /*获取热门评论*/ |
| 51 | + fetchQualityCommentList(pageNum: string): Promise<commentListModel> { | ||
| 51 | let url = HttpUrlUtils.getQualityCommentUrl() + `?&pageSize=${10}&pageNum=${pageNum}` | 52 | let url = HttpUrlUtils.getQualityCommentUrl() + `?&pageSize=${10}&pageNum=${pageNum}` |
| 52 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 53 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 53 | return new Promise<commentListModel>((success, fail) => { | 54 | return new Promise<commentListModel>((success, fail) => { |
| @@ -62,7 +63,15 @@ class CommentViewModel { | @@ -62,7 +63,15 @@ class CommentViewModel { | ||
| 62 | } | 63 | } |
| 63 | let listData = data.data as commentListModel | 64 | let listData = data.data as commentListModel |
| 64 | 65 | ||
| 65 | - success(listData) | 66 | + this.fetchCommentStatusAndConfigAuthIcon(listData).then((commentListModel) =>{ |
| 67 | + console.log(TAG, 'fetchCommentStatusAndConfigAuthIcon完成') | ||
| 68 | + success(commentListModel) | ||
| 69 | + }) | ||
| 70 | + | ||
| 71 | + // return this.fetchCommentStatusAndConfigAuthIcon(listData) | ||
| 72 | + | ||
| 73 | + // this.fetchCommentStatusAndConfigAuthIcon(listData) | ||
| 74 | + // success(listData) | ||
| 66 | }, (error: Error) => { | 75 | }, (error: Error) => { |
| 67 | fail(error.message) | 76 | fail(error.message) |
| 68 | Logger.debug(TAG, error.toString()) | 77 | Logger.debug(TAG, error.toString()) |
| @@ -70,35 +79,192 @@ class CommentViewModel { | @@ -70,35 +79,192 @@ class CommentViewModel { | ||
| 70 | }) | 79 | }) |
| 71 | } | 80 | } |
| 72 | 81 | ||
| 82 | + /*多接口批查*/ | ||
| 83 | + fetchCommentStatusAndConfigAuthIcon(model: commentListModel): Promise<commentListModel> { | ||
| 84 | + | ||
| 85 | + let commentIDs: string[] = []; | ||
| 86 | + | ||
| 87 | + let fromUserIDs: string[] = []; | ||
| 73 | 88 | ||
| 74 | - // BaseGetRequest(contentID:number,contentType:string,pageNum:string){ | ||
| 75 | - // let url = HttpUrlUtils.getMyCollectionListDataUrl()+ `?type=${type}&operateTag=${1}&pageSize=${10}&pageNum=${pageNum}` | ||
| 76 | - // if (tagId.length > 0) { | ||
| 77 | - // url = url + `&tagId=${tagId}` | ||
| 78 | - // } | ||
| 79 | - // let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders() | ||
| 80 | - // return WDHttp.get<ResponseDTO<commentListModel>>(url, headers) | ||
| 81 | - // } | ||
| 82 | - // | ||
| 83 | - // | ||
| 84 | - // fetchCommentList(contentID:number,contentType:string,pageNum:string):Promise<commentListModel>{ | ||
| 85 | - // return new Promise<commentListModel>((success,error) => { | ||
| 86 | - // this.BaseGetRequest(contentID,contentType,pageNum).then((navResDTO: ResponseDTO<commentListModel>) => { | ||
| 87 | - // if (!navResDTO || navResDTO.code != 0) { | ||
| 88 | - // // success(this.getAppointmentListDataLocal(context)) | ||
| 89 | - // return | ||
| 90 | - // } | ||
| 91 | - // Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); | ||
| 92 | - // let listData = navResDTO.data as commentListModel | ||
| 93 | - // success(listData) | ||
| 94 | - // }).catch((err: Error) => { | ||
| 95 | - // Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`); | ||
| 96 | - // error("page data invalid"); | ||
| 97 | - // }) | ||
| 98 | - // }) | ||
| 99 | - // } | 89 | + let creatorIDs: string[] = []; |
| 100 | 90 | ||
| 91 | + //主评论 | ||
| 92 | + for (const element of model.list) { | ||
| 93 | + if ((element.id + '').length > 0) { | ||
| 94 | + commentIDs.push(element.id + '') | ||
| 95 | + } | ||
| 96 | + if ((element.fromUserId + '').length > 0) { | ||
| 97 | + fromUserIDs.push(element.fromUserId) | ||
| 98 | + } | ||
| 99 | + if ((element.fromCreatorId + '').length > 0) { | ||
| 100 | + creatorIDs.push(element.fromCreatorId) | ||
| 101 | + } | ||
| 101 | 102 | ||
| 103 | + | ||
| 104 | + //子评论 | ||
| 105 | + if (element.childComments) { | ||
| 106 | + for (const obj2 of element.childComments) { | ||
| 107 | + if ((obj2.id + '').length > 0) { | ||
| 108 | + commentIDs.push(obj2.id + '') | ||
| 109 | + } | ||
| 110 | + if ((obj2.fromUserId + '').length > 0) { | ||
| 111 | + fromUserIDs.push(obj2.fromUserId) | ||
| 112 | + } | ||
| 113 | + if ((obj2.fromCreatorId + '').length > 0) { | ||
| 114 | + creatorIDs.push(obj2.fromCreatorId) | ||
| 115 | + } | ||
| 116 | + } | ||
| 117 | + } | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + | ||
| 121 | + let promiseArray: Promise<commentStatusListModel | void>[] = []; | ||
| 122 | + | ||
| 123 | + //TODO 未登录不用批查 | ||
| 124 | + if (commentIDs.length > 0) { | ||
| 125 | + let promise1 = new Promise<void>((success) => { | ||
| 126 | + // HttpRequest HttpBizUtil | ||
| 127 | + let url = HttpUrlUtils.getBatchCommentStatusUrl(); | ||
| 128 | + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | ||
| 129 | + let bean: Record<string, string[]> = {}; | ||
| 130 | + bean['commentIdList'] = commentIDs; | ||
| 131 | + HttpRequest.post<ResponseDTO<commentStatusModel[]>>(url, bean, headers).then((data: ResponseDTO<commentStatusModel[]>) => { | ||
| 132 | + if (!data || !data.data) { | ||
| 133 | + success() | ||
| 134 | + return | ||
| 135 | + } | ||
| 136 | + if (data.code != 0) { | ||
| 137 | + success() | ||
| 138 | + return | ||
| 139 | + } | ||
| 140 | + if (data.data.length == 0) { | ||
| 141 | + success() | ||
| 142 | + return | ||
| 143 | + } | ||
| 144 | + let listData = data.data as commentStatusModel[] | ||
| 145 | + | ||
| 146 | + for (const element of listData) { | ||
| 147 | + for (const commentModel of model.list) { | ||
| 148 | + if (element.commentId == commentModel.id) { | ||
| 149 | + commentModel.api_status = element.status | ||
| 150 | + } | ||
| 151 | + if (commentModel.childComments) { | ||
| 152 | + for (const childCommentModel of commentModel.childComments) { | ||
| 153 | + if (element.commentId == childCommentModel.id) { | ||
| 154 | + childCommentModel.api_status = element.status | ||
| 155 | + } | ||
| 156 | + } | ||
| 157 | + } | ||
| 158 | + } | ||
| 159 | + } | ||
| 160 | + success() | ||
| 161 | + }, (error: Error) => { | ||
| 162 | + success() | ||
| 163 | + Logger.debug(TAG, error.toString()) | ||
| 164 | + }) | ||
| 165 | + }) | ||
| 166 | + promiseArray.push(promise1); | ||
| 167 | + } | ||
| 168 | + | ||
| 169 | + if (fromUserIDs.length > 0) { | ||
| 170 | + let promise2 = new Promise<void>((success) => { | ||
| 171 | + let url = HttpUrlUtils.getBatchUserUrl(); | ||
| 172 | + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | ||
| 173 | + // HttpRequest HttpBizUtil | ||
| 174 | + HttpRequest.post<ResponseDTO<commentStatusModel[]>>(url, fromUserIDs, headers).then((data: ResponseDTO<commentStatusModel[]>) => { | ||
| 175 | + if (!data || !data.data) { | ||
| 176 | + success() | ||
| 177 | + return | ||
| 178 | + } | ||
| 179 | + if (data.code != 0) { | ||
| 180 | + success() | ||
| 181 | + return | ||
| 182 | + } | ||
| 183 | + if (data.data.length == 0) { | ||
| 184 | + success() | ||
| 185 | + return | ||
| 186 | + } | ||
| 187 | + let listData = data.data as commentStatusModel[] | ||
| 188 | + | ||
| 189 | + for (const element of listData) { | ||
| 190 | + for (const commentModel of model.list) { | ||
| 191 | + if (element.userId == commentModel.fromUserId) { | ||
| 192 | + commentModel.api_levelHead = element.levelHead | ||
| 193 | + } | ||
| 194 | + if (commentModel.childComments) { | ||
| 195 | + for (const childCommentModel of commentModel.childComments) { | ||
| 196 | + if (element.userId == childCommentModel.fromUserId) { | ||
| 197 | + childCommentModel.api_levelHead = element.levelHead | ||
| 198 | + } | ||
| 199 | + } | ||
| 200 | + } | ||
| 201 | + } | ||
| 202 | + } | ||
| 203 | + success() | ||
| 204 | + }, (error: Error) => { | ||
| 205 | + success() | ||
| 206 | + Logger.debug(TAG, error.toString()) | ||
| 207 | + }) | ||
| 208 | + }) | ||
| 209 | + promiseArray.push(promise2); | ||
| 210 | + } | ||
| 211 | + | ||
| 212 | + //TODO 一次20个上限 | ||
| 213 | + if (creatorIDs.length > 0) { | ||
| 214 | + let promise3 = new Promise<void>((success) => { | ||
| 215 | + let url = HttpUrlUtils.getDetailListUrl(); | ||
| 216 | + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | ||
| 217 | + let bean: Record<string, string[]> = {}; | ||
| 218 | + bean['creatorIdList'] = creatorIDs; | ||
| 219 | + // HttpRequest HttpBizUtil | ||
| 220 | + HttpRequest.post<ResponseDTO<commentStatusModel[]>>(url, bean, headers).then((data: ResponseDTO<commentStatusModel[]>) => { | ||
| 221 | + if (!data || !data.data) { | ||
| 222 | + success() | ||
| 223 | + return | ||
| 224 | + } | ||
| 225 | + if (data.code != 0) { | ||
| 226 | + success() | ||
| 227 | + return | ||
| 228 | + } | ||
| 229 | + if (data.data.length == 0) { | ||
| 230 | + success() | ||
| 231 | + return | ||
| 232 | + } | ||
| 233 | + let listData = data.data as commentStatusModel[] | ||
| 234 | + | ||
| 235 | + for (const element of listData) { | ||
| 236 | + for (const commentModel of model.list) { | ||
| 237 | + if (element.creatorId == commentModel.fromCreatorId) { | ||
| 238 | + commentModel.api_authIcon = element.authIcon | ||
| 239 | + } | ||
| 240 | + if (commentModel.childComments) { | ||
| 241 | + for (const childCommentModel of commentModel.childComments) { | ||
| 242 | + if (element.creatorId == childCommentModel.fromCreatorId) { | ||
| 243 | + childCommentModel.api_authIcon = element.authIcon | ||
| 244 | + } | ||
| 245 | + } | ||
| 246 | + } | ||
| 247 | + } | ||
| 248 | + } | ||
| 249 | + success() | ||
| 250 | + }, (error: Error) => { | ||
| 251 | + success() | ||
| 252 | + Logger.debug(TAG, error.toString()) | ||
| 253 | + }) | ||
| 254 | + }) | ||
| 255 | + promiseArray.push(promise3); | ||
| 256 | + } | ||
| 257 | + | ||
| 258 | + return new Promise<commentListModel>((success) => { | ||
| 259 | + Promise.all(promiseArray).then(() => { | ||
| 260 | + console.log(TAG, 'Promise.all'); | ||
| 261 | + success(model) | ||
| 262 | + }) | ||
| 263 | + | ||
| 264 | + }) | ||
| 265 | + | ||
| 266 | + | ||
| 267 | + } | ||
| 102 | } | 268 | } |
| 103 | 269 | ||
| 104 | 270 |
| 1 | -import { StringUtils } from 'wdKit/Index' | 1 | +import { StringUtils, ToastUtils } from 'wdKit/Index' |
| 2 | import { HttpUrlUtils } from 'wdNetwork/Index' | 2 | import { HttpUrlUtils } from 'wdNetwork/Index' |
| 3 | +import { WDRouterRule, WDRouterPage } from 'wdRouter/Index' | ||
| 3 | import MinePageDatasModel from '../../../model/MinePageDatasModel' | 4 | import MinePageDatasModel from '../../../model/MinePageDatasModel' |
| 4 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem' | 5 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem' |
| 5 | import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRequestItem' | 6 | import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRequestItem' |
| @@ -12,92 +13,6 @@ export struct FollowChildComponent{ | @@ -12,92 +13,6 @@ export struct FollowChildComponent{ | ||
| 12 | build() { | 13 | build() { |
| 13 | if(this.type == 0 ){ | 14 | if(this.type == 0 ){ |
| 14 | Column(){ | 15 | Column(){ |
| 15 | - Blank().height('27lpx') | ||
| 16 | - | ||
| 17 | - Row() { | ||
| 18 | - Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl) | ||
| 19 | - .objectFit(ImageFit.Auto) | ||
| 20 | - .width('92lpx') | ||
| 21 | - .height('92lpx') | ||
| 22 | - .margin({right:'15lpx'}) | ||
| 23 | - | ||
| 24 | - Column(){ | ||
| 25 | - Text(this.data.cnUserName) | ||
| 26 | - .fontWeight('400lpx') | ||
| 27 | - .fontSize('31lpx') | ||
| 28 | - .lineHeight('38lpx') | ||
| 29 | - .fontColor($r('app.color.color_222222')) | ||
| 30 | - .maxLines(1) | ||
| 31 | - Text(`粉丝${this.data.cnFansNum}`) | ||
| 32 | - .fontColor($r('app.color.color_B0B0B0')) | ||
| 33 | - .fontSize('23lpx') | ||
| 34 | - .maxLines(1) | ||
| 35 | - Text(`${this.data.introduction}`) | ||
| 36 | - .fontColor($r('app.color.color_B0B0B0')) | ||
| 37 | - .fontSize('23lpx') | ||
| 38 | - .maxLines(2) | ||
| 39 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 40 | - }.layoutWeight(1) | ||
| 41 | - .alignItems(HorizontalAlign.Start) | ||
| 42 | - | ||
| 43 | - if(this.data.status == "1"){ | ||
| 44 | - Row(){ | ||
| 45 | - Text(`已关注`) | ||
| 46 | - .fontColor($r('app.color.color_CCCCCC')) | ||
| 47 | - .fontSize('23lpx') | ||
| 48 | - .fontWeight('500lpx') | ||
| 49 | - .lineHeight('35lpx') | ||
| 50 | - }.backgroundColor($r('app.color.color_F5F5F5')) | ||
| 51 | - .borderRadius('6lpx') | ||
| 52 | - .borderColor($r('app.color.color_F5F5F5')) | ||
| 53 | - .borderWidth('2lpx') | ||
| 54 | - .justifyContent(FlexAlign.Center) | ||
| 55 | - .width('100lpx') | ||
| 56 | - .height('46lpx') | ||
| 57 | - .margin({left:'4lpx',top:'23lpx'}) | ||
| 58 | - .onClick(()=>{ | ||
| 59 | - this.followOperation() | ||
| 60 | - // this.data.status = "0" | ||
| 61 | - }) | ||
| 62 | - }else{ | ||
| 63 | - Row(){ | ||
| 64 | - Image($r('app.media.follow_icon')) | ||
| 65 | - .margin({right:'4lpx'}) | ||
| 66 | - .width('23lpx') | ||
| 67 | - .height('23lpx') | ||
| 68 | - Text(`关注`) | ||
| 69 | - .fontColor($r('app.color.color_ED2800')) | ||
| 70 | - .fontSize('23lpx') | ||
| 71 | - .fontWeight('500lpx') | ||
| 72 | - .lineHeight('35lpx') | ||
| 73 | - }.borderColor($r('app.color.color_1AED2800')) | ||
| 74 | - .borderRadius('6lpx') | ||
| 75 | - .borderWidth('2lpx') | ||
| 76 | - .justifyContent(FlexAlign.Center) | ||
| 77 | - .width('100lpx') | ||
| 78 | - .height('46lpx') | ||
| 79 | - .margin({left:'4lpx',top:'23lpx'}) | ||
| 80 | - .onClick(()=>{ | ||
| 81 | - this.followOperation() | ||
| 82 | - // this.data.status = "1" | ||
| 83 | - }) | ||
| 84 | - } | ||
| 85 | - }.alignItems(VerticalAlign.Top) | ||
| 86 | - .width('100%') | ||
| 87 | - .layoutWeight(1) | ||
| 88 | - | ||
| 89 | - Divider().width('100%') | ||
| 90 | - .height('2lpx') | ||
| 91 | - .strokeWidth('1lpx') | ||
| 92 | - .backgroundColor($r('app.color.color_EDEDED')) | ||
| 93 | - | ||
| 94 | - }.height('146lpx') | ||
| 95 | - .justifyContent(FlexAlign.Center) | ||
| 96 | - .onClick(()=>{ | ||
| 97 | - //跳转 人民号的 主页 | ||
| 98 | - }) | ||
| 99 | - }else if(this.type == 1 ){ | ||
| 100 | - Column(){ | ||
| 101 | Column(){ | 16 | Column(){ |
| 102 | 17 | ||
| 103 | Row() { | 18 | Row() { |
| @@ -118,28 +33,30 @@ export struct FollowChildComponent{ | @@ -118,28 +33,30 @@ export struct FollowChildComponent{ | ||
| 118 | .lineHeight('38lpx') | 33 | .lineHeight('38lpx') |
| 119 | .fontColor($r('app.color.color_222222')) | 34 | .fontColor($r('app.color.color_222222')) |
| 120 | .maxLines(1) | 35 | .maxLines(1) |
| 121 | - .margin({bottom:'12lpx'}) | ||
| 122 | - Row(){ | ||
| 123 | - Text(`粉丝${this.data.cnFansNum}`) | ||
| 124 | - .fontColor($r('app.color.color_B0B0B0')) | ||
| 125 | - .fontSize('23lpx') | 36 | + .margin({bottom:'8lpx'}) |
| 126 | 37 | ||
| 127 | - Image($r("app.media.point")) | ||
| 128 | - .width('31lpx') | ||
| 129 | - .height('31lpx') | ||
| 130 | - .objectFit(ImageFit.Auto) | 38 | + Text(`粉丝${this.data.cnFansNum}`) |
| 39 | + .fontColor($r('app.color.color_B0B0B0')) | ||
| 40 | + .fontSize('23lpx') | ||
| 41 | + .fontWeight('400lpx') | ||
| 42 | + .lineHeight('31lpx') | ||
| 43 | + .margin({bottom:'8lpx'}) | ||
| 131 | 44 | ||
| 132 | - Text(`${this.data.introduction}`) | ||
| 133 | - .fontColor($r('app.color.color_B0B0B0')) | ||
| 134 | - .fontSize('23lpx') | ||
| 135 | - .layoutWeight(1) | ||
| 136 | - .maxLines(1) | ||
| 137 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 138 | - }.width('100%') | 45 | + Text(`${this.data.introduction}`) |
| 46 | + .fontColor($r('app.color.color_B0B0B0')) | ||
| 47 | + .fontSize('23lpx') | ||
| 48 | + .maxLines(2) | ||
| 49 | + .textAlign(TextAlign.Start) | ||
| 50 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 139 | } | 51 | } |
| 140 | .layoutWeight(1) | 52 | .layoutWeight(1) |
| 141 | .alignItems(HorizontalAlign.Start) | 53 | .alignItems(HorizontalAlign.Start) |
| 54 | + .justifyContent(FlexAlign.Start) | ||
| 142 | }.layoutWeight(1) | 55 | }.layoutWeight(1) |
| 56 | + .alignItems(VerticalAlign.Top) | ||
| 57 | + .onClick(()=>{ | ||
| 58 | + this.jumpCreatorHomePage() | ||
| 59 | + }) | ||
| 143 | 60 | ||
| 144 | if(this.data.status == "1"){ | 61 | if(this.data.status == "1"){ |
| 145 | Row(){ | 62 | Row(){ |
| @@ -154,7 +71,7 @@ export struct FollowChildComponent{ | @@ -154,7 +71,7 @@ export struct FollowChildComponent{ | ||
| 154 | .height('46lpx') | 71 | .height('46lpx') |
| 155 | .onClick(()=>{ | 72 | .onClick(()=>{ |
| 156 | this.followOperation() | 73 | this.followOperation() |
| 157 | - }) | 74 | + }).margin({top:'29lpx'}) |
| 158 | }else{ | 75 | }else{ |
| 159 | Row(){ | 76 | Row(){ |
| 160 | Image($r('app.media.follow_icon')) | 77 | Image($r('app.media.follow_icon')) |
| @@ -172,11 +89,114 @@ export struct FollowChildComponent{ | @@ -172,11 +89,114 @@ export struct FollowChildComponent{ | ||
| 172 | .justifyContent(FlexAlign.Center) | 89 | .justifyContent(FlexAlign.Center) |
| 173 | .width('100lpx') | 90 | .width('100lpx') |
| 174 | .height('46lpx') | 91 | .height('46lpx') |
| 92 | + .margin({top:'29lpx'}) | ||
| 175 | .onClick(()=>{ | 93 | .onClick(()=>{ |
| 176 | this.followOperation() | 94 | this.followOperation() |
| 177 | }) | 95 | }) |
| 178 | } | 96 | } |
| 179 | } | 97 | } |
| 98 | + .padding({top:'27lpx'}) | ||
| 99 | + .width('100%') | ||
| 100 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 101 | + .alignItems(VerticalAlign.Top) | ||
| 102 | + | ||
| 103 | + }.height('202lpx') | ||
| 104 | + .justifyContent(FlexAlign.Start) | ||
| 105 | + | ||
| 106 | + Divider().width('100%') | ||
| 107 | + .height('1lpx') | ||
| 108 | + .strokeWidth('1lpx') | ||
| 109 | + .backgroundColor($r('app.color.color_EDEDED')) | ||
| 110 | + }.width('100%') | ||
| 111 | + | ||
| 112 | + }else { | ||
| 113 | + Column(){ | ||
| 114 | + Column(){ | ||
| 115 | + | ||
| 116 | + Row() { | ||
| 117 | + Row(){ | ||
| 118 | + Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl) | ||
| 119 | + .objectFit(ImageFit.Auto) | ||
| 120 | + .width('92lpx') | ||
| 121 | + .height('92lpx') | ||
| 122 | + .margin({right:'15lpx'}) | ||
| 123 | + .borderRadius(50) | ||
| 124 | + .borderWidth('1lpx') | ||
| 125 | + .borderColor($r('app.color.color_0D000000')) | ||
| 126 | + | ||
| 127 | + Column(){ | ||
| 128 | + Text(this.data.cnUserName) | ||
| 129 | + .fontWeight('400lpx') | ||
| 130 | + .fontSize('31lpx') | ||
| 131 | + .lineHeight('38lpx') | ||
| 132 | + .fontColor($r('app.color.color_222222')) | ||
| 133 | + .maxLines(1) | ||
| 134 | + .margin({bottom:'12lpx'}) | ||
| 135 | + Row(){ | ||
| 136 | + Text(`粉丝${this.data.cnFansNum}`) | ||
| 137 | + .fontColor($r('app.color.color_B0B0B0')) | ||
| 138 | + .fontSize('23lpx') | ||
| 139 | + | ||
| 140 | + Image($r("app.media.point")) | ||
| 141 | + .width('31lpx') | ||
| 142 | + .height('31lpx') | ||
| 143 | + .objectFit(ImageFit.Auto) | ||
| 144 | + | ||
| 145 | + Text(`${this.data.introduction}`) | ||
| 146 | + .fontColor($r('app.color.color_B0B0B0')) | ||
| 147 | + .fontSize('23lpx') | ||
| 148 | + .layoutWeight(1) | ||
| 149 | + .maxLines(1) | ||
| 150 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 151 | + }.width('100%') | ||
| 152 | + } | ||
| 153 | + .layoutWeight(1) | ||
| 154 | + .alignItems(HorizontalAlign.Start) | ||
| 155 | + }.layoutWeight(1) | ||
| 156 | + .onClick(()=>{ | ||
| 157 | + this.jumpCreatorHomePage() | ||
| 158 | + }) | ||
| 159 | + | ||
| 160 | + if(this.type === 2){ | ||
| 161 | + Blank() | ||
| 162 | + }else { | ||
| 163 | + if(this.data.status == "1"){ | ||
| 164 | + Row(){ | ||
| 165 | + Text(`已关注`) | ||
| 166 | + .fontColor($r('app.color.color_CCCCCC')) | ||
| 167 | + .fontSize('23lpx') | ||
| 168 | + .fontWeight('500lpx') | ||
| 169 | + .lineHeight('35lpx') | ||
| 170 | + } | ||
| 171 | + .justifyContent(FlexAlign.Center) | ||
| 172 | + .width('100lpx') | ||
| 173 | + .height('46lpx') | ||
| 174 | + .onClick(()=>{ | ||
| 175 | + this.followOperation() | ||
| 176 | + }) | ||
| 177 | + }else{ | ||
| 178 | + Row(){ | ||
| 179 | + Image($r('app.media.follow_icon')) | ||
| 180 | + .margin({right:'4lpx'}) | ||
| 181 | + .width('23lpx') | ||
| 182 | + .height('23lpx') | ||
| 183 | + Text(`关注`) | ||
| 184 | + .fontColor($r('app.color.color_ED2800')) | ||
| 185 | + .fontSize('23lpx') | ||
| 186 | + .fontWeight('500lpx') | ||
| 187 | + .lineHeight('35lpx') | ||
| 188 | + }.borderColor($r('app.color.color_1AED2800')) | ||
| 189 | + .borderRadius('6lpx') | ||
| 190 | + .borderWidth('2lpx') | ||
| 191 | + .justifyContent(FlexAlign.Center) | ||
| 192 | + .width('100lpx') | ||
| 193 | + .height('46lpx') | ||
| 194 | + .onClick(()=>{ | ||
| 195 | + this.followOperation() | ||
| 196 | + }) | ||
| 197 | + } | ||
| 198 | + } | ||
| 199 | + } | ||
| 180 | .width('100%') | 200 | .width('100%') |
| 181 | .height('92lpx') | 201 | .height('92lpx') |
| 182 | .justifyContent(FlexAlign.SpaceBetween) | 202 | .justifyContent(FlexAlign.SpaceBetween) |
| @@ -206,4 +226,15 @@ export struct FollowChildComponent{ | @@ -206,4 +226,15 @@ export struct FollowChildComponent{ | ||
| 206 | } | 226 | } |
| 207 | }) | 227 | }) |
| 208 | } | 228 | } |
| 229 | + | ||
| 230 | + jumpCreatorHomePage() { | ||
| 231 | + if(this.data.mainControl === 0){ | ||
| 232 | + ToastUtils.shortToast("无法查看此用户主页") | ||
| 233 | + }else if(this.data.banControl === 1){ | ||
| 234 | + ToastUtils.shortToast("该账号已封禁,不予访问") | ||
| 235 | + }else{ | ||
| 236 | + let params = {'creatorId': this.data.creatorId} as Record<string, string>; | ||
| 237 | + WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params) | ||
| 238 | + } | ||
| 239 | + } | ||
| 209 | } | 240 | } |
| 1 | import { LazyDataSource } from 'wdKit'; | 1 | import { LazyDataSource } from 'wdKit'; |
| 2 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; | 2 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; |
| 3 | +import SearcherAboutDataModel from '../../../model/SearcherAboutDataModel'; | ||
| 4 | +import { CreatorDetailRequestItem } from '../../../viewmodel/CreatorDetailRequestItem'; | ||
| 3 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem' | 5 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem' |
| 4 | import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem'; | 6 | import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem'; |
| 5 | import { FollowListStatusRequestItem } from '../../../viewmodel/FollowListStatusRequestItem'; | 7 | import { FollowListStatusRequestItem } from '../../../viewmodel/FollowListStatusRequestItem'; |
| @@ -73,8 +75,7 @@ export struct FollowListDetailUI{ | @@ -73,8 +75,7 @@ export struct FollowListDetailUI{ | ||
| 73 | this.hasMore = false | 75 | this.hasMore = false |
| 74 | }else{ | 76 | }else{ |
| 75 | value.list.forEach((value)=>{ | 77 | value.list.forEach((value)=>{ |
| 76 | - | ||
| 77 | - this.data.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,value.fansNum+"",value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.attentionUserType,value.attentionUserId)) | 78 | + this.data.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,value.fansNum+"",value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.attentionUserType,value.attentionUserId,value.mainControl,value.banControl)) |
| 78 | }) | 79 | }) |
| 79 | this.data.notifyDataReload() | 80 | this.data.notifyDataReload() |
| 80 | this.count = this.data.totalCount() | 81 | this.count = this.data.totalCount() |
| @@ -109,31 +110,72 @@ export struct FollowListDetailUI{ | @@ -109,31 +110,72 @@ export struct FollowListDetailUI{ | ||
| 109 | } | 110 | } |
| 110 | } | 111 | } |
| 111 | 112 | ||
| 112 | - getFollowListStatus(value:MineFollowListDetailItem){ | 113 | + getFollowListStatus(result:MineFollowListDetailItem){ |
| 114 | + let data_temp : FollowListDetailItem[] = [] | ||
| 115 | + result.list.forEach((item)=>{ | ||
| 116 | + data_temp.push(new FollowListDetailItem(item.headPhotoUrl,item.cnUserName,item.cnFansNum,item.introduction,item.creatorId,"0",item.attentionUserId,item.cnUserType,item.cnUserId,item.cnMainControl,-1)) | ||
| 117 | + }) | ||
| 118 | + let request = new CreatorDetailRequestItem() | ||
| 119 | + | ||
| 120 | + data_temp.forEach((data)=>{ | ||
| 121 | + request.creatorIdList.push(data.creatorId) | ||
| 122 | + }) | ||
| 123 | + SearcherAboutDataModel.getCreatorDetailListData(request).then((value)=>{ | ||
| 124 | + if(value!=null && value.length>0){ | ||
| 125 | + data_temp.forEach((data)=>{ | ||
| 126 | + value.forEach((item)=>{ | ||
| 127 | + if(data.creatorId == item.creatorId){ | ||
| 128 | + data.headPhotoUrl = item.headPhotoUrl | ||
| 129 | + if(item.fansNum>10000){ | ||
| 130 | + let temp = (item.fansNum/10000)+"" | ||
| 131 | + let index = temp.indexOf('.') | ||
| 132 | + if(index != -1){ | ||
| 133 | + temp = temp.substring(0,index+2) | ||
| 134 | + }else{ | ||
| 135 | + temp = temp | ||
| 136 | + } | ||
| 137 | + data.cnFansNum = temp + "万" | ||
| 138 | + }else{ | ||
| 139 | + data.cnFansNum = item.fansNum + "" | ||
| 140 | + } | ||
| 141 | + data.introduction = item.introduction | ||
| 142 | + data.mainControl = item.mainControl | ||
| 143 | + data.banControl = item.banControl | ||
| 144 | + } | ||
| 145 | + }) | ||
| 146 | + }) | ||
| 147 | + this.getFollowStatus(data_temp,result.totalCount) | ||
| 148 | + } | ||
| 149 | + }).catch((err:Error)=>{ | ||
| 150 | + console.log(TAG,JSON.stringify(err)) | ||
| 151 | + this.isLoading = false | ||
| 152 | + this.count = this.count===-1?0:this.count | ||
| 153 | + }) | ||
| 154 | + } | ||
| 155 | + | ||
| 156 | + getFollowStatus(result : FollowListDetailItem[],totalCount:number){ | ||
| 113 | let status = new FollowListStatusRequestItem() | 157 | let status = new FollowListStatusRequestItem() |
| 114 | - let data : FollowListDetailItem[] = [] | ||
| 115 | - value.list.forEach((item)=>{ | 158 | + result.forEach((item)=>{ |
| 116 | status.creatorIds.push(new QueryListIsFollowedItem(item.creatorId)) | 159 | status.creatorIds.push(new QueryListIsFollowedItem(item.creatorId)) |
| 117 | - data.push(new FollowListDetailItem(item.headPhotoUrl,item.cnUserName,item.cnFansNum,item.introduction,item.creatorId,"0",item.attentionUserId,item.cnUserType,item.cnUserId)) | ||
| 118 | }) | 160 | }) |
| 119 | 161 | ||
| 120 | MinePageDatasModel.getFollowListStatusData(status,getContext(this)).then((newValue)=>{ | 162 | MinePageDatasModel.getFollowListStatusData(status,getContext(this)).then((newValue)=>{ |
| 121 | newValue.forEach((item)=>{ | 163 | newValue.forEach((item)=>{ |
| 122 | - data.forEach((list)=>{ | 164 | + result.forEach((list)=>{ |
| 123 | if (item.creatorId == list.creatorId) { | 165 | if (item.creatorId == list.creatorId) { |
| 124 | list.status = item.status | 166 | list.status = item.status |
| 125 | } | 167 | } |
| 126 | }) | 168 | }) |
| 127 | }) | 169 | }) |
| 128 | 170 | ||
| 129 | - data.forEach((item)=>{ | ||
| 130 | - this.data.push(new FollowListDetailItem(item.headPhotoUrl,item.cnUserName,item.cnFansNum,item.introduction,item.creatorId,item.status,item.attentionUserId,item.cnUserType,item.cnUserId)) | 171 | + result.forEach((item)=>{ |
| 172 | + this.data.push(new FollowListDetailItem(item.headPhotoUrl,item.cnUserName,item.cnFansNum,item.introduction,item.creatorId,item.status,item.attentionUserId,item.cnUserType,item.cnUserId,item.mainControl,item.banControl)) | ||
| 131 | }) | 173 | }) |
| 132 | 174 | ||
| 133 | this.data.notifyDataReload() | 175 | this.data.notifyDataReload() |
| 134 | 176 | ||
| 135 | this.count = this.data.totalCount() | 177 | this.count = this.data.totalCount() |
| 136 | - if (this.data.totalCount() < value.totalCount) { | 178 | + if (this.data.totalCount() < totalCount) { |
| 137 | this.curPageNum++ | 179 | this.curPageNum++ |
| 138 | }else { | 180 | }else { |
| 139 | this.hasMore = false | 181 | this.hasMore = false |
| @@ -8,6 +8,7 @@ import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; | @@ -8,6 +8,7 @@ import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; | ||
| 8 | import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem'; | 8 | import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem'; |
| 9 | import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRequestItem'; | 9 | import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRequestItem'; |
| 10 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; | 10 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; |
| 11 | +import { FollowChildComponent } from '../follow/FollowChildComponent'; | ||
| 11 | 12 | ||
| 12 | const TAG = "HomePageBottomComponent" | 13 | const TAG = "HomePageBottomComponent" |
| 13 | @Component | 14 | @Component |
| @@ -95,7 +96,7 @@ export struct HomePageBottomComponent{ | @@ -95,7 +96,7 @@ export struct HomePageBottomComponent{ | ||
| 95 | 96 | ||
| 96 | LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => { | 97 | LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => { |
| 97 | ListItem() { | 98 | ListItem() { |
| 98 | - ChildFollowComponent({data: item}) | 99 | + FollowChildComponent({data: item,type:1}) |
| 99 | } | 100 | } |
| 100 | .onClick(() => { | 101 | .onClick(() => { |
| 101 | }) | 102 | }) |
| @@ -184,7 +185,7 @@ export struct HomePageBottomComponent{ | @@ -184,7 +185,7 @@ export struct HomePageBottomComponent{ | ||
| 184 | this.hasMore = false | 185 | this.hasMore = false |
| 185 | }else{ | 186 | }else{ |
| 186 | value.list.forEach((value)=>{ | 187 | value.list.forEach((value)=>{ |
| 187 | - this.data_follow.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,value.fansNum+"",value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.attentionUserType,value.attentionUserId)) | 188 | + this.data_follow.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,value.fansNum+"",value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.attentionUserType,value.attentionUserId,value.mainControl,value.banControl)) |
| 188 | }) | 189 | }) |
| 189 | this.data_follow.notifyDataReload() | 190 | this.data_follow.notifyDataReload() |
| 190 | this.count = this.data_follow.totalCount() | 191 | this.count = this.data_follow.totalCount() |
| @@ -231,107 +232,6 @@ export struct HomePageBottomComponent{ | @@ -231,107 +232,6 @@ export struct HomePageBottomComponent{ | ||
| 231 | } | 232 | } |
| 232 | 233 | ||
| 233 | @Component | 234 | @Component |
| 234 | -struct ChildFollowComponent { | ||
| 235 | - @ObjectLink data: FollowListDetailItem | ||
| 236 | - | ||
| 237 | - build() { | ||
| 238 | - Column(){ | ||
| 239 | - Blank().height('27lpx') | ||
| 240 | - | ||
| 241 | - Row() { | ||
| 242 | - Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl) | ||
| 243 | - .objectFit(ImageFit.Auto) | ||
| 244 | - .width('92lpx') | ||
| 245 | - .height('92lpx') | ||
| 246 | - .margin({right:'15lpx'}) | ||
| 247 | - | ||
| 248 | - Column(){ | ||
| 249 | - Text(this.data.cnUserName) | ||
| 250 | - .fontWeight('400lpx') | ||
| 251 | - .fontSize('31lpx') | ||
| 252 | - .lineHeight('38lpx') | ||
| 253 | - .fontColor($r('app.color.color_222222')) | ||
| 254 | - Text(`粉丝${this.data.cnFansNum}`) | ||
| 255 | - .fontColor($r('app.color.color_B0B0B0')) | ||
| 256 | - .fontSize('23lpx') | ||
| 257 | - .maxLines(1) | ||
| 258 | - Text(`${this.data.introduction}`) | ||
| 259 | - .fontColor($r('app.color.color_B0B0B0')) | ||
| 260 | - .fontSize('23lpx') | ||
| 261 | - .maxLines(2) | ||
| 262 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 263 | - }.layoutWeight(1) | ||
| 264 | - .alignItems(HorizontalAlign.Start) | ||
| 265 | - | ||
| 266 | - if(this.data.status == "1"){ | ||
| 267 | - Row(){ | ||
| 268 | - Text(`已关注`) | ||
| 269 | - .fontColor($r('app.color.color_CCCCCC')) | ||
| 270 | - .fontSize('23lpx') | ||
| 271 | - .fontWeight('500lpx') | ||
| 272 | - .lineHeight('35lpx') | ||
| 273 | - }.backgroundColor($r('app.color.color_F5F5F5')) | ||
| 274 | - .borderRadius('6lpx') | ||
| 275 | - .borderColor($r('app.color.color_F5F5F5')) | ||
| 276 | - .borderWidth('2lpx') | ||
| 277 | - .justifyContent(FlexAlign.Center) | ||
| 278 | - .width('100lpx') | ||
| 279 | - .height('46lpx') | ||
| 280 | - .margin({left:'4lpx',top:'23lpx'}) | ||
| 281 | - .onClick(()=>{ | ||
| 282 | - // this.data.status = "0" | ||
| 283 | - this.followOperation() | ||
| 284 | - }) | ||
| 285 | - }else{ | ||
| 286 | - Row(){ | ||
| 287 | - Image($r('app.media.follow_icon')) | ||
| 288 | - .margin({right:'4lpx'}) | ||
| 289 | - .width('23lpx') | ||
| 290 | - .height('23lpx') | ||
| 291 | - Text(`关注`) | ||
| 292 | - .fontColor($r('app.color.color_ED2800')) | ||
| 293 | - .fontSize('23lpx') | ||
| 294 | - .fontWeight('500lpx') | ||
| 295 | - .lineHeight('35lpx') | ||
| 296 | - }.borderColor($r('app.color.color_1AED2800')) | ||
| 297 | - .borderRadius('6lpx') | ||
| 298 | - .borderWidth('2lpx') | ||
| 299 | - .justifyContent(FlexAlign.Center) | ||
| 300 | - .width('100lpx') | ||
| 301 | - .height('46lpx') | ||
| 302 | - .margin({left:'4lpx',top:'23lpx'}) | ||
| 303 | - .onClick(()=>{ | ||
| 304 | - // this.data.status = "1" | ||
| 305 | - this.followOperation() | ||
| 306 | - }) | ||
| 307 | - } | ||
| 308 | - }.alignItems(VerticalAlign.Top) | ||
| 309 | - .width('100%') | ||
| 310 | - .layoutWeight(1) | ||
| 311 | - | ||
| 312 | - Divider().width('100%') | ||
| 313 | - .height('2lpx') | ||
| 314 | - .strokeWidth('1lpx') | ||
| 315 | - .backgroundColor($r('app.color.color_EDEDED')) | ||
| 316 | - | ||
| 317 | - }.height('146lpx') | ||
| 318 | - .justifyContent(FlexAlign.Center) | ||
| 319 | - } | ||
| 320 | - | ||
| 321 | - followOperation(){ | ||
| 322 | - let item = new FollowOperationRequestItem(this.data.cnUserType,this.data.cnUserId,this.data.creatorId,UserDataLocal.getUserType(),UserDataLocal.getUserId(),this.data.status==="0" ? 1:0) | ||
| 323 | - MinePageDatasModel.getFollowOperation(item,getContext(this)).then((value)=>{ | ||
| 324 | - if(value!=null){ | ||
| 325 | - if (value.code === 0 || value.code.toString() === "0") { | ||
| 326 | - this.data.status = this.data.status ==="0"?"1":"0" | ||
| 327 | - } | ||
| 328 | - } | ||
| 329 | - }) | ||
| 330 | - } | ||
| 331 | - | ||
| 332 | -} | ||
| 333 | - | ||
| 334 | -@Component | ||
| 335 | struct ChildCommentComponent { | 235 | struct ChildCommentComponent { |
| 336 | @ObjectLink data: CommentListItem | 236 | @ObjectLink data: CommentListItem |
| 337 | isLastItem: boolean = false | 237 | isLastItem: boolean = false |
| @@ -5,6 +5,7 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel'; | @@ -5,6 +5,7 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel'; | ||
| 5 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; | 5 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; |
| 6 | import { UserFollowListRequestItem } from '../../../viewmodel/UserFollowListRequestItem'; | 6 | import { UserFollowListRequestItem } from '../../../viewmodel/UserFollowListRequestItem'; |
| 7 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; | 7 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; |
| 8 | +import { FollowChildComponent } from '../follow/FollowChildComponent'; | ||
| 8 | 9 | ||
| 9 | const TAG = "HomePageBottomComponent" | 10 | const TAG = "HomePageBottomComponent" |
| 10 | @Component | 11 | @Component |
| @@ -62,7 +63,7 @@ export struct OtherHomePageBottomFollowComponent{ | @@ -62,7 +63,7 @@ export struct OtherHomePageBottomFollowComponent{ | ||
| 62 | 63 | ||
| 63 | LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => { | 64 | LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => { |
| 64 | ListItem() { | 65 | ListItem() { |
| 65 | - ChildFollowComponent({data: item}) | 66 | + FollowChildComponent({data: item,type:2}) |
| 66 | } | 67 | } |
| 67 | .onClick(() => { | 68 | .onClick(() => { |
| 68 | }) | 69 | }) |
| @@ -116,7 +117,7 @@ export struct OtherHomePageBottomFollowComponent{ | @@ -116,7 +117,7 @@ export struct OtherHomePageBottomFollowComponent{ | ||
| 116 | this.hasMore = false | 117 | this.hasMore = false |
| 117 | }else{ | 118 | }else{ |
| 118 | value.list.forEach((value)=>{ | 119 | value.list.forEach((value)=>{ |
| 119 | - this.data_follow.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,value.fansNum+"",value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.cnUserType,value.cnUserId)) | 120 | + this.data_follow.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,value.fansNum+"",value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.cnUserType,value.cnUserId,value.mainControl,value.banControl)) |
| 120 | }) | 121 | }) |
| 121 | this.data_follow.notifyDataReload() | 122 | this.data_follow.notifyDataReload() |
| 122 | this.count = this.data_follow.totalCount() | 123 | this.count = this.data_follow.totalCount() |
| @@ -134,50 +135,4 @@ export struct OtherHomePageBottomFollowComponent{ | @@ -134,50 +135,4 @@ export struct OtherHomePageBottomFollowComponent{ | ||
| 134 | }) | 135 | }) |
| 135 | } | 136 | } |
| 136 | } | 137 | } |
| 137 | -} | ||
| 138 | - | ||
| 139 | -@Component | ||
| 140 | -struct ChildFollowComponent { | ||
| 141 | - @ObjectLink data: FollowListDetailItem | ||
| 142 | - | ||
| 143 | - build() { | ||
| 144 | - Column(){ | ||
| 145 | - Blank().height('27lpx') | ||
| 146 | - | ||
| 147 | - Row() { | ||
| 148 | - Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl) | ||
| 149 | - .objectFit(ImageFit.Auto) | ||
| 150 | - .width('92lpx') | ||
| 151 | - .height('92lpx') | ||
| 152 | - .margin({right:'15lpx'}) | ||
| 153 | - | ||
| 154 | - Column(){ | ||
| 155 | - Text(this.data.cnUserName) | ||
| 156 | - .fontWeight('400lpx') | ||
| 157 | - .fontSize('31lpx') | ||
| 158 | - .lineHeight('38lpx') | ||
| 159 | - .fontColor($r('app.color.color_222222')) | ||
| 160 | - Text(`粉丝${this.data.cnFansNum}`) | ||
| 161 | - .fontColor($r('app.color.color_B0B0B0')) | ||
| 162 | - .fontSize('23lpx') | ||
| 163 | - .maxLines(1) | ||
| 164 | - Text(`${this.data.introduction}`) | ||
| 165 | - .fontColor($r('app.color.color_B0B0B0')) | ||
| 166 | - .fontSize('23lpx') | ||
| 167 | - .maxLines(2) | ||
| 168 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 169 | - }.layoutWeight(1) | ||
| 170 | - .alignItems(HorizontalAlign.Start) | ||
| 171 | - }.alignItems(VerticalAlign.Top) | ||
| 172 | - .width('100%') | ||
| 173 | - .layoutWeight(1) | ||
| 174 | - | ||
| 175 | - Divider().width('100%') | ||
| 176 | - .height('2lpx') | ||
| 177 | - .strokeWidth('1lpx') | ||
| 178 | - .backgroundColor($r('app.color.color_EDEDED')) | ||
| 179 | - | ||
| 180 | - }.height('146lpx') | ||
| 181 | - .justifyContent(FlexAlign.Center) | ||
| 182 | - } | ||
| 183 | } | 138 | } |
| @@ -2,7 +2,7 @@ import { CustomTitleAndEditUI } from '../reusable/CustomTitleAndEditUI' | @@ -2,7 +2,7 @@ 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' |
| 5 | -import { EmptyComponent } from '../view/EmptyComponent' | 5 | +import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent' |
| 6 | import { ErrorComponent } from '../view/ErrorComponent' | 6 | import { ErrorComponent } from '../view/ErrorComponent' |
| 7 | import RefreshLayout from './RefreshLayout' | 7 | import RefreshLayout from './RefreshLayout' |
| 8 | import { RefreshLayoutBean } from './RefreshLayoutBean'; | 8 | import { RefreshLayoutBean } from './RefreshLayoutBean'; |
| @@ -41,31 +41,28 @@ struct BrowsingHistoryPage { | @@ -41,31 +41,28 @@ struct BrowsingHistoryPage { | ||
| 41 | this.deleteNum = 0 | 41 | this.deleteNum = 0 |
| 42 | }}) | 42 | }}) |
| 43 | 43 | ||
| 44 | - CustomPullToRefresh({ | ||
| 45 | - alldata:this.allDatas, | ||
| 46 | - scroller:this.scroller, | ||
| 47 | - customList:()=>{ | ||
| 48 | - this.ListLayout() | ||
| 49 | - }, | ||
| 50 | - onRefresh:(resolve)=>{ | ||
| 51 | - this.browSingModel.currentPage = 0 | ||
| 52 | - this.getData(resolve) | ||
| 53 | - }, | ||
| 54 | - onLoadMore:(resolve)=> { | ||
| 55 | - this.browSingModel.currentPage++ | ||
| 56 | - this.getData() | ||
| 57 | - } | ||
| 58 | - }) | ||
| 59 | - | ||
| 60 | - | ||
| 61 | // if (this.browSingModel.viewType == ViewType.LOADING){ | 44 | // if (this.browSingModel.viewType == ViewType.LOADING){ |
| 62 | // this.LoadingLayout() | 45 | // this.LoadingLayout() |
| 63 | // }else if(this.browSingModel.viewType == ViewType.ERROR){ | 46 | // }else if(this.browSingModel.viewType == ViewType.ERROR){ |
| 64 | // ErrorComponent() | 47 | // ErrorComponent() |
| 65 | // }else if(this.browSingModel.viewType == ViewType.EMPTY){ | 48 | // }else if(this.browSingModel.viewType == ViewType.EMPTY){ |
| 66 | - // EmptyComponent() | 49 | + EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoHistory}) |
| 67 | // }else { | 50 | // }else { |
| 68 | - // this.ListLayout() | 51 | + // CustomPullToRefresh({ |
| 52 | + // alldata:this.allDatas, | ||
| 53 | + // scroller:this.scroller, | ||
| 54 | + // customList:()=>{ | ||
| 55 | + // this.ListLayout() | ||
| 56 | + // }, | ||
| 57 | + // onRefresh:(resolve)=>{ | ||
| 58 | + // this.browSingModel.currentPage = 0 | ||
| 59 | + // this.getData(resolve) | ||
| 60 | + // }, | ||
| 61 | + // onLoadMore:(resolve)=> { | ||
| 62 | + // this.browSingModel.currentPage++ | ||
| 63 | + // this.getData() | ||
| 64 | + // } | ||
| 65 | + // }) | ||
| 69 | // } | 66 | // } |
| 70 | 67 | ||
| 71 | if (this.isEditState){ | 68 | if (this.isEditState){ |
| @@ -287,16 +287,6 @@ struct ChannelDialog { | @@ -287,16 +287,6 @@ struct ChannelDialog { | ||
| 287 | .height('100%') | 287 | .height('100%') |
| 288 | .justifyContent(FlexAlign.Center) | 288 | .justifyContent(FlexAlign.Center) |
| 289 | .backgroundColor(item.homeChannel === '1' || item.movePermitted === 0 ? '#F5F5F5' : '#ffffff') | 289 | .backgroundColor(item.homeChannel === '1' || item.movePermitted === 0 ? '#F5F5F5' : '#ffffff') |
| 290 | - .onClick(() => { | ||
| 291 | - if (this.isEditIng) { | ||
| 292 | - if (item.delPermitted === 1) { | ||
| 293 | - this.delChannelItem(index) | ||
| 294 | - } | ||
| 295 | - } else { | ||
| 296 | - this.confirm(index) | ||
| 297 | - this.controller?.close() | ||
| 298 | - } | ||
| 299 | - }) | ||
| 300 | } | 290 | } |
| 301 | .width('23%') | 291 | .width('23%') |
| 302 | .height(40) | 292 | .height(40) |
| @@ -307,31 +297,40 @@ struct ChannelDialog { | @@ -307,31 +297,40 @@ struct ChannelDialog { | ||
| 307 | }) | 297 | }) |
| 308 | .zIndex(this.dragItem == item.num ? 1 : 0) | 298 | .zIndex(this.dragItem == item.num ? 1 : 0) |
| 309 | .translate(this.dragItem == item.num ? { x: this.offsetX, y: this.offsetY } : { x: 0, y: 0 }) | 299 | .translate(this.dragItem == item.num ? { x: this.offsetX, y: this.offsetY } : { x: 0, y: 0 }) |
| 310 | - | ||
| 311 | .gesture( | 300 | .gesture( |
| 312 | - GestureGroup(GestureMode.Sequence, | ||
| 313 | - PanGesture({ fingers: 1, direction: null, distance: 0 }) | ||
| 314 | - .onActionStart((event: GestureEvent) => { | ||
| 315 | - this.dragItem = item.num | ||
| 316 | - this.dragRefOffsetX = 0 | ||
| 317 | - this.dragRefOffsetY = 0 | ||
| 318 | - }) | ||
| 319 | - .onActionUpdate((event: GestureEvent) => { | ||
| 320 | - animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => { | ||
| 321 | - this.handleAnimationTo(item, event) | ||
| 322 | - }) | ||
| 323 | - }) | ||
| 324 | - .onActionEnd((event: GestureEvent) => { | ||
| 325 | - animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => { | ||
| 326 | - this.dragItem = -1 | ||
| 327 | - this.offsetX = 0 | ||
| 328 | - this.offsetY = 0 | 301 | + GestureGroup(GestureMode.Parallel, |
| 302 | + TapGesture() | ||
| 303 | + .onAction((event?: GestureEvent) => { | ||
| 304 | + if (this.isEditIng) { | ||
| 305 | + if (item.delPermitted === 1) { | ||
| 306 | + this.delChannelItem(index) | ||
| 307 | + } | ||
| 308 | + } else { | ||
| 309 | + this.confirm(index) | ||
| 310 | + this.controller?.close() | ||
| 311 | + } | ||
| 312 | + }), | ||
| 313 | + PanGesture({ fingers: 1, direction: null, distance: 0 }) | ||
| 314 | + .onActionStart((event: GestureEvent) => { | ||
| 315 | + this.dragItem = item.num | ||
| 329 | this.dragRefOffsetX = 0 | 316 | this.dragRefOffsetX = 0 |
| 330 | this.dragRefOffsetY = 0 | 317 | this.dragRefOffsetY = 0 |
| 331 | }) | 318 | }) |
| 332 | - }) | ||
| 333 | - ) | ||
| 334 | - .onCancel(() => { | 319 | + .onActionUpdate((event: GestureEvent) => { |
| 320 | + animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => { | ||
| 321 | + this.handleAnimationTo(item, event) | ||
| 322 | + }) | ||
| 323 | + }) | ||
| 324 | + .onActionEnd((event: GestureEvent) => { | ||
| 325 | + animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => { | ||
| 326 | + this.dragItem = -1 | ||
| 327 | + this.offsetX = 0 | ||
| 328 | + this.offsetY = 0 | ||
| 329 | + this.dragRefOffsetX = 0 | ||
| 330 | + this.dragRefOffsetY = 0 | ||
| 331 | + }) | ||
| 332 | + }) | ||
| 333 | + ).onCancel(() => { | ||
| 335 | animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => { | 334 | animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => { |
| 336 | this.dragItem = -1 | 335 | this.dragItem = -1 |
| 337 | this.offsetX = 0 | 336 | this.offsetX = 0 |
| @@ -339,8 +338,8 @@ struct ChannelDialog { | @@ -339,8 +338,8 @@ struct ChannelDialog { | ||
| 339 | this.dragRefOffsetX = 0 | 338 | this.dragRefOffsetX = 0 |
| 340 | this.dragRefOffsetY = 0 | 339 | this.dragRefOffsetY = 0 |
| 341 | }) | 340 | }) |
| 342 | - })) | ||
| 343 | - | 341 | + }) |
| 342 | + ) | ||
| 344 | }, (item: TopNavDTO) => JSON.stringify(item)) | 343 | }, (item: TopNavDTO) => JSON.stringify(item)) |
| 345 | } | 344 | } |
| 346 | .width('100%') | 345 | .width('100%') |
| @@ -127,7 +127,8 @@ struct EditUserInfoPage { | @@ -127,7 +127,8 @@ struct EditUserInfoPage { | ||
| 127 | lunar:false, | 127 | lunar:false, |
| 128 | onAccept:(value:DatePickerResult) => { | 128 | onAccept:(value:DatePickerResult) => { |
| 129 | let mon = value.month as number + 1 | 129 | let mon = value.month as number + 1 |
| 130 | - this.currentUserInfo.userExtend.birthday = value.year+'-'+mon.toString()+'-'+value.day; | 130 | + let monStr = mon < 10? '0'+mon.toString():mon.toString(); |
| 131 | + this.currentUserInfo.userExtend.birthday = value.year+'-'+monStr+'-'+value.day; | ||
| 131 | this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_birthday | 132 | this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_birthday |
| 132 | this.updateEditModel() | 133 | this.updateEditModel() |
| 133 | } | 134 | } |
| @@ -171,8 +172,10 @@ struct EditUserInfoPage { | @@ -171,8 +172,10 @@ struct EditUserInfoPage { | ||
| 171 | 172 | ||
| 172 | updateEditModel(){ | 173 | updateEditModel(){ |
| 173 | this.listData = [] | 174 | this.listData = [] |
| 174 | - this.listData.push(...EditInfoViewModel.getEditListInfo(this.currentUserInfo)) | ||
| 175 | - EditInfoViewModel.updateUserInfo(this.currentUserInfo) | 175 | + // this.listData.push(...EditInfoViewModel.getEditListInfo(this.currentUserInfo)) |
| 176 | + EditInfoViewModel.updateUserInfo(this.currentUserInfo).then(()=>{ | ||
| 177 | + this.getAccountOwnerInfo() | ||
| 178 | + }) | ||
| 176 | } | 179 | } |
| 177 | getAccountOwnerInfo(){ | 180 | getAccountOwnerInfo(){ |
| 178 | EditInfoViewModel.queryAccountOwnerInfo(1,getContext(this)).then((editModel) => { | 181 | EditInfoViewModel.queryAccountOwnerInfo(1,getContext(this)).then((editModel) => { |
| @@ -19,7 +19,6 @@ import { | @@ -19,7 +19,6 @@ import { | ||
| 19 | struct PeopleShipHomePage { | 19 | struct PeopleShipHomePage { |
| 20 | // Todo 传入数据 后续在修改 | 20 | // Todo 传入数据 后续在修改 |
| 21 | creatorId: string = (router.getParams() as Record<string, string>)['creatorId']; | 21 | creatorId: string = (router.getParams() as Record<string, string>)['creatorId']; |
| 22 | - @State arr: number[] = [] | ||
| 23 | // 页面详情数据 | 22 | // 页面详情数据 |
| 24 | @Provide detailModel: PeopleShipUserDetailData = {} as PeopleShipUserDetailData | 23 | @Provide detailModel: PeopleShipUserDetailData = {} as PeopleShipUserDetailData |
| 25 | // 每个分类数量 | 24 | // 每个分类数量 |
| @@ -108,9 +107,12 @@ struct PeopleShipHomePage { | @@ -108,9 +107,12 @@ struct PeopleShipHomePage { | ||
| 108 | Logger.debug('PeopleShipHomePage', '获取页面信息', `${JSON.stringify(this.detailModel)}`) | 107 | Logger.debug('PeopleShipHomePage', '获取页面信息', `${JSON.stringify(this.detailModel)}`) |
| 109 | 108 | ||
| 110 | // 获取关注 | 109 | // 获取关注 |
| 111 | - let followList: QueryListIsFollowedItem[] = await PeopleShipHomePageDataModel.getHomePageFollowListStatusData(this.creatorId) | ||
| 112 | - Logger.debug('PeopleShipHomePage', '获取关注信息', `${JSON.stringify(followList)}`) | ||
| 113 | - this.findFollowStata(followList) | 110 | + // 登录后获取,是否关注 |
| 111 | + if (HttpUrlUtils.getUserId()) { | ||
| 112 | + let followList: QueryListIsFollowedItem[] = await PeopleShipHomePageDataModel.getHomePageFollowListStatusData(this.creatorId) | ||
| 113 | + Logger.debug('PeopleShipHomePage', '获取关注信息', `${JSON.stringify(followList)}`) | ||
| 114 | + this.findFollowStata(followList) | ||
| 115 | + } | ||
| 114 | 116 | ||
| 115 | } catch (exception) { | 117 | } catch (exception) { |
| 116 | 118 | ||
| @@ -128,14 +130,17 @@ struct PeopleShipHomePage { | @@ -128,14 +130,17 @@ struct PeopleShipHomePage { | ||
| 128 | } | 130 | } |
| 129 | 131 | ||
| 130 | handleChangeAttentionStata() { | 132 | handleChangeAttentionStata() { |
| 133 | + | ||
| 131 | if (!this.isLoadingAttention) { | 134 | if (!this.isLoadingAttention) { |
| 132 | return | 135 | return |
| 133 | } | 136 | } |
| 134 | // 未登录,跳转登录 | 137 | // 未登录,跳转登录 |
| 135 | if (!HttpUrlUtils.getUserId()) { | 138 | if (!HttpUrlUtils.getUserId()) { |
| 139 | + this.isLoadingAttention = false | ||
| 136 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | 140 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) |
| 137 | return | 141 | return |
| 138 | } | 142 | } |
| 143 | + | ||
| 139 | let status = 0 | 144 | let status = 0 |
| 140 | if (this.isAttention == '0') { | 145 | if (this.isAttention == '0') { |
| 141 | status = 1 | 146 | status = 1 |
| @@ -20,24 +20,26 @@ import { RefreshLayoutBean } from '../page/RefreshLayoutBean' | @@ -20,24 +20,26 @@ import { RefreshLayoutBean } from '../page/RefreshLayoutBean' | ||
| 20 | import CustomRefreshLoadLayout from '../page/CustomRefreshLoadLayout' | 20 | import CustomRefreshLoadLayout from '../page/CustomRefreshLoadLayout' |
| 21 | import { ErrorComponent } from '../view/ErrorComponent'; | 21 | import { ErrorComponent } from '../view/ErrorComponent'; |
| 22 | import NoMoreLayout from '../page/NoMoreLayout'; | 22 | import NoMoreLayout from '../page/NoMoreLayout'; |
| 23 | -import { LazyDataSource } from 'wdKit'; | 23 | +// import { LazyDataSource } from 'wdKit'; |
| 24 | +import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh' | ||
| 24 | 25 | ||
| 25 | const TAG = 'PeopleShipHomeArticleListComponent'; | 26 | const TAG = 'PeopleShipHomeArticleListComponent'; |
| 26 | 27 | ||
| 27 | @Component | 28 | @Component |
| 28 | export struct PeopleShipHomeArticleListComponent { | 29 | export struct PeopleShipHomeArticleListComponent { |
| 29 | - // @State arr: ContentDTO[] = [] | ||
| 30 | - @State arr: LazyDataSource<ContentDTO> = new LazyDataSource(); | 30 | + @State arr: ContentDTO[] = [] |
| 31 | + // @State arr: LazyDataSource<ContentDTO> = new LazyDataSource(); | ||
| 31 | @State typeModel: ArticleTypeData = new ArticleTypeData() | 32 | @State typeModel: ArticleTypeData = new ArticleTypeData() |
| 32 | @State creatorId: string = '' | 33 | @State creatorId: string = '' |
| 33 | @Consume detailModel: PeopleShipUserDetailData | 34 | @Consume detailModel: PeopleShipUserDetailData |
| 34 | - @State private viewType: number = 1; | ||
| 35 | - currentIndex: number = 0 | 35 | + @State private viewType: number = 1 |
| 36 | + currentIndex: number = 1 | ||
| 36 | @Link @Watch('onChange') currentTopSelectedIndex: number | 37 | @Link @Watch('onChange') currentTopSelectedIndex: number |
| 37 | @State private hasMore: boolean = true | 38 | @State private hasMore: boolean = true |
| 38 | - @State currentPage: number = 1 | 39 | + @State private currentPage: number = 1 |
| 39 | @State private isLoading: boolean = false | 40 | @State private isLoading: boolean = false |
| 40 | @Consume topHeight: number | 41 | @Consume topHeight: number |
| 42 | + private scroller: Scroller = new Scroller() | ||
| 41 | 43 | ||
| 42 | build() { | 44 | build() { |
| 43 | if (this.viewType == 1) { | 45 | if (this.viewType == 1) { |
| @@ -46,7 +48,34 @@ export struct PeopleShipHomeArticleListComponent { | @@ -46,7 +48,34 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 46 | } else if (this.viewType == 2) { | 48 | } else if (this.viewType == 2) { |
| 47 | ErrorComponent() | 49 | ErrorComponent() |
| 48 | } else { | 50 | } else { |
| 49 | - this.ListLayout() | 51 | + CustomPullToRefresh({ |
| 52 | + alldata:this.arr, | ||
| 53 | + scroller:this.scroller, | ||
| 54 | + hasMore: this.hasMore, | ||
| 55 | + customList:()=>{ | ||
| 56 | + this.ListLayout() | ||
| 57 | + }, | ||
| 58 | + onRefresh:(resolve)=>{ | ||
| 59 | + this.currentPage = 1 | ||
| 60 | + this.getPeopleShipPageArticleList(resolve) | ||
| 61 | + }, | ||
| 62 | + onLoadMore:(resolve)=> { | ||
| 63 | + if (this.hasMore === false) { | ||
| 64 | + if(resolve) { | ||
| 65 | + resolve('') | ||
| 66 | + } | ||
| 67 | + return | ||
| 68 | + } | ||
| 69 | + if(!this.isLoading && this.hasMore){ | ||
| 70 | + //加载分页数据 | ||
| 71 | + this.getPeopleShipPageArticleList(resolve) | ||
| 72 | + }else { | ||
| 73 | + if(resolve) { | ||
| 74 | + resolve('') | ||
| 75 | + } | ||
| 76 | + } | ||
| 77 | + }, | ||
| 78 | + }) | ||
| 50 | } | 79 | } |
| 51 | 80 | ||
| 52 | } | 81 | } |
| @@ -62,10 +91,10 @@ export struct PeopleShipHomeArticleListComponent { | @@ -62,10 +91,10 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 62 | @Builder | 91 | @Builder |
| 63 | ListLayout() { | 92 | ListLayout() { |
| 64 | 93 | ||
| 65 | - List() { | 94 | + List({scroller: this.scroller}) { |
| 66 | // 下拉刷新 | 95 | // 下拉刷新 |
| 67 | 96 | ||
| 68 | - LazyForEach(this.arr, (item: ContentDTO) => { | 97 | + ForEach(this.arr, (item: ContentDTO) => { |
| 69 | ListItem() { | 98 | ListItem() { |
| 70 | CardParser({ contentDTO: item }) | 99 | CardParser({ contentDTO: item }) |
| 71 | }.width("100%") | 100 | }.width("100%") |
| @@ -74,25 +103,25 @@ export struct PeopleShipHomeArticleListComponent { | @@ -74,25 +103,25 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 74 | 103 | ||
| 75 | // 加载更多 | 104 | // 加载更多 |
| 76 | ListItem() { | 105 | ListItem() { |
| 77 | - if (!this.hasMore) { | 106 | + if (!this.hasMore && !this.isLoading) { |
| 78 | NoMoreLayout() | 107 | NoMoreLayout() |
| 79 | } | 108 | } |
| 80 | } | 109 | } |
| 81 | } | 110 | } |
| 82 | .width("100%") | 111 | .width("100%") |
| 83 | .height("100%") | 112 | .height("100%") |
| 84 | - .edgeEffect(EdgeEffect.Spring) | 113 | + .edgeEffect(EdgeEffect.None) |
| 85 | .nestedScroll({ | 114 | .nestedScroll({ |
| 86 | scrollForward: NestedScrollMode.PARENT_FIRST, | 115 | scrollForward: NestedScrollMode.PARENT_FIRST, |
| 87 | scrollBackward: NestedScrollMode.SELF_FIRST | 116 | scrollBackward: NestedScrollMode.SELF_FIRST |
| 88 | }) | 117 | }) |
| 89 | 118 | ||
| 90 | - .onReachEnd(() => { | ||
| 91 | - if(!this.isLoading && this.hasMore){ | ||
| 92 | - //加载分页数据 | ||
| 93 | - this.getPeopleShipPageArticleList() | ||
| 94 | - } | ||
| 95 | - }) | 119 | + // .onReachEnd(() => { |
| 120 | + // if(!this.isLoading && this.hasMore){ | ||
| 121 | + // //加载分页数据 | ||
| 122 | + // this.getPeopleShipPageArticleList() | ||
| 123 | + // } | ||
| 124 | + // }) | ||
| 96 | } | 125 | } |
| 97 | 126 | ||
| 98 | aboutToAppear() { | 127 | aboutToAppear() { |
| @@ -109,16 +138,28 @@ export struct PeopleShipHomeArticleListComponent { | @@ -109,16 +138,28 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 109 | } | 138 | } |
| 110 | } | 139 | } |
| 111 | 140 | ||
| 112 | - private async getPeopleShipPageArticleList() { | 141 | + |
| 142 | + private async getPeopleShipPageArticleList(resolve?: (value: string | PromiseLike<string>) => void) { | ||
| 113 | Logger.info(`获取页面信息PeopleShipHomeArticleListComponent${this.typeModel.type}`) | 143 | Logger.info(`获取页面信息PeopleShipHomeArticleListComponent${this.typeModel.type}`) |
| 114 | if (this.isLoading) { | 144 | if (this.isLoading) { |
| 145 | + if (resolve) { | ||
| 146 | + resolve('') | ||
| 147 | + } | ||
| 115 | return | 148 | return |
| 116 | } | 149 | } |
| 117 | try { | 150 | try { |
| 118 | this.isLoading = true | 151 | this.isLoading = true |
| 119 | let listData: ArticleListData = await PeopleShipHomePageDataModel.getPeopleShipHomePageArticleListData(this.creatorId, this.currentPage, 20, this.typeModel.type) | 152 | let listData: ArticleListData = await PeopleShipHomePageDataModel.getPeopleShipHomePageArticleListData(this.creatorId, this.currentPage, 20, this.typeModel.type) |
| 120 | Logger.debug(TAG, `获取页面信息, ${listData.list.length}`); | 153 | Logger.debug(TAG, `获取页面信息, ${listData.list.length}`); |
| 154 | + Logger.debug(TAG, `已更新值最新, ${this.currentPage}`); | ||
| 121 | 155 | ||
| 156 | + if (resolve ) { | ||
| 157 | + if (this.currentPage == 1) { | ||
| 158 | + resolve('已更新至最新') | ||
| 159 | + }else { | ||
| 160 | + resolve('') | ||
| 161 | + } | ||
| 162 | + } | ||
| 122 | if (listData && listData.list && listData.list.length > 0) { | 163 | if (listData && listData.list && listData.list.length > 0) { |
| 123 | this.viewType = 3; | 164 | this.viewType = 3; |
| 124 | if (listData.list.length === 20) { | 165 | if (listData.list.length === 20) { |
| @@ -130,15 +171,18 @@ export struct PeopleShipHomeArticleListComponent { | @@ -130,15 +171,18 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 130 | } else { | 171 | } else { |
| 131 | this.viewType = 1; | 172 | this.viewType = 1; |
| 132 | } | 173 | } |
| 174 | + this.isLoading = false | ||
| 133 | this.queryArticleContentInteractCount(listData) | 175 | this.queryArticleContentInteractCount(listData) |
| 134 | - Logger.debug(TAG, '展示的总数', `${this.arr.totalCount()}`) | 176 | + Logger.debug(TAG, '展示的总数', `${this.arr.length}`) |
| 135 | }catch (exception) { | 177 | }catch (exception) { |
| 178 | + if (resolve) { | ||
| 179 | + resolve('') | ||
| 180 | + } | ||
| 136 | this.isLoading = false | 181 | this.isLoading = false |
| 137 | - if (this.arr.totalCount() == 0) { | 182 | + if (this.arr.length == 0) { |
| 138 | this.viewType = 2 | 183 | this.viewType = 2 |
| 139 | } | 184 | } |
| 140 | } | 185 | } |
| 141 | - | ||
| 142 | } | 186 | } |
| 143 | 187 | ||
| 144 | /** | 188 | /** |
| @@ -15,13 +15,13 @@ export struct PeopleShipHomePageHeadComponent { | @@ -15,13 +15,13 @@ export struct PeopleShipHomePageHeadComponent { | ||
| 15 | .borderWidth('1vp') | 15 | .borderWidth('1vp') |
| 16 | .borderStyle(BorderStyle.Solid) | 16 | .borderStyle(BorderStyle.Solid) |
| 17 | .borderColor(Color.White) | 17 | .borderColor(Color.White) |
| 18 | - .objectFit(ImageFit.Auto) | 18 | + .objectFit(ImageFit.Cover) |
| 19 | if(this.authIcon.length > 0 ) { | 19 | if(this.authIcon.length > 0 ) { |
| 20 | Image( this.authIcon ) | 20 | Image( this.authIcon ) |
| 21 | .width(this.iconDiameter) | 21 | .width(this.iconDiameter) |
| 22 | .height(this.iconDiameter) | 22 | .height(this.iconDiameter) |
| 23 | .borderRadius(this.iconDiameter/2) | 23 | .borderRadius(this.iconDiameter/2) |
| 24 | - .objectFit(ImageFit.Auto) | 24 | + .objectFit(ImageFit.Cover) |
| 25 | .margin({ | 25 | .margin({ |
| 26 | right: '-3vp' | 26 | right: '-3vp' |
| 27 | }) | 27 | }) |
| @@ -10,7 +10,7 @@ export struct CustomPullToRefresh { | @@ -10,7 +10,7 @@ export struct CustomPullToRefresh { | ||
| 10 | onLoadMore: (resolve?: (value: string | PromiseLike<string>) => void) => void = () => { | 10 | onLoadMore: (resolve?: (value: string | PromiseLike<string>) => void) => void = () => { |
| 11 | } | 11 | } |
| 12 | ///是否存在上拉更多 | 12 | ///是否存在上拉更多 |
| 13 | - @State hasMore: boolean = true | 13 | + @Prop hasMore: boolean = true |
| 14 | refreshConfigurator: PullToRefreshConfigurator = new PullToRefreshConfigurator().setHasLoadMore(this.hasMore); | 14 | refreshConfigurator: PullToRefreshConfigurator = new PullToRefreshConfigurator().setHasLoadMore(this.hasMore); |
| 15 | build() { | 15 | build() { |
| 16 | Column(){ | 16 | Column(){ |
| 1 | +import { ToastUtils } from 'wdKit/Index' | ||
| 2 | +import { WDRouterRule, WDRouterPage } from 'wdRouter/Index' | ||
| 1 | import { SearchRmhDescription } from '../../viewmodel/SearchResultContentItem' | 3 | import { SearchRmhDescription } from '../../viewmodel/SearchResultContentItem' |
| 2 | 4 | ||
| 3 | @Component | 5 | @Component |
| @@ -21,5 +23,19 @@ export struct SearchCreatorComponent{ | @@ -21,5 +23,19 @@ export struct SearchCreatorComponent{ | ||
| 21 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 23 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 22 | }.alignItems(HorizontalAlign.Center) | 24 | }.alignItems(HorizontalAlign.Center) |
| 23 | .justifyContent(FlexAlign.Center) | 25 | .justifyContent(FlexAlign.Center) |
| 26 | + .onClick(()=>{ | ||
| 27 | + this.jumpCreatorHomePage() | ||
| 28 | + }) | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + jumpCreatorHomePage() { | ||
| 32 | + if(Number.parseInt(this.item.mainControl) === 0){ | ||
| 33 | + ToastUtils.shortToast("无法查看此用户主页") | ||
| 34 | + }else if(Number.parseInt(this.item.banControl) === 1){ | ||
| 35 | + ToastUtils.shortToast("该账号已封禁,不予访问") | ||
| 36 | + }else{ | ||
| 37 | + let params = {'creatorId': this.item.id} as Record<string, string>; | ||
| 38 | + WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params) | ||
| 39 | + } | ||
| 24 | } | 40 | } |
| 25 | } | 41 | } |
| @@ -72,6 +72,7 @@ export struct SearchResultContentComponent{ | @@ -72,6 +72,7 @@ export struct SearchResultContentComponent{ | ||
| 72 | value.forEach((item)=>{ | 72 | value.forEach((item)=>{ |
| 73 | if(data.creatorId == item.creatorId){ | 73 | if(data.creatorId == item.creatorId){ |
| 74 | data.headerPhotoUrl = item.headPhotoUrl.split("?")[0] | 74 | data.headerPhotoUrl = item.headPhotoUrl.split("?")[0] |
| 75 | + data.mainControl = item.mainControl+"" | ||
| 75 | } | 76 | } |
| 76 | }) | 77 | }) |
| 77 | }) | 78 | }) |
| 1 | import { BottomNavi, CommonConstants, SpConstants } from 'wdConstant'; | 1 | import { BottomNavi, CommonConstants, SpConstants } from 'wdConstant'; |
| 2 | -import { Logger, SPHelper } from 'wdKit'; | 2 | +import { Logger, SPHelper, StringUtils } from 'wdKit'; |
| 3 | import PageViewModel from '../../viewmodel/PageViewModel'; | 3 | import PageViewModel from '../../viewmodel/PageViewModel'; |
| 4 | import storageStatistics from "@ohos.file.storageStatistics"; | 4 | import storageStatistics from "@ohos.file.storageStatistics"; |
| 5 | import { BusinessError } from '@ohos.base'; | 5 | import { BusinessError } from '@ohos.base'; |
| @@ -12,7 +12,7 @@ import { CustomCacheDialog } from './CustomCacheDialog'; | @@ -12,7 +12,7 @@ import { CustomCacheDialog } from './CustomCacheDialog'; | ||
| 12 | import MineSettingDatasModel from '../../model/MineSettingDatasModel'; | 12 | import MineSettingDatasModel from '../../model/MineSettingDatasModel'; |
| 13 | import { MineMainSettingFunctionItem } from '../../viewmodel/MineMainSettingFunctionItem'; | 13 | import { MineMainSettingFunctionItem } from '../../viewmodel/MineMainSettingFunctionItem'; |
| 14 | import common from '@ohos.app.ability.common'; | 14 | import common from '@ohos.app.ability.common'; |
| 15 | - | 15 | +import dataPreferences from '@ohos.data.preferences'; |
| 16 | 16 | ||
| 17 | @Component | 17 | @Component |
| 18 | export struct MineSettingComponent { | 18 | export struct MineSettingComponent { |
| @@ -21,6 +21,7 @@ export struct MineSettingComponent { | @@ -21,6 +21,7 @@ export struct MineSettingComponent { | ||
| 21 | @State privacySwitch: boolean = false | 21 | @State privacySwitch: boolean = false |
| 22 | @State cacheSize: number = 0 | 22 | @State cacheSize: number = 0 |
| 23 | @State accountState:boolean=false | 23 | @State accountState:boolean=false |
| 24 | + preferences: dataPreferences.Preferences | null = null; | ||
| 24 | dialogController: CustomDialogController = new CustomDialogController({ | 25 | dialogController: CustomDialogController = new CustomDialogController({ |
| 25 | builder: CustomCacheDialog({ | 26 | builder: CustomCacheDialog({ |
| 26 | cancel: () => { | 27 | cancel: () => { |
| @@ -41,6 +42,8 @@ export struct MineSettingComponent { | @@ -41,6 +42,8 @@ export struct MineSettingComponent { | ||
| 41 | 42 | ||
| 42 | this.getAccountState() | 43 | this.getAccountState() |
| 43 | 44 | ||
| 45 | + this.addLoginStatusObserver() | ||
| 46 | + | ||
| 44 | } | 47 | } |
| 45 | 48 | ||
| 46 | async getAccountState(){ | 49 | async getAccountState(){ |
| @@ -304,4 +307,14 @@ export struct MineSettingComponent { | @@ -304,4 +307,14 @@ export struct MineSettingComponent { | ||
| 304 | } | 307 | } |
| 305 | }); | 308 | }); |
| 306 | } | 309 | } |
| 310 | + | ||
| 311 | + async addLoginStatusObserver(){ | ||
| 312 | + this.preferences = await SPHelper.default.getPreferences(); | ||
| 313 | + let observer = (key: string) => { | ||
| 314 | + if(key == SpConstants.USER_ID){ | ||
| 315 | + this.getSettingPageData() | ||
| 316 | + } | ||
| 317 | + } | ||
| 318 | + this.preferences.on('change', observer); | ||
| 319 | + } | ||
| 307 | } | 320 | } |
| @@ -108,7 +108,9 @@ export struct EmptyComponent { | @@ -108,7 +108,9 @@ export struct EmptyComponent { | ||
| 108 | let contentString: string = '暂无内容' | 108 | let contentString: string = '暂无内容' |
| 109 | if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCollection) { | 109 | if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCollection) { |
| 110 | contentString = '暂无收藏' | 110 | contentString = '暂无收藏' |
| 111 | - } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoMessage) { | 111 | + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoHistory) { |
| 112 | + contentString = '暂无浏览历史' | ||
| 113 | + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoMessage) { | ||
| 112 | contentString = '暂无消息' | 114 | contentString = '暂无消息' |
| 113 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoComment) { | 115 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoComment) { |
| 114 | contentString = '暂无评论' | 116 | contentString = '暂无评论' |
| @@ -140,7 +142,7 @@ export struct EmptyComponent { | @@ -140,7 +142,7 @@ export struct EmptyComponent { | ||
| 140 | buildNoDataTipImage(): Resource | string { | 142 | buildNoDataTipImage(): Resource | string { |
| 141 | Logger.info(TAG, "buildNoDataTip"); | 143 | Logger.info(TAG, "buildNoDataTip"); |
| 142 | let imageString: Resource | string = $r('app.media.icon_no_content') | 144 | let imageString: Resource | string = $r('app.media.icon_no_content') |
| 143 | - if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCollection) { | 145 | + if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCollection||this.emptyType === WDViewDefaultType.WDViewDefaultType_NoHistory) { |
| 144 | imageString = $r('app.media.icon_no_collection') | 146 | imageString = $r('app.media.icon_no_collection') |
| 145 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoMessage) { | 147 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoMessage) { |
| 146 | imageString = $r('app.media.icon_no_message') | 148 | imageString = $r('app.media.icon_no_message') |
| 1 | +import { Logger } from 'wdKit/Index' | ||
| 2 | +import { LikeViewModel } from '../../viewmodel/LikeViewModel' | ||
| 3 | + | ||
| 4 | +@Component | ||
| 5 | +export struct LikeComponent { | ||
| 6 | + @State likeStatus: boolean = false | ||
| 7 | + viewModel: LikeViewModel = new LikeViewModel() | ||
| 8 | + @Prop data: Record<string, string> | ||
| 9 | + enableBtn = true | ||
| 10 | + | ||
| 11 | + //上层传值 样例 | ||
| 12 | + // this.data['contentId'] = '30035444649' //必须 | ||
| 13 | + // this.data['userName'] = '人民日报网友2kD2xW' | ||
| 14 | + // this.data['contentType'] = '8' //必须 | ||
| 15 | + // this.data['title'] = '开创两校交流先河!克罗地亚教育代表团访问同济大学' | ||
| 16 | + // this.data['userHeaderUrl'] = "" | ||
| 17 | + // this.data['channelId'] = "2059" //必须 | ||
| 18 | + // this.data['status'] = "1" //必须 | ||
| 19 | + | ||
| 20 | + aboutToAppear(): void { | ||
| 21 | + if (this.data) { | ||
| 22 | + Logger.debug("ddd: " + this.data['status']) | ||
| 23 | + if (this.data['status'] == '1') { | ||
| 24 | + this.likeStatus = true | ||
| 25 | + } else { | ||
| 26 | + this.likeStatus = false | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + build() { | ||
| 34 | + Column() { | ||
| 35 | + Image(this.likeStatus ? $r('app.media.icon_like_select') : $r('app.media.icon_like_default')) | ||
| 36 | + .width(24) | ||
| 37 | + .height(24) | ||
| 38 | + .onClick(() => { | ||
| 39 | + if (!this.enableBtn) { | ||
| 40 | + return | ||
| 41 | + } | ||
| 42 | + if (this.likeStatus) { | ||
| 43 | + //1 | ||
| 44 | + this.executeLike('1') | ||
| 45 | + } else { | ||
| 46 | + //0 | ||
| 47 | + this.executeLike('0') | ||
| 48 | + } | ||
| 49 | + }) | ||
| 50 | + }.width(24).height(24) | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + executeLike(status: string) { | ||
| 54 | + this.data['status'] = status | ||
| 55 | + this.viewModel.executeLike2(this.data).then(() => { | ||
| 56 | + this.likeStatus = !this.likeStatus | ||
| 57 | + this.enableBtn = true | ||
| 58 | + }).catch(() => { | ||
| 59 | + this.enableBtn = true | ||
| 60 | + }) | ||
| 61 | + } | ||
| 62 | +} |
| @@ -33,6 +33,7 @@ export struct SecondLevelComponent { | @@ -33,6 +33,7 @@ export struct SecondLevelComponent { | ||
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | onFirstChange(){ | 35 | onFirstChange(){ |
| 36 | + this.select = 0 | ||
| 36 | if (!this.currentFirst) { | 37 | if (!this.currentFirst) { |
| 37 | this.mTip = '暂无数据'; | 38 | this.mTip = '暂无数据'; |
| 38 | } else { | 39 | } else { |
| @@ -34,10 +34,11 @@ export struct ThirdLevelComponent { | @@ -34,10 +34,11 @@ export struct ThirdLevelComponent { | ||
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | onFirstChange(){ | 36 | onFirstChange(){ |
| 37 | - | 37 | + this.select = 0 |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | onSecondChange(){ | 40 | onSecondChange(){ |
| 41 | + this.select = 0 | ||
| 41 | if (!this.currentSecondBean) { | 42 | if (!this.currentSecondBean) { |
| 42 | this.mTip = '暂无数据'; | 43 | this.mTip = '暂无数据'; |
| 43 | } else { | 44 | } else { |
| @@ -12,7 +12,7 @@ export struct ENewspaperListDialog { | @@ -12,7 +12,7 @@ export struct ENewspaperListDialog { | ||
| 12 | @Consume @Watch('onCurrentPageNumUpdated') currentPageNum: string | 12 | @Consume @Watch('onCurrentPageNumUpdated') currentPageNum: string |
| 13 | @State pageDialogShow: boolean = false | 13 | @State pageDialogShow: boolean = false |
| 14 | @State scrollIndex: number = 0 | 14 | @State scrollIndex: number = 0 |
| 15 | - newspaperListBean: NewspaperListBean = {} as NewspaperListBean | 15 | + @Prop newspaperListBean: NewspaperListBean = {} as NewspaperListBean |
| 16 | private listScroller: Scroller = new Scroller(); | 16 | private listScroller: Scroller = new Scroller(); |
| 17 | //文字版选择弹框 | 17 | //文字版选择弹框 |
| 18 | pageListDialogController: CustomDialogController = new CustomDialogController({ | 18 | pageListDialogController: CustomDialogController = new CustomDialogController({ |
| @@ -21,13 +21,14 @@ export struct ENewspaperListDialog { | @@ -21,13 +21,14 @@ export struct ENewspaperListDialog { | ||
| 21 | newspaperListBean: this.newspaperListBean, | 21 | newspaperListBean: this.newspaperListBean, |
| 22 | }), | 22 | }), |
| 23 | alignment: DialogAlignment.TopStart, | 23 | alignment: DialogAlignment.TopStart, |
| 24 | - offset: { dx: 0, dy: 214 }, | 24 | + offset: { dx: 0, dy: 224 }, |
| 25 | customStyle: true, | 25 | customStyle: true, |
| 26 | }) | 26 | }) |
| 27 | //页面半屏弹窗(实现在上个组件)若尝试在CustomDialog中传入多个其他的Controller, | 27 | //页面半屏弹窗(实现在上个组件)若尝试在CustomDialog中传入多个其他的Controller, |
| 28 | // 以实现在CustomDialog中打开另一个或另一些CustomDialog, | 28 | // 以实现在CustomDialog中打开另一个或另一些CustomDialog, |
| 29 | // 那么此处需要将指向自己的controller放在所有controller的后面 | 29 | // 那么此处需要将指向自己的controller放在所有controller的后面 |
| 30 | - listDialogController: CustomDialogController | 30 | + // listDialogController: CustomDialogController |
| 31 | + public closeDialog?: () => void | ||
| 31 | 32 | ||
| 32 | //watch监听报纸页码回调 | 33 | //watch监听报纸页码回调 |
| 33 | onCurrentPageNumUpdated(): void { | 34 | onCurrentPageNumUpdated(): void { |
| @@ -53,147 +54,168 @@ export struct ENewspaperListDialog { | @@ -53,147 +54,168 @@ export struct ENewspaperListDialog { | ||
| 53 | } | 54 | } |
| 54 | 55 | ||
| 55 | build() { | 56 | build() { |
| 56 | - Column() { | ||
| 57 | - Row() | ||
| 58 | - .width(43) | ||
| 59 | - .height(4) | ||
| 60 | - .backgroundColor('#EDEDED') | ||
| 61 | - .margin({ | ||
| 62 | - top: 10, | ||
| 63 | - bottom: 10 | ||
| 64 | - }) | ||
| 65 | - Row() { | ||
| 66 | - Text(this.currentPageNum) | ||
| 67 | - .fontSize($r('app.float.font_size_36')) | ||
| 68 | - .fontColor($r('app.color.color_222222')) | ||
| 69 | - .fontFamily('BebasNeue_Regular') | ||
| 70 | - Text('版') | ||
| 71 | - .fontSize($r('app.float.font_size_16')) | ||
| 72 | - .fontColor($r('app.color.color_222222')) | ||
| 73 | - .margin({ bottom: 6 }) | ||
| 74 | - | ||
| 75 | - Image($r('app.media.icon_triangle_black')) | ||
| 76 | - .width($r('app.float.border_radius_6')) | ||
| 77 | - .height($r('app.float.border_radius_6')) | ||
| 78 | - .margin({ left: 2, bottom: 6 }) | ||
| 79 | - } | ||
| 80 | - .alignItems(VerticalAlign.Bottom) | ||
| 81 | - .margin({ left: 15 }) | ||
| 82 | - .alignSelf(ItemAlign.Start) | ||
| 83 | - .onClick(() => { | ||
| 84 | - this.pageDialogShow = !this.pageDialogShow | ||
| 85 | - if (this.pageDialogShow) { | ||
| 86 | - this.pageListDialogController.open() | ||
| 87 | - } else { | ||
| 88 | - this.pageListDialogController.close() | 57 | + Stack() { |
| 58 | + Column() { | ||
| 59 | + Row() | ||
| 60 | + .width(43) | ||
| 61 | + .height(4) | ||
| 62 | + .backgroundColor('#EDEDED') | ||
| 63 | + .margin({ | ||
| 64 | + top: 10, | ||
| 65 | + bottom: 10 | ||
| 66 | + }) | ||
| 67 | + .onClick(() => { | ||
| 68 | + if (this.closeDialog) { | ||
| 69 | + this.closeDialog() | ||
| 70 | + } | ||
| 71 | + }) | ||
| 72 | + Row() { | ||
| 73 | + Text(this.currentPageNum) | ||
| 74 | + .fontSize($r('app.float.font_size_36')) | ||
| 75 | + .fontColor($r('app.color.color_222222')) | ||
| 76 | + .fontFamily('BebasNeue_Regular') | ||
| 77 | + Text('版') | ||
| 78 | + .fontSize($r('app.float.font_size_16')) | ||
| 79 | + .fontColor($r('app.color.color_222222')) | ||
| 80 | + .margin({ bottom: 6 }) | ||
| 81 | + | ||
| 82 | + Image($r('app.media.icon_triangle_black')) | ||
| 83 | + .width($r('app.float.border_radius_6')) | ||
| 84 | + .height($r('app.float.border_radius_6')) | ||
| 85 | + .margin({ left: 2, bottom: 6 }) | ||
| 89 | } | 86 | } |
| 90 | - }) | ||
| 91 | - | ||
| 92 | - Image($r('app.media.line')) | ||
| 93 | - .width('100%') | ||
| 94 | - .height(6) | ||
| 95 | - .margin({ top: 20, left: 16, right: 16 }) | ||
| 96 | - .objectFit(ImageFit.Contain) | ||
| 97 | - | ||
| 98 | - List({ scroller: this.listScroller, initialIndex: this.scrollIndex }) { | ||
| 99 | - ForEach(this.newspaperListBean?.list, (item: NewspaperListItemBean, index: number) => { | ||
| 100 | - ListItem() { | ||
| 101 | - List() { | ||
| 102 | - ForEach(item.items, (positionItem: NewspaperPositionItemBean, itemIndex: number) => { | ||
| 103 | - ListItem() { | ||
| 104 | - Column() { | ||
| 105 | - if (itemIndex == 0) { | ||
| 106 | - Text(item.pageNum + item.pageName) | ||
| 107 | - .fontSize($r('app.float.font_size_14')) | ||
| 108 | - .fontColor($r('app.color.color_ED2800')) | ||
| 109 | - .fontWeight(600) | ||
| 110 | - .margin({ top: 16, bottom: 16 }) | ||
| 111 | - .maxLines(1) | ||
| 112 | - } | ||
| 113 | - | ||
| 114 | - if (positionItem.shortTitle) { | ||
| 115 | - Text(positionItem.shortTitle) | ||
| 116 | - .fontSize($r('app.float.font_size_14')) | ||
| 117 | - .fontColor($r('app.color.color_222222')) | ||
| 118 | - .fontWeight(600) | ||
| 119 | - .maxLines(2) | ||
| 120 | - } | ||
| 121 | - | ||
| 122 | - if (positionItem.title) { | ||
| 123 | - Text(positionItem.title) | ||
| 124 | - .fontSize($r('app.float.font_size_17')) | ||
| 125 | - .fontColor($r('app.color.color_222222')) | ||
| 126 | - .margin({ top: 8 }) | ||
| 127 | - .maxLines(2) | ||
| 128 | - } | ||
| 129 | - | ||
| 130 | - if (positionItem.downTitle) { | ||
| 131 | - Text(positionItem.downTitle) | ||
| 132 | - .fontSize($r('app.float.font_size_14')) | ||
| 133 | - .fontColor($r('app.color.color_222222')) | ||
| 134 | - .fontWeight(600) | ||
| 135 | - .margin({ top: 8 }) | ||
| 136 | - .maxLines(2) | ||
| 137 | - } | 87 | + .alignItems(VerticalAlign.Bottom) |
| 88 | + .margin({ left: 15 }) | ||
| 89 | + .alignSelf(ItemAlign.Start) | ||
| 90 | + .onClick(() => { | ||
| 91 | + this.pageDialogShow = !this.pageDialogShow | ||
| 92 | + if (this.pageDialogShow) { | ||
| 93 | + this.pageListDialogController.open() | ||
| 94 | + } else { | ||
| 95 | + this.pageListDialogController.close() | ||
| 96 | + } | ||
| 97 | + }) | ||
| 138 | 98 | ||
| 139 | - if (positionItem.newsTxt) { | ||
| 140 | - Text(positionItem.newsTxt) | ||
| 141 | - .fontSize($r('app.float.font_size_14')) | ||
| 142 | - .fontColor($r('app.color.color_999999')) | ||
| 143 | - .margin({ top: 15, bottom: 15 }) | ||
| 144 | - .maxLines(5) | 99 | + Image($r('app.media.line')) |
| 100 | + .width('100%') | ||
| 101 | + .height(6) | ||
| 102 | + .margin({ top: 20, left: 16, right: 16 }) | ||
| 103 | + .objectFit(ImageFit.Contain) | ||
| 104 | + | ||
| 105 | + List({ scroller: this.listScroller, initialIndex: this.scrollIndex }) { | ||
| 106 | + ForEach(this.newspaperListBean?.list, (item: NewspaperListItemBean, index: number) => { | ||
| 107 | + ListItem() { | ||
| 108 | + List() { | ||
| 109 | + ForEach(item.items, (positionItem: NewspaperPositionItemBean, itemIndex: number) => { | ||
| 110 | + ListItem() { | ||
| 111 | + Column() { | ||
| 112 | + if (itemIndex == 0) { | ||
| 113 | + Text(item.pageNum + item.pageName) | ||
| 114 | + .fontSize($r('app.float.font_size_14')) | ||
| 115 | + .fontColor($r('app.color.color_ED2800')) | ||
| 116 | + .fontWeight(600) | ||
| 117 | + .margin({ top: 16, bottom: 16 }) | ||
| 118 | + .maxLines(1) | ||
| 119 | + } | ||
| 120 | + | ||
| 121 | + if (positionItem.shortTitle) { | ||
| 122 | + Text(positionItem.shortTitle) | ||
| 123 | + .fontSize($r('app.float.font_size_14')) | ||
| 124 | + .fontColor($r('app.color.color_222222')) | ||
| 125 | + .fontWeight(600) | ||
| 126 | + .maxLines(2) | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + if (positionItem.title) { | ||
| 130 | + Text(positionItem.title) | ||
| 131 | + .fontSize($r('app.float.font_size_17')) | ||
| 132 | + .fontColor($r('app.color.color_222222')) | ||
| 133 | + .margin({ top: 8 }) | ||
| 134 | + .maxLines(2) | ||
| 135 | + } | ||
| 136 | + | ||
| 137 | + if (positionItem.downTitle) { | ||
| 138 | + Text(positionItem.downTitle) | ||
| 139 | + .fontSize($r('app.float.font_size_14')) | ||
| 140 | + .fontColor($r('app.color.color_222222')) | ||
| 141 | + .fontWeight(600) | ||
| 142 | + .margin({ top: 8 }) | ||
| 143 | + .maxLines(2) | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + if (positionItem.newsTxt) { | ||
| 147 | + Text(positionItem.newsTxt) | ||
| 148 | + .fontSize($r('app.float.font_size_14')) | ||
| 149 | + .fontColor($r('app.color.color_999999')) | ||
| 150 | + .margin({ top: 15, bottom: 15 }) | ||
| 151 | + .maxLines(5) | ||
| 152 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 153 | + } | ||
| 145 | } | 154 | } |
| 155 | + .alignItems(HorizontalAlign.Start) | ||
| 156 | + .onClick(() => { | ||
| 157 | + let taskAction: Action = { | ||
| 158 | + type: 'JUMP_INNER_NEW_PAGE', | ||
| 159 | + params: { | ||
| 160 | + contentID: '' + positionItem.newsId, | ||
| 161 | + pageID: 'IMAGE_TEXT_DETAIL', | ||
| 162 | + extra: { | ||
| 163 | + relType: positionItem.relType ?? '', | ||
| 164 | + relId: '' + positionItem.relId, | ||
| 165 | + sourcePage: '5' | ||
| 166 | + } as ExtraDTO | ||
| 167 | + } as Params, | ||
| 168 | + }; | ||
| 169 | + WDRouterRule.jumpWithAction(taskAction) | ||
| 170 | + // if (this.listDialogController) { | ||
| 171 | + // this.listDialogController.close() | ||
| 172 | + // } | ||
| 173 | + }) | ||
| 146 | } | 174 | } |
| 147 | - .alignItems(HorizontalAlign.Start) | ||
| 148 | - .onClick(() => { | ||
| 149 | - let taskAction: Action = { | ||
| 150 | - type: 'JUMP_INNER_NEW_PAGE', | ||
| 151 | - params: { | ||
| 152 | - contentID: '' + positionItem.newsId, | ||
| 153 | - pageID: 'IMAGE_TEXT_DETAIL', | ||
| 154 | - extra: { | ||
| 155 | - relType: positionItem.relType ?? '', | ||
| 156 | - relId: '' + positionItem.relId, | ||
| 157 | - sourcePage: '5' | ||
| 158 | - } as ExtraDTO | ||
| 159 | - } as Params, | ||
| 160 | - }; | ||
| 161 | - WDRouterRule.jumpWithAction(taskAction) | ||
| 162 | - if (this.listDialogController) { | ||
| 163 | - this.listDialogController.close() | ||
| 164 | - } | ||
| 165 | - }) | ||
| 166 | - } | ||
| 167 | 175 | ||
| 168 | - }) | 176 | + }) |
| 177 | + } | ||
| 169 | } | 178 | } |
| 170 | - } | 179 | + }) |
| 180 | + } | ||
| 181 | + .width('100%') | ||
| 182 | + .padding({ left: 15, right: 15 }) | ||
| 183 | + .margin({ | ||
| 184 | + bottom: 85 | ||
| 185 | + }) | ||
| 186 | + .scrollBar(BarState.Off) | ||
| 187 | + .divider({ | ||
| 188 | + strokeWidth: 0.5, | ||
| 189 | + color: '#EDEDED' | ||
| 190 | + }) | ||
| 191 | + .onScrollIndex((firstIndex: number) => { | ||
| 192 | + console.log('firstIndex', firstIndex) | ||
| 193 | + }) | ||
| 194 | + .onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => { | ||
| 195 | + console.info('first' + firstIndex) | ||
| 196 | + console.info('last' + lastIndex) | ||
| 197 | + console.info('center' + centerIndex) | ||
| 198 | + // this.updateCurrentPageNum(firstIndex) | ||
| 199 | + this.currentPageNum = `${centerIndex < 9 ? '0' + (centerIndex + 1) : centerIndex + 1}` | ||
| 200 | + }) | ||
| 201 | + .onScroll((scrollOffset: number, scrollState: ScrollState) => { | ||
| 202 | + console.info(`onScroll scrollState = ScrollState` + scrollState + `, scrollOffset = ` + scrollOffset) | ||
| 171 | }) | 203 | }) |
| 172 | } | 204 | } |
| 205 | + .margin({ top: 124 }) | ||
| 173 | .width('100%') | 206 | .width('100%') |
| 174 | - .padding({ left: 15, right: 15 }) | ||
| 175 | - .scrollBar(BarState.Off) | ||
| 176 | - .divider({ | ||
| 177 | - strokeWidth: 0.5, | ||
| 178 | - color: '#EDEDED' | ||
| 179 | - }) | ||
| 180 | - .onScrollIndex((firstIndex: number) => { | ||
| 181 | - console.log('firstIndex', firstIndex) | ||
| 182 | - }) | ||
| 183 | - .onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => { | ||
| 184 | - console.info('first' + firstIndex) | ||
| 185 | - console.info('last' + lastIndex) | ||
| 186 | - console.info('center' + centerIndex) | ||
| 187 | - // this.updateCurrentPageNum(firstIndex) | ||
| 188 | - this.currentPageNum = `${centerIndex < 9 ? '0' + (centerIndex + 1) : centerIndex + 1}` | ||
| 189 | - }) | ||
| 190 | - .onScroll((scrollOffset: number, scrollState: ScrollState) => { | ||
| 191 | - console.info(`onScroll scrollState = ScrollState` + scrollState + `, scrollOffset = ` + scrollOffset) | ||
| 192 | - }) | ||
| 193 | - } | ||
| 194 | - .width('100%') | ||
| 195 | - .backgroundColor(Color.White) | 207 | + .backgroundColor(Color.White) |
| 208 | + .onClick(() => { | ||
| 196 | 209 | ||
| 210 | + }) | ||
| 211 | + }.width('100%') | ||
| 212 | + .height('100%') | ||
| 213 | + .backgroundColor('#80000000') | ||
| 214 | + .onClick(() => { | ||
| 215 | + if (this.closeDialog) { | ||
| 216 | + this.closeDialog() | ||
| 217 | + } | ||
| 218 | + }) | ||
| 197 | } | 219 | } |
| 198 | 220 | ||
| 199 | updateCurrentPageNum(firstIndex: number): void { | 221 | updateCurrentPageNum(firstIndex: number): void { |
| 1 | +import { HashMap } from '@kit.ArkTS'; | ||
| 2 | +import { Logger } from 'wdKit/Index'; | ||
| 3 | +import { HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index'; | ||
| 4 | +import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; | ||
| 5 | + | ||
| 6 | +export class LikeModel { | ||
| 7 | + executeLike(data: Record<string, string>) { | ||
| 8 | + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | ||
| 9 | + | ||
| 10 | + return new Promise<object>((success, fail) => { | ||
| 11 | + HttpRequest.post<ResponseDTO<object>>(HttpUrlUtils.executeLike(), data, headers).then((data: ResponseDTO<object>) => { | ||
| 12 | + if (data.code != 0) { | ||
| 13 | + fail(data.message) | ||
| 14 | + return | ||
| 15 | + } | ||
| 16 | + success(data) | ||
| 17 | + }, (error: Error) => { | ||
| 18 | + fail(error.message) | ||
| 19 | + Logger.debug("LoginViewModel:error ", error.toString()) | ||
| 20 | + }) | ||
| 21 | + }) | ||
| 22 | + } | ||
| 23 | +} |
| @@ -40,8 +40,9 @@ struct SearchCreatorPage { | @@ -40,8 +40,9 @@ struct SearchCreatorPage { | ||
| 40 | this.hasMore = false | 40 | this.hasMore = false |
| 41 | this.isLoading = false | 41 | this.isLoading = false |
| 42 | }else{ | 42 | }else{ |
| 43 | + this.data_temp = [] | ||
| 43 | result.list.forEach((data)=>{ | 44 | result.list.forEach((data)=>{ |
| 44 | - this.data_temp.push(new FollowListDetailItem("",data.data.creatorName,"0","",data.data.id,"0",data.data.userId,data.data.userType,data.data.userId)) | 45 | + this.data_temp.push(new FollowListDetailItem("",data.data.creatorName,"0","",data.data.id,"0",data.data.userId,data.data.userType,data.data.userId,Number.parseInt(data.data.mainControl),-1)) |
| 45 | }) | 46 | }) |
| 46 | 47 | ||
| 47 | let request = new CreatorDetailRequestItem() | 48 | let request = new CreatorDetailRequestItem() |
| @@ -69,6 +70,8 @@ struct SearchCreatorPage { | @@ -69,6 +70,8 @@ struct SearchCreatorPage { | ||
| 69 | data.cnFansNum = item.fansNum + "" | 70 | data.cnFansNum = item.fansNum + "" |
| 70 | } | 71 | } |
| 71 | data.introduction = item.introduction | 72 | data.introduction = item.introduction |
| 73 | + data.mainControl = item.mainControl | ||
| 74 | + data.banControl = item.banControl | ||
| 72 | } | 75 | } |
| 73 | }) | 76 | }) |
| 74 | }) | 77 | }) |
| @@ -104,7 +107,7 @@ struct SearchCreatorPage { | @@ -104,7 +107,7 @@ struct SearchCreatorPage { | ||
| 104 | }) | 107 | }) |
| 105 | 108 | ||
| 106 | this.data_temp.forEach((item)=>{ | 109 | this.data_temp.forEach((item)=>{ |
| 107 | - this.data.push(new FollowListDetailItem(item.headPhotoUrl,item.cnUserName,item.cnFansNum,item.introduction,item.creatorId,item.status,item.attentionUserId,item.cnUserType,item.cnUserId)) | 110 | + this.data.push(new FollowListDetailItem(item.headPhotoUrl,item.cnUserName,item.cnFansNum,item.introduction,item.creatorId,item.status,item.attentionUserId,item.cnUserType,item.cnUserId,item.mainControl,item.banControl)) |
| 108 | }) | 111 | }) |
| 109 | 112 | ||
| 110 | this.data.notifyDataReload() | 113 | this.data.notifyDataReload() |
| @@ -44,7 +44,7 @@ class EditInfoViewModel { | @@ -44,7 +44,7 @@ class EditInfoViewModel { | ||
| 44 | new EditListInfo('简介',item&&item.userExtend.introduction?item.userExtend.introduction:'待完善'), | 44 | new EditListInfo('简介',item&&item.userExtend.introduction?item.userExtend.introduction:'待完善'), |
| 45 | new EditListInfo('地区',item&&item.userExtend.address?item.userExtend.address:'待完善'), | 45 | new EditListInfo('地区',item&&item.userExtend.address?item.userExtend.address:'待完善'), |
| 46 | new EditListInfo('生日',item&&item.userExtend.birthday?item.userExtend.birthday:'待完善'), | 46 | new EditListInfo('生日',item&&item.userExtend.birthday?item.userExtend.birthday:'待完善'), |
| 47 | - new EditListInfo('性别',item?(item.userExtend.sex === 1?'男':'女'):'待完善'),] | 47 | + new EditListInfo('性别',item?(item.userExtend.sex === 10?'待完善':(item.userExtend.sex === 1?'男':'女')):'待完善'),] |
| 48 | return this.editListData | 48 | return this.editListData |
| 49 | } | 49 | } |
| 50 | 50 | ||
| @@ -129,6 +129,7 @@ class EditInfoViewModel { | @@ -129,6 +129,7 @@ class EditInfoViewModel { | ||
| 129 | .then((navResDTO: ResponseDTO) => { | 129 | .then((navResDTO: ResponseDTO) => { |
| 130 | if (navResDTO.code == 0) { | 130 | if (navResDTO.code == 0) { |
| 131 | promptAction.showToast({ message: '修改成功' }) | 131 | promptAction.showToast({ message: '修改成功' }) |
| 132 | + success(navResDTO) | ||
| 132 | }else { | 133 | }else { |
| 133 | promptAction.showToast({ message: navResDTO.message }) | 134 | promptAction.showToast({ message: navResDTO.message }) |
| 134 | } | 135 | } |
| @@ -71,16 +71,20 @@ export class FollowListDetailItem{ | @@ -71,16 +71,20 @@ export class FollowListDetailItem{ | ||
| 71 | 71 | ||
| 72 | cnUserType:string = "" | 72 | cnUserType:string = "" |
| 73 | cnUserId:string = "" | 73 | cnUserId:string = "" |
| 74 | + mainControl:number = 0 | ||
| 74 | 75 | ||
| 76 | + cnMainControl:number = 0 | ||
| 75 | attentionCreatorId:string = "" | 77 | attentionCreatorId:string = "" |
| 76 | attentionUserType:string = "" | 78 | attentionUserType:string = "" |
| 77 | 79 | ||
| 78 | attentionHeadPhotoUrl:string = "" | 80 | attentionHeadPhotoUrl:string = "" |
| 79 | attentionUserName:string = "" | 81 | attentionUserName:string = "" |
| 80 | fansNum :number = 0 | 82 | fansNum :number = 0 |
| 83 | + banControl:number = -1 | ||
| 81 | 84 | ||
| 82 | 85 | ||
| 83 | - constructor(headPhotoUrl:string,cnUserName:string,cnFansNum:string,introduction:string,creatorId:string,status:string,attentionUserId:string,cnUserType:string,cnUserId:string) { | 86 | + |
| 87 | + constructor(headPhotoUrl:string,cnUserName:string,cnFansNum:string,introduction:string,creatorId:string,status:string,attentionUserId:string,cnUserType:string,cnUserId:string,mainControl:number,banControl:number) { | ||
| 84 | this.headPhotoUrl = headPhotoUrl | 88 | this.headPhotoUrl = headPhotoUrl |
| 85 | this.cnUserName = cnUserName | 89 | this.cnUserName = cnUserName |
| 86 | this.cnFansNum = cnFansNum | 90 | this.cnFansNum = cnFansNum |
| @@ -90,5 +94,7 @@ export class FollowListDetailItem{ | @@ -90,5 +94,7 @@ export class FollowListDetailItem{ | ||
| 90 | this.attentionUserId = attentionUserId | 94 | this.attentionUserId = attentionUserId |
| 91 | this.cnUserType = cnUserType | 95 | this.cnUserType = cnUserType |
| 92 | this.cnUserId = cnUserId | 96 | this.cnUserId = cnUserId |
| 97 | + this.mainControl = mainControl | ||
| 98 | + this.banControl = banControl | ||
| 93 | } | 99 | } |
| 94 | } | 100 | } |
| 1 | +import { LikeModel } from '../model/LikeModel' | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * 点赞*/ | ||
| 5 | +export class LikeViewModel { | ||
| 6 | + likeModel: LikeModel | ||
| 7 | + | ||
| 8 | + constructor() { | ||
| 9 | + this.likeModel = new LikeModel(); | ||
| 10 | + } | ||
| 11 | + | ||
| 12 | + executeLike(contentId: string, userName: string, contentType: string, title: string, userHeaderUrl: string, channelId: string, status: string) { | ||
| 13 | + let bean: Record<string, string> = {} | ||
| 14 | + bean['contentId'] = contentId | ||
| 15 | + bean['userName'] = userName | ||
| 16 | + bean['contentType'] = contentType | ||
| 17 | + bean['title'] = title | ||
| 18 | + bean['userHeaderUrl'] = userHeaderUrl | ||
| 19 | + bean['channelId'] = channelId | ||
| 20 | + bean['status'] = status | ||
| 21 | + this.likeModel.executeLike(bean) | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + executeLike2(bean: Record<string, string>) { | ||
| 25 | + | ||
| 26 | + return new Promise<object>((success, fail) => { | ||
| 27 | + this.likeModel.executeLike(bean).then((data) => { | ||
| 28 | + success(data) | ||
| 29 | + }).catch((error: string) => { | ||
| 30 | + fail(error) | ||
| 31 | + }) | ||
| 32 | + }) | ||
| 33 | + | ||
| 34 | + } | ||
| 35 | +} |
1.15 KB
581 Bytes
| @@ -6,6 +6,7 @@ | @@ -6,6 +6,7 @@ | ||
| 6 | "pages/MineHomePage", | 6 | "pages/MineHomePage", |
| 7 | "components/page/SettingPage", | 7 | "components/page/SettingPage", |
| 8 | "components/page/SettingAboutPage", | 8 | "components/page/SettingAboutPage", |
| 9 | + "components/page/QualityCommentsPage", | ||
| 9 | "components/page/PrivacySettingPage", | 10 | "components/page/PrivacySettingPage", |
| 10 | "components/page/EditUserInfoPage", | 11 | "components/page/EditUserInfoPage", |
| 11 | "components/page/EditUserNikeNamePage", | 12 | "components/page/EditUserNikeNamePage", |
| @@ -5,6 +5,7 @@ import { WindowModel } from 'wdKit/Index'; | @@ -5,6 +5,7 @@ import { WindowModel } from 'wdKit/Index'; | ||
| 5 | import { PlayerComponent } from '../widgets/vertical/PlayerComponent'; | 5 | import { PlayerComponent } from '../widgets/vertical/PlayerComponent'; |
| 6 | import { PlayerInfoComponent } from '../widgets/vertical/PlayerInfoComponent'; | 6 | import { PlayerInfoComponent } from '../widgets/vertical/PlayerInfoComponent'; |
| 7 | import { WDPlayerController } from 'wdPlayer/Index'; | 7 | import { WDPlayerController } from 'wdPlayer/Index'; |
| 8 | +import { DisplayDirection } from 'wdConstant/Index'; | ||
| 8 | 9 | ||
| 9 | const storage = LocalStorage.getShared(); | 10 | const storage = LocalStorage.getShared(); |
| 10 | 11 | ||
| @@ -21,6 +22,7 @@ export struct DetailPlayVLivePage { | @@ -21,6 +22,7 @@ export struct DetailPlayVLivePage { | ||
| 21 | @Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean | 22 | @Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean |
| 22 | @Provide isShowControl: boolean = false | 23 | @Provide isShowControl: boolean = false |
| 23 | @Provide liveState: string = '' | 24 | @Provide liveState: string = '' |
| 25 | + @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL //横竖屏,默认竖屏 | ||
| 24 | @State relId: string = '' | 26 | @State relId: string = '' |
| 25 | @State contentId: string = '' | 27 | @State contentId: string = '' |
| 26 | @State relType: string = '' | 28 | @State relType: string = '' |
| @@ -43,7 +45,6 @@ export struct DetailPlayVLivePage { | @@ -43,7 +45,6 @@ export struct DetailPlayVLivePage { | ||
| 43 | aboutToDisappear(): void { | 45 | aboutToDisappear(): void { |
| 44 | WindowModel.shared.setWindowLayoutFullScreen(false) | 46 | WindowModel.shared.setWindowLayoutFullScreen(false) |
| 45 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | 47 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) |
| 46 | - | ||
| 47 | } | 48 | } |
| 48 | 49 | ||
| 49 | build() { | 50 | build() { |
| @@ -52,9 +53,6 @@ export struct DetailPlayVLivePage { | @@ -52,9 +53,6 @@ export struct DetailPlayVLivePage { | ||
| 52 | PlayerComponent({ | 53 | PlayerComponent({ |
| 53 | playerController: this.playerController | 54 | playerController: this.playerController |
| 54 | }) | 55 | }) |
| 55 | - .onClick(() => { | ||
| 56 | - this.isShowControl = !this.isShowControl | ||
| 57 | - }) | ||
| 58 | 56 | ||
| 59 | PlayerInfoComponent({ | 57 | PlayerInfoComponent({ |
| 60 | playerController: this.playerController, | 58 | playerController: this.playerController, |
| @@ -67,7 +65,8 @@ export struct DetailPlayVLivePage { | @@ -67,7 +65,8 @@ export struct DetailPlayVLivePage { | ||
| 67 | .aspectRatio(1) | 65 | .aspectRatio(1) |
| 68 | .visibility(this.swiperIndex === 0 ? Visibility.Visible : Visibility.Hidden) | 66 | .visibility(this.swiperIndex === 0 ? Visibility.Visible : Visibility.Hidden) |
| 69 | .animation({ duration: 500 }) | 67 | .animation({ duration: 500 }) |
| 70 | - .position({ x: '90%', y: '90%' }) | 68 | + .position({ x: '100%', y: '100%' }) |
| 69 | + .markAnchor({ x: 56, y: 56 }) | ||
| 71 | .onClick(() => { | 70 | .onClick(() => { |
| 72 | this.swiperController.showNext() | 71 | this.swiperController.showNext() |
| 73 | }) | 72 | }) |
| 1 | -import { LiveDetailsBean } from 'wdBean/Index'; | ||
| 2 | -import { WDPlayerController, WDPlayerRenderView } from 'wdPlayer/Index'; | ||
| 3 | -import { PlayUIComponent } from './PlayUIComponent'; | ||
| 4 | - | ||
| 5 | -@Component | ||
| 6 | -export struct TopPlayVComponent { | ||
| 7 | - @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean | ||
| 8 | - playerController: WDPlayerController = new WDPlayerController(); | ||
| 9 | - | ||
| 10 | - aboutToAppear(): void { | ||
| 11 | - this.playerController.onCanplay = () => { | ||
| 12 | - this.playerController.play() | ||
| 13 | - } | ||
| 14 | - } | ||
| 15 | - | ||
| 16 | - updateData() { | ||
| 17 | - //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | ||
| 18 | - if (this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.vlive.length > 0) { | ||
| 19 | - let playUrl = '' | ||
| 20 | - if (this.liveDetailsBean.liveInfo.liveState == 'running') { | ||
| 21 | - playUrl = this.liveDetailsBean.liveInfo.vlive[0].liveUrl | ||
| 22 | - } else if (this.liveDetailsBean.liveInfo.liveState == 'end') { | ||
| 23 | - playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri | ||
| 24 | - } | ||
| 25 | - this.playerController.firstPlay(playUrl); | ||
| 26 | - } | ||
| 27 | - } | ||
| 28 | - | ||
| 29 | - build() { | ||
| 30 | - Stack() { | ||
| 31 | - // https://developer.huawei.com/consumer/cn/doc/harmonyos-references/ts-universal-attributes-image-effect-0000001862607345 | ||
| 32 | - Image(this.liveDetailsBean.fullColumnImgUrls[0].url) | ||
| 33 | - .height('100%') | ||
| 34 | - .width('100%') | ||
| 35 | - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | ||
| 36 | - .blur(100) | ||
| 37 | - | ||
| 38 | - WDPlayerRenderView({ | ||
| 39 | - playerController: this.playerController, | ||
| 40 | - onLoad: async () => { | ||
| 41 | - } | ||
| 42 | - })// .height('100%') | ||
| 43 | - .width('100%')// 扩展至所有非安全区域 | ||
| 44 | - .onClick(() => { | ||
| 45 | - this.playerController.play() | ||
| 46 | - }) | ||
| 47 | - // PlayUIComponent({ playerController: this.playerController }) | ||
| 48 | - } | ||
| 49 | - // .height('100%') | ||
| 50 | - .width('100%') | ||
| 51 | - // 扩展至所有非安全区域 | ||
| 52 | - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | ||
| 53 | - } | ||
| 54 | - | ||
| 55 | - aboutToDisappear(): void { | ||
| 56 | - this.playerController.pause() | ||
| 57 | - } | ||
| 58 | -} |
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/vertical/ChartItemCompereComponent.ets
0 → 100644
| 1 | +import { LiveDetailsBean } from 'wdBean/Index' | ||
| 2 | + | ||
| 3 | +@Component | ||
| 4 | +export struct ChartItemCompereComponent { | ||
| 5 | + @Consume liveDetailsBean: LiveDetailsBean | ||
| 6 | + | ||
| 7 | + aboutToAppear(): void { | ||
| 8 | + } | ||
| 9 | + | ||
| 10 | + build() { | ||
| 11 | + ListItem() { | ||
| 12 | + Column() { | ||
| 13 | + Row() { | ||
| 14 | + Image($r('app.media.icon_live_status_running')) | ||
| 15 | + .borderRadius(10) | ||
| 16 | + .width(20) | ||
| 17 | + .height(20) | ||
| 18 | + .margin({ right: 8 }) | ||
| 19 | + | ||
| 20 | + Text('人民日报') | ||
| 21 | + .fontSize(14) | ||
| 22 | + .fontColor('#FFFFFFFF') | ||
| 23 | + .margin({ right: 8 }) | ||
| 24 | + | ||
| 25 | + Text(' 主持人 ') | ||
| 26 | + .fontSize(11) | ||
| 27 | + .backgroundColor('808562') | ||
| 28 | + .fontColor('#FFFFFFFF') | ||
| 29 | + .padding({ top: 2, bottom: 2, left: 4, right: 4 }) | ||
| 30 | + .borderRadius(4) | ||
| 31 | + }.margin({ bottom: 8 }) | ||
| 32 | + | ||
| 33 | + Text(this.liveDetailsBean.newIntroduction).lineHeight(22) | ||
| 34 | + } | ||
| 35 | + .backgroundColor('#4D000000') | ||
| 36 | + .borderRadius(3) | ||
| 37 | + .padding({ | ||
| 38 | + top: 6, | ||
| 39 | + bottom: 6, | ||
| 40 | + left: 8, | ||
| 41 | + right: 8 | ||
| 42 | + }) | ||
| 43 | + .margin({ left: 16, bottom: 4 }) | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + } | ||
| 47 | +} |
| @@ -9,31 +9,35 @@ export struct ChatItemComponent { | @@ -9,31 +9,35 @@ export struct ChatItemComponent { | ||
| 9 | 9 | ||
| 10 | build() { | 10 | build() { |
| 11 | Row() { | 11 | Row() { |
| 12 | - Image(this.item.senderUserAvatarUrl) | ||
| 13 | - .borderRadius(90) | ||
| 14 | - .width(24) | ||
| 15 | - .height(24) | ||
| 16 | Text() { | 12 | Text() { |
| 13 | + if (this.item.senderUserName) { | ||
| 14 | + Span(' 主持人 ') | ||
| 15 | + .fontSize(11) | ||
| 16 | + .lineHeight(20) | ||
| 17 | + .textBackgroundStyle({ color: '#808562', radius: 2 }) | ||
| 18 | + Span(' ') | ||
| 19 | + } | ||
| 17 | Span(this.item.senderUserName + ': ') | 20 | Span(this.item.senderUserName + ': ') |
| 18 | - .fontColor('#666666') | 21 | + .fontColor('#FFFFC63F') |
| 22 | + .padding({ right: 118 }) | ||
| 23 | + // | ||
| 24 | + | ||
| 19 | Span(this.item.text) | 25 | Span(this.item.text) |
| 20 | - .fontColor('#222222') | ||
| 21 | } | 26 | } |
| 22 | - .margin({ left: 8 }) | ||
| 23 | - .lineHeight(20) | ||
| 24 | - .layoutWeight(1) | ||
| 25 | - .fontSize('14fp') | ||
| 26 | - .fontWeight(400) | 27 | + .fontSize(14) |
| 28 | + .fontColor('#FFFFFFFF') | ||
| 29 | + .lineHeight(22) | ||
| 30 | + .textShadow({ offsetX: 1, offsetY: 1, color: '#4D000000', radius: 1 }) | ||
| 31 | + | ||
| 27 | } | 32 | } |
| 28 | - .alignItems(VerticalAlign.Top) | 33 | + .backgroundColor('#4D000000') |
| 34 | + .borderRadius(3) | ||
| 29 | .padding({ | 35 | .padding({ |
| 30 | - left: 15, | ||
| 31 | - top: 15, | ||
| 32 | - right: 15 | 36 | + top: 6, |
| 37 | + bottom: 6, | ||
| 38 | + left: 8, | ||
| 39 | + right: 8 | ||
| 33 | }) | 40 | }) |
| 34 | - } | ||
| 35 | - | ||
| 36 | - aboutToDisappear(): void { | ||
| 37 | - | 41 | + .margin({ left: 16, bottom: 4 }) |
| 38 | } | 42 | } |
| 39 | } | 43 | } |
| 1 | -import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index' | ||
| 2 | -import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI } from 'wdComponent/Index' | ||
| 3 | -import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout' | ||
| 4 | -import LoadMoreLayout from 'wdComponent/src/main/ets/components/page/LoadMoreLayout' | ||
| 5 | -import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayout' | ||
| 6 | -import { RefreshLayoutBean } from 'wdComponent/src/main/ets/components/page/RefreshLayoutBean' | 1 | +import { LiveDetailsBean, LiveRoomDataBean, LiveRoomItemBean } from 'wdBean/Index' |
| 2 | +import { LiveCommentComponent } from 'wdComponent/Index' | ||
| 7 | import PageModel from 'wdComponent/src/main/ets/viewmodel/PageModel' | 3 | import PageModel from 'wdComponent/src/main/ets/viewmodel/PageModel' |
| 8 | -import { ViewType } from 'wdConstant/Index' | 4 | +import { DisplayDirection, ViewType } from 'wdConstant/Index' |
| 9 | import { LiveViewModel } from '../../viewModel/LiveViewModel' | 5 | import { LiveViewModel } from '../../viewModel/LiveViewModel' |
| 10 | -import { TabChatItemComponent } from '../details/TabChatItemComponent' | 6 | +import { ChartItemCompereComponent } from './ChartItemCompereComponent' |
| 7 | +import { ChatItemComponent } from './ChartItemComponent' | ||
| 11 | 8 | ||
| 12 | 9 | ||
| 13 | @Component | 10 | @Component |
| 14 | export struct PlayerCommentComponent { | 11 | export struct PlayerCommentComponent { |
| 15 | liveViewModel: LiveViewModel = new LiveViewModel() | 12 | liveViewModel: LiveViewModel = new LiveViewModel() |
| 16 | - @Consume liveDetailsBean: LiveDetailsBean | 13 | + @Consume @Watch('liveDetailsBeanChange') liveDetailsBean: LiveDetailsBean |
| 14 | + @Consume liveRoomDataBean: LiveRoomDataBean | ||
| 15 | + @Consume displayDirection: DisplayDirection | ||
| 17 | @State private pageModel: PageModel = new PageModel() | 16 | @State private pageModel: PageModel = new PageModel() |
| 18 | @State liveChatList: Array<LiveRoomItemBean> = [] | 17 | @State liveChatList: Array<LiveRoomItemBean> = [] |
| 19 | 18 | ||
| @@ -21,6 +20,10 @@ export struct PlayerCommentComponent { | @@ -21,6 +20,10 @@ export struct PlayerCommentComponent { | ||
| 21 | this.getLiveChatList() | 20 | this.getLiveChatList() |
| 22 | } | 21 | } |
| 23 | 22 | ||
| 23 | + liveDetailsBeanChange() { | ||
| 24 | + this.getLiveChatList() | ||
| 25 | + } | ||
| 26 | + | ||
| 24 | getLiveChatList() { | 27 | getLiveChatList() { |
| 25 | this.pageModel.currentPage = 1 | 28 | this.pageModel.currentPage = 1 |
| 26 | this.liveViewModel.getLiveChatList( | 29 | this.liveViewModel.getLiveChatList( |
| @@ -31,8 +34,10 @@ export struct PlayerCommentComponent { | @@ -31,8 +34,10 @@ export struct PlayerCommentComponent { | ||
| 31 | .then( | 34 | .then( |
| 32 | (data) => { | 35 | (data) => { |
| 33 | if (data.barrageResponses && data.barrageResponses.length > 0) { | 36 | if (data.barrageResponses && data.barrageResponses.length > 0) { |
| 37 | + | ||
| 34 | this.pageModel.viewType = ViewType.LOADED; | 38 | this.pageModel.viewType = ViewType.LOADED; |
| 35 | this.liveChatList.push(...data.barrageResponses) | 39 | this.liveChatList.push(...data.barrageResponses) |
| 40 | + console.log('liveChatList===', this.liveChatList) | ||
| 36 | if (data.barrageResponses.length === this.pageModel.pageSize) { | 41 | if (data.barrageResponses.length === this.pageModel.pageSize) { |
| 37 | this.pageModel.currentPage++; | 42 | this.pageModel.currentPage++; |
| 38 | this.pageModel.hasMore = true; | 43 | this.pageModel.hasMore = true; |
| @@ -49,58 +54,27 @@ export struct PlayerCommentComponent { | @@ -49,58 +54,27 @@ export struct PlayerCommentComponent { | ||
| 49 | } | 54 | } |
| 50 | 55 | ||
| 51 | build() { | 56 | build() { |
| 52 | - Stack() { | ||
| 53 | - if (this.pageModel.viewType == ViewType.LOADING) { | ||
| 54 | - this.LoadingLayout() | ||
| 55 | - } else if (this.pageModel.viewType == ViewType.ERROR) { | ||
| 56 | - ErrorComponent() | ||
| 57 | - } else if (this.pageModel.viewType == ViewType.EMPTY) { | ||
| 58 | - EmptyComponent() | ||
| 59 | - } else { | ||
| 60 | - this.ListLayout() | ||
| 61 | - } | ||
| 62 | - } | ||
| 63 | - .align(Alignment.Top) | ||
| 64 | - // .backgroundColor('#F5F5F5') | ||
| 65 | - .height('100%') | ||
| 66 | - .width('100%') | ||
| 67 | - } | ||
| 68 | - | ||
| 69 | - @Builder | ||
| 70 | - LoadingLayout() { | ||
| 71 | - CustomRefreshLoadLayout({ | ||
| 72 | - refreshBean: new RefreshLayoutBean(true, | ||
| 73 | - $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), this.pageModel.pullDownRefreshHeight) | ||
| 74 | - }) | ||
| 75 | - } | ||
| 76 | - | ||
| 77 | - @Builder | ||
| 78 | - ListLayout() { | ||
| 79 | - List() { | ||
| 80 | - ListItem() { | ||
| 81 | - // 下拉刷新 | ||
| 82 | - RefreshLayout({ | ||
| 83 | - refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullDown, this.pageModel.pullDownRefreshImage, | ||
| 84 | - this.pageModel.pullDownRefreshText, this.pageModel.pullDownRefreshHeight) | 57 | + Column() { |
| 58 | + List() { | ||
| 59 | + // 主持人 | ||
| 60 | + if (this.liveDetailsBean.oldNewsId) { | ||
| 61 | + ChartItemCompereComponent() | ||
| 62 | + } | ||
| 63 | + ForEach(this.liveChatList, (item: LiveRoomItemBean) => { | ||
| 64 | + ListItem() { | ||
| 65 | + ChatItemComponent({ item: item }) | ||
| 66 | + } | ||
| 85 | }) | 67 | }) |
| 86 | } | 68 | } |
| 69 | + .height(280) | ||
| 70 | + .width('80%') | ||
| 71 | + .scrollBar(BarState.Off) | ||
| 72 | + .margin({ bottom: 20 }) | ||
| 73 | + | ||
| 74 | + LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum }) | ||
| 75 | + .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | ||
| 76 | + .backgroundColor(Color.Transparent) | ||
| 77 | + }.alignItems(HorizontalAlign.Start) | ||
| 87 | 78 | ||
| 88 | - ForEach(this.liveChatList, (item: LiveRoomItemBean) => { | ||
| 89 | - ListItem() { | ||
| 90 | - TabChatItemComponent({ item: item }) | ||
| 91 | - } | ||
| 92 | - }) | ||
| 93 | - // 加载更多 | ||
| 94 | - ListItem() { | ||
| 95 | - if (this.pageModel.hasMore) { | ||
| 96 | - LoadMoreLayout({ | ||
| 97 | - refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage, | ||
| 98 | - this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight) | ||
| 99 | - }) | ||
| 100 | - } else { | ||
| 101 | - ListHasNoMoreDataUI() | ||
| 102 | - } | ||
| 103 | - } | ||
| 104 | - } | ||
| 105 | } | 79 | } |
| 106 | } | 80 | } |
| @@ -80,7 +80,7 @@ export struct PlayerComponent { | @@ -80,7 +80,7 @@ export struct PlayerComponent { | ||
| 80 | onLoad: () => { | 80 | onLoad: () => { |
| 81 | this.playerController?.firstPlay(this.playUrl); | 81 | this.playerController?.firstPlay(this.playUrl); |
| 82 | } | 82 | } |
| 83 | - }).padding({ top: 195 }) | 83 | + }).margin({ top: 195 }).height(211) |
| 84 | } | 84 | } |
| 85 | } | 85 | } |
| 86 | .height('100%') | 86 | .height('100%') |
| @@ -7,6 +7,8 @@ export struct PlayerInfoComponent { | @@ -7,6 +7,8 @@ export struct PlayerInfoComponent { | ||
| 7 | private playerController?: WDPlayerController | 7 | private playerController?: WDPlayerController |
| 8 | @Consume bottomSafeHeight: number | 8 | @Consume bottomSafeHeight: number |
| 9 | @Consume topSafeHeight: number | 9 | @Consume topSafeHeight: number |
| 10 | + @Consume liveState: string | ||
| 11 | + @Consume isShowControl: boolean | ||
| 10 | @Link swiperIndex: number | 12 | @Link swiperIndex: number |
| 11 | 13 | ||
| 12 | build() { | 14 | build() { |
| @@ -17,7 +19,6 @@ export struct PlayerInfoComponent { | @@ -17,7 +19,6 @@ export struct PlayerInfoComponent { | ||
| 17 | bottom: this.bottomSafeHeight + 'px', | 19 | bottom: this.bottomSafeHeight + 'px', |
| 18 | top: this.topSafeHeight + 'px' | 20 | top: this.topSafeHeight + 'px' |
| 19 | }) | 21 | }) |
| 20 | - | ||
| 21 | } | 22 | } |
| 22 | .cachedCount(2) | 23 | .cachedCount(2) |
| 23 | .indicator(false) | 24 | .indicator(false) |
| @@ -25,6 +26,11 @@ export struct PlayerInfoComponent { | @@ -25,6 +26,11 @@ export struct PlayerInfoComponent { | ||
| 25 | .width('100%') | 26 | .width('100%') |
| 26 | .height('100%') | 27 | .height('100%') |
| 27 | .index(this.swiperIndex) | 28 | .index(this.swiperIndex) |
| 29 | + .onClick(() => { | ||
| 30 | + if (this.liveState === 'end') { | ||
| 31 | + this.isShowControl = !this.isShowControl | ||
| 32 | + } | ||
| 33 | + }) | ||
| 28 | .onChange((index) => { | 34 | .onChange((index) => { |
| 29 | this.swiperIndex = index | 35 | this.swiperIndex = index |
| 30 | }) | 36 | }) |
| @@ -6,20 +6,27 @@ import { PlayerVideoControlComponent } from './PlayerVideoControlComponent'; | @@ -6,20 +6,27 @@ import { PlayerVideoControlComponent } from './PlayerVideoControlComponent'; | ||
| 6 | @Component | 6 | @Component |
| 7 | export struct PlayerUIComponent { | 7 | export struct PlayerUIComponent { |
| 8 | private playerController?: WDPlayerController | 8 | private playerController?: WDPlayerController |
| 9 | - @Consume liveState: string | 9 | + @Consume isShowControl: boolean |
| 10 | 10 | ||
| 11 | build() { | 11 | build() { |
| 12 | - Column() { | 12 | + Stack() { |
| 13 | PlayerTitleComponent() | 13 | PlayerTitleComponent() |
| 14 | - Blank() | ||
| 15 | - // PlayerCommentComponent().layoutWeight(1) | ||
| 16 | - if (this.liveState === 'end') { | 14 | + // Row() { |
| 15 | + // // 全屏按钮 | ||
| 16 | + // }.layoutWeight(1) | ||
| 17 | + | ||
| 18 | + Row() { | ||
| 19 | + PlayerCommentComponent() | ||
| 17 | PlayerVideoControlComponent({ playerController: this.playerController }) | 20 | PlayerVideoControlComponent({ playerController: this.playerController }) |
| 21 | + .visibility(this.isShowControl ? Visibility.Visible : Visibility.Hidden) | ||
| 22 | + .animation({ duration: 500 }) | ||
| 18 | } | 23 | } |
| 19 | - | 24 | + .position({ y: '100%' }) |
| 25 | + .markAnchor({ y: '100%' }) | ||
| 20 | } | 26 | } |
| 21 | .height('100%') | 27 | .height('100%') |
| 22 | .width('100%') | 28 | .width('100%') |
| 29 | + .alignContent(Alignment.TopStart) | ||
| 23 | 30 | ||
| 24 | } | 31 | } |
| 25 | } | 32 | } |
| @@ -11,9 +11,6 @@ export struct PlayerVideoControlComponent { | @@ -11,9 +11,6 @@ export struct PlayerVideoControlComponent { | ||
| 11 | private playerController?: WDPlayerController | 11 | private playerController?: WDPlayerController |
| 12 | @Consume liveDetailsBean: LiveDetailsBean | 12 | @Consume liveDetailsBean: LiveDetailsBean |
| 13 | @Consume liveRoomDataBean: LiveRoomDataBean | 13 | @Consume liveRoomDataBean: LiveRoomDataBean |
| 14 | - //菜单键是否可见 | ||
| 15 | - @State isMenuVisible: boolean = true | ||
| 16 | - @State isFullScreen: boolean = false | ||
| 17 | @State currentTime: string = '' | 14 | @State currentTime: string = '' |
| 18 | @State totalTime: string = '' | 15 | @State totalTime: string = '' |
| 19 | @State progressVal: number = 0; | 16 | @State progressVal: number = 0; |
| @@ -24,7 +21,6 @@ export struct PlayerVideoControlComponent { | @@ -24,7 +21,6 @@ export struct PlayerVideoControlComponent { | ||
| 24 | if (this.playerController) { | 21 | if (this.playerController) { |
| 25 | //播放进度监听 | 22 | //播放进度监听 |
| 26 | this.playerController.onTimeUpdate = (position: number, duration: number) => { | 23 | this.playerController.onTimeUpdate = (position: number, duration: number) => { |
| 27 | - console.log('onTimeUpdate===', position, duration) | ||
| 28 | this.currentTime = DateFormatUtil.secondToTime(Math.floor(position / 1000)); | 24 | this.currentTime = DateFormatUtil.secondToTime(Math.floor(position / 1000)); |
| 29 | this.totalTime = DateFormatUtil.secondToTime(Math.floor(duration / 1000)); | 25 | this.totalTime = DateFormatUtil.secondToTime(Math.floor(duration / 1000)); |
| 30 | this.progressVal = Math.floor(position * 100 / duration); | 26 | this.progressVal = Math.floor(position * 100 / duration); |
| @@ -61,14 +57,6 @@ export struct PlayerVideoControlComponent { | @@ -61,14 +57,6 @@ export struct PlayerVideoControlComponent { | ||
| 61 | right: 16 | 57 | right: 16 |
| 62 | }) | 58 | }) |
| 63 | 59 | ||
| 64 | - // Image($r('app.media.icon_live_player_full_screen')) | ||
| 65 | - // .width(24) | ||
| 66 | - // .height(24) | ||
| 67 | - // .onClick(() => { | ||
| 68 | - // this.isFullScreen = !this.isFullScreen | ||
| 69 | - // WindowModel.shared.setPreferredOrientation(this.isFullScreen ? window.Orientation.LANDSCAPE : window.Orientation.PORTRAIT); | ||
| 70 | - // devicePLSensorManager.devicePLSensorOn(this.isFullScreen ? window.Orientation.LANDSCAPE : window.Orientation.PORTRAIT); | ||
| 71 | - // }) | ||
| 72 | } | 60 | } |
| 73 | .alignItems(VerticalAlign.Center) | 61 | .alignItems(VerticalAlign.Center) |
| 74 | // .linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] }) | 62 | // .linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] }) |
| @@ -79,7 +67,6 @@ export struct PlayerVideoControlComponent { | @@ -79,7 +67,6 @@ export struct PlayerVideoControlComponent { | ||
| 79 | top: 15, | 67 | top: 15, |
| 80 | bottom: 15 | 68 | bottom: 15 |
| 81 | }) | 69 | }) |
| 82 | - .visibility(this.isMenuVisible ? Visibility.Visible : Visibility.None) | ||
| 83 | } | 70 | } |
| 84 | 71 | ||
| 85 | @Builder | 72 | @Builder |
| @@ -502,6 +502,406 @@ | @@ -502,6 +502,406 @@ | ||
| 502 | "topicType": null, | 502 | "topicType": null, |
| 503 | "uuid": "dcc25c99-8e27-42fc-aa29-861beec958f2", | 503 | "uuid": "dcc25c99-8e27-42fc-aa29-861beec958f2", |
| 504 | "visitorComment": 1 | 504 | "visitorComment": 1 |
| 505 | + }, { | ||
| 506 | + "authorLike": 0, | ||
| 507 | + "avatarFrame": "", | ||
| 508 | + "checkStatus": 2, | ||
| 509 | + "commentContent": "外婆企图", | ||
| 510 | + "commentContentSensitive": "", | ||
| 511 | + "commentLevel": 1, | ||
| 512 | + "commentPics": "", | ||
| 513 | + "commentSensitive": "", | ||
| 514 | + "commentType": "2", | ||
| 515 | + "contentAuthor": 0, | ||
| 516 | + "createTime": "2024-04-01 14:22:37", | ||
| 517 | + "creatorFlag": 0, | ||
| 518 | + "fromCreatorId": "", | ||
| 519 | + "fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn//zhbj/img/user/2024040114/133af3190cd84eb7a5e70c4c23071881.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 520 | + "fromUserId": "574444396143685", | ||
| 521 | + "fromUserName": "人民日报网友2Ai3yZ", | ||
| 522 | + "fromUserType": 1, | ||
| 523 | + "h5Url": "", | ||
| 524 | + "highQualityExpireTime": "2024-04-15T18:26:05+0800", | ||
| 525 | + "highQualityTime": "2024-04-12T18:26:05+0800", | ||
| 526 | + "id": 56792966, | ||
| 527 | + "likeNum": 0, | ||
| 528 | + "mySelf": 0, | ||
| 529 | + "pageId": null, | ||
| 530 | + "parentId": -1, | ||
| 531 | + "region": "安徽", | ||
| 532 | + "replyNum": 0, | ||
| 533 | + "rootCommentId": 56792966, | ||
| 534 | + "sensitiveExist": 0, | ||
| 535 | + "sensitiveShow": 1, | ||
| 536 | + "shareInfo": { | ||
| 537 | + "shareCoverUrl": "", | ||
| 538 | + "shareSummary": "说话的艺术,说到底就是生活的艺术。", | ||
| 539 | + "shareTitle": "学会这三种说话方式,受益无穷", | ||
| 540 | + "shareUrl": "https://people.pdnews.cn/column/30044115488-500005262017" | ||
| 541 | + }, | ||
| 542 | + "targetId": "30044115488", | ||
| 543 | + "targetRelId": "500005262017", | ||
| 544 | + "targetRelObjectId": "2003", | ||
| 545 | + "targetRelType": 1, | ||
| 546 | + "targetStatus": 0, | ||
| 547 | + "targetTitle": "学会这三种说话方式,受益无穷", | ||
| 548 | + "targetType": 13, | ||
| 549 | + "toUserContentAuthor": 0, | ||
| 550 | + "toUserName": "", | ||
| 551 | + "topFlag": 0, | ||
| 552 | + "topicType": null, | ||
| 553 | + "uuid": "dcc25c99-8e27-42fc-aa29-861beec958f2", | ||
| 554 | + "visitorComment": 1 | ||
| 555 | + }, { | ||
| 556 | + "authorLike": 0, | ||
| 557 | + "avatarFrame": "", | ||
| 558 | + "checkStatus": 2, | ||
| 559 | + "commentContent": "外婆企图", | ||
| 560 | + "commentContentSensitive": "", | ||
| 561 | + "commentLevel": 1, | ||
| 562 | + "commentPics": "", | ||
| 563 | + "commentSensitive": "", | ||
| 564 | + "commentType": "2", | ||
| 565 | + "contentAuthor": 0, | ||
| 566 | + "createTime": "2024-04-01 14:22:37", | ||
| 567 | + "creatorFlag": 0, | ||
| 568 | + "fromCreatorId": "", | ||
| 569 | + "fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn//zhbj/img/user/2024040114/133af3190cd84eb7a5e70c4c23071881.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 570 | + "fromUserId": "574444396143685", | ||
| 571 | + "fromUserName": "人民日报网友2Ai3yZ", | ||
| 572 | + "fromUserType": 1, | ||
| 573 | + "h5Url": "", | ||
| 574 | + "highQualityExpireTime": "2024-04-15T18:26:05+0800", | ||
| 575 | + "highQualityTime": "2024-04-12T18:26:05+0800", | ||
| 576 | + "id": 56792966, | ||
| 577 | + "likeNum": 0, | ||
| 578 | + "mySelf": 0, | ||
| 579 | + "pageId": null, | ||
| 580 | + "parentId": -1, | ||
| 581 | + "region": "安徽", | ||
| 582 | + "replyNum": 0, | ||
| 583 | + "rootCommentId": 56792966, | ||
| 584 | + "sensitiveExist": 0, | ||
| 585 | + "sensitiveShow": 1, | ||
| 586 | + "shareInfo": { | ||
| 587 | + "shareCoverUrl": "", | ||
| 588 | + "shareSummary": "说话的艺术,说到底就是生活的艺术。", | ||
| 589 | + "shareTitle": "学会这三种说话方式,受益无穷", | ||
| 590 | + "shareUrl": "https://people.pdnews.cn/column/30044115488-500005262017" | ||
| 591 | + }, | ||
| 592 | + "targetId": "30044115488", | ||
| 593 | + "targetRelId": "500005262017", | ||
| 594 | + "targetRelObjectId": "2003", | ||
| 595 | + "targetRelType": 1, | ||
| 596 | + "targetStatus": 0, | ||
| 597 | + "targetTitle": "学会这三种说话方式,受益无穷", | ||
| 598 | + "targetType": 13, | ||
| 599 | + "toUserContentAuthor": 0, | ||
| 600 | + "toUserName": "", | ||
| 601 | + "topFlag": 0, | ||
| 602 | + "topicType": null, | ||
| 603 | + "uuid": "dcc25c99-8e27-42fc-aa29-861beec958f2", | ||
| 604 | + "visitorComment": 1 | ||
| 605 | + }, { | ||
| 606 | + "authorLike": 0, | ||
| 607 | + "avatarFrame": "", | ||
| 608 | + "checkStatus": 2, | ||
| 609 | + "commentContent": "外婆企图", | ||
| 610 | + "commentContentSensitive": "", | ||
| 611 | + "commentLevel": 1, | ||
| 612 | + "commentPics": "", | ||
| 613 | + "commentSensitive": "", | ||
| 614 | + "commentType": "2", | ||
| 615 | + "contentAuthor": 0, | ||
| 616 | + "createTime": "2024-04-01 14:22:37", | ||
| 617 | + "creatorFlag": 0, | ||
| 618 | + "fromCreatorId": "", | ||
| 619 | + "fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn//zhbj/img/user/2024040114/133af3190cd84eb7a5e70c4c23071881.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 620 | + "fromUserId": "574444396143685", | ||
| 621 | + "fromUserName": "人民日报网友2Ai3yZ", | ||
| 622 | + "fromUserType": 1, | ||
| 623 | + "h5Url": "", | ||
| 624 | + "highQualityExpireTime": "2024-04-15T18:26:05+0800", | ||
| 625 | + "highQualityTime": "2024-04-12T18:26:05+0800", | ||
| 626 | + "id": 56792966, | ||
| 627 | + "likeNum": 0, | ||
| 628 | + "mySelf": 0, | ||
| 629 | + "pageId": null, | ||
| 630 | + "parentId": -1, | ||
| 631 | + "region": "安徽", | ||
| 632 | + "replyNum": 0, | ||
| 633 | + "rootCommentId": 56792966, | ||
| 634 | + "sensitiveExist": 0, | ||
| 635 | + "sensitiveShow": 1, | ||
| 636 | + "shareInfo": { | ||
| 637 | + "shareCoverUrl": "", | ||
| 638 | + "shareSummary": "说话的艺术,说到底就是生活的艺术。", | ||
| 639 | + "shareTitle": "学会这三种说话方式,受益无穷", | ||
| 640 | + "shareUrl": "https://people.pdnews.cn/column/30044115488-500005262017" | ||
| 641 | + }, | ||
| 642 | + "targetId": "30044115488", | ||
| 643 | + "targetRelId": "500005262017", | ||
| 644 | + "targetRelObjectId": "2003", | ||
| 645 | + "targetRelType": 1, | ||
| 646 | + "targetStatus": 0, | ||
| 647 | + "targetTitle": "学会这三种说话方式,受益无穷", | ||
| 648 | + "targetType": 13, | ||
| 649 | + "toUserContentAuthor": 0, | ||
| 650 | + "toUserName": "", | ||
| 651 | + "topFlag": 0, | ||
| 652 | + "topicType": null, | ||
| 653 | + "uuid": "dcc25c99-8e27-42fc-aa29-861beec958f2", | ||
| 654 | + "visitorComment": 1 | ||
| 655 | + }, { | ||
| 656 | + "authorLike": 0, | ||
| 657 | + "avatarFrame": "", | ||
| 658 | + "checkStatus": 2, | ||
| 659 | + "commentContent": "外婆企图", | ||
| 660 | + "commentContentSensitive": "", | ||
| 661 | + "commentLevel": 1, | ||
| 662 | + "commentPics": "", | ||
| 663 | + "commentSensitive": "", | ||
| 664 | + "commentType": "2", | ||
| 665 | + "contentAuthor": 0, | ||
| 666 | + "createTime": "2024-04-01 14:22:37", | ||
| 667 | + "creatorFlag": 0, | ||
| 668 | + "fromCreatorId": "", | ||
| 669 | + "fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn//zhbj/img/user/2024040114/133af3190cd84eb7a5e70c4c23071881.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 670 | + "fromUserId": "574444396143685", | ||
| 671 | + "fromUserName": "人民日报网友2Ai3yZ", | ||
| 672 | + "fromUserType": 1, | ||
| 673 | + "h5Url": "", | ||
| 674 | + "highQualityExpireTime": "2024-04-15T18:26:05+0800", | ||
| 675 | + "highQualityTime": "2024-04-12T18:26:05+0800", | ||
| 676 | + "id": 56792966, | ||
| 677 | + "likeNum": 0, | ||
| 678 | + "mySelf": 0, | ||
| 679 | + "pageId": null, | ||
| 680 | + "parentId": -1, | ||
| 681 | + "region": "安徽", | ||
| 682 | + "replyNum": 0, | ||
| 683 | + "rootCommentId": 56792966, | ||
| 684 | + "sensitiveExist": 0, | ||
| 685 | + "sensitiveShow": 1, | ||
| 686 | + "shareInfo": { | ||
| 687 | + "shareCoverUrl": "", | ||
| 688 | + "shareSummary": "说话的艺术,说到底就是生活的艺术。", | ||
| 689 | + "shareTitle": "学会这三种说话方式,受益无穷", | ||
| 690 | + "shareUrl": "https://people.pdnews.cn/column/30044115488-500005262017" | ||
| 691 | + }, | ||
| 692 | + "targetId": "30044115488", | ||
| 693 | + "targetRelId": "500005262017", | ||
| 694 | + "targetRelObjectId": "2003", | ||
| 695 | + "targetRelType": 1, | ||
| 696 | + "targetStatus": 0, | ||
| 697 | + "targetTitle": "学会这三种说话方式,受益无穷", | ||
| 698 | + "targetType": 13, | ||
| 699 | + "toUserContentAuthor": 0, | ||
| 700 | + "toUserName": "", | ||
| 701 | + "topFlag": 0, | ||
| 702 | + "topicType": null, | ||
| 703 | + "uuid": "dcc25c99-8e27-42fc-aa29-861beec958f2", | ||
| 704 | + "visitorComment": 1 | ||
| 705 | + }, { | ||
| 706 | + "authorLike": 0, | ||
| 707 | + "avatarFrame": "", | ||
| 708 | + "checkStatus": 2, | ||
| 709 | + "commentContent": "外婆企图", | ||
| 710 | + "commentContentSensitive": "", | ||
| 711 | + "commentLevel": 1, | ||
| 712 | + "commentPics": "", | ||
| 713 | + "commentSensitive": "", | ||
| 714 | + "commentType": "2", | ||
| 715 | + "contentAuthor": 0, | ||
| 716 | + "createTime": "2024-04-01 14:22:37", | ||
| 717 | + "creatorFlag": 0, | ||
| 718 | + "fromCreatorId": "", | ||
| 719 | + "fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn//zhbj/img/user/2024040114/133af3190cd84eb7a5e70c4c23071881.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 720 | + "fromUserId": "574444396143685", | ||
| 721 | + "fromUserName": "人民日报网友2Ai3yZ", | ||
| 722 | + "fromUserType": 1, | ||
| 723 | + "h5Url": "", | ||
| 724 | + "highQualityExpireTime": "2024-04-15T18:26:05+0800", | ||
| 725 | + "highQualityTime": "2024-04-12T18:26:05+0800", | ||
| 726 | + "id": 56792966, | ||
| 727 | + "likeNum": 0, | ||
| 728 | + "mySelf": 0, | ||
| 729 | + "pageId": null, | ||
| 730 | + "parentId": -1, | ||
| 731 | + "region": "安徽", | ||
| 732 | + "replyNum": 0, | ||
| 733 | + "rootCommentId": 56792966, | ||
| 734 | + "sensitiveExist": 0, | ||
| 735 | + "sensitiveShow": 1, | ||
| 736 | + "shareInfo": { | ||
| 737 | + "shareCoverUrl": "", | ||
| 738 | + "shareSummary": "说话的艺术,说到底就是生活的艺术。", | ||
| 739 | + "shareTitle": "学会这三种说话方式,受益无穷", | ||
| 740 | + "shareUrl": "https://people.pdnews.cn/column/30044115488-500005262017" | ||
| 741 | + }, | ||
| 742 | + "targetId": "30044115488", | ||
| 743 | + "targetRelId": "500005262017", | ||
| 744 | + "targetRelObjectId": "2003", | ||
| 745 | + "targetRelType": 1, | ||
| 746 | + "targetStatus": 0, | ||
| 747 | + "targetTitle": "学会这三种说话方式,受益无穷", | ||
| 748 | + "targetType": 13, | ||
| 749 | + "toUserContentAuthor": 0, | ||
| 750 | + "toUserName": "", | ||
| 751 | + "topFlag": 0, | ||
| 752 | + "topicType": null, | ||
| 753 | + "uuid": "dcc25c99-8e27-42fc-aa29-861beec958f2", | ||
| 754 | + "visitorComment": 1 | ||
| 755 | + }, { | ||
| 756 | + "authorLike": 0, | ||
| 757 | + "avatarFrame": "", | ||
| 758 | + "checkStatus": 2, | ||
| 759 | + "commentContent": "外婆企图", | ||
| 760 | + "commentContentSensitive": "", | ||
| 761 | + "commentLevel": 1, | ||
| 762 | + "commentPics": "", | ||
| 763 | + "commentSensitive": "", | ||
| 764 | + "commentType": "2", | ||
| 765 | + "contentAuthor": 0, | ||
| 766 | + "createTime": "2024-04-01 14:22:37", | ||
| 767 | + "creatorFlag": 0, | ||
| 768 | + "fromCreatorId": "", | ||
| 769 | + "fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn//zhbj/img/user/2024040114/133af3190cd84eb7a5e70c4c23071881.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 770 | + "fromUserId": "574444396143685", | ||
| 771 | + "fromUserName": "人民日报网友2Ai3yZ", | ||
| 772 | + "fromUserType": 1, | ||
| 773 | + "h5Url": "", | ||
| 774 | + "highQualityExpireTime": "2024-04-15T18:26:05+0800", | ||
| 775 | + "highQualityTime": "2024-04-12T18:26:05+0800", | ||
| 776 | + "id": 56792966, | ||
| 777 | + "likeNum": 0, | ||
| 778 | + "mySelf": 0, | ||
| 779 | + "pageId": null, | ||
| 780 | + "parentId": -1, | ||
| 781 | + "region": "安徽", | ||
| 782 | + "replyNum": 0, | ||
| 783 | + "rootCommentId": 56792966, | ||
| 784 | + "sensitiveExist": 0, | ||
| 785 | + "sensitiveShow": 1, | ||
| 786 | + "shareInfo": { | ||
| 787 | + "shareCoverUrl": "", | ||
| 788 | + "shareSummary": "说话的艺术,说到底就是生活的艺术。", | ||
| 789 | + "shareTitle": "学会这三种说话方式,受益无穷", | ||
| 790 | + "shareUrl": "https://people.pdnews.cn/column/30044115488-500005262017" | ||
| 791 | + }, | ||
| 792 | + "targetId": "30044115488", | ||
| 793 | + "targetRelId": "500005262017", | ||
| 794 | + "targetRelObjectId": "2003", | ||
| 795 | + "targetRelType": 1, | ||
| 796 | + "targetStatus": 0, | ||
| 797 | + "targetTitle": "学会这三种说话方式,受益无穷", | ||
| 798 | + "targetType": 13, | ||
| 799 | + "toUserContentAuthor": 0, | ||
| 800 | + "toUserName": "", | ||
| 801 | + "topFlag": 0, | ||
| 802 | + "topicType": null, | ||
| 803 | + "uuid": "dcc25c99-8e27-42fc-aa29-861beec958f2", | ||
| 804 | + "visitorComment": 1 | ||
| 805 | + }, { | ||
| 806 | + "authorLike": 0, | ||
| 807 | + "avatarFrame": "", | ||
| 808 | + "checkStatus": 2, | ||
| 809 | + "commentContent": "外婆企图", | ||
| 810 | + "commentContentSensitive": "", | ||
| 811 | + "commentLevel": 1, | ||
| 812 | + "commentPics": "", | ||
| 813 | + "commentSensitive": "", | ||
| 814 | + "commentType": "2", | ||
| 815 | + "contentAuthor": 0, | ||
| 816 | + "createTime": "2024-04-01 14:22:37", | ||
| 817 | + "creatorFlag": 0, | ||
| 818 | + "fromCreatorId": "", | ||
| 819 | + "fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn//zhbj/img/user/2024040114/133af3190cd84eb7a5e70c4c23071881.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 820 | + "fromUserId": "574444396143685", | ||
| 821 | + "fromUserName": "人民日报网友2Ai3yZ", | ||
| 822 | + "fromUserType": 1, | ||
| 823 | + "h5Url": "", | ||
| 824 | + "highQualityExpireTime": "2024-04-15T18:26:05+0800", | ||
| 825 | + "highQualityTime": "2024-04-12T18:26:05+0800", | ||
| 826 | + "id": 56792966, | ||
| 827 | + "likeNum": 0, | ||
| 828 | + "mySelf": 0, | ||
| 829 | + "pageId": null, | ||
| 830 | + "parentId": -1, | ||
| 831 | + "region": "安徽", | ||
| 832 | + "replyNum": 0, | ||
| 833 | + "rootCommentId": 56792966, | ||
| 834 | + "sensitiveExist": 0, | ||
| 835 | + "sensitiveShow": 1, | ||
| 836 | + "shareInfo": { | ||
| 837 | + "shareCoverUrl": "", | ||
| 838 | + "shareSummary": "说话的艺术,说到底就是生活的艺术。", | ||
| 839 | + "shareTitle": "学会这三种说话方式,受益无穷", | ||
| 840 | + "shareUrl": "https://people.pdnews.cn/column/30044115488-500005262017" | ||
| 841 | + }, | ||
| 842 | + "targetId": "30044115488", | ||
| 843 | + "targetRelId": "500005262017", | ||
| 844 | + "targetRelObjectId": "2003", | ||
| 845 | + "targetRelType": 1, | ||
| 846 | + "targetStatus": 0, | ||
| 847 | + "targetTitle": "学会这三种说话方式,受益无穷", | ||
| 848 | + "targetType": 13, | ||
| 849 | + "toUserContentAuthor": 0, | ||
| 850 | + "toUserName": "", | ||
| 851 | + "topFlag": 0, | ||
| 852 | + "topicType": null, | ||
| 853 | + "uuid": "dcc25c99-8e27-42fc-aa29-861beec958f2", | ||
| 854 | + "visitorComment": 1 | ||
| 855 | + }, { | ||
| 856 | + "authorLike": 0, | ||
| 857 | + "avatarFrame": "", | ||
| 858 | + "checkStatus": 2, | ||
| 859 | + "commentContent": "外婆企图", | ||
| 860 | + "commentContentSensitive": "", | ||
| 861 | + "commentLevel": 1, | ||
| 862 | + "commentPics": "", | ||
| 863 | + "commentSensitive": "", | ||
| 864 | + "commentType": "2", | ||
| 865 | + "contentAuthor": 0, | ||
| 866 | + "createTime": "2024-04-01 14:22:37", | ||
| 867 | + "creatorFlag": 0, | ||
| 868 | + "fromCreatorId": "", | ||
| 869 | + "fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn//zhbj/img/user/2024040114/133af3190cd84eb7a5e70c4c23071881.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 870 | + "fromUserId": "574444396143685", | ||
| 871 | + "fromUserName": "人民日报网友2Ai3yZ", | ||
| 872 | + "fromUserType": 1, | ||
| 873 | + "h5Url": "", | ||
| 874 | + "highQualityExpireTime": "2024-04-15T18:26:05+0800", | ||
| 875 | + "highQualityTime": "2024-04-12T18:26:05+0800", | ||
| 876 | + "id": 56792966, | ||
| 877 | + "likeNum": 0, | ||
| 878 | + "mySelf": 0, | ||
| 879 | + "pageId": null, | ||
| 880 | + "parentId": -1, | ||
| 881 | + "region": "安徽", | ||
| 882 | + "replyNum": 0, | ||
| 883 | + "rootCommentId": 56792966, | ||
| 884 | + "sensitiveExist": 0, | ||
| 885 | + "sensitiveShow": 1, | ||
| 886 | + "shareInfo": { | ||
| 887 | + "shareCoverUrl": "", | ||
| 888 | + "shareSummary": "说话的艺术,说到底就是生活的艺术。", | ||
| 889 | + "shareTitle": "学会这三种说话方式,受益无穷", | ||
| 890 | + "shareUrl": "https://people.pdnews.cn/column/30044115488-500005262017" | ||
| 891 | + }, | ||
| 892 | + "targetId": "30044115488", | ||
| 893 | + "targetRelId": "500005262017", | ||
| 894 | + "targetRelObjectId": "2003", | ||
| 895 | + "targetRelType": 1, | ||
| 896 | + "targetStatus": 0, | ||
| 897 | + "targetTitle": "学会这三种说话方式,受益无穷", | ||
| 898 | + "targetType": 13, | ||
| 899 | + "toUserContentAuthor": 0, | ||
| 900 | + "toUserName": "", | ||
| 901 | + "topFlag": 0, | ||
| 902 | + "topicType": null, | ||
| 903 | + "uuid": "dcc25c99-8e27-42fc-aa29-861beec958f2", | ||
| 904 | + "visitorComment": 1 | ||
| 505 | }], | 905 | }], |
| 506 | "pageNum": 1, | 906 | "pageNum": 1, |
| 507 | "pageSize": 10, | 907 | "pageSize": 10, |
-
Please register or login to post a comment