Showing
2 changed files
with
31 additions
and
8 deletions
| @@ -12,6 +12,7 @@ import { | @@ -12,6 +12,7 @@ import { | ||
| 12 | } from 'wdBean'; | 12 | } from 'wdBean'; |
| 13 | import DetailViewModel from '../viewmodel/DetailViewModel'; | 13 | import DetailViewModel from '../viewmodel/DetailViewModel'; |
| 14 | import { ImageAndTextWebComponent } from './ImageAndTextWebComponent'; | 14 | import { ImageAndTextWebComponent } from './ImageAndTextWebComponent'; |
| 15 | +import { OperRowListView } from './view/OperRowListView'; | ||
| 15 | import router from '@ohos.router'; | 16 | import router from '@ohos.router'; |
| 16 | import { RecommendList } from '../components/view/RecommendList' | 17 | import { RecommendList } from '../components/view/RecommendList' |
| 17 | import { CommonConstants } from 'wdConstant'; | 18 | import { CommonConstants } from 'wdConstant'; |
| @@ -91,7 +92,8 @@ export struct ImageAndTextPageComponent { | @@ -91,7 +92,8 @@ export struct ImageAndTextPageComponent { | ||
| 91 | } | 92 | } |
| 92 | 93 | ||
| 93 | //底部交互区 | 94 | //底部交互区 |
| 94 | - Row() { | 95 | + OperRowListView({contentDetailData: this.contentDetailData[0]}) |
| 96 | + /* Row() { | ||
| 95 | Image($r('app.media.icon_arrow_left')) | 97 | Image($r('app.media.icon_arrow_left')) |
| 96 | .width(24) | 98 | .width(24) |
| 97 | .height(24) | 99 | .height(24) |
| @@ -126,7 +128,7 @@ export struct ImageAndTextPageComponent { | @@ -126,7 +128,7 @@ export struct ImageAndTextPageComponent { | ||
| 126 | .height(56) | 128 | .height(56) |
| 127 | .padding({ left: 15, right: 15, bottom: 50, top: 20 }) | 129 | .padding({ left: 15, right: 15, bottom: 50, top: 20 }) |
| 128 | .justifyContent(FlexAlign.SpaceBetween) | 130 | .justifyContent(FlexAlign.SpaceBetween) |
| 129 | - .backgroundColor(Color.White) | 131 | + .backgroundColor(Color.White)*/ |
| 130 | } | 132 | } |
| 131 | 133 | ||
| 132 | } | 134 | } |
| @@ -12,6 +12,7 @@ import { | @@ -12,6 +12,7 @@ import { | ||
| 12 | import router from '@ohos.router'; | 12 | import router from '@ohos.router'; |
| 13 | import inputMethod from '@ohos.inputMethod'; | 13 | import inputMethod from '@ohos.inputMethod'; |
| 14 | import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel'; | 14 | import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel'; |
| 15 | +import { LikeComponent } from './LikeComponent'; | ||
| 15 | import { HttpUrlUtils } from 'wdNetwork/Index'; | 16 | import { HttpUrlUtils } from 'wdNetwork/Index'; |
| 16 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 17 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 17 | import { PageRepository } from '../../repository/PageRepository'; | 18 | import { PageRepository } from '../../repository/PageRepository'; |
| @@ -29,9 +30,11 @@ const TAG = 'OperRowListView'; | @@ -29,9 +30,11 @@ const TAG = 'OperRowListView'; | ||
| 29 | @Preview | 30 | @Preview |
| 30 | @Component | 31 | @Component |
| 31 | export struct OperRowListView { | 32 | export struct OperRowListView { |
| 32 | - private contentDetailData: ContentDetailDTO = {} as ContentDetailDTO | 33 | + // private contentDetailData: ContentDetailDTO = {} as ContentDetailDTO |
| 34 | + @Prop contentDetailData: ContentDetailDTO | ||
| 33 | @State interactData: InteractDataDTO = {} as InteractDataDTO | 35 | @State interactData: InteractDataDTO = {} as InteractDataDTO |
| 34 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 | 36 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 |
| 37 | + @State likeBean: Record<string, string> = {} | ||
| 35 | 38 | ||
| 36 | @State operationList: OperationItem[] = [ | 39 | @State operationList: OperationItem[] = [ |
| 37 | { | 40 | { |
| @@ -60,6 +63,20 @@ export struct OperRowListView { | @@ -60,6 +63,20 @@ export struct OperRowListView { | ||
| 60 | this.getInteractDataStatus() | 63 | this.getInteractDataStatus() |
| 61 | } | 64 | } |
| 62 | this.queryContentInteractCount() | 65 | this.queryContentInteractCount() |
| 66 | + // 点赞需要数据 | ||
| 67 | + // this.data['userName'] = '人民日报网友2kD2xW' | ||
| 68 | + // this.data['contentType'] = '8' //必须 | ||
| 69 | + // this.data['title'] = '开创两校交流先河!克罗地亚教育代表团访问同济大学' | ||
| 70 | + // this.data['userHeaderUrl'] = "" | ||
| 71 | + // this.data['channelId'] = "2059" //必须 | ||
| 72 | + // this.data['status'] = "1" //必须 | ||
| 73 | + this.likeBean['contentId'] = this.contentDetailData.newsId + '' | ||
| 74 | + this.likeBean['userName'] = this.contentDetailData.editorName + '' | ||
| 75 | + this.likeBean['contentType'] = this.contentDetailData.newsType + '' | ||
| 76 | + this.likeBean['title'] = this.contentDetailData.newsTitle + '' | ||
| 77 | + this.likeBean['userHeaderUrl'] = '' | ||
| 78 | + this.likeBean['channelId'] = this.contentDetailData.reLInfo?.channelId + '' | ||
| 79 | + this.likeBean['status'] = '' | ||
| 63 | } | 80 | } |
| 64 | 81 | ||
| 65 | build() { | 82 | build() { |
| @@ -83,7 +100,7 @@ export struct OperRowListView { | @@ -83,7 +100,7 @@ export struct OperRowListView { | ||
| 83 | .onClick(() => { | 100 | .onClick(() => { |
| 84 | router.back(); | 101 | router.back(); |
| 85 | }) | 102 | }) |
| 86 | - TextInput({placeholder:'说两句...'}) | 103 | + TextInput({placeholder:'说两句11...'}) |
| 87 | .placeholderColor('#999999') | 104 | .placeholderColor('#999999') |
| 88 | .placeholderFont( | 105 | .placeholderFont( |
| 89 | { | 106 | { |
| @@ -112,10 +129,9 @@ export struct OperRowListView { | @@ -112,10 +129,9 @@ export struct OperRowListView { | ||
| 112 | .width('54.5%') | 129 | .width('54.5%') |
| 113 | } | 130 | } |
| 114 | .width('100%') | 131 | .width('100%') |
| 115 | - .height(56) | 132 | + .height(126) |
| 116 | .backgroundColor(Color.Black) | 133 | .backgroundColor(Color.Black) |
| 117 | } | 134 | } |
| 118 | - | ||
| 119 | /** | 135 | /** |
| 120 | * 组件项 | 136 | * 组件项 |
| 121 | * | 137 | * |
| @@ -125,7 +141,11 @@ export struct OperRowListView { | @@ -125,7 +141,11 @@ export struct OperRowListView { | ||
| 125 | buildOperationItem(item: OperationItem, index: number) { | 141 | buildOperationItem(item: OperationItem, index: number) { |
| 126 | Column() { | 142 | Column() { |
| 127 | if (item.text === '点赞') { | 143 | if (item.text === '点赞') { |
| 128 | - RelativeContainer() { | 144 | + LikeComponent({ |
| 145 | + data: this.likeBean | ||
| 146 | + }) | ||
| 147 | + | ||
| 148 | + /* RelativeContainer() { | ||
| 129 | Row() { | 149 | Row() { |
| 130 | Image(this.newsStatusOfUser?.likeStatus == '1' ? item.icon_check : item.icon) | 150 | Image(this.newsStatusOfUser?.likeStatus == '1' ? item.icon_check : item.icon) |
| 131 | .width(24) | 151 | .width(24) |
| @@ -134,6 +154,7 @@ export struct OperRowListView { | @@ -134,6 +154,7 @@ export struct OperRowListView { | ||
| 134 | .interpolation(ImageInterpolation.High) | 154 | .interpolation(ImageInterpolation.High) |
| 135 | .onClick(() => { | 155 | .onClick(() => { |
| 136 | this.toggleLikeStatus() | 156 | this.toggleLikeStatus() |
| 157 | + console.log('点赞_111', JSON.stringify(this.contentDetailData)) | ||
| 137 | }) | 158 | }) |
| 138 | } | 159 | } |
| 139 | .alignRules({ | 160 | .alignRules({ |
| @@ -168,7 +189,7 @@ export struct OperRowListView { | @@ -168,7 +189,7 @@ export struct OperRowListView { | ||
| 168 | .id(`e_row3_${index}`) | 189 | .id(`e_row3_${index}`) |
| 169 | } | 190 | } |
| 170 | } | 191 | } |
| 171 | - .id(`e_icon_${index}`) | 192 | + .id(`e_icon_${index}`)*/ |
| 172 | } else if (item.text === '收藏') { | 193 | } else if (item.text === '收藏') { |
| 173 | RelativeContainer() { | 194 | RelativeContainer() { |
| 174 | Row() { | 195 | Row() { |
-
Please register or login to post a comment