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
yuzhilin
2024-04-26 09:18:38 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e34df6230a71b566db8ce4ecf1ce0d26b13aca48
e34df623
1 parent
104a9a8a
增加 H5详情页预览图片
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
11 deletions
sight_harmony/commons/wdJsBridge/src/main/ets/bean/Message.ets
sight_harmony/commons/wdWebComponent/src/main/ets/pages/JsBridgeBiz.ets
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
sight_harmony/commons/wdJsBridge/src/main/ets/bean/Message.ets
View file @
e34df62
import { Action } from './Action';
interface IImgItem {
pic: string
width: number
height: number
}
export interface IImgListData {
imgIndex: number
imgArr: IImgItem[]
}
interface dataObject {
// dataSource:
// 1、图文详情数据
...
...
@@ -13,7 +24,7 @@ interface dataObject {
// 9、活动投稿 视频跳转
// 10、活动投稿 动态跳转
// 11、活动投稿 图集跳转
dataSource:
number
dataSource:
string
operateType?: string
webViewHeight?: string
dataJson?: string
...
...
@@ -27,6 +38,7 @@ interface dataObject {
positionLeft?: string
positionTop?: string
videoLandscape?: string
imgListData?: string
}
/**
...
...
sight_harmony/commons/wdWebComponent/src/main/ets/pages/JsBridgeBiz.ets
View file @
e34df62
import HashMap from '@ohos.util.HashMap';
import { Callback } from 'wdJsBridge';
import { Message } from 'wdJsBridge/src/main/ets/bean/Message';
import { Message
, IImgListData
} from 'wdJsBridge/src/main/ets/bean/Message';
import { Logger } from 'wdKit';
import { H5CallNativeType } from './H5CallNativeType';
import { H5OperateType } from './H5OperateType';
...
...
@@ -8,7 +8,7 @@ import { ContentConstants } from 'wdConstant';
import { ProcessUtils } from 'wdRouter';
import router from '@ohos.router';
import Url from '@ohos.url'
import { ContentDTO
} from 'wdBean/Index
';
import { ContentDTO
, PhotoListBean } from 'wdBean
';
import { ResponseDTO, WDHttp, HttpUrlUtils } from 'wdNetwork';
const TAG = 'JsBridgeBiz'
...
...
@@ -96,11 +96,25 @@ function getAppPublicInfo(): string {
function handleJsCallReceiveH5Data(data: Message) {
switch (data?.data?.dataSource) {
case 5:
if (data?.data?.dataSource === 5) {
ProcessUtils.processPage(JSON.parse(data?.data?.dataJson || '{}'))
case '3':
let imgListData: IImgListData = JSON.parse(data?.data?.imgListData || "{}")
let imgArr = imgListData?.imgArr || []
if (imgArr.length > 0) {
const photoList: PhotoListBean[] = imgArr.map(item => {
const photo: PhotoListBean = {
width: item.width,
height: item.height,
picPath: item.pic,
picDesc: ''
}
return photo
})
ProcessUtils.gotoMultiPictureListPage(photoList)
}
break;
case '5':
ProcessUtils.processPage(JSON.parse(data?.data?.dataJson || '{}'))
break;
default:
break;
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
View file @
e34df62
...
...
@@ -90,7 +90,7 @@ export struct ImageAndTextPageComponent {
.height(24)
.margin({ right: 5 })
}
Text(`${this.interactData?.likeNum || 0}`)
Text(`${this.interactData?.likeNum || 0
}`)
.fontSize(16)
.fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999')
.fontWeight(500)
...
...
@@ -100,10 +100,10 @@ export struct ImageAndTextPageComponent {
.justifyContent(FlexAlign.Center)
.alignItems(VerticalAlign.Center)
.borderRadius(20)
.border({
width: 1,
color: '#EDEDED',
})
// .border({
// width: 1,
// color: '#EDEDED',
// })
.onClick(() => {
this.toggleLikeStatus()
})
...
...
Please
register
or
login
to post a comment