Showing
2 changed files
with
48 additions
and
8 deletions
| 1 | -import { LazyDataSource, NetworkUtil, StringUtils } from 'wdKit/Index'; | 1 | +import { LazyDataSource, NetworkUtil, StringUtils, ToastUtils } from 'wdKit/Index'; |
| 2 | import { Remark, SubscribeMessageModel, | 2 | import { Remark, SubscribeMessageModel, |
| 3 | WDMessageCenterMessageType } from '../../../../model/InteractMessageModel'; | 3 | WDMessageCenterMessageType } from '../../../../model/InteractMessageModel'; |
| 4 | import MinePageDatasModel from '../../../../model/MinePageDatasModel'; | 4 | import MinePageDatasModel from '../../../../model/MinePageDatasModel'; |
| @@ -88,13 +88,9 @@ export struct SubscribeMessageComponent{ | @@ -88,13 +88,9 @@ export struct SubscribeMessageComponent{ | ||
| 88 | .width('100%') | 88 | .width('100%') |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | - @Builder ListLayout(){ | ||
| 92 | - List({scroller: this.scroller}) { | ||
| 93 | - LazyForEach(this.data, (item: SubscribeMessageModel, index: number) => { | ||
| 94 | - ListItem() { | ||
| 95 | - SubscribeListChildComponent({ item: item }) | ||
| 96 | - }.width('100%') | ||
| 97 | - .onClick(()=>{ | 91 | + jumpDetail(item: SubscribeMessageModel){ |
| 92 | + MinePageDatasModel.getAssertDetailData(item.relId,item.contentId,item.relType).then((value) => { | ||
| 93 | + if(value == "1"){ | ||
| 98 | let action = { | 94 | let action = { |
| 99 | type:item.contentType, | 95 | type:item.contentType, |
| 100 | params:{ | 96 | params:{ |
| @@ -106,6 +102,25 @@ export struct SubscribeMessageComponent{ | @@ -106,6 +102,25 @@ export struct SubscribeMessageComponent{ | ||
| 106 | } | 102 | } |
| 107 | } as Action | 103 | } as Action |
| 108 | WDRouterRule.jumpWithPage(WDRouterPage.detailPlayLiveCommon, action) | 104 | WDRouterRule.jumpWithPage(WDRouterPage.detailPlayLiveCommon, action) |
| 105 | + }else{ | ||
| 106 | + ToastUtils.shortToast("内容不存在") | ||
| 107 | + } | ||
| 108 | + }).catch((err: Error) => { | ||
| 109 | + console.log(TAG, JSON.stringify(err)) | ||
| 110 | + }) | ||
| 111 | + | ||
| 112 | + | ||
| 113 | + | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + @Builder ListLayout(){ | ||
| 117 | + List({scroller: this.scroller}) { | ||
| 118 | + LazyForEach(this.data, (item: SubscribeMessageModel, index: number) => { | ||
| 119 | + ListItem() { | ||
| 120 | + SubscribeListChildComponent({ item: item }) | ||
| 121 | + }.width('100%') | ||
| 122 | + .onClick(()=>{ | ||
| 123 | + this.jumpDetail(item) | ||
| 109 | }) | 124 | }) |
| 110 | }) | 125 | }) |
| 111 | //没有更多数据 显示提示 | 126 | //没有更多数据 显示提示 |
| @@ -724,6 +724,31 @@ class MinePageDatasModel{ | @@ -724,6 +724,31 @@ class MinePageDatasModel{ | ||
| 724 | return WDHttp.get<ResponseDTO<String>>(url) | 724 | return WDHttp.get<ResponseDTO<String>>(url) |
| 725 | }; | 725 | }; |
| 726 | 726 | ||
| 727 | + | ||
| 728 | + /** | ||
| 729 | + * 预约消息 查询详情 | ||
| 730 | + * @returns | ||
| 731 | + */ | ||
| 732 | + getAssertDetailData(relId:string,contentId:string,relType:string): Promise<String> { | ||
| 733 | + return new Promise<String>((success, error) => { | ||
| 734 | + this.fetchAssertDetailData(relId,contentId,relType).then((navResDTO: ResponseDTO<String>) => { | ||
| 735 | + console.log(TAG,JSON.stringify(navResDTO)) | ||
| 736 | + if (!navResDTO || StringUtils.isEmpty(navResDTO.data)) { | ||
| 737 | + success("0"); | ||
| 738 | + return | ||
| 739 | + } | ||
| 740 | + success("1"); | ||
| 741 | + }).catch((err: Error) => { | ||
| 742 | + error(err) | ||
| 743 | + }) | ||
| 744 | + }) | ||
| 745 | + } | ||
| 746 | + | ||
| 747 | + fetchAssertDetailData(relId:string,contentId:string,relType:string) { | ||
| 748 | + let url = HttpUrlUtils.getHost() + HttpUrlUtils.DETAIL_PATH + `?relId=${relId}&contentId=${contentId}&relType=${relType}` | ||
| 749 | + return WDHttp.get<ResponseDTO<String>>(url) | ||
| 750 | + }; | ||
| 751 | + | ||
| 727 | } | 752 | } |
| 728 | 753 | ||
| 729 | const minePageDatasModel = MinePageDatasModel.getInstance() | 754 | const minePageDatasModel = MinePageDatasModel.getInstance() |
-
Please register or login to post a comment