Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
陈剑华
2024-04-26 15:16:20 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
0c9cce45a56b9b770c2d12794df390856250ca5e
0c9cce45
2 parents
740d640f
65c96a06
Merge remote-tracking branch 'origin/main'
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
64 deletions
sight_harmony/features/wdBean/src/main/ets/bean/detail/UserInfoDTO.ts
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
sight_harmony/features/wdComponent/src/main/ets/model/LogoutModel.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/LogoutViewModel.ets
sight_harmony/features/wdBean/src/main/ets/bean/detail/UserInfoDTO.ts
View file @
0c9cce4
export
interface
UserInfoDTO
{
userHeadUrl
:
string
userHeadUrl
:
string
userName
?:
string
headPhotoUrl
?:
string
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
View file @
0c9cce4
...
...
@@ -13,6 +13,7 @@ import {
import DetailViewModel from '../viewmodel/DetailViewModel';
import { ImageAndTextWebComponent } from './ImageAndTextWebComponent';
import { OperRowListView } from './view/OperRowListView';
import router from '@ohos.router';
import { RecommendList } from '../components/view/RecommendList'
import { CommonConstants } from 'wdConstant';
import { HttpUrlUtils } from 'wdNetwork/Index';
...
...
@@ -20,7 +21,6 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
import { PageRepository } from '../repository/PageRepository';
import { detailedSkeleton } from './skeleton/detailSkeleton';
import { CommentComponent } from '../components/comment/view/CommentComponent'
const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
...
...
@@ -75,58 +75,16 @@ export struct ImageAndTextPageComponent {
isPageEnd: $isPageEnd
})
Column() {
// 点赞
if (this.contentDetailData[0]?.openLikes) {
Row() {
Row() {
if (this.newsStatusOfUser?.likeStatus === '1') {
Image(this.contentDetailData[0]?.likesStyle === 1 ? $r('app.media.ic_like_check') : (this.contentDetailData[0]?.likesStyle === 2 ? $r('app.media.icon_prayer_active') : $r('app.media.icon_candle_active')))
.width(24)
.height(24)
.margin({ right: 5 })
} else {
Image(this.contentDetailData[0]?.likesStyle === 1 ? $r('app.media.icon_like') : (this.contentDetailData[0]?.likesStyle === 2 ? $r('app.media.icon_prayer') : $r('app.media.icon_candle')))
.width(24)
.height(24)
.margin({ right: 5 })
}
Text(`${this.interactData?.likeNum || 0 }`)
.fontSize(16)
.fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999')
.fontWeight(500)
}
.width(140)
.height(36)
.justifyContent(FlexAlign.Center)
.alignItems(VerticalAlign.Center)
.borderRadius(20)
// .border({
// width: 1,
// color: '#EDEDED',
// })
.onClick(() => {
this.toggleLikeStatus()
})
}.width(CommonConstants.FULL_WIDTH).height(80)
.justifyContent(FlexAlign.Center)
Divider().strokeWidth(6).color('#f5f5f5')
}
if (this.recommendList.length > 0) {
RecommendList({ recommendList: this.recommendList })
}
// 评论
if(this.contentDetailData[0]?.openComment){
}
}
}
}
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.padding({ bottom:
12
6 })
.padding({ bottom:
7
6 })
.scrollBar(BarState.Off)
if (!this.isPageEnd) {
...
...
@@ -134,7 +92,45 @@ export struct ImageAndTextPageComponent {
}
//底部交互区
OperRowListView({ contentDetailData: this.contentDetailData[0] })
if (this.contentDetailData?.length) {
OperRowListView({contentDetailData: this.contentDetailData[0]})
}
/* Row() {
Image($r('app.media.icon_arrow_left'))
.width(24)
.height(24)
.onClick((event: ClickEvent) => {
router.back()
})
Row() {
Image($r('app.media.icon_comment'))
.width(24)
.height(24)
.margin({ right: 24 })
.id('comment')
Image($r('app.media.icon_star'))
.width(24)
.height(24)
.margin({ right: 24 })
Image($r('app.media.icon_listen'))
.width(24)
.height(24)
.margin({ right: 24 })
Image($r('app.media.icon_forward'))
.width(24)
.height(24)
}
}
.width(CommonConstants.FULL_WIDTH)
.height(56)
.padding({ left: 15, right: 15, bottom: 50, top: 20 })
.justifyContent(FlexAlign.SpaceBetween)
.backgroundColor(Color.White)*/
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
View file @
0c9cce4
...
...
@@ -13,6 +13,7 @@ import router from '@ohos.router';
import inputMethod from '@ohos.inputMethod';
import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel';
import { LikeComponent } from './LikeComponent';
import { CommentCustomDialog } from '../comment/view/CommentCustomDialog';
import { HttpUrlUtils } from 'wdNetwork/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { PageRepository } from '../../repository/PageRepository';
...
...
@@ -27,11 +28,13 @@ export interface OperationItem {
const TAG = 'OperRowListView';
@Preview
// @Preview
@Entry
@Component
export struct OperRowListView {
// private contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
@Prop contentDetailData: ContentDetailDTO
// @Prop contentDetailData: ContentDetailDTO
@State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
@State interactData: InteractDataDTO = {} as InteractDataDTO
@State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
@State likeBean: Record<string, string> = {}
...
...
@@ -71,12 +74,13 @@ export struct OperRowListView {
// this.data['channelId'] = "2059" //必须
// this.data['status'] = "1" //必须
this.likeBean['contentId'] = this.contentDetailData.newsId + ''
this.likeBean['userName'] = this.contentDetailData.
edito
rName + ''
this.likeBean['userName'] = this.contentDetailData.
userInfo?.use
rName + ''
this.likeBean['contentType'] = this.contentDetailData.newsType + ''
this.likeBean['title'] = this.contentDetailData.newsTitle + ''
this.likeBean['userHeaderUrl'] = ''
this.likeBean['userHeaderUrl'] =
this.contentDetailData.userInfo?.headPhotoUrl +
''
this.likeBean['channelId'] = this.contentDetailData.reLInfo?.channelId + ''
this.likeBean['status'] = ''
console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData))
console.info(TAG, 'likeBean----', JSON.stringify(this.likeBean))
}
build() {
...
...
@@ -100,7 +104,13 @@ export struct OperRowListView {
.onClick(() => {
router.back();
})
TextInput({placeholder:'说两句11...'})
Column() {
/*评论组件*/
/* CommentCustomDialog({
placeHolderText: '说两句'
})*/
}
/*TextInput({placeholder:'说两句...'})
.placeholderColor('#999999')
.placeholderFont(
{
...
...
@@ -116,9 +126,9 @@ export struct OperRowListView {
.borderRadius(0)
.onClick(() => {
this.buildInputMethod()
})
})
*/
}
.width('45.5%')
//
.width('45.5%')
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Start)
Flex({ justifyContent: FlexAlign.SpaceAround, alignItems:ItemAlign.Center }) {
...
...
@@ -129,8 +139,11 @@ export struct OperRowListView {
.width('54.5%')
}
.width('100%')
.height(
126
)
.height(
50
)
.backgroundColor(Color.Black)
.margin({
bottom: 20
})
}
/**
* 组件项
...
...
@@ -141,9 +154,12 @@ export struct OperRowListView {
buildOperationItem(item: OperationItem, index: number) {
Column() {
if (item.text === '点赞') {
/*点赞组件*/
if (this.likeBean?.contentId) {
LikeComponent({
data: this.likeBean
})
}
/* RelativeContainer() {
Row() {
...
...
@@ -191,6 +207,7 @@ export struct OperRowListView {
}
.id(`e_icon_${index}`)*/
} else if (item.text === '收藏') {
RelativeContainer() {
Row() {
Image(this.newsStatusOfUser?.collectStatus == 1 ? item.icon_check : item.icon)
...
...
@@ -236,7 +253,7 @@ export struct OperRowListView {
}
.id(`e_icon_${index}`)
} else if (item.text === '评论') {
RelativeContainer() {
/*
RelativeContainer() {
Row() {
Image(item.icon)
.width(24)
...
...
@@ -279,7 +296,7 @@ export struct OperRowListView {
.id(`e_row3_${index}`)
}
}
.id(`e_icon_${index}`)
.id(`e_icon_${index}`)
*/
} else {
RelativeContainer() {
Row() {
...
...
sight_harmony/features/wdComponent/src/main/ets/model/LogoutModel.ets
View file @
0c9cce4
import HashMap from '@ohos.util.HashMap';
import { UserDataLocal } from 'wdKit/Index';
import { HttpUrlUtils, ResponseDTO } from 'wdNetwork';
import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
import { HttpBizUtil, HttpUrlUtils, ResponseDTO } from 'wdNetwork';
export class LogoutModel{
requestLogout(){
let bean: Record<string, string> = {};
bean['refreshToken'] = HttpUrlUtils.getRefreshToken()
bean['refreshToken'] = 'ddrqreeee'
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return new Promise<string>((success, fail) => {
Http
Request
.post<ResponseDTO<string>>(HttpUrlUtils.accountLogoutUrl(), bean, headers).then((data: ResponseDTO<string>) => {
Http
BizUtil
.post<ResponseDTO<string>>(HttpUrlUtils.accountLogoutUrl(), bean, headers).then((data: ResponseDTO<string>) => {
if (!data) {
fail("数据为空")
return
...
...
@@ -23,7 +20,6 @@ export class LogoutModel{
success(data.message)
}, (error: Error) => {
fail(error.message)
// Logger.debug("LoginViewModel:error ", error.toString())
})
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/LogoutViewModel.ets
View file @
0c9cce4
import { SpConstants } from 'wdConstant/Index'
import { SPHelper } from 'wdKit/Index'
import { SPHelper
, UserDataLocal
} from 'wdKit/Index'
import { HttpUrlUtils } from 'wdNetwork/Index'
import { LogoutModel } from '../model/LogoutModel'
...
...
@@ -32,5 +32,6 @@ export class LogoutViewModel{
HttpUrlUtils.setUserId("")
HttpUrlUtils.setUserType("")
HttpUrlUtils.setUserToken('')
UserDataLocal.clearUserData()
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment