陈剑华

Merge remote-tracking branch 'origin/main'

# Conflicts:
#	sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
Showing 118 changed files with 3369 additions and 1716 deletions
1 import { Action } from './Action'; 1 import { Action } from './Action';
2 interface dataObject { 2 interface dataObject {
  3 + dataSource: number
3 operateType?: string 4 operateType?: string
4 webViewHeight?: string 5 webViewHeight?: string
5 dataJson?: string 6 dataJson?: string
@@ -3,15 +3,15 @@ @@ -3,15 +3,15 @@
3 { 3 {
4 "name": "shared_desc", 4 "name": "shared_desc",
5 "value": "全局工具包" 5 "value": "全局工具包"
6 - } , 6 + },
7 { 7 {
8 "name": "net_core_no_network", 8 "name": "net_core_no_network",
9 "value": "当前无网络,请重试" 9 "value": "当前无网络,请重试"
10 - } , 10 + },
11 { 11 {
12 "name": "net_core_weak_network", 12 "name": "net_core_weak_network",
13 "value": "当前无网络,请重试" 13 "value": "当前无网络,请重试"
14 - } , 14 + },
15 { 15 {
16 "name": "net_core_page_error_network", 16 "name": "net_core_page_error_network",
17 "value": "网络出小差了,请检查下网络" 17 "value": "网络出小差了,请检查下网络"
@@ -47,6 +47,10 @@ @@ -47,6 +47,10 @@
47 { 47 {
48 "name": "auditing_core_error", 48 "name": "auditing_core_error",
49 "value": "内容已下线" 49 "value": "内容已下线"
  50 + },
  51 + {
  52 + "name": "image_request_fail",
  53 + "value": "图片加载失败,请检查网络"
50 } 54 }
51 ] 55 ]
52 } 56 }
@@ -397,7 +397,8 @@ export class HttpUrlUtils { @@ -397,7 +397,8 @@ export class HttpUrlUtils {
397 if (StringUtils.isNotEmpty(HttpUrlUtils.token)) { 397 if (StringUtils.isNotEmpty(HttpUrlUtils.token)) {
398 return HttpUrlUtils.token 398 return HttpUrlUtils.token
399 } 399 }
400 - return 'eyJhbGciOiJIUzI1NiIsImtpZCI6ImQ4WkI2QkhxSEZrdjJ2U25BNlRwZEdKRjBHcjItVzBvS2FaYzdLOUUycmcifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcwMzY0OTYwNiwidXNlcklkIjo0NTk3NzYyOTc0NzQ5NDksInVzZXJWZXJzaW9uIjoiNDU5Nzc2Mjk3NDc0OTQ5XzIiLCJ1c2VyTmFtZSI6IkJ1bGlraWtpMTgxIiwidXNlclR5cGUiOjIsImNyZWF0b3JJZCI6NDI2NTM5MH0.jhQ9kylcm3FxWf0-lBMZuLkdtIQ6XpFnAi0AFZJNwfc'; 400 + // return 'eyJhbGciOiJIUzI1NiIsImtpZCI6ImQ4WkI2QkhxSEZrdjJ2U25BNlRwZEdKRjBHcjItVzBvS2FaYzdLOUUycmcifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcwMzY0OTYwNiwidXNlcklkIjo0NTk3NzYyOTc0NzQ5NDksInVzZXJWZXJzaW9uIjoiNDU5Nzc2Mjk3NDc0OTQ5XzIiLCJ1c2VyTmFtZSI6IkJ1bGlraWtpMTgxIiwidXNlclR5cGUiOjIsImNyZWF0b3JJZCI6NDI2NTM5MH0.jhQ9kylcm3FxWf0-lBMZuLkdtIQ6XpFnAi0AFZJNwfc';
  401 + return ''
401 } 402 }
402 403
403 static getRefreshToken() { 404 static getRefreshToken() {
@@ -556,6 +557,24 @@ export class HttpUrlUtils { @@ -556,6 +557,24 @@ export class HttpUrlUtils {
556 return url 557 return url
557 } 558 }
558 559
  560 + /*评论状态*/
  561 + static getBatchCommentStatusUrl() {
  562 + let url = HttpUrlUtils._hostUrl + "/api/rmrb-comment/comment/zh/c/batchCommentStatus"
  563 + return url
  564 + }
  565 +
  566 + /*levleIcon*/
  567 + static getBatchUserUrl() {
  568 + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-point/auth/level/zh/c/batchUser"
  569 + return url
  570 + }
  571 +
  572 + /*authIcon 20个一次上限*/
  573 + static getDetailListUrl() {
  574 + let url = HttpUrlUtils._hostUrl + "/api/rmrb-contact/contact/zh/c/master/detailList"
  575 + return url
  576 + }
  577 +
559 578
560 //账户注销 579 //账户注销
561 static accountLogoutUrl() { 580 static accountLogoutUrl() {
@@ -756,6 +775,12 @@ export class HttpUrlUtils { @@ -756,6 +775,12 @@ export class HttpUrlUtils {
756 return url 775 return url
757 } 776 }
758 777
  778 + //点赞
  779 + static executeLike() {
  780 + let url = HttpUrlUtils._hostUrl + "/api/rmrb-interact/interact/zh/c/like/executeLike";
  781 + return url;
  782 + }
  783 +
759 // static getYcgCommonHeaders(): HashMap<string, string> { 784 // static getYcgCommonHeaders(): HashMap<string, string> {
760 // let headers: HashMap<string, string> = new HashMap<string, string>() 785 // let headers: HashMap<string, string> = new HashMap<string, string>()
761 // 786 //
@@ -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 // 设置页
@@ -82,7 +82,6 @@ export struct WdWebLocalComponent { @@ -82,7 +82,6 @@ export struct WdWebLocalComponent {
82 82
83 //webview 高度设置 83 //webview 高度设置
84 private setCurrentPageOperate: (data: Message) => void = (data) => { 84 private setCurrentPageOperate: (data: Message) => void = (data) => {
85 - console.log("setCurrentPageOperate", JSON.stringify(data))  
86 if (data.handlerName === H5CallNativeType.jsCall_currentPageOperate && data?.data?.operateType === '8') { 85 if (data.handlerName === H5CallNativeType.jsCall_currentPageOperate && data?.data?.operateType === '8') {
87 if (typeof this.webHeight === 'number') { 86 if (typeof this.webHeight === 'number') {
88 if (Number(data?.data?.webViewHeight) > this.webHeight) { 87 if (Number(data?.data?.webViewHeight) > this.webHeight) {
@@ -19,7 +19,7 @@ export interface CompDTO { @@ -19,7 +19,7 @@ export interface CompDTO {
19 name: string; 19 name: string;
20 objectId: string; // 跳转页面id? 20 objectId: string; // 跳转页面id?
21 objectTitle: string; // comp标题 21 objectTitle: string; // comp标题
22 - // objectType?: any; // 跳转类型,枚举: 22 + objectType?: string; // 跳转类型,枚举:
23 operDataList: ContentDTO[]; // 运营数据列表【正常运营配置的强运营数据,部分推荐场景的配置(自动源兜底数据)】 23 operDataList: ContentDTO[]; // 运营数据列表【正常运营配置的强运营数据,部分推荐场景的配置(自动源兜底数据)】
24 // pageId?: any; 24 // pageId?: any;
25 posterSize: string; 25 posterSize: string;
@@ -20,4 +20,5 @@ export interface Params { @@ -20,4 +20,5 @@ export interface Params {
20 // 17.多图(图集)详情页 20 // 17.多图(图集)详情页
21 detailPageType?: number; // 详情页类型 21 detailPageType?: number; // 详情页类型
22 liveStyle?: number; // 直播类型:0横屏,1竖屏 22 liveStyle?: number; // 直播类型:0横屏,1竖屏
  23 + creatorId?: string; //号主id
23 } 24 }
@@ -69,3 +69,5 @@ export { newsSkeleton } from "./src/main/ets/components/skeleton/newsSkeleton" @@ -69,3 +69,5 @@ export { newsSkeleton } from "./src/main/ets/components/skeleton/newsSkeleton"
69 69
70 export { LiveCommentComponent } from "./src/main/ets/components/comment/view/LiveCommentComponent" 70 export { LiveCommentComponent } from "./src/main/ets/components/comment/view/LiveCommentComponent"
71 71
  72 +export { WDViewDefaultType } from "./src/main/ets/components/view/EmptyComponent"
  73 +
@@ -20,6 +20,7 @@ import { CardParser } from './CardParser'; @@ -20,6 +20,7 @@ import { CardParser } from './CardParser';
20 import { LiveHorizontalReservationComponent } from './view/LiveHorizontalReservationComponent'; 20 import { LiveHorizontalReservationComponent } from './view/LiveHorizontalReservationComponent';
21 import { ZhGridLayout02 } from './compview/ZhGridLayout02'; 21 import { ZhGridLayout02 } from './compview/ZhGridLayout02';
22 import { Card5Component } from './cardview/Card5Component' 22 import { Card5Component } from './cardview/Card5Component'
  23 +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
23 24
24 /** 25 /**
25 * comp适配器. 26 * comp适配器.
@@ -32,7 +33,9 @@ export struct CompParser { @@ -32,7 +33,9 @@ export struct CompParser {
32 compIndex: number = 0; 33 compIndex: number = 0;
33 34
34 build() { 35 build() {
35 - this.componentBuilder(this.compDTO, this.compIndex); 36 + Column() {
  37 + this.componentBuilder(this.compDTO, this.compIndex);
  38 + }
36 } 39 }
37 40
38 @Builder 41 @Builder
@@ -53,8 +56,6 @@ export struct CompParser { @@ -53,8 +56,6 @@ export struct CompParser {
53 ZhSingleRow02({ compDTO }) 56 ZhSingleRow02({ compDTO })
54 } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_03) { 57 } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_03) {
55 LiveHorizontalReservationComponent({ compDTO: compDTO }) 58 LiveHorizontalReservationComponent({ compDTO: compDTO })
56 - } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_06) {  
57 - ZhSingleRow06({ compDTO })  
58 } else if (compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { 59 } else if (compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) {
59 ZhGridLayout02({ compDTO: compDTO }) 60 ZhGridLayout02({ compDTO: compDTO })
60 } else if (compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) { 61 } else if (compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) {
@@ -68,8 +69,6 @@ export struct CompParser { @@ -68,8 +69,6 @@ export struct CompParser {
68 ZhSingleColumn04({ compDTO: compDTO }) 69 ZhSingleColumn04({ compDTO: compDTO })
69 } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_05) { 70 } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_05) {
70 ZhSingleColumn05({ compDTO: compDTO }) 71 ZhSingleColumn05({ compDTO: compDTO })
71 - } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_09) {  
72 - ZhSingleColumn09({ compDTO: compDTO })  
73 } else if (!Number.isNaN(Number(compDTO.compStyle))) { 72 } else if (!Number.isNaN(Number(compDTO.compStyle))) {
74 CardParser({ contentDTO: compDTO.operDataList[0] }); 73 CardParser({ contentDTO: compDTO.operDataList[0] });
75 } 74 }
@@ -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() {
1 -import { Logger, NumberFormatterUtils } from 'wdKit'; 1 +import { Logger, NumberFormatterUtils, DateTimeUtils } from 'wdKit';
2 import { 2 import {
3 Action, 3 Action,
4 ContentDetailDTO, 4 ContentDetailDTO,
@@ -14,15 +14,15 @@ import DetailViewModel from '../viewmodel/DetailViewModel'; @@ -14,15 +14,15 @@ import DetailViewModel from '../viewmodel/DetailViewModel';
14 import { ImageAndTextWebComponent } from './ImageAndTextWebComponent'; 14 import { ImageAndTextWebComponent } from './ImageAndTextWebComponent';
15 import router from '@ohos.router'; 15 import router from '@ohos.router';
16 import { RecommendList } from '../components/view/RecommendList' 16 import { RecommendList } from '../components/view/RecommendList'
17 -import { CommonConstants } from 'wdConstant' 17 +import { CommonConstants } from 'wdConstant';
18 import { HttpUrlUtils } from 'wdNetwork/Index'; 18 import { HttpUrlUtils } from 'wdNetwork/Index';
19 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 19 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
20 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; 20 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
21 import { PageRepository } from '../repository/PageRepository'; 21 import { PageRepository } from '../repository/PageRepository';
22 -import { detailedSkeleton } from './skeleton/detailSkeleton' 22 +import { detailedSkeleton } from './skeleton/detailSkeleton';
  23 +const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
23 24
24 const TAG = 'ImageAndTextPageComponent' 25 const TAG = 'ImageAndTextPageComponent'
25 -  
26 @Component 26 @Component
27 export struct ImageAndTextPageComponent { 27 export struct ImageAndTextPageComponent {
28 scroller: Scroller = new Scroller(); 28 scroller: Scroller = new Scroller();
@@ -32,7 +32,7 @@ export struct ImageAndTextPageComponent { @@ -32,7 +32,7 @@ export struct ImageAndTextPageComponent {
32 @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 32 @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
33 @State interactData: InteractDataDTO = {} as InteractDataDTO 33 @State interactData: InteractDataDTO = {} as InteractDataDTO
34 @State isPageEnd: boolean = false 34 @State isPageEnd: boolean = false
35 - 35 + @State publishTime: string = ''
36 build() { 36 build() {
37 Column() { 37 Column() {
38 if (!this.isPageEnd) { 38 if (!this.isPageEnd) {
@@ -40,10 +40,10 @@ export struct ImageAndTextPageComponent { @@ -40,10 +40,10 @@ export struct ImageAndTextPageComponent {
40 } else { 40 } else {
41 // 发布时间 41 // 发布时间
42 Row() { 42 Row() {
43 - Image($r('app.media.icon_ren_min_ri_bao'))  
44 - .width(70) 43 + Image(this.contentDetailData[0]?.rmhInfo ? $r('app.media.logo_rmh') : $r('app.media.logo_rmrb'))
  44 + .width(80)
45 .height(28) 45 .height(28)
46 - Text(this.contentDetailData[0]?.publishTime) 46 + Text(this.publishTime)
47 .fontColor($r('app.color.color_B0B0B0')) 47 .fontColor($r('app.color.color_B0B0B0'))
48 .fontSize($r('app.float.font_size_13')) 48 .fontSize($r('app.float.font_size_13'))
49 .height('100%') 49 .height('100%')
@@ -151,6 +151,8 @@ export struct ImageAndTextPageComponent { @@ -151,6 +151,8 @@ export struct ImageAndTextPageComponent {
151 let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType) 151 let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType)
152 if (detailBeans && detailBeans.length > 0) { 152 if (detailBeans && detailBeans.length > 0) {
153 this.contentDetailData = detailBeans; 153 this.contentDetailData = detailBeans;
  154 + let dateTime = DateTimeUtils.parseDate(this.contentDetailData[0]?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN);
  155 + this.publishTime = DateTimeUtils.formatDate(dateTime,PATTERN_DATE_CN_RN)
154 if (this.contentDetailData[0]?.recommendShow === 1) { 156 if (this.contentDetailData[0]?.recommendShow === 1) {
155 this.getRecommend() 157 this.getRecommend()
156 } 158 }
  1 +import { abilityAccessCtrl, common, Permissions } from '@kit.AbilityKit';
  2 +import { http } from '@kit.NetworkKit';
  3 +import { BusinessError } from '@kit.BasicServicesKit';
  4 +import { promptAction } from '@kit.ArkUI';
  5 +import { image } from '@kit.ImageKit';
  6 +import { photoAccessHelper } from '@kit.MediaLibraryKit';
  7 +import fs from '@ohos.file.fs';
  8 +
  9 +const PERMISSIONS: Array<Permissions> = [
  10 + 'ohos.permission.READ_IMAGEVIDEO',
  11 + 'ohos.permission.WRITE_IMAGEVIDEO'
  12 +];
  13 +
  14 +/*
  15 + * saveButton参考文档
  16 + * https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/savebutton-0000001820999677
  17 + * */
  18 +@Component
  19 +export struct ImageDownloadComponent {
  20 + @State image: PixelMap | undefined = undefined;
  21 + @State photoAccessHelper: photoAccessHelper.PhotoAccessHelper | undefined = undefined; // 相册模块管理实例
  22 + @State imageBuffer: ArrayBuffer | undefined = undefined; // 图片ArrayBuffer
  23 + url: string = ''
  24 +
  25 + build() {
  26 + Column() {
  27 + SaveButton({ icon: SaveIconStyle.LINES })
  28 + .iconColor(Color.White)
  29 + .onClick(async () => {
  30 + console.info(`cj2024 onClick ${this.imageBuffer}`)
  31 + if (this.imageBuffer !== undefined) {
  32 + await this.saveImage(this.imageBuffer);
  33 + promptAction.showToast({
  34 + message: $r('app.string.image_request_success'),
  35 + duration: 2000
  36 + })
  37 + }
  38 + })
  39 + }
  40 +
  41 + }
  42 +
  43 + async aboutToAppear(): Promise<void> {
  44 + console.info(`cj2024 图片下载 ${this.url}`)
  45 + const context = getContext(this) as common.UIAbilityContext;
  46 + const atManager = abilityAccessCtrl.createAtManager();
  47 + await atManager.requestPermissionsFromUser(context, PERMISSIONS);
  48 + this.getPicture();
  49 + }
  50 +
  51 + /**
  52 + * 通过http的request方法从网络下载图片资源
  53 + */
  54 + async getPicture() {
  55 + console.info(`cj2024 getPicture`)
  56 + http.createHttp()
  57 + .request(this.url,
  58 + (error: BusinessError, data: http.HttpResponse) => {
  59 + if (error) {
  60 + // 下载失败时弹窗提示检查网络,不执行后续逻辑
  61 + promptAction.showToast({
  62 + message: $r('app.string.image_request_fail'),
  63 + duration: 2000
  64 + })
  65 + return;
  66 + }
  67 + this.transcodePixelMap(data);
  68 + // 判断网络获取到的资源是否为ArrayBuffer类型
  69 + console.info(`cj2024 getPicture ${data.result}`)
  70 + if (data.result instanceof ArrayBuffer) {
  71 + console.info(`cj2024 getPicture 222`)
  72 + this.imageBuffer = data.result as ArrayBuffer;
  73 + }
  74 + }
  75 + )
  76 + }
  77 +
  78 + /**
  79 + * 使用createPixelMap将ArrayBuffer类型的图片装换为PixelMap类型
  80 + * @param data:网络获取到的资源
  81 + */
  82 + transcodePixelMap(data: http.HttpResponse) {
  83 + console.info(`cj2024 transcodePixelMap ${data.responseCode}`)
  84 + if (http.ResponseCode.OK === data.responseCode) {
  85 + const imageData: ArrayBuffer = data.result as ArrayBuffer;
  86 + // 通过ArrayBuffer创建图片源实例。
  87 + const imageSource: image.ImageSource = image.createImageSource(imageData);
  88 + const options: image.InitializationOptions = {
  89 + 'alphaType': 0, // 透明度
  90 + 'editable': false, // 是否可编辑
  91 + 'pixelFormat': 3, // 像素格式
  92 + 'scaleMode': 1, // 缩略值
  93 + 'size': { height: 100, width: 100 }
  94 + }; // 创建图片大小
  95 +
  96 + // 通过属性创建PixelMap
  97 + imageSource.createPixelMap(options).then((pixelMap: PixelMap) => {
  98 + this.image = pixelMap;
  99 + });
  100 + }
  101 + }
  102 +
  103 + /**
  104 + * 保存ArrayBuffer到图库
  105 + * @param buffer:图片ArrayBuffer
  106 + * @returns
  107 + */
  108 + async saveImage(buffer: ArrayBuffer | string): Promise<void> {
  109 + console.info(`cj2024 saveImage buffer ${buffer}`)
  110 + const context = getContext(this) as common.UIAbilityContext; // 获取getPhotoAccessHelper需要的context
  111 + const helper = photoAccessHelper.getPhotoAccessHelper(context); // 获取相册管理模块的实例
  112 + const uri = await helper.createAsset(photoAccessHelper.PhotoType.IMAGE, 'jpg'); // 指定待创建的文件类型、后缀和创建选项,创建图片或视频资源
  113 + console.info(`cj2024 saveImage uri ${uri}`)
  114 + const file = await fs.open(uri, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE);
  115 + await fs.write(file.fd, buffer);
  116 + await fs.close(file.fd);
  117 + }
  118 +}
1 import { PhotoListBean } from 'wdBean/Index'; 1 import { PhotoListBean } from 'wdBean/Index';
2 import { Logger } from 'wdKit/Index'; 2 import { Logger } from 'wdKit/Index';
3 -import { MultiPictureDetailItemComponent } from './MultiPictureDetailItemComponent';  
4 -import { display } from '@kit.ArkUI'; 3 +import { display, router } from '@kit.ArkUI';
  4 +import { ImageDownloadComponent } from './ImageDownloadComponent';
  5 +import { ImageItemView } from './view/ImageItemView';
5 6
6 const TAG = 'ImageSwiperComponent'; 7 const TAG = 'ImageSwiperComponent';
7 8
@@ -16,6 +17,9 @@ export struct ImageSwiperComponent { @@ -16,6 +17,9 @@ export struct ImageSwiperComponent {
16 private screenWidth: number = 0 17 private screenWidth: number = 0
17 private picWidth: number = 0 18 private picWidth: number = 0
18 @State picHeight: number = 0 19 @State picHeight: number = 0
  20 + @State isEnableSwipe: boolean = true;
  21 +
  22 + // @Provide bgc: Color = Color.White;
19 23
20 //watch监听页码回调 24 //watch监听页码回调
21 onCurrentPageNumUpdated(): void { 25 onCurrentPageNumUpdated(): void {
@@ -35,10 +39,25 @@ export struct ImageSwiperComponent { @@ -35,10 +39,25 @@ export struct ImageSwiperComponent {
35 39
36 build() { 40 build() {
37 RelativeContainer() { 41 RelativeContainer() {
  42 + Image($r('app.media.icon_arrow_left_white'))
  43 + .width(24)
  44 + .height(24)
  45 + .aspectRatio(1)
  46 + .interpolation(ImageInterpolation.High)
  47 + .alignRules({
  48 + top: { anchor: "__container__", align: VerticalAlign.Top },
  49 + left: { anchor: "__container__", align: HorizontalAlign.Start }
  50 + })
  51 + .onClick(() => {
  52 + router.back();
  53 + })
  54 + .id("backImg")
  55 +
38 if (this.photoList && this.photoList?.length > 0) { 56 if (this.photoList && this.photoList?.length > 0) {
39 Swiper(this.swiperController) { 57 Swiper(this.swiperController) {
40 ForEach(this.photoList, (item: PhotoListBean) => { 58 ForEach(this.photoList, (item: PhotoListBean) => {
41 - MultiPictureDetailItemComponent({ MultiPictureDetailItem: item }) 59 + // MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })
  60 + ImageItemView({ MultiPictureDetailItem: item, isEnableSwipe: this.isEnableSwipe })
42 }) 61 })
43 } 62 }
44 .index(this.swiperIndex) 63 .index(this.swiperIndex)
@@ -96,6 +115,19 @@ export struct ImageSwiperComponent { @@ -96,6 +115,19 @@ export struct ImageSwiperComponent {
96 middle: { anchor: "__container__", align: HorizontalAlign.Center } 115 middle: { anchor: "__container__", align: HorizontalAlign.Center }
97 }) 116 })
98 } 117 }
  118 +
  119 + ImageDownloadComponent({ url: this.photoList[this.swiperIndex].picPath })
  120 + .alignRules({
  121 + bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
  122 + right: { anchor: "__container__", align: HorizontalAlign.End }
  123 + })
  124 + .margin({
  125 + top: 8,
  126 + left: 18,
  127 + bottom: 24,
  128 + right: 18
  129 + })
  130 + .id("downloadImg")
99 } 131 }
100 .width('100%') 132 .width('100%')
101 .height('100%') 133 .height('100%')
1 import { PhotoListBean } from 'wdBean'; 1 import { PhotoListBean } from 'wdBean';
2 import { Logger } from 'wdKit'; 2 import { Logger } from 'wdKit';
  3 +import router from '@ohos.router';
  4 +import display from '@ohos.display';
3 5
4 const TAG = 'MultiPictureDetailPageComponent'; 6 const TAG = 'MultiPictureDetailPageComponent';
5 7
6 @Component 8 @Component
7 export struct MultiPictureDetailItemComponent { 9 export struct MultiPictureDetailItemComponent {
8 private MultiPictureDetailItem: PhotoListBean = {} as PhotoListBean 10 private MultiPictureDetailItem: PhotoListBean = {} as PhotoListBean
  11 + //alt app.media.picture_loading 设计稿尺寸
  12 + @State imageWidth:string | number = 167
  13 + @State ratio:number = 167/60
  14 + private scroller: Scroller = new Scroller()
  15 + private displayTool = display.getDefaultDisplaySync()
  16 + @State picHeight: number = 0
9 17
10 18
11 async aboutToAppear() { 19 async aboutToAppear() {
12 Logger.info(TAG, 'pictures preview') 20 Logger.info(TAG, 'pictures preview')
  21 + this.picHeight = this.displayTool.width * 578 / 375
13 } 22 }
14 23
15 build() { 24 build() {
16 - Stack({ alignContent: Alignment.BottomStart }) {  
17 - Row() {  
18 - Image(this.MultiPictureDetailItem.picPath)  
19 - .alt($r('app.media.picture_loading'))  
20 - .width('100%')  
21 - .aspectRatio(this.MultiPictureDetailItem.width / this.MultiPictureDetailItem.height)  
22 - .objectFit(ImageFit.Fill)  
23 - .interpolation(ImageInterpolation.High)  
24 - }  
25 - .height('100%')  
26 - .width('100%') 25 + Row() {
  26 + Image(this.MultiPictureDetailItem.picPath)
  27 + .alt($r('app.media.picture_loading'))
  28 + .width(this.imageWidth)
  29 + .aspectRatio(this.ratio)
  30 + .objectFit(ImageFit.Fill)
  31 + .interpolation(ImageInterpolation.High)
  32 + .onComplete(event => {
  33 + this.imageWidth = '100%'
  34 + this.ratio = this.MultiPictureDetailItem.width / this.MultiPictureDetailItem.height
  35 + })
  36 + /*.onDrop(event => {
  37 + router.back();
  38 + })
  39 + .draggable(true)*/
  40 + /*Scroll(this.scroller) {
27 41
  42 + }
  43 + .scrollable(ScrollDirection.Vertical)
  44 + .scrollBarWidth(0)
  45 + .height(px2vp(this.picHeight))*/
28 } 46 }
29 - .backgroundColor(Color.Black) 47 + .height('100%')
30 .width('100%') 48 .width('100%')
  49 + .backgroundColor(Color.Black)
  50 + .justifyContent(FlexAlign.Center)
31 } 51 }
32 } 52 }
1 -import { Logger } from 'wdKit'; 1 +import { Logger, SPHelper } from 'wdKit';
  2 +import { ResponseDTO } from 'wdNetwork';
2 import { 3 import {
3 ContentDetailDTO, 4 ContentDetailDTO,
4 PhotoListBean, 5 PhotoListBean,
@@ -11,10 +12,12 @@ import display from '@ohos.display'; @@ -11,10 +12,12 @@ import display from '@ohos.display';
11 import font from '@ohos.font'; 12 import font from '@ohos.font';
12 import { OperRowListView } from './view/OperRowListView'; 13 import { OperRowListView } from './view/OperRowListView';
13 import { MultiPictureDetailItemComponent } from './MultiPictureDetailItemComponent'; 14 import { MultiPictureDetailItemComponent } from './MultiPictureDetailItemComponent';
  15 +import { EmptyComponent } from './view/EmptyComponent';
14 import { DateTimeUtils } from 'wdKit/Index'; 16 import { DateTimeUtils } from 'wdKit/Index';
15 import { HttpUrlUtils } from 'wdNetwork/Index'; 17 import { HttpUrlUtils } from 'wdNetwork/Index';
16 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 18 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
17 import { PageRepository } from '../repository/PageRepository'; 19 import { PageRepository } from '../repository/PageRepository';
  20 +import { SpConstants } from 'wdConstant/Index';
18 21
19 const TAG = 'MultiPictureDetailPageComponent'; 22 const TAG = 'MultiPictureDetailPageComponent';
20 23
@@ -34,6 +37,7 @@ export struct MultiPictureDetailPageComponent { @@ -34,6 +37,7 @@ export struct MultiPictureDetailPageComponent {
34 @State swiperIndex: number = 0; 37 @State swiperIndex: number = 0;
35 @Provide followStatus: string = '0' // 关注状态 38 @Provide followStatus: string = '0' // 关注状态
36 private scroller: Scroller = new Scroller() 39 private scroller: Scroller = new Scroller()
  40 + @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
37 41
38 //watch监听页码回调 42 //watch监听页码回调
39 onCurrentPageNumUpdated(): void { 43 onCurrentPageNumUpdated(): void {
@@ -56,10 +60,6 @@ export struct MultiPictureDetailPageComponent { @@ -56,10 +60,6 @@ export struct MultiPictureDetailPageComponent {
56 familySrc: $rawfile('font/BebasNeue_Regular.otf') 60 familySrc: $rawfile('font/BebasNeue_Regular.otf')
57 }) 61 })
58 this.getContentDetailData() 62 this.getContentDetailData()
59 - if (HttpUrlUtils.getUserId()) {  
60 - this.getInteractBrowsOperate()  
61 - this.getBatchAttentionStatus()  
62 - }  
63 } 63 }
64 64
65 aboutToDisappear() { 65 aboutToDisappear() {
@@ -238,24 +238,33 @@ export struct MultiPictureDetailPageComponent { @@ -238,24 +238,33 @@ export struct MultiPictureDetailPageComponent {
238 }) 238 })
239 .height(px2vp(this.titleHeight) + 64) 239 .height(px2vp(this.titleHeight) + 64)
240 240
241 - OperRowListView({  
242 - contentDetailData: this.contentDetailData,  
243 - })  
244 - .alignRules({  
245 - bottom: { anchor: "__container__", align: VerticalAlign.Bottom },  
246 - middle: { anchor: "__container__", align: HorizontalAlign.Center }  
247 - })  
248 - .width('100%')  
249 - .height(56)  
250 - .margin({  
251 - top: 16,  
252 - left: 16,  
253 - right: 16,  
254 - bottom: 0  
255 - })  
256 - .border({ width: { top: 0.5 }, color: '#FFFFFF' })  
257 - .id('e_oper_row') 241 + } else {
  242 + if(this.netStatus !== undefined) {
  243 + EmptyComponent({ emptyType: this.netStatus})
  244 + .id('e_empty_content')
  245 + .alignRules({
  246 + center: { anchor: "__container__", align: VerticalAlign.Center },
  247 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
  248 + })
  249 + }
258 } 250 }
  251 + OperRowListView({
  252 + contentDetailData: this.contentDetailData,
  253 + })
  254 + .alignRules({
  255 + bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
  256 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
  257 + })
  258 + .width('100%')
  259 + .height(56)
  260 + .margin({
  261 + top: 16,
  262 + left: 16,
  263 + right: 16,
  264 + bottom: 0
  265 + })
  266 + .border({ width: { top: 0.5 }, color: '#FFFFFF' })
  267 + .id('e_oper_row')
259 } 268 }
260 .width('100%') 269 .width('100%')
261 .height('100%') 270 .height('100%')
@@ -266,11 +275,44 @@ export struct MultiPictureDetailPageComponent { @@ -266,11 +275,44 @@ export struct MultiPictureDetailPageComponent {
266 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) 275 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
267 } 276 }
268 277
269 - private async getContentDetailData() { 278 + private getContentDetailData() {
270 try { 279 try {
271 - let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType)  
272 - this.contentDetailData = data?.[0];  
273 - Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`) 280 + PageRepository.fetchDetailData(this.relId, this.contentId, this.relType).then((resDTO: ResponseDTO<ContentDetailDTO[]>) => {
  281 + // Logger.info(TAG, `fetchDetailData then,navResDTO.timestamp ${resDTO.timestamp}`);
  282 + // Logger.info(TAG, `fetchDetailData then,navResDTO: ${JSON.stringify(resDTO)}`);
  283 + // Logger.info(TAG, `fetchDetailData then,navResDTO.data: ${JSON.stringify(resDTO.data)}`);
  284 + if (!resDTO || !resDTO.data) {
  285 + Logger.error(TAG, 'fetchDetailData is empty');
  286 + return
  287 + }
  288 + if (resDTO.code != 0) {
  289 + Logger.error(TAG, `fetchDetailData then code:${resDTO.code}, message:${resDTO.message}`);
  290 + return
  291 + }
  292 + this.contentDetailData = resDTO.data?.[0];
  293 + if(this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) {
  294 + this.netStatus = 0
  295 + }
  296 + Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`)
  297 + if (HttpUrlUtils.getUserId()) {
  298 + this.getInteractBrowsOperate()
  299 + this.getBatchAttentionStatus()
  300 + }
  301 + }).catch((err: Error) => {
  302 + Logger.info(TAG, `fetchDetailData then,err: ${JSON.stringify(err)}`);
  303 + /*// 请求失败处理
  304 + if (err.response) {
  305 + // 请求已发出,但服务器响应的状态码不在2xx范围内
  306 + console.error('请求失败,状态码:', err.response.status);
  307 + console.error('响应数据:', err.response.data);
  308 + } else if (err.request) {
  309 + // 请求已发出,但无响应(例如:网络故障)
  310 + console.error('请求已发出,但无响应:', err.request);
  311 + } else {
  312 + // 发生了其他类型的错误(如配置错误或拒绝权限等)
  313 + console.error('请求发生错误:', err.message);
  314 + }*/
  315 + })
274 } catch (exception) { 316 } catch (exception) {
275 317
276 } 318 }
@@ -312,9 +354,10 @@ export struct MultiPictureDetailPageComponent { @@ -312,9 +354,10 @@ export struct MultiPictureDetailPageComponent {
312 /** 354 /**
313 * 关注号主 355 * 关注号主
314 */ 356 */
315 - handleAccention() { 357 + async handleAccention() {
316 // 未登录,跳转登录 358 // 未登录,跳转登录
317 - if (!HttpUrlUtils.getUserId()) { 359 + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
  360 + if (!user_id) {
318 WDRouterRule.jumpWithPage(WDRouterPage.loginPage) 361 WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
319 return 362 return
320 } 363 }
@@ -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 }
  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 +
@@ -11,7 +11,7 @@ export struct LiveCommentComponent { @@ -11,7 +11,7 @@ export struct LiveCommentComponent {
11 11
12 build() { 12 build() {
13 Row() { 13 Row() {
14 - Image($r('app.media.back_icon')) 14 + Image($r('app.media.iv_back_left_black'))
15 .width(24) 15 .width(24)
16 .height(24) 16 .height(24)
17 .margin({ 17 .margin({
@@ -71,7 +71,7 @@ export struct LiveCommentComponent { @@ -71,7 +71,7 @@ export struct LiveCommentComponent {
71 left: 6, 71 left: 6,
72 right: 2 72 right: 2
73 }) 73 })
74 - Image(this.isLike ? $r('app.media.iv_live_comment_hert_light') : $r('app.media.comment_like_normal')) 74 + Image(this.isLike ? $r('app.media.icon_like_selected_redheart') : $r('app.media.iv_live_heart_normal'))
75 .width(24) 75 .width(24)
76 .height(24) 76 .height(24)
77 .margin({ 77 .margin({
@@ -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
@@ -19,7 +19,6 @@ export default struct MinePagePersonFunctionUI { @@ -19,7 +19,6 @@ export default struct MinePagePersonFunctionUI {
19 .interpolation(ImageInterpolation.High) 19 .interpolation(ImageInterpolation.High)
20 Text(`${item.msg}`) 20 Text(`${item.msg}`)
21 .margin({top:'8lpx'}) 21 .margin({top:'8lpx'})
22 - .width('50lpx')  
23 .height('23lpx') 22 .height('23lpx')
24 .fontColor($r('app.color.color_222222')) 23 .fontColor($r('app.color.color_222222'))
25 .fontSize('23lpx') 24 .fontSize('23lpx')
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
1 import { Params } from 'wdBean'; 1 import { Params } from 'wdBean';
2 -import { DateTimeUtils, LazyDataSource, StringUtils, UserDataLocal } from 'wdKit';  
3 -import { HttpUrlUtils } from 'wdNetwork'; 2 +import { DateTimeUtils, LazyDataSource,UserDataLocal } from 'wdKit';
4 import { WDRouterPage, WDRouterRule } from 'wdRouter'; 3 import { WDRouterPage, WDRouterRule } from 'wdRouter';
5 import MinePageDatasModel from '../../../model/MinePageDatasModel'; 4 import MinePageDatasModel from '../../../model/MinePageDatasModel';
6 import { CommentListItem } from '../../../viewmodel/CommentListItem'; 5 import { CommentListItem } from '../../../viewmodel/CommentListItem';
7 import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; 6 import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem';
8 import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem'; 7 import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem';
9 -import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRequestItem';  
10 import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; 8 import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI';
  9 +import { FollowChildComponent } from '../follow/FollowChildComponent';
11 10
12 const TAG = "HomePageBottomComponent" 11 const TAG = "HomePageBottomComponent"
13 @Component 12 @Component
@@ -21,6 +20,7 @@ export struct HomePageBottomComponent{ @@ -21,6 +20,7 @@ export struct HomePageBottomComponent{
21 @State count:number = 0; 20 @State count:number = 0;
22 @State isMineAccount:boolean = true; 21 @State isMineAccount:boolean = true;
23 @State userId:string = ""; 22 @State userId:string = "";
  23 + @Link commentNum:number
24 24
25 aboutToAppear(){ 25 aboutToAppear(){
26 this.getNewPageData() 26 this.getNewPageData()
@@ -35,30 +35,33 @@ export struct HomePageBottomComponent{ @@ -35,30 +35,33 @@ export struct HomePageBottomComponent{
35 35
36 if(this.count === 0){ 36 if(this.count === 0){
37 if(this.style === 1){ 37 if(this.style === 1){
38 - Row(){  
39 - Text("关注更多人民号")  
40 - .fontWeight('400lpx')  
41 - .fontColor($r('app.color.color_222222'))  
42 - .lineHeight('38lpx')  
43 - .fontSize('27lpx')  
44 - .textAlign(TextAlign.Center)  
45 - .margin({right:'4lpx'})  
46 - Image($r('app.media.arrow_icon_right'))  
47 - .objectFit(ImageFit.Auto)  
48 - .width('27lpx')  
49 - .height('27lpx')  
50 - }.height('69lpx')  
51 - .width('659lpx')  
52 - .alignItems(VerticalAlign.Center)  
53 - .justifyContent(FlexAlign.Center)  
54 - .backgroundColor($r('app.color.color_F5F5F5'))  
55 - .margin({top:'31lpx',bottom:'4lpx'})  
56 - .onClick(()=>{  
57 - let params: Params = {  
58 - pageID: "1"  
59 - }  
60 - WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params)  
61 - }) 38 + Column(){
  39 + Row(){
  40 + Text("关注更多人民号")
  41 + .fontWeight('400lpx')
  42 + .fontColor($r('app.color.color_222222'))
  43 + .lineHeight('38lpx')
  44 + .fontSize('27lpx')
  45 + .textAlign(TextAlign.Center)
  46 + .margin({right:'4lpx'})
  47 + Image($r('app.media.arrow_icon_right'))
  48 + .objectFit(ImageFit.Auto)
  49 + .width('27lpx')
  50 + .height('27lpx')
  51 + }.height('69lpx')
  52 + .width('659lpx')
  53 + .alignItems(VerticalAlign.Center)
  54 + .justifyContent(FlexAlign.Center)
  55 + .backgroundColor($r('app.color.color_F5F5F5'))
  56 + .margin({top:'31lpx',bottom:'4lpx'})
  57 + .onClick(()=>{
  58 + let params: Params = {
  59 + pageID: "1"
  60 + }
  61 + WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params)
  62 + })
  63 + }.layoutWeight(1)
  64 + .justifyContent(FlexAlign.Start)
62 }else{ 65 }else{
63 ListHasNoMoreDataUI({style:2}) 66 ListHasNoMoreDataUI({style:2})
64 .layoutWeight(1) 67 .layoutWeight(1)
@@ -95,7 +98,7 @@ export struct HomePageBottomComponent{ @@ -95,7 +98,7 @@ export struct HomePageBottomComponent{
95 98
96 LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => { 99 LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => {
97 ListItem() { 100 ListItem() {
98 - ChildFollowComponent({data: item}) 101 + FollowChildComponent({data: item,type:1})
99 } 102 }
100 .onClick(() => { 103 .onClick(() => {
101 }) 104 })
@@ -184,7 +187,7 @@ export struct HomePageBottomComponent{ @@ -184,7 +187,7 @@ export struct HomePageBottomComponent{
184 this.hasMore = false 187 this.hasMore = false
185 }else{ 188 }else{
186 value.list.forEach((value)=>{ 189 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)) 190 + 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 }) 191 })
189 this.data_follow.notifyDataReload() 192 this.data_follow.notifyDataReload()
190 this.count = this.data_follow.totalCount() 193 this.count = this.data_follow.totalCount()
@@ -210,7 +213,8 @@ export struct HomePageBottomComponent{ @@ -210,7 +213,8 @@ export struct HomePageBottomComponent{
210 this.hasMore = false 213 this.hasMore = false
211 }else{ 214 }else{
212 value.list.forEach((value)=>{ 215 value.list.forEach((value)=>{
213 - this.data_comment.push(new CommentListItem(value.fromUserHeader,value.fromUserName,value.targetTitle,value.createTime,value.commentContent,value.likeNum,0,value.id,value.targetId,value.targetType)) 216 + let publishTime = DateTimeUtils.getCommentTime(DateTimeUtils.parseDate(value.createTime,DateTimeUtils.PATTERN_DATE_TIME_HYPHEN))
  217 + this.data_comment.push(new CommentListItem(value.fromUserHeader,value.fromUserName,value.targetTitle,publishTime,value.commentContent,value.likeNum,0,value.id,value.targetId,value.targetType))
214 }) 218 })
215 this.data_comment.notifyDataReload() 219 this.data_comment.notifyDataReload()
216 this.count = this.data_comment.totalCount() 220 this.count = this.data_comment.totalCount()
@@ -221,6 +225,7 @@ export struct HomePageBottomComponent{ @@ -221,6 +225,7 @@ export struct HomePageBottomComponent{
221 } 225 }
222 } 226 }
223 this.isLoading = false 227 this.isLoading = false
  228 + this.commentNum = value.totalCount
224 }).catch((err:Error)=>{ 229 }).catch((err:Error)=>{
225 console.log(TAG,"请求失败") 230 console.log(TAG,"请求失败")
226 this.isLoading = false 231 this.isLoading = false
@@ -231,107 +236,6 @@ export struct HomePageBottomComponent{ @@ -231,107 +236,6 @@ export struct HomePageBottomComponent{
231 } 236 }
232 237
233 @Component 238 @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 { 239 struct ChildCommentComponent {
336 @ObjectLink data: CommentListItem 240 @ObjectLink data: CommentListItem
337 isLastItem: boolean = false 241 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 }
@@ -18,12 +18,15 @@ export struct BottomNavigationComponent { @@ -18,12 +18,15 @@ export struct BottomNavigationComponent {
18 @Provide bottomRectHeight: number = 0 18 @Provide bottomRectHeight: number = 0
19 @Provide topRectHeight: number = 0 19 @Provide topRectHeight: number = 0
20 @Provide isLayoutFullScreen: boolean = false 20 @Provide isLayoutFullScreen: boolean = false
  21 + @Provide isImmersive: boolean = false // 是否开启沉浸式模式 http://192.168.1.3:3300/project/3802/interface/api/189229
  22 + @Provide isNight: boolean = false // 是否开启夜间模式
21 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 23 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
22 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 24 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
23 // 底导/顶导全部数据 25 // 底导/顶导全部数据
24 @State @Watch('onBottomNavigationDataUpdated') bottomNavList: BottomNavDTO[] = [] 26 @State @Watch('onBottomNavigationDataUpdated') bottomNavList: BottomNavDTO[] = []
25 // 底导当前选中/焦点下标 27 // 底导当前选中/焦点下标
26 @State currentNavIndex: number = BottomNavi.NEWS; 28 @State currentNavIndex: number = BottomNavi.NEWS;
  29 + // @State currentTopNavSelectedIndex: number = 0; //
27 @State barBackgroundColor: Color = Color.Transparent 30 @State barBackgroundColor: Color = Color.Transparent
28 // 底导TabsController 31 // 底导TabsController
29 private navController: TabsController = new TabsController(); 32 private navController: TabsController = new TabsController();
@@ -42,6 +45,8 @@ export struct BottomNavigationComponent { @@ -42,6 +45,8 @@ export struct BottomNavigationComponent {
42 let bottomNav = await PageViewModel.getBottomNavData(getContext(this)) 45 let bottomNav = await PageViewModel.getBottomNavData(getContext(this))
43 if (bottomNav && bottomNav.bottomNavList != null) { 46 if (bottomNav && bottomNav.bottomNavList != null) {
44 Logger.info(TAG, `aboutToAppear, bottomNav.length: ${bottomNav.bottomNavList.length}`); 47 Logger.info(TAG, `aboutToAppear, bottomNav.length: ${bottomNav.bottomNavList.length}`);
  48 + // 使用filter方法移除name为'服务'的项
  49 + bottomNav.bottomNavList = bottomNav.bottomNavList.filter(item => item.name !== '服务');
45 this.bottomNavList = bottomNav.bottomNavList 50 this.bottomNavList = bottomNav.bottomNavList
46 } 51 }
47 } 52 }
@@ -61,7 +66,7 @@ export struct BottomNavigationComponent { @@ -61,7 +66,7 @@ export struct BottomNavigationComponent {
61 } else { 66 } else {
62 TopNavigationComponent({ 67 TopNavigationComponent({
63 groupId: navItem.id, 68 groupId: navItem.id,
64 - topNavList: navItem.topNavChannelList, 69 + topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073),
65 _currentNavIndex: this.currentNavIndex, 70 _currentNavIndex: this.currentNavIndex,
66 changeBarBackgroundColor: (color: Color) => { 71 changeBarBackgroundColor: (color: Color) => {
67 this.barBackgroundColor = color 72 this.barBackgroundColor = color
@@ -2,19 +2,20 @@ import { CustomTitleAndEditUI } from '../reusable/CustomTitleAndEditUI' @@ -2,19 +2,20 @@ 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';
9 import { CompDTO, ContentDTO } from 'wdBean' 9 import { CompDTO, ContentDTO } from 'wdBean'
10 import LoadMoreLayout from './LoadMoreLayout' 10 import LoadMoreLayout from './LoadMoreLayout'
11 import NoMoreLayout from './NoMoreLayout' 11 import NoMoreLayout from './NoMoreLayout'
12 -import { CompParser } from '../CompParser'  
13 import CustomRefreshLoadLayout from './CustomRefreshLoadLayout'; 12 import CustomRefreshLoadLayout from './CustomRefreshLoadLayout';
14 import { CustomSelectUI } from '../view/CustomSelectUI'; 13 import { CustomSelectUI } from '../view/CustomSelectUI';
15 import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI'; 14 import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI';
16 import { BigPicCardComponent } from '../view/BigPicCardComponent'; 15 import { BigPicCardComponent } from '../view/BigPicCardComponent';
17 16
  17 +import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh';
  18 +
18 @Entry 19 @Entry
19 @Component 20 @Component
20 struct BrowsingHistoryPage { 21 struct BrowsingHistoryPage {
@@ -25,6 +26,8 @@ struct BrowsingHistoryPage { @@ -25,6 +26,8 @@ struct BrowsingHistoryPage {
25 @State selectDatas :ContentDTO[] = []; 26 @State selectDatas :ContentDTO[] = [];
26 @Provide deleteNum :number = 0; 27 @Provide deleteNum :number = 0;
27 @Provide isAllSelect:boolean = false 28 @Provide isAllSelect:boolean = false
  29 + private scroller: Scroller = new Scroller();
  30 +
28 aboutToAppear(){ 31 aboutToAppear(){
29 this.getData() 32 this.getData()
30 } 33 }
@@ -37,15 +40,30 @@ struct BrowsingHistoryPage { @@ -37,15 +40,30 @@ struct BrowsingHistoryPage {
37 this.selectDatas = [] 40 this.selectDatas = []
38 this.deleteNum = 0 41 this.deleteNum = 0
39 }}) 42 }})
40 - if (this.browSingModel.viewType == ViewType.LOADING){  
41 - this.LoadingLayout()  
42 - }else if(this.browSingModel.viewType == ViewType.ERROR){  
43 - ErrorComponent()  
44 - }else if(this.browSingModel.viewType == ViewType.EMPTY){  
45 - EmptyComponent()  
46 - }else {  
47 - this.ListLayout()  
48 - } 43 +
  44 + // if (this.browSingModel.viewType == ViewType.LOADING){
  45 + // this.LoadingLayout()
  46 + // }else if(this.browSingModel.viewType == ViewType.ERROR){
  47 + // ErrorComponent()
  48 + // }else if(this.browSingModel.viewType == ViewType.EMPTY){
  49 + EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoHistory})
  50 + // }else {
  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 + // })
  66 + // }
49 67
50 if (this.isEditState){ 68 if (this.isEditState){
51 CustomBottomFuctionUI({ 69 CustomBottomFuctionUI({
@@ -64,34 +82,27 @@ struct BrowsingHistoryPage { @@ -64,34 +82,27 @@ struct BrowsingHistoryPage {
64 } 82 }
65 83
66 @Builder ListLayout() { 84 @Builder ListLayout() {
67 - List() { 85 + List({scroller: this.scroller}) {
68 // 下拉刷新 86 // 下拉刷新
69 - ListItem() {  
70 - RefreshLayout({  
71 - refreshBean: new RefreshLayoutBean(this.browSingModel.isVisiblePullDown, this.browSingModel.pullDownRefreshImage,  
72 - this.browSingModel.pullDownRefreshText, this.browSingModel.pullDownRefreshHeight)  
73 - })  
74 - }  
75 -  
76 ForEach(this.allDatas, (compDTO: ContentDTO, compIndex: number) => { 87 ForEach(this.allDatas, (compDTO: ContentDTO, compIndex: number) => {
77 ListItem() { 88 ListItem() {
78 this.newCompParser(compDTO,compIndex) 89 this.newCompParser(compDTO,compIndex)
79 } 90 }
80 }) 91 })
81 -  
82 // 加载更多 92 // 加载更多
83 ListItem() { 93 ListItem() {
84 if (this.browSingModel.hasMore) { 94 if (this.browSingModel.hasMore) {
85 - LoadMoreLayout({  
86 - refreshBean: new RefreshLayoutBean(this.browSingModel.isVisiblePullUpLoad, this.browSingModel.pullUpLoadImage,  
87 - this.browSingModel.pullUpLoadText, this.browSingModel.pullUpLoadHeight)  
88 - }) 95 + // LoadMoreLayout({
  96 + // refreshBean: new RefreshLayoutBean(this.browSingModel.isVisiblePullUpLoad, this.browSingModel.pullUpLoadImage,
  97 + // this.browSingModel.pullUpLoadText, this.browSingModel.pullUpLoadHeight)
  98 + // })
89 } else { 99 } else {
90 NoMoreLayout() 100 NoMoreLayout()
91 } 101 }
92 } 102 }
93 } 103 }
94 .height(CommonConstants.FULL_PARENT) 104 .height(CommonConstants.FULL_PARENT)
  105 + .edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果
95 } 106 }
96 107
97 @Builder 108 @Builder
@@ -117,9 +128,9 @@ struct BrowsingHistoryPage { @@ -117,9 +128,9 @@ struct BrowsingHistoryPage {
117 $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), this.browSingModel.pullDownRefreshHeight) }) 128 $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), this.browSingModel.pullDownRefreshHeight) })
118 } 129 }
119 130
120 - async getData() {  
121 - this.browSingModel.currentPage = 1 131 + async getData(resolve?: (value: string | PromiseLike<string>) => void){
122 MyCollectionViewModel.fetchMyCollectList(2,'1',this.browSingModel.currentPage,getContext(this)).then(collectionItem => { 132 MyCollectionViewModel.fetchMyCollectList(2,'1',this.browSingModel.currentPage,getContext(this)).then(collectionItem => {
  133 + if(resolve) resolve('刷新成功')
123 if (collectionItem && collectionItem.list && collectionItem.list.length > 0) { 134 if (collectionItem && collectionItem.list && collectionItem.list.length > 0) {
124 this.browSingModel.viewType = ViewType.LOADED; 135 this.browSingModel.viewType = ViewType.LOADED;
125 this.allDatas.push(...collectionItem.list) 136 this.allDatas.push(...collectionItem.list)
@@ -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) => {
@@ -4,17 +4,13 @@ import PageModel from '../../viewmodel/PageModel'; @@ -4,17 +4,13 @@ import PageModel from '../../viewmodel/PageModel';
4 import { CommonConstants, ViewType } from 'wdConstant' 4 import { CommonConstants, ViewType } from 'wdConstant'
5 import { EmptyComponent,WDViewDefaultType } 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'  
8 -import { RefreshLayoutBean } from './RefreshLayoutBean';  
9 -import { CompDTO, ContentDTO } from 'wdBean'  
10 -import LoadMoreLayout from './LoadMoreLayout' 7 +import { ContentDTO } from 'wdBean'
11 import NoMoreLayout from './NoMoreLayout' 8 import NoMoreLayout from './NoMoreLayout'
12 -import { CompParser } from '../CompParser'  
13 -import CustomRefreshLoadLayout from './CustomRefreshLoadLayout';  
14 import { CustomSelectUI } from '../view/CustomSelectUI'; 9 import { CustomSelectUI } from '../view/CustomSelectUI';
15 import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI'; 10 import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI';
16 import { BigPicCardComponent } from '../view/BigPicCardComponent'; 11 import { BigPicCardComponent } from '../view/BigPicCardComponent';
17 import { contentListItemParams } from '../../model/MyCollectionModel'; 12 import { contentListItemParams } from '../../model/MyCollectionModel';
  13 +import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh';
18 14
19 @Entry 15 @Entry
20 @Component 16 @Component
@@ -26,6 +22,10 @@ struct MyCollectionListPage { @@ -26,6 +22,10 @@ struct MyCollectionListPage {
26 @State selectDatas :ContentDTO[] = []; 22 @State selectDatas :ContentDTO[] = [];
27 @Provide deleteNum :number = 0; 23 @Provide deleteNum :number = 0;
28 @Provide isAllSelect:boolean = false 24 @Provide isAllSelect:boolean = false
  25 +
  26 + @State currentPage: number = 1;
  27 + private scroller: Scroller = new Scroller();
  28 +
29 aboutToAppear(){ 29 aboutToAppear(){
30 this.getData() 30 this.getData()
31 } 31 }
@@ -38,26 +38,44 @@ struct MyCollectionListPage { @@ -38,26 +38,44 @@ struct MyCollectionListPage {
38 this.selectDatas = [] 38 this.selectDatas = []
39 this.deleteNum = 0 39 this.deleteNum = 0
40 }}) 40 }})
41 - if (this.browSingModel.viewType == ViewType.LOADING){  
42 - this.LoadingLayout()  
43 - }else if(this.browSingModel.viewType == ViewType.ERROR){ 41 +
  42 + if(this.browSingModel.viewType == ViewType.ERROR){
44 ErrorComponent() 43 ErrorComponent()
45 }else if(this.browSingModel.viewType == ViewType.EMPTY){ 44 }else if(this.browSingModel.viewType == ViewType.EMPTY){
46 EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoCollection}) 45 EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoCollection})
47 }else { 46 }else {
48 - this.ListLayout()  
49 - }  
50 -  
51 - if (this.isEditState){  
52 - CustomBottomFuctionUI({  
53 - selectAllCallback:(isAllSelect)=>{  
54 - this.allSelectDatas(isAllSelect) 47 + CustomPullToRefresh({
  48 + alldata:this.allDatas,
  49 + scroller:this.scroller,
  50 + customList:()=>{
  51 + this.ListLayout()
  52 + },
  53 + onRefresh:(resolve)=>{
  54 + this.currentPage = 1
  55 + this.getData(resolve)
55 }, 56 },
56 - confirmCallback:()=>{  
57 - this.deleteDatas() 57 + onLoadMore:(resolve)=> {
  58 + if (this.browSingModel.hasMore === false) {
  59 + if(resolve) resolve('')
  60 + return
  61 + }
  62 + this.currentPage++
  63 + this.getData(resolve)
58 } 64 }
59 }) 65 })
60 - .position({y:'92%'}) 66 + }
  67 +
  68 + if (this.isEditState){
  69 + Stack(){
  70 + CustomBottomFuctionUI({
  71 + selectAllCallback:(isAllSelect)=>{
  72 + this.allSelectDatas(isAllSelect)
  73 + },
  74 + confirmCallback:()=>{
  75 + this.deleteDatas()
  76 + }
  77 + })
  78 + }.position({y:'92%'})
61 } 79 }
62 } 80 }
63 .width(CommonConstants.FULL_WIDTH) 81 .width(CommonConstants.FULL_WIDTH)
@@ -65,34 +83,19 @@ struct MyCollectionListPage { @@ -65,34 +83,19 @@ struct MyCollectionListPage {
65 } 83 }
66 84
67 @Builder ListLayout() { 85 @Builder ListLayout() {
68 - List() {  
69 - // 下拉刷新  
70 - ListItem() {  
71 - RefreshLayout({  
72 - refreshBean: new RefreshLayoutBean(this.browSingModel.isVisiblePullDown, this.browSingModel.pullDownRefreshImage,  
73 - this.browSingModel.pullDownRefreshText, this.browSingModel.pullDownRefreshHeight)  
74 - })  
75 - }  
76 - 86 + List({scroller: this.scroller}) {
77 ForEach(this.allDatas, (compDTO: ContentDTO, compIndex: number) => { 87 ForEach(this.allDatas, (compDTO: ContentDTO, compIndex: number) => {
78 ListItem() { 88 ListItem() {
79 this.newCompParser(compDTO,compIndex) 89 this.newCompParser(compDTO,compIndex)
80 } 90 }
81 }) 91 })
82 -  
83 // 加载更多 92 // 加载更多
84 ListItem() { 93 ListItem() {
85 - if (this.browSingModel.hasMore) {  
86 - LoadMoreLayout({  
87 - refreshBean: new RefreshLayoutBean(this.browSingModel.isVisiblePullUpLoad, this.browSingModel.pullUpLoadImage,  
88 - this.browSingModel.pullUpLoadText, this.browSingModel.pullUpLoadHeight)  
89 - })  
90 - } else {  
91 - NoMoreLayout()  
92 - } 94 + if (this.browSingModel.hasMore === false) NoMoreLayout()
93 } 95 }
94 } 96 }
95 .height(CommonConstants.FULL_PARENT) 97 .height(CommonConstants.FULL_PARENT)
  98 + .edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果
96 } 99 }
97 100
98 @Builder 101 @Builder
@@ -113,25 +116,25 @@ struct MyCollectionListPage { @@ -113,25 +116,25 @@ struct MyCollectionListPage {
113 } 116 }
114 } 117 }
115 118
116 - @Builder LoadingLayout() {  
117 - CustomRefreshLoadLayout({ refreshBean: new RefreshLayoutBean(true,  
118 - $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), this.browSingModel.pullDownRefreshHeight) })  
119 - }  
120 -  
121 - async getData() {  
122 - this.browSingModel.currentPage = 1  
123 - MyCollectionViewModel.fetchMyCollectList(1,'1',this.browSingModel.currentPage,getContext(this)).then(collectionItem => { 119 + async getData(resolve?: (value: string | PromiseLike<string>) => void) {
  120 + MyCollectionViewModel.fetchMyCollectList(1,'1',this.currentPage,getContext(this)).then(collectionItem => {
  121 + if(resolve) resolve('刷新成功')
124 if (collectionItem && collectionItem.list && collectionItem.list.length > 0) { 122 if (collectionItem && collectionItem.list && collectionItem.list.length > 0) {
125 - this.browSingModel.viewType = ViewType.LOADED;  
126 - this.allDatas.push(...collectionItem.list)  
127 - if (collectionItem.list.length === this.browSingModel.pageSize) {  
128 - this.browSingModel.currentPage++;  
129 - this.browSingModel.hasMore = true;  
130 - } else { 123 + if (this.currentPage === 1) {
  124 + this.allDatas = []
  125 + this.allDatas.push(...collectionItem.list)
  126 + }else {
  127 + this.allDatas = this.allDatas.concat(...collectionItem.list)
  128 + }
  129 + if (collectionItem.hasNext === 0) {
131 this.browSingModel.hasMore = false; 130 this.browSingModel.hasMore = false;
  131 + } else {
  132 + this.browSingModel.hasMore = true;
132 } 133 }
133 } else { 134 } else {
134 - this.browSingModel.viewType = ViewType.EMPTY; 135 + if (this.currentPage === 1) {
  136 + this.browSingModel.viewType = ViewType.EMPTY;
  137 + }
135 } 138 }
136 }) 139 })
137 } 140 }
@@ -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
  1 +import { QualityCommentsComponent } from '../comment/view/QualityCommentsComponent';
  2 +
  3 +@Entry
  4 +@Component
  5 +struct QualityCommentsPage {
  6 + build() {
  7 + Column(){
  8 + QualityCommentsComponent();
  9 + }
  10 +
  11 + }
  12 +}
@@ -151,36 +151,25 @@ export struct TopNavigationComponent { @@ -151,36 +151,25 @@ export struct TopNavigationComponent {
151 } 151 }
152 152
153 indexChange() { 153 indexChange() {
154 - if (this._currentNavIndex === 2 && this.currentTopNavSelectedIndex === 0 && this.changeBarBackgroundColor) {  
155 - this.barBackgroundColor = Color.Black  
156 - this.changeBarBackgroundColor(this.barBackgroundColor)  
157 - } else {  
158 - this.barBackgroundColor = Color.Transparent  
159 - this.changeBarBackgroundColor(this.barBackgroundColor)  
160 - }  
161 154
  155 + // 判断视频频道待处理
162 if (this._currentNavIndex === 2 && this.currentTopNavSelectedIndex == 0) { 156 if (this._currentNavIndex === 2 && this.currentTopNavSelectedIndex == 0) {
163 - if (!this.isLayoutFullScreen) {  
164 - const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage  
165 - const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口  
166 - windowClass.setWindowLayoutFullScreen(true).then(() => {  
167 - this.isLayoutFullScreen = true  
168 - this.bottomRectHeight = this.bottomSafeHeight  
169 - this.topRectHeight = this.topSafeHeight  
170 - })  
171 - } 157 + this.barBackgroundColor = Color.Black
  158 + this.changeBarBackgroundColor && this.changeBarBackgroundColor(this.barBackgroundColor)
  159 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
  160 + WindowModel.shared.setWindowLayoutFullScreen(true)
  161 + this.isLayoutFullScreen = true
  162 + this.bottomRectHeight = this.bottomSafeHeight
  163 + this.topRectHeight = this.topSafeHeight
172 164
173 } else { 165 } else {
174 - if (this.isLayoutFullScreen) {  
175 - const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage  
176 - const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口  
177 - windowClass.setWindowLayoutFullScreen(false).then(() => {  
178 - this.isLayoutFullScreen = false  
179 - this.bottomRectHeight = 0  
180 - this.topRectHeight = 0  
181 - console.error(' this.isLayoutFullScreen ', this.isLayoutFullScreen)  
182 - })  
183 - } 166 + this.barBackgroundColor = Color.Transparent
  167 + this.changeBarBackgroundColor && this.changeBarBackgroundColor(this.barBackgroundColor)
  168 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
  169 + WindowModel.shared.setWindowLayoutFullScreen(false)
  170 + this.isLayoutFullScreen = false
  171 + this.bottomRectHeight = 0
  172 + this.topRectHeight = 0
184 } 173 }
185 } 174 }
186 175
@@ -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 })
  1 +import { PullToRefresh, PullToRefreshConfigurator } from '@ohos/pulltorefresh';
  2 +
  3 +@Component
  4 +export struct CustomPullToRefresh {
  5 + @Link alldata: Object[];
  6 + scroller: Scroller = new Scroller();
  7 + @BuilderParam customList: () => void;
  8 + onRefresh: (resolve?: (value: string | PromiseLike<string>) => void) => void = () => {
  9 + }
  10 + onLoadMore: (resolve?: (value: string | PromiseLike<string>) => void) => void = () => {
  11 + }
  12 + ///是否存在上拉更多
  13 + @Prop hasMore: boolean = true
  14 + refreshConfigurator: PullToRefreshConfigurator = new PullToRefreshConfigurator().setHasLoadMore(this.hasMore);
  15 + build() {
  16 + Column(){
  17 + PullToRefresh({
  18 + data:this.alldata,
  19 + scroller:this.scroller,
  20 + refreshConfigurator:this.refreshConfigurator,
  21 + customList:()=>{
  22 + this.customList();
  23 + },
  24 + onRefresh:()=>{
  25 + return new Promise<string>((resolve, reject) => {
  26 + this.onRefresh(resolve)
  27 + });
  28 + },
  29 + onLoadMore:()=>{
  30 + return new Promise<string>((resolve, reject) => {
  31 + this.onLoadMore(resolve)
  32 + });
  33 + },
  34 + customLoad: null,
  35 + customRefresh: null,
  36 + })
  37 + }
  38 + }
  39 +}
  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 { CommonConstants } from 'wdConstant' 1 import { CommonConstants } from 'wdConstant'
2 -import { ContentDTO,CompDTO } from 'wdBean' 2 +import { ContentDTO, CompDTO } from 'wdBean'
  3 +import { ProcessUtils } from '../../utils/ProcessUtils';
3 4
4 @Component 5 @Component
5 export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { 6 export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
@@ -59,13 +60,12 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { @@ -59,13 +60,12 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
59 .padding({ left: (index == 0) ? 16 : 0, right: (index == this.compDTO.operDataList.length - 1) ? 16 : 0 }) 60 .padding({ left: (index == 0) ? 16 : 0, right: (index == this.compDTO.operDataList.length - 1) ? 16 : 0 })
60 // .offset({x:16}) 61 // .offset({x:16})
61 .onClick(() => { 62 .onClick(() => {
62 - if (item.objectType != '0') {  
63 - console.log(item.objectId)  
64 - } 63 + ProcessUtils.processPage(item)
65 }) 64 })
66 }) 65 })
67 66
68 }.listDirection(Axis.Horizontal) 67 }.listDirection(Axis.Horizontal)
  68 + .scrollBar(BarState.Off)
69 .width('100%') 69 .width('100%')
70 70
71 // .backgroundColor($r("app.color.color_FE4B05")) 71 // .backgroundColor($r("app.color.color_FE4B05"))
@@ -2,10 +2,12 @@ import { Action, CompDTO, ContentDTO, Params } from 'wdBean' @@ -2,10 +2,12 @@ import { Action, CompDTO, ContentDTO, Params } from 'wdBean'
2 import { WDRouterRule } from 'wdRouter/Index' 2 import { WDRouterRule } from 'wdRouter/Index'
3 import { Logger } from 'wdKit/Index' 3 import { Logger } from 'wdKit/Index'
4 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' 4 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'
  5 +import { LiveModel } from '../../viewmodel/LiveModel'
5 6
6 @Component 7 @Component
7 export struct HorizontalStrokeCardThreeTwoRadioForOneComponent { 8 export struct HorizontalStrokeCardThreeTwoRadioForOneComponent {
8 @State compDTO: CompDTO = {} as CompDTO 9 @State compDTO: CompDTO = {} as CompDTO
  10 +
9 build() { 11 build() {
10 Column() { 12 Column() {
11 Row() { 13 Row() {
@@ -30,7 +32,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent { @@ -30,7 +32,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent {
30 .height(14) 32 .height(14)
31 } 33 }
32 }.justifyContent(FlexAlign.SpaceBetween) 34 }.justifyContent(FlexAlign.SpaceBetween)
33 - .margin({ top: 8 ,bottom: 8}) 35 + .margin({ top: 8, bottom: 8 })
34 .width('100%') 36 .width('100%')
35 37
36 38
@@ -45,12 +47,13 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent { @@ -45,12 +47,13 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent {
45 .fontColor($r("app.color.color_212228")) 47 .fontColor($r("app.color.color_212228"))
46 .fontWeight(400) 48 .fontWeight(400)
47 .maxLines(1) 49 .maxLines(1)
48 - .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 50 + .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
49 .textAlign(TextAlign.Start) 51 .textAlign(TextAlign.Start)
50 .margin({ top: 8 }) 52 .margin({ top: 8 })
51 .width('100%') 53 .width('100%')
52 54
53 - }.width("100%") 55 + }
  56 + .width("100%")
54 .padding({ 57 .padding({
55 top: 14, 58 top: 14,
56 left: 16, 59 left: 16,
@@ -59,16 +62,26 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent { @@ -59,16 +62,26 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent {
59 }) 62 })
60 .backgroundColor($r("app.color.white")) 63 .backgroundColor($r("app.color.white"))
61 .margin({ bottom: 8 }) 64 .margin({ bottom: 8 })
62 - .onClick(()=>{ 65 + .onClick(() => {
63 this.gotoLive(this.compDTO?.operDataList[0]) 66 this.gotoLive(this.compDTO?.operDataList[0])
64 }) 67 })
65 } 68 }
66 - gotoLive(content: ContentDTO) { 69 +
  70 + async gotoLive(content: ContentDTO) {
  71 + const liveDetail = await LiveModel.getLiveDetails(content?.objectId || '', content?.relId || '', content?.relType || '')
  72 + const liveStyle = liveDetail[0].liveInfo.liveStyle
  73 + const liveState = liveDetail[0].liveInfo.liveState
  74 +
  75 +
  76 + console.error('liveDetail===', liveDetail)
  77 +
  78 +
67 let taskAction: Action = { 79 let taskAction: Action = {
68 type: 'JUMP_DETAIL_PAGE', 80 type: 'JUMP_DETAIL_PAGE',
69 params: { 81 params: {
70 detailPageType: 2, 82 detailPageType: 2,
71 contentID: content?.objectId, 83 contentID: content?.objectId,
  84 + liveStyle: liveState === 'wait' ? 0 : liveStyle,
72 extra: { 85 extra: {
73 relType: content?.relType, 86 relType: content?.relType,
74 relId: content?.relId, 87 relId: content?.relId,
@@ -76,6 +89,6 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent { @@ -76,6 +89,6 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent {
76 } as Params, 89 } as Params,
77 }; 90 };
78 WDRouterRule.jumpWithAction(taskAction) 91 WDRouterRule.jumpWithAction(taskAction)
79 - Logger.debug(`gotoLive, ${content.objectId}`); 92 + // Logger.debug(TAG, `gotoLive, ${content.objectId}`);
80 } 93 }
81 } 94 }
  1 +import { image } from '@kit.ImageKit';
  2 +import { matrix4, promptAction, window } from '@kit.ArkUI';
  3 +import { BusinessError } from '@kit.BasicServicesKit';
  4 +import { ScaleModel } from '../../model/ScaleModel';
  5 +import { OffsetModel } from '../../model/OffsetModel';
  6 +import { windowSizeManager } from '../../utils/Managers';
  7 +import { runWithAnimation } from '../../utils/FuncUtils';
  8 +import { PhotoListBean } from 'wdBean/Index';
  9 +import { http } from '@kit.NetworkKit';
  10 +
  11 +// TODO:知识点:组件复用
  12 +@Reusable
  13 +@Component
  14 +export struct ImageItemView {
  15 + @Consume private bgc: Color;
  16 + @Link isEnableSwipe: boolean; // TODO:需求:多图切换
  17 + @State isEnableOffset: boolean = false;
  18 + @State imageScaleInfo: ScaleModel = new ScaleModel(1.0, 1.0, 1.5, 0.3);
  19 + @State imageOffsetInfo: OffsetModel = new OffsetModel(0, 0);
  20 + @State matrix: matrix4.Matrix4Transit = matrix4.identity().copy();
  21 + @State imagePixelMap: image.PixelMap | null = null; // 当前图片pixelMap,用于Image组件显示
  22 + @State fitWH: "width" | "height" | undefined = undefined; // 表示当前图片是根据宽度适配还是高度适配
  23 + @State imageDefaultSize: image.Size = { width: 0, height: 0 }; // 图片默认大小,即,与屏幕大小最适配的显示大小
  24 + imageUri: string = ""; // 当前图片uri
  25 + imageWHRatio: number = 0; // 图片原始宽高比
  26 + private MultiPictureDetailItem: PhotoListBean = {} as PhotoListBean
  27 + @State imageBuffer: ArrayBuffer | undefined = undefined; // 图片ArrayBuffer
  28 +
  29 + aboutToAppear(): void {
  30 + this.imageUri = this.MultiPictureDetailItem.picPath
  31 + this.getPicture()
  32 + }
  33 +
  34 + /**
  35 + * 通过http的request方法从网络下载图片资源
  36 + */
  37 + async getPicture() {
  38 + console.info(`cj2024 getPicture`)
  39 + http.createHttp()
  40 + .request(this.imageUri,
  41 + (error: BusinessError, data: http.HttpResponse) => {
  42 + if (error) {
  43 + // 下载失败时弹窗提示检查网络,不执行后续逻辑
  44 + promptAction.showToast({
  45 + message: $r('app.string.image_request_fail'),
  46 + duration: 2000
  47 + })
  48 + return;
  49 + }
  50 + this.transcodePixelMap(data);
  51 + // 判断网络获取到的资源是否为ArrayBuffer类型
  52 + console.info(`cj2024 getPicture ${data.result}`)
  53 + if (data.result instanceof ArrayBuffer) {
  54 + console.info(`cj2024 getPicture 222`)
  55 + this.imageBuffer = data.result as ArrayBuffer;
  56 + }
  57 + }
  58 + )
  59 + }
  60 +
  61 + /**
  62 + * 使用createPixelMap将ArrayBuffer类型的图片装换为PixelMap类型
  63 + * @param data:网络获取到的资源
  64 + */
  65 + transcodePixelMap(data: http.HttpResponse) {
  66 + console.info(`cj2024 transcodePixelMap ${data.responseCode}`)
  67 + if (http.ResponseCode.OK === data.responseCode) {
  68 + const imageData: ArrayBuffer = data.result as ArrayBuffer;
  69 + // 通过ArrayBuffer创建图片源实例。
  70 + const imageSource: image.ImageSource = image.createImageSource(imageData);
  71 + this.initCurrentImageInfo(imageSource);
  72 + }
  73 + }
  74 +
  75 + /**
  76 + * 根据图片宽高比及窗口大小计算图片的默认宽高,即,图片最适配屏幕的大小
  77 + * @param imageWHRatio:图片原始宽高比
  78 + * @param size:窗口大小{with:number,height:number}
  79 + * @returns image.Size
  80 + */
  81 + calcImageDefaultSize(imageWHRatio: number, size: window.Size): image.Size {
  82 + let width = 0
  83 + let height = 0;
  84 + if (imageWHRatio > size.width / size.height) {
  85 + // 图片宽高比大于屏幕宽高比,图片默认以屏幕宽度进行显示
  86 + width = size.width;
  87 + height = size.width / imageWHRatio;
  88 + } else {
  89 + height = size.height;
  90 + width = size.height * imageWHRatio;
  91 + }
  92 + return { width: width, height: height };
  93 + }
  94 +
  95 + /**
  96 + * TODO:知识点:根据图片大小(宽高<=屏幕宽高)和屏幕大小计算图片放大适配屏幕进行显示的缩放倍率
  97 + * @param imageSize:图片当前大小
  98 + * @param windowSize:窗口大小
  99 + * @returns:缩放倍率
  100 + */
  101 + calcFitScaleRatio(imageSize: image.Size, windowSize: window.Size): number {
  102 + let ratio: number = 1.0;
  103 + if (windowSize.width > imageSize.width) {
  104 + ratio = windowSize.width / imageSize.width;
  105 + } else {
  106 + ratio = windowSize.height / imageSize.height;
  107 + }
  108 + return ratio;
  109 + }
  110 +
  111 + /**
  112 + * 设置当前图片的相关信息:uri、whRatio、pixelMap、fitWH、defaultSize、maxScaleValue
  113 + * TODO:知识点:提前获取图片的信息,以进行Image组件的尺寸设置及后续的相关计算
  114 + */
  115 + initCurrentImageInfo(imageSource: image.ImageSource): void {
  116 + this.matrix = matrix4.identity().copy();
  117 + // const imageSource: image.ImageSource = image.createImageSource(this.imageUri);
  118 + imageSource.getImageInfo(0).then((data: image.ImageInfo) => {
  119 + this.imageWHRatio = data.size.width / data.size.height;
  120 + this.imageDefaultSize = this.calcImageDefaultSize(this.imageWHRatio, windowSizeManager.get());
  121 + if (this.imageDefaultSize.width === windowSizeManager.get().width) {
  122 + this.fitWH = "width";
  123 + } else {
  124 + this.fitWH = "height";
  125 + }
  126 + this.imageScaleInfo.maxScaleValue += this.fitWH === "width" ?
  127 + (windowSizeManager.get().height / this.imageDefaultSize.height) :
  128 + (windowSizeManager.get().width / this.imageDefaultSize.width);
  129 + }).catch((err: BusinessError) => {
  130 + console.error(`[error][getImageInfo]${err.message}`);
  131 + });
  132 + imageSource.createPixelMap().then((data: image.PixelMap) => {
  133 + this.imagePixelMap = data;
  134 + }).catch((err: BusinessError) => {
  135 + console.error(`[error][createPixelMap]${err.message}`);
  136 + });
  137 + this.isEnableOffset = false;
  138 + this.imageScaleInfo.reset();
  139 + this.imageOffsetInfo.reset();
  140 + }
  141 +
  142 + /**
  143 + * 在图片消失时,将当前图片的信息设置为默认值
  144 + */
  145 + resetCurrentImageInfo(): void {
  146 + this.imageScaleInfo.reset();
  147 + this.imageOffsetInfo.reset();
  148 + this.matrix = matrix4.identity().copy();
  149 + }
  150 +
  151 + /**
  152 + * TODO:需求:在偏移时评估是否到达边界,以便进行位移限制与图片的切换
  153 + * @returns:长度为4的boolean数组,表示上下左右是否到达边界
  154 + */
  155 + evaluateBound(): boolean[] {
  156 + return [false, false, false, false];
  157 + }
  158 +
  159 + build() {
  160 + Stack() {
  161 + Image(this.imagePixelMap)// TODO:知识点:宽高只根据其尺寸设置一个,通过保持宽高比来设置另一个属性
  162 + .width(this.fitWH === "width" ? "100%" : undefined)
  163 + .height(this.fitWH === "height" ? "100%" : undefined)
  164 + .aspectRatio(this.imageWHRatio)
  165 + .objectFit(ImageFit.Cover)// TODO:知识点:保持宽高比进行缩放,可以超出父组件,以便实现多图切换的增强功能
  166 + .autoResize(false)
  167 + .transform(this.matrix)// TODO:知识点:通过matrix控制图片的缩放
  168 + .defaultFocus(true)
  169 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
  170 + .offset({
  171 + // TODO:知识点:通过offset控制图片的偏移
  172 + x: this.imageOffsetInfo.currentX,
  173 + y: this.imageOffsetInfo.currentY
  174 + })
  175 + }
  176 + .onBlur(() => {
  177 + this.resetCurrentImageInfo();
  178 + })
  179 + // .backgroundColor(this.bgc)
  180 + .alignContent(Alignment.Center)
  181 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
  182 + .width("100%")
  183 + .height("100%")
  184 + .gesture(
  185 + GestureGroup(
  186 + GestureMode.Exclusive,
  187 + // TODO:知识点:双击切换图片大小
  188 + TapGesture({ count: 2 })
  189 + .onAction(() => {
  190 + let fn: Function;
  191 + // 已经是放大状态下,双击缩小
  192 + if (this.imageScaleInfo.scaleValue > this.imageScaleInfo.defaultScaleValue) {
  193 + fn = () => {
  194 + this.isEnableSwipe = true;
  195 + this.imageScaleInfo.reset();
  196 + this.imageOffsetInfo.reset();
  197 + this.matrix = matrix4.identity().copy();
  198 + };
  199 + } else {
  200 + // 已经是缩小状态,双击放大
  201 + fn = () => {
  202 + this.isEnableSwipe = false;
  203 + const ratio: number = this.calcFitScaleRatio(this.imageDefaultSize, windowSizeManager.get());
  204 + this.imageScaleInfo.scaleValue = ratio;
  205 + this.imageOffsetInfo.reset();
  206 + this.matrix = matrix4.identity().scale({
  207 + x: ratio,
  208 + y: ratio,
  209 + }).copy();
  210 + this.imageScaleInfo.stash();
  211 + }
  212 + }
  213 + runWithAnimation(fn);
  214 + }),
  215 + // 单击切换背景色
  216 + // TapGesture({ count: 1 }).onAction(() => {
  217 + // runWithAnimation(() => {
  218 + // this.bgc = this.bgc === Color.White ? Color.Black : Color.White;
  219 + // });
  220 + // }),
  221 + // TODO:知识点:双指捏合缩放图片
  222 + PinchGesture({ fingers: 2, distance: 1 })
  223 + .onActionUpdate((event: GestureEvent) => {
  224 + this.imageScaleInfo.scaleValue = this.imageScaleInfo.lastValue * event.scale;
  225 + // TODO:知识点:缩放时不允许大于最大缩放因子+额外缩放因子,不允许小于默认大小-额外缩放因子,额外缩放因子用于提升用户体验
  226 + if (this.imageScaleInfo.scaleValue > this.imageScaleInfo.maxScaleValue *
  227 + (1 + this.imageScaleInfo.extraScaleValue)
  228 + ) {
  229 + this.imageScaleInfo.scaleValue = this.imageScaleInfo.maxScaleValue *
  230 + (1 + this.imageScaleInfo.extraScaleValue);
  231 + }
  232 + if (this.imageScaleInfo.scaleValue < this.imageScaleInfo.defaultScaleValue *
  233 + (1 - this.imageScaleInfo.extraScaleValue)) {
  234 + this.imageScaleInfo.scaleValue = this.imageScaleInfo.defaultScaleValue *
  235 + (1 - this.imageScaleInfo.extraScaleValue);
  236 + }
  237 + // TODO:知识点:matrix默认缩放中心为组件中心
  238 + this.matrix = matrix4.identity().scale({
  239 + x: this.imageScaleInfo.scaleValue,
  240 + y: this.imageScaleInfo.scaleValue,
  241 + }).copy();
  242 + console.debug(this.imageScaleInfo.toString());
  243 + })
  244 + .onActionEnd((event: GestureEvent) => {
  245 + /**
  246 + * TODO:知识点:当小于默认大小时,恢复为默认大小
  247 + */
  248 + if (this.imageScaleInfo.scaleValue < this.imageScaleInfo.defaultScaleValue) {
  249 + runWithAnimation(() => {
  250 + this.imageScaleInfo.reset();
  251 + this.imageOffsetInfo.reset();
  252 + this.matrix = matrix4.identity().copy();
  253 + })
  254 + }
  255 + // TODO:知识点:当大于最大缩放因子时,恢复到最大
  256 + if (this.imageScaleInfo.scaleValue > this.imageScaleInfo.maxScaleValue) {
  257 + runWithAnimation(() => {
  258 + this.imageScaleInfo.scaleValue = this.imageScaleInfo.maxScaleValue;
  259 + this.matrix = matrix4.identity()
  260 + .scale({
  261 + x: this.imageScaleInfo.maxScaleValue,
  262 + y: this.imageScaleInfo.maxScaleValue
  263 + });
  264 + })
  265 + }
  266 + this.imageScaleInfo.stash();
  267 + }),
  268 + // // TODO:知识点:滑动图片
  269 + // PanGesture({ fingers: 1 })// TODO:需求:默认大小下左右滑动应当是切换图片
  270 + // .onActionUpdate((event: GestureEvent) => {
  271 + // if (this.imageScaleInfo.scaleValue === this.imageScaleInfo.defaultScaleValue) {
  272 + // // 默认大小下不允许移动
  273 + // return;
  274 + // }
  275 + // this.imageOffsetInfo.currentX = this.imageOffsetInfo.lastX + event.offsetX;
  276 + // this.imageOffsetInfo.currentY = this.imageOffsetInfo.lastY + event.offsetY;
  277 + // })
  278 + // .onActionEnd((event: GestureEvent) => {
  279 + // this.imageOffsetInfo.stash();
  280 + // })
  281 + ),
  282 + )
  283 + }
  284 +}
  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 +}
@@ -6,6 +6,7 @@ import { WDRouterRule } from 'wdRouter/Index' @@ -6,6 +6,7 @@ import { WDRouterRule } from 'wdRouter/Index'
6 import { CardMediaInfo } from '../cardCommon/CardMediaInfo' 6 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
7 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' 7 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'
8 import { Logger } from 'wdKit/Index' 8 import { Logger } from 'wdKit/Index'
  9 +import { LiveModel } from '../../viewmodel/LiveModel'
9 10
10 @Component 11 @Component
11 export struct LiveHorizontalCardComponent { 12 export struct LiveHorizontalCardComponent {
@@ -100,12 +101,22 @@ export struct LiveHorizontalCardComponent { @@ -100,12 +101,22 @@ export struct LiveHorizontalCardComponent {
100 }) 101 })
101 .backgroundColor($r("app.color.white")) 102 .backgroundColor($r("app.color.white"))
102 } 103 }
103 - gotoLive(content: ContentDTO) { 104 +
  105 + async gotoLive(content: ContentDTO) {
  106 + const liveDetail = await LiveModel.getLiveDetails(content?.objectId || '', content?.relId || '', content?.relType || '')
  107 + const liveStyle = liveDetail[0].liveInfo.liveStyle
  108 + const liveState = liveDetail[0].liveInfo.liveState
  109 +
  110 +
  111 + console.error('liveDetail===', liveDetail)
  112 +
  113 +
104 let taskAction: Action = { 114 let taskAction: Action = {
105 type: 'JUMP_DETAIL_PAGE', 115 type: 'JUMP_DETAIL_PAGE',
106 params: { 116 params: {
107 detailPageType: 2, 117 detailPageType: 2,
108 contentID: content?.objectId, 118 contentID: content?.objectId,
  119 + liveStyle: liveState === 'wait' ? 0 : liveStyle,
109 extra: { 120 extra: {
110 relType: content?.relType, 121 relType: content?.relType,
111 relId: content?.relId, 122 relId: content?.relId,
@@ -113,6 +124,6 @@ export struct LiveHorizontalCardComponent { @@ -113,6 +124,6 @@ export struct LiveHorizontalCardComponent {
113 } as Params, 124 } as Params,
114 }; 125 };
115 WDRouterRule.jumpWithAction(taskAction) 126 WDRouterRule.jumpWithAction(taskAction)
116 - Logger.debug(`gotoLive, ${content.objectId}`); 127 + // Logger.debug(TAG, `gotoLive, ${content.objectId}`);
117 } 128 }
118 } 129 }
@@ -6,6 +6,7 @@ import { Logger, StringUtils } from 'wdKit/Index' @@ -6,6 +6,7 @@ import { Logger, StringUtils } from 'wdKit/Index'
6 import { CardMediaInfo } from '../cardCommon/CardMediaInfo' 6 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
7 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' 7 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'
8 import { WDRouterRule } from 'wdRouter/Index' 8 import { WDRouterRule } from 'wdRouter/Index'
  9 +import { LiveModel } from '../../viewmodel/LiveModel'
9 10
10 @Component 11 @Component
11 export struct LiveHorizontalReservationComponent { 12 export struct LiveHorizontalReservationComponent {
@@ -92,12 +93,21 @@ export struct LiveHorizontalReservationComponent { @@ -92,12 +93,21 @@ export struct LiveHorizontalReservationComponent {
92 .backgroundColor($r("app.color.white")) 93 .backgroundColor($r("app.color.white"))
93 } 94 }
94 95
95 - gotoLive(content: ContentDTO) { 96 + async gotoLive(content: ContentDTO) {
  97 + const liveDetail = await LiveModel.getLiveDetails(content?.objectId || '', content?.relId || '', content?.relType || '')
  98 + const liveStyle = liveDetail[0].liveInfo.liveStyle
  99 + const liveState = liveDetail[0].liveInfo.liveState
  100 +
  101 +
  102 + console.error('liveDetail===', liveDetail)
  103 +
  104 +
96 let taskAction: Action = { 105 let taskAction: Action = {
97 type: 'JUMP_DETAIL_PAGE', 106 type: 'JUMP_DETAIL_PAGE',
98 params: { 107 params: {
99 detailPageType: 2, 108 detailPageType: 2,
100 contentID: content?.objectId, 109 contentID: content?.objectId,
  110 + liveStyle: liveState === 'wait' ? 0 : liveStyle,
101 extra: { 111 extra: {
102 relType: content?.relType, 112 relType: content?.relType,
103 relId: content?.relId, 113 relId: content?.relId,
@@ -105,6 +115,6 @@ export struct LiveHorizontalReservationComponent { @@ -105,6 +115,6 @@ export struct LiveHorizontalReservationComponent {
105 } as Params, 115 } as Params,
106 }; 116 };
107 WDRouterRule.jumpWithAction(taskAction) 117 WDRouterRule.jumpWithAction(taskAction)
108 - Logger.debug(`gotoLive, ${content.objectId}`); 118 + // Logger.debug(TAG, `gotoLive, ${content.objectId}`);
109 } 119 }
110 } 120 }
1 -import { ToastUtils, Logger, NumberFormatterUtils } from 'wdKit'; 1 +import { ToastUtils, Logger, NumberFormatterUtils, SPHelper } from 'wdKit';
2 import { 2 import {
3 InputMethodProperty, 3 InputMethodProperty,
4 batchLikeAndCollectResult, 4 batchLikeAndCollectResult,
@@ -15,6 +15,7 @@ import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailV @@ -15,6 +15,7 @@ import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailV
15 import { HttpUrlUtils } from 'wdNetwork/Index'; 15 import { HttpUrlUtils } from 'wdNetwork/Index';
16 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 16 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
17 import { PageRepository } from '../../repository/PageRepository'; 17 import { PageRepository } from '../../repository/PageRepository';
  18 +import { SpConstants } from 'wdConstant/Index';
18 19
19 export interface OperationItem { 20 export interface OperationItem {
20 icon: Resource; 21 icon: Resource;
@@ -53,8 +54,9 @@ export struct OperRowListView { @@ -53,8 +54,9 @@ export struct OperRowListView {
53 } 54 }
54 ] 55 ]
55 56
56 - aboutToAppear() {  
57 - if (HttpUrlUtils.getUserId()) { 57 + async aboutToAppear() {
  58 + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
  59 + if (user_id) {
58 this.getInteractDataStatus() 60 this.getInteractDataStatus()
59 } 61 }
60 this.queryContentInteractCount() 62 this.queryContentInteractCount()
@@ -338,9 +340,10 @@ export struct OperRowListView { @@ -338,9 +340,10 @@ export struct OperRowListView {
338 /** 340 /**
339 * 点赞、取消点赞 341 * 点赞、取消点赞
340 */ 342 */
341 - toggleLikeStatus() { 343 + async toggleLikeStatus() {
342 // 未登录,跳转登录 344 // 未登录,跳转登录
343 - if (!HttpUrlUtils.getUserId()) { 345 + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
  346 + if (!user_id) {
344 WDRouterRule.jumpWithPage(WDRouterPage.loginPage) 347 WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
345 return 348 return
346 } 349 }
@@ -361,9 +364,10 @@ export struct OperRowListView { @@ -361,9 +364,10 @@ export struct OperRowListView {
361 /** 364 /**
362 * 收藏、取消收藏 365 * 收藏、取消收藏
363 */ 366 */
364 - toggleCollectStatus() { 367 + async toggleCollectStatus() {
365 // 未登录,跳转登录 368 // 未登录,跳转登录
366 - if (!HttpUrlUtils.getUserId()) { 369 + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
  370 + if (!user_id) {
367 WDRouterRule.jumpWithPage(WDRouterPage.loginPage) 371 WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
368 return 372 return
369 } 373 }
@@ -30,10 +30,10 @@ export struct RecommendList { @@ -30,10 +30,10 @@ export struct RecommendList {
30 ForEach(this.recommendList, (item: ContentDTO, index: number) => { 30 ForEach(this.recommendList, (item: ContentDTO, index: number) => {
31 Row() { 31 Row() {
32 CardParser({ contentDTO: item }); 32 CardParser({ contentDTO: item });
33 - }.border({  
34 - width: { bottom: this.recommendList.length === index + 1 ? 0 : 1 },  
35 - color: '#f5f5f5'  
36 - }) 33 + }
  34 + if (this.recommendList.length !== index + 1) {
  35 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  36 + }
37 }, (item: ContentDTO) => JSON.stringify(item)) 37 }, (item: ContentDTO) => JSON.stringify(item))
38 }.width('100%') 38 }.width('100%')
39 } 39 }
@@ -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 {
@@ -16,6 +16,12 @@ export class ContentConstants { @@ -16,6 +16,12 @@ export class ContentConstants {
16 * 5:专题详情 16 * 5:专题详情
17 */ 17 */
18 static readonly TYPE_SPECIAL_TOPIC: string = "5"; 18 static readonly TYPE_SPECIAL_TOPIC: string = "5";
  19 +
  20 + /**
  21 + * 6:链接
  22 + */
  23 + static readonly TYPE_LINK: string = "6";
  24 +
19 /** 25 /**
20 * 8:图文详情,这里是h5页面 26 * 8:图文详情,这里是h5页面
21 */ 27 */
  1 +export class ImageViewerConstants {
  2 + // 缩放动画的持续时间
  3 + static readonly ANIMATE_DURATION: number = 300;
  4 + // swiper中缓存图片的数量
  5 + static readonly SWIPER_CACHE_COUNT: number = 2;
  6 +}
@@ -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 {
@@ -40,7 +40,7 @@ export class EditInfoModel{ @@ -40,7 +40,7 @@ export class EditInfoModel{
40 //生日 40 //生日
41 birthday:string = '' 41 birthday:string = ''
42 //性别 42 //性别
43 - sex:number = 0 43 + sex:number = 10
44 44
45 airec:number = 0 45 airec:number = 0
46 46
  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 +}
@@ -60,7 +60,7 @@ class MinePageDatasModel{ @@ -60,7 +60,7 @@ class MinePageDatasModel{
60 return this.personalData 60 return this.personalData
61 } 61 }
62 this.personalData.push(new MinePagePersonalFunctionsItem("评论",$r('app.media.mine_comment_icon'))) 62 this.personalData.push(new MinePagePersonalFunctionsItem("评论",$r('app.media.mine_comment_icon')))
63 - this.personalData.push(new MinePagePersonalFunctionsItem("关注",$r('app.media.mine_order_icon'))) 63 + this.personalData.push(new MinePagePersonalFunctionsItem("关注",$r('app.media.mine_follow_icon')))
64 this.personalData.push(new MinePagePersonalFunctionsItem("收藏",$r('app.media.mine_collect_icon'))) 64 this.personalData.push(new MinePagePersonalFunctionsItem("收藏",$r('app.media.mine_collect_icon')))
65 this.personalData.push(new MinePagePersonalFunctionsItem("历史",$r('app.media.mine_history_icon'))) 65 this.personalData.push(new MinePagePersonalFunctionsItem("历史",$r('app.media.mine_history_icon')))
66 this.personalData.push(new MinePagePersonalFunctionsItem("消息",$r('app.media.mine_msg_icon'))) 66 this.personalData.push(new MinePagePersonalFunctionsItem("消息",$r('app.media.mine_msg_icon')))
  1 +@Observed
  2 +export class OffsetModel {
  3 + public currentX: number;
  4 + public currentY: number;
  5 + public lastX: number = 0;
  6 + public lastY: number = 0;
  7 +
  8 + constructor(currentX: number = 0, currentY: number = 0) {
  9 + this.currentX = currentX;
  10 + this.currentY = currentY;
  11 + }
  12 +
  13 + reset(): void {
  14 + this.currentX = 0;
  15 + this.currentY = 0;
  16 + this.lastX = 0;
  17 + this.lastY = 0;
  18 + }
  19 +
  20 + stash(): void {
  21 + this.lastX = this.currentX;
  22 + this.lastY = this.currentY;
  23 + }
  24 +
  25 + toString(): string {
  26 + return `[currentX: ${this.currentX} currentY: ${this.currentY} lastX: ${this.lastX} lastY: ${this.lastY}]`;
  27 + }
  28 +}
  1 +@Observed
  2 +export class ScaleModel {
  3 + /**
  4 + * scaleValue: 本次缩放因子,用于控制图片的大小显示
  5 + * lastValue:记录上次缩放完后的缩放因子
  6 + * defaultMaxScaleValue:默认的最大放大值
  7 + * defaultScaleValue:默认缩放值,1
  8 + */
  9 + public scaleValue: number;
  10 + public lastValue: number;
  11 + public maxScaleValue: number;
  12 + public extraScaleValue: number;
  13 + public readonly defaultScaleValue: number = 1;
  14 +
  15 + constructor(scaleValue: number = 1.0, lastValue: number = 1.0,
  16 + maxScaleValue: number = 1.5, extraScaleValue: number = 0.2) {
  17 + this.scaleValue = scaleValue;
  18 + this.lastValue = lastValue;
  19 + this.maxScaleValue = maxScaleValue;
  20 + this.extraScaleValue = extraScaleValue;
  21 + }
  22 +
  23 + reset(): void {
  24 + this.scaleValue = this.defaultScaleValue;
  25 + this.lastValue = this.scaleValue;
  26 + }
  27 +
  28 + stash(): void {
  29 + this.lastValue = this.scaleValue;
  30 + }
  31 +
  32 + toString(): string {
  33 + return `[scaleValue: ${this.scaleValue} lastValue: ${this.lastValue}]`;
  34 + }
  35 +}
@@ -185,10 +185,10 @@ struct MineHomePage { @@ -185,10 +185,10 @@ struct MineHomePage {
185 //tab 页面 185 //tab 页面
186 Tabs({controller: this.controller}) { 186 Tabs({controller: this.controller}) {
187 TabContent() { 187 TabContent() {
188 - HomePageBottomComponent({style:0}) 188 + HomePageBottomComponent({style:0,commentNum:$commentNum})
189 }.tabBar(this.TabBuilder(0,"评论")) 189 }.tabBar(this.TabBuilder(0,"评论"))
190 TabContent() { 190 TabContent() {
191 - HomePageBottomComponent({style:1}) 191 + HomePageBottomComponent({style:1,commentNum:$commentNum})
192 }.tabBar(this.TabBuilder(1,"关注")) 192 }.tabBar(this.TabBuilder(1,"关注"))
193 } 193 }
194 .backgroundColor($r('app.color.white')) 194 .backgroundColor($r('app.color.white'))
@@ -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()
  1 +/**
  2 + * 给函数的执行加上动画
  3 + * @param fn:要在动画内执行的回调函数,通常fn里面会改变状态变量
  4 + * @param duration:动画持续时长
  5 + * @param curve:动画区线
  6 + */
  7 +import { ImageViewerConstants } from '../constants/ImageViewerConstants';
  8 +
  9 +export function runWithAnimation(
  10 + fn: Function,
  11 + duration: number = ImageViewerConstants.ANIMATE_DURATION,
  12 + curve: Curve = Curve.Smooth): void {
  13 + animateTo({ duration: duration, curve: curve }, () => {
  14 + fn();
  15 + })
  16 +}
  1 +import { window } from '@kit.ArkUI';
  2 +
  3 +class WindowSizeManager {
  4 + private size: window.Size = { width: 0, height: 0 };
  5 +
  6 + constructor() {
  7 + window.getLastWindow(getContext()).then((value: window.Window) => {
  8 + const rect: window.Rect = value.getWindowProperties().windowRect;
  9 + this.size.width = px2vp(rect.width);
  10 + this.size.height = px2vp(rect.height);
  11 + console.log(`[windowWidth]${this.size.width} [windowHeight]${this.size.height}`);
  12 + })
  13 + }
  14 +
  15 + get(): window.Size {
  16 + return this.size;
  17 + }
  18 +}
  19 +
  20 +export const windowSizeManager: WindowSizeManager = new WindowSizeManager();
@@ -43,6 +43,9 @@ export class ProcessUtils { @@ -43,6 +43,9 @@ export class ProcessUtils {
43 // 图文详情,跳转h5 43 // 图文详情,跳转h5
44 ProcessUtils.gotoWeb(content); 44 ProcessUtils.gotoWeb(content);
45 break; 45 break;
  46 + case ContentConstants.TYPE_LINK:
  47 + ProcessUtils.gotoDefaultWeb(content);
  48 + break;
46 //图集详情页 49 //图集详情页
47 case ContentConstants.TYPE_NINE: 50 case ContentConstants.TYPE_NINE:
48 ProcessUtils.gotoAtlasDetailPage(content); 51 ProcessUtils.gotoAtlasDetailPage(content);
@@ -53,6 +56,7 @@ export class ProcessUtils { @@ -53,6 +56,7 @@ export class ProcessUtils {
53 break; 56 break;
54 //动态详情页(动态图文) 57 //动态详情页(动态图文)
55 case ContentConstants.TYPE_FOURTEEN: 58 case ContentConstants.TYPE_FOURTEEN:
  59 + break;
56 //动态详情页(动态视频) 60 //动态详情页(动态视频)
57 case ContentConstants.TYPE_FIFTEEN: 61 case ContentConstants.TYPE_FIFTEEN:
58 ProcessUtils.gotoDynamicDetailPage(content); 62 ProcessUtils.gotoDynamicDetailPage(content);
@@ -113,6 +117,17 @@ export class ProcessUtils { @@ -113,6 +117,17 @@ export class ProcessUtils {
113 WDRouterRule.jumpWithAction(taskAction) 117 WDRouterRule.jumpWithAction(taskAction)
114 } 118 }
115 119
  120 + private static gotoDefaultWeb(content: ContentDTO) {
  121 + let taskAction: Action = {
  122 + type: 'JUMP_H5_BY_WEB_VIEW',
  123 + params: {
  124 + url: content.linkUrl,
  125 + } as Params,
  126 + };
  127 + WDRouterRule.jumpWithAction(taskAction)
  128 + Logger.debug(TAG, `gotoWeb, ${content.objectId}`);
  129 + }
  130 +
116 private static gotoWeb(content: ContentDTO) { 131 private static gotoWeb(content: ContentDTO) {
117 // // topicId 132 // // topicId
118 // content.channelId; 133 // content.channelId;
@@ -34,7 +34,7 @@ export class RefreshConstants { @@ -34,7 +34,7 @@ export class RefreshConstants {
34 /** 34 /**
35 * The refresh and load height. 35 * The refresh and load height.
36 */ 36 */
37 - static readonly CUSTOM_LAYOUT_HEIGHT: number = 70; 37 + static readonly CUSTOM_LAYOUT_HEIGHT: number = 90;
38 /** 38 /**
39 * Full the width. 39 * Full the width.
40 */ 40 */
@@ -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 -import { PageDTO, CompDTO, PageInfoDTO } from 'wdBean'; 1 +import { PageDTO, CompDTO, PageInfoDTO, ContentDTO } from 'wdBean';
2 import { CompStyle, ViewType } from 'wdConstant/Index'; 2 import { CompStyle, ViewType } from 'wdConstant/Index';
3 import { CollectionUtils, DateTimeUtils, Logger } from 'wdKit'; 3 import { CollectionUtils, DateTimeUtils, Logger } from 'wdKit';
4 import { closeRefresh } from '../utils/PullDownRefresh'; 4 import { closeRefresh } from '../utils/PullDownRefresh';
@@ -58,7 +58,6 @@ export class PageHelper { @@ -58,7 +58,6 @@ export class PageHelper {
58 if (pageDto && pageDto.compList && pageDto.compList.length > 0) { 58 if (pageDto && pageDto.compList && pageDto.compList.length > 0) {
59 pageModel.viewType = ViewType.LOADED; 59 pageModel.viewType = ViewType.LOADED;
60 let sizeBefore: number = pageModel.compList.size(); 60 let sizeBefore: number = pageModel.compList.size();
61 - pageModel.compList.push(...pageDto.compList)  
62 if (pageDto.compList.length === pageModel.pageSize) { 61 if (pageDto.compList.length === pageModel.pageSize) {
63 pageModel.currentPage++; 62 pageModel.currentPage++;
64 pageModel.hasMore = true; 63 pageModel.hasMore = true;
@@ -66,6 +65,11 @@ export class PageHelper { @@ -66,6 +65,11 @@ export class PageHelper {
66 pageModel.hasMore = false; 65 pageModel.hasMore = false;
67 } 66 }
68 67
  68 + //移除音频 和 活动
  69 + this.removeComp(pageModel,pageDto)
  70 +
  71 + // pageModel.compList.push(...pageDto.compList)
  72 +
69 // TODO 暂时去掉互动数据,待优化。(主要是互动数据返回,如何渲染到ui上) 73 // TODO 暂时去掉互动数据,待优化。(主要是互动数据返回,如何渲染到ui上)
70 // TODO updateItems(sizeBefore, data),这里可能有时序问题,导致覆盖别的group数据,需要优化,考虑精准替换 74 // TODO updateItems(sizeBefore, data),这里可能有时序问题,导致覆盖别的group数据,需要优化,考虑精准替换
71 // 二次请求,批查互动数据 75 // 二次请求,批查互动数据
@@ -108,7 +112,11 @@ export class PageHelper { @@ -108,7 +112,11 @@ export class PageHelper {
108 pageModel.hasMore = false; 112 pageModel.hasMore = false;
109 } 113 }
110 let sizeBefore: number = pageModel.compList.size(); 114 let sizeBefore: number = pageModel.compList.size();
111 - pageModel.compList.push(...data.compList) 115 +
  116 + //移除音频 和 活动
  117 + this.removeComp(pageModel,data)
  118 + //
  119 + // pageModel.compList.push(...data.compList)
112 PageViewModel.getInteractData(data.compList).then((data: CompDTO[]) => { 120 PageViewModel.getInteractData(data.compList).then((data: CompDTO[]) => {
113 // 刷新,替换所有数据 121 // 刷新,替换所有数据
114 pageModel.compList.updateItems(sizeBefore, data) 122 pageModel.compList.updateItems(sizeBefore, data)
@@ -119,6 +127,23 @@ export class PageHelper { @@ -119,6 +127,23 @@ export class PageHelper {
119 promptAction.showToast({ message: err }); 127 promptAction.showToast({ message: err });
120 }) 128 })
121 } 129 }
  130 +
  131 + /**
  132 + * 移除comp
  133 + */
  134 + private removeComp(pageModel: PageModel, pageDto: PageDTO) {
  135 + let datas = pageDto.compList
  136 + for (let index = 0; index < datas.length; index++) {
  137 + const element = datas[index];
  138 + let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0);
  139 + //移除音频 和 活动
  140 + if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) {
  141 + Logger.debug(TAG, 'getGroupData 移除音频 和 活动');
  142 + }else {
  143 + pageModel.compList.push(element)
  144 + }
  145 + }
  146 + }
122 } 147 }
123 148
124 149
@@ -31,6 +31,22 @@ @@ -31,6 +31,22 @@
31 { 31 {
32 "name": "refresh_fail_text", 32 "name": "refresh_fail_text",
33 "value": "刷新失败" 33 "value": "刷新失败"
  34 + },
  35 + {
  36 + "name": "image_request_success",
  37 + "value": "图片下载到图库成功"
  38 + },
  39 + {
  40 + "name": "image_request_fail",
  41 + "value": "图片加载失败,请检查网络"
  42 + },
  43 + {
  44 + "name": "EntryAbility_desc",
  45 + "value": "$string:app_desc"
  46 + },
  47 + {
  48 + "name": "reason_read_write_media",
  49 + "value": "user_grant"
34 } 50 }
35 ] 51 ]
36 } 52 }
@@ -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",
1 -import { TabComponent } from '../widgets/details/TabComponent';  
2 -import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet';  
3 -  
4 -  
5 -@Component  
6 -export struct DetailPlayHLivePage {  
7 - aboutToAppear(): void {  
8 -  
9 - }  
10 -  
11 - build() {  
12 - Column() {  
13 - TopPlayComponent()  
14 - TabComponent()  
15 - }  
16 - .height('100%')  
17 - .width('100%')  
18 - }  
19 -  
20 - onPageShow(): void {  
21 -  
22 - }  
23 -  
24 - aboutToDisappear(): void {  
25 -  
26 - }  
27 -}  
@@ -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
@@ -19,7 +20,9 @@ export struct DetailPlayVLivePage { @@ -19,7 +20,9 @@ export struct DetailPlayVLivePage {
19 @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 20 @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
20 @Provide liveDetailsBean: LiveDetailsBean = {} as LiveDetailsBean 21 @Provide liveDetailsBean: LiveDetailsBean = {} as LiveDetailsBean
21 @Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean 22 @Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean
22 - @Provide isMenuVisible: boolean = false 23 + @Provide isShowControl: boolean = false
  24 + @Provide liveState: string = ''
  25 + @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL //横竖屏,默认竖屏
23 @State relId: string = '' 26 @State relId: string = ''
24 @State contentId: string = '' 27 @State contentId: string = ''
25 @State relType: string = '' 28 @State relType: string = ''
@@ -42,7 +45,6 @@ export struct DetailPlayVLivePage { @@ -42,7 +45,6 @@ export struct DetailPlayVLivePage {
42 aboutToDisappear(): void { 45 aboutToDisappear(): void {
43 WindowModel.shared.setWindowLayoutFullScreen(false) 46 WindowModel.shared.setWindowLayoutFullScreen(false)
44 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) 47 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
45 -  
46 } 48 }
47 49
48 build() { 50 build() {
@@ -51,21 +53,20 @@ export struct DetailPlayVLivePage { @@ -51,21 +53,20 @@ export struct DetailPlayVLivePage {
51 PlayerComponent({ 53 PlayerComponent({
52 playerController: this.playerController 54 playerController: this.playerController
53 }) 55 })
54 - .onClick(() => {  
55 - this.isMenuVisible = !this.isMenuVisible  
56 - })  
57 56
58 PlayerInfoComponent({ 57 PlayerInfoComponent({
59 playerController: this.playerController, 58 playerController: this.playerController,
60 swiperController: this.swiperController, 59 swiperController: this.swiperController,
61 swiperIndex: $swiperIndex 60 swiperIndex: $swiperIndex
62 }) 61 })
63 - 62 +
64 Image($r('app.media.icon_live_more')) 63 Image($r('app.media.icon_live_more'))
65 .width(40) 64 .width(40)
66 - .aspectRatio(1)// .visibility(this.swiperIndex === 0 ? Visibility.Visible : Visibility.Hidden) 65 + .aspectRatio(1)
  66 + .visibility(this.swiperIndex === 0 ? Visibility.Visible : Visibility.Hidden)
67 .animation({ duration: 500 }) 67 .animation({ duration: 500 })
68 - .position({ x: '95%', y: '95%' }) 68 + .position({ x: '100%', y: '100%' })
  69 + .markAnchor({ x: 56, y: 56 })
69 .onClick(() => { 70 .onClick(() => {
70 this.swiperController.showNext() 71 this.swiperController.showNext()
71 }) 72 })
@@ -78,16 +79,13 @@ export struct DetailPlayVLivePage { @@ -78,16 +79,13 @@ export struct DetailPlayVLivePage {
78 .width('100%') 79 .width('100%')
79 } 80 }
80 81
81 - onPageShow(): void {  
82 -  
83 - }  
84 -  
85 getLiveDetails() { 82 getLiveDetails() {
86 this.liveViewModel.getLiveDetails(this.contentId, this.relId, this.relType) 83 this.liveViewModel.getLiveDetails(this.contentId, this.relId, this.relType)
87 .then( 84 .then(
88 (data) => { 85 (data) => {
89 if (data.length > 0) { 86 if (data.length > 0) {
90 this.liveDetailsBean = data[0] 87 this.liveDetailsBean = data[0]
  88 + this.liveState = this.liveDetailsBean.liveInfo?.liveState
91 console.error('liveDetailsBean===', JSON.stringify((this.liveDetailsBean))) 89 console.error('liveDetailsBean===', JSON.stringify((this.liveDetailsBean)))
92 } 90 }
93 }, 91 },
1 import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index' 1 import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index'
2 -import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI } from 'wdComponent/Index' 2 +import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI,WDViewDefaultType } from 'wdComponent/Index'
3 import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout' 3 import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout'
4 import LoadMoreLayout from 'wdComponent/src/main/ets/components/page/LoadMoreLayout' 4 import LoadMoreLayout from 'wdComponent/src/main/ets/components/page/LoadMoreLayout'
5 import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayout' 5 import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayout'
@@ -79,7 +79,7 @@ export struct TabChatComponent { @@ -79,7 +79,7 @@ export struct TabChatComponent {
79 getLiveChatList() { 79 getLiveChatList() {
80 this.pageModel.currentPage = 1 80 this.pageModel.currentPage = 1
81 this.liveViewModel.getLiveChatList( 81 this.liveViewModel.getLiveChatList(
82 - 1, 82 + this.pageModel.currentPage,
83 this.liveDetailsBean?.liveInfo?.mlive?.mliveId, 83 this.liveDetailsBean?.liveInfo?.mlive?.mliveId,
84 this.liveDetailsBean?.newsId, 84 this.liveDetailsBean?.newsId,
85 20,) 85 20,)
1 import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index' 1 import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index'
2 -import { ListHasNoMoreDataUI } from 'wdComponent/Index' 2 +import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI } from 'wdComponent/Index'
3 import { StringUtils } from 'wdKit/Index' 3 import { StringUtils } from 'wdKit/Index'
4 import { LiveViewModel } from '../../viewModel/LiveViewModel' 4 import { LiveViewModel } from '../../viewModel/LiveViewModel'
5 import { TabLiveItemComponent } from './TabLiveItemComponent' 5 import { TabLiveItemComponent } from './TabLiveItemComponent'
  6 +import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout'
  7 +import { RefreshLayoutBean } from 'wdComponent/src/main/ets/components/page/RefreshLayoutBean'
  8 +import PageModel from 'wdComponent/src/main/ets/viewmodel/PageModel'
  9 +import { ViewType } from 'wdConstant/Index'
  10 +import LoadMoreLayout from 'wdComponent/src/main/ets/components/page/LoadMoreLayout'
  11 +import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayout'
6 12
7 @Component 13 @Component
8 export struct TabLiveComponent { 14 export struct TabLiveComponent {
9 liveViewModel: LiveViewModel = new LiveViewModel() 15 liveViewModel: LiveViewModel = new LiveViewModel()
10 @State liveList: Array<LiveRoomItemBean> = [] 16 @State liveList: Array<LiveRoomItemBean> = []
11 @Consume @Watch('updateDate') liveDetailsBean: LiveDetailsBean 17 @Consume @Watch('updateDate') liveDetailsBean: LiveDetailsBean
  18 + @State private pageModel: PageModel = new PageModel()
12 19
13 updateDate() { 20 updateDate() {
14 this.getLiveList() 21 this.getLiveList()
@@ -20,51 +27,98 @@ export struct TabLiveComponent { @@ -20,51 +27,98 @@ export struct TabLiveComponent {
20 27
21 build() { 28 build() {
22 Stack() { 29 Stack() {
23 - if (this.liveList.length == 0) {  
24 - ListHasNoMoreDataUI({ style: 2 }) 30 + if (this.pageModel.viewType == ViewType.LOADING) {
  31 + this.LoadingLayout()
  32 + } else if (this.pageModel.viewType == ViewType.ERROR) {
  33 + ErrorComponent()
  34 + } else if (this.pageModel.viewType == ViewType.EMPTY) {
  35 + EmptyComponent()
25 } else { 36 } else {
26 - List() {  
27 - ForEach(this.liveList, (item: LiveRoomItemBean) => {  
28 - ListItem() {  
29 - TabLiveItemComponent({ item: item })  
30 - }  
31 - })  
32 - ListItem() {  
33 - ListHasNoMoreDataUI()  
34 - }  
35 - } 37 + this.ListLayout()
36 } 38 }
37 } 39 }
38 .alignContent(Alignment.Top) 40 .alignContent(Alignment.Top)
39 .backgroundColor('#F5F5F5') 41 .backgroundColor('#F5F5F5')
40 .height('100%') 42 .height('100%')
41 .width('100%') 43 .width('100%')
  44 + }
42 45
  46 + @Builder
  47 + ListLayout() {
  48 + List() {
  49 + ListItem() {
  50 + // 下拉刷新
  51 + RefreshLayout({
  52 + refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullDown, this.pageModel.pullDownRefreshImage,
  53 + this.pageModel.pullDownRefreshText, this.pageModel.pullDownRefreshHeight)
  54 + })
  55 + }
  56 +
  57 + ForEach(this.liveList, (item: LiveRoomItemBean) => {
  58 + ListItem() {
  59 + TabLiveItemComponent({ item: item })
  60 + }
  61 + })
  62 + // 加载更多
  63 + ListItem() {
  64 + if (this.pageModel.hasMore) {
  65 + LoadMoreLayout({
  66 + refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage,
  67 + this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight)
  68 + })
  69 + } else {
  70 + ListHasNoMoreDataUI()
  71 + }
  72 + }
  73 + }
  74 + }
  75 +
  76 + @Builder
  77 + LoadingLayout() {
  78 + CustomRefreshLoadLayout({
  79 + refreshBean: new RefreshLayoutBean(true,
  80 + $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), this.pageModel.pullDownRefreshHeight)
  81 + })
43 } 82 }
44 83
45 getLiveList() { 84 getLiveList() {
  85 + this.pageModel.currentPage = 1
46 this.liveViewModel.getLiveList( 86 this.liveViewModel.getLiveList(
47 - 1, 87 + this.pageModel.currentPage,
48 this.liveDetailsBean?.liveInfo?.mlive?.mliveId, 88 this.liveDetailsBean?.liveInfo?.mlive?.mliveId,
49 this.liveDetailsBean?.newsId, 89 this.liveDetailsBean?.newsId,
50 20) 90 20)
51 .then( 91 .then(
52 (data) => { 92 (data) => {
53 - /**  
54 - * 在直播聊天添加一条新内容逻辑:  
55 - 判断 oldNewsId:迁移id非空 且 直播状态不是预约:"wait"  
56 - 消息内容:  
57 - 1.头像固定:APP默认头像  
58 - 2.名称固定:人民日报主持人  
59 - 3.内容:详情接口的简介,newIntroduction  
60 - */  
61 - if (StringUtils.isNotEmpty(this.liveDetailsBean.oldNewsId) && this.liveDetailsBean && this.liveDetailsBean.liveInfo.liveState != 'wait') {  
62 - let liveRoomItemBeanTemp: LiveRoomItemBean = {} as LiveRoomItemBean  
63 - liveRoomItemBeanTemp.text = this.liveDetailsBean.newIntroduction  
64 - liveRoomItemBeanTemp.senderUserName = '人民日报主持人'  
65 - data.barrageResponses.push(liveRoomItemBeanTemp) 93 + if (data.barrageResponses && data.barrageResponses.length > 0) {
  94 + /**
  95 + * 在直播聊天添加一条新内容逻辑:
  96 + 判断 oldNewsId:迁移id非空 且 直播状态不是预约:"wait"
  97 + 消息内容:
  98 + 1.头像固定:APP默认头像
  99 + 2.名称固定:人民日报主持人
  100 + 3.内容:详情接口的简介,newIntroduction
  101 + */
  102 + if (StringUtils.isNotEmpty(this.liveDetailsBean.oldNewsId)
  103 + && this.liveDetailsBean
  104 + && this.liveDetailsBean.liveInfo.liveState != 'wait'
  105 + && this.pageModel.currentPage == 1) {
  106 + let liveRoomItemBeanTemp: LiveRoomItemBean = {} as LiveRoomItemBean
  107 + liveRoomItemBeanTemp.text = this.liveDetailsBean.newIntroduction
  108 + liveRoomItemBeanTemp.senderUserName = '人民日报主持人'
  109 + data.barrageResponses.push(liveRoomItemBeanTemp)
  110 + }
  111 + this.pageModel.viewType = ViewType.LOADED;
  112 + this.liveList.push(...data.barrageResponses)
  113 + if (data.barrageResponses.length === this.pageModel.pageSize) {
  114 + this.pageModel.currentPage++;
  115 + this.pageModel.hasMore = true;
  116 + } else {
  117 + this.pageModel.hasMore = false;
  118 + }
  119 + } else {
  120 + this.pageModel.viewType = ViewType.EMPTY;
66 } 121 }
67 - this.liveList = data.barrageResponses  
68 }, 122 },
69 () => { 123 () => {
70 124
1 -import { LiveRoomItemBean } from 'wdBean/Index' 1 +import { LiveRoomItemBean, PhotoListBean } from 'wdBean/Index'
2 import { DateTimeUtils, StringUtils } from 'wdKit/Index' 2 import { DateTimeUtils, StringUtils } from 'wdKit/Index'
3 3
4 @Component 4 @Component
5 export struct TabLiveItemComponent { 5 export struct TabLiveItemComponent {
6 item: LiveRoomItemBean = {} as LiveRoomItemBean 6 item: LiveRoomItemBean = {} as LiveRoomItemBean
  7 + photoList: PhotoListBean[] = []
7 8
8 aboutToAppear(): void { 9 aboutToAppear(): void {
9 10
@@ -86,7 +87,16 @@ export struct TabLiveItemComponent { @@ -86,7 +87,16 @@ export struct TabLiveItemComponent {
86 .aspectRatio(310 / 174) 87 .aspectRatio(310 / 174)
87 .objectFit(ImageFit.Auto) 88 .objectFit(ImageFit.Auto)
88 .borderRadius(4) 89 .borderRadius(4)
89 - } 90 + }.onClick(() => {
  91 + for (let item of this.item.pictureUrls) {
  92 + this.photoList.push({
  93 + width: 0,
  94 + height: 0,
  95 + picPath: item,
  96 + picDesc: ''
  97 + })
  98 + }
  99 + })
90 }) 100 })
91 }.margin({ 101 }.margin({
92 left: 32, 102 left: 32,
@@ -200,18 +200,21 @@ export struct PlayUIComponent { @@ -200,18 +200,21 @@ export struct PlayUIComponent {
200 } else { 200 } else {
201 Blank() 201 Blank()
202 } 202 }
203 - Image($r('app.media.icon_live_player_full_screen'))  
204 - .width(24)  
205 - .height(24)  
206 - .onClick(() => {  
207 - this.displayDirection = this.displayDirection == DisplayDirection.VERTICAL ? DisplayDirection.VIDEO_HORIZONTAL : DisplayDirection.VERTICAL  
208 - WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?  
209 - window.Orientation.PORTRAIT :  
210 - window.Orientation.LANDSCAPE)  
211 - devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ?  
212 - window.Orientation.PORTRAIT :  
213 - window.Orientation.LANDSCAPE);  
214 - }) 203 + if (this.liveDetailsBean?.liveInfo?.liveState == 'running'
  204 + || this.liveDetailsBean?.liveInfo?.liveState == 'end') {
  205 + Image($r('app.media.icon_live_player_full_screen'))
  206 + .width(24)
  207 + .height(24)
  208 + .onClick(() => {
  209 + this.displayDirection = this.displayDirection == DisplayDirection.VERTICAL ? DisplayDirection.VIDEO_HORIZONTAL : DisplayDirection.VERTICAL
  210 + WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
  211 + window.Orientation.PORTRAIT :
  212 + window.Orientation.LANDSCAPE)
  213 + devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ?
  214 + window.Orientation.PORTRAIT :
  215 + window.Orientation.LANDSCAPE);
  216 + })
  217 + }
215 } 218 }
216 .alignItems(VerticalAlign.Center) 219 .alignItems(VerticalAlign.Center)
217 .linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] }) 220 .linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] })
1 -import { window } from '@kit.ArkUI'  
2 -import { NumberFormatterUtils, WindowModel } from 'wdKit/Index'  
3 -  
4 -import { devicePLSensorManager } from 'wdDetailPlayApi/Index'  
5 -import { DateFormatUtil, WDPlayerController } from 'wdPlayer/Index'  
6 -import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'  
7 -  
8 -@Entry  
9 -@Component  
10 -export struct PlayVUIComponent {  
11 - playerController: WDPlayerController = new WDPlayerController();  
12 - //菜单键是否可见  
13 - @State isMenuVisible: boolean = true  
14 - @State isFullScreen: boolean = false  
15 - @Consume liveDetailsBean: LiveDetailsBean  
16 - @Consume liveRoomDataBean: LiveRoomDataBean  
17 - @State currentTime: string = ''  
18 - @State totalTime: string = ''  
19 - @State progressVal: number = 0;  
20 - //是否处于播放状态中  
21 - @State isPlayStatus: boolean = true  
22 -  
23 - aboutToAppear(): void {  
24 - //播放进度监听  
25 - this.playerController.onTimeUpdate = (position: number, duration: number) => {  
26 - this.currentTime = DateFormatUtil.secondToTime(Math.floor(position / 1000));  
27 - this.totalTime = DateFormatUtil.secondToTime(Math.floor(duration / 1000));  
28 - this.progressVal = Math.floor(position * 100 / duration);  
29 - }  
30 - }  
31 -  
32 - build() {  
33 - Column() {  
34 - this.getTopUIComponent()  
35 - this.getMiddleUIComponent()  
36 - this.getBottomUIComponent()  
37 - }  
38 - .width('100%')  
39 - .height('100%')  
40 - .alignItems(HorizontalAlign.Start)  
41 - }  
42 -  
43 - @Builder  
44 - getTopUIComponent() {  
45 - Column() {  
46 - Row() {  
47 - Image($r('app.media.icon_arrow_left_white'))  
48 - .width(24)  
49 - .aspectRatio(1)  
50 - .visibility(Visibility.None)  
51 - .margin({  
52 - right: 10  
53 - })  
54 - if (this.liveDetailsBean.liveInfo?.liveState != 'wait') {  
55 - Text(this.liveDetailsBean.newsTitle)  
56 - .maxLines(1)  
57 - .textOverflow({ overflow: TextOverflow.Ellipsis })  
58 - .fontSize('16fp')  
59 - .fontWeight(500)  
60 - .fontColor(Color.White)  
61 - .textAlign(TextAlign.Start)  
62 - .layoutWeight(1)  
63 - } else {  
64 - Blank()  
65 - }  
66 - Image($r('app.media.icon_share'))  
67 - .width(24)  
68 - .aspectRatio(1)  
69 - .visibility(Visibility.None)  
70 - }  
71 - .width('100%')  
72 - .alignItems(VerticalAlign.Center)  
73 - .margin({  
74 - bottom: 10  
75 - })  
76 -  
77 - this.getLiveStatusView()  
78 - }.width('100%')  
79 - .padding({  
80 - top: 20,  
81 - bottom: 6,  
82 - left: 10,  
83 - right: 10  
84 - })  
85 - .alignItems(HorizontalAlign.Start)  
86 - .visibility(this.isMenuVisible ? Visibility.Visible : Visibility.None)  
87 - }  
88 -  
89 - @Builder  
90 - getLiveStatusView() {  
91 - // 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停  
92 - // 预约  
93 - if (this.liveDetailsBean.liveInfo?.liveState == 'wait') {  
94 - Row() {  
95 - Image($r('app.media.icon_live_status_wait'))  
96 - .width(22)  
97 - .height(18)  
98 - Text('预约')  
99 - .fontSize('11fp')  
100 - .fontWeight(400)  
101 - .fontColor(Color.White)  
102 - }  
103 - .backgroundColor('#4D000000')  
104 - .padding({  
105 - top: 1,  
106 - right: 4,  
107 - bottom: 1  
108 - })  
109 - }  
110 - // 直播中  
111 - else if (this.liveDetailsBean.liveInfo?.liveState == 'running') {  
112 - Row() {  
113 - Image($r('app.media.icon_live_status_running'))  
114 - .width(22)  
115 - .height(18)  
116 - Text('直播中')  
117 - .fontSize('11fp')  
118 - .fontWeight(400)  
119 - .fontColor(Color.White)  
120 - Image($r('app.media.icon_live_player_status_end'))  
121 - .width(12)  
122 - .height(12)  
123 - Text(`${NumberFormatterUtils.formatNumberWithWan(this.liveRoomDataBean.pv)}人参与`)  
124 - .fontSize('11fp')  
125 - .fontWeight(400)  
126 - .fontColor(Color.White)  
127 - }  
128 - .backgroundColor('#4D000000')  
129 - .padding({  
130 - top: 1,  
131 - right: 4,  
132 - bottom: 1  
133 - })  
134 - }  
135 - //回看  
136 - else if (this.liveDetailsBean.liveInfo?.liveState == 'end') {  
137 - Row() {  
138 - Text('回看')  
139 - .fontSize('11fp')  
140 - .fontWeight(400)  
141 - .fontColor(Color.White)  
142 - Image($r('app.media.icon_live_player_status_end'))  
143 - .width(12)  
144 - .height(12)  
145 - Text(`${NumberFormatterUtils.formatNumberWithWan(this.liveRoomDataBean.pv)}人参与`)  
146 - .fontSize('11fp')  
147 - .fontWeight(400)  
148 - .fontColor(Color.White)  
149 - }  
150 - .backgroundColor('#4D000000')  
151 - .padding({  
152 - left: 4,  
153 - top: 1,  
154 - right: 4,  
155 - bottom: 1  
156 - })  
157 - }  
158 - }  
159 -  
160 - @Builder  
161 - getMiddleUIComponent() {  
162 - Stack()  
163 - .layoutWeight(1)  
164 - .width('100%')  
165 - .onClick(() => {  
166 - this.isMenuVisible = !this.isMenuVisible  
167 - })  
168 - }  
169 -  
170 - @Builder  
171 - getBottomUIComponent() {  
172 - Row() {  
173 - if (this.liveDetailsBean?.liveInfo?.liveState == 'end') {  
174 - this.playOrPauseBtn()  
175 - Text(this.currentTime)  
176 - .fontColor(Color.White)  
177 - .fontWeight(600)  
178 - .fontSize('12fp')  
179 - .margin({  
180 - left: 16  
181 - })  
182 -  
183 - this.playProgressView()  
184 -  
185 - Text(this.totalTime)  
186 - .fontColor(Color.White)  
187 - .fontWeight(600)  
188 - .fontSize('12fp')  
189 - .margin({  
190 - right: 16  
191 - })  
192 - } else {  
193 - Blank()  
194 - }  
195 - Image($r('app.media.icon_live_player_full_screen'))  
196 - .width(24)  
197 - .height(24)  
198 - .onClick(() => {  
199 - this.isFullScreen = !this.isFullScreen  
200 - WindowModel.shared.setPreferredOrientation(this.isFullScreen ? window.Orientation.LANDSCAPE : window.Orientation.PORTRAIT);  
201 - devicePLSensorManager.devicePLSensorOn(this.isFullScreen ? window.Orientation.LANDSCAPE : window.Orientation.PORTRAIT);  
202 - })  
203 - }  
204 - .alignItems(VerticalAlign.Center)  
205 - .linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] })  
206 - .width('100%')  
207 - .padding({  
208 - left: 10,  
209 - right: 10,  
210 - top: 15,  
211 - bottom: 15  
212 - })  
213 - .visibility(this.isMenuVisible ? Visibility.Visible : Visibility.None)  
214 - }  
215 -  
216 - @Builder  
217 - playOrPauseBtn() {  
218 - //暂停、播放  
219 - Image(this.isPlayStatus ? $r('app.media.icon_live_player_pause') : $r('app.media.player_play_ic'))  
220 - .width(24)  
221 - .height(24)  
222 - .onClick(() => {  
223 - if (this.isPlayStatus) {  
224 - this.isPlayStatus = false  
225 - this.playerController.pause()  
226 - } else {  
227 - this.isPlayStatus = true  
228 - this.playerController.play()  
229 - }  
230 - })  
231 - }  
232 -  
233 - @Builder  
234 - playProgressView() {  
235 - Slider({  
236 - value: this.progressVal,  
237 - step: 1,  
238 - style: SliderStyle.OutSet  
239 - })  
240 - .blockSize({  
241 - width: 18,  
242 - height: 12  
243 - })// .blockStyle({  
244 - // type: SliderBlockType.IMAGE,  
245 - // image: $r('app.media.ic_player_block')  
246 - // })  
247 - .blockColor(Color.White)  
248 - .trackColor('#4DFFFFFF')  
249 - .selectedColor('#FFED2800')  
250 - .height(14)  
251 - .trackThickness(1)  
252 - .layoutWeight(1)  
253 - .margin({  
254 - left: 8,  
255 - right: 8  
256 - })  
257 - .onChange((value: number, mode: SliderChangeMode) => {  
258 - this.playerController?.setSeekTime(value, mode);  
259 - })  
260 - }  
261 -}  
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 -}  
  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 +}
  1 +import { LiveRoomItemBean } from 'wdBean/Index'
  2 +
  3 +@Component
  4 +export struct ChatItemComponent {
  5 + item: LiveRoomItemBean = {} as LiveRoomItemBean
  6 +
  7 + aboutToAppear(): void {
  8 + }
  9 +
  10 + build() {
  11 + Row() {
  12 + Text() {
  13 + if (this.item.senderUserName) {
  14 + Span(' 主持人 ')
  15 + .fontSize(11)
  16 + .lineHeight(20)
  17 + .textBackgroundStyle({ color: '#808562', radius: 2 })
  18 + Span(' ')
  19 + }
  20 + Span(this.item.senderUserName + ': ')
  21 + .fontColor('#FFFFC63F')
  22 + .padding({ right: 118 })
  23 + //
  24 +
  25 + Span(this.item.text)
  26 + }
  27 + .fontSize(14)
  28 + .fontColor('#FFFFFFFF')
  29 + .lineHeight(22)
  30 + .textShadow({ offsetX: 1, offsetY: 1, color: '#4D000000', radius: 1 })
  31 +
  32 + }
  33 + .backgroundColor('#4D000000')
  34 + .borderRadius(3)
  35 + .padding({
  36 + top: 6,
  37 + bottom: 6,
  38 + left: 8,
  39 + right: 8
  40 + })
  41 + .margin({ left: 16, bottom: 4 })
  42 + }
  43 +}
  1 +import { LiveDetailsBean, LiveRoomDataBean, LiveRoomItemBean } from 'wdBean/Index'
  2 +import { LiveCommentComponent } from 'wdComponent/Index'
  3 +import PageModel from 'wdComponent/src/main/ets/viewmodel/PageModel'
  4 +import { DisplayDirection, ViewType } from 'wdConstant/Index'
  5 +import { LiveViewModel } from '../../viewModel/LiveViewModel'
  6 +import { ChartItemCompereComponent } from './ChartItemCompereComponent'
  7 +import { ChatItemComponent } from './ChartItemComponent'
  8 +
  9 +
1 @Component 10 @Component
2 export struct PlayerCommentComponent { 11 export struct PlayerCommentComponent {
  12 + liveViewModel: LiveViewModel = new LiveViewModel()
  13 + @Consume @Watch('liveDetailsBeanChange') liveDetailsBean: LiveDetailsBean
  14 + @Consume liveRoomDataBean: LiveRoomDataBean
  15 + @Consume displayDirection: DisplayDirection
  16 + @State private pageModel: PageModel = new PageModel()
  17 + @State liveChatList: Array<LiveRoomItemBean> = []
  18 +
  19 + aboutToAppear(): void {
  20 + this.getLiveChatList()
  21 + }
  22 +
  23 + liveDetailsBeanChange() {
  24 + this.getLiveChatList()
  25 + }
  26 +
  27 + getLiveChatList() {
  28 + this.pageModel.currentPage = 1
  29 + this.liveViewModel.getLiveChatList(
  30 + 1,
  31 + this.liveDetailsBean?.liveInfo?.mlive?.mliveId,
  32 + this.liveDetailsBean?.newsId,
  33 + 20,)
  34 + .then(
  35 + (data) => {
  36 + if (data.barrageResponses && data.barrageResponses.length > 0) {
  37 +
  38 + this.pageModel.viewType = ViewType.LOADED;
  39 + this.liveChatList.push(...data.barrageResponses)
  40 + console.log('liveChatList===', this.liveChatList)
  41 + if (data.barrageResponses.length === this.pageModel.pageSize) {
  42 + this.pageModel.currentPage++;
  43 + this.pageModel.hasMore = true;
  44 + } else {
  45 + this.pageModel.hasMore = false;
  46 + }
  47 + } else {
  48 + this.pageModel.viewType = ViewType.EMPTY;
  49 + }
  50 + },
  51 + () => {
  52 +
  53 + })
  54 + }
  55 +
3 build() { 56 build() {
  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 + }
  67 + })
  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)
  78 +
4 } 79 }
5 } 80 }
@@ -13,6 +13,7 @@ export struct PlayerComponent { @@ -13,6 +13,7 @@ export struct PlayerComponent {
13 @State imgUrl: string = '' 13 @State imgUrl: string = ''
14 @State isWait: boolean = false 14 @State isWait: boolean = false
15 @State liveStreamType: number | null = -1 15 @State liveStreamType: number | null = -1
  16 + @State playUrl: string = ''
16 17
17 aboutToAppear(): void { 18 aboutToAppear(): void {
18 if (this.playerController) { 19 if (this.playerController) {
@@ -48,8 +49,10 @@ export struct PlayerComponent { @@ -48,8 +49,10 @@ export struct PlayerComponent {
48 playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri 49 playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri
49 liveStreamType = this.liveDetailsBean.liveInfo.vlive[0].liveStreamType 50 liveStreamType = this.liveDetailsBean.liveInfo.vlive[0].liveStreamType
50 } 51 }
  52 +
51 this.liveStreamType = liveStreamType 53 this.liveStreamType = liveStreamType
52 - this.playerController?.firstPlay(playUrl); 54 + this.playUrl = playUrl
  55 +
53 } 56 }
54 } 57 }
55 58
@@ -60,12 +63,14 @@ export struct PlayerComponent { @@ -60,12 +63,14 @@ export struct PlayerComponent {
60 .height('100%') 63 .height('100%')
61 .width('100%') 64 .width('100%')
62 .blur(100) 65 .blur(100)
  66 + .renderFit(RenderFit.RESIZE_COVER)
63 67
64 // TODO:判断横竖屏,liveStreamType=1竖屏铺满屏幕,liveStreamType=0横屏正常展示 68 // TODO:判断横竖屏,liveStreamType=1竖屏铺满屏幕,liveStreamType=0横屏正常展示
65 if (this.liveStreamType == null) { 69 if (this.liveStreamType == null) {
66 WDPlayerRenderVLiveView({ 70 WDPlayerRenderVLiveView({
67 playerController: this.playerController, 71 playerController: this.playerController,
68 onLoad: () => { 72 onLoad: () => {
  73 + this.playerController?.firstPlay(this.playUrl);
69 } 74 }
70 }).height('100%') 75 }).height('100%')
71 .width('100%') 76 .width('100%')
@@ -73,8 +78,9 @@ export struct PlayerComponent { @@ -73,8 +78,9 @@ export struct PlayerComponent {
73 WDPlayerRenderView({ 78 WDPlayerRenderView({
74 playerController: this.playerController, 79 playerController: this.playerController,
75 onLoad: () => { 80 onLoad: () => {
  81 + this.playerController?.firstPlay(this.playUrl);
76 } 82 }
77 - }).padding({ top: 195 }) 83 + }).margin({ top: 195 }).height(211)
78 } 84 }
79 } 85 }
80 .height('100%') 86 .height('100%')
@@ -4,9 +4,11 @@ import { PlayerUIComponent } from './PlayerUIComponent' @@ -4,9 +4,11 @@ import { PlayerUIComponent } from './PlayerUIComponent'
4 @Component 4 @Component
5 export struct PlayerInfoComponent { 5 export struct PlayerInfoComponent {
6 swiperController?: SwiperController 6 swiperController?: SwiperController
7 - @Prop 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 })
1 import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index' 1 import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'
2 import { NumberFormatterUtils } from 'wdKit/Index' 2 import { NumberFormatterUtils } from 'wdKit/Index'
3 3
  4 +@Preview
4 @Component 5 @Component
5 export struct PlayerTitleComponent { 6 export struct PlayerTitleComponent {
6 @Consume liveDetailsBean: LiveDetailsBean 7 @Consume liveDetailsBean: LiveDetailsBean
7 @Consume liveRoomDataBean: LiveRoomDataBean 8 @Consume liveRoomDataBean: LiveRoomDataBean
  9 + @Consume liveState: string
8 10
9 build() { 11 build() {
10 Column() { 12 Column() {
11 Row() { 13 Row() {
12 - Image($r('app.media.icon_arrow_left_white'))  
13 - .width(24)  
14 - .aspectRatio(1)  
15 - .visibility(Visibility.None)  
16 - .margin({  
17 - right: 10  
18 - })  
19 - if (this.liveDetailsBean.liveInfo?.liveState != 'wait') {  
20 - Text(this.liveDetailsBean.newsTitle)  
21 - .maxLines(1)  
22 - .textOverflow({ overflow: TextOverflow.Ellipsis })  
23 - .fontSize('16fp')  
24 - .fontWeight(500)  
25 - .fontColor(Color.White)  
26 - .textAlign(TextAlign.Start)  
27 - .layoutWeight(1)  
28 - } else {  
29 - Blank()  
30 - }  
31 - Image($r('app.media.icon_share'))  
32 - .width(24)  
33 - .aspectRatio(1)  
34 - .visibility(Visibility.None) 14 + Text(this.liveDetailsBean.newsTitle || '')
  15 + .maxLines(2)
  16 + .fontSize(16)
  17 + .fontWeight(500)
  18 + .fontColor(Color.White)
  19 + }.margin({ bottom: 10 })
  20 +
  21 + Row() {
  22 + this.getLiveStatusView()
35 } 23 }
36 - .width('100%')  
37 - .alignItems(VerticalAlign.Center)  
38 - .margin({  
39 - bottom: 10  
40 - })  
41 24
42 - this.getLiveStatusView()  
43 - }.width('100%') 25 + }
  26 + .width('100%')
  27 + .alignItems(HorizontalAlign.Start)
44 .padding({ 28 .padding({
45 - top: 20,  
46 - bottom: 6,  
47 - left: 10,  
48 - right: 10 29 + top: 12,
  30 + left: 16
49 }) 31 })
50 - .alignItems(HorizontalAlign.Start)  
51 - .visibility(Visibility.Visible) 32 +
52 } 33 }
53 34
54 @Builder 35 @Builder
55 getLiveStatusView() { 36 getLiveStatusView() {
56 - Row() {  
57 - Image(this.liveDetailsBean.rmhInfo.rmhHeadUrl)  
58 - .width(22)  
59 - .height(18)  
60 - Text(this.liveDetailsBean.rmhInfo.rmhName)  
61 - .fontSize('11fp')  
62 - .fontWeight(400)  
63 - .fontColor(Color.White)  
64 - }  
65 - .backgroundColor('#4D000000')  
66 - .padding({  
67 - top: 1,  
68 - right: 4,  
69 - bottom: 1  
70 - })  
71 -  
72 -  
73 - // 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停  
74 - // 预约  
75 - if (this.liveDetailsBean.liveInfo?.liveState == 'wait') { 37 + if (this.liveDetailsBean.rmhInfo?.rmhName) {
76 Row() { 38 Row() {
77 - Image($r('app.media.icon_live_status_wait'))  
78 - .width(22)  
79 - .height(18)  
80 - Text('预约')  
81 - .fontSize('11fp')  
82 - .fontWeight(400) 39 + Image(this.liveDetailsBean.rmhInfo?.rmhHeadUrl || '')
  40 + .width(24)
  41 + .aspectRatio(1)
  42 + .borderRadius(12)
  43 + .fillColor(Color.Transparent)
  44 +
  45 + Text(this.liveDetailsBean.rmhInfo?.rmhName || '')
  46 + .fontSize(12)
  47 + .fontWeight(500)
83 .fontColor(Color.White) 48 .fontColor(Color.White)
  49 + .padding({
  50 + top: 2,
  51 + right: 8,
  52 + left: 4,
  53 + bottom: 2
  54 + })
84 } 55 }
85 .backgroundColor('#4D000000') 56 .backgroundColor('#4D000000')
86 - .padding({  
87 - top: 1,  
88 - right: 4,  
89 - bottom: 1  
90 - }) 57 + .borderRadius(2)
  58 + .borderRadius({ topLeft: 12, bottomLeft: 12 })
  59 + .margin({ right: 8 })
91 } 60 }
92 - // 直播中  
93 - else if (this.liveDetailsBean.liveInfo?.liveState == 'running') {  
94 - Row() { 61 +
  62 +
  63 + Row() {
  64 + if (this.liveState == 'running') {
95 Image($r('app.media.icon_live_status_running')) 65 Image($r('app.media.icon_live_status_running'))
96 .width(22) 66 .width(22)
97 .height(18) 67 .height(18)
98 - Text('直播中')  
99 - .fontSize('11fp')  
100 - .fontWeight(400)  
101 - .fontColor(Color.White)  
102 - Image($r('app.media.icon_live_player_status_end'))  
103 - .width(12)  
104 - .height(12)  
105 - Text(`${NumberFormatterUtils.formatNumberWithWan(this.liveRoomDataBean.pv)}人参与`)  
106 - .fontSize('11fp')  
107 - .fontWeight(400)  
108 - .fontColor(Color.White)  
109 - }  
110 - .backgroundColor('#4D000000')  
111 - .padding({  
112 - top: 1,  
113 - right: 4,  
114 - bottom: 1  
115 - })  
116 - }  
117 - //回看  
118 - else if (this.liveDetailsBean.liveInfo?.liveState == 'end') {  
119 - Row() {  
120 - Text('回看')  
121 - .fontSize('11fp')  
122 - .fontWeight(400)  
123 - .fontColor(Color.White)  
124 - Image($r('app.media.icon_live_player_status_end'))  
125 - .width(12)  
126 - .height(12)  
127 - Text(`${NumberFormatterUtils.formatNumberWithWan(this.liveRoomDataBean.pv)}人参与`)  
128 - .fontSize('11fp')  
129 - .fontWeight(400)  
130 - .fontColor(Color.White) 68 + .margin({ right: 1 })
131 } 69 }
132 - .backgroundColor('#4D000000')  
133 - .padding({  
134 - left: 4,  
135 - top: 1,  
136 - right: 4,  
137 - bottom: 1  
138 - }) 70 +
  71 + Text(this.liveState == 'running' ? '直播中' : '回看')
  72 + .fontSize(11)
  73 + .fontWeight(400)
  74 + .fontColor(Color.White)
  75 + Image($r('app.media.icon_live_player_status_end'))
  76 + .width(12)
  77 + .height(12)
  78 + Text(`${NumberFormatterUtils.formatNumberWithWan(this.liveRoomDataBean.pv)}人参与`)
  79 + .fontSize('11fp')
  80 + .fontWeight(400)
  81 + .fontColor(Color.White)
139 } 82 }
  83 + .backgroundColor('#4D000000')
  84 + .borderRadius(2)
  85 + .padding(this.liveState == 'running' ? { left: 0, right: 4, top: 0, bottom: 0 } : 4)
140 } 86 }
141 } 87 }
1 import { WDPlayerController } from 'wdPlayer/Index'; 1 import { WDPlayerController } from 'wdPlayer/Index';
  2 +import { PlayerCommentComponent } from './PlayerCommentComponent';
  3 +import { PlayerTitleComponent } from './PlayerTitleComponent';
  4 +import { PlayerVideoControlComponent } from './PlayerVideoControlComponent';
2 5
3 @Component 6 @Component
4 export struct PlayerUIComponent { 7 export struct PlayerUIComponent {
5 - playerController: WDPlayerController = new WDPlayerController(); 8 + private playerController?: WDPlayerController
  9 + @Consume isShowControl: boolean
6 10
7 build() { 11 build() {
  12 + Stack() {
  13 + PlayerTitleComponent()
  14 + // Row() {
  15 + // // 全屏按钮
  16 + // }.layoutWeight(1)
  17 +
  18 +
  19 + PlayerCommentComponent()
  20 + .visibility(this.isShowControl ? Visibility.Hidden : Visibility.Visible)
  21 + .animation({ duration: 500 })
  22 + .position({ y: '100%' })
  23 + .markAnchor({ y: '100%' })
  24 +
  25 + PlayerVideoControlComponent({ playerController: this.playerController })
  26 + .visibility(this.isShowControl ? Visibility.Visible : Visibility.Hidden)
  27 + .animation({ duration: 500 })
  28 + .position({ y: '100%' })
  29 + .markAnchor({ y: '100%' })
  30 +
  31 + }
  32 + .height('100%')
  33 + .width('100%')
  34 + .alignContent(Alignment.TopStart)
  35 +
8 } 36 }
9 } 37 }
@@ -8,12 +8,9 @@ import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index' @@ -8,12 +8,9 @@ import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'
8 8
9 @Component 9 @Component
10 export struct PlayerVideoControlComponent { 10 export struct PlayerVideoControlComponent {
11 - playerController: WDPlayerController = new 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;
@@ -21,12 +18,15 @@ export struct PlayerVideoControlComponent { @@ -21,12 +18,15 @@ export struct PlayerVideoControlComponent {
21 @State isPlayStatus: boolean = true 18 @State isPlayStatus: boolean = true
22 19
23 aboutToAppear(): void { 20 aboutToAppear(): void {
24 - //播放进度监听  
25 - this.playerController.onTimeUpdate = (position: number, duration: number) => {  
26 - this.currentTime = DateFormatUtil.secondToTime(Math.floor(position / 1000));  
27 - this.totalTime = DateFormatUtil.secondToTime(Math.floor(duration / 1000));  
28 - this.progressVal = Math.floor(position * 100 / duration); 21 + if (this.playerController) {
  22 + //播放进度监听
  23 + this.playerController.onTimeUpdate = (position: number, duration: number) => {
  24 + this.currentTime = DateFormatUtil.secondToTime(Math.floor(position / 1000));
  25 + this.totalTime = DateFormatUtil.secondToTime(Math.floor(duration / 1000));
  26 + this.progressVal = Math.floor(position * 100 / duration);
  27 + }
29 } 28 }
  29 +
30 } 30 }
31 31
32 build() { 32 build() {
@@ -38,39 +38,28 @@ export struct PlayerVideoControlComponent { @@ -38,39 +38,28 @@ export struct PlayerVideoControlComponent {
38 @Builder 38 @Builder
39 getBottomUIComponent() { 39 getBottomUIComponent() {
40 Row() { 40 Row() {
41 - if (this.liveDetailsBean?.liveInfo?.liveState == 'end') {  
42 - this.playOrPauseBtn()  
43 - Text(this.currentTime)  
44 - .fontColor(Color.White)  
45 - .fontWeight(600)  
46 - .fontSize('12fp')  
47 - .margin({  
48 - left: 16  
49 - }) 41 + this.playOrPauseBtn()
  42 + Text(this.currentTime)
  43 + .fontColor(Color.White)
  44 + .fontWeight(600)
  45 + .fontSize('12fp')
  46 + .margin({
  47 + left: 16
  48 + })
50 49
51 - this.playProgressView() 50 + this.playProgressView()
52 51
53 - Text(this.totalTime)  
54 - .fontColor(Color.White)  
55 - .fontWeight(600)  
56 - .fontSize('12fp')  
57 - .margin({  
58 - right: 16  
59 - })  
60 - } else {  
61 - Blank()  
62 - }  
63 - Image($r('app.media.icon_live_player_full_screen'))  
64 - .width(24)  
65 - .height(24)  
66 - .onClick(() => {  
67 - this.isFullScreen = !this.isFullScreen  
68 - WindowModel.shared.setPreferredOrientation(this.isFullScreen ? window.Orientation.LANDSCAPE : window.Orientation.PORTRAIT);  
69 - devicePLSensorManager.devicePLSensorOn(this.isFullScreen ? window.Orientation.LANDSCAPE : window.Orientation.PORTRAIT); 52 + Text(this.totalTime)
  53 + .fontColor(Color.White)
  54 + .fontWeight(600)
  55 + .fontSize('12fp')
  56 + .margin({
  57 + right: 16
70 }) 58 })
  59 +
71 } 60 }
72 .alignItems(VerticalAlign.Center) 61 .alignItems(VerticalAlign.Center)
73 - .linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] }) 62 + // .linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] })
74 .width('100%') 63 .width('100%')
75 .padding({ 64 .padding({
76 left: 10, 65 left: 10,
@@ -78,7 +67,6 @@ export struct PlayerVideoControlComponent { @@ -78,7 +67,6 @@ export struct PlayerVideoControlComponent {
78 top: 15, 67 top: 15,
79 bottom: 15 68 bottom: 15
80 }) 69 })
81 - .visibility(this.isMenuVisible ? Visibility.Visible : Visibility.None)  
82 } 70 }
83 71
84 @Builder 72 @Builder
@@ -90,10 +78,10 @@ export struct PlayerVideoControlComponent { @@ -90,10 +78,10 @@ export struct PlayerVideoControlComponent {
90 .onClick(() => { 78 .onClick(() => {
91 if (this.isPlayStatus) { 79 if (this.isPlayStatus) {
92 this.isPlayStatus = false 80 this.isPlayStatus = false
93 - this.playerController.pause() 81 + this.playerController?.pause()
94 } else { 82 } else {
95 this.isPlayStatus = true 83 this.isPlayStatus = true
96 - this.playerController.play() 84 + this.playerController?.play()
97 } 85 }
98 }) 86 })
99 } 87 }
@@ -108,15 +96,16 @@ export struct PlayerVideoControlComponent { @@ -108,15 +96,16 @@ export struct PlayerVideoControlComponent {
108 .blockSize({ 96 .blockSize({
109 width: 18, 97 width: 18,
110 height: 12 98 height: 12
111 - })// .blockStyle({  
112 - // type: SliderBlockType.IMAGE,  
113 - // image: $r('app.media.ic_player_block')  
114 - // })  
115 - .blockColor(Color.White) 99 + })
116 .trackColor('#4DFFFFFF') 100 .trackColor('#4DFFFFFF')
117 .selectedColor('#FFED2800') 101 .selectedColor('#FFED2800')
  102 + .trackThickness(2)
  103 + .blockStyle({
  104 + type: SliderBlockType.IMAGE,
  105 + image: $r('app.media.ic_player_block')
  106 + })
  107 + .blockSize({ width: 18, height: 12 })
118 .height(14) 108 .height(14)
119 - .trackThickness(1)  
120 .layoutWeight(1) 109 .layoutWeight(1)
121 .margin({ 110 .margin({
122 left: 8, 111 left: 8,
@@ -31,6 +31,10 @@ @@ -31,6 +31,10 @@
31 { 31 {
32 "name": "refresh_fail_text", 32 "name": "refresh_fail_text",
33 "value": "刷新失败" 33 "value": "刷新失败"
  34 + },
  35 + {
  36 + "name": "reason_read_write_media",
  37 + "value": "user_grant"
34 } 38 }
35 ] 39 ]
36 } 40 }
@@ -13,6 +13,7 @@ @@ -13,6 +13,7 @@
13 "wdBean": "file:../../features/wdBean", 13 "wdBean": "file:../../features/wdBean",
14 "wdRouter": "file:../../commons/wdRouter", 14 "wdRouter": "file:../../commons/wdRouter",
15 "wdNetwork": "file:../../commons/wdNetwork", 15 "wdNetwork": "file:../../commons/wdNetwork",
  16 + "wdConstant": "file:../../commons/wdConstant",
16 "wdDetailPlayApi": "file:../../features/wdDetailPlayApi", 17 "wdDetailPlayApi": "file:../../features/wdDetailPlayApi",
17 // "wdComponent": "file:../../features/wdComponent" 18 // "wdComponent": "file:../../features/wdComponent"
18 } 19 }
@@ -168,17 +168,15 @@ export struct DetailPlayShortVideoPage { @@ -168,17 +168,15 @@ export struct DetailPlayShortVideoPage {
168 WDPlayerRenderView({ 168 WDPlayerRenderView({
169 playerController: this.playerController, 169 playerController: this.playerController,
170 onLoad: async () => { 170 onLoad: async () => {
171 - // console.log('onload==', this.index)  
172 - // if (this.index === 0) {  
173 -  
174 if (this.contentDetailData != null && this.contentDetailData?.videoInfo[0] != null) { 171 if (this.contentDetailData != null && this.contentDetailData?.videoInfo[0] != null) {
175 this.playerController.firstPlay(this.contentDetailData.videoInfo[0].videoUrl); 172 this.playerController.firstPlay(this.contentDetailData.videoInfo[0].videoUrl);
176 } 173 }
177 - // }  
178 } 174 }
179 }) 175 })
180 .height('100%') 176 .height('100%')
181 .width('100%') 177 .width('100%')
  178 + .margin({ top: this.videoLandScape === 1 ? 218 : 0 })
  179 + .align(this.videoLandScape === 1 ? Alignment.Top : Alignment.Start)
182 .onClick(() => { 180 .onClick(() => {
183 console.error('WDPlayerRenderView=== onClick') 181 console.error('WDPlayerRenderView=== onClick')
184 this.playerController?.switchPlayOrPause(); 182 this.playerController?.switchPlayOrPause();
@@ -195,14 +193,13 @@ export struct DetailPlayShortVideoPage { @@ -195,14 +193,13 @@ export struct DetailPlayShortVideoPage {
195 193
196 @Builder 194 @Builder
197 detailContainerBuilder() { 195 detailContainerBuilder() {
198 - // DetailTabBarPageComponent({ pageId: this.pageId }).backgroundColor(Color.Black)  
199 DetailContainer({ 196 DetailContainer({
200 playerController: this.playerController 197 playerController: this.playerController
201 }) 198 })
202 } 199 }
203 200
204 build() { 201 build() {
205 - Row() { 202 + Column() {
206 PlayerDetailContainer({ 203 PlayerDetailContainer({
207 playerView: () => { 204 playerView: () => {
208 this.playerViewContainerBuilder() 205 this.playerViewContainerBuilder()
@@ -212,17 +209,8 @@ export struct DetailPlayShortVideoPage { @@ -212,17 +209,8 @@ export struct DetailPlayShortVideoPage {
212 this.detailContainerBuilder() 209 this.detailContainerBuilder()
213 } 210 }
214 }) 211 })
215 - .height('100%')  
216 - .width('100%')  
217 - .onClick(() => {  
218 - console.error('PlayerDetailContainer=== onClick')  
219 - this.playerController?.switchPlayOrPause();  
220 - })  
221 - }  
222 - .height('100%') 212 + }.height('100%')
223 .width('100%') 213 .width('100%')
224 - .backgroundColor(Color.Black)  
225 - // 扩展至所有非安全区域  
226 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) 214 +
227 } 215 }
228 } 216 }
@@ -4,7 +4,6 @@ import { ResponseDTO } from 'wdNetwork/Index'; @@ -4,7 +4,6 @@ import { ResponseDTO } from 'wdNetwork/Index';
4 import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage' 4 import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage'
5 import router from '@ohos.router'; 5 import router from '@ohos.router';
6 import { contentListParams } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; 6 import { contentListParams } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
7 -import window from '@ohos.window';  
8 import { WindowModel } from 'wdKit'; 7 import { WindowModel } from 'wdKit';
9 8
10 const storage = LocalStorage.getShared(); 9 const storage = LocalStorage.getShared();
@@ -31,16 +30,16 @@ export struct DetailVideoListPage { @@ -31,16 +30,16 @@ export struct DetailVideoListPage {
31 /** 30 /**
32 * 开启沉浸式并设置状态栏颜色 31 * 开启沉浸式并设置状态栏颜色
33 */ 32 */
34 - const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage  
35 - const windowClass: window.Window = windowStage.getMainWindowSync();  
36 - windowClass.setWindowLayoutFullScreen(true)  
37 - this.isFullScreen = true  
38 - windowClass.setWindowSystemBarProperties({  
39 - statusBarContentColor: '#ffffff',  
40 - }) 33 + // const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage
  34 + // const windowClass: window.Window = windowStage.getMainWindowSync();
  35 + // windowClass.setWindowLayoutFullScreen(true)
  36 + // this.isFullScreen = true
  37 + // windowClass.setWindowSystemBarProperties({
  38 + // statusBarContentColor: '#ffffff',
  39 + // })
41 40
42 41
43 - let data: ContentDetailDTO[] = [] 42 + // let data: ContentDetailDTO[] = []
44 let action: Action = router.getParams() as Action 43 let action: Action = router.getParams() as Action
45 if (action) { 44 if (action) {
46 this.contentId = action.params?.contentID || '' 45 this.contentId = action.params?.contentID || ''
@@ -63,17 +62,6 @@ export struct DetailVideoListPage { @@ -63,17 +62,6 @@ export struct DetailVideoListPage {
63 62
64 await this.queryVideoList() 63 await this.queryVideoList()
65 64
66 - // await ContentDetailRequest.postRecommendVideoList({  
67 - // pageSize: 5,  
68 - // refreshCnt: 1  
69 - // }).then(res => {  
70 - // if (res.data) {  
71 - // data = data.concat(res.data)  
72 - // }  
73 - // console.log('res1===', JSON.stringify(res))  
74 - // console.log('res==' + this.data)  
75 - // })  
76 -  
77 65
78 if (this.data.length > 0) { 66 if (this.data.length > 0) {
79 const params: contentListParams = { 67 const params: contentListParams = {
@@ -103,37 +91,18 @@ export struct DetailVideoListPage { @@ -103,37 +91,18 @@ export struct DetailVideoListPage {
103 } 91 }
104 92
105 aboutToDisappear(): void { 93 aboutToDisappear(): void {
106 -  
107 - const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage  
108 - const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口  
109 - windowClass.setWindowLayoutFullScreen(false)  
110 - this.isFullScreen = false  
111 - windowClass.setWindowSystemBarProperties({ statusBarContentColor: '#000000' })  
112 - 94 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
  95 + WindowModel.shared.setWindowLayoutFullScreen(false)
113 } 96 }
114 97
115 onPageShow(): void { 98 onPageShow(): void {
116 - if (!this.isFullScreen) {  
117 - const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage  
118 - const windowClass: window.Window = windowStage.getMainWindowSync();  
119 - windowClass.setWindowLayoutFullScreen(true)  
120 - this.isFullScreen = true  
121 - windowClass.setWindowSystemBarProperties({  
122 - statusBarContentColor: '#ffffff',  
123 - })  
124 -  
125 - } 99 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
  100 + WindowModel.shared.setWindowLayoutFullScreen(true)
126 } 101 }
127 102
128 onPageHide(): void { 103 onPageHide(): void {
129 - if (this.isFullScreen) {  
130 - const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage  
131 - const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口  
132 - windowClass.setWindowLayoutFullScreen(false)  
133 - this.isFullScreen = false  
134 - windowClass.setWindowSystemBarProperties({ statusBarContentColor: '#000000' })  
135 - }  
136 - 104 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
  105 + WindowModel.shared.setWindowLayoutFullScreen(false)
137 } 106 }
138 107
139 /** 108 /**
@@ -166,7 +135,7 @@ export struct DetailVideoListPage { @@ -166,7 +135,7 @@ export struct DetailVideoListPage {
166 }) 135 })
167 }.width('100%') 136 }.width('100%')
168 .height('100%') 137 .height('100%')
169 - 138 +
170 }, (item: ContentDetailDTO) => item.newsId + '') 139 }, (item: ContentDetailDTO) => item.newsId + '')
171 } 140 }
172 .clip(false) 141 .clip(false)
@@ -12,6 +12,5 @@ export struct DetailContainer { @@ -12,6 +12,5 @@ export struct DetailContainer {
12 PlayerTitleComment({ 12 PlayerTitleComment({
13 playerController: this.playerController 13 playerController: this.playerController
14 }) 14 })
15 - .width('100%')  
16 } 15 }
17 } 16 }
@@ -45,7 +45,7 @@ export struct DetailDialog { @@ -45,7 +45,7 @@ export struct DetailDialog {
45 } 45 }
46 .width('100%') 46 .width('100%')
47 .alignItems(HorizontalAlign.Start) 47 .alignItems(HorizontalAlign.Start)
48 - .backgroundColor(Color.Gray) 48 + .backgroundColor('#80000000')
49 // .linearGradient({ 49 // .linearGradient({
50 // direction: GradientDirection.Top, // 渐变方向 50 // direction: GradientDirection.Top, // 渐变方向
51 // repeating: false, // 渐变颜色是否重复 51 // repeating: false, // 渐变颜色是否重复
1 -import { ContentDetailDTO, InteractDataDTO, RmhInfoDTO, UserInfoDTO } from 'wdBean/Index'; 1 +import { ContentDetailDTO, InteractDataDTO, Params, RmhInfoDTO, UserInfoDTO } from 'wdBean/Index';
2 import { 2 import {
3 batchLikeAndCollectParams, 3 batchLikeAndCollectParams,
4 batchLikeAndCollectResult, 4 batchLikeAndCollectResult,
@@ -8,10 +8,11 @@ import { @@ -8,10 +8,11 @@ import {
8 postExecuteLikeParams, 8 postExecuteLikeParams,
9 postInteractAccentionOperateParams 9 postInteractAccentionOperateParams
10 } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; 10 } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
11 -import { ToastUtils } from 'wdKit'; 11 +import { SPHelper, ToastUtils } from 'wdKit';
12 import { HttpUrlUtils } from 'wdNetwork/Index'; 12 import { HttpUrlUtils } from 'wdNetwork/Index';
13 import { WDPlayerController } from 'wdPlayer/Index'; 13 import { WDPlayerController } from 'wdPlayer/Index';
14 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 14 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
  15 +import { SpConstants } from 'wdConstant/Index'
15 16
16 export interface OperationItem { 17 export interface OperationItem {
17 icon: Resource; 18 icon: Resource;
@@ -64,9 +65,10 @@ export struct OperationListView { @@ -64,9 +65,10 @@ export struct OperationListView {
64 /** 65 /**
65 * 点赞、取消点赞 66 * 点赞、取消点赞
66 */ 67 */
67 - toggleLikeStatus() { 68 + async toggleLikeStatus() {
68 // 未登录,跳转登录 69 // 未登录,跳转登录
69 - if (!HttpUrlUtils.getUserId()) { 70 + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
  71 + if (!user_id) {
70 this.playerController?.pause() 72 this.playerController?.pause()
71 WDRouterRule.jumpWithPage(WDRouterPage.loginPage) 73 WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
72 return 74 return
@@ -77,10 +79,16 @@ export struct OperationListView { @@ -77,10 +79,16 @@ export struct OperationListView {
77 contentType: this.contentDetailData?.newsType + '', 79 contentType: this.contentDetailData?.newsType + '',
78 } 80 }
79 ContentDetailRequest.postExecuteLike(params).then(res => { 81 ContentDetailRequest.postExecuteLike(params).then(res => {
80 - console.log('toggleLikeStatus==',) 82 +
81 if (this.newsStatusOfUser) { 83 if (this.newsStatusOfUser) {
82 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1' 84 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1'
83 - this.queryContentInteractCount() 85 + if (this.newsStatusOfUser.likeStatus === '1') {
  86 + this.interactData.likeNum = Number(this.interactData.likeNum) + 1
  87 + } else {
  88 + this.interactData.likeNum = Number(this.interactData.likeNum) - 1
  89 + }
  90 + console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum)
  91 + // this.queryContentInteractCount()
84 } 92 }
85 93
86 }) 94 })
@@ -89,9 +97,10 @@ export struct OperationListView { @@ -89,9 +97,10 @@ export struct OperationListView {
89 /** 97 /**
90 * 收藏、取消收藏 98 * 收藏、取消收藏
91 */ 99 */
92 - toggleCollectStatus() { 100 + async toggleCollectStatus() {
93 // 未登录,跳转登录 101 // 未登录,跳转登录
94 - if (!HttpUrlUtils.getUserId()) { 102 + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
  103 + if (!user_id) {
95 WDRouterRule.jumpWithPage(WDRouterPage.loginPage) 104 WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
96 return 105 return
97 } 106 }
@@ -104,10 +113,15 @@ export struct OperationListView { @@ -104,10 +113,15 @@ export struct OperationListView {
104 113
105 } 114 }
106 ContentDetailRequest.postExecuteCollectRecord(params).then(res => { 115 ContentDetailRequest.postExecuteCollectRecord(params).then(res => {
107 - console.log('toggleLikeStatus==',)  
108 if (this.newsStatusOfUser) { 116 if (this.newsStatusOfUser) {
109 this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 117 this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
110 - this.queryContentInteractCount() 118 + // this.queryContentInteractCount()
  119 + if (this.newsStatusOfUser.collectStatus === 1) {
  120 + this.interactData.collectNum = Number(this.interactData.collectNum) + 1
  121 + } else {
  122 + this.interactData.collectNum = Number(this.interactData.collectNum) - 1
  123 + }
  124 + console.log('收藏、取消收藏==', this.newsStatusOfUser?.collectStatus, this.interactData?.collectNum)
111 } 125 }
112 }) 126 })
113 127
@@ -140,9 +154,10 @@ export struct OperationListView { @@ -140,9 +154,10 @@ export struct OperationListView {
140 /** 154 /**
141 * 关注号主 155 * 关注号主
142 */ 156 */
143 - handleAccention() { 157 + async handleAccention() {
144 // 未登录,跳转登录 158 // 未登录,跳转登录
145 - if (!HttpUrlUtils.getUserId()) { 159 + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
  160 + if (!user_id) {
146 WDRouterRule.jumpWithPage(WDRouterPage.loginPage) 161 WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
147 return 162 return
148 } 163 }
@@ -181,7 +196,15 @@ export struct OperationListView { @@ -181,7 +196,15 @@ export struct OperationListView {
181 }) 196 })
182 .id("row1") 197 .id("row1")
183 .onClick(() => { 198 .onClick(() => {
184 - // 号主页 199 + if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
  200 + // 号主页
  201 + const params: Params = {
  202 + creatorId: this.contentDetailData.rmhInfo.rmhId,
  203 + pageID: ''
  204 + }
  205 + WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
  206 + }
  207 +
185 }) 208 })
186 if (this.followStatus == '0') { 209 if (this.followStatus == '0') {
187 Image($r('app.media.ic_add')) 210 Image($r('app.media.ic_add'))
@@ -60,52 +60,14 @@ export struct PlayerDetailContainer { @@ -60,52 +60,14 @@ export struct PlayerDetailContainer {
60 } 60 }
61 61
62 build() { 62 build() {
63 - RelativeContainer() {  
64 - Row() {  
65 - Stack() {  
66 - Row() {  
67 - this.playerView()  
68 - }  
69 - .height('100%')  
70 - .width('100%')  
71 - .zIndex(0)  
72 - .margin({ top: this.videoLandScape === 1 ? 218 : 0 })  
73 -  
74 - Row() {  
75 - this.playControlView()  
76 - }  
77 - .height('100%')  
78 - .width('100%')  
79 - .zIndex(1)  
80 - }  
81 - .width('100%')  
82 - .height('100%')  
83 - // .aspectRatio(this.isFullScreen ? 0.1 : 16 / 9.0) // 若width值确定,当aspectRatio值越小,则height值越大  
84 - // .height(this.isFullScreen ? '100%' : this.buildVideoHeight())  
85 - // .margin({ top: this.isFullScreen ? 0 : this.buildVideoTo() })  
86 - // .margin({ bottom: this.isFullScreen ? 0 : this.buildVideoBottom() })  
87 - .alignRules({  
88 - top: { anchor: '__container__', align: VerticalAlign.Top },  
89 - // middle: { anchor: '__container__', align: HorizontalAlign.Center }  
90 - })  
91 - .id('stk_player_container')  
92 - }.height('100%').layoutWeight(1)  
93 -  
94 - if (this.isShowBottomView()) {  
95 - Row() {  
96 - this.detailView()  
97 - }  
98 - .width('100%')  
99 - // .opacity(0.3)  
100 - .alignRules({  
101 - bottom: { anchor: '__container__', align: VerticalAlign.Bottom },  
102 - // middle: { anchor: '__container__', align: HorizontalAlign.Center }  
103 - })  
104 - .id('row_bottomView')  
105 - } 63 + Stack() {
  64 + this.playerView()
  65 + this.detailView()
106 } 66 }
107 .width('100%') 67 .width('100%')
108 .height('100%') 68 .height('100%')
109 69
  70 + // .backgroundColor(Color.Black) // 扩展至所有非安全区域
  71 + // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
110 } 72 }
111 } 73 }
@@ -140,7 +140,11 @@ export struct PlayerTitleComment { @@ -140,7 +140,11 @@ export struct PlayerTitleComment {
140 .width(48) 140 .width(48)
141 } 141 }
142 .width('100%') 142 .width('100%')
  143 + .layoutWeight(1)
143 .alignItems(VerticalAlign.Bottom) 144 .alignItems(VerticalAlign.Bottom)
  145 + .onClick(() => {
  146 + this.playerController?.switchPlayOrPause()
  147 + })
144 148
145 Row() { 149 Row() {
146 Column() { 150 Column() {
@@ -194,9 +198,10 @@ export struct PlayerTitleComment { @@ -194,9 +198,10 @@ export struct PlayerTitleComment {
194 }.backgroundColor(Color.Black) 198 }.backgroundColor(Color.Black)
195 199
196 } 200 }
  201 + .height('100%')
197 .width('100%') 202 .width('100%')
198 - // .height('40%')  
199 - .alignItems(HorizontalAlign.Start) 203 + .alignItems(HorizontalAlign.End)
  204 + .align(Alignment.End)
200 .opacity(this.isOpen ? 0 : 1) 205 .opacity(this.isOpen ? 0 : 1)
201 .animation({ duration: 200 }) 206 .animation({ duration: 200 })
202 } 207 }
@@ -4,9 +4,9 @@ import { WDRouterPage } from 'wdRouter'; @@ -4,9 +4,9 @@ import { WDRouterPage } from 'wdRouter';
4 @Entry 4 @Entry
5 @Component 5 @Component
6 struct GuidePages { 6 struct GuidePages {
7 - guideImage = [$r('app.media.guide_static1'), $r('app.media.guide_static2'), $r('app.media.guide_static3'), $r('app.media.guide_static4')]  
8 - guideTitle = [$r('app.media.guide_title1'), $r('app.media.guide_title2'), $r('app.media.guide_title3'), $r('app.media.guide_title4')]  
9 - guideIndex = [$r('app.media.guide_index1'), $r('app.media.guide_index2'), $r('app.media.guide_index3'), $r('app.media.guide_button')] 7 + guideImage = [$r('app.media.guide_static1'), $r('app.media.guide_static2'), $r('app.media.guide_static3'), $r('app.media.guide_static4'),$r('app.media.guide_static5')]
  8 + guideTitle = [$r('app.media.guide_title1'), $r('app.media.guide_title2'), $r('app.media.guide_title3'), $r('app.media.guide_title4'),$r('app.media.guide_title5')]
  9 + guideIndex = [$r('app.media.guide_index1'), $r('app.media.guide_index2'), $r('app.media.guide_index3'),$r('app.media.guide_index4'), $r('app.media.guide_button')]
10 10
11 build() { 11 build() {
12 Column() { 12 Column() {
@@ -57,7 +57,7 @@ struct GuidePages { @@ -57,7 +57,7 @@ struct GuidePages {
57 .margin({ bottom: 85 }) 57 .margin({ bottom: 85 })
58 .height(40) 58 .height(40)
59 .onClick(() => { 59 .onClick(() => {
60 - if (index == 3) { 60 + if (index == 4) {
61 // 跳转到首页 61 // 跳转到首页
62 //WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) 62 //WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
63 //跳转到兴趣偏好选择页 63 //跳转到兴趣偏好选择页
@@ -85,7 +85,7 @@ export struct WDPlayerRenderLiveView { @@ -85,7 +85,7 @@ export struct WDPlayerRenderLiveView {
85 console.log('insId===', this.insId) 85 console.log('insId===', this.insId)
86 this.xComponentController.setXComponentSurfaceSize({ 86 this.xComponentController.setXComponentSurfaceSize({
87 surfaceWidth: 1920, 87 surfaceWidth: 1920,
88 - surfaceHeight: 1080 88 + surfaceHeight: 720
89 }); 89 });
90 this.playerController?.setXComponentController(this.xComponentController) 90 this.playerController?.setXComponentController(this.xComponentController)
91 if (this.onLoad) { 91 if (this.onLoad) {
@@ -92,6 +92,7 @@ export struct WDPlayerRenderVLiveView { @@ -92,6 +92,7 @@ export struct WDPlayerRenderVLiveView {
92 // .height(this.selfSize.height) 92 // .height(this.selfSize.height)
93 .height('100%') 93 .height('100%')
94 .width('100%') 94 .width('100%')
  95 + .renderFit(RenderFit.RESIZE_COVER)
95 } 96 }
96 .id(this.insId) 97 .id(this.insId)
97 .onAreaChange(() => { 98 .onAreaChange(() => {
@@ -100,6 +101,7 @@ export struct WDPlayerRenderVLiveView { @@ -100,6 +101,7 @@ export struct WDPlayerRenderVLiveView {
100 .backgroundColor("#000000") 101 .backgroundColor("#000000")
101 .height('100%') 102 .height('100%')
102 .width('100%') 103 .width('100%')
  104 + .renderFit(RenderFit.RESIZE_COVER)
103 } 105 }
104 106
105 updateLayout() { 107 updateLayout() {
@@ -5,7 +5,8 @@ @@ -5,7 +5,8 @@
5 "lockfileVersion": 3, 5 "lockfileVersion": 3,
6 "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", 6 "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
7 "specifiers": { 7 "specifiers": {
8 - "@ohos/hypium@1.0.16": "@ohos/hypium@1.0.16" 8 + "@ohos/hypium@1.0.16": "@ohos/hypium@1.0.16",
  9 + "@ohos/pulltorefresh@^2.0.5": "@ohos/pulltorefresh@2.0.5"
9 }, 10 },
10 "packages": { 11 "packages": {
11 "@ohos/hypium@1.0.16": { 12 "@ohos/hypium@1.0.16": {
@@ -13,6 +14,12 @@ @@ -13,6 +14,12 @@
13 "integrity": "sha512-PC3jpwKERg68V+4dmKU+SLjNps9i5JcQH57rQriaTsh62NBgVZs4SceMmNOtrIOyldbEJ5mXSwoZwiG/nkRmTw==", 14 "integrity": "sha512-PC3jpwKERg68V+4dmKU+SLjNps9i5JcQH57rQriaTsh62NBgVZs4SceMmNOtrIOyldbEJ5mXSwoZwiG/nkRmTw==",
14 "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.16.har", 15 "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.16.har",
15 "registryType": "ohpm" 16 "registryType": "ohpm"
  17 + },
  18 + "@ohos/pulltorefresh@2.0.5": {
  19 + "name": "@ohos/pulltorefresh",
  20 + "integrity": "sha512-mgBvJ6Ga70LmAoPKTOEPLFJluHUEAaBt2+7wF7R6223Vw6UEbZrof1MyvVOLEHk8Uc64ASIMW/TNQ8AHraTV5A==",
  21 + "resolved": "https://repo.harmonyos.com/ohpm/@ohos/pulltorefresh/-/pulltorefresh-2.0.5.har",
  22 + "registryType": "ohpm"
16 } 23 }
17 } 24 }
18 } 25 }
@@ -8,5 +8,8 @@ @@ -8,5 +8,8 @@
8 "description": "Please describe the basic information.", 8 "description": "Please describe the basic information.",
9 "main": "", 9 "main": "",
10 "version": "1.0.0", 10 "version": "1.0.0",
11 - "dependencies": {}  
12 -} 11 + "dependencies": {
  12 + "@ohos/pulltorefresh": "^2.0.5"
  13 + },
  14 + "dynamicDependencies": {}
  15 +}
@@ -3,6 +3,7 @@ import { WDRouterRule } from 'wdRouter'; @@ -3,6 +3,7 @@ import { WDRouterRule } from 'wdRouter';
3 import { WDRouterPage } from 'wdRouter'; 3 import { WDRouterPage } from 'wdRouter';
4 import { SPHelper } from 'wdKit/Index'; 4 import { SPHelper } from 'wdKit/Index';
5 import { SpConstants } from 'wdConstant/Index'; 5 import { SpConstants } from 'wdConstant/Index';
  6 +import { ButtonOptions, promptAction } from '@kit.ArkUI';
6 7
7 @Entry 8 @Entry
8 @Component 9 @Component
@@ -79,6 +80,11 @@ struct LaunchInterestsHobbiesPage { @@ -79,6 +80,11 @@ struct LaunchInterestsHobbiesPage {
79 .margin({top:'2lpx',left:'19lpx'}) 80 .margin({top:'2lpx',left:'19lpx'})
80 .width('100%') 81 .width('100%')
81 .height('31lpx') 82 .height('31lpx')
  83 + Image(item.choose ? $r('app.media.interestsSelected') : $r('app.media.interestsSelectNot'))
  84 + .height('32lpx')
  85 + .width('32lpx')
  86 + .margin({top:'80lpx',left:'110lpx'})
  87 +
82 }.justifyContent(FlexAlign.Start) 88 }.justifyContent(FlexAlign.Start)
83 } 89 }
84 90
@@ -87,7 +93,7 @@ struct LaunchInterestsHobbiesPage { @@ -87,7 +93,7 @@ struct LaunchInterestsHobbiesPage {
87 .width('100%') 93 .width('100%')
88 .height('100%') 94 .height('100%')
89 .backgroundColor(Color.White) 95 .backgroundColor(Color.White)
90 - .opacity(item.choose?0:0.7) 96 + .opacity(item.choose?0:0.6)
91 .borderRadius(5) 97 .borderRadius(5)
92 } 98 }
93 } 99 }
@@ -122,7 +128,21 @@ struct LaunchInterestsHobbiesPage { @@ -122,7 +128,21 @@ struct LaunchInterestsHobbiesPage {
122 .borderRadius('10lpx') 128 .borderRadius('10lpx')
123 .width('662lpx') 129 .width('662lpx')
124 .height('84lpx') 130 .height('84lpx')
  131 + Image('')
  132 + .width('662lpx')
  133 + .height('84lpx')
  134 + .backgroundColor(Color.White)
  135 + .opacity(this.selectCount == 0 ? 0.6 : 0)
  136 + .borderRadius('10lpx')
125 .onClick(()=>{ 137 .onClick(()=>{
  138 + if (this.selectCount == 0) {
  139 + promptAction.showToast({
  140 + message : '请先选择您感兴趣的内容哦',
  141 + duration: 2000,
  142 + bottom: 50
  143 + })
  144 + return
  145 + }
126 this.saveTagIds() 146 this.saveTagIds()
127 //跳转首页 147 //跳转首页
128 WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) 148 WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
@@ -43,7 +43,10 @@ @@ -43,7 +43,10 @@
43 { 43 {
44 "name": "privacy_text_title_protocol", 44 "name": "privacy_text_title_protocol",
45 "value": "《用户协议》" 45 "value": "《用户协议》"
  46 + },
  47 + {
  48 + "name": "reason_read_write_media",
  49 + "value": "user_grant"
46 } 50 }
47 -  
48 ] 51 ]
49 } 52 }
@@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
7 "pages/MorningEveningPaperPage", 7 "pages/MorningEveningPaperPage",
8 "pages/detail/AudioDetail", 8 "pages/detail/AudioDetail",
9 "pages/detail/MultiPictureDetailPage", 9 "pages/detail/MultiPictureDetailPage",
  10 + "pages/detail/DynamicDetailPage",
10 "pages/launchPage/PrivacyPage", 11 "pages/launchPage/PrivacyPage",
11 "pages/launchPage/LaunchPage", 12 "pages/launchPage/LaunchPage",
12 "pages/launchPage/LaunchAdvertisingPage", 13 "pages/launchPage/LaunchAdvertisingPage",
@@ -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,