yumaochao
Showing 68 changed files with 909 additions and 276 deletions
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 "app": { 2 "app": {
3 "bundleName": "com.peopledailychina.hosactivity", 3 "bundleName": "com.peopledailychina.hosactivity",
4 "vendor": "$string:app_vendor", 4 "vendor": "$string:app_vendor",
5 - "versionCode": 10000,  
6 - "versionName": "1.0.0", 5 + "versionCode": 7370,
  6 + "versionName": "7.3.7.0",
7 "icon": "$media:app_icon", 7 "icon": "$media:app_icon",
8 "label": "$string:app_name" 8 "label": "$string:app_name"
9 } 9 }
@@ -17,10 +17,26 @@ @@ -17,10 +17,26 @@
17 "value": "13fp" 17 "value": "13fp"
18 }, 18 },
19 { 19 {
  20 + "name": "font_size_13_5",
  21 + "value": "13.5fp"
  22 + },
  23 + {
  24 + "name": "font_size_13_2",
  25 + "value": "13.2fp"
  26 + },
  27 + {
20 "name": "font_size_14", 28 "name": "font_size_14",
21 "value": "14fp" 29 "value": "14fp"
22 }, 30 },
23 { 31 {
  32 + "name": "font_size_14_5",
  33 + "value": "14.5fp"
  34 + },
  35 + {
  36 + "name": "font_size_15",
  37 + "value": "15fp"
  38 + },
  39 + {
24 "name": "font_size_16", 40 "name": "font_size_16",
25 "value": "16fp" 41 "value": "16fp"
26 }, 42 },
  1 +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g><g></g><g style="opacity:0.5;"><g><path d="M20.314453125,11.330568125C20.314453125,6.360008125,16.285053124999997,2.330566406,11.314453125,2.330566406C6.343893125,2.330566406,2.314453125,6.360008125,2.314453125,11.330568125C2.314453125,13.375078125,2.999354125,15.317678125,4.237673125,16.891578125000002C5.933093125,19.046478125,8.518933125,20.330578125,11.314453125,20.330578125C16.285053124999997,20.330578125,20.314453125,16.301178125,20.314453125,11.330568125ZM4.314453125,11.330568125C4.314453125,7.464568125,7.448463125,4.330568125,11.314453125,4.330568125C15.180453125,4.330568125,18.314453125,7.464568125,18.314453125,11.330568125C18.314453125,15.196578125,15.180453125,18.330578125,11.314453125,18.330578125C9.138813125,18.330578125,7.129653125,17.332878125,5.8094931249999995,15.654978125C4.846133125,14.430478125,4.314453125,12.922378125,4.314453125,11.330568125Z" fill-rule="evenodd" fill="#8794A3" fill-opacity="1"/></g><g transform="matrix(0.7071067690849304,0.7071067690849304,-0.7071067690849304,0.7071067690849304,16.41416933434084,-7.627309776376933)" style="opacity:0.800000011920929;"><path d="M17.6140625,16L22.7906525,16C22.9393225,16,23.0360225,16.156463,22.9695325,16.289443L22.1695325,17.88944C22.1356625,17.9572,22.0664025,18,21.9906525,18L17.6140625,18C17.5036056,18,17.4140625,17.91046,17.4140625,17.8L17.4140625,16.2C17.4140625,16.0895431,17.5036056,16,17.6140625,16" fill="#8794A3" fill-opacity="0.800000011920929"/></g></g></g></svg>
  1 +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g><g></g><g style="opacity:0.5;"><g><path d="M20.314453125,11.330568125C20.314453125,6.360008125,16.285053124999997,2.330566406,11.314453125,2.330566406C6.343893125,2.330566406,2.314453125,6.360008125,2.314453125,11.330568125C2.314453125,13.375078125,2.999354125,15.317678125,4.237673125,16.891578125000002C5.933093125,19.046478125,8.518933125,20.330578125,11.314453125,20.330578125C16.285053124999997,20.330578125,20.314453125,16.301178125,20.314453125,11.330568125ZM4.314453125,11.330568125C4.314453125,7.464568125,7.448463125,4.330568125,11.314453125,4.330568125C15.180453125,4.330568125,18.314453125,7.464568125,18.314453125,11.330568125C18.314453125,15.196578125,15.180453125,18.330578125,11.314453125,18.330578125C9.138813125,18.330578125,7.129653125,17.332878125,5.8094931249999995,15.654978125C4.846133125,14.430478125,4.314453125,12.922378125,4.314453125,11.330568125Z" fill-rule="evenodd" fill="#000000" fill-opacity="1"/></g><g transform="matrix(0.7071067690849304,0.7071067690849304,-0.7071067690849304,0.7071067690849304,16.41416933434084,-7.627309776376933)" style="opacity:0.800000011920929;"><path d="M17.6140625,16L22.7906525,16C22.9393225,16,23.0360225,16.156463,22.9695325,16.289443L22.1695325,17.88944C22.1356625,17.9572,22.0664025,18,21.9906525,18L17.6140625,18C17.5036056,18,17.4140625,17.91046,17.4140625,17.8L17.4140625,16.2C17.4140625,16.0895431,17.5036056,16,17.6140625,16" fill="#000000" fill-opacity="0.800000011920929"/></g></g></g></svg>
