张善主

Merge remote-tracking branch 'origin/main'

Showing 44 changed files with 542 additions and 302 deletions
@@ -511,7 +511,12 @@ export class HttpUrlUtils { @@ -511,7 +511,12 @@ export class HttpUrlUtils {
511 } 511 }
512 512
513 static getVerifyCodeByTokenUrl() { 513 static getVerifyCodeByTokenUrl() {
514 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/auth/zh/c/sendVerifyCodeByToken"; 514 + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/sendVerifyCodeByToken";
  515 + return url;
  516 + }
  517 +
  518 + static getCheckVerifyCodeByToken() {
  519 + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/checkVerifyCodeByToken";
515 return url; 520 return url;
516 } 521 }
517 522
@@ -6,6 +6,8 @@ import { WDRouterRule } from '../router/WDRouterRule'; @@ -6,6 +6,8 @@ import { WDRouterRule } from '../router/WDRouterRule';
6 import { ContentConstants } from 'wdConstant'; 6 import { ContentConstants } from 'wdConstant';
7 import { common, Want } from '@kit.AbilityKit'; 7 import { common, Want } from '@kit.AbilityKit';
8 import { BusinessError } from '@kit.BasicServicesKit'; 8 import { BusinessError } from '@kit.BasicServicesKit';
  9 +import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean';
  10 +import { AdvertsBean } from 'wdBean/src/main/ets/bean/adv/AdvertsBean';
