王士厅
Showing 33 changed files with 356 additions and 120 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 }
@@ -18,6 +18,10 @@ @@ -18,6 +18,10 @@
18 }, 18 },
19 { 19 {
20 "name": "font_size_13_5", 20 "name": "font_size_13_5",
  21 + "value": "13.5fp"
  22 + },
  23 + {
  24 + "name": "font_size_13_2",
21 "value": "13.2fp" 25 "value": "13.2fp"
22 }, 26 },
23 { 27 {
@@ -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 */
@@ -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';
@@ -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 +}
@@ -97,6 +97,10 @@ export struct FeedBackActivity { @@ -97,6 +97,10 @@ export struct FeedBackActivity {
97 TextArea({ placeholder: $r('app.string.feedback_comments') }) 97 TextArea({ placeholder: $r('app.string.feedback_comments') })
98 .width(CommonConstants.FULL_WIDTH) 98 .width(CommonConstants.FULL_WIDTH)
99 .height(CommonConstants.FULL_HEIGHT) 99 .height(CommonConstants.FULL_HEIGHT)
  100 + .fontColor($r('app.color.color_222222'))
  101 + .fontSize($r('app.float.font_size_13_2'))
  102 + .placeholderColor($r('app.color.color_CCCCCC'))
  103 + .placeholderFont({size:$r('app.float.font_size_13_2')})
100 .padding({bottom:96}) 104 .padding({bottom:96})
101 .backgroundColor($r('app.color.color_F5F5F5')) 105 .backgroundColor($r('app.color.color_F5F5F5'))
102 .align(Alignment.TopStart) 106 .align(Alignment.TopStart)
@@ -170,6 +174,8 @@ export struct FeedBackActivity { @@ -170,6 +174,8 @@ export struct FeedBackActivity {
170 .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_12'),left: $r('app.float.vp_12')}) 174 .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_12'),left: $r('app.float.vp_12')})
171 Text(this.textNumLabel) 175 Text(this.textNumLabel)
172 .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_11')}) 176 .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_11')})
  177 + .fontColor($r('app.color.color_999999'))
  178 + .fontSize($r('app.float.font_size_13_5'))
173 } 179 }
174 .height(200) 180 .height(200)
175 .width('94%') 181 .width('94%')
@@ -232,6 +238,7 @@ export struct FeedBackActivity { @@ -232,6 +238,7 @@ export struct FeedBackActivity {
232 } 238 }
233 }.margin({bottom:20}) 239 }.margin({bottom:20})
234 } 240 }
  241 + .backgroundColor($r('app.color.color_fff'))
