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
zhenghy
2024-05-10 17:02:08 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
08c9d09f15c6d044f02792012a7502d2a531d2b7
08c9d09f
2 parents
e560ca9e
22673b05
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
61 additions
and
148 deletions
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleRow06.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/MinePageMoreFunctionUI.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/MinePageUserSimpleInfoUI.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchHistoryComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/setting/MineSettingComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/EmptyComponent.ets
sight_harmony/features/wdComponent/src/main/ets/model/MineSettingDatasModel.ets
sight_harmony/features/wdComponent/src/main/ets/pages/MineHomePage.ets
sight_harmony/features/wdComponent/src/main/resources/base/media/mine_user_arrow.png
sight_harmony/features/wdComponent/src/main/resources/base/media/mine_user_arrow_2.png
sight_harmony/features/wdComponent/src/main/resources/base/media/mine_user_edit.png
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabLiveComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentComponent.ets
View file @
08c9d09
import ArrayList from '@ohos.util.ArrayList'
import { ViewType } from 'wdConstant/Index';
import { DateTimeUtils, EmitterEventId, EmitterUtils, LazyDataSource } from 'wdKit/Index';
import PageModel from '../../../viewmodel/PageModel';
import { commentItemModel, commentListModel, WDPublicUserType } from '../model/CommentModel';
import commentViewModel from '../viewmodel/CommentViewModel'
import { commentItemModel, WDPublicUserType } from '../model/CommentModel';
import commentViewModel from '../viewmodel/CommentViewModel';
import { CommentText } from './CommentText';
import measure from '@ohos.measure'
import { CommentCustomDialog } from './CommentCustomDialog'
import { CommentCustomDialog } from './CommentCustomDialog';
import { publishCommentModel } from '../model/PublishCommentModel';
import { ifaa } from '@kit.OnlineAuthenticationKit';
import { HttpUrlUtils, HttpUtils } from 'wdNetwork/Index';
import NoMoreLayout from '../../page/NoMoreLayout';
import { HttpUtils } from 'wdNetwork/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import {
ColorUtils } from '../../../utils/ColorUtils
';
import {
EmptyComponent } from '../../view/EmptyComponent
';
const TAG = 'CommentComponent';
...
...
@@ -23,14 +17,12 @@ const testString = '因为读书的人\n是低着头向上看的人\n身处一
@Component
export struct CommentComponent {
@State hasMore: boolean = true;
@State
currentPage: number = 1;
@State currentPage: number = 1;
// @State private browSingModel: commentListModel = new commentListModel()
/*必传*/
@ObjectLink publishCommentModel: publishCommentModel
listScroller: ListScroller = new ListScroller(); // scroller控制器
historyOffset: number = 0; // 上次浏览到列表距离顶端的偏移量offset
isloading: boolean = false
@State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource();
@State dialogController: CustomDialogController | null = null;
...
...
@@ -142,7 +134,7 @@ export struct CommentComponent {
build() {
Column() {
List({
scroller:this.listScroller
}) {
List({
scroller: this.listScroller
}) {
ListItemGroup({ header: this.titleHeader() })
LazyForEach(this.allDatas, (item: commentItemModel, index: number) => {
...
...
@@ -181,10 +173,15 @@ export struct CommentComponent {
// 加载更多
ListItem() {
if (this.hasMore === false) NoMoreLayout()
if (this.hasMore === false) {
// NoMoreLayout()
EmptyComponent({ emptyType: 17 })
.height(300)
}
}
}
.onReachEnd(()
=>
{
.onReachEnd(()
=>
{
if (this.hasMore) {
this.getData()
}
...
...
@@ -197,11 +194,13 @@ export struct CommentComponent {
//获取数据
async getData() {
commentViewModel.fetchContentCommentList(this.currentPage + '', this.publishCommentModel.targetId, this.publishCommentModel.targetType)
commentViewModel.fetchContentCommentList(this.currentPage + '', this.publishCommentModel.targetId,
this.publishCommentModel.targetType)
.then(commentListModel => {
this.currentPage++
if (Number.parseInt(commentListModel.totalCommentNum) > Number.parseInt(this.publishCommentModel.totalCommentNumer)) {
if (Number.parseInt(commentListModel.totalCommentNum) >
Number.parseInt(this.publishCommentModel.totalCommentNumer)) {
this.publishCommentModel.totalCommentNumer = commentListModel.totalCommentNum + ''
}
...
...
@@ -223,7 +222,7 @@ export struct CommentComponent {
});
}
else
{
}
else
{
this.hasMore = false
}
})
...
...
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleRow06.ets
View file @
08c9d09
import { commentInfo, CompDTO, ContentDTO, Params } from 'wdBean';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { HttpUtils } from 'wdNetwork/Index';
import { postInteractAccentionOperateParams } from 'wdBean';
import { PageRepository } from '../../repository/PageRepository';
import { DateTimeUtils } from 'wdKit/Index';
import { DateTimeUtils, SPHelper } from 'wdKit/Index';
import { ProcessUtils } from 'wdRouter';
import { SpConstants } from 'wdConstant/Index'
/**
* 精选评论卡
...
...
@@ -32,6 +30,20 @@ export struct ZhSingleRow06 {
@State compDTO: CompDTO = {} as CompDTO
@State likeBl: boolean = false;
async likeAction() {
const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
if (!user_id) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
if (this.likeBl) {
this.likeBl = false;
} else {
this.likeBl = true;
}
}
build() {
Column() {
//顶部
...
...
@@ -41,6 +53,7 @@ export struct ZhSingleRow06 {
Column(){
Text(this.compDTO.operDataList[0]?.commentInfo?.commentTitle)
.fontWeight(500)
.maxLines(4)
.textOverflow({overflow: TextOverflow.Ellipsis})
.lineHeight(23)
...
...
@@ -88,15 +101,11 @@ export struct ZhSingleRow06 {
.margin({right: 3})
Text('点赞')
.fontSize(1
4
)
.fontSize(1
5
)
.fontColor(0x999999)
}
.onClick(() => {
if (this.likeBl) {
this.likeBl = false;
} else {
this.likeBl = true;
}
this.likeAction()
})
}
.justifyContent(FlexAlign.SpaceBetween)
...
...
@@ -125,6 +134,7 @@ export struct ZhSingleRow06 {
.fontSize(14)
.fontColor(0x222222)
.maxLines(1)
.fontWeight(500)
.textOverflow({overflow: TextOverflow.Ellipsis})
}
.onClick(() => {
...
...
@@ -155,106 +165,3 @@ function textOverflowStyle(maxLine: number) {
.maxLines(maxLine)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}
@Component
struct CreatorItem {
@Prop item: ContentDTO
@State rmhIsAttention: number = 0
build() {
ListItem() {
Column() {
Flex({direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween}) {
Column() {
Row() {
Image('')
.width(20)
.height(20)
.margin({right: 4})
.border({width: 1, color: 0xcccccc, radius: 10})
Text('立志之间')
.fontColor(0x212228)
.fontSize(12)
}
}
Column() {
Row() {
Image($r('app.media.icon_like_no'))
.width(16)
.height(16)
.margin({right: 4})
Text('3835')
.fontSize(14)
.fontColor(0x999999)
}
}
}
.margin({top: 10, left: 10, right: 10, bottom: 8})
Text('就业不仅是民生问题,也是发展问题,就业不仅是民生问题,也是发展问题,就业不仅是民生问题,也是发展问题,')
.maxLines(2)
.textOverflow({overflow: TextOverflow.Ellipsis})
.margin({left: 10, right: 10, bottom: 8})
.fontSize(17)
.fontColor(0x212228)
.lineHeight(25)
Row() {
Image('')
.width(66)
.height(44)
.borderRadius({topLeft: 3, topRight: 0, bottomLeft: 3, bottomRight: 0})
Text('原文|强化就业优先政策 健全就业促进机制原文|强化就业优先政策 健全就业促进机制原文|强化就业优先政策 健全就业促进机制')
.margin({left: 8})
.width(172)
.maxLines(2)
.textOverflow({overflow: TextOverflow.Ellipsis})
}
.linearGradient({
direction: GradientDirection.Right,
colors: [[0xffffff, 0.0],[0xffffff, 0.8], [0xf9f9f9, 1.0]]
})
}
.width(276)
.height(150)
.margin({ right: 10 })
.borderWidth(1)
.borderColor($r('app.color.color_EDEDED'))
.borderRadius($r('app.float.image_border_radius'))
.backgroundColor(0xf9f9f9)
}
.onClick(() => {
console.log('跳转到rmh');
})
}
/**
* 关注号主 TODO 这里后面需要抽离
*/
handleAccention(item: ContentDTO, status: number) {
this.rmhIsAttention = this.rmhIsAttention ? 0 : 1
return
// 未登录,跳转登录
if (!HttpUtils.getUserId()) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
const params: postInteractAccentionOperateParams = {
attentionUserType: item.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号)
attentionUserId: item.rmhInfo?.userId || '', // 被关注用户号主id
attentionCreatorId: item.rmhInfo?.rmhId || '', // 被关注用户号主id
// userType: 1,
// userId: '1', // TODO 用户id需要从本地获取
status: status,
}
PageRepository.postInteractAccentionOperate(params).then(res => {
console.log(TAG, '关注号主==', JSON.stringify(res.data))
if (status === 1) {
this.rmhIsAttention = 0
} else {
this.rmhIsAttention = 1
}
})
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/MinePageMoreFunctionUI.ets
View file @
08c9d09
...
...
@@ -47,7 +47,7 @@ export default struct MinePageMoreFunctionUI {
.fontWeight(400)
Blank()
Image($r('app.media.mine_user_arrow'))
Image($r('app.media.mine_user_arrow
_2
'))
.width('27lpx')
.height('27lpx')
.objectFit(ImageFit.Auto)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/MinePageUserSimpleInfoUI.ets
View file @
08c9d09
...
...
@@ -83,14 +83,15 @@ export default struct MinePageUserSimpleInfoUI {
.height('29lpx')
}.margin({top:'15lpx'})
}.alignItems(HorizontalAlign.Start)
.margin({top:'12lpx',left:'
17
lpx'})
.margin({top:'12lpx',left:'
23
lpx'})
.width('352lpx')
}else{
Row(){
Text("登录注册")
.fontColor($r('app.color.color_222222'))
.textOverflow({ overflow: TextOverflow.Ellipsis })
.fontSize('33lpx')
.fontSize('38lpx')
.lineHeight("46lpx")
.fontWeight(600)
Image($r('app.media.mine_user_edit'))
.width('11lpx')
...
...
@@ -101,7 +102,7 @@ export default struct MinePageUserSimpleInfoUI {
}.onClick(()=>{
this.jumpLogin()
})
.margin({top:'11lpx',left:'
17
lpx'})
.margin({top:'11lpx',left:'
23
lpx'})
.width('352lpx')
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponent.ets
View file @
08c9d09
import { BottomNavDTO, CompDTO, TopNavDTO } from 'wdBean';
import { SpConstants } from 'wdConstant';
import { DisplayUtils, LazyDataSource, Logger, SPHelper } from 'wdKit';
import { DisplayUtils, LazyDataSource, Logger, SPHelper
, NetworkUtil, ToastUtils
} from 'wdKit';
import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter';
import { PageComponent } from './PageComponent';
import { ChannelSubscriptionLayout } from './ChannelSubscriptionLayout';
...
...
@@ -209,7 +209,11 @@ export struct TopNavigationComponent {
.height(30)
.width(124)
.onClick(() => {
ProcessUtils.gotoMorningEveningPaper()
if (NetworkUtil.isNetConnected()) {
ProcessUtils.gotoMorningEveningPaper()
} else {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
}
})
}.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchHistoryComponent.ets
View file @
08c9d09
...
...
@@ -17,7 +17,8 @@ export struct SearchHistoryComponent{
this.onAccept()
},
title: "确认清空历史记录",
tipShow:false
tipShow:false,
leftTextColor:$r('app.color.color_648DF2')
}),
autoCancel: true,
alignment: DialogAlignment.Center,
...
...
sight_harmony/features/wdComponent/src/main/ets/components/setting/MineSettingComponent.ets
View file @
08c9d09
...
...
@@ -256,7 +256,7 @@ export struct MineSettingComponent {
// 右侧文案和右箭头
Row() {
Text((item.itemType=='clear_cache') ? this.cacheSize.toFixed(2) + 'M
B
' : '')
Text((item.itemType=='clear_cache') ? this.cacheSize.toFixed(2) + 'M' : '')
.fontColor('#999999')
.maxLines(1)
Image($r('app.media.mine_user_arrow'))
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/EmptyComponent.ets
View file @
08c9d09
...
...
@@ -231,7 +231,7 @@ export struct EmptyComponent {
this.emptyType === WDViewDefaultType.WDViewDefaultType_NoComment1) {
imageString = $r('app.media.icon_no_comment')
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoSearchResult) {
imageString = $r('app.media.icon_no_result')
imageString = $r('app.media.icon_no_result
1
')
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) {
imageString = $r('app.media.icon_no_net1')
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) {
...
...
sight_harmony/features/wdComponent/src/main/ets/model/MineSettingDatasModel.ets
View file @
08c9d09
...
...
@@ -47,13 +47,13 @@ class MineSettingDatasModel{
this.mainSettingData.push(new MineMainSettingFunctionItem(null, '接收推送', null, 1, pushState,"push_switch"))
this.mainSettingData.push(new MineMainSettingFunctionItem(null, '隐私设罝', null, 0, false,"private_setting"))
let wifiState=SPHelper.default.getSync(SpConstants.SETTING_WIFI_IMAGE_SWITCH,false) as boolean
this.mainSettingData.push(new MineMainSettingFunctionItem(null, '仅
WiF
i网络加载图片', null, 1, wifiState,"wifi_switch"))
this.mainSettingData.push(new MineMainSettingFunctionItem(null, '仅
wif
i网络加载图片', null, 1, wifiState,"wifi_switch"))
let videoState=SPHelper.default.getSync(SpConstants.SETTING_WIFI_VIDEO_SWITCH,false) as boolean
this.mainSettingData.push(new MineMainSettingFunctionItem(null, '
WiF
i网络情况下自动播放视频', null, 1, videoState,"video_switch"))
this.mainSettingData.push(new MineMainSettingFunctionItem(null, '
wif
i网络情况下自动播放视频', null, 1, videoState,"video_switch"))
let suspensionState=SPHelper.default.getSync(SpConstants.SETTING_SUSPENSION_SWITCH,false) as boolean
this.mainSettingData.push(new MineMainSettingFunctionItem(null, '开启播放器悬浮窗', null, 1, suspensionState,"suspensionState_switch"))
this.mainSettingData.push(new MineMainSettingFunctionItem(null, null, null, 2, null,""))
this.mainSettingData.push(new MineMainSettingFunctionItem(null, '清
除
缓存', '32MB', 0, false,"clear_cache"))
this.mainSettingData.push(new MineMainSettingFunctionItem(null, '清
理
缓存', '32MB', 0, false,"clear_cache"))
this.mainSettingData.push(new MineMainSettingFunctionItem(null, '评价我们', null, 0, false,""))
return this.mainSettingData
...
...
sight_harmony/features/wdComponent/src/main/ets/pages/MineHomePage.ets
View file @
08c9d09
...
...
@@ -392,7 +392,7 @@ struct MineHomePage {
this.userName = value.userName
this.headPhotoUrl = value.headPhotoUrl
if(StringUtils.isNotEmpty(value.introduction)){
this.desc = value.introduction
this.desc =
"简介:" +
value.introduction
this.isHasIntroduction = true
}else{
this.desc = "点击添加简介,让大家认识你"
...
...
sight_harmony/features/wdComponent/src/main/resources/base/media/mine_user_arrow.png
View file @
08c9d09
202 Bytes
|
W:
|
H:
278 Bytes
|
W:
|
H:
2-up
Swipe
Onion skin
sight_harmony/features/wdComponent/src/main/resources/base/media/mine_user_arrow_2.png
0 → 100644
View file @
08c9d09
271 Bytes
sight_harmony/features/wdComponent/src/main/resources/base/media/mine_user_edit.png
View file @
08c9d09
290 Bytes
|
W:
|
H:
276 Bytes
|
W:
|
H:
2-up
Swipe
Onion skin
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabLiveComponent.ets
View file @
08c9d09
...
...
@@ -90,7 +90,7 @@ export struct TabLiveComponent {
20)
.then(
(data) => {
Logger.debug(TAG, `${JSON.stringify(data)}`)
Logger.debug(TAG,
'直播间数据:' +
`${JSON.stringify(data)}`)
if (data.barrageResponses && data.barrageResponses.length > 0) {
/**
* 在直播聊天添加一条新内容逻辑:
...
...
@@ -117,6 +117,7 @@ export struct TabLiveComponent {
if (StringUtils.isEmpty(this.liveDetailsBean.oldNewsId)
&& this.liveDetailsBean
&& this.liveDetailsBean.liveInfo.liveState != 'wait') {
this.pageModel.viewType = ViewType.LOADED;
this.updateLiveListData()
} else {
this.pageModel.viewType = ViewType.EMPTY;
...
...
Please
register
or
login
to post a comment