yangchenggong1_wd

desc:人民号主页跳转

1 -import { StringUtils } from 'wdKit/Index' 1 +import { StringUtils, ToastUtils } from 'wdKit/Index'
2 import { HttpUrlUtils } from 'wdNetwork/Index' 2 import { HttpUrlUtils } from 'wdNetwork/Index'
  3 +import { WDRouterRule, WDRouterPage } from 'wdRouter/Index'
3 import MinePageDatasModel from '../../../model/MinePageDatasModel' 4 import MinePageDatasModel from '../../../model/MinePageDatasModel'
4 import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem' 5 import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'
5 import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRequestItem' 6 import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRequestItem'
@@ -12,92 +13,6 @@ export struct FollowChildComponent{ @@ -12,92 +13,6 @@ export struct FollowChildComponent{
12 build() { 13 build() {
13 if(this.type == 0 ){ 14 if(this.type == 0 ){
14 Column(){ 15 Column(){
15 - Blank().height('27lpx')  
16 -  
17 - Row() {  
18 - Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl)  
19 - .objectFit(ImageFit.Auto)  
20 - .width('92lpx')  
21 - .height('92lpx')  
22 - .margin({right:'15lpx'})  
23 -  
24 - Column(){  
25 - Text(this.data.cnUserName)  
26 - .fontWeight('400lpx')  
27 - .fontSize('31lpx')  
28 - .lineHeight('38lpx')  
29 - .fontColor($r('app.color.color_222222'))  
30 - .maxLines(1)  
31 - Text(`粉丝${this.data.cnFansNum}`)  
32 - .fontColor($r('app.color.color_B0B0B0'))  
33 - .fontSize('23lpx')  
34 - .maxLines(1)  
35 - Text(`${this.data.introduction}`)  
36 - .fontColor($r('app.color.color_B0B0B0'))  
37 - .fontSize('23lpx')  
38 - .maxLines(2)  
39 - .textOverflow({ overflow: TextOverflow.Ellipsis })  
40 - }.layoutWeight(1)  
41 - .alignItems(HorizontalAlign.Start)  
42 -  
43 - if(this.data.status == "1"){  
44 - Row(){  
45 - Text(`已关注`)  
46 - .fontColor($r('app.color.color_CCCCCC'))  
47 - .fontSize('23lpx')  
48 - .fontWeight('500lpx')  
49 - .lineHeight('35lpx')  
50 - }.backgroundColor($r('app.color.color_F5F5F5'))  
51 - .borderRadius('6lpx')  
52 - .borderColor($r('app.color.color_F5F5F5'))  
53 - .borderWidth('2lpx')  
54 - .justifyContent(FlexAlign.Center)  
55 - .width('100lpx')  
56 - .height('46lpx')  
57 - .margin({left:'4lpx',top:'23lpx'})  
58 - .onClick(()=>{  
59 - this.followOperation()  
60 - // this.data.status = "0"  
61 - })  
62 - }else{  
63 - Row(){  
64 - Image($r('app.media.follow_icon'))  
65 - .margin({right:'4lpx'})  
66 - .width('23lpx')  
67 - .height('23lpx')  
68 - Text(`关注`)  
69 - .fontColor($r('app.color.color_ED2800'))  
70 - .fontSize('23lpx')  
71 - .fontWeight('500lpx')  
72 - .lineHeight('35lpx')  
73 - }.borderColor($r('app.color.color_1AED2800'))  
74 - .borderRadius('6lpx')  
75 - .borderWidth('2lpx')  
76 - .justifyContent(FlexAlign.Center)  
77 - .width('100lpx')  
78 - .height('46lpx')  
79 - .margin({left:'4lpx',top:'23lpx'})  
80 - .onClick(()=>{  
81 - this.followOperation()  
82 - // this.data.status = "1"  
83 - })  
84 - }  
85 - }.alignItems(VerticalAlign.Top)  
86 - .width('100%')  
87 - .layoutWeight(1)  
88 -  
89 - Divider().width('100%')  
90 - .height('2lpx')  
91 - .strokeWidth('1lpx')  
92 - .backgroundColor($r('app.color.color_EDEDED'))  
93 -  
94 - }.height('146lpx')  
95 - .justifyContent(FlexAlign.Center)  
96 - .onClick(()=>{  
97 - //跳转 人民号的 主页  
98 - })  
99 - }else if(this.type == 1 ){  
100 - Column(){  
101 Column(){ 16 Column(){
102 17
103 Row() { 18 Row() {
@@ -118,28 +33,30 @@ export struct FollowChildComponent{ @@ -118,28 +33,30 @@ export struct FollowChildComponent{
118 .lineHeight('38lpx') 33 .lineHeight('38lpx')
119 .fontColor($r('app.color.color_222222')) 34 .fontColor($r('app.color.color_222222'))
120 .maxLines(1) 35 .maxLines(1)
121 - .margin({bottom:'12lpx'})  
122 - Row(){  
123 - Text(`粉丝${this.data.cnFansNum}`)  
124 - .fontColor($r('app.color.color_B0B0B0'))  
125 - .fontSize('23lpx') 36 + .margin({bottom:'8lpx'})
126 37
127 - Image($r("app.media.point"))  
128 - .width('31lpx')  
129 - .height('31lpx')  
130 - .objectFit(ImageFit.Auto) 38 + Text(`粉丝${this.data.cnFansNum}`)
  39 + .fontColor($r('app.color.color_B0B0B0'))
  40 + .fontSize('23lpx')
  41 + .fontWeight('400lpx')
  42 + .lineHeight('31lpx')
  43 + .margin({bottom:'8lpx'})
131 44
132 - Text(`${this.data.introduction}`)  
133 - .fontColor($r('app.color.color_B0B0B0'))  
134 - .fontSize('23lpx')  
135 - .layoutWeight(1)  
136 - .maxLines(1)  
137 - .textOverflow({ overflow: TextOverflow.Ellipsis })  
138 - }.width('100%') 45 + Text(`${this.data.introduction}`)
  46 + .fontColor($r('app.color.color_B0B0B0'))
  47 + .fontSize('23lpx')
  48 + .maxLines(2)
  49 + .textAlign(TextAlign.Start)
  50 + .textOverflow({ overflow: TextOverflow.Ellipsis })
139 } 51 }
140 .layoutWeight(1) 52 .layoutWeight(1)
141 .alignItems(HorizontalAlign.Start) 53 .alignItems(HorizontalAlign.Start)
  54 + .justifyContent(FlexAlign.Start)
142 }.layoutWeight(1) 55 }.layoutWeight(1)
  56 + .alignItems(VerticalAlign.Top)
  57 + .onClick(()=>{
  58 + this.jumpCreatorHomePage()
  59 + })
143 60
144 if(this.data.status == "1"){ 61 if(this.data.status == "1"){
145 Row(){ 62 Row(){
@@ -154,7 +71,7 @@ export struct FollowChildComponent{ @@ -154,7 +71,7 @@ export struct FollowChildComponent{
154 .height('46lpx') 71 .height('46lpx')
155 .onClick(()=>{ 72 .onClick(()=>{
156 this.followOperation() 73 this.followOperation()
157 - }) 74 + }).margin({top:'29lpx'})
158 }else{ 75 }else{
159 Row(){ 76 Row(){
160 Image($r('app.media.follow_icon')) 77 Image($r('app.media.follow_icon'))
@@ -172,11 +89,114 @@ export struct FollowChildComponent{ @@ -172,11 +89,114 @@ export struct FollowChildComponent{
172 .justifyContent(FlexAlign.Center) 89 .justifyContent(FlexAlign.Center)
173 .width('100lpx') 90 .width('100lpx')
174 .height('46lpx') 91 .height('46lpx')
  92 + .margin({top:'29lpx'})
175 .onClick(()=>{ 93 .onClick(()=>{
176 this.followOperation() 94 this.followOperation()
177 }) 95 })
178 } 96 }
179 } 97 }
  98 + .padding({top:'27lpx'})
  99 + .width('100%')
  100 + .justifyContent(FlexAlign.SpaceBetween)
  101 + .alignItems(VerticalAlign.Top)
  102 +
  103 + }.height('202lpx')
  104 + .justifyContent(FlexAlign.Start)
  105 +
  106 + Divider().width('100%')
  107 + .height('1lpx')
  108 + .strokeWidth('1lpx')
  109 + .backgroundColor($r('app.color.color_EDEDED'))
  110 + }.width('100%')
  111 +
  112 + }else {
  113 + Column(){
  114 + Column(){
  115 +
  116 + Row() {
  117 + Row(){
  118 + Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl)
  119 + .objectFit(ImageFit.Auto)
  120 + .width('92lpx')
  121 + .height('92lpx')
  122 + .margin({right:'15lpx'})
  123 + .borderRadius(50)
  124 + .borderWidth('1lpx')
  125 + .borderColor($r('app.color.color_0D000000'))
  126 +
  127 + Column(){
  128 + Text(this.data.cnUserName)
  129 + .fontWeight('400lpx')
  130 + .fontSize('31lpx')
  131 + .lineHeight('38lpx')
  132 + .fontColor($r('app.color.color_222222'))
  133 + .maxLines(1)
  134 + .margin({bottom:'12lpx'})
  135 + Row(){
  136 + Text(`粉丝${this.data.cnFansNum}`)
  137 + .fontColor($r('app.color.color_B0B0B0'))
  138 + .fontSize('23lpx')
  139 +
  140 + Image($r("app.media.point"))
  141 + .width('31lpx')
  142 + .height('31lpx')
  143 + .objectFit(ImageFit.Auto)
  144 +
  145 + Text(`${this.data.introduction}`)
  146 + .fontColor($r('app.color.color_B0B0B0'))
  147 + .fontSize('23lpx')
  148 + .layoutWeight(1)
  149 + .maxLines(1)
  150 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  151 + }.width('100%')
  152 + }
  153 + .layoutWeight(1)
  154 + .alignItems(HorizontalAlign.Start)
  155 + }.layoutWeight(1)
  156 + .onClick(()=>{
  157 + this.jumpCreatorHomePage()
  158 + })
  159 +
  160 + if(this.type === 2){
  161 + Blank()
  162 + }else {
  163 + if(this.data.status == "1"){
  164 + Row(){
  165 + Text(`已关注`)
  166 + .fontColor($r('app.color.color_CCCCCC'))
  167 + .fontSize('23lpx')
  168 + .fontWeight('500lpx')
  169 + .lineHeight('35lpx')
  170 + }
  171 + .justifyContent(FlexAlign.Center)
  172 + .width('100lpx')
  173 + .height('46lpx')
  174 + .onClick(()=>{
  175 + this.followOperation()
  176 + })
  177 + }else{
  178 + Row(){
  179 + Image($r('app.media.follow_icon'))
  180 + .margin({right:'4lpx'})
  181 + .width('23lpx')
  182 + .height('23lpx')
  183 + Text(`关注`)
  184 + .fontColor($r('app.color.color_ED2800'))
  185 + .fontSize('23lpx')
  186 + .fontWeight('500lpx')
  187 + .lineHeight('35lpx')
  188 + }.borderColor($r('app.color.color_1AED2800'))
  189 + .borderRadius('6lpx')
  190 + .borderWidth('2lpx')
  191 + .justifyContent(FlexAlign.Center)
  192 + .width('100lpx')
  193 + .height('46lpx')
  194 + .onClick(()=>{
  195 + this.followOperation()
  196 + })
  197 + }
  198 + }
  199 + }
180 .width('100%') 200 .width('100%')
181 .height('92lpx') 201 .height('92lpx')
182 .justifyContent(FlexAlign.SpaceBetween) 202 .justifyContent(FlexAlign.SpaceBetween)
@@ -206,4 +226,15 @@ export struct FollowChildComponent{ @@ -206,4 +226,15 @@ export struct FollowChildComponent{
206 } 226 }
207 }) 227 })
208 } 228 }
  229 +
  230 + jumpCreatorHomePage() {
  231 + if(this.data.mainControl === 0){
  232 + ToastUtils.shortToast("无法查看此用户主页")
  233 + }else if(this.data.banControl === 1){
  234 + ToastUtils.shortToast("该账号已封禁,不予访问")
  235 + }else{
  236 + let params = {'creatorId': this.data.creatorId} as Record<string, string>;
  237 + WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
  238 + }
  239 + }
209 } 240 }
1 import { LazyDataSource } from 'wdKit'; 1 import { LazyDataSource } from 'wdKit';
2 import MinePageDatasModel from '../../../model/MinePageDatasModel'; 2 import MinePageDatasModel from '../../../model/MinePageDatasModel';
  3 +import SearcherAboutDataModel from '../../../model/SearcherAboutDataModel';
  4 +import { CreatorDetailRequestItem } from '../../../viewmodel/CreatorDetailRequestItem';
3 import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem' 5 import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'
4 import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem'; 6 import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem';
5 import { FollowListStatusRequestItem } from '../../../viewmodel/FollowListStatusRequestItem'; 7 import { FollowListStatusRequestItem } from '../../../viewmodel/FollowListStatusRequestItem';
@@ -73,8 +75,7 @@ export struct FollowListDetailUI{ @@ -73,8 +75,7 @@ export struct FollowListDetailUI{
73 this.hasMore = false 75 this.hasMore = false
74 }else{ 76 }else{
75 value.list.forEach((value)=>{ 77 value.list.forEach((value)=>{
76 -  
77 - this.data.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,value.fansNum+"",value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.attentionUserType,value.attentionUserId)) 78 + this.data.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,value.fansNum+"",value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.attentionUserType,value.attentionUserId,value.mainControl,value.banControl))
78 }) 79 })
79 this.data.notifyDataReload() 80 this.data.notifyDataReload()
80 this.count = this.data.totalCount() 81 this.count = this.data.totalCount()
@@ -109,31 +110,72 @@ export struct FollowListDetailUI{ @@ -109,31 +110,72 @@ export struct FollowListDetailUI{
109 } 110 }
110 } 111 }
111 112
112 - getFollowListStatus(value:MineFollowListDetailItem){ 113 + getFollowListStatus(result:MineFollowListDetailItem){
  114 + let data_temp : FollowListDetailItem[] = []
  115 + result.list.forEach((item)=>{
  116 + data_temp.push(new FollowListDetailItem(item.headPhotoUrl,item.cnUserName,item.cnFansNum,item.introduction,item.creatorId,"0",item.attentionUserId,item.cnUserType,item.cnUserId,item.cnMainControl,-1))
  117 + })
  118 + let request = new CreatorDetailRequestItem()
  119 +
  120 + data_temp.forEach((data)=>{
  121 + request.creatorIdList.push(data.creatorId)
  122 + })
  123 + SearcherAboutDataModel.getCreatorDetailListData(request).then((value)=>{
  124 + if(value!=null && value.length>0){
  125 + data_temp.forEach((data)=>{
  126 + value.forEach((item)=>{
  127 + if(data.creatorId == item.creatorId){
  128 + data.headPhotoUrl = item.headPhotoUrl
  129 + if(item.fansNum>10000){
  130 + let temp = (item.fansNum/10000)+""
  131 + let index = temp.indexOf('.')
  132 + if(index != -1){
  133 + temp = temp.substring(0,index+2)
  134 + }else{
  135 + temp = temp
  136 + }
  137 + data.cnFansNum = temp + "万"
  138 + }else{
  139 + data.cnFansNum = item.fansNum + ""
  140 + }
  141 + data.introduction = item.introduction
  142 + data.mainControl = item.mainControl
  143 + data.banControl = item.banControl
  144 + }
  145 + })
  146 + })
  147 + this.getFollowStatus(data_temp,result.totalCount)
  148 + }
  149 + }).catch((err:Error)=>{
  150 + console.log(TAG,JSON.stringify(err))
  151 + this.isLoading = false
  152 + this.count = this.count===-1?0:this.count
  153 + })
  154 + }
  155 +
  156 + getFollowStatus(result : FollowListDetailItem[],totalCount:number){
113 let status = new FollowListStatusRequestItem() 157 let status = new FollowListStatusRequestItem()
114 - let data : FollowListDetailItem[] = []  
115 - value.list.forEach((item)=>{ 158 + result.forEach((item)=>{
116 status.creatorIds.push(new QueryListIsFollowedItem(item.creatorId)) 159 status.creatorIds.push(new QueryListIsFollowedItem(item.creatorId))
117 - data.push(new FollowListDetailItem(item.headPhotoUrl,item.cnUserName,item.cnFansNum,item.introduction,item.creatorId,"0",item.attentionUserId,item.cnUserType,item.cnUserId))  
118 }) 160 })
119 161
120 MinePageDatasModel.getFollowListStatusData(status,getContext(this)).then((newValue)=>{ 162 MinePageDatasModel.getFollowListStatusData(status,getContext(this)).then((newValue)=>{
121 newValue.forEach((item)=>{ 163 newValue.forEach((item)=>{
122 - data.forEach((list)=>{ 164 + result.forEach((list)=>{
123 if (item.creatorId == list.creatorId) { 165 if (item.creatorId == list.creatorId) {
124 list.status = item.status 166 list.status = item.status
125 } 167 }
126 }) 168 })
127 }) 169 })
128 170
129 - data.forEach((item)=>{  
130 - this.data.push(new FollowListDetailItem(item.headPhotoUrl,item.cnUserName,item.cnFansNum,item.introduction,item.creatorId,item.status,item.attentionUserId,item.cnUserType,item.cnUserId)) 171 + result.forEach((item)=>{
  172 + this.data.push(new FollowListDetailItem(item.headPhotoUrl,item.cnUserName,item.cnFansNum,item.introduction,item.creatorId,item.status,item.attentionUserId,item.cnUserType,item.cnUserId,item.mainControl,item.banControl))
131 }) 173 })
132 174
133 this.data.notifyDataReload() 175 this.data.notifyDataReload()
134 176
135 this.count = this.data.totalCount() 177 this.count = this.data.totalCount()
136 - if (this.data.totalCount() < value.totalCount) { 178 + if (this.data.totalCount() < totalCount) {
137 this.curPageNum++ 179 this.curPageNum++
138 }else { 180 }else {
139 this.hasMore = false 181 this.hasMore = false
@@ -8,6 +8,7 @@ import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; @@ -8,6 +8,7 @@ import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem';
8 import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem'; 8 import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem';
9 import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRequestItem'; 9 import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRequestItem';
10 import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; 10 import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI';
  11 +import { FollowChildComponent } from '../follow/FollowChildComponent';
11 12
12 const TAG = "HomePageBottomComponent" 13 const TAG = "HomePageBottomComponent"
13 @Component 14 @Component
@@ -95,7 +96,7 @@ export struct HomePageBottomComponent{ @@ -95,7 +96,7 @@ export struct HomePageBottomComponent{
95 96
96 LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => { 97 LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => {
97 ListItem() { 98 ListItem() {
98 - ChildFollowComponent({data: item}) 99 + FollowChildComponent({data: item,type:1})
99 } 100 }
100 .onClick(() => { 101 .onClick(() => {
101 }) 102 })
@@ -184,7 +185,7 @@ export struct HomePageBottomComponent{ @@ -184,7 +185,7 @@ export struct HomePageBottomComponent{
184 this.hasMore = false 185 this.hasMore = false
185 }else{ 186 }else{
186 value.list.forEach((value)=>{ 187 value.list.forEach((value)=>{
187 - this.data_follow.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,value.fansNum+"",value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.attentionUserType,value.attentionUserId)) 188 + this.data_follow.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,value.fansNum+"",value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.attentionUserType,value.attentionUserId,value.mainControl,value.banControl))
188 }) 189 })
189 this.data_follow.notifyDataReload() 190 this.data_follow.notifyDataReload()
190 this.count = this.data_follow.totalCount() 191 this.count = this.data_follow.totalCount()
@@ -231,107 +232,6 @@ export struct HomePageBottomComponent{ @@ -231,107 +232,6 @@ export struct HomePageBottomComponent{
231 } 232 }
232 233
233 @Component 234 @Component
234 -struct ChildFollowComponent {  
235 - @ObjectLink data: FollowListDetailItem  
236 -  
237 - build() {  
238 - Column(){  
239 - Blank().height('27lpx')  
240 -  
241 - Row() {  
242 - Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl)  
243 - .objectFit(ImageFit.Auto)  
244 - .width('92lpx')  
245 - .height('92lpx')  
246 - .margin({right:'15lpx'})  
247 -  
248 - Column(){  
249 - Text(this.data.cnUserName)  
250 - .fontWeight('400lpx')  
251 - .fontSize('31lpx')  
252 - .lineHeight('38lpx')  
253 - .fontColor($r('app.color.color_222222'))  
254 - Text(`粉丝${this.data.cnFansNum}`)  
255 - .fontColor($r('app.color.color_B0B0B0'))  
256 - .fontSize('23lpx')  
257 - .maxLines(1)  
258 - Text(`${this.data.introduction}`)  
259 - .fontColor($r('app.color.color_B0B0B0'))  
260 - .fontSize('23lpx')  
261 - .maxLines(2)  
262 - .textOverflow({ overflow: TextOverflow.Ellipsis })  
263 - }.layoutWeight(1)  
264 - .alignItems(HorizontalAlign.Start)  
265 -  
266 - if(this.data.status == "1"){  
267 - Row(){  
268 - Text(`已关注`)  
269 - .fontColor($r('app.color.color_CCCCCC'))  
270 - .fontSize('23lpx')  
271 - .fontWeight('500lpx')  
272 - .lineHeight('35lpx')  
273 - }.backgroundColor($r('app.color.color_F5F5F5'))  
274 - .borderRadius('6lpx')  
275 - .borderColor($r('app.color.color_F5F5F5'))  
276 - .borderWidth('2lpx')  
277 - .justifyContent(FlexAlign.Center)  
278 - .width('100lpx')  
279 - .height('46lpx')  
280 - .margin({left:'4lpx',top:'23lpx'})  
281 - .onClick(()=>{  
282 - // this.data.status = "0"  
283 - this.followOperation()  
284 - })  
285 - }else{  
286 - Row(){  
287 - Image($r('app.media.follow_icon'))  
288 - .margin({right:'4lpx'})  
289 - .width('23lpx')  
290 - .height('23lpx')  
291 - Text(`关注`)  
292 - .fontColor($r('app.color.color_ED2800'))  
293 - .fontSize('23lpx')  
294 - .fontWeight('500lpx')  
295 - .lineHeight('35lpx')  
296 - }.borderColor($r('app.color.color_1AED2800'))  
297 - .borderRadius('6lpx')  
298 - .borderWidth('2lpx')  
299 - .justifyContent(FlexAlign.Center)  
300 - .width('100lpx')  
301 - .height('46lpx')  
302 - .margin({left:'4lpx',top:'23lpx'})  
303 - .onClick(()=>{  
304 - // this.data.status = "1"  
305 - this.followOperation()  
306 - })  
307 - }  
308 - }.alignItems(VerticalAlign.Top)  
309 - .width('100%')  
310 - .layoutWeight(1)  
311 -  
312 - Divider().width('100%')  
313 - .height('2lpx')  
314 - .strokeWidth('1lpx')  
315 - .backgroundColor($r('app.color.color_EDEDED'))  
316 -  
317 - }.height('146lpx')  
318 - .justifyContent(FlexAlign.Center)  
319 - }  
320 -  
321 - followOperation(){  
322 - let item = new FollowOperationRequestItem(this.data.cnUserType,this.data.cnUserId,this.data.creatorId,UserDataLocal.getUserType(),UserDataLocal.getUserId(),this.data.status==="0" ? 1:0)  
323 - MinePageDatasModel.getFollowOperation(item,getContext(this)).then((value)=>{  
324 - if(value!=null){  
325 - if (value.code === 0 || value.code.toString() === "0") {  
326 - this.data.status = this.data.status ==="0"?"1":"0"  
327 - }  
328 - }  
329 - })  
330 - }  
331 -  
332 -}  
333 -  
334 -@Component  
335 struct ChildCommentComponent { 235 struct ChildCommentComponent {
336 @ObjectLink data: CommentListItem 236 @ObjectLink data: CommentListItem
337 isLastItem: boolean = false 237 isLastItem: boolean = false
@@ -5,6 +5,7 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel'; @@ -5,6 +5,7 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel';
5 import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; 5 import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem';
6 import { UserFollowListRequestItem } from '../../../viewmodel/UserFollowListRequestItem'; 6 import { UserFollowListRequestItem } from '../../../viewmodel/UserFollowListRequestItem';
7 import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; 7 import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI';
  8 +import { FollowChildComponent } from '../follow/FollowChildComponent';
8 9
9 const TAG = "HomePageBottomComponent" 10 const TAG = "HomePageBottomComponent"
10 @Component 11 @Component
@@ -62,7 +63,7 @@ export struct OtherHomePageBottomFollowComponent{ @@ -62,7 +63,7 @@ export struct OtherHomePageBottomFollowComponent{
62 63
63 LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => { 64 LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => {
64 ListItem() { 65 ListItem() {
65 - ChildFollowComponent({data: item}) 66 + FollowChildComponent({data: item,type:2})
66 } 67 }
67 .onClick(() => { 68 .onClick(() => {
68 }) 69 })
@@ -116,7 +117,7 @@ export struct OtherHomePageBottomFollowComponent{ @@ -116,7 +117,7 @@ export struct OtherHomePageBottomFollowComponent{
116 this.hasMore = false 117 this.hasMore = false
117 }else{ 118 }else{
118 value.list.forEach((value)=>{ 119 value.list.forEach((value)=>{
119 - this.data_follow.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,value.fansNum+"",value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.cnUserType,value.cnUserId)) 120 + this.data_follow.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,value.fansNum+"",value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.cnUserType,value.cnUserId,value.mainControl,value.banControl))
120 }) 121 })
121 this.data_follow.notifyDataReload() 122 this.data_follow.notifyDataReload()
122 this.count = this.data_follow.totalCount() 123 this.count = this.data_follow.totalCount()
@@ -134,50 +135,4 @@ export struct OtherHomePageBottomFollowComponent{ @@ -134,50 +135,4 @@ export struct OtherHomePageBottomFollowComponent{
134 }) 135 })
135 } 136 }
136 } 137 }
137 -}  
138 -  
139 -@Component  
140 -struct ChildFollowComponent {  
141 - @ObjectLink data: FollowListDetailItem  
142 -  
143 - build() {  
144 - Column(){  
145 - Blank().height('27lpx')  
146 -  
147 - Row() {  
148 - Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl)  
149 - .objectFit(ImageFit.Auto)  
150 - .width('92lpx')  
151 - .height('92lpx')  
152 - .margin({right:'15lpx'})  
153 -  
154 - Column(){  
155 - Text(this.data.cnUserName)  
156 - .fontWeight('400lpx')  
157 - .fontSize('31lpx')  
158 - .lineHeight('38lpx')  
159 - .fontColor($r('app.color.color_222222'))  
160 - Text(`粉丝${this.data.cnFansNum}`)  
161 - .fontColor($r('app.color.color_B0B0B0'))  
162 - .fontSize('23lpx')  
163 - .maxLines(1)  
164 - Text(`${this.data.introduction}`)  
165 - .fontColor($r('app.color.color_B0B0B0'))  
166 - .fontSize('23lpx')  
167 - .maxLines(2)  
168 - .textOverflow({ overflow: TextOverflow.Ellipsis })  
169 - }.layoutWeight(1)  
170 - .alignItems(HorizontalAlign.Start)  
171 - }.alignItems(VerticalAlign.Top)  
172 - .width('100%')  
173 - .layoutWeight(1)  
174 -  
175 - Divider().width('100%')  
176 - .height('2lpx')  
177 - .strokeWidth('1lpx')  
178 - .backgroundColor($r('app.color.color_EDEDED'))  
179 -  
180 - }.height('146lpx')  
181 - .justifyContent(FlexAlign.Center)  
182 - }  
183 } 138 }
  1 +import { ToastUtils } from 'wdKit/Index'
  2 +import { WDRouterRule, WDRouterPage } from 'wdRouter/Index'
1 import { SearchRmhDescription } from '../../viewmodel/SearchResultContentItem' 3 import { SearchRmhDescription } from '../../viewmodel/SearchResultContentItem'
2 4
3 @Component 5 @Component
@@ -21,5 +23,19 @@ export struct SearchCreatorComponent{ @@ -21,5 +23,19 @@ export struct SearchCreatorComponent{
21 .textOverflow({ overflow: TextOverflow.Ellipsis }) 23 .textOverflow({ overflow: TextOverflow.Ellipsis })
22 }.alignItems(HorizontalAlign.Center) 24 }.alignItems(HorizontalAlign.Center)
23 .justifyContent(FlexAlign.Center) 25 .justifyContent(FlexAlign.Center)
  26 + .onClick(()=>{
  27 + this.jumpCreatorHomePage()
  28 + })
  29 + }
  30 +
  31 + jumpCreatorHomePage() {
  32 + if(Number.parseInt(this.item.mainControl) === 0){
  33 + ToastUtils.shortToast("无法查看此用户主页")
  34 + }else if(Number.parseInt(this.item.banControl) === 1){
  35 + ToastUtils.shortToast("该账号已封禁,不予访问")
  36 + }else{
  37 + let params = {'creatorId': this.item.id} as Record<string, string>;
  38 + WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
  39 + }
24 } 40 }
25 } 41 }
@@ -72,6 +72,7 @@ export struct SearchResultContentComponent{ @@ -72,6 +72,7 @@ export struct SearchResultContentComponent{
72 value.forEach((item)=>{ 72 value.forEach((item)=>{
73 if(data.creatorId == item.creatorId){ 73 if(data.creatorId == item.creatorId){
74 data.headerPhotoUrl = item.headPhotoUrl.split("?")[0] 74 data.headerPhotoUrl = item.headPhotoUrl.split("?")[0]
  75 + data.mainControl = item.mainControl+""
75 } 76 }
76 }) 77 })
77 }) 78 })
@@ -40,8 +40,9 @@ struct SearchCreatorPage { @@ -40,8 +40,9 @@ struct SearchCreatorPage {
40 this.hasMore = false 40 this.hasMore = false
41 this.isLoading = false 41 this.isLoading = false
42 }else{ 42 }else{
  43 + this.data_temp = []
43 result.list.forEach((data)=>{ 44 result.list.forEach((data)=>{
44 - this.data_temp.push(new FollowListDetailItem("",data.data.creatorName,"0","",data.data.id,"0",data.data.userId,data.data.userType,data.data.userId)) 45 + this.data_temp.push(new FollowListDetailItem("",data.data.creatorName,"0","",data.data.id,"0",data.data.userId,data.data.userType,data.data.userId,Number.parseInt(data.data.mainControl),-1))
45 }) 46 })
46 47
47 let request = new CreatorDetailRequestItem() 48 let request = new CreatorDetailRequestItem()
@@ -69,6 +70,8 @@ struct SearchCreatorPage { @@ -69,6 +70,8 @@ struct SearchCreatorPage {
69 data.cnFansNum = item.fansNum + "" 70 data.cnFansNum = item.fansNum + ""
70 } 71 }
71 data.introduction = item.introduction 72 data.introduction = item.introduction
  73 + data.mainControl = item.mainControl
  74 + data.banControl = item.banControl
72 } 75 }
73 }) 76 })
74 }) 77 })
@@ -104,7 +107,7 @@ struct SearchCreatorPage { @@ -104,7 +107,7 @@ struct SearchCreatorPage {
104 }) 107 })
105 108
106 this.data_temp.forEach((item)=>{ 109 this.data_temp.forEach((item)=>{
107 - this.data.push(new FollowListDetailItem(item.headPhotoUrl,item.cnUserName,item.cnFansNum,item.introduction,item.creatorId,item.status,item.attentionUserId,item.cnUserType,item.cnUserId)) 110 + this.data.push(new FollowListDetailItem(item.headPhotoUrl,item.cnUserName,item.cnFansNum,item.introduction,item.creatorId,item.status,item.attentionUserId,item.cnUserType,item.cnUserId,item.mainControl,item.banControl))
108 }) 111 })
109 112
110 this.data.notifyDataReload() 113 this.data.notifyDataReload()
@@ -71,16 +71,20 @@ export class FollowListDetailItem{ @@ -71,16 +71,20 @@ export class FollowListDetailItem{
71 71
72 cnUserType:string = "" 72 cnUserType:string = ""
73 cnUserId:string = "" 73 cnUserId:string = ""
  74 + mainControl:number = 0
74 75
  76 + cnMainControl:number = 0
75 attentionCreatorId:string = "" 77 attentionCreatorId:string = ""
76 attentionUserType:string = "" 78 attentionUserType:string = ""
77 79
78 attentionHeadPhotoUrl:string = "" 80 attentionHeadPhotoUrl:string = ""
79 attentionUserName:string = "" 81 attentionUserName:string = ""
80 fansNum :number = 0 82 fansNum :number = 0
  83 + banControl:number = -1
81 84
82 85
83 - constructor(headPhotoUrl:string,cnUserName:string,cnFansNum:string,introduction:string,creatorId:string,status:string,attentionUserId:string,cnUserType:string,cnUserId:string) { 86 +
  87 + constructor(headPhotoUrl:string,cnUserName:string,cnFansNum:string,introduction:string,creatorId:string,status:string,attentionUserId:string,cnUserType:string,cnUserId:string,mainControl:number,banControl:number) {
84 this.headPhotoUrl = headPhotoUrl 88 this.headPhotoUrl = headPhotoUrl
85 this.cnUserName = cnUserName 89 this.cnUserName = cnUserName
86 this.cnFansNum = cnFansNum 90 this.cnFansNum = cnFansNum
@@ -90,5 +94,7 @@ export class FollowListDetailItem{ @@ -90,5 +94,7 @@ export class FollowListDetailItem{
90 this.attentionUserId = attentionUserId 94 this.attentionUserId = attentionUserId
91 this.cnUserType = cnUserType 95 this.cnUserType = cnUserType
92 this.cnUserId = cnUserId 96 this.cnUserId = cnUserId
  97 + this.mainControl = mainControl
  98 + this.banControl = banControl
93 } 99 }
94 } 100 }