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-02 19:04:30 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e6ca09bbb5a79a4835a1c74ee7be7dda01cc9b55
e6ca09bb
1 parent
f475c9a8
多图(图集)详情页评论、点赞增加角标,返回上一页,输入法开发部分
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
162 additions
and
11 deletions
sight_harmony/features/wdBean/Index.ets
sight_harmony/features/wdBean/src/main/ets/bean/detail/MultiPictureDetailPageDTO.ts
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
sight_harmony/features/wdComponent/src/main/resources/base/media/corner_mark.png
sight_harmony/features/wdBean/Index.ets
View file @
e6ca09b
...
...
@@ -23,7 +23,7 @@ export { Pic } from './src/main/ets/bean/content/Pic'
export { InteractDataDTO } from './src/main/ets/bean/content/InteractDataDTO';
export { InteractDataStatusBean, PhotoListBean } from './src/main/ets/bean/detail/MultiPictureDetailPageDTO';
export { InteractDataStatusBean, PhotoListBean
, InputMethodProperty
} from './src/main/ets/bean/detail/MultiPictureDetailPageDTO';
export { InteractParam, ContentBean } from './src/main/ets/bean/content/InteractParam';
...
...
sight_harmony/features/wdBean/src/main/ets/bean/detail/MultiPictureDetailPageDTO.ts
View file @
e6ca09b
...
...
@@ -17,4 +17,84 @@ export interface PhotoListBean {
width
:
number
;
picPath
:
string
;
picDesc
:
string
;
}
export
interface
InputMethodProperty
{
/**
* The name of input method
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 8
* @deprecated since 9
* @useinstead inputMethod.InputMethodProperty#name
*/
readonly
packageName
:
string
;
/**
* The id of input method
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 8
* @deprecated since 9
* @useinstead inputMethod.InputMethodProperty#id
*/
readonly
methodId
:
string
;
/**
* The name of input method
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
readonly
name
:
string
;
/**
* The id of input method
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
readonly
id
:
string
;
/**
* The label of input method
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
readonly
label
?:
string
;
/**
* The label id of input method
*
* @type { ?number }
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 10
*/
readonly
labelId
?:
number
;
/**
* The icon of input method
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
readonly
icon
?:
string
;
/**
* The icon id of input method
*
* @type { ?number }
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
readonly
iconId
?:
number
;
/**
* The extra info of input method
*
* @type { object }
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
/**
* The extra info of input method
*
* @type { ?object }
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 10
*/
extra
?:
object
;
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
View file @
e6ca09b
import { ToastUtils, Logger } from 'wdKit';
import { InputMethodProperty } from 'wdBean';
import router from '@ohos.router';
import inputMethod from '@ohos.inputMethod';
export interface OperationItem {
icon: Resource;
...
...
@@ -25,7 +28,6 @@ export struct OperRowListView {
{
icon: $r('app.media.ic_collect_uncheck'),
text: "收藏",
num: 662,
},
{
icon: $r('app.media.ic_share'),
...
...
@@ -54,8 +56,8 @@ export struct OperRowListView {
})
.alignItems(HorizontalAlign.Center)
.hoverEffect(HoverEffect.Scale)
.onClick((event: ClickEvent) => {
ToastUtils.showToast('体验版,本功能暂未开发', 1000);
.onClick(() => {
router.back();
})
TextInput({placeholder:'说两句...'})
.placeholderColor('#999999')
...
...
@@ -71,6 +73,9 @@ export struct OperRowListView {
.width('61.5%')
.height(30)
.borderRadius(0)
.onClick(() => {
this.buildInputMethod()
})
}
.width('45.5%')
.alignItems(VerticalAlign.Center)
...
...
@@ -78,7 +83,7 @@ export struct OperRowListView {
Flex({ justifyContent: FlexAlign.SpaceAround, alignItems:ItemAlign.Center }) {
ForEach(this.operationList, (item: OperationItem, index: number) => {
this.buildOperationItem(item, index)
}, (item: OperationItem
, index: number
) => JSON.stringify(item))
}, (item: OperationItem) => JSON.stringify(item))
}
.width('54.5%')
}
...
...
@@ -95,18 +100,84 @@ export struct OperRowListView {
@Builder
buildOperationItem(item: OperationItem, index: number) {
Column() {
Image(item.icon)
.width(24)
.height(24)
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
RelativeContainer() {
Row() {
Image(item.icon)
.width(24)
.height(24)
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
}
.alignRules({
center: { anchor: '__container__', align: VerticalAlign.Center },
middle: { anchor: '__container__', align: HorizontalAlign.Center }
})
.id(`e_row1_${index}`)
if(item.num) {
Row() {
Image($r('app.media.corner_mark'))
.width(25)
.height(12)
.interpolation(ImageInterpolation.High)
}
.alignRules({
top: { anchor: `e_row1_${index}`, align: VerticalAlign.Top },
left: { anchor: `e_row1_${index}`, align: HorizontalAlign.Center }
})
.id(`e_row2_${index}`)
Row() {
Text('99+')
.fontSize(8)
.textAlign(TextAlign.Center)
.fontColor(Color.White)
.lineHeight(12)
}
.alignRules({
top: { anchor: `e_row2_${index}`, align: VerticalAlign.Top },
middle: { anchor: `e_row2_${index}`, align: HorizontalAlign.Center }
})
.id(`e_row3_${index}`)
}
}
.id(`e_icon_${index}`)
}
.margin(5)
.alignItems(HorizontalAlign.Center)
.hoverEffect(HoverEffect.Scale)
.onClick((
event: ClickEvent
) => {
.onClick(() => {
Logger.info(TAG, `buildOperationItem onClick event index: ${index}`);
ToastUtils.showToast('体验版,本功能暂未开发', 1000);
})
}
/**
* 输入法
*/
private buildInputMethod() {
let im = inputMethod.getCurrentInputMethod();
let prop: InputMethodProperty = {
packageName: im.packageName,
methodId: im.methodId,
name: im.name,
id: im.id,
extra: {}
}
try{
inputMethod.switchInputMethod(prop, (err, result) => {
if (err !== undefined) {
console.error('Failed to switchInputMethod: ' + JSON.stringify(err));
return;
}
if (result) {
console.info('Succeeded in switching inputmethod.');
} else {
console.error('Failed to switchInputMethod.');
}
});
} catch(err) {
console.error('Failed to switchInputMethod: ' + JSON.stringify(err));
}
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/resources/base/media/corner_mark.png
0 → 100644
View file @
e6ca09b
495 Bytes
Please
register
or
login
to post a comment