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
yumaochao
2024-05-16 16:50:44 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
34756ed6474c2b75a0af30114683be3bfff1cf5b
34756ed6
2 parents
050f39f4
c6847b7e
Merge branch 'main' of
http://192.168.1.42/developOne/harmonyPool
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
169 additions
and
124 deletions
sight_harmony/features/wdComponent/src/main/ets/components/CardParser.ets
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/ImageDownloadComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/InteractMessage/InteractMComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/SpacialTopicPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/CardSourceInfo.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/RmhTitle.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card2Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card3Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card5Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card6Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentTabComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleRow03.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserInfoPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/InteractMessagePage.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/MyCollectionListPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/LikeComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
sight_harmony/features/wdComponent/src/main/ets/utils/InsightIntentShare.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/EditInfoViewModel.ets
sight_harmony/features/wdComponent/src/main/resources/base/element/float.json
sight_harmony/features/wdComponent/src/main/resources/base/media/ic_like_back_new.png
sight_harmony/products/phone/src/main/ets/pages/SpacialTopicPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/CardParser.ets
View file @
34756ed
...
...
@@ -44,7 +44,7 @@ export struct CardParser {
} else if (contentDTO.appStyle === CompStyle.Card_04) {
Card4Component({ compDTO: this.compDTO, contentDTO })
} else if (contentDTO.appStyle === CompStyle.Card_05) {
Card5Component({ contentDTO, titleShowPolicy: this.compDTO.titleShowPolicy })
Card5Component({ contentDTO, titleShowPolicy: this.compDTO.titleShowPolicy
, compDTO: this.compDTO
})
} else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle
.Card_13) {
Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO })
...
...
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
View file @
34756ed
...
...
@@ -103,7 +103,7 @@ export struct DynamicDetailComponent {
//分割线
Image($r('app.media.ic_news_detail_division'))
.width('100%')
.height($r('app.float.margin_
9
'))
.height($r('app.float.margin_
12
'))
.padding({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') })
Stack({ alignContent: Alignment.Bottom }) {
if (!this.isNetConnected) {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageDownloadComponent.ets
View file @
34756ed
...
...
@@ -25,6 +25,7 @@ export struct ImageDownloadComponent {
build() {
Column() {
SaveButton({ icon: SaveIconStyle.LINES })
.iconSize(24)
.iconColor(Color.White)
.onClick(async () => {
console.info(`cj2024 onClick ${this.imageBuffer}`)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/InteractMessage/InteractMComponent.ets
View file @
34756ed
...
...
@@ -42,7 +42,7 @@ export struct InteractMComponent {
.constraintSize({maxHeight:500})
}
if(this.messageModel.contentType != '211'
&& this.messageModel.contentType != '210'
){
if(this.messageModel.contentType != '211'){
Column(){
if (this.messageModel.contentType === '207' || this.messageModel.contentType === '209'){
Text('[你的评论]'+this.buildCommentContent()).fontSize('14fp').fontColor('#666666').constraintSize({maxHeight:500})
...
...
sight_harmony/features/wdComponent/src/main/ets/components/SpacialTopicPageComponent.ets
View file @
34756ed
...
...
@@ -20,7 +20,7 @@ export struct SpacialTopicPageComponent {
action: Action = {} as Action
@State webUrl: string = '';
@State isPageEnd: boolean = false
@
State
reload: number = 0;
@
Prop
reload: number = 0;
@Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean
private webPrepared = false;
...
...
@@ -134,13 +134,6 @@ export struct SpacialTopicPageComponent {
}.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)
}
onPageShow() {
if (!this.action?.params?.backVisibility) {
WindowModel.shared.setWindowLayoutFullScreen(true)
}
this.reload++
}
aboutToAppear() {
if (!this.action?.params?.backVisibility) {
WindowModel.shared.setWindowLayoutFullScreen(true)
...
...
@@ -149,12 +142,6 @@ export struct SpacialTopicPageComponent {
this.getDetail()
}
onPageHide() {
if (!this.action?.params?.backVisibility) {
WindowModel.shared.setWindowLayoutFullScreen(false)
}
}
aboutToDisappear() {
if (!this.action?.params?.backVisibility) {
WindowModel.shared.setWindowLayoutFullScreen(false)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/CardSourceInfo.ets
View file @
34756ed
...
...
@@ -11,19 +11,19 @@ export struct CardSourceInfo {
Flex() {
if (this.contentDTO.corner) {
Text(this.contentDTO.corner)
.fontSize($r("app.float.font_size_1
2
"))
.fontSize($r("app.float.font_size_1
1
"))
.fontColor($r("app.color.color_ED2800"))
.margin({ right: 2 })
}
if (this.contentDTO.rmhPlatform === 1) {
Text(this.contentDTO.rmhInfo?.rmhName)
.fontSize($r("app.float.font_size_1
2
"))
.fontSize($r("app.float.font_size_1
1
"))
.fontColor($r("app.color.color_B0B0B0"))
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
} else if (this.contentDTO.source) {
Text(`${this.contentDTO.source}`)
.fontSize($r("app.float.font_size_1
2
"))
.fontSize($r("app.float.font_size_1
1
"))
.fontColor($r("app.color.color_B0B0B0"))
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
...
...
@@ -43,13 +43,13 @@ export struct CardSourceInfo {
.height(16)
}
Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)))
.fontSize($r("app.float.font_size_1
2
"))
.fontSize($r("app.float.font_size_1
1
"))
.fontColor($r("app.color.color_B0B0B0"))
.flexShrink(0)
}
if (this.getContentDtoBean()?.interactData?.commentNum) {
Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`)
.fontSize($r("app.float.font_size_1
2
"))
.fontSize($r("app.float.font_size_1
1
"))
.fontColor($r("app.color.color_B0B0B0"))
.flexShrink(0)
.margin({ left: 6 })
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/RmhTitle.ets
View file @
34756ed
...
...
@@ -13,11 +13,13 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import router from '@ohos.router'
import { postBatchAttentionStatusParams } from 'wdBean/Index';
import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
@Component
export struct RmhTitle {
@Prop rmhInfo: RmhInfoDTO
@Prop publishTime: string | undefined
@State loadImg: boolean = false;
/**
* 是否需要隐藏发布时间超过2天的时间展示,默认不隐藏
*/
...
...
@@ -76,13 +78,15 @@ export struct RmhTitle {
}
}
a
boutToAppear(): void
{
a
sync aboutToAppear(): Promise<void>
{
this.getBatchAttentionStatus()
let page = router.getState();
if (page.path.includes('/page/PeopleShipHomePage') || page.path.includes('/pages/MainPage')) {
this.hideTime = true;
}
this.loadImg = await onlyWifiLoadImg();
}
getDaysBetweenDates(date: number) {
...
...
@@ -96,7 +100,7 @@ export struct RmhTitle {
build() {
Flex() {
Stack() {
Image(this.
rmhInfo?.rmhHeadUrl
)
Image(this.
loadImg ? this.rmhInfo?.rmhHeadUrl : $r('app.media.comment_rmh_tag')
)
.width(36)
.height(36).borderRadius(50)
Image(this.rmhInfo?.authIcon)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card2Component.ets
View file @
34756ed
...
...
@@ -7,8 +7,6 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
import { Notes } from './notes';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
// import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { viewBlogInsightIntentShare, ActionMode } from '../../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
const TAG: string = 'Card2Component';
/**
...
...
@@ -111,11 +109,6 @@ export struct Card2Component {
this.clicked = true;
// persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
if (this.contentDTO?.channelId === '2001' || this.contentDTO?.channelId === '2002') {
let context = getContext(this) as common.UIAbilityContext;
viewBlogInsightIntentShare(context, this.contentDTO?.channelId, [this.compDTO], ActionMode.EXECUTED)
}
})
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card3Component.ets
View file @
34756ed
...
...
@@ -50,6 +50,7 @@ export struct Card3Component {
Span(this.contentDTO.newsTitle)
}
}
.lineHeight(27)
.fontSize($r("app.float.font_size_18"))
.fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222"))
.width(CommonConstants.FULL_WIDTH)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card5Component.ets
View file @
34756ed
import { ContentDTO } from 'wdBean';
import { ContentDTO
, CompDTO
} from 'wdBean';
import { CommonConstants } from 'wdConstant';
import { ProcessUtils } from 'wdRouter';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { Notes } from './notes';
import { viewBlogInsightIntentShare, ActionMode } from '../../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
const TAG: string = 'Card5Component';
...
...
@@ -13,6 +15,7 @@ const TAG: string = 'Card5Component';
export struct Card5Component {
@State contentDTO: ContentDTO = new ContentDTO();
@Prop titleShowPolicy: number | string
@Prop compDTO: CompDTO = {} as CompDTO
@State loadImg: boolean = false;
@State clicked: boolean = false;
@State titleMarked: boolean = false;
...
...
@@ -97,6 +100,8 @@ export struct Card5Component {
.onClick((event: ClickEvent) => {
this.clicked = true;
ProcessUtils.processPage(this.contentDTO)
let context = getContext(this) as common.UIAbilityContext;
viewBlogInsightIntentShare(context, this.contentDTO?.channelId, [this.compDTO], ActionMode.EXECUTED)
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card6Component.ets
View file @
34756ed
...
...
@@ -71,7 +71,7 @@ export struct Card6Component {
}
.fontColor(this.clicked ? 0x848484 : 0x222222)
.fontSize(18)
.lineHeight(2
4
)
.lineHeight(2
7
)
.fontWeight(FontWeight.Normal)
.maxLines(3)
.alignSelf(ItemAlign.Start)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentTabComponent.ets
View file @
34756ed
...
...
@@ -156,7 +156,7 @@ export struct CommentIconComponent {
// Stack({alignContent:Alignment.Start}) {
if (Number.parseInt(this.publishCommentModel.totalCommentNumer) != 0) {
RelativeContainer() {
Image(
$r('app.media.comment_icon_number_bg
'))
Image(
this.styleType == 1 ? $r('app.media.comment_icon_number_bg'):$r('app.media.ic_like_back_Select
'))
.objectFit(ImageFit.Fill)
.resizable({
slice: {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleRow03.ets
View file @
34756ed
...
...
@@ -40,7 +40,6 @@ export struct ZhSingleRow03 {
// 请求所有预约状态
async getReserveState() {
this.reservedIds = []
const reserveBean: reserveReqItem[] = this.compDTO.operDataList.map((item: ContentDTO) => {
const reqItem: reserveReqItem = {
liveId: item.objectId.toString(),
...
...
@@ -49,6 +48,7 @@ export struct ZhSingleRow03 {
return reqItem;
})
const res = await LiveModel.getAppointmentStatus(reserveBean);
this.reservedIds = []
// this.reserveStatus = res;
Logger.debug(TAG, '数据信息:' + `${JSON.stringify(res)}`)
res.map((item: ReserveItemBean) => {
...
...
@@ -280,6 +280,8 @@ struct CreatorItem {
.backgroundColor(0xf5f5f5)
.width(156)
.height(208)
.border({width: 1})
.borderRadius(3)
Row()
.width(156)
.height(80)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserInfoPage.ets
View file @
34756ed
...
...
@@ -27,7 +27,7 @@ struct EditUserInfoPage {
}
}),
alignment: DialogAlignment.Bottom,
offset:{dx:0,dy:
-2
0},
offset:{dx:0,dy:0},
})
aboutToAppear() {
...
...
@@ -104,7 +104,7 @@ struct EditUserInfoPage {
.textOverflow({overflow:TextOverflow.Ellipsis})
.maxLines(1)
.fontSize(14)
.fontColor(r.subTitle === '待完善'?'#
999999
':'#666666')
.fontColor(r.subTitle === '待完善'?'#
cccccc
':'#666666')
.padding({right:10})
.width('70%')
.textAlign(TextAlign.End)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/InteractMessagePage.ets
View file @
34756ed
...
...
@@ -8,6 +8,7 @@ import { CustomTitleUI } from '../reusable/CustomTitleUI';
import { InteractMComponent } from '../InteractMessage/InteractMComponent';
import { InteractMessageModel, WDMessageCenterMessageType } from '../../model/InteractMessageModel';
import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh';
import { NetworkUtil } from 'wdKit/Index';
@Entry
@Component
...
...
@@ -28,10 +29,9 @@ struct InteractMessagePage {
build() {
Column(){
CustomTitleUI({titleName:'互动消息'})
if(this.browSingModel.viewType == ViewType.ERROR){
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NetworkFailed})
}else if(this.browSingModel.viewType == ViewType.EMPTY){
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoMessage})
if(this.browSingModel.viewType == ViewType.EMPTY){
EmptyComponent({emptyType:this.browSingModel.emptyType})
}else {
CustomPullToRefresh({
alldata:this.allDatas,
...
...
@@ -114,6 +114,9 @@ struct InteractMessagePage {
}
async getData(resolve?: (value: string | PromiseLike<string>) => void){
let netStatus = NetworkUtil.isNetConnected()
if (netStatus) {
InteractMessageViewModel.fetchMessageList(WDMessageCenterMessageType.WDMessageCenterMessageType_Interact,this.currentPage).then(InteractMessageMItem => {
if(resolve) resolve('刷新成功')
if (InteractMessageMItem && InteractMessageMItem.list && InteractMessageMItem.list.length > 0) {
...
...
@@ -137,9 +140,14 @@ struct InteractMessagePage {
} else {
if (this.currentPage === 1) {
this.browSingModel.viewType = ViewType.EMPTY;
this.browSingModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoMessage;
}
}
})
}else {
this.browSingModel.viewType = ViewType.EMPTY;
this.browSingModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoNetwork;
}
}
async getMessageLikeCount(){
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/MyCollectionListPage.ets
View file @
34756ed
...
...
@@ -12,6 +12,7 @@ import { BigPicCardComponent } from '../view/BigPicCardComponent';
import { contentListItemParams } from '../../model/MyCollectionModel';
import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh';
import { MyCustomDialog } from '../reusable/MyCustomDialog'
import { NetworkUtil } from 'wdKit/Index';
@Entry
@Component
...
...
@@ -26,6 +27,7 @@ struct MyCollectionListPage {
@State currentPage: number = 1;
private scroller: Scroller = new Scroller();
emptyType: WDViewDefaultType = WDViewDefaultType.WDViewDefaultType_Default
dialogController: CustomDialogController = new CustomDialogController({
builder: MyCustomDialog({
...
...
@@ -53,10 +55,8 @@ struct MyCollectionListPage {
this.deleteNum = 0
}})
if(this.browSingModel.viewType == ViewType.ERROR){
ErrorComponent()
}else if(this.browSingModel.viewType == ViewType.EMPTY){
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoCollection})
if(this.browSingModel.viewType == ViewType.EMPTY){
EmptyComponent({emptyType:this.browSingModel.emptyType})
}else {
CustomPullToRefresh({
alldata:this.allDatas,
...
...
@@ -137,7 +137,10 @@ struct MyCollectionListPage {
}
}
async getData(resolve?: (value: string | PromiseLike<string>) => void) {
let netStatus = NetworkUtil.isNetConnected()
if (netStatus) {
MyCollectionViewModel.fetchMyCollectList(1,'1',this.currentPage,getContext(this)).then(collectionItem => {
if(resolve) resolve('刷新成功')
if (collectionItem && collectionItem.list && collectionItem.list.length > 0) {
...
...
@@ -159,9 +162,14 @@ struct MyCollectionListPage {
} else {
if (this.currentPage === 1) {
this.browSingModel.viewType = ViewType.EMPTY;
this.browSingModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoCollection
}
}
})
} else {
this.browSingModel.viewType = ViewType.EMPTY;
this.browSingModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoNetwork;
}
}
//数据处理
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/LikeComponent.ets
View file @
34756ed
import { Logger, NumberFormatterUtils } from 'wdKit/Index'
import {
DisplayUtils,
Logger, NumberFormatterUtils } from 'wdKit/Index'
import { LikeViewModel } from '../../viewmodel/LikeViewModel'
import { SPHelper } from 'wdKit';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { SpConstants } from 'wdConstant/Index';
import { ContentDetailDTO } from 'wdBean/Index';
import measure from '@ohos.measure'
const TAG = 'LikeComponent';
...
...
@@ -168,30 +168,74 @@ export struct LikeComponent {
likeCompStyle5() {
//1: 底部栏目样式 默认样式
Stack({ alignContent: Alignment.Bottom }) {
Column() {
// Image(this.likeStatus ? $r('app.media.icon_like_select') : $r('app.media.icon_like_default'))
Image(this.transLikeStyle().url)
.width(24)
.height(24)
.onClick(() => {
this.clickButtonEvent()
})
if (this.likeCount > 0){
RelativeContainer() {
Image(this.likeStatus ? $r('app.media.ic_like_back_Select') : $r('app.media.ic_like_back'))
.objectFit(ImageFit.Fill)
.resizable({
slice: {
top: 1,
left: 20,
right: 1,
bottom: 1
}
})
.alignRules({
top: { anchor: "Text", align: VerticalAlign.Top },
left: { anchor: "Text", align: HorizontalAlign.Start },
right: { anchor: "Text", align: HorizontalAlign.End },
bottom: { anchor: "Text", align: VerticalAlign.Bottom },
})
.id("Image")
Row() {
Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || ''))
Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || ''))// Text("44444444")
.fontSize(8)
.fontColor(Color.White)
.padding({ left: 4, right: 2 })
}
.fontColor('#ffffff')// .backgroundColor('#ED2800')
.height(12)
.alignItems(VerticalAlign.Center)
.position({ x: '100%', })
.markAnchor({ x: '100%' })
.backgroundImage(this.likeStatus ? $r('app.media.ic_like_back_Select') : $r('app.media.ic_like_back'))
.backgroundImageSize(ImageSize.Auto)
.textAlign(TextAlign.Center)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})/*动态计算文字宽度*/
.width(this.getMeasureText(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) +
12)// .backgroundColor(Color.Green)
.id("Text")
.visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden)
}.width(24).height(24)
}
.offset({
x: 12
})
}
// Column() {
// // Image(this.likeStatus ? $r('app.media.icon_like_select') : $r('app.media.icon_like_default'))
// Image(this.transLikeStyle().url)
// .width(24)
// .height(24)
// .onClick(() => {
// this.clickButtonEvent()
// })
// }
//
// Row() {
// Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || ''))
// .fontSize(8)
// .fontColor(Color.White)
// .padding({ left: 4, right: 2 })
// }
// .height(12)
// .alignItems(VerticalAlign.Center)
// .position({ x: '100%', })
// .markAnchor({ x: '100%' })
// .backgroundImage(this.likeStatus ? $r('app.media.ic_like_back_Select') : $r('app.media.ic_like_back'))
// .backgroundImageSize(ImageSize.Auto)
// .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden)
}.width(24).height(24).onClick(() => {
this.clickButtonEvent()
})
}
@Builder
...
...
@@ -210,8 +254,6 @@ export struct LikeComponent {
.height(36)
.borderRadius(18)
.backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : '#FFF5F5F5')
Row() {
Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || ''))
.fontSize(8)
...
...
@@ -306,4 +348,14 @@ export struct LikeComponent {
this.likeCount = 0
})
}
private getMeasureText(text: string) {
let width = measure.measureText({
textContent: text,
fontSize: 8,
lineHeight: 12,
constraintWidth: DisplayUtils.getDeviceWidth(),
})
width = px2vp(width)
return width
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
View file @
34756ed
...
...
@@ -135,7 +135,8 @@ export struct OperRowListView {
Column() {
Image($r('app.media.ic_news_detail_division'))
.width('100%')
.height($r('app.float.margin_4'))
.height($r('app.float.margin_1'))
.margin({bottom: -2})
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
// AudioDialog()
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/InsightIntentShare.ets
View file @
34756ed
import { common } from '@kit.AbilityKit';
import { insightIntent } from '@kit.IntentsKit';
import { BusinessError } from '@kit.BasicServicesKit';
import { CompDTO, CompList, ContentDTO, PageInfoBean } from 'wdBean';
function generateUniqueId() {
// 生成当前时间戳
let timestamp = new Date().getTime();
// 将时间戳转换成16进制字符串
let hexString = timestamp.toString(16);
// 确保字符串长度为16位,不足的话在前面补0
while (hexString.length < 16) {
hexString = '0' + hexString;
}
// 格式化为UUID样式
let uuid = hexString.substring(0, 8) + '-' +
hexString.substring(8, 12) + '-' +
hexString.substring(12, 16) + '-' +
hexString.substring(16, 20) + '-' +
hexString.substring(20);
function generateUUID() {
let dt = new Date().getTime(); // 获取当前时间的时间戳(毫秒)
let uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
let r = (dt + Math.random() * 16) % 16 | 0;
dt = Math.floor(dt / 16);
return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);
});
return uuid;
}
...
...
@@ -34,15 +23,16 @@ export const enum ActionMode {
//ViewBlog意图共享-频道列表
export function viewBlogInsightIntentShare(context: common.UIAbilityContext, entityGroupId: string,
compList: CompDTO[] | CompList[], actionMode: ActionMode) {
console.log('viewBlogInsightIntentShare',actionMode)
console.log('viewBlogInsightIntentShare',
actionMode)
let insightIntentArray: insightIntent.InsightIntent [] = []
let identifier = generateUUID()
if (compList?.length > 0) {
compList?.forEach((item: CompDTO | CompList) => {
item.operDataList.forEach((_item: ContentDTO) => {
let viewBlogInsightIntentItem: insightIntent.InsightIntent = {
intentName: 'ViewBlog',
intentVersion: '1.0.1',
identifier
: generateUniqueId()
,
identifier,
intentActionInfo: {
actionMode,
currentPercentage: 50,
...
...
@@ -67,7 +57,7 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
_item?.newsSummary.substring(0, 20) : _item?.newsSummary,
blogAuthor: _item?.source,
blogPublishTime: _item?.publishTimestamp,
tag: _item?.newTags,
tag: _item?.newTags
.split(',')
,
likeCount: _item?.interactData?.likeNum || 0,
forwardCount: _item?.interactData?.shareNum || 0,
commentCount: _item?.interactData?.commentNum || 0,
...
...
@@ -82,21 +72,13 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
})
console.log('yzl', JSON.stringify(insightIntentArray[0]))
try {
// 共享数据
insightIntent.shareIntent(context, insightIntentArray, (error) => {
if (error?.code) {
// 处理业务逻辑错误
console.error(`shareIntent failed, error.code: ${error?.code}, error.message: ${error?.message}`);
return;
}
// 执行正常业务
console.log('shareIntent succeed');
insightIntent.shareIntent(context, insightIntentArray).then(() => {
console.log('yzl shareIntent success');
}).catch((err: BusinessError) => {
console.error(`yzl failed because ${err?.message}`);
});
} catch (error) {
// 处理异常
console.error(`error.code: ${error?.code}, error.message: ${error?.message}`);
}
}
}
...
...
@@ -108,7 +90,7 @@ export function viewColumInsightIntentShare(context: common.UIAbilityContext, en
let viewBlogInsightIntentItem: insightIntent.InsightIntent = {
intentName: 'ViewColumn',
intentVersion: '1.0.1',
identifier: generateU
niqueId
(),
identifier: generateU
UID
(),
intentActionInfo: {
actionMode: ActionMode.EXECUTED,
currentPercentage: 50,
...
...
@@ -116,30 +98,22 @@ export function viewColumInsightIntentShare(context: common.UIAbilityContext, en
intentEntityInfo: {
entityName: 'Column',
entityId,
displayName:pageInfoBean?.topicInfo?.title,
displayName:
pageInfoBean?.topicInfo?.title,
description: pageInfoBean?.shareSummary,
logoURL:pageInfoBean?.shareCoverUrl,
activityType:['RecentViews'],
logoURL: pageInfoBean?.shareCoverUrl,
activityType: ['RecentViews'],
columnTitle: pageInfoBean?.topicInfo?.title,
columnSubTitle: pageInfoBean?.shareSummary,
rankingHint: 99,
isPublicData: true
}
}
console.log('yzl viewColumInsightIntentShare', JSON.stringify(viewBlogInsightIntentItem))
try {
// 共享数据
insightIntent.shareIntent(context, [viewBlogInsightIntentItem], (error) => {
if (error?.code) {
// 处理业务逻辑错误
console.error(`shareIntent failed, error.code: ${error?.code}, error.message: ${error?.message}`);
return;
}
// 执行正常业务
console.log('shareIntent succeed');
insightIntent.shareIntent(context, [viewBlogInsightIntentItem]).then(() => {
console.log('yzl shareIntent success');
}).catch((err: BusinessError) => {
console.error(`yzl failed because ${err?.message}`);
});
} catch (error) {
// 处理异常
console.error(`error.code: ${error?.code}, error.message: ${error?.message}`);
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/EditInfoViewModel.ets
View file @
34756ed
...
...
@@ -52,11 +52,11 @@ class EditInfoViewModel {
if (editDTO.code == 0) {
success(editDTO.data)
}else {
success(this.GetqueryAccountOwnerLocal(context))
//
success(this.GetqueryAccountOwnerLocal(context))
}
}).catch((error: Error) => {
Logger.info(TAG,'queryAccountOwnerInfo','EditInfoViewModel')
success(this.GetqueryAccountOwnerLocal(context))
//
success(this.GetqueryAccountOwnerLocal(context))
})
}))
}
...
...
sight_harmony/features/wdComponent/src/main/resources/base/element/float.json
View file @
34756ed
...
...
@@ -81,6 +81,10 @@
"value"
:
"10vp"
},
{
"name"
:
"margin_12"
,
"value"
:
"12vp"
},
{
"name"
:
"margin_bottom_16"
,
"value"
:
"16vp"
},
...
...
sight_harmony/features/wdComponent/src/main/resources/base/media/ic_like_back_new.png
0 → 100644
View file @
34756ed
496 Bytes
sight_harmony/products/phone/src/main/ets/pages/SpacialTopicPage.ets
View file @
34756ed
...
...
@@ -9,11 +9,12 @@ const TAG = 'SpacialTopicPage';
@Entry
@Component
struct SpacialTopicPage {
action: Action = {} as Action
@State action: Action = {} as Action
@State reload: number = 0
@State count: number = 0
build() {
Column() {
SpacialTopicPageComponent({ action: this.action })
SpacialTopicPageComponent({ action: this.action
,reload:this.reload
})
}.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)
}
...
...
@@ -30,8 +31,12 @@ struct SpacialTopicPage {
}
aboutToAppear() {
Logger.info(TAG,
'aboutToAppear'
);
Logger.info(TAG,
`aboutToAppearcount:${this.reload}`
);
let action: Action = router.getParams() as Action
this.action = action
}
onPageShow() {
this.reload = this.reload + 1
Logger.info(TAG, `onPageShowcount:${this.reload}`);
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment