Skip to content

Commit d7d6efb

Browse files
authored
feature/2.2.1 (#98)
* feature(2.2.1) * feature(2.2.1)
1 parent 17ec576 commit d7d6efb

80 files changed

Lines changed: 2262 additions & 706 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AppScope/app.json5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"app": {
33
"bundleName": "com.ibestservice.ibest_ui",
44
"vendor": "example",
5-
"versionCode": 1000013,
6-
"versionName": "1.1.3",
5+
"versionCode": 1000014,
6+
"versionName": "1.1.4",
77
"icon": "$media:layered_image",
88
"label": "$string:app_name"
99
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ OpenHarmony ohpm 环境配置等更多内容,请参考[如何安装 OpenHarmon
135135
| Table 表格 | 用于展示多条结构类似的数据。 | <a href="https://ibestui.ibestservices.com/components/table/" target="_blank">文档</a> |
136136
| Tag 标签 | 用于标记关键词和概括主要内容。 | <a href="https://ibestui.ibestservices.com/components/tag/" target="_blank">文档</a> |
137137
| TextEllipsis 文本省略 | 对长文本进行省略,支持展开/收起。 | <a href="https://ibestui.ibestservices.com/components/textEllipsis/" target="_blank">文档</a> |
138+
| Tree 树形控件 | 用清晰的层级结构展示信息,可展开或折叠。 | <a href="https://ibestui.ibestservices.com/components/tree/" target="_blank">文档</a> |
138139
| Watermark 水印 | 在页面上添加特定的文字或图案作为水印,可用于防止信息盗用。 | <a href="https://ibestui.ibestservices.com/components/watermark/" target="_blank">文档</a> |
139140

140141
### 导航组件

build-profile.json5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"signingConfig": "default",
4848
"compatibleSdkVersion": "5.1.1(19)",
4949
"runtimeOS": "HarmonyOS",
50-
"targetSdkVersion": "6.0.0(20)",
50+
"targetSdkVersion": "6.0.1(21)",
5151
"buildOption": {
5252
"strictMode": {
5353
"useNormalizedOHMUrl": true

entry/src/main/ets/entryability/EntryAbility.ets

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import AbilityConstant from '@ohos.app.ability.AbilityConstant';
22
import UIAbility from '@ohos.app.ability.UIAbility';
33
import Want from '@ohos.app.ability.Want';
44
import window from '@ohos.window';
5-
import { IBestInit, IBestSetGlobalConfig } from '@ibestservices/ibest-ui';
5+
import { IBestInit, IBestSetUIGlobalConfig } from '@ibestservices/ibest-ui';
66
import { ConfigurationConstant } from '@kit.AbilityKit';
77
import GlobalStore from '../utils/global';
88

@@ -23,6 +23,9 @@ export default class EntryAbility extends UIAbility {
2323
familyName: 'testFont',
2424
familySrc: $rawfile('iconfont.woff')
2525
})
26+
IBestSetUIGlobalConfig({
27+
fontNames: ['testFont']
28+
})
2629
})
2730
}
2831

entry/src/main/ets/pages/Index.ets

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import { common, Want, bundleManager } from '@kit.AbilityKit'
66
import { getAppVersion, getResourceStr } from '../utils/utils'
77
import { rcp } from '@kit.RemoteCommunicationKit'
88
import fs from '@ohos.file.fs'
9-
import { updateManager } from '@kit.AppGalleryKit'
9+
import { commentManager, updateManager } from '@kit.AppGalleryKit'
1010
import RouterUtil from '../utils/routerUtil'
1111

1212
interface ComponentPart {
1313
title: Resource
1414
list: ComponentItem[]
1515
}
1616
interface ComponentItem {
17-
name: ResourceStr,
17+
name: ResourceStr
1818
path: string
1919
}
2020
interface Tab {
@@ -294,6 +294,10 @@ struct Index {
294294
name: $r("app.string.component_textEllipsis"),
295295
path: "TextEllipsis"
296296
},
297+
{
298+
name: $r("app.string.component_tree"),
299+
path: "Tree"
300+
},
297301
{
298302
name: $r("app.string.component_watermark"),
299303
path: "Watermark"
@@ -437,6 +441,7 @@ struct Index {
437441
private context = this.getUIContext().getHostContext() as common.UIAbilityContext
438442
private router = this.getUIContext().getRouter()
439443
private navPathStack: NavPathStack = new NavPathStack()
444+
private timer: number = 0
440445

441446
@Builder tabBuilder(index: number){
442447
Column({space: 5}) {
@@ -610,7 +615,7 @@ struct Index {
610615
isLink: true,
611616
hasBorder: false,
612617
onCellClick: () => {
613-
this.showCommentDialog()
618+
this.viewAppStoreDetail()
614619
}
615620
})
616621
}
@@ -663,10 +668,15 @@ struct Index {
663668
RouterUtil.navPathStackList.push(this.navPathStack)
664669
this.checkUpdate()
665670
this.getUiVersion()
671+
this.showCommentDialog()
666672
// setTimeout(() => {
667-
// RouterUtil.push("Switch")
673+
// RouterUtil.push("Tree")
668674
// }, 100)
669675
}
676+
aboutToDisappear(): void {
677+
clearInterval(this.timer)
678+
this.timer = 0
679+
}
670680
getTitleOpacity(){
671681
// let scrollY = this.scrollTop < 50 ? this.scrollTop : 50
672682
return this.scrollTop < 50 ? 0 : 1
@@ -730,10 +740,21 @@ struct Index {
730740
}
731741
// 提示评论
732742
showCommentDialog(){
733-
// 评论弹框 6.0.0 支持
734-
// commentManager.showCommentDialog(this.context).then(()=>{
735-
// console.log("succeeded in showing commentDialog.");
736-
// })
743+
let count = 0
744+
this.timer = setInterval(() => {
745+
count++
746+
if(count > 120){
747+
clearInterval(this.timer)
748+
commentManager.showCommentDialog(this.context).then(()=>{
749+
console.log("succeeded in showing commentDialog.");
750+
}).catch((error: BusinessError<Object>) => {
751+
console.log(`showCommentDialog failed, Code: ${error.code}, message: ${error.message}`);
752+
})
753+
}
754+
}, 1000)
755+
}
756+
// 跳转应用市场详情
757+
viewAppStoreDetail(){
737758
let bundleName = bundleManager.getBundleInfoForSelfSync(bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT).name
738759
let link = 'https://appgallery.huawei.com/app/detail?id=' + bundleName + '&action=write-review'
739760
this.context.openLink(link, { appLinkingOnly: false })

entry/src/main/ets/pages/base/ActionSheet.ets

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,11 @@ struct ActionSheetPage {
6161
onBtnClick: () => {
6262
IBestActionSheet.show({
6363
actions: ["选项一", "选项二", "选项三"],
64-
onSelect: (index: number, name?: string | number) => {
65-
IBestToast.show(`点击了第${index}个选项,名称为${name}`)
66-
},
67-
beforeClose: () => {
64+
beforeClose: (index: number, name?: string | number) => {
6865
return new Promise((resolve, reject) => {
6966
IBestDialogUtil.open({
7067
title: "提示",
71-
message: "确定关闭?",
68+
message: `确定选择${name}?`,
7269
showCancelButton: true,
7370
onConfirm: () => {
7471
resolve(true)
@@ -78,6 +75,9 @@ struct ActionSheetPage {
7875
}
7976
})
8077
})
78+
},
79+
onSelect: (index: number, name?: string | number) => {
80+
IBestToast.show(`点击了第${index}个选项,名称为${name}`)
8181
}
8282
})
8383
}
@@ -216,7 +216,6 @@ struct ActionSheetPage {
216216
})
217217
}
218218
})
219-
220219
}
221220
.width(CONTAINER_SIZE.FULL)
222221
.justifyContent(FlexAlign.Center)

entry/src/main/ets/pages/base/Button.ets

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,12 @@ struct ButtonPage {
197197
})
198198
IBestButton({
199199
text: $r("app.string.border"),
200-
btnBorderColor: "red"
200+
btnBorder: {
201+
width: 2,
202+
color: "red",
203+
style: BorderStyle.Dashed,
204+
radius: 16
205+
}
201206
})
202207
IBestButton({
203208
type: "primary",

entry/src/main/ets/pages/base/Caliper.ets

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ export function CaliperBuilder(_: string, title: string){
1212
@Component
1313
struct CaliperPage {
1414
@State title: string = ''
15-
@State value: number = 6
15+
@State value: number = 0
1616
@State value1: number = 50
1717
@State value2: number = 0
1818
@State value3: number = 0
19-
@State value4: number = 0
19+
@State value4: number = 0.5
2020
@State value5: number = 0
21+
@State value6: number = 0
2122

2223
build() {
2324
NavDestination() {
@@ -59,15 +60,21 @@ struct CaliperPage {
5960
scales: 5,
6061
scaleSize: 2
6162
})
63+
Text(this.value4.toString())
64+
IBestCaliper({
65+
value: $value4,
66+
endNum: 5,
67+
scaleSize: 0.1
68+
})
6269
}.alignItems(HorizontalAlign.Start)
6370
}
6471
}
6572
ListItem() {
6673
ComponentShowContainer({ title: '自定义样式' }){
6774
Column({space: SPACE.BASE}){
68-
Text(this.value4.toString())
75+
Text(this.value5.toString())
6976
IBestCaliper({
70-
value: $value4,
77+
value: $value5,
7178
bgColor: "#d8e9f6",
7279
fontColor: "#038cfd",
7380
bigScaleHeight: 50,
@@ -81,13 +88,13 @@ struct CaliperPage {
8188
ListItem() {
8289
ComponentShowContainer({ title: '刻度对齐方式' }){
8390
Column({space: SPACE.SM}){
84-
Text(this.value5.toString())
91+
Text(this.value6.toString())
8592
IBestCaliper({
86-
value: $value5,
93+
value: $value6,
8794
scaleAlign: "center"
8895
})
8996
IBestCaliper({
90-
value: $value5,
97+
value: $value6,
9198
scaleAlign: "bottom"
9299
})
93100
}.alignItems(HorizontalAlign.Start)

0 commit comments

Comments
 (0)