diff --git a/UI/Popup/README.md b/UI/Popup/README.md new file mode 100644 index 0000000000000000000000000000000000000000..48345c44950130a5ffd90b6f1f6bb031dd8d6e9e --- /dev/null +++ b/UI/Popup/README.md @@ -0,0 +1,14 @@ +# JavaScript Bubble + +##### Introduction + +This sample shows JavaScript bubbles. After you click a bound component, a bubble with a message is displayed to provide you with guidance. You can define component attributes such as its position, style, and events to respond. + +##### Usage + +On the home screen of the sample app, touch the prompt button or the text box. A JavaScript bubble is displayed. The bubble disappears after you touch it. + +##### Constraints + +This sample can only be run on standard-system devices. + diff --git a/UI/Popup/README_zh.md b/UI/Popup/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..be4d687f47e7bf131598d9550376de32e4389d89 --- /dev/null +++ b/UI/Popup/README_zh.md @@ -0,0 +1,14 @@ +# JS气泡 + +##### 简介 + +本示例展示了JS气泡提示,在点击绑定的控件后会弹出相应的气泡来引导用户进行操作。开发者可自行定义该控件的位置、样式、响应事件等属性信息。 + +##### 使用说明 + +进入应用主界面后,点击提示按钮或者文本框,JS气泡提示会出现,点击JS气泡提示后,气泡提示会消失。 + +##### 约束与限制 + +本示例仅支持在标准系统上运行。 + diff --git a/UI/Popup/build.gradle b/UI/Popup/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..c3f3ef69e87fa254198e144c7a94775654584c77 --- /dev/null +++ b/UI/Popup/build.gradle @@ -0,0 +1,37 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +apply plugin: 'com.huawei.ohos.app' + +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#ZH-CN_TOPIC_0000001154985555__section1112183053510 +ohos { + compileSdkVersion 6 + defaultConfig { + compatibleSdkVersion 6 + } +} + +buildscript { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + jcenter() + } + dependencies { + classpath 'com.huawei.ohos:hap:2.4.4.3-RC' + } +} + +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + jcenter() + } +} diff --git a/UI/Popup/entry/build.gradle b/UI/Popup/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..921386f38e8d5e8e0272b5326c80b80bcf5a067d --- /dev/null +++ b/UI/Popup/entry/build.gradle @@ -0,0 +1,16 @@ +apply plugin: 'com.huawei.ohos.hap' +ohos { + compileSdkVersion 6 + defaultConfig { + compatibleSdkVersion 6 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } + supportSystem "standard" +} diff --git a/UI/Popup/entry/src/main/config.json b/UI/Popup/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..fd74fab10747f46f8cbb44146480352bd6336864 --- /dev/null +++ b/UI/Popup/entry/src/main/config.json @@ -0,0 +1,56 @@ +{ + "app": { + "bundleName": "ohos.samples.popup", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.samples.popup", + "name": ".MyApplication", + "mainAbility": "ohos.samples.popup.MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "ohos.samples.popup.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": true + } + } + ] + } +} \ No newline at end of file diff --git a/UI/Popup/entry/src/main/js/default/app.js b/UI/Popup/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..8e47afff13e928a74fdcc01a108e4422404b9ac9 --- /dev/null +++ b/UI/Popup/entry/src/main/js/default/app.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/UI/Popup/entry/src/main/js/default/common/images/ic_me_purchased_items.png b/UI/Popup/entry/src/main/js/default/common/images/ic_me_purchased_items.png new file mode 100644 index 0000000000000000000000000000000000000000..73d460f3f0d9f3a33ce6bdf153986b78ec604ed3 Binary files /dev/null and b/UI/Popup/entry/src/main/js/default/common/images/ic_me_purchased_items.png differ diff --git a/UI/Popup/entry/src/main/js/default/common/images/ic_public_arrow_right.png b/UI/Popup/entry/src/main/js/default/common/images/ic_public_arrow_right.png new file mode 100644 index 0000000000000000000000000000000000000000..5c3e7958febb83eb4efeb145340d6c0388f8ce0e Binary files /dev/null and b/UI/Popup/entry/src/main/js/default/common/images/ic_public_arrow_right.png differ diff --git a/UI/Popup/entry/src/main/js/default/i18n/en-US.json b/UI/Popup/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..c4cc35ba0d2a856c49ac2513d35ab66d23acf08a --- /dev/null +++ b/UI/Popup/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,8 @@ +{ + "strings": { + "title": "Payment & Billing", + "content": "Set up your bank card for online payment and check your payment bill", + "popup": "The original Quick Payment function can be viewed on the Payment & Bill page", + "btn": "hints" + } +} \ No newline at end of file diff --git a/UI/Popup/entry/src/main/js/default/i18n/zh-CN.json b/UI/Popup/entry/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..126cf2014741b46440f10c568d0b281ad206444f --- /dev/null +++ b/UI/Popup/entry/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,8 @@ +{ + "strings": { + "title": "付款与账单", + "content": "设置在线支付的银行卡,查看支付账单", + "popup": "原“快捷支付”功能,在“付款与账单”中查看", + "btn": "提示" + } +} \ No newline at end of file diff --git a/UI/Popup/entry/src/main/js/default/pages/index/index.css b/UI/Popup/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..6390492d14c072e0543ab9e7fed4887091190c4f --- /dev/null +++ b/UI/Popup/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + height: 100%; + width: 100%; + align-items: center; + justify-content: center; + flex-direction: column; + background-color: #F2F3F5 +} +.item { + height: 72px; + width: 100%; + display: flex; + align-items:center; + justify-content: space-between; + margin-right: 12px; + margin-left: 12px; + margin-bottom: 2px; +} +.content { + display: flex; + margin-left:20px; + flex-direction: column; + align-content: flex-start; + justify-content: space-between; +} +.img { + height: 40px; + width: 40px; +} +.title { + font-size: 16px; + color: #e6000000; + opacity: 0.9; + margin-top: 8px; + margin-bottom: 1px; +} +.text { + font-size: 14px; + color: #99000000; + opacity: 0.6; + margin-top: 1px; + margin-bottom: 8px; +} +.popup { + opacity: 0.8; + font-size: 14px; + background-color: #4D4D4D; + border-top-left-radius:16px; + border-bottom-left-radius:16px; + border-top-right-radius: 16px; + border-bottom-right-radius:16px; +} +.button { + width:100px; + margin-top: 50px; +} diff --git a/UI/Popup/entry/src/main/js/default/pages/index/index.hml b/UI/Popup/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..2c24009e5c5c7512e97580a7ba9f4ad77ab6977d --- /dev/null +++ b/UI/Popup/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,31 @@ + + +