235 } 242 }
236 243
237 /** 244 /**
@@ -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
@@ -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 }
@@ -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 })
@@ -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 })
@@ -21,6 +21,10 @@ @@ -21,6 +21,10 @@
21 "value": "13.2fp" 21 "value": "13.2fp"
22 }, 22 },
23 { 23 {
  24 + "name": "font_size_13_5",
  25 + "value": "13.5fp"
  26 + },
  27 + {
24 "name": "font_size_14", 28 "name": "font_size_14",
25 "value": "14fp" 29 "value": "14fp"
26 }, 30 },
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
@@ -78,14 +78,7 @@ export struct DetailPlayLiveCommon { @@ -78,14 +78,7 @@ export struct DetailPlayLiveCommon {
78 this.liveState = detailData.liveInfo?.liveState 78 this.liveState = detailData.liveInfo?.liveState
79 79
80 80
81 - if (this.liveState === 'wait' || this.liveLandscape === 'news') {  
82 - this.contentDetailData = data[0]  
83 - } else if (this.liveLandscape === 'general') {  
84 - //todo 不加setTimeOut ,接口返回的数据 就没法让PlayerComponent #@Consume @Watch('updateData') liveDetailsBean 的updateData方法运行  
85 - setTimeout(() => {  
86 this.contentDetailData = data[0] 81 this.contentDetailData = data[0]
87 - }, 10)  
88 - }  
89 82
90 console.log(TAG, '查询视频详情用于评论展示 openComment:', detailData.openComment) 83 console.log(TAG, '查询视频详情用于评论展示 openComment:', detailData.openComment)
91 this.publishCommentModel.targetId = String(detailData?.newsId || '') 84 this.publishCommentModel.targetId = String(detailData?.newsId || '')
@@ -106,7 +99,20 @@ export struct DetailPlayLiveCommon { @@ -106,7 +99,20 @@ export struct DetailPlayLiveCommon {
106 if (detailData.liveInfo.liveState == 'end') { 99 if (detailData.liveInfo.liveState == 'end') {
107 this.playUrl = detailData.liveInfo.vlive[0].replayUri 100 this.playUrl = detailData.liveInfo.vlive[0].replayUri
108 } 101 }
109 - //console.error('XXXXZZZZ', "liveLandscape =" + this.liveLandscape + ' this.liveState =' + this.liveState) 102 +
  103 + //人民号类型单独获取直播地址
  104 + if (detailData.rmhPlatform === 1) {
  105 +
  106 + let vliveId = detailData.liveInfo.vlive[0].vliveId as string
  107 + console.error(TAG, 'vliveId==' + vliveId)
  108 + this.liveViewModel.getLiveRoomPullAddress(vliveId)
  109 + .then((data: GetPullAddressBean) => {
  110 + console.log(TAG, ' GetPullAddressBean:', JSON.stringify(data))
  111 +
  112 + })
  113 +
  114 + }
  115 +
110 } 116 }
111 }) 117 })
112 } 118 }
1 -import { ContentDetailDTO, LiveDetailsBean, LiveRoomBean, LiveRoomDataBean, ValueType } from 'wdBean/Index' 1 +import { ContentDetailDTO,
  2 + GetPullAddressBean,
  3 + LiveDetailsBean, LiveRoomBean, LiveRoomDataBean, ValueType } from 'wdBean/Index'
  4 +import { ContentDetailRequest } from 'wdDetailPlayApi/Index'
2 5
3 import { ResponseDTO } from 'wdNetwork/Index' 6 import { ResponseDTO } from 'wdNetwork/Index'
4 import { LiveModel } from './LiveModel' 7 import { LiveModel } from './LiveModel'
@@ -24,6 +27,28 @@ export class LiveViewModel { @@ -24,6 +27,28 @@ export class LiveViewModel {
24 27
25 } 28 }
26 29
  30 + getLiveRoomPullAddress(vliveId:string){
  31 + // return new Promise<GetPullAddressBean>((success, fail) => {
  32 + // this.liveModel.getContentDetail(contentId, relId, relType).then((data) => {
  33 + // success(data)
  34 + // }).catch((message: string) => {
  35 + // fail(message)
  36 + // })
  37 + // })
  38 +
  39 + return new Promise<GetPullAddressBean>((success, fail) => {
  40 + ContentDetailRequest.getLiveRoomPullStream(vliveId).then(async (resDTO: ResponseDTO<GetPullAddressBean>) => {
  41 + console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
  42 + if (resDTO.data) {
  43 + success(resDTO.data)
  44 + }
  45 + }).catch(() => {
  46 + fail("数据为空")
  47 + })
  48 +
  49 + })
  50 +
  51 + }
27 52
28 //直播详情 53 //直播详情
29 getLiveDetails(contentId: string, relId: string, relType: string) { 54 getLiveDetails(contentId: string, relId: string, relType: string) {
@@ -52,7 +52,6 @@ export struct TopPlayComponent { @@ -52,7 +52,6 @@ export struct TopPlayComponent {
52 } else if (status === PlayerConstants.STATUS_COMPLETION) { 52 } else if (status === PlayerConstants.STATUS_COMPLETION) {
53 // 播放完成 53 // 播放完成
54 54
55 -  
56 } else { 55 } else {
57 this.isError = false 56 this.isError = false
58 } 57 }
@@ -28,7 +28,10 @@ export struct PlayerComponent { @@ -28,7 +28,10 @@ export struct PlayerComponent {
28 this.playerController?.pause() 28 this.playerController?.pause()
29 } 29 }
30 30
31 - aboutToAppear(): void { 31 + async aboutToAppear(): Promise<void> {
  32 + setTimeout(() => {
  33 + this.updateData()
  34 + }, 10)
32 } 35 }
33 36
34 async aboutToDisappear(): Promise<void> { 37 async aboutToDisappear(): Promise<void> {
@@ -36,6 +39,7 @@ export struct PlayerComponent { @@ -36,6 +39,7 @@ export struct PlayerComponent {
36 await this.playerController?.pause() 39 await this.playerController?.pause()
37 await this.playerController?.stop() 40 await this.playerController?.stop()
38 await this.playerController?.release() 41 await this.playerController?.release()
  42 +
39 } 43 }
40 44
41 updateData() { 45 updateData() {
@@ -58,6 +62,7 @@ export struct PlayerComponent { @@ -58,6 +62,7 @@ export struct PlayerComponent {
58 this.liveStreamType = liveStreamType 62 this.liveStreamType = liveStreamType
59 this.playUrl = playUrl 63 this.playUrl = playUrl
60 } 64 }
  65 + console.error("XXXXZZZZ", 'updateData ----liveState==>' + this.playUrl)
61 } 66 }
62 67
63 build() { 68 build() {
@@ -69,6 +74,7 @@ export struct PlayerComponent { @@ -69,6 +74,7 @@ export struct PlayerComponent {
69 playerController: this.playerController, 74 playerController: this.playerController,
70 onLoad: () => { 75 onLoad: () => {
71 this.isCanplay = true 76 this.isCanplay = true
  77 + console.error("XXXXZZZZ", '------2------------')
72 this.playerController?.firstPlay(this.playUrl); 78 this.playerController?.firstPlay(this.playUrl);
73 } 79 }
74 }) 80 })
@@ -77,7 +83,7 @@ export struct PlayerComponent { @@ -77,7 +83,7 @@ export struct PlayerComponent {
77 playerController: this.playerController, 83 playerController: this.playerController,
78 onLoad: () => { 84 onLoad: () => {
79 this.isCanplay = true 85 this.isCanplay = true
80 - console.error('WDAliPlayerController', '------1------------') 86 + console.error('XXXXZZZZ', '------1------------')
81 this.playerController?.firstPlay(this.playUrl); 87 this.playerController?.firstPlay(this.playUrl);
82 } 88 }
83 }).margin({ top: 195 }).height(211) 89 }).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,10 @@ export class WDAliPlayerController { @@ -256,6 +266,10 @@ export class WDAliPlayerController {
256 } 266 }
257 267
258 async firstPlay(url: string) { 268 async firstPlay(url: string) {
  269 + if (StringUtils.isEmpty(url)) {
  270 + return
  271 + }
  272 +
259 this.url = url; 273 this.url = url;
260 if (this.avPlayer == null) { 274 if (this.avPlayer == null) {
261 Logger.info(TAG, "等待播放器初始化") 275 Logger.info(TAG, "等待播放器初始化")
@@ -278,7 +292,7 @@ export class WDAliPlayerController { @@ -278,7 +292,7 @@ export class WDAliPlayerController {
278 292
279 this.avPlayer?.setAutoPlay(false) 293 this.avPlayer?.setAutoPlay(false)
280 294
281 - Logger.debug(TAG, "开始播放", this.url) 295 + Logger.debug(TAG, "开始播放:"+ this.url)
282 this.setAliPlayerURL(this.url); 296 this.setAliPlayerURL(this.url);
283 297
284 Logger.info(TAG, "设置SurfaceId: " + this.surfaceId) 298 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,12 @@ struct LaunchAdvertisingPage { @@ -99,11 +94,12 @@ 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.screenType != '2'){
103 //底部logo样式 按钮加载在背景展示图上 99 //底部logo样式 按钮加载在背景展示图上
104 Button(){ 100 Button(){
105 Row(){ 101 Row(){
106 - Text('点击跳转至详情或第三方应用') 102 + Text('点击跳转至详情')
107 .fontSize('31lpx') 103 .fontSize('31lpx')
108 .fontColor(Color.White) 104 .fontColor(Color.White)
109 .margin({ 105 .margin({
@@ -126,17 +122,16 @@ struct LaunchAdvertisingPage { @@ -126,17 +122,16 @@ struct LaunchAdvertisingPage {
126 }) 122 })
127 } 123 }
128 } 124 }
129 -  
130 } 125 }
131 .width('100%') 126 .width('100%')
132 .height('84%') 127 .height('84%')
133 .margin({top:'0'}) 128 .margin({top:'0'})
134 129
135 - if(this.model.launchAdInfo.length && this.model.launchAdInfo[0].matInfo.startStyle == 1){ 130 + if(this.defaultModel.screenType === '2'){
136 //全屏样式,底部无logo 按钮放在原底部logo位置 131 //全屏样式,底部无logo 按钮放在原底部logo位置
137 Button(){ 132 Button(){
138 Row(){ 133 Row(){
139 - Text('点击跳转至详情或第三方应用') 134 + Text('点击跳转至详情')
140 .fontSize('31lpx') 135 .fontSize('31lpx')
141 .fontColor(Color.White) 136 .fontColor(Color.White)
142 .margin({ 137 .margin({
@@ -164,8 +159,8 @@ struct LaunchAdvertisingPage { @@ -164,8 +159,8 @@ struct LaunchAdvertisingPage {
164 .height('154lpx') 159 .height('154lpx')
165 .margin({top: '28lpx'}) 160 .margin({top: '28lpx'})
166 } 161 }
167 -  
168 } 162 }
  163 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
169 .width('100%') 164 .width('100%')
170 .height('100%') 165 .height('100%')
171 .backgroundColor(Color.White) 166 .backgroundColor(Color.White)
@@ -179,25 +174,59 @@ struct LaunchAdvertisingPage { @@ -179,25 +174,59 @@ struct LaunchAdvertisingPage {
179 ///埋点 174 ///埋点
180 this.trackingLaunchClick() 175 this.trackingLaunchClick()
181 176
182 - if(this.model.launchAdInfo.length){  
183 - if (this.model.launchAdInfo[0].matInfo.openType == '2') { 177 + if(this.defaultModel.linkUrl.length > 0){
  178 + if (this.defaultModel.objectType == '2') {
184 //端外打开 179 //端外打开
185 - ProcessUtils.jumpExternalWebPage(this.model.launchAdInfo[0].matInfo.linkUrl)  
186 - //clearInterval(this.timer) 180 + ProcessUtils.jumpExternalWebPage(this.defaultModel.linkUrl)
187 }else { 181 }else {
188 //端内打开 182 //端内打开
189 - ProcessUtils.gotoDefaultWebPage(this.model.launchAdInfo[0].matInfo.linkUrl)  
190 - //clearInterval(this.timer)  
191 -  
192 - } 183 + ProcessUtils.gotoDefaultWebPage(this.defaultModel.linkUrl)
  184 + }
  185 + }else if(this.defaultModel.objectId.length > 0){
  186 + let contentDTO :ContentDTO = new ContentDTO();
  187 + contentDTO.objectType = this.defaultModel.objectType
  188 + contentDTO.objectId = this.defaultModel.objectId
  189 + ProcessUtils.processPage(contentDTO)
  190 + }
  191 + }
  192 +
  193 + rebaseDefaultModel(dataModel : LaunchDataModel){
  194 + if (dataModel.launchPageInfo){
  195 + this.defaultModel.ID = dataModel.launchPageInfo.ID
  196 + this.defaultModel.screenName = dataModel.launchPageInfo.screenName
  197 + this.defaultModel.objectType = dataModel.launchPageInfo.objectType
  198 + this.defaultModel.objectId = dataModel.launchPageInfo.objectId
  199 + this.defaultModel.objectLevel = dataModel.launchPageInfo.objectLevel
  200 + this.defaultModel.pageId = dataModel.launchPageInfo.pageId
  201 + this.defaultModel.durations = dataModel.launchPageInfo.durations
  202 + this.defaultModel.linkUrl = dataModel.launchPageInfo.linkUrl
  203 + this.defaultModel.screenType = dataModel.launchPageInfo.screenType
  204 + this.defaultModel.bootScreenUrl = dataModel.launchPageInfo.bootScreenUrl
  205 + this.defaultModel.bootVideoUrl = dataModel.launchPageInfo.bootScreenUrl
  206 + this.defaultModel.bootVideoScreenUrl = dataModel.launchPageInfo.bootVideoScreenUrl
  207 + this.defaultModel.showType = dataModel.launchPageInfo.showType
  208 + this.defaultModel.isAd = dataModel.launchPageInfo.isAd
  209 + this.defaultModel.bottomNavId = dataModel.launchPageInfo.bottomNavId
  210 + this.defaultModel.relId = dataModel.launchPageInfo.relId
  211 + this.defaultModel.openType = '1'
  212 + }else if (dataModel.launchAdInfo.length > 0){
  213 + this.defaultModel.ID = dataModel.launchAdInfo[0].ID
  214 + this.defaultModel.screenName = dataModel.launchAdInfo[0].matInfo.advTitle
  215 + this.defaultModel.durations = dataModel.launchAdInfo[0].displayDuration
  216 + this.defaultModel.linkUrl = dataModel.launchAdInfo[0].matInfo.linkUrl
  217 + this.defaultModel.screenType = dataModel.launchAdInfo[0].matInfo.startStyle
  218 + this.defaultModel.bootScreenUrl = dataModel.launchAdInfo[0].matInfo.matImageUrl[0]
  219 + this.defaultModel.bootVideoUrl = dataModel.launchAdInfo[0].matInfo.matVideoUrl
  220 + this.defaultModel.showType = dataModel.launchAdInfo[0].matInfo.matType
  221 + this.defaultModel.isAd = '1'
193 } 222 }
194 } 223 }
195 224
196 contentTrackingDict(){ 225 contentTrackingDict(){
197 this.pageParam = { 226 this.pageParam = {
198 - 'adType':'0',  
199 - 'adId':this.model.launchAdInfo[0]?.matInfo.id.toString(),  
200 - 'adName':this.model.launchAdInfo[0]?.matInfo.advTitle, 227 + 'adType':this.defaultModel.showType,
  228 + 'adId':this.defaultModel.ID,
  229 + 'adName':this.defaultModel.screenName,
201 'regionName':'0' 230 'regionName':'0'
202 } 231 }
203 } 232 }
@@ -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
@@ -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 }