@@ -40,6 +40,9 @@ instance.interceptors.request.use( @@ -40,6 +40,9 @@ instance.interceptors.request.use(
40 // 公共请求参数 40 // 公共请求参数
41 // config.params.key = key 41 // config.params.key = key
42 Logger.debug('HttpRequest', 'request: ' + config.url) 42 Logger.debug('HttpRequest', 'request: ' + config.url)
  43 + // TODO 临时打印token,测试token失效。待删除
  44 + Logger.debug('HttpRequest', 'request token: ' + config?.headers?.get('RMRB-X-TOKEN'))
  45 + Logger.debug('HttpRequest', 'request cookie: ' + config?.headers?.get('cookie'))
43 return config; 46 return config;
44 }, 47 },
45 (error: AxiosError) => { 48 (error: AxiosError) => {
@@ -29,10 +29,11 @@ export class HttpBizUtil { @@ -29,10 +29,11 @@ export class HttpBizUtil {
29 // 403:临时token;406:强制下线、封禁、清空登录信息还要跳转登录页面 29 // 403:临时token;406:强制下线、封禁、清空登录信息还要跳转登录页面
30 if (res.code == 403 || res.code == 406) { 30 if (res.code == 403 || res.code == 406) {
31 HttpBizUtil.refreshToken().then((token: string) => { 31 HttpBizUtil.refreshToken().then((token: string) => {
32 - if (headers) {  
33 - headers.replace('RMRB-X-TOKEN', token)  
34 - headers.replace('cookie', 'RMRB-X-TOKEN=' + token) 32 + if (!headers) {
  33 + headers = new HashMap()
35 } 34 }
  35 + headers?.replace('RMRB-X-TOKEN', token)
  36 + headers?.replace('cookie', 'RMRB-X-TOKEN=' + token)
36 Logger.debug(TAG, 'get again send: ' + token) 37 Logger.debug(TAG, 'get again send: ' + token)
37 // refreshToken为空场景不处理,直接请求接口。 38 // refreshToken为空场景不处理,直接请求接口。
38 WDHttp.get<T>(url, headers).then((againResDTO: T) => { 39 WDHttp.get<T>(url, headers).then((againResDTO: T) => {
@@ -67,10 +68,11 @@ export class HttpBizUtil { @@ -67,10 +68,11 @@ export class HttpBizUtil {
67 Logger.debug(TAG, 'post catch error: ' + JSON.stringify(res)) 68 Logger.debug(TAG, 'post catch error: ' + JSON.stringify(res))
68 if (res.code == 403 || res.code == 406) { 69 if (res.code == 403 || res.code == 406) {
69 HttpBizUtil.refreshToken().then((token: string) => { 70 HttpBizUtil.refreshToken().then((token: string) => {
70 - if (headers) {  
71 - headers.replace('RMRB-X-TOKEN', token)  
72 - headers.replace('cookie', 'RMRB-X-TOKEN=' + token) 71 + if (!headers) {
  72 + headers = new HashMap()
73 } 73 }
  74 + headers?.replace('RMRB-X-TOKEN', token)
  75 + headers?.replace('cookie', 'RMRB-X-TOKEN=' + token)
74 Logger.debug(TAG, 'post again send: ' + token) 76 Logger.debug(TAG, 'post again send: ' + token)
75 // refreshToken为空场景不处理,直接请求接口。 77 // refreshToken为空场景不处理,直接请求接口。
76 WDHttp.post<T>(url, data, headers).then((againResDTO: T) => { 78 WDHttp.post<T>(url, data, headers).then((againResDTO: T) => {
@@ -32,6 +32,11 @@ export class HttpUrlUtils { @@ -32,6 +32,11 @@ export class HttpUrlUtils {
32 * 详情页面详情接口 32 * 详情页面详情接口
33 */ 33 */
34 static readonly DETAIL_PATH: string = "/api/rmrb-bff-display-zh/content/zh/c/content/detail"; 34 static readonly DETAIL_PATH: string = "/api/rmrb-bff-display-zh/content/zh/c/content/detail";
  35 +
  36 + /**
  37 + * 获取视频直播间拉流地址
  38 + */
  39 + static readonly PULL_STREAM_PATH: string = "/api/live-center-video/zh/c/vlive/pull-stream/";
35 /** 40 /**
36 * 批查接口,查询互动相关数据,如收藏数、评论数等 41 * 批查接口,查询互动相关数据,如收藏数、评论数等
37 */ 42 */
@@ -676,6 +681,15 @@ export class HttpUrlUtils { @@ -676,6 +681,15 @@ export class HttpUrlUtils {
676 return url 681 return url
677 } 682 }
678 683
  684 + static getLiveSendBarrageUrl() {
  685 + let url = HttpUrlUtils.getHost() + "/api/live-center-message/zh/c/live/message/chat/send"
  686 + return url
  687 + }
  688 + static getLiveTouristSendBarrageUrl() {
  689 + let url = HttpUrlUtils.getHost() + "/api/live-center-message/zh/a/live/message/chat/tourist/send"
  690 + return url
  691 + }
  692 +
679 static getAppointmentStatusUrl() { 693 static getAppointmentStatusUrl() {
680 let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_APPOINTMENT_BATCH_PATH 694 let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_APPOINTMENT_BATCH_PATH
681 return url 695 return url
@@ -70,6 +70,8 @@ export { NewspaperTimeItemBean } from './src/main/ets/bean/newspaper/NewspaperTi @@ -70,6 +70,8 @@ export { NewspaperTimeItemBean } from './src/main/ets/bean/newspaper/NewspaperTi
70 70
71 export { ContentDetailDTO } from './src/main/ets/bean/detail/ContentDetailDTO'; 71 export { ContentDetailDTO } from './src/main/ets/bean/detail/ContentDetailDTO';
72 72
  73 +export { GetPullAddressBean } from './src/main/ets/bean/live/GetPullAddressBean';
  74 +
73 export { RmhInfoDTO } from './src/main/ets/bean/detail/RmhInfoDTO'; 75 export { RmhInfoDTO } from './src/main/ets/bean/detail/RmhInfoDTO';
74 76
75 export { UserInfoDTO } from './src/main/ets/bean/detail/UserInfoDTO'; 77 export { UserInfoDTO } from './src/main/ets/bean/detail/UserInfoDTO';
@@ -59,6 +59,7 @@ export class ContentDTO implements BaseDTO { @@ -59,6 +59,7 @@ export class ContentDTO implements BaseDTO {
59 source: string = ''; 59 source: string = '';
60 objectId: string = ''; 60 objectId: string = '';
61 objectType: string = ''; 61 objectType: string = '';
  62 + objectLevel: string = '';
62 channelId: string = ''; 63 channelId: string = '';
63 relId: string = ''; 64 relId: string = '';
64 relType: string = ''; 65 relType: string = '';
@@ -102,6 +103,7 @@ export class ContentDTO implements BaseDTO { @@ -102,6 +103,7 @@ export class ContentDTO implements BaseDTO {
102 liveRoomDataBean : LiveRoomDataBean = {} as LiveRoomDataBean// 批查获取到的直播观看人数 103 liveRoomDataBean : LiveRoomDataBean = {} as LiveRoomDataBean// 批查获取到的直播观看人数
103 //本地字段:时间轴专题页节点组件时间;【如果开启模糊则显示时间->左右;0:否,1:是】 104 //本地字段:时间轴专题页节点组件时间;【如果开启模糊则显示时间->左右;0:否,1:是】
104 timeBlurred:number = 0 105 timeBlurred:number = 0
  106 + top:number = 0
105 107
106 static clone(old: ContentDTO): ContentDTO { 108 static clone(old: ContentDTO): ContentDTO {
107 let content = new ContentDTO(); 109 let content = new ContentDTO();
@@ -19,4 +19,9 @@ export interface RmhInfoDTO { @@ -19,4 +19,9 @@ export interface RmhInfoDTO {
19 userId: string; 19 userId: string;
20 userType: string; 20 userType: string;
21 honoraryIcon:string; 21 honoraryIcon:string;
  22 +
  23 + /**
  24 + * 发布标识,0-cms;1-表示号主发布
  25 + */
  26 + rmhPlatform:number
22 } 27 }
  1 +/**
  2 + * 获取拉流地址解析类
  3 + */
  4 +export class GetPullAddressBean {
  5 + origin: OriginBean = new OriginBean();
  6 + transCode: Array<TransCodeBean> = new Array;
  7 +}
  8 +
  9 +class OriginBean {
  10 + expireTime: number = -1;
  11 + definition: string = '';
  12 + flvUrl: string = '';
  13 + m3u8Url: string = '';
  14 + rtmpUrl: string = '';
  15 + rtsUrl: string = '';
  16 +}
  17 +
  18 +export class TransCodeBean {
  19 + expireTime: number = -1;
  20 + definition: string = '';
  21 + flvUrl: string = '';
  22 + m3u8Url: string = '';
  23 + rtmpUrl: string = '';
  24 + rtsUrl: string = '';
  25 +}
@@ -32,6 +32,10 @@ export struct CardParser { @@ -32,6 +32,10 @@ export struct CardParser {
32 pageShowTime:number = 0; 32 pageShowTime:number = 0;
33 pageHideTime:number = 0; 33 pageHideTime:number = 0;
34 34
  35 + aboutToAppear(): void {
  36 + console.log('CardParser-', JSON.stringify(this.contentDTO))
  37 + }
  38 +
35 onPageShow() { 39 onPageShow() {
36 this.pageShowTime = DateTimeUtils.getTimeStamp() 40 this.pageShowTime = DateTimeUtils.getTimeStamp()
37 } 41 }
@@ -49,10 +49,15 @@ export struct FeedBackActivity { @@ -49,10 +49,15 @@ export struct FeedBackActivity {
49 Column() { 49 Column() {
50 Text($r('app.string.feedback_opinion_type')) 50 Text($r('app.string.feedback_opinion_type'))
51 .fontColor($r('app.color.color_222222')) 51 .fontColor($r('app.color.color_222222'))
52 - .fontSize($r('app.float.font_size_16'))  
53 - .fontWeight(FontWeight.Bold) 52 + .fontSize($r('app.float.font_size_14_5'))
  53 + .fontWeight(600)
54 .width('100%') 54 .width('100%')
55 .margin({ left: 24, top: $r('app.float.vp_14') }) 55 .margin({ left: 24, top: $r('app.float.vp_14') })
  56 + Blank()
  57 + .height(0.5)
  58 + .width('94%')
  59 + .margin({ top: $r('app.float.vp_12') })
  60 + .backgroundColor($r('app.color.color_EDEDED'))
56 GridRow({ 61 GridRow({
57 columns:3, 62 columns:3,
58 }) { 63 }) {
@@ -82,21 +87,25 @@ export struct FeedBackActivity { @@ -82,21 +87,25 @@ export struct FeedBackActivity {
82 } 87 }
83 }) 88 })
84 } 89 }
85 - .width('94%') 90 + .width('90%')
86 .margin({top:$r('app.float.vp_16')}) 91 .margin({top:$r('app.float.vp_16')})
87 Blank() 92 Blank()
88 .height($r('app.float.margin_5')) 93 .height($r('app.float.margin_5'))
89 .backgroundColor($r('app.color.color_F5F5F5')) 94 .backgroundColor($r('app.color.color_F5F5F5'))
90 Text($r('app.string.feedback_opinion_tv')) 95 Text($r('app.string.feedback_opinion_tv'))
91 .fontColor($r('app.color.color_222222')) 96 .fontColor($r('app.color.color_222222'))
92 - .fontSize($r('app.float.font_size_16'))  
93 - .fontWeight(FontWeight.Bold) 97 + .fontSize($r('app.float.font_size_14_5'))
  98 + .fontWeight(600)
94 .width(CommonConstants.FULL_WIDTH) 99 .width(CommonConstants.FULL_WIDTH)
95 .margin({ left: 24, top: $r('app.float.vp_12') }) 100 .margin({ left: 24, top: $r('app.float.vp_12') })
96 Stack({ alignContent: Alignment.BottomEnd }) { 101 Stack({ alignContent: Alignment.BottomEnd }) {
97 TextArea({ placeholder: $r('app.string.feedback_comments') }) 102 TextArea({ placeholder: $r('app.string.feedback_comments') })
98 .width(CommonConstants.FULL_WIDTH) 103 .width(CommonConstants.FULL_WIDTH)
99 .height(CommonConstants.FULL_HEIGHT) 104 .height(CommonConstants.FULL_HEIGHT)
  105 + .fontColor($r('app.color.color_222222'))
  106 + .fontSize($r('app.float.font_size_13_2'))
  107 + .placeholderColor($r('app.color.color_CCCCCC'))
  108 + .placeholderFont({size:$r('app.float.font_size_13_2')})
100 .padding({bottom:96}) 109 .padding({bottom:96})
101 .backgroundColor($r('app.color.color_F5F5F5')) 110 .backgroundColor($r('app.color.color_F5F5F5'))
102 .align(Alignment.TopStart) 111 .align(Alignment.TopStart)
@@ -170,6 +179,8 @@ export struct FeedBackActivity { @@ -170,6 +179,8 @@ export struct FeedBackActivity {
170 .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_12'),left: $r('app.float.vp_12')}) 179 .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_12'),left: $r('app.float.vp_12')})
171 Text(this.textNumLabel) 180 Text(this.textNumLabel)
172 .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_11')}) 181 .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_11')})
  182 + .fontColor($r('app.color.color_999999'))
  183 + .fontSize($r('app.float.font_size_13_5'))
173 } 184 }
174 .height(200) 185 .height(200)
175 .width('94%') 186 .width('94%')
@@ -182,29 +193,49 @@ export struct FeedBackActivity { @@ -182,29 +193,49 @@ export struct FeedBackActivity {
182 193
183 Text($r('app.string.feedback_email')) 194 Text($r('app.string.feedback_email'))
184 .fontColor($r('app.color.color_222222')) 195 .fontColor($r('app.color.color_222222'))
185 - .fontSize($r('app.float.font_size_14')) 196 + .fontSize($r('app.float.font_size_13_2'))
186 .width('94%') 197 .width('94%')
187 .margin({ top: $r('app.float.margin_24') }) 198 .margin({ top: $r('app.float.margin_24') })
  199 +
188 Row() { 200 Row() {
  201 + Blank().width('3%')
189 Text($r('app.string.feedback_mail')) 202 Text($r('app.string.feedback_mail'))
  203 + .height(CommonConstants.FULL_HEIGHT)
190 .fontColor($r('app.color.color_222222')) 204 .fontColor($r('app.color.color_222222'))
191 - .fontSize($r('app.float.font_size_14'))  
192 - .fontWeight(FontWeight.Bold) 205 + .fontSize($r('app.float.font_size_13_2'))
  206 + .fontWeight(600)
  207 + .padding({left: $r('app.float.margin_12') })
  208 + .backgroundColor($r('app.color.color_F5F5F5'))
  209 + .borderRadius({
  210 + topLeft: 4,
  211 + topRight: 0,
  212 + bottomLeft: 4,
  213 + bottomRight: 0,
  214 + })
  215 +
193 TextInput({ placeholder: $r('app.string.feedback_hideemail') }) 216 TextInput({ placeholder: $r('app.string.feedback_hideemail') })
194 - .width(CommonConstants.FULL_WIDTH) 217 + .width(0)
  218 + .layoutWeight(1)
195 .height(CommonConstants.FULL_HEIGHT) 219 .height(CommonConstants.FULL_HEIGHT)
196 - // .margin({left:15}) 220 + .fontColor($r('app.color.color_222222'))
  221 + .fontSize($r('app.float.font_size_13_2'))
  222 + .placeholderColor($r('app.color.color_CCCCCC'))
  223 + .placeholderFont({size:$r('app.float.font_size_13_2')})
197 .backgroundColor($r('app.color.color_F5F5F5')) 224 .backgroundColor($r('app.color.color_F5F5F5'))
  225 + .borderRadius({
  226 + topLeft: 0,
  227 + topRight: 4,
  228 + bottomLeft: 0,
  229 + bottomRight: 4,
  230 + })
198 .onChange((value) => { 231 .onChange((value) => {
199 - // Logger.debug(TAG, "onChange" + value + "/" + this.passwordContent)  
200 this.email = value 232 this.email = value
201 }) 233 })
  234 + Blank().width('3%')
202 } 235 }
203 - .height(44)  
204 - .width('94%')  
205 - .backgroundColor($r('app.color.color_F5F5F5'))  
206 - .margin({top: $r('app.float.margin_16') })  
207 - .borderRadius(4) 236 + .height(42)
  237 + .width(CommonConstants.FULL_WIDTH)
  238 + .margin({top: $r('app.float.margin_16')})
208 Blank().layoutWeight(1) 239 Blank().layoutWeight(1)
209 } 240 }
210 } 241 }
@@ -216,8 +247,8 @@ export struct FeedBackActivity { @@ -216,8 +247,8 @@ export struct FeedBackActivity {
216 Column(){ 247 Column(){
217 Text($r('app.string.submit')) 248 Text($r('app.string.submit'))
218 .textAlign(TextAlign.Center) 249 .textAlign(TextAlign.Center)
219 - .height(44)  
220 - .width('90%') 250 + .height(42)
  251 + .width('94%')
221 .fontColor(this.canSubmit ? $r('app.color.color_fff') : $r('app.color.color_FFFFFF_40')) 252 .fontColor(this.canSubmit ? $r('app.color.color_fff') : $r('app.color.color_FFFFFF_40'))
222 .fontSize($r('app.float.font_size_18')) 253 .fontSize($r('app.float.font_size_18'))
223 .backgroundColor(this.canSubmit ? $r('app.color.color_ED2800') : $r('app.color.color_ED2800_99')) 254 .backgroundColor(this.canSubmit ? $r('app.color.color_ED2800') : $r('app.color.color_ED2800_99'))
@@ -232,6 +263,7 @@ export struct FeedBackActivity { @@ -232,6 +263,7 @@ export struct FeedBackActivity {
232 } 263 }
233 }.margin({bottom:20}) 264 }.margin({bottom:20})
234 } 265 }
  266 + .backgroundColor($r('app.color.color_fff'))
235 } 267 }
236 268
237 /** 269 /**
@@ -169,8 +169,8 @@ export struct SingleColumn999Component { @@ -169,8 +169,8 @@ export struct SingleColumn999Component {
169 */ 169 */
170 @Builder 170 @Builder
171 buildPaperItem(item: ContentDTO, index: number) { 171 buildPaperItem(item: ContentDTO, index: number) {
172 - ///屏蔽早晚报 音频  
173 - if (item.objectType != '13'){ 172 + ///屏蔽早晚报 音频 和 音频专题
  173 + if (item.objectType != '13'&&!(item.objectType == '5' && item.objectLevel === '22')){
174 PaperSingleColumn999CardView({ 174 PaperSingleColumn999CardView({
175 item: item, 175 item: item,
176 index: index, 176 index: index,
@@ -39,13 +39,16 @@ export struct Card11Component { @@ -39,13 +39,16 @@ export struct Card11Component {
39 Column() { 39 Column() {
40 Stack() { 40 Stack() {
41 if(this.contentDTO.objectType == '5'){ 41 if(this.contentDTO.objectType == '5'){
42 - Notes({ objectType: this.contentDTO.objectType }).height(20).align(Alignment.Center) 42 + Notes({ objectType: this.contentDTO.objectType }).height(28).align(Alignment.Center)
43 } else { 43 } else {
44 if (this.contentDTO.seoTags) { 44 if (this.contentDTO.seoTags) {
45 - Notes({ newTags: this.contentDTO.seoTags }).height(20).align(Alignment.Center) 45 + Notes({ newTags: this.contentDTO.seoTags }).height(28).align(Alignment.Center)
46 } 46 }
47 if (this.contentDTO.newTags) { 47 if (this.contentDTO.newTags) {
48 - Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center) 48 + Notes({ newTags: this.contentDTO.newTags }).height(28).align(Alignment.Center)
  49 + }
  50 + if (this.contentDTO.top === 1) {
  51 + Notes({ newTags: '置顶' }).height(28).align(Alignment.Center)
49 } 52 }
50 } 53 }
51 Text() { 54 Text() {
@@ -70,7 +73,7 @@ export struct Card11Component { @@ -70,7 +73,7 @@ export struct Card11Component {
70 .width(CommonConstants.FULL_WIDTH) 73 .width(CommonConstants.FULL_WIDTH)
71 .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && 74 .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
72 (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : 75 (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 :
73 - ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 : 76 + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 :
74 0 ) 77 0 )
75 78
76 }.alignContent(Alignment.TopStart) 79 }.alignContent(Alignment.TopStart)
@@ -69,6 +69,9 @@ export struct Card2Component { @@ -69,6 +69,9 @@ export struct Card2Component {
69 if (this.contentDTO.newTags) { 69 if (this.contentDTO.newTags) {
70 Notes({ newTags: this.contentDTO.newTags }).height(29).align(Alignment.Center) 70 Notes({ newTags: this.contentDTO.newTags }).height(29).align(Alignment.Center)
71 } 71 }
  72 + if (this.contentDTO.top === 1) {
  73 + Notes({ newTags: '置顶' }).height(29).align(Alignment.Center)
  74 + }
72 } 75 }
73 //新闻标题 76 //新闻标题
74 // if (this.contentDTO.newTags) { 77 // if (this.contentDTO.newTags) {
@@ -101,7 +104,7 @@ export struct Card2Component { @@ -101,7 +104,7 @@ export struct Card2Component {
101 .align(Alignment.Start) 104 .align(Alignment.Start)
102 .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && 105 .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
103 (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : 106 (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 :
104 - ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 : 107 + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 :
105 0 ) 108 0 )
106 }.alignContent(Alignment.TopStart) 109 }.alignContent(Alignment.TopStart)
107 110
@@ -50,6 +50,9 @@ export struct Card3Component { @@ -50,6 +50,9 @@ export struct Card3Component {
50 if (this.contentDTO.newTags) { 50 if (this.contentDTO.newTags) {
51 Notes({ newTags: this.contentDTO.newTags }).height(29).align(Alignment.Center) 51 Notes({ newTags: this.contentDTO.newTags }).height(29).align(Alignment.Center)
52 } 52 }
  53 + if (this.contentDTO.top === 1) {
  54 + Notes({ newTags: '置顶' }).height(29).align(Alignment.Center)
  55 + }
53 } 56 }
54 Text() { 57 Text() {
55 if (this.titleMarked) { 58 if (this.titleMarked) {
@@ -71,7 +74,7 @@ export struct Card3Component { @@ -71,7 +74,7 @@ export struct Card3Component {
71 .width(CommonConstants.FULL_WIDTH) 74 .width(CommonConstants.FULL_WIDTH)
72 .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && 75 .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
73 (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : 76 (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 :
74 - ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 : 77 + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 :
75 0 ) 78 0 )
76 }.alignContent(Alignment.TopStart) 79 }.alignContent(Alignment.TopStart)
77 80
@@ -55,6 +55,9 @@ export struct Card4Component { @@ -55,6 +55,9 @@ export struct Card4Component {
55 if (this.contentDTO.newTags) { 55 if (this.contentDTO.newTags) {
56 Notes({ newTags: this.contentDTO.newTags }).height(19).align(Alignment.Center) 56 Notes({ newTags: this.contentDTO.newTags }).height(19).align(Alignment.Center)
57 } 57 }
  58 + if (this.contentDTO.top === 1) {
  59 + Notes({ newTags: '置顶' }).height(20).align(Alignment.Center)
  60 + }
58 } 61 }
59 Text() { 62 Text() {
60 if (this.titleMarked) { 63 if (this.titleMarked) {
@@ -76,7 +79,7 @@ export struct Card4Component { @@ -76,7 +79,7 @@ export struct Card4Component {
76 .textOverflow({ overflow: TextOverflow.Ellipsis }) 79 .textOverflow({ overflow: TextOverflow.Ellipsis })
77 .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && 80 .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
78 (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : 81 (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 :
79 - ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 : 82 + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 :
80 0 ) 83 0 )
81 }.alignContent(Alignment.TopStart) 84 }.alignContent(Alignment.TopStart)
82 //新闻标题 85 //新闻标题
@@ -82,6 +82,9 @@ export struct Card5Component { @@ -82,6 +82,9 @@ export struct Card5Component {
82 if (this.contentDTO.newTags) { 82 if (this.contentDTO.newTags) {
83 Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center) 83 Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center)
84 } 84 }
  85 + if (this.contentDTO.top === 1) {
  86 + Notes({ newTags: '置顶' }).height(20).align(Alignment.Center)
  87 + }
85 } 88 }
86 89
87 Text() { 90 Text() {
@@ -106,7 +109,7 @@ export struct Card5Component { @@ -106,7 +109,7 @@ export struct Card5Component {
106 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 109 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
107 .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && 110 .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
108 (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : 111 (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 :
109 - ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 : 112 + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 :
110 0 ) 113 0 )
111 }.alignContent(Alignment.TopStart) 114 }.alignContent(Alignment.TopStart)
112 } 115 }
@@ -62,6 +62,9 @@ export struct Card6Component { @@ -62,6 +62,9 @@ export struct Card6Component {
62 if (this.contentDTO.newTags) { 62 if (this.contentDTO.newTags) {
63 Notes({ newTags: this.contentDTO.newTags }).height(28).align(Alignment.Center) 63 Notes({ newTags: this.contentDTO.newTags }).height(28).align(Alignment.Center)
64 } 64 }
  65 + if (this.contentDTO.top === 1) {
  66 + Notes({ newTags: '置顶' }).height(28).align(Alignment.Center)
  67 + }
65 } 68 }
66 69
67 Text() 70 Text()
@@ -90,7 +93,7 @@ export struct Card6Component { @@ -90,7 +93,7 @@ export struct Card6Component {
90 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 93 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
91 .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && 94 .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
92 (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : 95 (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 :
93 - ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 : 96 + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 :
94 0 ) 97 0 )
95 }.alignContent(Alignment.TopStart) 98 }.alignContent(Alignment.TopStart)
96 99
@@ -98,6 +98,9 @@ export struct Card9Component { @@ -98,6 +98,9 @@ export struct Card9Component {
98 if (this.contentDTO.newTags) { 98 if (this.contentDTO.newTags) {
99 Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center) 99 Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center)
100 } 100 }
  101 + if (this.contentDTO.top === 1) {
  102 + Notes({ newTags: '置顶' }).height(20).align(Alignment.Center)
  103 + }
101 } 104 }
102 105
103 }.alignContent(Alignment.BottomStart) 106 }.alignContent(Alignment.BottomStart)
@@ -40,6 +40,7 @@ export struct ZhSingleRow02 { @@ -40,6 +40,7 @@ export struct ZhSingleRow02 {
40 } 40 }
41 .listDirection(Axis.Horizontal) 41 .listDirection(Axis.Horizontal)
42 .scrollBar(BarState.Off) 42 .scrollBar(BarState.Off)
  43 + .edgeEffect(EdgeEffect.None)
43 } 44 }
44 .width(CommonConstants.FULL_WIDTH) 45 .width(CommonConstants.FULL_WIDTH)
45 .height(208) 46 .height(208)
@@ -58,6 +58,12 @@ export struct AppointmentListUI { @@ -58,6 +58,12 @@ export struct AppointmentListUI {
58 } 58 }
59 } 59 }
60 } else { 60 } else {
  61 + Stack(){
  62 + Row()
  63 + .width("100%")
  64 + .height("100%")
  65 + .backgroundColor($r('app.color.color_F9F9F9'))
  66 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
61 CustomPullToRefresh({ 67 CustomPullToRefresh({
62 alldata:this.data, 68 alldata:this.data,
63 scroller:this.scroller, 69 scroller:this.scroller,
@@ -84,7 +90,8 @@ export struct AppointmentListUI { @@ -84,7 +90,8 @@ export struct AppointmentListUI {
84 }) 90 })
85 } 91 }
86 } 92 }
87 - .backgroundColor($r('app.color.color_F9F9F9')) 93 + }
  94 + .backgroundColor($r('app.color.color_transparent'))
88 .height('100%') 95 .height('100%')
89 .width('100%') 96 .width('100%')
90 } 97 }
@@ -117,9 +117,6 @@ export struct FollowChildComponent{ @@ -117,9 +117,6 @@ export struct FollowChildComponent{
117 }.height('202lpx') 117 }.height('202lpx')
118 .justifyContent(FlexAlign.Start) 118 .justifyContent(FlexAlign.Start)
119 119
120 - // Text().backgroundColor($r('app.color.color_EDEDED'))  
121 - // .width('100%')  
122 - // .height('2lpx')  
123 Divider() 120 Divider()
124 .width('100%') 121 .width('100%')
125 .height('2lpx') 122 .height('2lpx')
@@ -236,10 +233,6 @@ export struct FollowChildComponent{ @@ -236,10 +233,6 @@ export struct FollowChildComponent{
236 }.height('146lpx') 233 }.height('146lpx')
237 .justifyContent(FlexAlign.Center) 234 .justifyContent(FlexAlign.Center)
238 235
239 - // Text().backgroundColor($r('app.color.color_EDEDED'))  
240 - // .width('100%')  
241 - // .height('2lpx')  
242 -  
243 Divider() 236 Divider()
244 .width('100%') 237 .width('100%')
245 .height('2lpx') 238 .height('2lpx')
@@ -95,6 +95,8 @@ export struct FollowFirstTabsComponent{ @@ -95,6 +95,8 @@ export struct FollowFirstTabsComponent{
95 TabContent(){ 95 TabContent(){
96 FollowSecondTabsComponent({data:$data,firstIndex:index}) 96 FollowSecondTabsComponent({data:$data,firstIndex:index})
97 }.tabBar(this.TabBuilder(index,item)) 97 }.tabBar(this.TabBuilder(index,item))
  98 + .backgroundColor($r('app.color.white'))
  99 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
98 }, (item: FollowListItem, index: number) => index.toString()) 100 }, (item: FollowListItem, index: number) => index.toString())
99 } 101 }
100 .vertical(false) 102 .vertical(false)
@@ -108,9 +110,11 @@ export struct FollowFirstTabsComponent{ @@ -108,9 +110,11 @@ export struct FollowFirstTabsComponent{
108 trackTabFirstClick(this.data[index].directoryName) 110 trackTabFirstClick(this.data[index].directoryName)
109 }) 111 })
110 .width('100%') 112 .width('100%')
  113 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
111 .layoutWeight(1) 114 .layoutWeight(1)
112 } 115 }
113 }.width('100%') 116 }.width('100%')
  117 + .height("100%")
114 } 118 }
115 119
116 reloadNetWork(){ 120 reloadNetWork(){
@@ -91,8 +91,6 @@ export struct FollowListDetailUI { @@ -91,8 +91,6 @@ export struct FollowListDetailUI {
91 ListItem() { 91 ListItem() {
92 FollowChildComponent({ data: item, type: this.type }) 92 FollowChildComponent({ data: item, type: this.type })
93 } 93 }
94 - .onClick(() => {  
95 - })  
96 }, (item: FollowListDetailItem) => item.creatorId) 94 }, (item: FollowListDetailItem) => item.creatorId)
97 95
98 //没有更多数据 显示提示 96 //没有更多数据 显示提示
@@ -102,6 +100,7 @@ export struct FollowListDetailUI { @@ -102,6 +100,7 @@ export struct FollowListDetailUI {
102 } 100 }
103 } 101 }
104 } 102 }
  103 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
105 .edgeEffect(EdgeEffect.None) 104 .edgeEffect(EdgeEffect.None)
106 .cachedCount(5) 105 .cachedCount(5)
107 .padding({ left: '31lpx', right: '31lpx' }) 106 .padding({ left: '31lpx', right: '31lpx' })
@@ -118,6 +117,7 @@ export struct FollowListDetailUI { @@ -118,6 +117,7 @@ export struct FollowListDetailUI {
118 } 117 }
119 } 118 }
120 .width('100%') 119 .width('100%')
  120 + .layoutWeight(1)
121 } 121 }
122 122
123 async addFollowStatusObserver() { 123 async addFollowStatusObserver() {
@@ -22,15 +22,35 @@ export struct FollowSecondTabsComponent{ @@ -22,15 +22,35 @@ export struct FollowSecondTabsComponent{
22 22
23 if(this.data != null){ 23 if(this.data != null){
24 if(this.data[this.firstIndex].children == null || this.data[this.firstIndex].children.length == 0){ 24 if(this.data[this.firstIndex].children == null || this.data[this.firstIndex].children.length == 0){
  25 + Stack({ alignContent: Alignment.Top }){
  26 + Row()
  27 + .width("100%")
  28 + .height("100%")
  29 + .backgroundColor($r('app.color.color_transparent'))
  30 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
  31 +
25 FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].id,type:1}) 32 FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].id,type:1})
  33 + .height("100%")
  34 + .width("100%")
  35 + }.width("100%")
26 .layoutWeight(1) 36 .layoutWeight(1)
27 }else{ 37 }else{
  38 + Stack({ alignContent: Alignment.Top }){
  39 + Row()
  40 + .width("100%")
  41 + .height("100%")
  42 + .backgroundColor($r('app.color.color_transparent'))
  43 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
  44 +
28 this.FollowSecondUI() 45 this.FollowSecondUI()
  46 + }.width("100%")
  47 + .layoutWeight(1)
29 } 48 }
30 } 49 }
31 } 50 }
32 .width('100%') 51 .width('100%')
33 .layoutWeight(1) 52 .layoutWeight(1)
  53 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
34 } 54 }
35 55
36 @Builder FollowSecondUI(){ 56 @Builder FollowSecondUI(){
@@ -51,6 +71,7 @@ export struct FollowSecondTabsComponent{ @@ -51,6 +71,7 @@ export struct FollowSecondTabsComponent{
51 .scrollBar(BarState.Off) 71 .scrollBar(BarState.Off)
52 .height('100%') 72 .height('100%')
53 }.height('100%') 73 }.height('100%')
  74 + .backgroundColor($r('app.color.color_F9F9F9'))
54 .alignItems(HorizontalAlign.Center) 75 .alignItems(HorizontalAlign.Center)
55 } 76 }
56 .alignItems(VerticalAlign.Top) 77 .alignItems(VerticalAlign.Top)
@@ -60,8 +81,7 @@ export struct FollowSecondTabsComponent{ @@ -60,8 +81,7 @@ export struct FollowSecondTabsComponent{
60 ForEach(this.data[this.firstIndex].children, (item: FollowSecondListItem, index: number ) => { 81 ForEach(this.data[this.firstIndex].children, (item: FollowSecondListItem, index: number ) => {
61 TabContent(){ 82 TabContent(){
62 FollowThirdTabsComponent({data:$data,firstIndex:$firstIndex,secondIndex:index}) 83 FollowThirdTabsComponent({data:$data,firstIndex:$firstIndex,secondIndex:index})
63 - }  
64 - .backgroundColor($r('app.color.white')) 84 + }.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
65 }, (item: FollowListItem, index: number) => index.toString()) 85 }, (item: FollowListItem, index: number) => index.toString())
66 } 86 }
67 .vertical(true) 87 .vertical(true)
@@ -73,6 +93,7 @@ export struct FollowSecondTabsComponent{ @@ -73,6 +93,7 @@ export struct FollowSecondTabsComponent{
73 .barWidth(0) 93 .barWidth(0)
74 .height('100%') 94 .height('100%')
75 .layoutWeight(1) 95 .layoutWeight(1)
  96 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
76 }.width('100%') 97 }.width('100%')
77 } 98 }
78 99
@@ -104,6 +104,8 @@ export struct FollowThirdTabsComponent{ @@ -104,6 +104,8 @@ export struct FollowThirdTabsComponent{
104 this.currentIndex = index 104 this.currentIndex = index
105 }) 105 })
106 .width('100%') 106 .width('100%')
  107 + .layoutWeight(1)
  108 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
107 } 109 }
108 } 110 }
109 111
@@ -438,7 +438,8 @@ export struct PaperSingleColumn999CardView { @@ -438,7 +438,8 @@ export struct PaperSingleColumn999CardView {
438 Stack({ alignContent: Alignment.BottomEnd }) { 438 Stack({ alignContent: Alignment.BottomEnd }) {
439 Image(this.item?.coverUrl) 439 Image(this.item?.coverUrl)
440 .borderRadius(5) 440 .borderRadius(5)
441 - .aspectRatio(319 / 179) ///图片设计比例 441 + .objectFit(ImageFit.Fill)
  442 + .aspectRatio(16 / 10) ///图片设计比例
442 .padding({ top: 10 }) 443 .padding({ top: 10 })
443 //视频 444 //视频
444 if (this.item?.videoInfo) { 445 if (this.item?.videoInfo) {
@@ -629,7 +630,11 @@ export struct PaperSingleColumn999CardView { @@ -629,7 +630,11 @@ export struct PaperSingleColumn999CardView {
629 }else if(this.item.liveInfo.liveState === 'running'){ 630 }else if(this.item.liveInfo.liveState === 'running'){
630 contentString = '直播中' 631 contentString = '直播中'
631 }else if(this.item.liveInfo.liveState === 'end'){ 632 }else if(this.item.liveInfo.liveState === 'end'){
  633 + if (this.item.liveInfo.replayUri.length > 0) {
632 contentString = '回看' 634 contentString = '回看'
  635 + }else {
  636 + contentString = '已结束'
  637 + }
633 } 638 }
634 return contentString; 639 return contentString;
635 } 640 }
@@ -643,7 +648,10 @@ export struct PaperSingleColumn999CardView { @@ -643,7 +648,10 @@ export struct PaperSingleColumn999CardView {
643 }else if(this.item.liveInfo.liveState === 'running'){ 648 }else if(this.item.liveInfo.liveState === 'running'){
644 imageString = $r('app.media.card_live') 649 imageString = $r('app.media.card_live')
645 }else if(this.item.liveInfo.liveState === 'end'){ 650 }else if(this.item.liveInfo.liveState === 'end'){
  651 + if (this.item.liveInfo.replayUri.length > 0) {
646 imageString = $r('app.media.card_play') 652 imageString = $r('app.media.card_play')
  653 + }else {
  654 + }
647 } 655 }
648 return imageString; 656 return imageString;
649 } 657 }
@@ -23,7 +23,7 @@ struct ChannelSubscriptionLayout { @@ -23,7 +23,7 @@ struct ChannelSubscriptionLayout {
23 @Link myChannelList: TopNavDTO [] 23 @Link myChannelList: TopNavDTO []
24 @Link moreChannelList: TopNavDTO [] 24 @Link moreChannelList: TopNavDTO []
25 @Link localChannelList: TopNavDTO [] 25 @Link localChannelList: TopNavDTO []
26 - @Link channelIds: number [] 26 + @State channelIds: number [] = []
27 @State isShow: boolean = false 27 @State isShow: boolean = false
28 @State dragItem: number = -1 28 @State dragItem: number = -1
29 private dragRefOffsetX: number = 0 29 private dragRefOffsetX: number = 0
@@ -40,6 +40,9 @@ struct ChannelSubscriptionLayout { @@ -40,6 +40,9 @@ struct ChannelSubscriptionLayout {
40 40
41 aboutToAppear() { 41 aboutToAppear() {
42 this.currentTopNavSelectedItem = this.myChannelList[this.currentTopNavSelectedIndex] 42 this.currentTopNavSelectedItem = this.myChannelList[this.currentTopNavSelectedIndex]
  43 + this.myChannelList.forEach(item=>{
  44 + this.channelIds.push(item.channelId)
  45 + })
43 } 46 }
44 47
45 //交换我的频道数组中的位置 48 //交换我的频道数组中的位置
@@ -54,7 +57,7 @@ struct ChannelSubscriptionLayout { @@ -54,7 +57,7 @@ struct ChannelSubscriptionLayout {
54 delChannelItem(index: number){ 57 delChannelItem(index: number){
55 let item = this.myChannelList.splice(index, 1)[0] 58 let item = this.myChannelList.splice(index, 1)[0]
56 this.channelIds.splice(index, 1) 59 this.channelIds.splice(index, 1)
57 - AppStorage.setOrCreate('channelIds', this.channelIds.join(',')) 60 + AppStorage.setOrCreate('channelIds', JSON.stringify(this.channelIds))
58 if (item.moreChannel === '1') { 61 if (item.moreChannel === '1') {
59 this.moreChannelList.unshift(item) 62 this.moreChannelList.unshift(item)
60 } 63 }
@@ -29,7 +29,7 @@ struct FollowListPage { @@ -29,7 +29,7 @@ struct FollowListPage {
29 //Tab 详情 29 //Tab 详情
30 FollowFirstTabsComponent({changeIndex:Number(this.curIndex)}) 30 FollowFirstTabsComponent({changeIndex:Number(this.curIndex)})
31 } 31 }
32 - .backgroundColor($r('app.color.color_F9F9F9')) 32 + .backgroundColor($r('app.color.white'))
33 .height('100%') 33 .height('100%')
34 .width('100%') 34 .width('100%')
35 } 35 }
@@ -61,13 +61,17 @@ export struct MinePageComponent { @@ -61,13 +61,17 @@ export struct MinePageComponent {
61 @Prop isMinePage:boolean = false; 61 @Prop isMinePage:boolean = false;
62 62
63 //第一次还没创建时候 pageShow 接收不到监听 63 //第一次还没创建时候 pageShow 接收不到监听
64 - pageShowForUpdateData(): void { 64 + async pageShowForUpdateData() {
65 if(this.isMinePage){ 65 if(this.isMinePage){
  66 + let userid = await SPHelper.default.get(SpConstants.USER_ID,"")
  67 + if(StringUtils.isNotEmpty(userid)){
66 this.getMessageData() 68 this.getMessageData()
  69 + }
  70 +
67 this.pageShowTime = DateTimeUtils.getTimeStamp() 71 this.pageShowTime = DateTimeUtils.getTimeStamp()
68 } 72 }
69 } 73 }
70 - pageHideForUpdateData(): void { 74 + pageHideForUpdateData(){
71 if(this.isMinePage){ 75 if(this.isMinePage){
72 this.pageHideTime = DateTimeUtils.getTimeStamp() 76 this.pageHideTime = DateTimeUtils.getTimeStamp()
73 let duration = 0 77 let duration = 0
@@ -83,10 +87,9 @@ export struct MinePageComponent { @@ -83,10 +87,9 @@ export struct MinePageComponent {
83 aboutToAppear(){ 87 aboutToAppear(){
84 this.pageFirstCreateTime = DateTimeUtils.getTimeStamp() 88 this.pageFirstCreateTime = DateTimeUtils.getTimeStamp()
85 89
86 - this.getUserLogin()  
87 this.getFunctionData() 90 this.getFunctionData()
  91 + this.getUserLogin()
88 this.addLoginStatusObserver() 92 this.addLoginStatusObserver()
89 - this.getMessageData()  
90 } 93 }
91 94
92 getMessageData(){ 95 getMessageData(){
@@ -177,6 +180,7 @@ export struct MinePageComponent { @@ -177,6 +180,7 @@ export struct MinePageComponent {
177 let userid = await SPHelper.default.get(SpConstants.USER_ID,"") 180 let userid = await SPHelper.default.get(SpConstants.USER_ID,"")
178 if(StringUtils.isNotEmpty(userid)){ 181 if(StringUtils.isNotEmpty(userid)){
179 this.isLogin = true 182 this.isLogin = true
  183 + this.getMessageData()
180 }else{ 184 }else{
181 this.isLogin = false 185 this.isLogin = false
182 } 186 }
@@ -28,7 +28,7 @@ struct PeopleShipHomePage { @@ -28,7 +28,7 @@ struct PeopleShipHomePage {
28 // 总滑动空间 28 // 总滑动空间
29 scroller: Scroller = new Scroller() 29 scroller: Scroller = new Scroller()
30 // 顶部透明度 30 // 顶部透明度
31 - @State topOpacity: number = 0 31 + @Watch('topOpacityChange') @State topOpacity: number = 0
32 //发布数量 32 //发布数量
33 @State publishCount: number = 0 33 @State publishCount: number = 0
34 // 是否关注 34 // 是否关注
@@ -42,6 +42,22 @@ struct PeopleShipHomePage { @@ -42,6 +42,22 @@ struct PeopleShipHomePage {
42 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 42 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
43 @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() 43 @State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
44 44
  45 + onPageShow(): void {
  46 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
  47 + }
  48 +
  49 + onPageHide(): void {
  50 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
  51 + }
  52 +
  53 + topOpacityChange(){
  54 + if(this.topOpacity > 0.8){
  55 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
  56 + }else{
  57 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
  58 + }
  59 + }
  60 +
45 build() { 61 build() {
46 if(this.isConnectNetwork){ 62 if(this.isConnectNetwork){
47 Stack({ alignContent: Alignment.TopStart }) { 63 Stack({ alignContent: Alignment.TopStart }) {
@@ -50,7 +66,8 @@ struct PeopleShipHomePage { @@ -50,7 +66,8 @@ struct PeopleShipHomePage {
50 Image($r('app.media.home_page_bg')) 66 Image($r('app.media.home_page_bg'))
51 .width('100%') 67 .width('100%')
52 .height('120vp') 68 .height('120vp')
53 - .objectFit(ImageFit.Fill) 69 + .objectFit(ImageFit.Auto)
  70 + .objectRepeat(ImageRepeat.NoRepeat)
54 .backgroundColor(Color.White) 71 .backgroundColor(Color.White)
55 .visibility(this.isLoading ? Visibility.None : Visibility.Visible) 72 .visibility(this.isLoading ? Visibility.None : Visibility.Visible)
56 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) 73 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
@@ -46,8 +46,6 @@ export struct TopNavigationComponentNew { @@ -46,8 +46,6 @@ export struct TopNavigationComponentNew {
46 // 顶导数据 46 // 顶导数据
47 @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = [] 47 @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = []
48 @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002 48 @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002
49 - //我的频道id列表  
50 - @State channelIds: number[] = []  
51 //本地缓存频道id列表 49 //本地缓存频道id列表
52 @State storageChannelIds: string = AppStorage.get<string>('channelIds') || '' 50 @State storageChannelIds: string = AppStorage.get<string>('channelIds') || ''
53 @State homeChannelList: TopNavDTO[] = [] 51 @State homeChannelList: TopNavDTO[] = []
@@ -192,7 +190,6 @@ export struct TopNavigationComponentNew { @@ -192,7 +190,6 @@ export struct TopNavigationComponentNew {
192 myChannelList: $myChannelList, 190 myChannelList: $myChannelList,
193 moreChannelList: $moreChannelList, 191 moreChannelList: $moreChannelList,
194 localChannelList: $localChannelList, 192 localChannelList: $localChannelList,
195 - channelIds: $channelIds,  
196 changeTab: (index) => { 193 changeTab: (index) => {
197 this.changePage(index) 194 this.changePage(index)
198 } 195 }
@@ -260,7 +257,7 @@ export struct TopNavigationComponentNew { @@ -260,7 +257,7 @@ export struct TopNavigationComponentNew {
260 .edgeEffect(EdgeEffect.None) 257 .edgeEffect(EdgeEffect.None)
261 .height($r('app.float.top_tab_bar_height_common')) 258 .height($r('app.float.top_tab_bar_height_common'))
262 .backgroundColor(this.barBackgroundColor) 259 .backgroundColor(this.barBackgroundColor)
263 - .margin({top:10}) 260 + .margin({ top: 10 })
264 .onAreaChange((oldValue: Area, newValue: Area) => { 261 .onAreaChange((oldValue: Area, newValue: Area) => {
265 let width = Number.parseFloat(newValue.width.toString()) 262 let width = Number.parseFloat(newValue.width.toString())
266 this.tabsWidth = Number.isNaN(width) ? 0 : width 263 this.tabsWidth = Number.isNaN(width) ? 0 : width
@@ -342,8 +339,6 @@ export struct TopNavigationComponentNew { @@ -342,8 +339,6 @@ export struct TopNavigationComponentNew {
342 //处理新闻tab顶导频道数据 339 //处理新闻tab顶导频道数据
343 topNavListHandle() { 340 topNavListHandle() {
344 let cityName = SPHelper.default.getSync(SpConstants.LOCATION_CITY_NAME, '') as string 341 let cityName = SPHelper.default.getSync(SpConstants.LOCATION_CITY_NAME, '') as string
345 -  
346 - let _channelIds: number [] = []  
347 let _myChannelList: TopNavDTO [] = [] 342 let _myChannelList: TopNavDTO [] = []
348 let _storageChannelIds: string [] = [] //list1 343 let _storageChannelIds: string [] = [] //list1
349 let defaultMyChannelList: TopNavDTO[] = [] 344 let defaultMyChannelList: TopNavDTO[] = []
@@ -379,11 +374,7 @@ export struct TopNavigationComponentNew { @@ -379,11 +374,7 @@ export struct TopNavigationComponentNew {
379 } 374 }
380 }) 375 })
381 defaultList.unshift(...defaultMyChannelList) 376 defaultList.unshift(...defaultMyChannelList)
382 -  
383 defaultList.forEach((item, index) => { 377 defaultList.forEach((item, index) => {
384 - if (this.storageChannelIds && _storageChannelIds.includes(String(item.channelId))) {  
385 - item.myChannel = '1'  
386 - }  
387 if (item.channelType === 2) { 378 if (item.channelType === 2) {
388 if (cityName.includes(item.name)) { 379 if (cityName.includes(item.name)) {
389 item.myChannel = '1' 380 item.myChannel = '1'
@@ -399,32 +390,34 @@ export struct TopNavigationComponentNew { @@ -399,32 +390,34 @@ export struct TopNavigationComponentNew {
399 item.moreChannel = '1' 390 item.moreChannel = '1'
400 } 391 }
401 } 392 }
402 - 393 + if (this.storageChannelIds && _storageChannelIds.includes(String(item.channelId))) {
  394 + item.myChannel = '1'
  395 + }
403 //频道分类 396 //频道分类
404 if (item.name !== '播报') { //暂时隐藏播报 397 if (item.name !== '播报') { //暂时隐藏播报
405 - if (item.myChannel === '1' && !this.storageChannelIds) { 398 + if (item.myChannel === '1') {
406 _myChannelList.push(item) 399 _myChannelList.push(item)
407 - _channelIds.push(item.channelId)  
408 } 400 }
409 - if (item.moreChannel === '1') { 401 + if (item.moreChannel === '1' && item.myChannel !== '1') {
410 this.moreChannelList.push(item) 402 this.moreChannelList.push(item)
411 } 403 }
412 if (item.localChannel === '1' && item.myChannel !== '1') { 404 if (item.localChannel === '1' && item.myChannel !== '1') {
413 this.localChannelList.push(item) 405 this.localChannelList.push(item)
414 } 406 }
415 } 407 }
416 -  
417 }) 408 })
418 409
419 - if(this.storageChannelIds){  
420 - _storageChannelIds.forEach((_item:string)=>{  
421 - let index = defaultList.findIndex(ele => Number(_item) === ele.channelId)  
422 - if(index > -1){  
423 - _myChannelList.push(defaultList[index])  
424 - _channelIds.push(defaultList[index].channelId)  
425 - }  
426 - }) 410 + //根据缓存数组排序
  411 + if (this.storageChannelIds) {
  412 + let sortedyChannelList = _myChannelList.sort((item1, item2) => {
  413 + let index1 = this.storageChannelIds.indexOf(String(item1.channelId));
  414 + let index2 = this.storageChannelIds.indexOf(String(item2.channelId));
  415 + return index1 - index2;
  416 + });
  417 + _myChannelList = sortedyChannelList
427 } 418 }
  419 +
  420 +
428 if (cityName) { 421 if (cityName) {
429 let index = _myChannelList.findIndex(ele => cityName.includes(ele.name)) 422 let index = _myChannelList.findIndex(ele => cityName.includes(ele.name))
430 const localChannelitem = _myChannelList.splice(index, 1)[0]; 423 const localChannelitem = _myChannelList.splice(index, 1)[0];
@@ -432,7 +425,6 @@ export struct TopNavigationComponentNew { @@ -432,7 +425,6 @@ export struct TopNavigationComponentNew {
432 _myChannelList.splice(3, 0, localChannelitem); 425 _myChannelList.splice(3, 0, localChannelitem);
433 } 426 }
434 427
435 - this.channelIds = _channelIds  
436 this.myChannelList = _myChannelList 428 this.myChannelList = _myChannelList
437 429
438 //缓存首页频道 430 //缓存首页频道
@@ -620,22 +612,22 @@ export struct TopNavigationComponentNew { @@ -620,22 +612,22 @@ export struct TopNavigationComponentNew {
620 }) 612 })
621 } 613 }
622 614
623 - clickMorningEveningPaper(){ 615 + clickMorningEveningPaper() {
624 if (NetworkUtil.isNetConnected()) { 616 if (NetworkUtil.isNetConnected()) {
625 - DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean =>{ 617 + DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => {
626 if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) { 618 if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) {
627 SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id); 619 SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id);
628 ProcessUtils.gotoMorningEveningPaper() 620 ProcessUtils.gotoMorningEveningPaper()
629 - TrackingButton.click('morning_evening_news_click',TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews)  
630 - }else { 621 + TrackingButton.click('morning_evening_news_click', TrackConstants.SummaryType.MorningAndEveningNews,
  622 + TrackConstants.SummaryType.MorningAndEveningNews)
  623 + } else {
631 ToastUtils.showToast('暂无早晚报信息', 1000) 624 ToastUtils.showToast('暂无早晚报信息', 1000)
632 } 625 }
633 - }).catch((err:string) =>{ 626 + }).catch((err: string) => {
634 ToastUtils.showToast('暂无早晚报信息', 1000) 627 ToastUtils.showToast('暂无早晚报信息', 1000)
635 }) 628 })
636 } else { 629 } else {
637 ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) 630 ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
638 } 631 }
639 } 632 }
640 -  
641 } 633 }
@@ -276,6 +276,7 @@ export struct PeopleShipHomeArticleListComponent { @@ -276,6 +276,7 @@ export struct PeopleShipHomeArticleListComponent {
276 let extModel = element.contentExt[0]; 276 let extModel = element.contentExt[0];
277 contentDTO.openLikes = extModel.openLikes; 277 contentDTO.openLikes = extModel.openLikes;
278 contentDTO.openComment = extModel.openComment; 278 contentDTO.openComment = extModel.openComment;
  279 + contentDTO.top = extModel.top //是否置顶
279 } 280 }
280 // 页面 281 // 页面
281 if (contentDTO.appStyle == '2' || contentDTO.appStyle == '13' || contentDTO.appStyle == '20') { 282 if (contentDTO.appStyle == '2' || contentDTO.appStyle == '13' || contentDTO.appStyle == '20') {
@@ -40,7 +40,9 @@ export struct PeopleShipHomePageTopComponent { @@ -40,7 +40,9 @@ export struct PeopleShipHomePageTopComponent {
40 Image($r('app.media.home_page_bg')) 40 Image($r('app.media.home_page_bg'))
41 .width('100%') 41 .width('100%')
42 .height('48vp') 42 .height('48vp')
43 - .objectFit(ImageFit.Fill) 43 + .objectFit(ImageFit.Auto)
  44 + .objectRepeat(ImageRepeat.NoRepeat)
  45 + .objectFit(ImageFit.Auto)
44 .backgroundColor(Color.White) 46 .backgroundColor(Color.White)
45 // 头像和名称 47 // 头像和名称
46 Row() { 48 Row() {
@@ -28,10 +28,10 @@ export struct CustomTitleUI { @@ -28,10 +28,10 @@ export struct CustomTitleUI {
28 Text(this.titleName) 28 Text(this.titleName)
29 .maxLines(1) 29 .maxLines(1)
30 .id("title") 30 .id("title")
31 - .fontSize('35lpx') 31 + .fontSize('30lpx')
32 .fontWeight(400) 32 .fontWeight(400)
33 .fontColor($r('app.color.color_222222')) 33 .fontColor($r('app.color.color_222222'))
34 - .lineHeight('42lpx') 34 + .lineHeight('43lpx')
35 .alignRules({ 35 .alignRules({
36 center: {anchor: "__container__", align: VerticalAlign.Center}, 36 center: {anchor: "__container__", align: VerticalAlign.Center},
37 middle: {anchor: "__container__", align: HorizontalAlign.Center} 37 middle: {anchor: "__container__", align: HorizontalAlign.Center}
@@ -466,7 +466,8 @@ export struct SearchResultContentComponent { @@ -466,7 +466,8 @@ export struct SearchResultContentComponent {
466 rmhDesc: obj.introduction, 466 rmhDesc: obj.introduction,
467 userId: obj.userId, 467 userId: obj.userId,
468 userType: obj.userType, 468 userType: obj.userType,
469 - honoraryIcon:'' 469 + honoraryIcon:'',
  470 + rmhPlatform:0
470 } 471 }
471 if(rem.length>0){ 472 if(rem.length>0){
472 rem.forEach(item=>{ 473 rem.forEach(item=>{
@@ -491,7 +492,8 @@ export struct SearchResultContentComponent { @@ -491,7 +492,8 @@ export struct SearchResultContentComponent {
491 rmhDesc: item.introduction, 492 rmhDesc: item.introduction,
492 userId: item.userId, 493 userId: item.userId,
493 userType: item.userType, 494 userType: item.userType,
494 - honoraryIcon:'' 495 + honoraryIcon:'',
  496 + rmhPlatform:0
495 } 497 }
496 } 498 }
497 }) 499 })
@@ -9,6 +9,8 @@ import { @@ -9,6 +9,8 @@ import {
9 } from 'wdBean'; 9 } from 'wdBean';
10 import { LiveModel } from '../../viewmodel/LiveModel'; 10 import { LiveModel } from '../../viewmodel/LiveModel';
11 import { HttpUtils } from 'wdNetwork/Index'; 11 import { HttpUtils } from 'wdNetwork/Index';
  12 +import vibrator from '@ohos.vibrator';
  13 +import { BusinessError } from '@ohos.base';
12 14
13 const TAG = 'LiveLikeComponent'; 15 const TAG = 'LiveLikeComponent';
14 16
@@ -106,38 +108,63 @@ export struct LiveLikeComponent { @@ -106,38 +108,63 @@ export struct LiveLikeComponent {
106 108
107 @Builder 109 @Builder
108 likeCompStyle() { 110 likeCompStyle() {
109 - Stack({ alignContent: Alignment.Bottom }) { 111 + Stack({ alignContent: Alignment.TopEnd }) {
110 Column() { 112 Column() {
111 Image(this.transLikeStyle().url) 113 Image(this.transLikeStyle().url)
112 .width(24) 114 .width(24)
113 .height(24) 115 .height(24)
114 - .onClick(() => {  
115 - this.clickButtonEvent()  
116 - })  
117 } 116 }
118 .justifyContent(FlexAlign.Center) 117 .justifyContent(FlexAlign.Center)
119 .width(36) 118 .width(36)
120 .height(36) 119 .height(36)
121 .borderRadius(18) 120 .borderRadius(18)
122 .backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : this.pageComponentType === 8 ? Color.Transparent : '#FFF5F5F5') 121 .backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : this.pageComponentType === 8 ? Color.Transparent : '#FFF5F5F5')
123 - Row() {  
124 - Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || ''))  
125 - .fontSize(8)  
126 - .fontColor(Color.White)  
127 - .padding({ left: 8, right: 2 }) 122 + if (this.likeCount != 0) {
  123 + RelativeContainer() {
  124 + Image(this.styleType == 1 ? $r('app.media.comment_icon_number_bg') : $r('app.media.ic_like_back_Select'))
  125 + .objectFit(ImageFit.Fill)
  126 + .resizable({
  127 + slice: {
  128 + top: 1,
  129 + left: 20,
  130 + right: 1,
  131 + bottom: 1
128 } 132 }
  133 + })
  134 + .alignRules({
  135 + top: { anchor: "Text", align: VerticalAlign.Top },
  136 + left: { anchor: "Text", align: HorizontalAlign.Start },
  137 + right: { anchor: "Text", align: HorizontalAlign.End },
  138 + bottom: { anchor: "Text", align: VerticalAlign.Bottom },
  139 + })
  140 + .id("Image")
  141 +
  142 + Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || ''))// Text("44444444")
  143 + .fontSize(8)
  144 + .fontColor('#ffffff')// .backgroundColor('#ED2800')
129 .height(12) 145 .height(12)
130 - .alignItems(VerticalAlign.Center)  
131 - .position({ x: '100%', y: 10 })  
132 - .markAnchor({ x: '100%' })  
133 - .backgroundImage($r('app.media.ic_like_back'))  
134 - .backgroundImageSize({height: 13}) 146 + .textAlign(TextAlign.Center)
  147 + .alignRules({
  148 + top: { anchor: "__container__", align: VerticalAlign.Top },
  149 + left: { anchor: "__container__", align: HorizontalAlign.Start }
  150 + })// .margin({left: 4,right:4
  151 + // })
  152 + /*动态计算文字宽度*/
135 .width(this.getMeasureText(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) + 153 .width(this.getMeasureText(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) +
136 - 12) 154 + 12)// .backgroundColor(Color.Green)
  155 + .id("Text")
137 .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden) 156 .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden)
138 } 157 }
  158 + .offset({
  159 + x: 18
  160 + })
  161 + }
  162 + }
139 .width(36) 163 .width(36)
140 - .height(42) 164 + .height(36)
  165 + .onClick(() => {
  166 + this.clickButtonEvent()
  167 + })
141 .visibility(this.likesStyle == 'empty' || !this.openLikes ? Visibility.None : Visibility.Visible) 168 .visibility(this.likesStyle == 'empty' || !this.openLikes ? Visibility.None : Visibility.Visible)
142 169
143 } 170 }
@@ -164,6 +191,25 @@ export struct LiveLikeComponent { @@ -164,6 +191,25 @@ export struct LiveLikeComponent {
164 this.LiveModel.getLiveRoomNumberLike(this.likeBean['contentId'], 1, HttpUtils.getDeviceId()).then((data) => { 191 this.LiveModel.getLiveRoomNumberLike(this.likeBean['contentId'], 1, HttpUtils.getDeviceId()).then((data) => {
165 192
166 console.log(TAG, '点赞接口调用成功', JSON.stringify(data)) 193 console.log(TAG, '点赞接口调用成功', JSON.stringify(data))
  194 + try {
  195 + // 触发马达振动
  196 + vibrator.startVibration({
  197 + type: 'time',
  198 + duration: 100,
  199 + }, {
  200 + id: 0,
  201 + usage: 'alarm'
  202 + }, (error: BusinessError) => {
  203 + if (error) {
  204 + console.error(`Failed to start vibration. Code: ${error.code}, message: ${error.message}`);
  205 + return;
  206 + }
  207 + console.info('Succeed in starting vibration');
  208 + });
  209 + } catch (err) {
  210 + let e: BusinessError = err as BusinessError;
  211 + console.error(`An unexpected error occurred. Code: ${e.code}, message: ${e.message}`);
  212 + }
167 this.likeCount++ 213 this.likeCount++
168 214
169 }).catch(() => { 215 }).catch(() => {
@@ -372,6 +372,7 @@ export struct LiveOperRowListView { @@ -372,6 +372,7 @@ export struct LiveOperRowListView {
372 this.publishCommentModel.rootCommentId = '-1'; 372 this.publishCommentModel.rootCommentId = '-1';
373 this.publishCommentModel.parentId = '-1'; 373 this.publishCommentModel.parentId = '-1';
374 this.publishCommentModel.placeHolderText = "说两句..." 374 this.publishCommentModel.placeHolderText = "说两句..."
  375 + this.publishCommentModel.commentContent = ""
375 this.commentInputDialogController?.open(); 376 this.commentInputDialogController?.open();
376 } 377 }
377 378
@@ -466,14 +467,20 @@ export struct LiveOperRowListView { @@ -466,14 +467,20 @@ export struct LiveOperRowListView {
466 this.showCommentInput = canComment 467 this.showCommentInput = canComment
467 468
468 let mLiveId: string = this.contentDetailData.liveInfo.mlive.mliveId as string 469 let mLiveId: string = this.contentDetailData.liveInfo.mlive.mliveId as string
469 - if (!HttpUtils.isLogin() || mLiveId == undefined) { 470 + if (!mLiveId) {
  471 + return
  472 + }
  473 + if (!HttpUtils.isLogin()) {
  474 + this.banComment = false
470 return 475 return
471 } 476 }
472 477
473 // 查询是否被禁言 478 // 查询是否被禁言
474 PageRepository.fetchLiveBarrageBan(mLiveId).then(res => { 479 PageRepository.fetchLiveBarrageBan(mLiveId).then(res => {
  480 + if (res.code == 0) {
475 this.banComment = res.data as boolean 481 this.banComment = res.data as boolean
476 this.showCommentInput = !this.banComment && canComment 482 this.showCommentInput = !this.banComment && canComment
  483 + }
477 }) 484 })
478 } 485 }
479 } 486 }
@@ -883,7 +883,8 @@ class MinePageDatasModel{ @@ -883,7 +883,8 @@ class MinePageDatasModel{
883 rmhDesc: obj.introduction, 883 rmhDesc: obj.introduction,
884 userId: obj.userId, 884 userId: obj.userId,
885 userType: obj.userType, 885 userType: obj.userType,
886 - honoraryIcon:'' 886 + honoraryIcon:'',
  887 + rmhPlatform:0
887 } 888 }
888 if(rem.length>0){ 889 if(rem.length>0){
889 rem.forEach(item=>{ 890 rem.forEach(item=>{
@@ -908,7 +909,8 @@ class MinePageDatasModel{ @@ -908,7 +909,8 @@ class MinePageDatasModel{
908 rmhDesc: item.introduction, 909 rmhDesc: item.introduction,
909 userId: item.userId, 910 userId: item.userId,
910 userType: item.userType, 911 userType: item.userType,
911 - honoraryIcon:'' 912 + honoraryIcon:'',
  913 + rmhPlatform:0
912 } 914 }
913 } 915 }
914 }) 916 })
@@ -27,32 +27,60 @@ export class SearchShowRed { @@ -27,32 +27,60 @@ export class SearchShowRed {
27 res.push(content); 27 res.push(content);
28 } 28 }
29 29
30 - SearchShowRed.formatTitle(html, res, 0, textArr); 30 + console.log('SearchShowRed-res', JSON.stringify(res))
  31 +
  32 + SearchShowRed.formatTitle(
  33 + html.replaceAll('<em>', '').replaceAll('</em>', ''),
  34 + res,
  35 + 0,
  36 + textArr
  37 + );
31 } 38 }
32 39
33 const titleInitRes: titleInitRes = { 40 const titleInitRes: titleInitRes = {
34 titleMarked, 41 titleMarked,
35 textArr 42 textArr
36 } 43 }
  44 + console.log('SearchShowRed-titleInitRes', JSON.stringify(titleInitRes))
37 return titleInitRes 45 return titleInitRes
38 } 46 }
39 47
40 private static formatTitle(textStr: string, matchArr: string[], index: number, textArr: textItem[]) { 48 private static formatTitle(textStr: string, matchArr: string[], index: number, textArr: textItem[]) {
41 const item: string = matchArr[index]; 49 const item: string = matchArr[index];
42 - const arr = textStr.split(item);  
43 - arr.forEach((str: string, ind: number) => { 50 + if (!item) {
  51 + textArr.push({
  52 + content: textStr,
  53 + isRed: false
  54 + })
  55 + return;
  56 + }
  57 + const ind = textStr.indexOf(item);
  58 + const len = item.length;
44 if (ind === 0) { 59 if (ind === 0) {
45 textArr.push({ 60 textArr.push({
46 - content: str.replaceAll('<em>', '').replaceAll('</em>', ''), 61 + content: item,
  62 + isRed: true
  63 + })
  64 + SearchShowRed.formatTitle(textStr.slice(len), matchArr, index + 1, textArr);
  65 + } else if (ind + len === textStr.length) {
  66 + textArr.push({
  67 + content: textStr.slice(0, ind),
47 isRed: false 68 isRed: false
48 - } as textItem) 69 + })
49 textArr.push({ 70 textArr.push({
50 content: item, 71 content: item,
51 isRed: true 72 isRed: true
52 }) 73 })
53 - } else if (ind === 1) {  
54 - SearchShowRed.formatTitle(str, matchArr, index + 1, textArr)  
55 - } 74 + } else {
  75 + textArr.push({
  76 + content: textStr.slice(0, ind),
  77 + isRed: false
56 }) 78 })
  79 + textArr.push({
  80 + content: item,
  81 + isRed: true
  82 + })
  83 + SearchShowRed.formatTitle(textStr.slice(ind + len), matchArr, index + 1, textArr);
  84 + }
57 } 85 }
58 } 86 }
@@ -12,6 +12,9 @@ @@ -12,6 +12,9 @@
12 "requestPermissions": [ 12 "requestPermissions": [
13 { 13 {
14 "name": "ohos.permission.INTERNET" 14 "name": "ohos.permission.INTERNET"
  15 + },
  16 + {
  17 + "name": "ohos.permission.VIBRATE"
15 } 18 }
16 ], 19 ],
17 "pages": "$profile:main_pages" 20 "pages": "$profile:main_pages"
@@ -17,10 +17,26 @@ @@ -17,10 +17,26 @@
17 "value": "13fp" 17 "value": "13fp"
18 }, 18 },
19 { 19 {
  20 + "name": "font_size_13_2",
  21 + "value": "13.2fp"
  22 + },
  23 + {
  24 + "name": "font_size_13_5",
  25 + "value": "13.5fp"
  26 + },
  27 + {
20 "name": "font_size_14", 28 "name": "font_size_14",
21 "value": "14fp" 29 "value": "14fp"
22 }, 30 },
23 { 31 {
  32 + "name": "font_size_14_5",
  33 + "value": "14.5fp"
  34 + },
  35 + {
  36 + "name": "font_size_15",
  37 + "value": "15fp"
  38 + },
  39 + {
24 "name": "font_size_16", 40 "name": "font_size_16",
25 "value": "16fp" 41 "value": "16fp"
26 }, 42 },
1 import { Logger, ResourcesUtils, EmitterUtils, EmitterEventId } from 'wdKit'; 1 import { Logger, ResourcesUtils, EmitterUtils, EmitterEventId } from 'wdKit';
2 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; 2 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
3 -import { ContentDetailDTO, InteractDataDTO } from 'wdBean'; 3 +import { ContentDetailDTO, GetPullAddressBean, InteractDataDTO } from 'wdBean';
4 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; 4 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
5 5
6 const TAG = 'ContentDetailRequest'; 6 const TAG = 'ContentDetailRequest';
@@ -208,6 +208,19 @@ export class ContentDetailRequest { @@ -208,6 +208,19 @@ export class ContentDetailRequest {
208 return url; 208 return url;
209 } 209 }
210 210
  211 +
  212 + static getLiveRoomPullStreamUrl(vliveId:string){
  213 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.PULL_STREAM_PATH
  214 + url = url + vliveId
  215 + return url;
  216 + }
  217 +
  218 + static getLiveRoomPullStream(vliveId: string): Promise<ResponseDTO<GetPullAddressBean>> {
  219 + let url = ContentDetailRequest.getLiveRoomPullStreamUrl(vliveId)
  220 + return WDHttp.get<ResponseDTO<GetPullAddressBean>>(url)
  221 + }
  222 +
  223 +
211 static getContentDetail(params: ContentDetailRequestParams): Promise<ResponseDTO<ContentDetailDTO[]>> { 224 static getContentDetail(params: ContentDetailRequestParams): Promise<ResponseDTO<ContentDetailDTO[]>> {
212 if (mock_switch) { 225 if (mock_switch) {
213 return ContentDetailRequest.getContentDetailDataMock(getContext()); 226 return ContentDetailRequest.getContentDetailDataMock(getContext());
@@ -216,6 +229,8 @@ export class ContentDetailRequest { @@ -216,6 +229,8 @@ export class ContentDetailRequest {
216 return WDHttp.get<ResponseDTO<ContentDetailDTO[]>>(url) 229 return WDHttp.get<ResponseDTO<ContentDetailDTO[]>>(url)
217 } 230 }
218 231
  232 +
  233 +
219 /** 234 /**
220 * 查询沉浸式视频频道推荐楼层数据 235 * 查询沉浸式视频频道推荐楼层数据
221 * @returns 236 * @returns
1 -import { Action, ContentDetailDTO } from 'wdBean/Index'; 1 +import { Action, ContentDetailDTO, GetPullAddressBean } from 'wdBean/Index';
2 import { LiveViewModel } from '../viewModel/LiveViewModel'; 2 import { LiveViewModel } from '../viewModel/LiveViewModel';
3 import router from '@ohos.router'; 3 import router from '@ohos.router';
4 4
@@ -68,27 +68,35 @@ export struct DetailPlayLiveCommon { @@ -68,27 +68,35 @@ export struct DetailPlayLiveCommon {
68 */ 68 */
69 getContentDetail() { 69 getContentDetail() {
70 this.liveViewModel.getContentDetail(this.contentId, this.relId, this.relType) 70 this.liveViewModel.getContentDetail(this.contentId, this.relId, this.relType)
71 - .then((data: Array<ContentDetailDTO>) => { 71 + .then(async (data: Array<ContentDetailDTO>) => {
72 console.log(TAG, '查询视频详情用于评论展示 getContentDetail:', JSON.stringify(data)) 72 console.log(TAG, '查询视频详情用于评论展示 getContentDetail:', JSON.stringify(data))
73 if (data) { 73 if (data) {
74 74
75 let detailData = data[0] 75 let detailData = data[0]
  76 + //人民号类型单独获取直播地址
  77 + if (detailData.rmhPlatform === 1) {
  78 +
  79 + let vliveId = detailData.liveInfo.vlive[0].vliveId as string
  80 + console.error(TAG, 'vliveId==' + vliveId)
  81 + let pullStreamAddressData = await this.liveViewModel.getLiveRoomPullAddress(vliveId) as GetPullAddressBean
  82 +
  83 + if (pullStreamAddressData) {
  84 + console.log(TAG, ' GetPullAddressBean:', JSON.stringify(pullStreamAddressData))
  85 + let m3u8uUrl = pullStreamAddressData.transCode[0].m3u8Url
  86 + detailData.liveInfo.vlive[0].liveUrl = m3u8uUrl
  87 + this.playUrl = m3u8uUrl
  88 + console.log(TAG, ' GetPullAddressBean:', m3u8uUrl)
  89 + }
  90 +
  91 + }
  92 +
76 this.liveLandscape = 93 this.liveLandscape =
77 - detailData?.liveInfo?.liveLandScape //String(this.contentDetailData?.liveInfo?.liveLandScape || '') 94 + detailData?.liveInfo?.liveLandScape
78 95
79 this.liveState = detailData.liveInfo?.liveState 96 this.liveState = detailData.liveInfo?.liveState
80 97
81 -  
82 - if (this.liveState === 'wait' || this.liveLandscape === 'news') {  
83 this.contentDetailData = data[0] 98 this.contentDetailData = data[0]
84 - } else if (this.liveLandscape === 'general') {  
85 - //todo 不加setTimeOut ,接口返回的数据 就没法让PlayerComponent #@Consume @Watch('updateData') liveDetailsBean 的updateData方法运行  
86 - setTimeout(() => {  
87 - this.contentDetailData = data[0]  
88 - }, 10)  
89 - }  
90 99
91 - console.log(TAG, '查询视频详情用于评论展示 openComment:', detailData.openComment)  
92 this.publishCommentModel.targetId = String(detailData?.newsId || '') 100 this.publishCommentModel.targetId = String(detailData?.newsId || '')
93 this.publishCommentModel.targetRelId = String(detailData?.reLInfo?.relId || '') 101 this.publishCommentModel.targetRelId = String(detailData?.reLInfo?.relId || '')
94 this.publishCommentModel.targetTitle = detailData?.newsTitle 102 this.publishCommentModel.targetTitle = detailData?.newsTitle
@@ -107,7 +115,8 @@ export struct DetailPlayLiveCommon { @@ -107,7 +115,8 @@ export struct DetailPlayLiveCommon {
107 if (detailData.liveInfo.liveState == 'end') { 115 if (detailData.liveInfo.liveState == 'end') {
108 this.playUrl = detailData.liveInfo.vlive[0].replayUri 116 this.playUrl = detailData.liveInfo.vlive[0].replayUri
109 } 117 }
110 - //console.error('XXXXZZZZ', "liveLandscape =" + this.liveLandscape + ' this.liveState =' + this.liveState) 118 +
  119 +
111 } 120 }
112 }) 121 })
113 } 122 }
1 -import { ContentDetailDTO, LiveRoomDataBean } from 'wdBean/Index'; 1 +import { ContentDetailDTO, LiveRoomDataBean, LiveRoomItemBean } from 'wdBean/Index';
2 import { LiveViewModel } from '../viewModel/LiveViewModel'; 2 import { LiveViewModel } from '../viewModel/LiveViewModel';
3 import { TabComponent } from '../widgets/details/TabComponent'; 3 import { TabComponent } from '../widgets/details/TabComponent';
4 import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet'; 4 import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet';
@@ -35,6 +35,10 @@ export struct DetailPlayLivePage { @@ -35,6 +35,10 @@ export struct DetailPlayLivePage {
35 @Consume contentDetailData: ContentDetailDTO 35 @Consume contentDetailData: ContentDetailDTO
36 @Consume publishCommentModel: publishCommentModel 36 @Consume publishCommentModel: publishCommentModel
37 37
  38 + // 尽量不要动属性。用来作为输入了评论之后,值传递
  39 + @State lastInputedLiveComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的直播间消息
  40 + @State lastInputedChatComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的大家聊消息
  41 +
38 aboutToAppear(): void { 42 aboutToAppear(): void {
39 Logger.info(TAG, `wyj-aboutToAppear`) 43 Logger.info(TAG, `wyj-aboutToAppear`)
40 44
@@ -65,7 +69,10 @@ export struct DetailPlayLivePage { @@ -65,7 +69,10 @@ export struct DetailPlayLivePage {
65 TopPlayComponent({ playerController: this.playerController }) 69 TopPlayComponent({ playerController: this.playerController })
66 .height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%') 70 .height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%')
67 71
68 - TabComponent({ tabs: this.tabs, changeToTab: this.changeToTab }) 72 + TabComponent({ tabs: this.tabs,
  73 + changeToTab: this.changeToTab,
  74 + lastInputedLiveComment: this.lastInputedLiveComment,
  75 + lastInputedChatComment: this.lastInputedChatComment})
69 .layoutWeight(1) 76 .layoutWeight(1)
70 .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) 77 .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
71 78
@@ -79,11 +86,21 @@ export struct DetailPlayLivePage { @@ -79,11 +86,21 @@ export struct DetailPlayLivePage {
79 }, 86 },
80 onCommentInputed: (content) => { 87 onCommentInputed: (content) => {
81 if (content.comment) { 88 if (content.comment) {
82 - this.liveViewModel.sendComment(content.comment) 89 + this.liveViewModel.sendComment(content.comment, this.contentDetailData).then(result => {
  90 + if (!result) {
  91 + return
  92 + }
  93 + if (result.isWall == 1) {
  94 + this.lastInputedLiveComment = result
  95 + } else {
  96 + this.lastInputedChatComment = result
  97 + }
  98 + })
83 } 99 }
84 } 100 }
85 }).visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) 101 }).visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
86 102
  103 +
87 // LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum }) 104 // LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum })
88 // .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) 105 // .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
89 } 106 }
1 -import { HttpUrlUtils, ResponseDTO } from 'wdNetwork'; 1 +import { HttpUrlUtils, HttpUtils, ResponseDTO } from 'wdNetwork';
2 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; 2 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
3 -import { Logger, ToastUtils, EmitterEventId, EmitterUtils } from 'wdKit';  
4 -import { ContentDetailDTO, LiveDetailsBean, LiveRoomBean, LiveRoomDataBean, ReserveItemBean, ValueType } from 'wdBean/Index'; 3 +import { Logger, ToastUtils, EmitterEventId, EmitterUtils, SPHelper } from 'wdKit';
  4 +import { ContentDetailDTO, LiveDetailsBean, LiveRoomBean, LiveRoomDataBean,
  5 + LiveRoomItemBean,
  6 + ReserveItemBean, ValueType } from 'wdBean/Index';
5 import { ContentDetailRequest } from 'wdDetailPlayApi/Index'; 7 import { ContentDetailRequest } from 'wdDetailPlayApi/Index';
  8 +import { SpConstants } from 'wdConstant/Index';
6 9
7 const TAG = 'LiveModel' 10 const TAG = 'LiveModel'
8 11
@@ -266,5 +269,61 @@ export class LiveModel { @@ -266,5 +269,61 @@ export class LiveModel {
266 }) 269 })
267 }) 270 })
268 } 271 }
  272 +
  273 + liveSendComment(comment: string, content: ContentDetailDTO) {
  274 + let tourist: boolean = !HttpUtils.isLogin()
  275 + let roomId: string = content.liveInfo.mlive.roomId as string
  276 + let liveId: string = content.newsId + ''
  277 + let mLiveId: string = content.liveInfo.mlive.mliveId as string
  278 +
  279 + let commentItem: LiveRoomItemBean = {} as LiveRoomItemBean
  280 + commentItem.text = comment
  281 + commentItem.isWall = 0
  282 + commentItem.dataType = "ZH_TEXT_MSG"
  283 +
  284 + let params: Record<string, string | number> = {};
  285 + params["liveId"] = liveId
  286 + params["mliveId"] = mLiveId
  287 + params["roomId"] = roomId
  288 + params["title"] = content.newsTitle
  289 + params["text"] = comment
  290 +
  291 + if (tourist) {
  292 + params["deviceId"] = HttpUtils.getDeviceId()
  293 + params["senderUserName"] = SPHelper.default.getSync(SpConstants.TOURIST_NICK_NAME, "") as string
  294 + } else {
  295 + params["senderUserId"] = SPHelper.default.getSync(SpConstants.USER_ID, "") as string
  296 + params["senderAvatarUrl"] = SPHelper.default.getSync(SpConstants.USER_HEAD_PHOTO_URL, "") as string
  297 + params["senderUserName"] = SPHelper.default.getSync(SpConstants.USER_NAME, "") as string
  298 + commentItem.senderUserAvatarUrl = params["senderAvatarUrl"]
  299 + }
  300 + commentItem.senderUserName = params["senderUserName"]
  301 + params["customizeExpression"] = 0
  302 + params["role"] = tourist ? "tourist" : "audience"
  303 + commentItem.role = tourist ? "tourist" : "audience"
  304 +
  305 + let url = tourist ? HttpUrlUtils.getLiveTouristSendBarrageUrl() : HttpUrlUtils.getLiveSendBarrageUrl()
  306 + return new Promise<SendLiveCommentRes>((success, fail) => {
  307 + HttpRequest.post<ResponseDTO<SendLiveCommentInterfaceRes>>(url, params).then((data) => {
  308 + let res:SendLiveCommentRes = {
  309 + preDisplay: data.data?.preDisplay || false,
  310 + tipMessage: data.message,
  311 + commentItem: commentItem
  312 + }
  313 + success(res)
  314 + }, (error: Error) => {
  315 + fail(error.message)
  316 + Logger.debug(TAG + ":error ", error.toString())
  317 + })
  318 + })
  319 + }
269 } 320 }
270 321
  322 +interface SendLiveCommentInterfaceRes {
  323 + preDisplay: boolean
  324 +}
  325 +export interface SendLiveCommentRes {
  326 + preDisplay: boolean
  327 + tipMessage: string
  328 + commentItem: LiveRoomItemBean
  329 +}
1 -import { ContentDetailDTO, LiveDetailsBean, LiveRoomBean, LiveRoomDataBean, ValueType } from 'wdBean/Index'  
2 - 1 +import { ContentDetailDTO,
  2 + GetPullAddressBean,
  3 + LiveDetailsBean, LiveRoomBean, LiveRoomDataBean,
  4 + LiveRoomItemBean,
  5 + ValueType } from 'wdBean/Index'
  6 +import { ContentDetailRequest } from 'wdDetailPlayApi/Index'
  7 +import { Logger } from 'wdKit/Index'
  8 +import { ToastUtils } from 'wdKit/src/main/ets/utils/ToastUtils'
3 import { ResponseDTO } from 'wdNetwork/Index' 9 import { ResponseDTO } from 'wdNetwork/Index'
4 import { LiveModel } from './LiveModel' 10 import { LiveModel } from './LiveModel'
5 11
@@ -24,6 +30,21 @@ export class LiveViewModel { @@ -24,6 +30,21 @@ export class LiveViewModel {
24 30
25 } 31 }
26 32
  33 + async getLiveRoomPullAddress(vliveId:string) : Promise<GetPullAddressBean>{
  34 +
  35 + return new Promise<GetPullAddressBean>((success, fail) => {
  36 + ContentDetailRequest.getLiveRoomPullStream(vliveId).then(async (resDTO: ResponseDTO<GetPullAddressBean>) => {
  37 + console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
  38 + if (resDTO.data) {
  39 + success(resDTO.data)
  40 + }
  41 + }).catch(() => {
  42 + fail("数据为空")
  43 + })
  44 +
  45 + })
  46 +
  47 + }
27 48
28 //直播详情 49 //直播详情
29 getLiveDetails(contentId: string, relId: string, relType: string) { 50 getLiveDetails(contentId: string, relId: string, relType: string) {
@@ -111,7 +132,40 @@ export class LiveViewModel { @@ -111,7 +132,40 @@ export class LiveViewModel {
111 }) 132 })
112 } 133 }
113 134
114 - sendComment(comment: string) { 135 + // 发送评论
  136 + sendComment(comment: string, content: ContentDetailDTO) {
  137 + return new Promise<LiveRoomItemBean | undefined>((success, fail) => {
  138 + this.liveModel.liveSendComment(comment, content).then((data) => {
  139 + Logger.debug(TAG, "发送评论结果: " + JSON.stringify(data))
  140 + if (data.preDisplay) {
  141 + success(data.commentItem)
  142 + } else {
  143 + success(undefined)
  144 + }
  145 + ToastUtils.showToast(data.tipMessage, 3000)
  146 + }).catch((message: string) => {
  147 + fail(message)
  148 + })
  149 + })
  150 + }
115 151
  152 + deepCopyLiveRoomItem(item: LiveRoomItemBean) {
  153 + return item
  154 + let retItem: LiveRoomItemBean = {} as LiveRoomItemBean
  155 + retItem.text = item.text
  156 + retItem.senderUserAvatarUrl = item.senderUserAvatarUrl
  157 + retItem.senderUserName = item.senderUserName
  158 + retItem.pictureUrls = item.pictureUrls
  159 + retItem.time = item.time
  160 + retItem.isWall = item.isWall
  161 + retItem.isTop = item.isTop
  162 + retItem.dataType = item.dataType
  163 + retItem.transcodeImageUrl = item.transcodeImageUrl
  164 + retItem.videoUrl = item.videoUrl
  165 + retItem.pictureResolutions = item.pictureResolutions
  166 + retItem.duration = item.duration
  167 + retItem.audioUrl = item.audioUrl
  168 + retItem.fullColumnImgUrlDto = item.fullColumnImgUrlDto
  169 + return retItem
116 } 170 }
117 } 171 }
@@ -12,6 +12,10 @@ import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment @@ -12,6 +12,10 @@ import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment
12 12
13 const TAG: string = 'TabChatComponent'; 13 const TAG: string = 'TabChatComponent';
14 14
  15 +/**
  16 + *
  17 + * 非沉浸式---大家聊
  18 + */
15 @Component 19 @Component
16 export struct TabChatComponent { 20 export struct TabChatComponent {
17 @State private pageModel: PageModel = new PageModel() 21 @State private pageModel: PageModel = new PageModel()
@@ -19,6 +23,7 @@ export struct TabChatComponent { @@ -19,6 +23,7 @@ export struct TabChatComponent {
19 @State liveChatList: Array<LiveRoomItemBean> = [] 23 @State liveChatList: Array<LiveRoomItemBean> = []
20 @Consume contentDetailData: ContentDetailDTO 24 @Consume contentDetailData: ContentDetailDTO
21 @Consume publishCommentModel: publishCommentModel 25 @Consume publishCommentModel: publishCommentModel
  26 + @Prop @Watch("lastInputedCommentChanged") lastInputedComment: LiveRoomItemBean
22 27
23 aboutToAppear(): void { 28 aboutToAppear(): void {
24 this.getLiveChatList() 29 this.getLiveChatList()
@@ -42,6 +47,12 @@ export struct TabChatComponent { @@ -42,6 +47,12 @@ export struct TabChatComponent {
42 }) 47 })
43 } 48 }
44 49
  50 + lastInputedCommentChanged(info: string) {
  51 + Logger.debug(TAG, "2显示评论》》》: " + JSON.stringify(this.lastInputedComment))
  52 + this.liveChatList.push(this.liveViewModel.deepCopyLiveRoomItem(this.lastInputedComment))
  53 + this.pageModel.viewType = ViewType.LOADED;
  54 + }
  55 +
45 build() { 56 build() {
46 Stack() { 57 Stack() {
47 if (this.pageModel.viewType == ViewType.LOADING) { 58 if (this.pageModel.viewType == ViewType.LOADING) {
1 import { LiveRoomItemBean, Action, PhotoListBean, Params } from 'wdBean/Index' 1 import { LiveRoomItemBean, Action, PhotoListBean, Params } from 'wdBean/Index'
2 -import { StringUtils } from 'wdKit/Index' 2 +import { Logger, StringUtils } from 'wdKit/Index'
3 // import { Action, LiveRoomItemBean, Params, PhotoListBean } from 'wdBean/Index' 3 // import { Action, LiveRoomItemBean, Params, PhotoListBean } from 'wdBean/Index'
4 import { WDRouterRule } from 'wdRouter' 4 import { WDRouterRule } from 'wdRouter'
5 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' 5 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'
6 6
  7 +const TAG = "TabChatItemComponent"
  8 +
7 @Component 9 @Component
8 export struct TabChatItemComponent { 10 export struct TabChatItemComponent {
9 item: LiveRoomItemBean = {} as LiveRoomItemBean 11 item: LiveRoomItemBean = {} as LiveRoomItemBean
10 12
11 aboutToAppear(): void { 13 aboutToAppear(): void {
  14 + Logger.debug(TAG, "评论内容: " + this.item.text + " 评论sender: " + this.item.senderUserName)
12 } 15 }
13 16
14 build() { 17 build() {
  1 +import { LiveRoomItemBean } from 'wdBean/Index'
1 import { TabChatComponent } from './TabChatComponent' 2 import { TabChatComponent } from './TabChatComponent'
2 import { TabInfoComponent } from './TabInfoComponent' 3 import { TabInfoComponent } from './TabInfoComponent'
3 import { TabLiveComponent } from './TabLiveComponent' 4 import { TabLiveComponent } from './TabLiveComponent'
@@ -13,11 +14,12 @@ export struct TabComponent { @@ -13,11 +14,12 @@ export struct TabComponent {
13 @State currentIndex: number = 0 14 @State currentIndex: number = 0
14 private controller: TabsController = new TabsController() 15 private controller: TabsController = new TabsController()
15 @Prop tabs: string[] = [] 16 @Prop tabs: string[] = []
  17 + @Prop lastInputedLiveComment: LiveRoomItemBean // 上次输入的直播间消息
  18 + @Prop lastInputedChatComment: LiveRoomItemBean // 上次输入的大家聊消息
16 19
17 aboutToAppear(): void { 20 aboutToAppear(): void {
18 21
19 } 22 }
20 -  
21 /** 23 /**
22 * 评论切换到大家聊 24 * 评论切换到大家聊
23 */ 25 */
@@ -36,9 +38,9 @@ export struct TabComponent { @@ -36,9 +38,9 @@ export struct TabComponent {
36 if ('简介' === item) { 38 if ('简介' === item) {
37 TabInfoComponent() 39 TabInfoComponent()
38 } else if ('直播间' === item) { 40 } else if ('直播间' === item) {
39 - TabLiveComponent() 41 + TabLiveComponent({lastInputedComment: this.lastInputedLiveComment})
40 } else if ('大家聊' === item) { 42 } else if ('大家聊' === item) {
41 - TabChatComponent() 43 + TabChatComponent({lastInputedComment: this.lastInputedChatComment})
42 } 44 }
43 } 45 }
44 .backgroundColor('#F5F5F5') 46 .backgroundColor('#F5F5F5')
1 import { ContentDetailDTO, LiveDetailsBean } from 'wdBean/Index' 1 import { ContentDetailDTO, LiveDetailsBean } from 'wdBean/Index'
2 import { LiveCountdownComponent } from './LiveCountdownComponent' 2 import { LiveCountdownComponent } from './LiveCountdownComponent'
3 3
  4 +/**
  5 + * 非沉浸式---简介
  6 + */
4 @Component 7 @Component
5 export struct TabInfoComponent { 8 export struct TabInfoComponent {
6 @Consume contentDetailData: ContentDetailDTO 9 @Consume contentDetailData: ContentDetailDTO
1 -import { ContentDetailDTO, LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index'  
2 -import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI, WDViewDefaultType } from 'wdComponent/Index' 1 +import { ContentDetailDTO, LiveRoomItemBean } from 'wdBean/Index'
  2 +import { CustomPullToRefresh, EmptyComponent, ErrorComponent, WDViewDefaultType } from 'wdComponent/Index'
3 import { TabLiveItemComponent } from './TabLiveItemComponent' 3 import { TabLiveItemComponent } from './TabLiveItemComponent'
4 import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout' 4 import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout'
5 import { RefreshLayoutBean } from 'wdComponent/src/main/ets/components/page/RefreshLayoutBean' 5 import { RefreshLayoutBean } from 'wdComponent/src/main/ets/components/page/RefreshLayoutBean'
6 import PageModel from 'wdComponent/src/main/ets/viewmodel/PageModel' 6 import PageModel from 'wdComponent/src/main/ets/viewmodel/PageModel'
7 import { ViewType } from 'wdConstant/Index' 7 import { ViewType } from 'wdConstant/Index'
8 -import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayout'  
9 -import { StringUtils } from 'wdKit/Index' 8 +import { LazyDataSource, StringUtils } from 'wdKit/Index'
10 import { LiveViewModel } from '../../viewModel/LiveViewModel' 9 import { LiveViewModel } from '../../viewModel/LiveViewModel'
11 import { Logger } from 'wdKit' 10 import { Logger } from 'wdKit'
  11 +import LoadMoreLayout from 'wdComponent/src/main/ets/components/page/LoadMoreLayout'
  12 +import { PeopleShipNoMoreData } from 'wdComponent/src/main/ets/components/reusable/PeopleShipNoMoreData'
12 13
13 const TAG: string = 'TabLiveComponent'; 14 const TAG: string = 'TabLiveComponent';
14 15
@@ -18,14 +19,22 @@ const TAG: string = 'TabLiveComponent'; @@ -18,14 +19,22 @@ const TAG: string = 'TabLiveComponent';
18 @Component 19 @Component
19 export struct TabLiveComponent { 20 export struct TabLiveComponent {
20 liveViewModel: LiveViewModel = new LiveViewModel() 21 liveViewModel: LiveViewModel = new LiveViewModel()
21 - @State liveList: Array<LiveRoomItemBean> = [] 22 + @State liveList: LazyDataSource<LiveRoomItemBean> = new LazyDataSource();
22 @Consume @Watch('updateData') contentDetailData: ContentDetailDTO 23 @Consume @Watch('updateData') contentDetailData: ContentDetailDTO
23 @State private pageModel: PageModel = new PageModel() 24 @State private pageModel: PageModel = new PageModel()
  25 + private scroller: Scroller = new Scroller()
  26 + @Prop @Watch("lastInputedCommentChanged") lastInputedComment: LiveRoomItemBean
24 27
25 aboutToAppear(): void { 28 aboutToAppear(): void {
26 this.getLiveList() 29 this.getLiveList()
27 } 30 }
28 31
  32 + lastInputedCommentChanged(info: string) {
  33 + Logger.debug(TAG, "1显示评论》》》: " + JSON.stringify(this.lastInputedComment))
  34 + this.liveList.push(this.liveViewModel.deepCopyLiveRoomItem(this.lastInputedComment))
  35 + this.pageModel.viewType = ViewType.LOADED;
  36 + }
  37 +
29 build() { 38 build() {
30 Stack() { 39 Stack() {
31 if (this.pageModel.viewType == ViewType.LOADING) { 40 if (this.pageModel.viewType == ViewType.LOADING) {
@@ -35,7 +44,19 @@ export struct TabLiveComponent { @@ -35,7 +44,19 @@ export struct TabLiveComponent {
35 } else if (this.pageModel.viewType == ViewType.EMPTY) { 44 } else if (this.pageModel.viewType == ViewType.EMPTY) {
36 EmptyComponent({ emptyType: WDViewDefaultType.WDViewDefaultType_NoContent1 }) 45 EmptyComponent({ emptyType: WDViewDefaultType.WDViewDefaultType_NoContent1 })
37 } else { 46 } else {
  47 + CustomPullToRefresh({
  48 + alldata: this.liveList,
  49 + scroller: this.scroller,
  50 + hasMore: false,
  51 + customList: () => {
38 this.ListLayout() 52 this.ListLayout()
  53 + },
  54 + onRefresh: (resolve) => {
  55 + this.pageModel.currentPage = 1
  56 + this.getLiveList(resolve)
  57 + },
  58 + })
  59 +
39 } 60 }
40 } 61 }
41 .alignContent(Alignment.Top) 62 .alignContent(Alignment.Top)
@@ -46,32 +67,35 @@ export struct TabLiveComponent { @@ -46,32 +67,35 @@ export struct TabLiveComponent {
46 67
47 @Builder 68 @Builder
48 ListLayout() { 69 ListLayout() {
49 - List() {  
50 - ListItem() {  
51 - // 下拉刷新 TODO 待对接新的下拉刷新组件  
52 - // RefreshLayout({  
53 - // refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullDown, this.pageModel.pullDownRefreshImage,  
54 - // this.pageModel.pullDownRefreshText, this.pageModel.pullDownRefreshHeight)  
55 - // })  
56 - }  
57 70
58 - ForEach(this.liveList, (item: LiveRoomItemBean) => { 71 + List({ scroller: this.scroller }) {
  72 + // 下拉刷新
  73 + LazyForEach(this.liveList, (item: LiveRoomItemBean, index: number) => {
59 ListItem() { 74 ListItem() {
60 TabLiveItemComponent({ item: item }) 75 TabLiveItemComponent({ item: item })
61 } 76 }
62 - }) 77 + },
  78 + (item: LiveRoomItemBean, contentIndex: number) => JSON.stringify(item)
  79 + )
63 // 加载更多 80 // 加载更多
64 ListItem() { 81 ListItem() {
65 - if (this.pageModel.hasMore) {  
66 - // LoadMoreLayout({  
67 - // refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage,  
68 - // this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight)  
69 - // })  
70 - } else {  
71 - ListHasNoMoreDataUI() 82 + if (this.pageModel.hasMore && this.liveList && this.liveList.totalCount() > 0) {
  83 + LoadMoreLayout({ isVisible: this.pageModel.hasMore })
  84 + } else if (!this.pageModel.hasMore && !this.pageModel.isLoading) {
  85 + PeopleShipNoMoreData()
72 } 86 }
73 } 87 }
74 } 88 }
  89 + .edgeEffect(EdgeEffect.None)
  90 + .scrollBar(BarState.Off)
  91 + .onReachEnd(() => {
  92 + Logger.debug(TAG, "触底了");
  93 + if (!this.pageModel.isLoading && this.pageModel.hasMore) {
  94 + //加载分页数据
  95 + //this.currentPage++;
  96 + this.getLiveList()
  97 + }
  98 + })
75 } 99 }
76 100
77 @Builder 101 @Builder
@@ -82,19 +106,35 @@ export struct TabLiveComponent { @@ -82,19 +106,35 @@ export struct TabLiveComponent {
82 }) 106 })
83 } 107 }
84 108
85 - getLiveList() { 109 + async getLiveList(resolve?: (value: string | PromiseLike<string>) => void) {
86 if (!this.contentDetailData || !this.contentDetailData.newsId) { 110 if (!this.contentDetailData || !this.contentDetailData.newsId) {
87 // 参数不够,直接拦截接口 111 // 参数不够,直接拦截接口
88 return 112 return
89 } 113 }
  114 + if (this.pageModel.isLoading) {
  115 +
  116 + if (resolve) {
  117 + resolve('已更新至最新')
  118 + }
  119 + return
  120 + }
  121 + this.pageModel.isLoading = true
90 this.pageModel.currentPage = 1 122 this.pageModel.currentPage = 1
91 this.liveViewModel.getLiveList( 123 this.liveViewModel.getLiveList(
92 this.pageModel.currentPage, 124 this.pageModel.currentPage,
93 this.contentDetailData?.liveInfo?.mlive?.mliveId, 125 this.contentDetailData?.liveInfo?.mlive?.mliveId,
94 - this.contentDetailData?.newsId+'', 126 + this.contentDetailData?.newsId + '',
95 20) 127 20)
96 .then( 128 .then(
97 (data) => { 129 (data) => {
  130 + this.pageModel.isLoading = false
  131 + if (resolve) {
  132 + if (this.pageModel.currentPage == 1) {
  133 + resolve('已更新至最新')
  134 + } else {
  135 + resolve('')
  136 + }
  137 + }
98 Logger.debug(TAG, '直播间数据:' + `${JSON.stringify(data)}`) 138 Logger.debug(TAG, '直播间数据:' + `${JSON.stringify(data)}`)
99 if (data.barrageResponses && data.barrageResponses.length > 0) { 139 if (data.barrageResponses && data.barrageResponses.length > 0) {
100 /** 140 /**
@@ -106,6 +146,10 @@ export struct TabLiveComponent { @@ -106,6 +146,10 @@ export struct TabLiveComponent {
106 3.内容:详情接口的简介,newIntroduction 146 3.内容:详情接口的简介,newIntroduction
107 */ 147 */
108 this.pageModel.viewType = ViewType.LOADED; 148 this.pageModel.viewType = ViewType.LOADED;
  149 + if(this.pageModel.currentPage ===1){
  150 + this.liveList.clear()
  151 + }
  152 +
109 this.liveList.push(...data.barrageResponses) 153 this.liveList.push(...data.barrageResponses)
110 if (data.barrageResponses.length === this.pageModel.pageSize) { 154 if (data.barrageResponses.length === this.pageModel.pageSize) {
111 this.pageModel.currentPage++; 155 this.pageModel.currentPage++;
@@ -124,9 +168,11 @@ export struct TabLiveComponent { @@ -124,9 +168,11 @@ export struct TabLiveComponent {
124 && this.contentDetailData.liveInfo.liveState != 'wait') { 168 && this.contentDetailData.liveInfo.liveState != 'wait') {
125 this.pageModel.viewType = ViewType.LOADED; 169 this.pageModel.viewType = ViewType.LOADED;
126 this.updateLiveListData() 170 this.updateLiveListData()
  171 + this.pageModel.hasMore = false;
127 } else { 172 } else {
128 this.pageModel.viewType = ViewType.EMPTY; 173 this.pageModel.viewType = ViewType.EMPTY;
129 } 174 }
  175 +
130 } 176 }
131 }, 177 },
132 () => { 178 () => {
@@ -155,7 +201,7 @@ export struct TabLiveComponent { @@ -155,7 +201,7 @@ export struct TabLiveComponent {
155 } 201 }
156 202
157 updateData() { 203 updateData() {
158 - if (this.liveList.length > 0) { 204 + if (this.liveList.totalCount() > 0) {
159 // TODO 拦截刷新?根据业务斟酌下 205 // TODO 拦截刷新?根据业务斟酌下
160 return 206 return
161 } 207 }
@@ -15,6 +15,7 @@ export struct TopPlayComponent { @@ -15,6 +15,7 @@ export struct TopPlayComponent {
15 playerController?: WDAliPlayerController 15 playerController?: WDAliPlayerController
16 // 预告片图片/视频url 16 // 预告片图片/视频url
17 @State previewUrl: string = '' 17 @State previewUrl: string = ''
  18 + // 预告资源是否是视频资源
18 @State isVideoSource: boolean = false 19 @State isVideoSource: boolean = false
19 //未开始 20 //未开始
20 @State isWait: boolean = false 21 @State isWait: boolean = false
@@ -52,7 +53,6 @@ export struct TopPlayComponent { @@ -52,7 +53,6 @@ export struct TopPlayComponent {
52 } else if (status === PlayerConstants.STATUS_COMPLETION) { 53 } else if (status === PlayerConstants.STATUS_COMPLETION) {
53 // 播放完成 54 // 播放完成
54 55
55 -  
56 } else { 56 } else {
57 this.isError = false 57 this.isError = false
58 } 58 }
@@ -62,8 +62,10 @@ export struct TopPlayComponent { @@ -62,8 +62,10 @@ export struct TopPlayComponent {
62 this.updateData() 62 this.updateData()
63 } 63 }
64 64
  65 + /**
  66 + * 更新直播播放数据
  67 + */
65 updateData() { 68 updateData() {
66 -  
67 // 检测等待中的直播预告是否视频资源 69 // 检测等待中的直播预告是否视频资源
68 if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewType === 1 70 if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewType === 1
69 && this.contentDetailData.liveInfo.previewUrl && 71 && this.contentDetailData.liveInfo.previewUrl &&
@@ -93,8 +95,11 @@ export struct TopPlayComponent { @@ -93,8 +95,11 @@ export struct TopPlayComponent {
93 } 95 }
94 } 96 }
95 97
  98 +
96 this.isEnd = this.contentDetailData?.liveInfo?.liveState === 'end' && 99 this.isEnd = this.contentDetailData?.liveInfo?.liveState === 'end' &&
97 StringUtils.isEmpty(this.contentDetailData?.liveInfo?.vlive[0]?.replayUri) 100 StringUtils.isEmpty(this.contentDetailData?.liveInfo?.vlive[0]?.replayUri)
  101 +
  102 + Logger.debug(TAG, `---0------>` + this.isWait + ' ->' + this.isLoading + ' ->' + this.isEnd)
98 if (!this.isWait && this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.vlive.length > 0) { 103 if (!this.isWait && this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.vlive.length > 0) {
99 let playUrl = '' 104 let playUrl = ''
100 if (this.contentDetailData.liveInfo.liveState == 'running') { 105 if (this.contentDetailData.liveInfo.liveState == 'running') {
@@ -107,17 +112,29 @@ export struct TopPlayComponent { @@ -107,17 +112,29 @@ export struct TopPlayComponent {
107 this.playUrl = this.previewUrl 112 this.playUrl = this.previewUrl
108 this.tryToPlay() 113 this.tryToPlay()
109 } else { 114 } else {
  115 + Logger.debug(TAG, `---0------>${playUrl}`)
110 if (StringUtils.isNotEmpty(playUrl)) { 116 if (StringUtils.isNotEmpty(playUrl)) {
111 - Logger.debug(TAG, `${playUrl}`)  
112 this.playUrl = playUrl 117 this.playUrl = playUrl
113 this.tryToPlay() 118 this.tryToPlay()
114 } 119 }
115 } 120 }
  121 + }
116 122
  123 + // 文字直播 running 状态
  124 + if (this.contentDetailData?.liveInfo?.liveWay === 1 && this.contentDetailData?.liveInfo?.liveState === 'running') {
  125 + this.isWait = true
  126 + this.isLoading = true
  127 + if (this.contentDetailData.fullColumnImgUrls && this.contentDetailData.fullColumnImgUrls.length > 0) {
  128 + this.previewUrl = this.contentDetailData.fullColumnImgUrls[0].url
  129 + } else {
  130 + this.previewUrl = ''
117 } 131 }
118 } 132 }
119 133
  134 + }
  135 +
120 tryToPlay() { 136 tryToPlay() {
  137 + Logger.debug(TAG, `---1------>`)
121 if (!this.xComponentIsLoaded) { 138 if (!this.xComponentIsLoaded) {
122 Logger.debug(TAG, "需要xComponent加载完成") 139 Logger.debug(TAG, "需要xComponent加载完成")
123 return 140 return
@@ -138,6 +155,7 @@ export struct TopPlayComponent { @@ -138,6 +155,7 @@ export struct TopPlayComponent {
138 this.isLoading = false 155 this.isLoading = false
139 this.isError = false 156 this.isError = false
140 this.xComponentIsLoaded = true 157 this.xComponentIsLoaded = true
  158 + Logger.debug(TAG, `---onLoad------>`)
141 this.tryToPlay() 159 this.tryToPlay()
142 } 160 }
143 }) 161 })
@@ -151,6 +169,7 @@ export struct TopPlayComponent { @@ -151,6 +169,7 @@ export struct TopPlayComponent {
151 // 直播房间图 169 // 直播房间图
152 Image(this.previewUrl) 170 Image(this.previewUrl)
153 .objectFit(ImageFit.Cover) 171 .objectFit(ImageFit.Cover)
  172 + .alt($r('app.media.live_room_image_fail'))
154 .visibility(this.isWait || this.isEnd ? Visibility.Visible : Visibility.None) 173 .visibility(this.isWait || this.isEnd ? Visibility.Visible : Visibility.None)
155 .contrast(this.isEnd ? 0.2 : 1) 174 .contrast(this.isEnd ? 0.2 : 1)
156 .width('100%') 175 .width('100%')
@@ -10,7 +10,7 @@ import { LiveViewModel } from '../../viewModel/LiveViewModel' @@ -10,7 +10,7 @@ import { LiveViewModel } from '../../viewModel/LiveViewModel'
10 import { ChartItemCompereComponent } from './ChartItemCompereComponent' 10 import { ChartItemCompereComponent } from './ChartItemCompereComponent'
11 import { ChatItemComponent } from './ChartItemComponent' 11 import { ChatItemComponent } from './ChartItemComponent'
12 import { router } from '@kit.ArkUI' 12 import { router } from '@kit.ArkUI'
13 -import { EmitterEventId, EmitterUtils, SPHelper, WindowModel } from 'wdKit/Index' 13 +import { EmitterEventId, EmitterUtils, Logger, SPHelper, WindowModel } from 'wdKit/Index'
14 14
15 const TAG = "PlayerCommentComponent" 15 const TAG = "PlayerCommentComponent"
16 16
@@ -28,22 +28,6 @@ export struct PlayerCommentComponent { @@ -28,22 +28,6 @@ export struct PlayerCommentComponent {
28 async aboutToAppear(): Promise<void> { 28 async aboutToAppear(): Promise<void> {
29 29
30 this.getLiveChatList() 30 this.getLiveChatList()
31 - //注册通知  
32 - EmitterUtils.receiveEvent(EmitterEventId.COMMENT_PUBLISH, async (targetId?: string) => {  
33 - if (targetId) {  
34 - if (targetId == this.publishCommentModel.targetId) {  
35 - const info = {  
36 - senderUserName: this.publishCommentModel.lastCommentModel.fromUserName,  
37 - text: this.publishCommentModel.lastCommentModel.commentContent,  
38 - } as LiveRoomItemBean  
39 -  
40 - this.liveChatList.push(info)  
41 - this.scroller.scrollEdge(Edge.Bottom)  
42 - console.log(TAG, '发布评论:', JSON.stringify(this.publishCommentModel.lastCommentModel))  
43 - }  
44 - }  
45 - })  
46 -  
47 } 31 }
48 32
49 generateRandomString() { 33 generateRandomString() {
@@ -122,7 +106,14 @@ export struct PlayerCommentComponent { @@ -122,7 +106,14 @@ export struct PlayerCommentComponent {
122 }, 106 },
123 onCommentInputed: (content) => { 107 onCommentInputed: (content) => {
124 if (content.comment) { 108 if (content.comment) {
125 - this.liveViewModel.sendComment(content.comment) 109 + this.liveViewModel.sendComment(content.comment, this.contentDetailData).then(result => {
  110 + if (!result) {
  111 + return
  112 + }
  113 + Logger.debug(TAG, "3显示评论》》》: " + JSON.stringify(result))
  114 + this.liveChatList.push(result)
  115 + this.scroller.scrollEdge(Edge.Bottom)
  116 + })
126 } 117 }
127 }, 118 },
128 onBack: () => { 119 onBack: () => {
@@ -16,6 +16,7 @@ export struct PlayerComponent { @@ -16,6 +16,7 @@ export struct PlayerComponent {
16 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 16 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
17 @State imgUrl: string = '' 17 @State imgUrl: string = ''
18 @State isWait: boolean = false 18 @State isWait: boolean = false
  19 + // 0-横屏流画面,1-竖屏幕流画面
19 @State liveStreamType: number | null = -1 20 @State liveStreamType: number | null = -1
20 @State playUrl: string = '' 21 @State playUrl: string = ''
21 @State isCanplay: boolean = false 22 @State isCanplay: boolean = false
@@ -28,7 +29,10 @@ export struct PlayerComponent { @@ -28,7 +29,10 @@ export struct PlayerComponent {
28 this.playerController?.pause() 29 this.playerController?.pause()
29 } 30 }
30 31
31 - aboutToAppear(): void { 32 + async aboutToAppear(): Promise<void> {
  33 + setTimeout(() => {
  34 + this.updateData()
  35 + }, 10)
32 } 36 }
33 37
34 async aboutToDisappear(): Promise<void> { 38 async aboutToDisappear(): Promise<void> {
@@ -36,6 +40,7 @@ export struct PlayerComponent { @@ -36,6 +40,7 @@ export struct PlayerComponent {
36 await this.playerController?.pause() 40 await this.playerController?.pause()
37 await this.playerController?.stop() 41 await this.playerController?.stop()
38 await this.playerController?.release() 42 await this.playerController?.release()
  43 +
39 } 44 }
40 45
41 updateData() { 46 updateData() {
@@ -58,6 +63,7 @@ export struct PlayerComponent { @@ -58,6 +63,7 @@ export struct PlayerComponent {
58 this.liveStreamType = liveStreamType 63 this.liveStreamType = liveStreamType
59 this.playUrl = playUrl 64 this.playUrl = playUrl
60 } 65 }
  66 + console.error("XXXXZZZZ", 'updateData ----liveState==>' + this.playUrl)
61 } 67 }
62 68
63 build() { 69 build() {
@@ -69,6 +75,7 @@ export struct PlayerComponent { @@ -69,6 +75,7 @@ export struct PlayerComponent {
69 playerController: this.playerController, 75 playerController: this.playerController,
70 onLoad: () => { 76 onLoad: () => {
71 this.isCanplay = true 77 this.isCanplay = true
  78 + console.error("XXXXZZZZ", '------2------------')
72 this.playerController?.firstPlay(this.playUrl); 79 this.playerController?.firstPlay(this.playUrl);
73 } 80 }
74 }) 81 })
@@ -77,7 +84,7 @@ export struct PlayerComponent { @@ -77,7 +84,7 @@ export struct PlayerComponent {
77 playerController: this.playerController, 84 playerController: this.playerController,
78 onLoad: () => { 85 onLoad: () => {
79 this.isCanplay = true 86 this.isCanplay = true
80 - console.error('WDAliPlayerController', '------1------------') 87 + console.error('XXXXZZZZ', '------1------------')
81 this.playerController?.firstPlay(this.playUrl); 88 this.playerController?.firstPlay(this.playUrl);
82 } 89 }
83 }).margin({ top: 195 }).height(211) 90 }).margin({ top: 195 }).height(211)
@@ -4,6 +4,7 @@ import { SpConstants } from 'wdConstant/Index' @@ -4,6 +4,7 @@ import { SpConstants } from 'wdConstant/Index'
4 import { ContentDetailRequest, postInteractAccentionOperateParams } from 'wdDetailPlayApi/Index' 4 import { ContentDetailRequest, postInteractAccentionOperateParams } from 'wdDetailPlayApi/Index'
5 import { NumberFormatterUtils, DateTimeUtils, SPHelper } from 'wdKit/Index' 5 import { NumberFormatterUtils, DateTimeUtils, SPHelper } from 'wdKit/Index'
6 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' 6 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
  7 +import { router } from '@kit.ArkUI'
7 8
8 const TAG = 'PlayerEndView' 9 const TAG = 'PlayerEndView'
9 10
@@ -15,9 +16,12 @@ export struct PlayerEndView { @@ -15,9 +16,12 @@ export struct PlayerEndView {
15 @Consume liveRoomDataBean: LiveRoomDataBean 16 @Consume liveRoomDataBean: LiveRoomDataBean
16 @State duration: string = '' 17 @State duration: string = ''
17 @State followStatus: String = '0'; 18 @State followStatus: String = '0';
  19 + private onBack: () => void = () => {
  20 + }
18 21
19 aboutToAppear(): void { 22 aboutToAppear(): void {
20 - const sn = DateTimeUtils.parseDate(this.contentDetailData.liveInfo.startTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN) 23 + const sn =
  24 + DateTimeUtils.parseDate(this.contentDetailData.liveInfo.startTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)
21 const en = DateTimeUtils.parseDate(this.contentDetailData.liveInfo.endTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN) 25 const en = DateTimeUtils.parseDate(this.contentDetailData.liveInfo.endTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)
22 const sd = DateTimeUtils.getDuration(sn, en) 26 const sd = DateTimeUtils.getDuration(sn, en)
23 this.duration = DateTimeUtils.secondToTime(sd / 1000) 27 this.duration = DateTimeUtils.secondToTime(sd / 1000)
@@ -113,7 +117,12 @@ export struct PlayerEndView { @@ -113,7 +117,12 @@ export struct PlayerEndView {
113 .fontWeight(400) 117 .fontWeight(400)
114 .fontSize(16) 118 .fontSize(16)
115 .fontColor(Color.White) 119 .fontColor(Color.White)
116 - .padding({ top: 8, bottom: 8, left: 122, right: 122 }) 120 + .padding({
  121 + top: 8,
  122 + bottom: 8,
  123 + left: 122,
  124 + right: 122
  125 + })
117 .backgroundColor(this.followStatus == '0' ? '#FFED2800' : Color.Grey) 126 .backgroundColor(this.followStatus == '0' ? '#FFED2800' : Color.Grey)
118 .borderRadius(4) 127 .borderRadius(4)
119 .onClick(() => { 128 .onClick(() => {
@@ -140,8 +149,30 @@ export struct PlayerEndView { @@ -140,8 +149,30 @@ export struct PlayerEndView {
140 } 149 }
141 .width(307) 150 .width(307)
142 .padding({ top: 40 }) 151 .padding({ top: 40 })
  152 +
  153 + Blank()
  154 +
  155 + // 返回按钮
  156 + Row() {
  157 + Image($r('app.media.icon_arrow_left_white'))
  158 + .width(24)
  159 + .height(24)
  160 + .aspectRatio(1)
  161 + .interpolation(ImageInterpolation.High)
  162 + .hoverEffect(HoverEffect.Scale)
  163 + .margin({ bottom: 30 ,left:14})
  164 + .onClick(() => {
  165 + if (this.onBack) {
  166 + this.onBack()
  167 + }
  168 + router.back();
  169 + })
  170 +
  171 + }.width('100%')
  172 +
143 } 173 }
144 .height('100%') 174 .height('100%')
  175 + .width('100%')
145 176
146 } 177 }
147 } 178 }
@@ -7,12 +7,13 @@ import { @@ -7,12 +7,13 @@ import {
7 paused, 7 paused,
8 stopped, 8 stopped,
9 completion, 9 completion,
10 - error} from 'premierlibrary/src/main/ets/com/aliyun/player/IPlayer'; 10 + error
  11 +} from 'premierlibrary/src/main/ets/com/aliyun/player/IPlayer';
11 12
12 import { initGlobalPlayerSettings, setupPlayerConfig } from '../utils/GlobalSetting'; 13 import { initGlobalPlayerSettings, setupPlayerConfig } from '../utils/GlobalSetting';
13 import prompt from '@ohos.promptAction'; 14 import prompt from '@ohos.promptAction';
14 import { PlayerConstants, AVPlayerStatus, Events } from '../constants/PlayerConstants'; 15 import { PlayerConstants, AVPlayerStatus, Events } from '../constants/PlayerConstants';
15 -import { Logger } from 'wdKit/Index'; 16 +import { Logger, StringUtils } from 'wdKit/Index';
16 17
17 const TAG = "WDAliPlayerController" 18 const TAG = "WDAliPlayerController"
18 19
@@ -26,7 +27,6 @@ const TAG = "WDAliPlayerController" @@ -26,7 +27,6 @@ const TAG = "WDAliPlayerController"
26 export class WDAliPlayerController { 27 export class WDAliPlayerController {
27 private initPromise: Promise<void>; 28 private initPromise: Promise<void>;
28 private avPlayer?: AliPlayer; 29 private avPlayer?: AliPlayer;
29 -  
30 // 内部播放器状态 30 // 内部播放器状态
31 private avPlayerStatus: number = idle 31 private avPlayerStatus: number = idle
32 private duration: number = 0; 32 private duration: number = 0;
@@ -38,18 +38,14 @@ export class WDAliPlayerController { @@ -38,18 +38,14 @@ export class WDAliPlayerController {
38 private seekTime: number = 0; 38 private seekTime: number = 0;
39 private positionY: number = 0; 39 private positionY: number = 0;
40 private startTime: number = 0 40 private startTime: number = 0
41 -  
42 public errorCode?: number 41 public errorCode?: number
43 public errorMesage?: string 42 public errorMesage?: string
44 -  
45 public onVideoSizeChange?: (width: number, height: number) => void; 43 public onVideoSizeChange?: (width: number, height: number) => void;
46 public onBufferUpdate?: (buffered: number, duration: number) => void; 44 public onBufferUpdate?: (buffered: number, duration: number) => void;
47 public onTimeUpdate?: (position: number, duration: number) => void; 45 public onTimeUpdate?: (position: number, duration: number) => void;
48 public onVolumeUpdate?: (volume: number) => void; 46 public onVolumeUpdate?: (volume: number) => void;
49 -  
50 // 播放完成,决定是否继续播放回调 47 // 播放完成,决定是否继续播放回调
51 public continue?: () => void; 48 public continue?: () => void;
52 -  
53 // 准备完成,决定是否播放回调。如果不实现,则自动播放 49 // 准备完成,决定是否播放回调。如果不实现,则自动播放
54 public onCanplay?: () => void; 50 public onCanplay?: () => void;
55 public onStatusChange?: (status: number) => void; 51 public onStatusChange?: (status: number) => void;
@@ -117,12 +113,12 @@ export class WDAliPlayerController { @@ -117,12 +113,12 @@ export class WDAliPlayerController {
117 onInfo: (bean: InfoBean) => { 113 onInfo: (bean: InfoBean) => {
118 114
119 if (bean.getCode() === InfoCode.CurrentPosition) { 115 if (bean.getCode() === InfoCode.CurrentPosition) {
120 - let position : number = bean.getExtraValue() 116 + let position: number = bean.getExtraValue()
121 Logger.debug(TAG, `播放进度条:${position}/ ${this.duration}`) 117 Logger.debug(TAG, `播放进度条:${position}/ ${this.duration}`)
122 this.initProgress(position); 118 this.initProgress(position);
123 119
124 } else if (bean.getCode() === InfoCode.BufferedPosition) { 120 } else if (bean.getCode() === InfoCode.BufferedPosition) {
125 - let buffer : number = bean.getExtraValue() 121 + let buffer: number = bean.getExtraValue()
126 if (this.onBufferUpdate) { 122 if (this.onBufferUpdate) {
127 this.onBufferUpdate(buffer, this.duration) 123 this.onBufferUpdate(buffer, this.duration)
128 } 124 }
@@ -140,7 +136,8 @@ export class WDAliPlayerController { @@ -140,7 +136,8 @@ export class WDAliPlayerController {
140 switch (status) { 136 switch (status) {
141 case initalized: { 137 case initalized: {
142 //this.avPlayer?.prepare(); 138 //this.avPlayer?.prepare();
143 - } break 139 + }
  140 + break
144 case prepared: { 141 case prepared: {
145 if (this.startTime) { 142 if (this.startTime) {
146 this.setSeekTime(this.startTime, SliderChangeMode.Begin); 143 this.setSeekTime(this.startTime, SliderChangeMode.Begin);
@@ -154,20 +151,24 @@ export class WDAliPlayerController { @@ -154,20 +151,24 @@ export class WDAliPlayerController {
154 } else { 151 } else {
155 this.play() 152 this.play()
156 } 153 }
157 - } break 154 + }
  155 + break
158 case started: { 156 case started: {
159 this.setBright(); 157 this.setBright();
160 this.status = PlayerConstants.STATUS_START; 158 this.status = PlayerConstants.STATUS_START;
161 this.watchStatus(); 159 this.watchStatus();
162 - } break 160 + }
  161 + break
163 case paused: { 162 case paused: {
164 this.status = PlayerConstants.STATUS_PAUSE; 163 this.status = PlayerConstants.STATUS_PAUSE;
165 this.watchStatus(); 164 this.watchStatus();
166 - } break 165 + }
  166 + break
167 case stopped: { 167 case stopped: {
168 this.status = PlayerConstants.STATUS_STOP; 168 this.status = PlayerConstants.STATUS_STOP;
169 this.watchStatus(); 169 this.watchStatus();
170 - } break 170 + }
  171 + break
171 case completion: { 172 case completion: {
172 this.status = PlayerConstants.STATUS_COMPLETION; 173 this.status = PlayerConstants.STATUS_COMPLETION;
173 this.watchStatus(); 174 this.watchStatus();
@@ -179,7 +180,8 @@ export class WDAliPlayerController { @@ -179,7 +180,8 @@ export class WDAliPlayerController {
179 //this.url = this.avPlayer.url || ''; 180 //this.url = this.avPlayer.url || '';
180 //this.avPlayer.reset(); 181 //this.avPlayer.reset();
181 } 182 }
182 - } break 183 + }
  184 + break
183 case error: { 185 case error: {
184 // 这里拿不到错误信息 186 // 这里拿不到错误信息
185 // this.status = PlayerConstants.STATUS_ERROR; 187 // this.status = PlayerConstants.STATUS_ERROR;
@@ -189,7 +191,7 @@ export class WDAliPlayerController { @@ -189,7 +191,7 @@ export class WDAliPlayerController {
189 } 191 }
190 }); 192 });
191 this.avPlayer?.setOnErrorListener({ 193 this.avPlayer?.setOnErrorListener({
192 - onError:(errorInfo) => { 194 + onError: (errorInfo) => {
193 Logger.error(TAG, "播放错误", JSON.stringify(errorInfo)) 195 Logger.error(TAG, "播放错误", JSON.stringify(errorInfo))
194 this.errorCode = errorInfo.getCode() 196 this.errorCode = errorInfo.getCode()
195 this.errorMesage = errorInfo.getMsg() 197 this.errorMesage = errorInfo.getMsg()
@@ -220,21 +222,29 @@ export class WDAliPlayerController { @@ -220,21 +222,29 @@ export class WDAliPlayerController {
220 } 222 }
221 223
222 private setAliPlayerURL(url: string) { 224 private setAliPlayerURL(url: string) {
223 - let urlSource : UrlSource = new UrlSource() 225 + let urlSource: UrlSource = new UrlSource()
224 urlSource.setUri(url) 226 urlSource.setUri(url)
225 this.avPlayer?.setUrlDataSource(urlSource) 227 this.avPlayer?.setUrlDataSource(urlSource)
226 } 228 }
227 229
228 - private getStatusStringWith(status: number) : string { 230 + private getStatusStringWith(status: number): string {
229 switch (status) { 231 switch (status) {
230 - case idle: return 'idle'  
231 - case initalized: return 'initalized'  
232 - case prepared: return 'prepared'  
233 - case started: return 'started'  
234 - case paused: return 'paused'  
235 - case stopped: return 'stopped'  
236 - case completion: return 'completion'  
237 - case error: return 'error' 232 + case idle:
  233 + return 'idle'
  234 + case initalized:
  235 + return 'initalized'
  236 + case prepared:
  237 + return 'prepared'
  238 + case started:
  239 + return 'started'
  240 + case paused:
  241 + return 'paused'
  242 + case stopped:
  243 + return 'stopped'
  244 + case completion:
  245 + return 'completion'
  246 + case error:
  247 + return 'error'
238 } 248 }
239 return 'unknow' 249 return 'unknow'
240 } 250 }
@@ -256,6 +266,11 @@ export class WDAliPlayerController { @@ -256,6 +266,11 @@ export class WDAliPlayerController {
256 } 266 }
257 267
258 async firstPlay(url: string) { 268 async firstPlay(url: string) {
  269 + if (StringUtils.isEmpty(url)) {
  270 + Logger.error(TAG, "播放链接为空")
  271 + return
  272 + }
  273 +
259 this.url = url; 274 this.url = url;
260 if (this.avPlayer == null) { 275 if (this.avPlayer == null) {
261 Logger.info(TAG, "等待播放器初始化") 276 Logger.info(TAG, "等待播放器初始化")
@@ -278,7 +293,7 @@ export class WDAliPlayerController { @@ -278,7 +293,7 @@ export class WDAliPlayerController {
278 293
279 this.avPlayer?.setAutoPlay(false) 294 this.avPlayer?.setAutoPlay(false)
280 295
281 - Logger.debug(TAG, "开始播放", this.url) 296 + Logger.debug(TAG, "开始播放: " + this.url)
282 this.setAliPlayerURL(this.url); 297 this.setAliPlayerURL(this.url);
283 298
284 Logger.info(TAG, "设置SurfaceId: " + this.surfaceId) 299 Logger.info(TAG, "设置SurfaceId: " + this.surfaceId)
@@ -175,7 +175,7 @@ export class WDPlayerController { @@ -175,7 +175,7 @@ export class WDPlayerController {
175 this.pageParam = pageParam 175 this.pageParam = pageParam
176 } 176 }
177 if (this.avPlayer == null) { 177 if (this.avPlayer == null) {
178 - Logger.error("等待") 178 + console.log("等待")
179 await this.initPromise; 179 await this.initPromise;
180 } else { 180 } else {
181 if (this.avPlayer.state != AVPlayerStatus.IDLE) { 181 if (this.avPlayer.state != AVPlayerStatus.IDLE) {
@@ -188,7 +188,7 @@ export class WDPlayerController { @@ -188,7 +188,7 @@ export class WDPlayerController {
188 if (this.avPlayer == null) { 188 if (this.avPlayer == null) {
189 return 189 return
190 } 190 }
191 - Logger.error("开始播放", this.url) 191 + console.log("开始播放", this.url)
192 this.avPlayer.url = this.url; 192 this.avPlayer.url = this.url;
193 //加载时长prepareTime 193 //加载时长prepareTime
194 this.creatEndTime = DateTimeUtils.getTimeStamp() 194 this.creatEndTime = DateTimeUtils.getTimeStamp()
@@ -3,9 +3,10 @@ import { ProcessUtils, WDRouterRule } from 'wdRouter'; @@ -3,9 +3,10 @@ import { ProcessUtils, WDRouterRule } from 'wdRouter';
3 import { WDRouterPage } from 'wdRouter'; 3 import { WDRouterPage } from 'wdRouter';
4 import { Logger, SPHelper } from 'wdKit/Index'; 4 import { Logger, SPHelper } from 'wdKit/Index';
5 import { SpConstants } from 'wdConstant/Index'; 5 import { SpConstants } from 'wdConstant/Index';
6 -import LaunchDataModel from '../viewModel/LaunchDataModel' 6 +import LaunchDataModel, { defaultLaunchModel } from '../viewModel/LaunchDataModel'
7 7
8 import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index'; 8 import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index';
  9 +import { ContentDTO } from 'wdBean/Index';
9 10
10 11
11 @Entry 12 @Entry
@@ -13,14 +14,11 @@ import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTr @@ -13,14 +14,11 @@ import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTr
13 struct LaunchAdvertisingPage { 14 struct LaunchAdvertisingPage {
14 @State time: number = 4 15 @State time: number = 4
15 timer :number = -1 16 timer :number = -1
16 - @State model : LaunchDataModel = {} as LaunchDataModel  
17 pageParam: ParamType = {} 17 pageParam: ParamType = {}
18 18
  19 + @State defaultModel:defaultLaunchModel = new defaultLaunchModel()
19 20
20 enter() { 21 enter() {
21 - // router.replaceUrl({  
22 - // url:'pages/MainPage'  
23 - // })  
24 WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) 22 WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
25 clearInterval(this.timer) 23 clearInterval(this.timer)
26 } 24 }
@@ -28,12 +26,16 @@ struct LaunchAdvertisingPage { @@ -28,12 +26,16 @@ struct LaunchAdvertisingPage {
28 aboutToAppear(): void { 26 aboutToAppear(): void {
29 let dataModelStr : string = SPHelper.default.getSync(SpConstants.APP_LAUNCH_PAGE_DATA_MODEL,'') as string 27 let dataModelStr : string = SPHelper.default.getSync(SpConstants.APP_LAUNCH_PAGE_DATA_MODEL,'') as string
30 let dataModel : LaunchDataModel = JSON.parse(dataModelStr) 28 let dataModel : LaunchDataModel = JSON.parse(dataModelStr)
31 - this.model = dataModel  
32 console.log(dataModelStr) 29 console.log(dataModelStr)
33 - if(this.model.launchAdInfo.length){ 30 +
  31 + this.rebaseDefaultModel(dataModel)
  32 +
  33 +
  34 + if(this.defaultModel){
34 //设置倒计时时间 35 //设置倒计时时间
35 - this.time = this.model.launchAdInfo[0].displayDuration 36 + this.time = this.defaultModel.durations
36 } 37 }
  38 +
37 this.contentTrackingDict() 39 this.contentTrackingDict()
38 40
39 this.trackingLaunchShow() 41 this.trackingLaunchShow()
@@ -41,7 +43,6 @@ struct LaunchAdvertisingPage { @@ -41,7 +43,6 @@ struct LaunchAdvertisingPage {
41 43
42 44
43 onPageShow(){ 45 onPageShow(){
44 -  
45 this.timer = setInterval(() => { 46 this.timer = setInterval(() => {
46 this.time-- 47 this.time--
47 if (this.time < 1) { 48 if (this.time < 1) {
@@ -49,29 +50,22 @@ struct LaunchAdvertisingPage { @@ -49,29 +50,22 @@ struct LaunchAdvertisingPage {
49 clearInterval(this.timer) 50 clearInterval(this.timer)
50 } 51 }
51 },1000) 52 },1000)
52 -  
53 } 53 }
54 54
55 build(){ 55 build(){
56 Column(){ 56 Column(){
57 Stack({alignContent:Alignment.Bottom}){ 57 Stack({alignContent:Alignment.Bottom}){
58 -  
59 Stack({alignContent:Alignment.Bottom}){ 58 Stack({alignContent:Alignment.Bottom}){
60 Column(){ 59 Column(){
61 - if(this.model.launchAdInfo.length && !(this.model.launchAdInfo[0].matInfo.matType == '1')){ 60 + if(this.defaultModel.showType === '1'){
  61 + //显示视频播放
  62 + }else {
62 //显示图片 63 //显示图片
63 - Image(this.model.launchAdInfo[0].matInfo.matImageUrl[0]) 64 + Image(this.defaultModel.bootScreenUrl)
  65 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
64 .width('100%') 66 .width('100%')
65 .height('100%') 67 .height('100%')
66 - // .margin({  
67 - // top:'128lpx',left:'48lpx',right:'48lpx',bottom:'128lpx'  
68 - // })  
69 - }else {  
70 - //显示视频播放  
71 -  
72 -  
73 } 68 }
74 -  
75 } 69 }
76 .justifyContent(FlexAlign.Center) 70 .justifyContent(FlexAlign.Center)
77 .width('100%') 71 .width('100%')
@@ -83,6 +77,7 @@ struct LaunchAdvertisingPage { @@ -83,6 +77,7 @@ struct LaunchAdvertisingPage {
83 Stack({alignContent:Alignment.TopEnd}){ 77 Stack({alignContent:Alignment.TopEnd}){
84 Button(){ 78 Button(){
85 Text(this.time + 's 跳过') 79 Text(this.time + 's 跳过')
  80 + // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
86 .fontSize('27lpx') 81 .fontSize('27lpx')
87 .fontColor(Color.White) 82 .fontColor(Color.White)
88 .margin({left:'28lpx',right:'28lpx'}) 83 .margin({left:'28lpx',right:'28lpx'})
@@ -90,7 +85,7 @@ struct LaunchAdvertisingPage { @@ -90,7 +85,7 @@ struct LaunchAdvertisingPage {
90 } 85 }
91 .width('148lpx') 86 .width('148lpx')
92 .height('56lpx') 87 .height('56lpx')
93 - .margin({top:'54lpx',right:'19lpx'}) 88 + .margin({top:'10lpx',right:'19lpx'})
94 .backgroundColor('#80000000') 89 .backgroundColor('#80000000')
95 .onClick(() => { 90 .onClick(() => {
96 this.enter() 91 this.enter()
@@ -99,11 +94,28 @@ struct LaunchAdvertisingPage { @@ -99,11 +94,28 @@ struct LaunchAdvertisingPage {
99 } 94 }
100 .width('100%') 95 .width('100%')
101 .height('100%') 96 .height('100%')
102 - if(this.model.launchAdInfo.length && !(this.model.launchAdInfo[0].matInfo.startStyle == 1)){ 97 +
  98 + if (this.defaultModel.isAd === '1'){
  99 + Stack({alignContent:Alignment.TopStart}){
  100 + Text('广告')
  101 + .fontColor(Color.White)
  102 + .textAlign(TextAlign.Center)
  103 + .fontSize('24lpx')
  104 + .width('72lpx')
  105 + .height('36lpx')
  106 + .borderRadius(5)
  107 + .margin({top:'10lpx',left:'19lpx'})
  108 + .backgroundColor('#80000000')
  109 + }
  110 + .width('100%')
  111 + .height('100%')
  112 + }
  113 +
  114 + if(this.defaultModel.screenType != '2'){
103 //底部logo样式 按钮加载在背景展示图上 115 //底部logo样式 按钮加载在背景展示图上
104 Button(){ 116 Button(){
105 Row(){ 117 Row(){
106 - Text('点击跳转至详情或第三方应用') 118 + Text('点击跳转至详情')
107 .fontSize('31lpx') 119 .fontSize('31lpx')
108 .fontColor(Color.White) 120 .fontColor(Color.White)
109 .margin({ 121 .margin({
@@ -126,17 +138,16 @@ struct LaunchAdvertisingPage { @@ -126,17 +138,16 @@ struct LaunchAdvertisingPage {
126 }) 138 })
127 } 139 }
128 } 140 }
129 -  
130 } 141 }
131 .width('100%') 142 .width('100%')
132 .height('84%') 143 .height('84%')
133 .margin({top:'0'}) 144 .margin({top:'0'})
134 145
135 - if(this.model.launchAdInfo.length && this.model.launchAdInfo[0].matInfo.startStyle == 1){ 146 + if(this.defaultModel.screenType === '2'){
136 //全屏样式,底部无logo 按钮放在原底部logo位置 147 //全屏样式,底部无logo 按钮放在原底部logo位置
137 Button(){ 148 Button(){
138 Row(){ 149 Row(){
139 - Text('点击跳转至详情或第三方应用') 150 + Text('点击跳转至详情')
140 .fontSize('31lpx') 151 .fontSize('31lpx')
141 .fontColor(Color.White) 152 .fontColor(Color.White)
142 .margin({ 153 .margin({
@@ -164,8 +175,8 @@ struct LaunchAdvertisingPage { @@ -164,8 +175,8 @@ struct LaunchAdvertisingPage {
164 .height('154lpx') 175 .height('154lpx')
165 .margin({top: '28lpx'}) 176 .margin({top: '28lpx'})
166 } 177 }
167 -  
168 } 178 }
  179 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
169 .width('100%') 180 .width('100%')
170 .height('100%') 181 .height('100%')
171 .backgroundColor(Color.White) 182 .backgroundColor(Color.White)
@@ -179,25 +190,59 @@ struct LaunchAdvertisingPage { @@ -179,25 +190,59 @@ struct LaunchAdvertisingPage {
179 ///埋点 190 ///埋点
180 this.trackingLaunchClick() 191 this.trackingLaunchClick()
181 192
182 - if(this.model.launchAdInfo.length){  
183 - if (this.model.launchAdInfo[0].matInfo.openType == '2') { 193 + if(this.defaultModel.linkUrl.length > 0){
  194 + if (this.defaultModel.objectType == '2') {
184 //端外打开 195 //端外打开
185 - ProcessUtils.jumpExternalWebPage(this.model.launchAdInfo[0].matInfo.linkUrl)  
186 - //clearInterval(this.timer) 196 + ProcessUtils.jumpExternalWebPage(this.defaultModel.linkUrl)
187 }else { 197 }else {
188 //端内打开 198 //端内打开
189 - ProcessUtils.gotoDefaultWebPage(this.model.launchAdInfo[0].matInfo.linkUrl)  
190 - //clearInterval(this.timer)  
191 - 199 + ProcessUtils.gotoDefaultWebPage(this.defaultModel.linkUrl)
192 } 200 }
  201 + }else if(this.defaultModel.objectId.length > 0){
  202 + let contentDTO :ContentDTO = new ContentDTO();
  203 + contentDTO.objectType = this.defaultModel.objectType
  204 + contentDTO.objectId = this.defaultModel.objectId
  205 + ProcessUtils.processPage(contentDTO)
  206 + }
  207 + }
  208 +
  209 + rebaseDefaultModel(dataModel : LaunchDataModel){
  210 + if (dataModel.launchPageInfo){
  211 + this.defaultModel.ID = dataModel.launchPageInfo.ID
  212 + this.defaultModel.screenName = dataModel.launchPageInfo.screenName
  213 + this.defaultModel.objectType = dataModel.launchPageInfo.objectType
  214 + this.defaultModel.objectId = dataModel.launchPageInfo.objectId
  215 + this.defaultModel.objectLevel = dataModel.launchPageInfo.objectLevel
  216 + this.defaultModel.pageId = dataModel.launchPageInfo.pageId
  217 + this.defaultModel.durations = dataModel.launchPageInfo.durations
  218 + this.defaultModel.linkUrl = dataModel.launchPageInfo.linkUrl
  219 + this.defaultModel.screenType = dataModel.launchPageInfo.screenType
  220 + this.defaultModel.bootScreenUrl = dataModel.launchPageInfo.bootScreenUrl
  221 + this.defaultModel.bootVideoUrl = dataModel.launchPageInfo.bootScreenUrl
  222 + this.defaultModel.bootVideoScreenUrl = dataModel.launchPageInfo.bootVideoScreenUrl
  223 + this.defaultModel.showType = dataModel.launchPageInfo.showType
  224 + this.defaultModel.isAd = dataModel.launchPageInfo.isAd
  225 + this.defaultModel.bottomNavId = dataModel.launchPageInfo.bottomNavId
  226 + this.defaultModel.relId = dataModel.launchPageInfo.relId
  227 + this.defaultModel.openType = '1'
  228 + }else if (dataModel.launchAdInfo.length > 0){
  229 + this.defaultModel.ID = dataModel.launchAdInfo[0].ID
  230 + this.defaultModel.screenName = dataModel.launchAdInfo[0].matInfo.advTitle
  231 + this.defaultModel.durations = dataModel.launchAdInfo[0].displayDuration
  232 + this.defaultModel.linkUrl = dataModel.launchAdInfo[0].matInfo.linkUrl
  233 + this.defaultModel.screenType = dataModel.launchAdInfo[0].matInfo.startStyle
  234 + this.defaultModel.bootScreenUrl = dataModel.launchAdInfo[0].matInfo.matImageUrl[0]
  235 + this.defaultModel.bootVideoUrl = dataModel.launchAdInfo[0].matInfo.matVideoUrl
  236 + this.defaultModel.showType = dataModel.launchAdInfo[0].matInfo.matType
  237 + this.defaultModel.isAd = '1'
193 } 238 }
194 } 239 }
195 240
196 contentTrackingDict(){ 241 contentTrackingDict(){
197 this.pageParam = { 242 this.pageParam = {
198 - 'adType':'0',  
199 - 'adId':this.model.launchAdInfo[0]?.matInfo.id.toString(),  
200 - 'adName':this.model.launchAdInfo[0]?.matInfo.advTitle, 243 + 'adType':this.defaultModel.showType,
  244 + 'adId':this.defaultModel.ID,
  245 + 'adName':this.defaultModel.screenName,
201 'regionName':'0' 246 'regionName':'0'
202 } 247 }
203 } 248 }
@@ -10,7 +10,6 @@ import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index'; @@ -10,7 +10,6 @@ import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index';
10 @Component 10 @Component
11 struct LaunchInterestsHobbiesPage { 11 struct LaunchInterestsHobbiesPage {
12 @State message: string = 'Hello World' 12 @State message: string = 'Hello World'
13 - @State dataArray: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]  
14 @State selectCount: number = 0 13 @State selectCount: number = 0
15 @State interestsArray: InterestsList[] = [] 14 @State interestsArray: InterestsList[] = []
16 15
@@ -20,7 +19,6 @@ struct LaunchInterestsHobbiesPage { @@ -20,7 +19,6 @@ struct LaunchInterestsHobbiesPage {
20 this.requestInterestsData() 19 this.requestInterestsData()
21 } 20 }
22 21
23 -  
24 build() { 22 build() {
25 Column() { 23 Column() {
26 Row(){ 24 Row(){
@@ -113,7 +113,7 @@ struct LaunchPage { @@ -113,7 +113,7 @@ struct LaunchPage {
113 let dataModel : LaunchDataModel = JSON.parse(dataModelStr) 113 let dataModel : LaunchDataModel = JSON.parse(dataModelStr)
114 console.log(dataModelStr) 114 console.log(dataModelStr)
115 115
116 - if (dataModel.launchAdInfo.length) { 116 + if (dataModel.launchPageInfo || dataModel.launchAdInfo.length) {
117 //跳转广告页 117 //跳转广告页
118 this.jumpToAdvertisingPage(); 118 this.jumpToAdvertisingPage();
119 119
@@ -56,9 +56,9 @@ export struct VideoChannelPage { @@ -56,9 +56,9 @@ export struct VideoChannelPage {
56 */ 56 */
57 getTopNavFontColor(item: TopNavDTO, index: number): Color | string { 57 getTopNavFontColor(item: TopNavDTO, index: number): Color | string {
58 if (item.name === '视频' && this.currentBottomNavInfo.name === '视频') { 58 if (item.name === '视频' && this.currentBottomNavInfo.name === '视频') {
59 - return this.currentTopNavSelectedIndex === index ? Color.White : '#e5e0e0' 59 + return this.currentTopNavSelectedIndex === index ? Color.White : '#949494'
60 } else { 60 } else {
61 - return this.currentTopNavSelectedIndex === index ? Color.Black : "#999999" 61 + return this.currentTopNavSelectedIndex === index ? Color.Black : "#B2B2B2"
62 } 62 }
63 } 63 }
64 64
@@ -74,7 +74,7 @@ export struct VideoChannelPage { @@ -74,7 +74,7 @@ export struct VideoChannelPage {
74 74
75 @Builder 75 @Builder
76 topNavView() { 76 topNavView() {
77 - Stack({ alignContent: Alignment.TopEnd }) { 77 + Stack({ alignContent: Alignment.End }) {
78 Row() { 78 Row() {
79 ForEach(this.topNavList, (item: TopNavDTO, index: number) => { 79 ForEach(this.topNavList, (item: TopNavDTO, index: number) => {
80 Column() { 80 Column() {
@@ -117,7 +117,7 @@ export struct VideoChannelPage { @@ -117,7 +117,7 @@ export struct VideoChannelPage {
117 117
118 // 搜索按钮 118 // 搜索按钮
119 Row() { 119 Row() {
120 - Image($r('app.media.icon_search')) 120 + Image($r(this.currentTopNavSelectedIndex === 0 ? 'app.media.icon_search_gray_svg' :'app.media.icon_search_svg'))
121 .width('24vp') 121 .width('24vp')
122 .height('24vp') 122 .height('24vp')
123 } 123 }
@@ -8,7 +8,7 @@ export interface NetLayerLaunchOperatModel { @@ -8,7 +8,7 @@ export interface NetLayerLaunchOperatModel {
8 objectId : string //跳转id 8 objectId : string //跳转id
9 objectLevel : string //频道(1:一级频道,2:二级频道),专题(1:普通专题,2:主题专题,3:作者专题 21:文章专题,22:音频专题,23:直播专题,24:话题专题) 9 objectLevel : string //频道(1:一级频道,2:二级频道),专题(1:普通专题,2:主题专题,3:作者专题 21:文章专题,22:音频专题,23:直播专题,24:话题专题)
10 pageId : string //跳转页面id,objectType=5,14使用页面跳转 10 pageId : string //跳转页面id,objectType=5,14使用页面跳转
11 - durations : string //展示时长(单位:秒) 11 + durations : number //展示时长(单位:秒)
12 linkUrl : string //转链接地址【objectType=6,13】 12 linkUrl : string //转链接地址【objectType=6,13】
13 screenType : string // 0, 1 : WDDisplayStyle_Logo 2 : WDDisplayStyle_Full 13 screenType : string // 0, 1 : WDDisplayStyle_Logo 2 : WDDisplayStyle_Full
14 bootScreenUrl : string //开机屏封面图/视频地址 14 bootScreenUrl : string //开机屏封面图/视频地址
@@ -17,14 +17,13 @@ export interface NetLayerLaunchOperatModel { @@ -17,14 +17,13 @@ export interface NetLayerLaunchOperatModel {
17 isAd : string //0-非广告,1-是广告 17 isAd : string //0-非广告,1-是广告
18 bottomNavId : string //底部导航ID 18 bottomNavId : string //底部导航ID
19 relId : string //频道/专题内容关系id 19 relId : string //频道/专题内容关系id
20 -  
21 } 20 }
22 21
23 22
24 export interface NetLayerLauncherADMaterialModel{ 23 export interface NetLayerLauncherADMaterialModel{
25 24
26 matType : string //1 video 其他 image 25 matType : string //1 video 其他 image
27 - startStyle : number // 1 WDDisplayStyle_Full 全屏样式 其他 WDDisplayStyle_Logo 底部logo样式 26 + startStyle : string // 1 WDDisplayStyle_Full 全屏样式 其他 WDDisplayStyle_Logo 底部logo样式
28 advTitle : string 27 advTitle : string
29 id:number 28 id:number
30 matImageUrl : string[] //取firstObject 29 matImageUrl : string[] //取firstObject
@@ -65,3 +64,23 @@ export default interface LaunchDataModel{ @@ -65,3 +64,23 @@ export default interface LaunchDataModel{
65 h5Template : NetLayerLauncherH5TemplateInfoModel[] 64 h5Template : NetLayerLauncherH5TemplateInfoModel[]
66 65
67 } 66 }
  67 +
  68 +export class defaultLaunchModel{
  69 + ID : string = ''
  70 + screenName : string = '' //开机屏名称
  71 + objectType : string = '' // WDPublicProgramType 对象类型 0:不跳转,1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,11:图文,12:组图,13:H5新闻,14:频道
  72 + objectId : string = '' //跳转id
  73 + objectLevel : string = '' //频道(1:一级频道,2:二级频道),专题(1:普通专题,2:主题专题,3:作者专题 21:文章专题,22:音频专题,23:直播专题,24:话题专题)
  74 + pageId : string = '' //跳转页面id,objectType=5,14使用页面跳转
  75 + durations : number = 0 //展示时长(单位:秒)
  76 + linkUrl : string = '' //转链接地址【objectType=6,13】
  77 + screenType : string = '' // 0, 1 : WDDisplayStyle_Logo 2 : WDDisplayStyle_Full
  78 + bootScreenUrl : string = '' //开机屏封面图/视频地址
  79 + bootVideoUrl : string = '' //开机屏封面图/视频地址
  80 + bootVideoScreenUrl : string = '' //视频封面地址
  81 + showType : string = '' //文件类型WDPublicFileType 2: 视频 其他: 图片
  82 + isAd : string = '' //0-非广告,1-是广告
  83 + bottomNavId : string = '' //底部导航ID
  84 + relId : string = '' //频道/专题内容关系id
  85 + openType : string = '' //链接打开方式,0-没链接,不用打开,1-端内打开,2-端外打开
  86 +}
@@ -18,6 +18,7 @@ import { JSON } from '@kit.ArkTS' @@ -18,6 +18,7 @@ import { JSON } from '@kit.ArkTS'
18 import app from '@system.app' 18 import app from '@system.app'
19 import { GetuiPush, HWLocationUtils } from 'wdHwAbility/Index' 19 import { GetuiPush, HWLocationUtils } from 'wdHwAbility/Index'
20 import { ImageKnife, ImageKnifeGlobal } from '@ohos/imageknife' 20 import { ImageKnife, ImageKnifeGlobal } from '@ohos/imageknife'
  21 +import { webview } from '@kit.ArkWeb'
21 22
22 const TAG = "[StartupManager]" 23 const TAG = "[StartupManager]"
23 24
@@ -120,7 +121,8 @@ export class StartupManager { @@ -120,7 +121,8 @@ export class StartupManager {
120 GetuiPush.sharedInstance().onReachMainPage() 121 GetuiPush.sharedInstance().onReachMainPage()
121 122
122 //TODO: 123 //TODO:
123 - 124 + // 提前初始化webview
  125 + webview.WebviewController.initializeWebEngine()
124 resolve() 126 resolve()
125 }) 127 })
126 } 128 }