9 11
10 // import { LiveModel } from '../viewmodel/LiveModel'; 12 // import { LiveModel } from '../viewmodel/LiveModel';
11 13
@@ -16,6 +18,65 @@ const TAG = 'ProcessUtils'; @@ -16,6 +18,65 @@ const TAG = 'ProcessUtils';
16 */ 18 */
17 export class ProcessUtils { 19 export class ProcessUtils {
18 /** 20 /**
  21 + * 广告中心的业务广告跳转方法( 现用在挂角广告)
  22 + * @param advContent
  23 + */
  24 + static openAdvDetail(matInfo: CompAdvMatInfoBean) {
  25 +
  26 + if (matInfo == null) {
  27 + return;
  28 + }
  29 +
  30 + // 优先openType,再取linkType
  31 + let type: string;
  32 + if (!StringUtils.isEmpty(matInfo.openType)) {
  33 + type = matInfo.openType;
  34 + } else {
  35 + type = matInfo.linkType;
  36 + }
  37 +
  38 + if ('0' == type) {
  39 + // 0 :无链接
  40 + return;
  41 + }
  42 +
  43 + let linkUrl: string = matInfo.linkUrl;
  44 + if (StringUtils.isEmpty(linkUrl)) {
  45 + return;
  46 + }
  47 +
  48 + if ('1' == type) {
  49 + // 内链
  50 + let content: ContentDTO = {} as ContentDTO;
  51 + content.linkUrl = linkUrl;
  52 + ProcessUtils.gotoWeb(content);
  53 + } else if ('2' == type) {
  54 + // 外链
  55 + ProcessUtils.jumpExternalWebPage(linkUrl);
  56 + }
  57 +
  58 + }
  59 +
  60 +
  61 + /**
  62 + * 展现中心的广告跳转 ( 现用在挂角广告)
  63 + * @param advert 展现中心的展现广告
  64 + */
  65 + static advJumpMainPage(advert: AdvertsBean) {
  66 +
  67 + let content: ContentDTO = {
  68 + linkUrl: advert.linkUrl,
  69 + pageId: advert.pageId,
  70 + objectId: advert.objectId,
  71 + objectType: advert.objectType,
  72 + relId: advert.relId,
  73 + bottomNavId: advert.bottomNavId
  74 + } as ContentDTO;
  75 +
  76 + ProcessUtils.processPage(content);
  77 + }
  78 +
  79 + /**
19 * 页面跳转 80 * 页面跳转
20 */ 81 */
21 static processPage(content: ContentDTO) { 82 static processPage(content: ContentDTO) {
@@ -97,7 +158,7 @@ export class ProcessUtils { @@ -97,7 +158,7 @@ export class ProcessUtils {
97 * 图集详情页 158 * 图集详情页
98 * @param content 159 * @param content
99 * */ 160 * */
100 - public static gotoMultiPictureListPage(photoList: PhotoListBean[]) { 161 + public static gotoMultiPictureListPage(photoList: PhotoListBean[]) {
101 let taskAction: Action = { 162 let taskAction: Action = {
102 type: 'JUMP_DETAIL_PAGE', 163 type: 'JUMP_DETAIL_PAGE',
103 params: { 164 params: {
@@ -95,4 +95,8 @@ export interface CompAdvBean { @@ -95,4 +95,8 @@ export interface CompAdvBean {
95 * 下一轮展示继续上面逻辑。 95 * 下一轮展示继续上面逻辑。
96 */ 96 */
97 displayRound: number; 97 displayRound: number;
  98 +
  99 +
  100 +
  101 +
98 } 102 }
@@ -78,4 +78,6 @@ export interface ContentDTO { @@ -78,4 +78,6 @@ export interface ContentDTO {
78 titleShow?: number; 78 titleShow?: number;
79 isSearch?: boolean; // 是否是搜索的结果,区分搜索和主页的数据 79 isSearch?: boolean; // 是否是搜索的结果,区分搜索和主页的数据
80 commentInfo?: commentInfo 80 commentInfo?: commentInfo
  81 + //底部导航栏 id(用于频道跳转)
  82 + bottomNavId:string;
81 } 83 }
1 -import {  
2 - NetworkUtil,  
3 - Logger,  
4 - NetworkType,  
5 - SPHelper,  
6 -} from 'wdKit'; 1 +import { NetworkUtil, Logger, NetworkType, SPHelper, } from 'wdKit';
7 import { ResponseDTO } from 'wdNetwork'; 2 import { ResponseDTO } from 'wdNetwork';
8 import { 3 import {
9 ContentDetailDTO, 4 ContentDetailDTO,
@@ -68,7 +63,7 @@ export struct MultiPictureDetailPageComponent { @@ -68,7 +63,7 @@ export struct MultiPictureDetailPageComponent {
68 }) 63 })
69 // 注册监听网络连接 64 // 注册监听网络连接
70 let netStatus = NetworkUtil.isNetConnected() 65 let netStatus = NetworkUtil.isNetConnected()
71 - if(netStatus) { 66 + if (netStatus) {
72 // 有网络 67 // 有网络
73 this.getContentDetailData() 68 this.getContentDetailData()
74 } else { 69 } else {
@@ -270,8 +265,12 @@ export struct MultiPictureDetailPageComponent { @@ -270,8 +265,12 @@ export struct MultiPictureDetailPageComponent {
270 .height(px2vp(this.titleHeight) + 64) 265 .height(px2vp(this.titleHeight) + 64)
271 266
272 } 267 }
273 - if(this.netStatus !== undefined) {  
274 - EmptyComponent({ emptyType: $netStatus, emptyButton:true, retry: () => {this.getContentDetailData()}}) 268 + if (this.netStatus !== undefined) {
  269 + EmptyComponent({
  270 + emptyType: this.netStatus, emptyButton: true, retry: () => {
  271 + this.getContentDetailData()
  272 + }
  273 + })
275 .id('e_empty_content') 274 .id('e_empty_content')
276 .alignRules({ 275 .alignRules({
277 center: { anchor: "__container__", align: VerticalAlign.Center }, 276 center: { anchor: "__container__", align: VerticalAlign.Center },
@@ -307,35 +306,37 @@ export struct MultiPictureDetailPageComponent { @@ -307,35 +306,37 @@ export struct MultiPictureDetailPageComponent {
307 306
308 getContentDetailData() { 307 getContentDetailData() {
309 try { 308 try {
310 - PageRepository.fetchDetailData(this.relId, this.contentId, this.relType).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {  
311 - if (!resDTO || !resDTO.data) {  
312 - Logger.error(TAG, 'fetchDetailData is empty');  
313 - return  
314 - }  
315 - if (resDTO.code != 0) {  
316 - Logger.error(TAG, `fetchDetailData then code:${resDTO.code}, message:${resDTO.message}`);  
317 - return  
318 - }  
319 - this.netStatus = undefined  
320 - this.contentDetailData = resDTO.data?.[0];  
321 - // this.contentDetailData.photoList = []  
322 - if(this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) {  
323 - // 暂无内容  
324 - this.netStatus = 0  
325 - Logger.info(TAG, `this.netStatus:${JSON.stringify(this.netStatus)}`)  
326 - }  
327 - Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`)  
328 - // 未登录,跳转登录  
329 - const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')  
330 - if (user_id) {  
331 - this.getInteractBrowsOperate()  
332 - this.getBatchAttentionStatus()  
333 - }  
334 - }).catch((err: Error) => {  
335 - Logger.info(TAG, `fetchDetailData then,err: ${JSON.stringify(err)}`);  
336 - // 内容获取失败  
337 - this.netStatus = 9  
338 - }) 309 + PageRepository.fetchDetailData(this.relId, this.contentId, this.relType)
  310 + .then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
  311 + if (!resDTO || !resDTO.data) {
  312 + Logger.error(TAG, 'fetchDetailData is empty');
  313 + return
  314 + }
  315 + if (resDTO.code != 0) {
  316 + Logger.error(TAG, `fetchDetailData then code:${resDTO.code}, message:${resDTO.message}`);
  317 + return
  318 + }
  319 + this.netStatus = undefined
  320 + this.contentDetailData = resDTO.data?.[0];
  321 + // this.contentDetailData.photoList = []
  322 + if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) {
  323 + // 暂无内容
  324 + this.netStatus = 0
  325 + Logger.info(TAG, `this.netStatus:${JSON.stringify(this.netStatus)}`)
  326 + }
  327 + Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`)
  328 + // 未登录,跳转登录
  329 + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
  330 + if (user_id) {
  331 + this.getInteractBrowsOperate()
  332 + this.getBatchAttentionStatus()
  333 + }
  334 + })
  335 + .catch((err: Error) => {
  336 + Logger.info(TAG, `fetchDetailData then,err: ${JSON.stringify(err)}`);
  337 + // 内容获取失败
  338 + this.netStatus = 9
  339 + })
339 } catch (exception) { 340 } catch (exception) {
340 341
341 } 342 }
@@ -27,6 +27,7 @@ const TAG = 'Zh_Single_Row-06' @@ -27,6 +27,7 @@ const TAG = 'Zh_Single_Row-06'
27 // operDataList: Array<operDataListItem> 27 // operDataList: Array<operDataListItem>
28 // } 28 // }
29 29
  30 +@Entry
30 @Component 31 @Component
31 export struct ZhSingleRow06 { 32 export struct ZhSingleRow06 {
32 @State compDTO: CompDTO = {} as CompDTO 33 @State compDTO: CompDTO = {} as CompDTO
@@ -44,9 +45,12 @@ export struct ZhSingleRow06 { @@ -44,9 +45,12 @@ export struct ZhSingleRow06 {
44 .textOverflow({overflow: TextOverflow.Ellipsis}) 45 .textOverflow({overflow: TextOverflow.Ellipsis})
45 .lineHeight(23) 46 .lineHeight(23)
46 .fontSize(16) 47 .fontSize(16)
47 - .margin({bottom: 19}) 48 + .margin({bottom: 10})
  49 + .padding({bottom: 10})
48 .textAlign(TextAlign.Start) 50 .textAlign(TextAlign.Start)
49 .width('100%') 51 .width('100%')
  52 + .border({width: {bottom: 1}})
  53 + .borderColor(0xf4f4f4)
50 54
51 55
52 Row() { 56 Row() {
@@ -98,8 +102,6 @@ export struct ZhSingleRow06 { @@ -98,8 +102,6 @@ export struct ZhSingleRow06 {
98 bottom: $r('app.float.card_comp_pagePadding_tb') 102 bottom: $r('app.float.card_comp_pagePadding_tb')
99 }) 103 })
100 .backgroundColor($r('app.color.white')) 104 .backgroundColor($r('app.color.white'))
101 - .margin({ bottom: 8 })  
102 - .height(251)  
103 } 105 }
104 106
105 @Builder 107 @Builder
@@ -14,6 +14,7 @@ import { CompParser } from '../CompParser'; @@ -14,6 +14,7 @@ import { CompParser } from '../CompParser';
14 import { CompDTO } from 'wdBean'; 14 import { CompDTO } from 'wdBean';
15 import PageHelper from '../../viewmodel/PageHelper'; 15 import PageHelper from '../../viewmodel/PageHelper';
16 import { channelSkeleton } from '../skeleton/channelSkeleton' 16 import { channelSkeleton } from '../skeleton/channelSkeleton'
  17 +import { ProcessUtils } from 'wdRouter/Index';
17 18
18 const TAG = 'PageComponent'; 19 const TAG = 'PageComponent';
19 20
@@ -119,29 +120,71 @@ export struct PageComponent { @@ -119,29 +120,71 @@ export struct PageComponent {
119 @Builder 120 @Builder
120 pageHornAd() { 121 pageHornAd() {
121 122
  123 + if (this.pageModel.isShowAds) {
  124 + if (this.pageModel.pageCornerAdv.matInfo != null) {
  125 + // 页面右边挂角
  126 + this.drawPageCornerAdvView(1, 1 == this.pageModel.isRightAdv)
  127 + } else if (this.pageModel.pageCornerContentInfo.advert != null) {
  128 + this.drawPageCornerAdvView(2, 1 == this.pageModel.isRightAdv)
  129 + }
  130 + }
122 131
123 - if (this.pageModel.pageLeftCornerAdv.matInfo != null) {  
124 - 132 + }
125 133
126 - // 页面左挂角  
127 - Image(this.pageModel.pageLeftCornerAdv.matInfo.matImageUrl[0])  
128 - .width($r('app.float.vp_80'))  
129 - .height($r('app.float.vp_80'))  
130 - .id("left_iv")  
131 - .alignRules({  
132 - bottom: { anchor: '__container__', align: VerticalAlign.Bottom },  
133 - left: { anchor: '__container__', align: HorizontalAlign.Start },  
134 - })  
135 - .margin({ bottom: "65vp", left: $r('app.float.card_comp_pagePadding_lf') }) 134 + /**
  135 + * 绘制页面挂角
  136 + *
  137 + * @param type 1:广告中心的挂角广告;2:展现中心的挂角广告
  138 + * @param isRightCorne true:右挂角;false:左挂角
  139 + */
  140 + @Builder
  141 + drawPageCornerAdvView(type: number, isRightCorne: boolean) {
  142 + // 页面左挂角
  143 + Image(type === 1 ? this.pageModel.pageCornerAdv.matInfo.matImageUrl[0]
  144 + : this.pageModel.pageCornerContentInfo.advert.displayUrl)
  145 + .width($r('app.float.vp_80'))
  146 + .height($r('app.float.vp_80'))
  147 + .id("left_iv")
  148 + .alignRules({
  149 + bottom: { anchor: '__container__', align: VerticalAlign.Bottom },
  150 + left: { anchor: isRightCorne ? "" : '__container__', align: HorizontalAlign.Start },
  151 + right: { anchor: isRightCorne ? '__container__' : "", align: HorizontalAlign.End },
  152 + })
  153 + .margin({
  154 + bottom: "65vp",
  155 + left: isRightCorne ? 0 : $r('app.float.card_comp_pagePadding_lf'),
  156 + right: isRightCorne ? $r('app.float.card_comp_pagePadding_lf') : 0,
136 157
137 - Image($r('app.media.icon_adv_horn_close')).id('left_close').width($r('app.float.vp_16')).alignRules({ 158 + })
  159 + .onClick(() => {
  160 + if (type === 1) {
  161 + // 广告业务跳转
  162 + ProcessUtils.openAdvDetail(this.pageModel.pageCornerAdv.matInfo);
  163 + } else {
  164 + // 展现中心的业务跳转
  165 + ProcessUtils.advJumpMainPage(this.pageModel.pageCornerContentInfo.advert)
  166 + }
  167 + })
  168 + // 关闭按钮
  169 + Image($r('app.media.icon_adv_horn_close'))
  170 + .id('left_close')
  171 + .width($r('app.float.vp_16'))
  172 + .alignRules({
138 top: { anchor: 'left_iv', align: VerticalAlign.Top }, 173 top: { anchor: 'left_iv', align: VerticalAlign.Top },
139 - left: { anchor: 'left_iv', align: HorizontalAlign.Start },  
140 - }).offset({  
141 - x: -10,  
142 - y: -10 174 + left: { anchor: isRightCorne ? '' : 'left_iv', align: HorizontalAlign.Start },
  175 + right: { anchor: isRightCorne ? 'left_iv' : '', align: HorizontalAlign.End },
  176 + })
  177 + .offset({
  178 + x: isRightCorne ? 10 : -10,
  179 + y: isRightCorne ? -10 : -10
143 }) 180 })
  181 + .onClick(() => {
  182 + // 关闭挂角广告
  183 + this.pageModel.isShowAds = false;
144 184
  185 + })
  186 +
  187 + if (type == 1) {
145 Text($r('app.string.comp_advertisement')) 188 Text($r('app.string.comp_advertisement'))
146 .width($r('app.float.vp_28')) 189 .width($r('app.float.vp_28'))
147 .height($r('app.float.vp_16')) 190 .height($r('app.float.vp_16'))
@@ -150,7 +193,8 @@ export struct PageComponent { @@ -150,7 +193,8 @@ export struct PageComponent {
150 .id('left_tag') 193 .id('left_tag')
151 .alignRules({ 194 .alignRules({
152 bottom: { anchor: 'left_iv', align: VerticalAlign.Bottom }, 195 bottom: { anchor: 'left_iv', align: VerticalAlign.Bottom },
153 - left: { anchor: 'left_iv', align: HorizontalAlign.Start }, 196 + left: { anchor: isRightCorne ? '' : 'left_iv', align: HorizontalAlign.Start },
  197 + right: { anchor: isRightCorne ? 'left_iv' : '', align: HorizontalAlign.End },
154 }) 198 })
155 .textAlign(TextAlign.Center) 199 .textAlign(TextAlign.Center)
156 .backgroundColor($r('app.color.res_color_general_000000_30')) 200 .backgroundColor($r('app.color.res_color_general_000000_30'))
@@ -162,60 +206,6 @@ export struct PageComponent { @@ -162,60 +206,6 @@ export struct PageComponent {
162 }) 206 })
163 } 207 }
164 208
165 - if (this.pageModel.pageRightCornerAdv.matInfo != null && this.pageModel.isShowRightAds) {  
166 - // 页面右边挂角  
167 - Image(this.pageModel.pageRightCornerAdv.matInfo.matImageUrl[0])  
168 - .width($r('app.float.vp_80'))  
169 - .height($r('app.float.vp_80'))  
170 - .id("right_iv")  
171 - .alignRules({  
172 - bottom: { anchor: '__container__', align: VerticalAlign.Bottom },  
173 - right: { anchor: '__container__', align: HorizontalAlign.End },  
174 - })  
175 - .margin({ bottom: "65vp", right: $r('app.float.card_comp_pagePadding_lf') })  
176 - .onClick(()=>{  
177 -  
178 - // 关闭挂角广告  
179 - this.pageModel.isShowLeftAds = false;  
180 -  
181 - })  
182 -  
183 - Image($r('app.media.icon_adv_horn_close'))  
184 - .id('right_close')  
185 - .width($r('app.float.vp_16'))  
186 - .alignRules({  
187 - top: { anchor: 'right_iv', align: VerticalAlign.Top },  
188 - right: { anchor: 'right_iv', align: HorizontalAlign.End },  
189 - })  
190 - .offset({  
191 - x: 10,  
192 - y: -10  
193 - })  
194 - .onClick(() => {  
195 - // 关闭挂角广告  
196 - this.pageModel.isShowRightAds = false;  
197 -  
198 - })  
199 -  
200 - Text($r('app.string.comp_advertisement'))  
201 - .width($r('app.float.vp_28'))  
202 - .height($r('app.float.vp_16'))  
203 - .fontSize($r('app.float.font_size_10'))  
204 - .fontColor(Color.White)  
205 - .id('right_tag')  
206 - .alignRules({  
207 - bottom: { anchor: 'right_iv', align: VerticalAlign.Bottom },  
208 - right: { anchor: 'right_iv', align: HorizontalAlign.End },  
209 - })  
210 - .textAlign(TextAlign.Center)  
211 - .backgroundColor($r('app.color.res_color_general_000000_30'))  
212 - .borderRadius({  
213 - topLeft: $r('app.float.vp_2'),  
214 - topRight: $r('app.float.vp_2'),  
215 - bottomLeft: $r('app.float.vp_2'),  
216 - bottomRight: $r('app.float.vp_2')  
217 - })  
218 - }  
219 } 209 }
220 210
221 async aboutToAppear() { 211 async aboutToAppear() {
@@ -192,7 +192,8 @@ export struct SearchResultContentComponent{ @@ -192,7 +192,8 @@ export struct SearchResultContentComponent{
192 rmhPlatform: 0, 192 rmhPlatform: 0,
193 newTags: '', 193 newTags: '',
194 isSearch: true, 194 isSearch: true,
195 - publishTimestamp:"" 195 + publishTimestamp:"",
  196 + bottomNavId:'',
196 } 197 }
197 198
198 this.data.push(contentDTO) 199 this.data.push(contentDTO)
@@ -3,6 +3,8 @@ import { EmptyComponent } from '../view/EmptyComponent' @@ -3,6 +3,8 @@ import { EmptyComponent } from '../view/EmptyComponent'
3 @Entry 3 @Entry
4 @Component 4 @Component
5 export struct DefaultPage { 5 export struct DefaultPage {
  6 + @State type: number = 1
  7 +
6 retry() { 8 retry() {
7 console.log('daj点击了重试') 9 console.log('daj点击了重试')
8 } 10 }
@@ -10,10 +12,14 @@ export struct DefaultPage { @@ -10,10 +12,14 @@ export struct DefaultPage {
10 build() { 12 build() {
11 Row() { 13 Row() {
12 EmptyComponent({ 14 EmptyComponent({
13 - emptyType: 8, emptyButton: true, retry: () => { 15 + emptyType: this.type,
  16 + emptyButton: true,
  17 + retry: () => {
14 this.retry() 18 this.retry()
15 } 19 }
16 }) 20 })
  21 + // .height('612lpx')
  22 + // .width('100%')
17 } 23 }
18 } 24 }
19 } 25 }
@@ -7,39 +7,39 @@ const TAG = 'EmptyComponent'; @@ -7,39 +7,39 @@ const TAG = 'EmptyComponent';
7 * WDViewDefaultType 缺省页 7 * WDViewDefaultType 缺省页
8 */ 8 */
9 export const enum WDViewDefaultType { 9 export const enum WDViewDefaultType {
10 - /// 1.默认 10 + /// 0.默认
11 WDViewDefaultType_Default, 11 WDViewDefaultType_Default,
12 - /// 2.无网 12 + /// 1.无网
13 WDViewDefaultType_NoNetwork, 13 WDViewDefaultType_NoNetwork,
14 - /// 3.暂无内容(列表页) 14 + /// 2.暂无内容(列表页)
15 WDViewDefaultType_NoListContent, 15 WDViewDefaultType_NoListContent,
16 - /// 4.内容找不到了(内容详情页) 16 + /// 3.内容找不到了(内容详情页)
17 WDViewDefaultType_NoContent, 17 WDViewDefaultType_NoContent,
18 - /// 5.无搜索内容 18 + /// 4.无搜索内容
19 WDViewDefaultType_NoSearchResult, 19 WDViewDefaultType_NoSearchResult,
20 - /// 6.无消息内容 20 + /// 5.无消息内容
21 WDViewDefaultType_NoMessage, 21 WDViewDefaultType_NoMessage,
22 - /// 7.无收藏内容 22 + /// 6.无收藏内容
23 WDViewDefaultType_NoCollection, 23 WDViewDefaultType_NoCollection,
24 - /// 8.无历史记录 24 + /// 7.无历史记录
25 WDViewDefaultType_NoHistory, 25 WDViewDefaultType_NoHistory,
26 - /// 9.网络失败 请稍后重试-倒计时 26 + /// 8.网络失败 请稍后重试-倒计时
27 WDViewDefaultType_NetworkFailed, 27 WDViewDefaultType_NetworkFailed,
28 - /// 10.内容获取失败 28 + /// 9.内容获取失败
29 WDViewDefaultType_ContentFailed, 29 WDViewDefaultType_ContentFailed,
30 - /// 11.无预约内容 30 + /// 10.无预约内容
31 WDViewDefaultType_NoBooking, 31 WDViewDefaultType_NoBooking,
32 - /// 12.无评论内容 32 + /// 11.无评论内容
33 WDViewDefaultType_NoComment, 33 WDViewDefaultType_NoComment,
34 - /// 13.暂无作品 34 + /// 12.暂无作品
35 WDViewDefaultType_NoCreation, 35 WDViewDefaultType_NoCreation,
36 - /// 14.该号主无法访问 36 + /// 13.该号主无法访问
37 WDViewDefaultType_NoVisitAccount, 37 WDViewDefaultType_NoVisitAccount,
38 - /// 15.暂无关注 38 + /// 14.暂无关注
39 WDViewDefaultType_NoFollow, 39 WDViewDefaultType_NoFollow,
40 - /// 18.视频加载失败 40 + /// 15.视频图集加载失败
41 WDViewDefaultType_NoVideo, 41 WDViewDefaultType_NoVideo,
42 - /// 19.暂无内容1 42 + /// 16.暂无内容1
43 WDViewDefaultType_NoContent1, 43 WDViewDefaultType_NoContent1,
44 } 44 }
45 45
@@ -52,7 +52,7 @@ export struct EmptyComponent { @@ -52,7 +52,7 @@ export struct EmptyComponent {
52 // private emptySize: SizeOptions = {}; 52 // private emptySize: SizeOptions = {};
53 @State emptyWidth: string | number = CommonConstants.FULL_PARENT; 53 @State emptyWidth: string | number = CommonConstants.FULL_PARENT;
54 @State emptyHeight: string | number = CommonConstants.FULL_PARENT; 54 @State emptyHeight: string | number = CommonConstants.FULL_PARENT;
55 - @Link emptyType: number 55 + @State emptyType: number = WDViewDefaultType.WDViewDefaultType_Default; // 缺省图类型,传枚举
56 @State emptyButton: boolean = false 56 @State emptyButton: boolean = false
57 @State timeNum: number = 10 57 @State timeNum: number = 10
58 /** 58 /**
@@ -127,8 +127,8 @@ export struct EmptyComponent { @@ -127,8 +127,8 @@ export struct EmptyComponent {
127 // .height(this.EMPTY_IMAGE_HEIGHT) 127 // .height(this.EMPTY_IMAGE_HEIGHT)
128 128
129 Text(this.emptyType !== 8 ? this.buildNoDataTip() : `${this.buildNoDataTip()}(${this.timeNum}s)`) 129 Text(this.emptyType !== 8 ? this.buildNoDataTip() : `${this.buildNoDataTip()}(${this.timeNum}s)`)
130 - .fontSize($r('app.float.normal_text_size'))  
131 - .fontColor('#000000') 130 + .fontSize($r('app.float.font_size_14'))
  131 + .fontColor('#FF999999')
132 .fontWeight(FontWeight.Normal) 132 .fontWeight(FontWeight.Normal)
133 .opacity(this.TEXT_OPACITY) 133 .opacity(this.TEXT_OPACITY)
134 .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP }) 134 .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP })
@@ -136,26 +136,47 @@ export struct EmptyComponent { @@ -136,26 +136,47 @@ export struct EmptyComponent {
136 Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`); 136 Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`);
137 }) 137 })
138 138
139 - if (this.emptyButton) {  
140 - Button('点击重试')  
141 - .type(ButtonType.Normal)  
142 - .width(80)  
143 - .height(28)  
144 - .backgroundColor('#fffffff')  
145 - .fontColor('#FF666666')  
146 - .border({ width: 1 })  
147 - .borderColor('#FFEDEDED')  
148 - .fontSize($r('app.float.font_size_12'))  
149 - .margin({ top: 16 })  
150 - .padding(0)  
151 - .onClick(() => {  
152 - this.retry()  
153 - }) 139 + if (this.isShowButton()) {
  140 + if (this.emptyType !== 15) {
  141 + Button('点击重试')
  142 + .type(ButtonType.Normal)
  143 + .width(80)
  144 + .height(28)
  145 + .backgroundColor('#fffffff')
  146 + .fontColor('#FF666666')
  147 + .border({ width: 1 })
  148 + .borderColor('#FFEDEDED')
  149 + .borderRadius(4)
  150 + .fontSize($r('app.float.font_size_12'))
  151 + .margin({ top: 16 })
  152 + .padding(0)
  153 + .onClick(() => {
  154 + this.retry()
  155 + })
  156 + } else {
  157 + Button('点击重试')
  158 + .type(ButtonType.Normal)
  159 + .width(80)
  160 + .height(28)
  161 + .backgroundColor(Color.Black)
  162 + .fontColor('#FFCCCCCC')
  163 + .border({ width: 1 })
  164 + .borderColor('#4DFFFFFF')
  165 + .borderRadius(4)
  166 + .fontSize($r('app.float.font_size_12'))
  167 + .margin({ top: 16 })
  168 + .padding(0)
  169 + .onClick(() => {
  170 + this.retry()
  171 + })
  172 + }
154 } 173 }
155 } 174 }
156 .justifyContent(FlexAlign.Center) 175 .justifyContent(FlexAlign.Center)
157 .width(this.emptyWidth) 176 .width(this.emptyWidth)
158 .height(this.emptyHeight) 177 .height(this.emptyHeight)
  178 +
  179 + // .backgroundColor(Color.Black)
159 } 180 }
160 181
161 buildNoDataTip(): string { 182 buildNoDataTip(): string {
@@ -224,4 +245,12 @@ export struct EmptyComponent { @@ -224,4 +245,12 @@ export struct EmptyComponent {
224 } 245 }
225 return imageString 246 return imageString
226 } 247 }
227 -}  
  248 +
  249 + isShowButton() {
  250 + if (this.emptyType === 1 || this.emptyType === 9 || this.emptyType === 15) {
  251 + return true
  252 + } else {
  253 + return false
  254 + }
  255 + }
  256 +}
@@ -7,13 +7,12 @@ const TAG = 'LiveEmptyComponent'; @@ -7,13 +7,12 @@ const TAG = 'LiveEmptyComponent';
7 * WDViewDefaultType 缺省页 7 * WDViewDefaultType 缺省页
8 */ 8 */
9 export const enum WDViewDefaultType { 9 export const enum WDViewDefaultType {
10 - /// 1.默认 10 + /// 1.默认
11 WDViewDefaultType_Default, 11 WDViewDefaultType_Default,
12 /// 16.直播结束 12 /// 16.直播结束
13 WDViewDefaultType_NoLiveEnd, 13 WDViewDefaultType_NoLiveEnd,
14 /// 17.直播暂停 14 /// 17.直播暂停
15 WDViewDefaultType_NoLiveSuspend, 15 WDViewDefaultType_NoLiveSuspend,
16 -  
17 } 16 }
18 17
19 /** 18 /**
@@ -21,11 +20,13 @@ export const enum WDViewDefaultType { @@ -21,11 +20,13 @@ export const enum WDViewDefaultType {
21 */ 20 */
22 @Preview 21 @Preview
23 @Component 22 @Component
24 -export struct LiveEmptyComponent { 23 +export struct EmptyComponent {
25 // private emptySize: SizeOptions = {}; 24 // private emptySize: SizeOptions = {};
26 @State emptyWidth: string | number = CommonConstants.FULL_PARENT; 25 @State emptyWidth: string | number = CommonConstants.FULL_PARENT;
27 @State emptyHeight: string | number = CommonConstants.FULL_PARENT; 26 @State emptyHeight: string | number = CommonConstants.FULL_PARENT;
28 - @State emptyType: number = WDViewDefaultType.WDViewDefaultType_Default 27 + @State emptyType: number = WDViewDefaultType.WDViewDefaultType_Default; // 缺省图类型,传枚举
  28 + @State emptyButton: boolean = false
  29 + @State timeNum: number = 10
29 /** 30 /**
30 * The empty image width percentage setting. 31 * The empty image width percentage setting.
31 */ 32 */
@@ -42,6 +43,42 @@ export struct LiveEmptyComponent { @@ -42,6 +43,42 @@ export struct LiveEmptyComponent {
42 * The empty data text opacity. 43 * The empty data text opacity.
43 */ 44 */
44 readonly TEXT_OPACITY: number = 0.4; 45 readonly TEXT_OPACITY: number = 0.4;
  46 + private timer: number = -1
  47 + retry: () => void = () => {
  48 + }
  49 +
  50 + createTimer() {
  51 + if (this.emptyType === 8) {
  52 + this.timer = setInterval(() => {
  53 + this.timeNum--;
  54 + if (this.timeNum === 0) {
  55 + clearInterval(this.timer);
  56 + }
  57 + }, 1000);
  58 + }
  59 + }
  60 +
  61 + destroyTimer() {
  62 + if (this.emptyType === 8) {
  63 + clearInterval(this.timer);
  64 + }
  65 + }
  66 +
  67 + onPageShow(): void {
  68 + this.createTimer()
  69 + }
  70 +
  71 + aboutToAppear(): void {
  72 + this.createTimer()
  73 + }
  74 +
  75 + onPageHide(): void {
  76 + this.destroyTimer()
  77 + }
  78 +
  79 + aboutToDisappear() {
  80 + this.destroyTimer()
  81 + }
45 82
46 build() { 83 build() {
47 this.noProgrammeData(); 84 this.noProgrammeData();
@@ -54,24 +91,64 @@ export struct LiveEmptyComponent { @@ -54,24 +91,64 @@ export struct LiveEmptyComponent {
54 noProgrammeData() { 91 noProgrammeData() {
55 Column() { 92 Column() {
56 Image(this.buildNoDataTipImage()) 93 Image(this.buildNoDataTipImage())
57 - .width('this.EMPTY_IMAGE_WIDTH')  
58 - .height(this.EMPTY_IMAGE_HEIGHT) 94 + .width(160)
  95 + .height(112)
59 .objectFit(ImageFit.Contain) 96 .objectFit(ImageFit.Contain)
60 // .border({ width: 1, color: Color.Red, radius: 6 }) 97 // .border({ width: 1, color: Color.Red, radius: 6 })
  98 + // .width('this.EMPTY_IMAGE_WIDTH')
  99 + // .height(this.EMPTY_IMAGE_HEIGHT)
61 100
62 - Text(this.buildNoDataTip())  
63 - .fontSize($r('app.float.normal_text_size'))  
64 - .fontColor('#000000') 101 + Text(this.emptyType !== 8 ? this.buildNoDataTip() : `${this.buildNoDataTip()}(${this.timeNum}s)`)
  102 + .fontSize($r('app.float.font_size_14'))
  103 + .fontColor('#FF999999')
65 .fontWeight(FontWeight.Normal) 104 .fontWeight(FontWeight.Normal)
66 .opacity(this.TEXT_OPACITY) 105 .opacity(this.TEXT_OPACITY)
67 .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP }) 106 .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP })
68 .onClick((event: ClickEvent) => { 107 .onClick((event: ClickEvent) => {
69 Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`); 108 Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`);
70 }) 109 })
  110 +
  111 + if (this.isShowButton()) {
  112 + if (this.emptyType !== 15) {
  113 + Button('点击重试')
  114 + .type(ButtonType.Normal)
  115 + .width(80)
  116 + .height(28)
  117 + .backgroundColor('#fffffff')
  118 + .fontColor('#FF666666')
  119 + .border({ width: 1 })
  120 + .borderColor('#FFEDEDED')
  121 + .borderRadius(4)
  122 + .fontSize($r('app.float.font_size_12'))
  123 + .margin({ top: 16 })
  124 + .padding(0)
  125 + .onClick(() => {
  126 + this.retry()
  127 + })
  128 + } else {
  129 + Button('点击重试')
  130 + .type(ButtonType.Normal)
  131 + .width(80)
  132 + .height(28)
  133 + .backgroundColor(Color.Black)
  134 + .fontColor('#FFCCCCCC')
  135 + .border({ width: 1 })
  136 + .borderColor('#4DFFFFFF')
  137 + .borderRadius(4)
  138 + .fontSize($r('app.float.font_size_12'))
  139 + .margin({ top: 16 })
  140 + .padding(0)
  141 + .onClick(() => {
  142 + this.retry()
  143 + })
  144 + }
  145 + }
71 } 146 }
72 .justifyContent(FlexAlign.Center) 147 .justifyContent(FlexAlign.Center)
73 .width(this.emptyWidth) 148 .width(this.emptyWidth)
74 .height(this.emptyHeight) 149 .height(this.emptyHeight)
  150 +
  151 + // .backgroundColor(Color.Black)
75 } 152 }
76 153
77 buildNoDataTip(): string { 154 buildNoDataTip(): string {
@@ -84,15 +161,22 @@ export struct LiveEmptyComponent { @@ -84,15 +161,22 @@ export struct LiveEmptyComponent {
84 } 161 }
85 return contentString 162 return contentString
86 } 163 }
87 -  
88 buildNoDataTipImage(): Resource | string { 164 buildNoDataTipImage(): Resource | string {
89 Logger.info(TAG, "buildNoDataTip"); 165 Logger.info(TAG, "buildNoDataTip");
90 let imageString: Resource | string = $r('app.media.icon_no_content') 166 let imageString: Resource | string = $r('app.media.icon_no_content')
91 - if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoLiveEnd) { 167 + if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoLiveEnd) {
92 imageString = $r('app.media.icon_no_end') 168 imageString = $r('app.media.icon_no_end')
93 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoLiveSuspend) { 169 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoLiveSuspend) {
94 imageString = $r('app.media.icon_no_liver') 170 imageString = $r('app.media.icon_no_liver')
95 } 171 }
96 return imageString 172 return imageString
97 } 173 }
98 -}  
  174 +
  175 + isShowButton() {
  176 + if (this.emptyType === 1 || this.emptyType === 9 || this.emptyType === 15) {
  177 + return true
  178 + } else {
  179 + return false
  180 + }
  181 + }
  182 +}
@@ -121,35 +121,6 @@ export struct LiveHorizontalCardComponent { @@ -121,35 +121,6 @@ export struct LiveHorizontalCardComponent {
121 } 121 }
122 122
123 async gotoLive(content: ContentDTO) { 123 async gotoLive(content: ContentDTO) {
124 - const liveDetail = await LiveModel.getLiveDetails(content?.objectId || '', content?.relId || '', content?.relType || '')  
125 - if (content && content.objectType) {  
126 - if (content.objectType === ContentConstants.TYPE_LIVE) {  
127 - if (liveDetail && liveDetail[0] && liveDetail[0].liveInfo) {  
128 - const liveStyle = liveDetail[0].liveInfo.liveStyle  
129 - const liveState = liveDetail[0].liveInfo.liveState  
130 -  
131 - console.error('liveDetail===', liveDetail)  
132 -  
133 - let taskAction: Action = {  
134 - type: 'JUMP_DETAIL_PAGE',  
135 - params: {  
136 - detailPageType: 2,  
137 - contentID: content?.objectId,  
138 - liveStyle: liveState === 'wait' ? 0 : liveStyle,  
139 - extra: {  
140 - relType: content?.relType,  
141 - relId: content?.relId,  
142 - } as ExtraDTO  
143 - } as Params,  
144 - };  
145 - WDRouterRule.jumpWithAction(taskAction)  
146 - // Logger.debug(TAG, `gotoLive, ${content.objectId}`);  
147 - }  
148 - } else if (content.objectType === ContentConstants.TYPE_TELETEXT) {  
149 - ProcessUtils.processPage(content)  
150 - }  
151 - }  
152 -  
153 - 124 + ProcessUtils.processPage(content)
154 } 125 }
155 } 126 }
@@ -64,29 +64,49 @@ export class PageHelper { @@ -64,29 +64,49 @@ export class PageHelper {
64 // 优先展示展现中心广告 64 // 优先展示展现中心广告
65 let cornersAdv = pageInfo.cornersAdv 65 let cornersAdv = pageInfo.cornersAdv
66 66
  67 + if (cornersAdv == null) {
  68 + return
  69 + }
  70 + if (cornersAdv.advert == null) {
  71 + return
  72 + }
  73 +
  74 + if ("left_down" == cornersAdv.pos) {
  75 + // 左边挂角广告
  76 + pageModel.isRightAdv = 2
  77 + } else {
  78 + // 右边挂角广告
  79 + pageModel.isRightAdv = 1
  80 +
  81 + }
  82 +
  83 + pageModel.pageCornerContentInfo = cornersAdv;
  84 + pageModel.isShowAds = true
  85 +
67 } else if (pageInfo.cornersAdv2 != null && pageInfo.cornersAdv2.length > 0) { 86 } else if (pageInfo.cornersAdv2 != null && pageInfo.cornersAdv2.length > 0) {
68 // 广告中心-挂角广告信息 87 // 广告中心-挂角广告信息
69 let cornersAdv2 = pageInfo.cornersAdv2 88 let cornersAdv2 = pageInfo.cornersAdv2
70 // 获取 89 // 获取
71 let showCompAdvBean = cornersAdv2[0] 90 let showCompAdvBean = cornersAdv2[0]
72 91
  92 + if (showCompAdvBean.matInfo == null) {
  93 + return
  94 + }
73 // 95 //
74 let slotInfo = showCompAdvBean.slotInfo; 96 let slotInfo = showCompAdvBean.slotInfo;
75 let postion = slotInfo.position 97 let postion = slotInfo.position
76 -  
77 if (postion == 0) { 98 if (postion == 0) {
78 //左边挂角 99 //左边挂角
79 - pageModel.pageLeftCornerAdv = showCompAdvBean  
80 - pageModel.isShowLeftAds = true 100 + pageModel.isRightAdv = 2
81 } else { 101 } else {
82 // 右边挂角 102 // 右边挂角
83 - pageModel.pageRightCornerAdv = showCompAdvBean  
84 - pageModel.isShowRightAds = true 103 + pageModel.isRightAdv = 1
85 } 104 }
86 -  
87 - Logger.error("XXX", JSON.stringify(pageInfo.cornersAdv2)) 105 + pageModel.pageCornerAdv = showCompAdvBean
  106 + pageModel.isShowAds = true
88 } 107 }
89 108
  109 +
90 } 110 }
91 111
92 112
@@ -4,7 +4,7 @@ import { ViewType } from 'wdConstant/src/main/ets/enum/ViewType'; @@ -4,7 +4,7 @@ import { ViewType } from 'wdConstant/src/main/ets/enum/ViewType';
4 import { RefreshConstants as Const } from '../utils/RefreshConstants'; 4 import { RefreshConstants as Const } from '../utils/RefreshConstants';
5 import { PageUIReqBean } from '../components/page/bean/PageUIReqBean'; 5 import { PageUIReqBean } from '../components/page/bean/PageUIReqBean';
6 import { GroupInfoDTO, PageInfoDTO } from 'wdBean/src/main/ets/bean/navigation/PageInfoDTO'; 6 import { GroupInfoDTO, PageInfoDTO } from 'wdBean/src/main/ets/bean/navigation/PageInfoDTO';
7 -import { CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean'; 7 +import { AdvRuleBean, CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean';
8 8
9 /** 9 /**
10 * 页面下拉刷新、上拉加载数据bean。 10 * 页面下拉刷新、上拉加载数据bean。
@@ -52,12 +52,10 @@ export default class PageModel { @@ -52,12 +52,10 @@ export default class PageModel {
52 timestamp: String = '1'; 52 timestamp: String = '1';
53 53
54 //左右挂角广告对象 54 //左右挂角广告对象
55 - pageLeftCornerAdv:CompAdvBean = {} as CompAdvBean  
56 - isShowLeftAds : boolean = true;  
57 - pageRightCornerAdv:CompAdvBean = {} as CompAdvBean  
58 - isShowRightAds : boolean = true;  
59 -  
60 - 55 + pageCornerAdv:CompAdvBean = {} as CompAdvBean // 挂角广告
  56 + isShowAds : boolean = false;
  57 + isRightAdv : number = 1;// 1:右边;2:左边 -> 默认右边
  58 + pageCornerContentInfo:AdvRuleBean = {} as AdvRuleBean // 展现中心业务信息
61 59
62 60
63 /** 61 /**
@@ -5,6 +5,8 @@ import router from '@ohos.router'; @@ -5,6 +5,8 @@ import router from '@ohos.router';
5 import { DetailPlayLivePage } from './DetailPlayLivePage' 5 import { DetailPlayLivePage } from './DetailPlayLivePage'
6 import { DetailPlayVLivePage } from './DetailPlayVLivePage' 6 import { DetailPlayVLivePage } from './DetailPlayVLivePage'
7 7
  8 +const TAG = 'DetailPlayLiveCommon'
  9 +
8 @Entry() 10 @Entry()
9 @Component 11 @Component
10 export struct DetailPlayLiveCommon { 12 export struct DetailPlayLiveCommon {
@@ -47,7 +49,7 @@ export struct DetailPlayLiveCommon { @@ -47,7 +49,7 @@ export struct DetailPlayLiveCommon {
47 this.liveDetailsBean = data[0] 49 this.liveDetailsBean = data[0]
48 this.liveState = this.liveDetailsBean.liveInfo?.liveState 50 this.liveState = this.liveDetailsBean.liveInfo?.liveState
49 this.liveStyle = this.liveDetailsBean.liveInfo.liveStyle 51 this.liveStyle = this.liveDetailsBean.liveInfo.liveStyle
50 - console.error('liveDetailsBean===', JSON.stringify((this.liveDetailsBean))) 52 + console.log(TAG, 'getLiveDetails:', JSON.stringify((this.liveDetailsBean)))
51 } 53 }
52 }, 54 },
53 () => { 55 () => {
@@ -8,11 +8,11 @@ import { WDPlayerController } from 'wdPlayer/Index'; @@ -8,11 +8,11 @@ import { WDPlayerController } from 'wdPlayer/Index';
8 import { DisplayDirection } from 'wdConstant/Index'; 8 import { DisplayDirection } from 'wdConstant/Index';
9 9
10 const storage = LocalStorage.getShared(); 10 const storage = LocalStorage.getShared();
  11 +const TAG = 'DetailPlayVLivePage'
11 12
12 @Entry(storage) 13 @Entry(storage)
13 @Component 14 @Component
14 export struct DetailPlayVLivePage { 15 export struct DetailPlayVLivePage {
15 - TAG: string = 'DetailPlayVLivePage';  
16 private liveViewModel: LiveViewModel = new LiveViewModel() 16 private liveViewModel: LiveViewModel = new LiveViewModel()
17 private playerController: WDPlayerController = new WDPlayerController(); 17 private playerController: WDPlayerController = new WDPlayerController();
18 private swiperController: SwiperController = new SwiperController() 18 private swiperController: SwiperController = new SwiperController()
@@ -29,6 +29,7 @@ export struct DetailPlayVLivePage { @@ -29,6 +29,7 @@ export struct DetailPlayVLivePage {
29 @State swiperIndex: number = 1 29 @State swiperIndex: number = 1
30 30
31 aboutToAppear(): void { 31 aboutToAppear(): void {
  32 + console.log(TAG, 'aboutToAppear')
32 WindowModel.shared.setWindowLayoutFullScreen(true) 33 WindowModel.shared.setWindowLayoutFullScreen(true)
33 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) 34 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
34 35
@@ -86,11 +87,11 @@ export struct DetailPlayVLivePage { @@ -86,11 +87,11 @@ export struct DetailPlayVLivePage {
86 if (data.length > 0) { 87 if (data.length > 0) {
87 this.liveDetailsBean = data[0] 88 this.liveDetailsBean = data[0]
88 this.liveState = this.liveDetailsBean.liveInfo?.liveState 89 this.liveState = this.liveDetailsBean.liveInfo?.liveState
89 - console.error('liveDetailsBean===', JSON.stringify((this.liveDetailsBean))) 90 + console.log(TAG, 'getLiveDetails', JSON.stringify((this.liveDetailsBean)))
90 } 91 }
91 }, 92 },
92 - () => {  
93 - 93 + (message: string) => {
  94 + console.error(TAG, 'getLiveDetails catch', message)
94 }) 95 })
95 } 96 }
96 97
@@ -99,9 +100,10 @@ export struct DetailPlayVLivePage { @@ -99,9 +100,10 @@ export struct DetailPlayVLivePage {
99 .then( 100 .then(
100 (data) => { 101 (data) => {
101 this.liveRoomDataBean = data 102 this.liveRoomDataBean = data
  103 + console.log(TAG, 'getLiveRoomData', JSON.stringify((this.liveRoomDataBean)))
102 }, 104 },
103 - () => {  
104 - 105 + (message: string) => {
  106 + console.error(TAG, 'getLiveDetails catch', message)
105 }) 107 })
106 } 108 }
107 } 109 }
1 import { LiveDetailsBean } from 'wdBean/Index'; 1 import { LiveDetailsBean } from 'wdBean/Index';
2 import { WDPlayerController, WDPlayerRenderVLiveView, WDPlayerRenderView } from 'wdPlayer/Index'; 2 import { WDPlayerController, WDPlayerRenderVLiveView, WDPlayerRenderView } from 'wdPlayer/Index';
3 -import componentUtils from '@ohos.arkui.componentUtils';  
4 - 3 +
  4 +const TAG = 'PlayerComponent'
5 5
6 @Component 6 @Component
7 export struct PlayerComponent { 7 export struct PlayerComponent {
8 private playerController?: WDPlayerController; 8 private playerController?: WDPlayerController;
9 - // playerController: WDPlayerController = new WDPlayerController();  
10 @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean 9 @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean
  10 + @Consume @Watch('pageShowChange') pageShow: number
  11 + @Consume @Watch('pageHideChange') pageHide: number
11 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 12 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
12 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 13 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
13 @State imgUrl: string = '' 14 @State imgUrl: string = ''
@@ -15,7 +16,16 @@ export struct PlayerComponent { @@ -15,7 +16,16 @@ export struct PlayerComponent {
15 @State liveStreamType: number | null = -1 16 @State liveStreamType: number | null = -1
16 @State playUrl: string = '' 17 @State playUrl: string = ''
17 18
  19 + pageShowChange() {
  20 + this.playerController?.play()
  21 + }
  22 +
  23 + pageHideChange() {
  24 + this.playerController?.pause()
  25 + }
  26 +
18 aboutToAppear(): void { 27 aboutToAppear(): void {
  28 + console.log(TAG, 'aboutToAppear')
19 if (this.playerController) { 29 if (this.playerController) {
20 this.playerController.onCanplay = () => { 30 this.playerController.onCanplay = () => {
21 console.log('可以播放了') 31 console.log('可以播放了')
@@ -33,7 +43,6 @@ export struct PlayerComponent { @@ -33,7 +43,6 @@ export struct PlayerComponent {
33 } 43 }
34 44
35 updateData() { 45 updateData() {
36 - console.error('updateData=============')  
37 //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 46 //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
38 if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) { 47 if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) {
39 this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url 48 this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url
@@ -32,19 +32,32 @@ export struct DetailPlayShortVideoPage { @@ -32,19 +32,32 @@ export struct DetailPlayShortVideoPage {
32 @Provide followStatus: string = '0' // 关注状态 32 @Provide followStatus: string = '0' // 关注状态
33 @Provide isOpenDetail: boolean = false // 查看详情按钮点击 33 @Provide isOpenDetail: boolean = false // 查看详情按钮点击
34 @Provide isDragging: boolean = false // 拖动时间进度条 34 @Provide isDragging: boolean = false // 拖动时间进度条
  35 + @Consume @Watch('videoStatusChange') switchVideoStatus: boolean
35 @Consume @Watch('pageShowChange') pageShow: number 36 @Consume @Watch('pageShowChange') pageShow: number
36 - @Consume @Watch('pageHideChange') pageHide: number  
37 37
  38 + /**
  39 + * 页面显示重查用户关注、点赞等信息
  40 + */
38 pageShowChange() { 41 pageShowChange() {
39 - if (this.currentIndex === this.index && this.playerController.getStatus() === PlayerConstants.STATUS_PAUSE) {  
40 - this.playerController.play() 42 + if (this.currentIndex === this.index) {
41 this.queryNewsInfoOfUser() 43 this.queryNewsInfoOfUser()
  44 + if (this.switchVideoStatus) {
  45 + this.playerController.play()
  46 + }
42 } 47 }
43 } 48 }
44 49
45 - pageHideChange() {  
46 - if (this.currentIndex === this.index && this.playerController.getStatus() === PlayerConstants.STATUS_START) {  
47 - this.playerController.pause() 50 + /**
  51 + * 频道切换视频暂停、播放
  52 + * 页面显隐视频暂停、播放
  53 + */
  54 + videoStatusChange() {
  55 + if (this.currentIndex === this.index) {
  56 + if (this.switchVideoStatus) {
  57 + this.playerController.play()
  58 + } else {
  59 + this.playerController.pause()
  60 + }
48 } 61 }
49 } 62 }
50 63
@@ -22,12 +22,12 @@ export struct DetailVideoListPage { @@ -22,12 +22,12 @@ export struct DetailVideoListPage {
22 @Provide showComment: boolean = true 22 @Provide showComment: boolean = true
23 @Provide pageShow: number = -1 23 @Provide pageShow: number = -1
24 @Provide pageHide: number = -1 24 @Provide pageHide: number = -1
  25 + @Provide switchVideoStatus: boolean = false
25 @State data: ContentDetailDTO[] = [] 26 @State data: ContentDetailDTO[] = []
26 @State testData: string[] = ['111', '222', '333'] 27 @State testData: string[] = ['111', '222', '333']
27 @State currentIndex: number = 0 28 @State currentIndex: number = 0
28 @State interactDataList: InteractDataDTO[] = [] 29 @State interactDataList: InteractDataDTO[] = []
29 @State isFullScreen: boolean = false 30 @State isFullScreen: boolean = false
30 - @State switchVideoStatus: boolean = false  
31 31
32 async aboutToAppear(): Promise<void> { 32 async aboutToAppear(): Promise<void> {
33 this.openFullScreen() 33 this.openFullScreen()
@@ -57,13 +57,14 @@ export struct DetailVideoListPage { @@ -57,13 +57,14 @@ export struct DetailVideoListPage {
57 onPageShow(): void { 57 onPageShow(): void {
58 console.log(TAG, 'onPageShow') 58 console.log(TAG, 'onPageShow')
59 this.pageShow = Math.random() 59 this.pageShow = Math.random()
  60 + this.switchVideoStatus = true
60 this.openFullScreen() 61 this.openFullScreen()
61 62
62 } 63 }
63 64
64 onPageHide(): void { 65 onPageHide(): void {
65 console.log(TAG, 'onPageHide') 66 console.log(TAG, 'onPageHide')
66 - this.pageHide = Math.random() 67 + this.switchVideoStatus = false
67 this.closeFullScreen() 68 this.closeFullScreen()
68 } 69 }
69 70
1 -import { Action, ContentDetailDTO, InteractDataDTO } from 'wdBean/Index'; 1 +import { ContentDetailDTO, InteractDataDTO } from 'wdBean/Index';
2 import { ContentDetailRequest } from 'wdDetailPlayApi/Index' 2 import { ContentDetailRequest } from 'wdDetailPlayApi/Index'
3 -import { ResponseDTO } from 'wdNetwork/Index';  
4 import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage' 3 import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage'
5 -// import { Test } from './Test'  
6 -import router from '@ohos.router';  
7 -import window from '@ohos.window'; 4 +import {
  5 + WDViewDefaultType,
  6 + EmptyComponent
  7 +} from '../../../../../wdComponent/src/main/ets/components/view/EmptyComponent'
8 import { 8 import {
9 batchContentDetailParams, 9 batchContentDetailParams,
10 compListItem, 10 compListItem,
11 contentListParams, 11 contentListParams,
12 - contentsItem,  
13 getRecCompInfoParams 12 getRecCompInfoParams
14 } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; 13 } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
15 import { Logger, WindowModel } from 'wdKit/Index'; 14 import { Logger, WindowModel } from 'wdKit/Index';
16 -import { BusinessError } from '@kit.BasicServicesKit';  
17 import { PictureLoading } from './PictureLoading'; 15 import { PictureLoading } from './PictureLoading';
18 16
19 interface loadMoreData { 17 interface loadMoreData {
@@ -23,8 +21,6 @@ interface loadMoreData { @@ -23,8 +21,6 @@ interface loadMoreData {
23 } 21 }
24 22
25 const TAG = 'VideoChannelDetail' 23 const TAG = 'VideoChannelDetail'
26 -let timer: number = -1  
27 -  
28 const storage = LocalStorage.getShared(); 24 const storage = LocalStorage.getShared();
29 25
30 @Entry(storage) 26 @Entry(storage)
@@ -46,36 +42,44 @@ export struct VideoChannelDetail { @@ -46,36 +42,44 @@ export struct VideoChannelDetail {
46 private swiperController: SwiperController = new SwiperController() 42 private swiperController: SwiperController = new SwiperController()
47 @Provide showComment: boolean = false 43 @Provide showComment: boolean = false
48 @Provide windowWidth: number = AppStorage.get<number>('windowWidth') || 0 44 @Provide windowWidth: number = AppStorage.get<number>('windowWidth') || 0
  45 + @Consume @Watch('pageShowChange') pageShow: number
  46 + @Consume @Watch('pageHideChange') pageHide: number
  47 + @Provide switchVideoStatus: boolean = false
49 @State data: ContentDetailDTO[] = [] 48 @State data: ContentDetailDTO[] = []
50 @State currentIndex: number = 0 49 @State currentIndex: number = 0
51 @State interactDataList: InteractDataDTO[] = [] 50 @State interactDataList: InteractDataDTO[] = []
52 @State totalCount: number = 0 51 @State totalCount: number = 0
53 - @State switchVideoStatus: boolean = false  
54 @State isMouted: boolean = false 52 @State isMouted: boolean = false
  53 + @State isRequestError: boolean = false
  54 +
  55 + pageShowChange() {
  56 + if (this.bottomNavIndex === 2 && this.topNavIndex === 0) {
  57 + this.barBackgroundColor = Color.Black
  58 + this.switchVideoStatus = true
  59 + this.openFullScreen()
  60 + }
  61 + }
  62 +
  63 + pageHideChange() {
  64 + this.barBackgroundColor = Color.Transparent
  65 + this.switchVideoStatus = false
  66 + this.closeFullScreen()
  67 + }
55 68
56 /** 69 /**
57 * 监听视频频道激活或失活 70 * 监听视频频道激活或失活
58 */ 71 */
59 navIndexChange() { 72 navIndexChange() {
60 - // if (timer) clearTimeout(timer)  
61 console.log('navIndexChange', this.bottomNavIndex, this.topNavIndex) 73 console.log('navIndexChange', this.bottomNavIndex, this.topNavIndex)
62 - // timer = setTimeout(() => {  
63 -  
64 if (this.bottomNavIndex === 2 && this.topNavIndex === 0) { 74 if (this.bottomNavIndex === 2 && this.topNavIndex === 0) {
65 - // 如果视频在暂停则播放视频  
66 - this.switchVideoStatus = true  
67 this.barBackgroundColor = Color.Black 75 this.barBackgroundColor = Color.Black
  76 + this.switchVideoStatus = true
68 this.openFullScreen() 77 this.openFullScreen()
69 } else { 78 } else {
70 - // 如果视频在播放则暂停视频  
71 - this.switchVideoStatus = false  
72 this.barBackgroundColor = Color.Transparent 79 this.barBackgroundColor = Color.Transparent
  80 + this.switchVideoStatus = false
73 this.closeFullScreen() 81 this.closeFullScreen()
74 } 82 }
75 - // timer = -1  
76 - // }, 100)  
77 -  
78 -  
79 } 83 }
80 84
81 aboutToAppear() { 85 aboutToAppear() {
@@ -90,16 +94,6 @@ export struct VideoChannelDetail { @@ -90,16 +94,6 @@ export struct VideoChannelDetail {
90 Logger.info(TAG, 'aboutToDisappear'); 94 Logger.info(TAG, 'aboutToDisappear');
91 } 95 }
92 96
93 - onPageShow(): void {  
94 - this.openFullScreen()  
95 - Logger.info(TAG, 'onPageShow');  
96 - }  
97 -  
98 - onPageHide(): void {  
99 - this.closeFullScreen()  
100 - Logger.info(TAG, 'onPageHide');  
101 - }  
102 -  
103 /** 97 /**
104 * 开启沉浸式 98 * 开启沉浸式
105 * TODO:颜色待根据业务接口修改 99 * TODO:颜色待根据业务接口修改
@@ -152,6 +146,7 @@ export struct VideoChannelDetail { @@ -152,6 +146,7 @@ export struct VideoChannelDetail {
152 } 146 }
153 147
154 await ContentDetailRequest.getRecCompInfo(params).then(res => { 148 await ContentDetailRequest.getRecCompInfo(params).then(res => {
  149 + this.isRequestError = false
155 console.log('根据视频频道传参查询视频楼层信息totalCount', res.data?.totalCount + '') 150 console.log('根据视频频道传参查询视频楼层信息totalCount', res.data?.totalCount + '')
156 151
157 this.totalCount = res.data?.totalCount || 0 152 this.totalCount = res.data?.totalCount || 0
@@ -185,6 +180,9 @@ export struct VideoChannelDetail { @@ -185,6 +180,9 @@ export struct VideoChannelDetail {
185 this.isMouted = true 180 this.isMouted = true
186 }, 500) 181 }, 500)
187 182
  183 + }).catch(() => {
  184 + // 获取内容失败请重试
  185 + this.isRequestError = true
188 }) 186 })
189 } 187 }
190 188
@@ -214,41 +212,51 @@ export struct VideoChannelDetail { @@ -214,41 +212,51 @@ export struct VideoChannelDetail {
214 212
215 build() { 213 build() {
216 Column() { 214 Column() {
217 - PictureLoading().visibility(this.isMouted ? Visibility.None : Visibility.Visible)  
218 - Swiper(this.swiperController) {  
219 - ForEach(this.data, (item: ContentDetailDTO, index: number) => {  
220 - Column() {  
221 - DetailPlayShortVideoPage({  
222 - contentDetailData: item,  
223 - currentIndex: this.currentIndex,  
224 - index: index,  
225 - interactData: this.interactDataList[index]  
226 - })  
227 - }.width('100%')  
228 - .height('100%')  
229 - }, (item: ContentDetailDTO) => item.newsId + '')  
230 - }  
231 - .visibility(this.isMouted ? Visibility.Visible : Visibility.None)  
232 - .cachedCount(-1)  
233 - .indicator(false)  
234 - .vertical(true)  
235 - .loop(false)  
236 - .width('100%')  
237 - .height('100%')  
238 - // 扩展至所有非安全区域  
239 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])  
240 - .onChange((index: number) => {  
241 - this.currentIndex = index  
242 - console.info('onChange==', index.toString()) 215 + if (this.isRequestError) {
  216 + EmptyComponent({
  217 + emptyType: WDViewDefaultType.WDViewDefaultType_NoVideo,
  218 + retry: () => {
  219 + this.getRecCompInfo()
  220 + }
  221 + })
  222 + } else {
243 223
244 - if (this.currentIndex === this.data.length - 1) {  
245 - this.pageNum++  
246 - this.refreshTime = new Date().getTime()  
247 - this.loadStrategy = 'push_up'  
248 - this.getRecCompInfo() 224 + PictureLoading().visibility(this.isMouted ? Visibility.None : Visibility.Visible)
  225 + Swiper(this.swiperController) {
  226 + ForEach(this.data, (item: ContentDetailDTO, index: number) => {
  227 + Column() {
  228 + DetailPlayShortVideoPage({
  229 + contentDetailData: item,
  230 + currentIndex: this.currentIndex,
  231 + index: index,
  232 + interactData: this.interactDataList[index]
  233 + })
  234 + }.width('100%')
  235 + .height('100%')
  236 + }, (item: ContentDetailDTO) => item.newsId + '')
249 } 237 }
250 - }) 238 + .visibility(this.isMouted ? Visibility.Visible : Visibility.None)
  239 + .cachedCount(-1)
  240 + .indicator(false)
  241 + .vertical(true)
  242 + .loop(false)
  243 + .width('100%')
  244 + .height('100%')
  245 + // 扩展至所有非安全区域
  246 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
  247 + .onChange((index: number) => {
  248 + this.currentIndex = index
  249 + console.info('onChange==', index.toString())
251 250
  251 + if (this.currentIndex === this.data.length - 1) {
  252 + this.pageNum++
  253 + this.refreshTime = new Date().getTime()
  254 + this.loadStrategy = 'push_up'
  255 + this.getRecCompInfo()
  256 + }
  257 + })
  258 +
  259 + }
252 } 260 }
253 .width('100%') 261 .width('100%')
254 .height('100%') 262 .height('100%')
@@ -9,6 +9,14 @@ @@ -9,6 +9,14 @@
9 "value": "14fp" 9 "value": "14fp"
10 }, 10 },
11 { 11 {
  12 + "name": "font_size_12",
  13 + "value": "12fp"
  14 + },
  15 + {
  16 + "name": "normal_text_size",
  17 + "value": "16fp"
  18 + },
  19 + {
12 "name": "title_popup_image_size", 20 "name": "title_popup_image_size",
13 "value": "24vp" 21 "value": "24vp"
14 }, 22 },
@@ -96,6 +96,16 @@ struct ForgetPasswordPage { @@ -96,6 +96,16 @@ struct ForgetPasswordPage {
96 if (this.isEmpty(this.phoneContent)) { 96 if (this.isEmpty(this.phoneContent)) {
97 return 97 return
98 } 98 }
  99 +
  100 + if(this.pageType == 1){
  101 + this.loginViewModel.sendVerifyCodeByToken().then(()=>{
  102 + promptAction.showToast({ message: "验证码已发送成功" })
  103 + }).catch((message: string)=>{
  104 + promptAction.showToast({ message: message })
  105 + })
  106 + return
  107 + }
  108 +
99 this.loginViewModel.sendVerifyCode(this.phoneContent).then((verifyCode) => { 109 this.loginViewModel.sendVerifyCode(this.phoneContent).then((verifyCode) => {
100 promptAction.showToast({ message: "验证码已发送成功" }) 110 promptAction.showToast({ message: "验证码已发送成功" })
101 Logger.debug(TAG, "sendVerifyCode: " + verifyCode) 111 Logger.debug(TAG, "sendVerifyCode: " + verifyCode)
@@ -115,7 +125,20 @@ struct ForgetPasswordPage { @@ -115,7 +125,20 @@ struct ForgetPasswordPage {
115 if (this.isEmpty(this.codeContent)) { 125 if (this.isEmpty(this.codeContent)) {
116 return 126 return
117 } 127 }
118 - 128 + if(this.pageType == 1){
  129 + this.loginViewModel.checkVerifyCodeByToken(this.codeContent).then(()=>{
  130 + let params: SettingPasswordParams = {
  131 + pageID:'1',
  132 + phoneContent:this.phoneContent,
  133 + codeContent:this.codeContent,
  134 + pageType:this.pageType
  135 + }
  136 + WDRouterRule.jumpWithPage(WDRouterPage.settingPasswordPage, params)
  137 + }).catch((message: string)=>{
  138 + promptAction.showToast({ message: message })
  139 + })
  140 + return
  141 + }
119 this.loginViewModel.checkVerifyCode(this.phoneContent, this.codeContent).then(() => { 142 this.loginViewModel.checkVerifyCode(this.phoneContent, this.codeContent).then(() => {
120 let params: SettingPasswordParams = { 143 let params: SettingPasswordParams = {
121 pageID:'1', 144 pageID:'1',
@@ -41,9 +41,9 @@ export class LoginModel { @@ -41,9 +41,9 @@ export class LoginModel {
41 let bean: Record<string, string> = {}; 41 let bean: Record<string, string> = {};
42 // bean['phoneNum'] = number 42 // bean['phoneNum'] = number
43 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 43 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
44 - return new Promise<string>((success, fail) => {  
45 - HttpRequest.post<ResponseDTO<string>>(HttpUrlUtils.getVerifyCodeByTokenUrl(), bean, headers).then((data: ResponseDTO<string>) => {  
46 - if (!data || !data.data) { 44 + return new Promise<object>((success, fail) => {
  45 + HttpBizUtil.post<ResponseDTO<object>>(HttpUrlUtils.getVerifyCodeByTokenUrl(),bean, headers).then((data: ResponseDTO<object>) => {
  46 + if (!data) {
47 fail("数据为空") 47 fail("数据为空")
48 return 48 return
49 } 49 }
@@ -51,7 +51,7 @@ export class LoginModel { @@ -51,7 +51,7 @@ export class LoginModel {
51 fail(data.message) 51 fail(data.message)
52 return 52 return
53 } 53 }
54 - success(data.data) 54 + success(data)
55 }, (error: Error) => { 55 }, (error: Error) => {
56 fail(error.message) 56 fail(error.message)
57 Logger.debug("LoginViewModel:error ", error.toString()) 57 Logger.debug("LoginViewModel:error ", error.toString())
@@ -148,9 +148,9 @@ export class LoginModel { @@ -148,9 +148,9 @@ export class LoginModel {
148 // bean['phone'] = phone 148 // bean['phone'] = phone
149 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 149 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
150 return new Promise<CheckVerifyBean>((success, fail) => { 150 return new Promise<CheckVerifyBean>((success, fail) => {
151 - HttpRequest.post<ResponseDTO<CheckVerifyBean>>(HttpUrlUtils.getCheckVerifyByTokenCodeUrl(), bean, headers).then((data: ResponseDTO<CheckVerifyBean>) => { 151 + HttpRequest.post<ResponseDTO<CheckVerifyBean>>(HttpUrlUtils.getCheckVerifyCodeByToken(), bean, headers).then((data: ResponseDTO<CheckVerifyBean>) => {
152 Logger.debug("LoginViewModel:success2 ", data.message) 152 Logger.debug("LoginViewModel:success2 ", data.message)
153 - if (!data || !data.data) { 153 + if (!data) {
154 fail("数据为空") 154 fail("数据为空")
155 return 155 return
156 } 156 }
@@ -158,7 +158,9 @@ export class LoginModel { @@ -158,7 +158,9 @@ export class LoginModel {
158 fail(data.message) 158 fail(data.message)
159 return 159 return
160 } 160 }
161 - success(data.data) 161 + if(data.data){
  162 + success(data.data)
  163 + }
162 }, (error: Error) => { 164 }, (error: Error) => {
163 Logger.debug("LoginViewModel:error2 ", error.toString()) 165 Logger.debug("LoginViewModel:error2 ", error.toString())
164 fail(error.message) 166 fail(error.message)
@@ -33,7 +33,7 @@ export class LoginViewModel { @@ -33,7 +33,7 @@ export class LoginViewModel {
33 } 33 }
34 34
35 sendVerifyCodeByToken() { 35 sendVerifyCodeByToken() {
36 - return new Promise<string>((success, fail) => { 36 + return new Promise<object>((success, fail) => {
37 this.loginModel.sendVerifyCodeByToken().then((data) => { 37 this.loginModel.sendVerifyCodeByToken().then((data) => {
38 success(data) 38 success(data)
39 }).catch((message: string) => { 39 }).catch((message: string) => {
@@ -55,7 +55,6 @@ export class LoginViewModel { @@ -55,7 +55,6 @@ export class LoginViewModel {
55 SPHelper.default.save(SpConstants.USER_STATUS, data.status) 55 SPHelper.default.save(SpConstants.USER_STATUS, data.status)
56 SPHelper.default.save(SpConstants.USER_Type, data.userType) 56 SPHelper.default.save(SpConstants.USER_Type, data.userType)
57 SPHelper.default.save(SpConstants.USER_NAME, data.userName) 57 SPHelper.default.save(SpConstants.USER_NAME, data.userName)
58 - SPHelper.default.save(SpConstants.USER_PHONE, phone)  
59 HttpUrlUtils.setUserId(data.id+"") 58 HttpUrlUtils.setUserId(data.id+"")
60 HttpUrlUtils.setUserType(data.userType+"") 59 HttpUrlUtils.setUserType(data.userType+"")
61 HttpUrlUtils.setUserToken(data.jwtToken) 60 HttpUrlUtils.setUserToken(data.jwtToken)
@@ -80,7 +79,6 @@ export class LoginViewModel { @@ -80,7 +79,6 @@ export class LoginViewModel {
80 SPHelper.default.save(SpConstants.USER_STATUS, data.status) 79 SPHelper.default.save(SpConstants.USER_STATUS, data.status)
81 SPHelper.default.save(SpConstants.USER_Type, data.userType) 80 SPHelper.default.save(SpConstants.USER_Type, data.userType)
82 SPHelper.default.save(SpConstants.USER_NAME, data.userName) 81 SPHelper.default.save(SpConstants.USER_NAME, data.userName)
83 - SPHelper.default.save(SpConstants.USER_PHONE, phone)  
84 HttpUrlUtils.setUserId(data.id+"") 82 HttpUrlUtils.setUserId(data.id+"")
85 HttpUrlUtils.setUserType(data.userType+"") 83 HttpUrlUtils.setUserType(data.userType+"")
86 HttpUrlUtils.setUserToken(data.jwtToken) 84 HttpUrlUtils.setUserToken(data.jwtToken)