diff --git a/AI/AIFunctionSet/README_en.md b/AI/AIFunctionSet/README_en.md new file mode 100644 index 0000000000000000000000000000000000000000..ea8bcb7d0382a3ca95f00a32263c618cdd81dac0 --- /dev/null +++ b/AI/AIFunctionSet/README_en.md @@ -0,0 +1,27 @@ +# AI + +- HarmonyOSOpenHarmony provides abundant Artificial Intelligence \(AI\) capabilities that can be used out of the box. You can easily integrate these AI capabilities on demand to make your applications smarter. The AI capabilities are as follows: + + \* QR code generation: Generates a quick response \(QR\) code image based on a given string and QR code image size and returns it through byte streams. The caller can then restore the QR code image from the QR code byte streams. + + \* General text recognition: Converts scanned text on bills, cards, forms, newspapers, books, and other printed materials into image information, and then uses text recognition technologies to convert the image information into computable input. + + \* Single image super-resolution \(SISR\): Provides 1x and 3x super-resolution capabilities for mobile devices. 1x SR processing removes the image compression noise, and 3x SR processing enlarges the side edge by three times while suppressing the compression noise. + + \* Document skew detection and correction: Provides document skew detection and correction as an assisting enhancement in document duplicating. + + \* Text-image super-resolution \(TISR\): Enlarges an image containing text by nine times \(three times the height and three times the width\) and enhances the definition of text in the image. + + \* Word segmentation: Automatically segments input text into words at the specified granularity. You can change the granularity as required. + + \* POS tagging: Automatically segments input text into words and attaches a correct part of speech \(POS\) tag to each word. You can define your own POS tagging granularity as required. + + \* Assistant-specific intention recognition: Performs semantic analysis and intention recognition on text messages users send to devices, making devices smarter in various application scenarios. + + \* IM-specific intention recognition: Uses the machine learning technology to analyze and recognize intentions of text messages, such as short messages or messages from IM applications. + + \* Keyword extraction: Extracts the most relevant keywords from text. A keyword may be an entity with a specific meaning, such as a person name, a place, and a movie. It can also be a basic but critical word in the text. + + \* Entity recognition: Extracts entities with specific meanings from natural languages and performs related operations \(such as searching\) based on the extracted entities. + + \* Automatic speech recognition \(ASR\): Converts audio files and real-time audio data streams into Chinese character sequences at a recognition accuracy of over 90% \(95% for local recognition\). diff --git a/AI/AIFunctionSet/README_zh.md b/AI/AIFunctionSet/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..9add77f11bdb4153f289ed9035f5d938b5b5d810 --- /dev/null +++ b/AI/AIFunctionSet/README_zh.md @@ -0,0 +1,24 @@ +AIFunctionSet +============ +### 简介 + +为应用提供丰富的AI(Artificial Intelligence)能力,支持开箱即用。开发者可以灵活、便捷地选择AI能力,让应用变得更加智能。 + +### 使用说明 + +* 二维码生成: 根据开发者给定的字符串信息和二维码图片尺寸,返回相应的二维码图片字节流。调用方可以通过二维码字节流生成二维码图片。 +* 通用文字识别: 通过拍照、扫描等光学输入方式,把各种票据、卡证、表格、报刊、书籍等印刷品文字转化为图像信息,再利用文字识别技术将图像信息转化为计算机等设备可以使用的字符信息的技术。 +* 图像超分辨率: 提供适用于移动终端的1x和3x超分能力;1x超分可以去除图片的压缩噪声,3x超分在有效抑制压缩噪声的同时,提供3倍的边长放大能力。 +* 文档检测校正: 提供了文档翻拍过程的辅助增强功能,包含两个子功能:文档检测和文档校正。 +* 文字图像超分: 文字图像超分辨率可以对包含文字内容的图像进行9倍放大(高宽各放大3倍),同时增强图像内文字的清晰度,称为“文字图像超分辨率”,简称“文字图像超分”。 +* 分词: 对于一段输入文本,可以自动进行分词,同时提供不同的分词粒度。开发者可以根据需要自定义分词粒度。 +* 词性标注: 对于输入的一段文本,自动通过词性标注接口对其进行分词,并为分词结果中的每个单词标注一个正确的词性。词性标注提供不同的分词粒度,开发者可以根据需要自定义分词粒度。 +* 助手类意图识别: 对用户发送给设备的文本消息进行语义分析和意图识别,进而衍生出各种智能的应用场景,使设备更智慧、更智能。 +* IM类意图识别: 利用机器学习技术,针对用户短信或聊天类APP等IM应用的文本消息进行内容分析,并识别出消息内容代表的用户意图。 +* 关键字提取: 可以在大量信息中提取出文本想要表达的核心内容,可以是具有特定意义的实体,如:人名,地点,电影等。也可以是一些基础但是在文本中很关键的词汇。 +* 实体识别: 从自然语言中提取出具有特定意义的实体,并在此基础上完成搜索等一系列相关操作及功能。 +* 语音识别: 将语音文件、实时语音数据流转换为汉字序列,准确率达到90%以上(本地识别95%)。 + +### 约束与限制 + +本示例仅支持在大型系统上运行。 diff --git a/AI/AIFunctionSet/build.gradle b/AI/AIFunctionSet/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..dede97233a0367a47b29085b9cf491932a1674e0 --- /dev/null +++ b/AI/AIFunctionSet/build.gradle @@ -0,0 +1,48 @@ +/* + * 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. + */ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +apply plugin: 'com.huawei.ohos.app' + +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } +} +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.2' + } +} +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + jcenter() + } +} \ No newline at end of file diff --git a/AI/AIFunctionSet/entry/build.gradle b/AI/AIFunctionSet/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..656369fc78e70ed49e04ddc78669669135d51545 --- /dev/null +++ b/AI/AIFunctionSet/entry/build.gradle @@ -0,0 +1,32 @@ +/* + * 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. + */ +apply plugin: 'com.huawei.ohos.hap' +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) +} diff --git a/AI/AIFunctionSet/entry/src/main/config.json b/AI/AIFunctionSet/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..51c442ac240033626cdfcd4af5c1dd1024223a1d --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/config.json @@ -0,0 +1,71 @@ +{ + "app": { + "bundleName": "ohos.samples.aifunctionset", + "version": { + "code": 1000000, + "name": "1.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.samples.aifunctionset", + "name": ".MainAbility", + "reqCapabilities": [ + "video_support" + ], + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree":false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "portrait", + "formsEnabled": false, + "name": ".MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.MICROPHONE" + }, + { + "name": "ohos.permission.READ_CALENDAR" + }, + { + "name": "ohos.permission.INTERNET" + }, + { + "name": "ohos.permission.ACCESS_NETWORK_STATE" + }, + { + "name": "ohos.permission.READ_USER_STORAGE" + }, + { + "name": "ohos.permission.WRITE_USER_STORAGE" + }, + { + "name": "ohos.permission.MANAGE_USER_STORAGE" + } + ] + } +} \ No newline at end of file diff --git a/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/MainAbility.java b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..fa9764176be4473ee90abc09eff8dbbfa2fdeca2 --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/MainAbility.java @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package ohos.samples.aifunctionset; + +import ohos.samples.aifunctionset.slice.AiMainSlice; + +import ohos.aafwk.ability.Ability; +import ohos.aafwk.content.Intent; + +/** + * MainAbility + */ +public class MainAbility extends Ability { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + super.setMainRoute(AiMainSlice.class.getName()); + } +} diff --git a/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/bean/AsrBean.java b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/bean/AsrBean.java new file mode 100644 index 0000000000000000000000000000000000000000..b8fd7ea68976e14c7ea2fa6281ac7e7bd8880b08 --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/bean/AsrBean.java @@ -0,0 +1,91 @@ +/* + * 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. + */ + +package ohos.samples.aifunctionset.bean; + +import java.util.List; + +/** + * AsrBean + */ + +public class AsrBean { + private List result; + + private String resultType; + + public void setResult(List result) { + this.result = result; + } + + public List getResult() { + return result; + } + + public void setResultType(String resultType) { + this.resultType = resultType; + } + + public String getResultType() { + return resultType; + } + + /** + * Speech recognition result + */ + public static class Result { + private double confidence; + + private String ori_word; + + private String pinyin; + + private String word; + + public void setConfidence(double confidence) { + this.confidence = confidence; + } + + public double getConfidence() { + return confidence; + } + + public void setOriWord(String ori_word) { + this.ori_word = ori_word; + } + + public String getOriWord() { + return ori_word; + } + + public void setPinyin(String pinyin) { + this.pinyin = pinyin; + } + + public String getPinyin() { + return pinyin; + } + + public void setWord(String word) { + this.word = word; + } + + public String getWord() { + return word; + } + } +} + + diff --git a/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/AiMainSlice.java b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/AiMainSlice.java new file mode 100644 index 0000000000000000000000000000000000000000..ecfe841f6113078e2b7643b1f3fdd0eea3ab9f22 --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/AiMainSlice.java @@ -0,0 +1,51 @@ +/* + * 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. + */ + +package ohos.samples.aifunctionset.slice; + +import ohos.samples.aifunctionset.ResourceTable; + +import ohos.aafwk.ability.AbilitySlice; +import ohos.aafwk.content.Intent; +import ohos.agp.components.ComponentContainer; + +/** + * AiMainSlice + */ +public class AiMainSlice extends AbilitySlice { + private final AbilitySlice[] sliceArray = { + new TextRecognitionSlice(), new ImageSuperResolutionSlice(), new DocumentCorrectionSlice(), + new QRCodeGenerationSlice(), new TextImageSuperResolutionSlice(), new WordSegmentationSlice(), + new PartOfSpeechTaggingSlice(), new AssistantIntentionRecognitionSlice(), new IMIntentRecognitionSlice(), + new KeywordExtractionSlice(), new EntityIdentificationSlice(), new SpeechRecognitionSlice(), + new TextToSpeechSlice() + }; + + @Override + public void onStart(Intent intent) { + super.onStart(intent); + super.setUIContent(ResourceTable.Layout_main_slice); + } + + @Override + protected void onActive() { + super.onActive(); + ComponentContainer container = (ComponentContainer) findComponentById(ResourceTable.Id_rootLayout); + for (int i = 0; i < container.getChildCount(); i++) { + int index = i; + container.getComponentAt(i).setClickedListener(component -> present(sliceArray[index], new Intent())); + } + } +} diff --git a/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/AssistantIntentionRecognitionSlice.java b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/AssistantIntentionRecognitionSlice.java new file mode 100644 index 0000000000000000000000000000000000000000..01d7f04d6262c3fcc41b8cfc3113fda1e8967dcb --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/AssistantIntentionRecognitionSlice.java @@ -0,0 +1,88 @@ +/* + * 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. + */ + +package ohos.samples.aifunctionset.slice; + +import ohos.samples.aifunctionset.ResourceTable; + +import ohos.agp.components.Component; +import ohos.agp.components.LayoutScatter; +import ohos.agp.components.TextField; +import ohos.ai.nlu.NluClient; +import ohos.ai.nlu.NluRequestType; +import ohos.ai.nlu.ResponseResult; +import ohos.utils.zson.ZSONObject; + +import java.util.HashMap; +import java.util.Map; + +/** + * Assistant Intention Recognition Slice + */ +public class AssistantIntentionRecognitionSlice extends BaseSlice { + private TextField inputText; + + private TextField outText; + + private boolean initEngineResult; + + @Override + public void initLayout() { + currComponent = LayoutScatter.getInstance(this) + .parse(ResourceTable.Layout_word_segmentation_slice, null, false); + rootLayout.addComponent(currComponent); + + initEngine(); + initComponents(); + } + + private void initEngine() { + NluClient.getInstance().init(this, result -> initEngineResult = true, true); + } + + private void initComponents() { + outText = (TextField) findComponentById(ResourceTable.Id_out_text); + inputText = (TextField) findComponentById(ResourceTable.Id_input_text); + Component startButton = findComponentById(ResourceTable.Id_start_parse); + startButton.setClickedListener(this::start); + inputText.setText("Turn off bluetooth."); + } + + private void start(Component component) { + Map map = new HashMap<>(); + map.put("text", inputText.getText()); + map.put("type", 0); + String requestJson = ZSONObject.toZSONString(map); + if (initEngineResult) { + ResponseResult responseResult = NluClient.getInstance() + .getAssistantIntention(requestJson, NluRequestType.REQUEST_TYPE_LOCAL); + if (responseResult != null) { + String result = responseResult.getResponseResult(); + outText.setText("Result:" + System.lineSeparator() + result); + } + } + } + + @Override + public void setTitle() { + aiTitle.setText("Assistant Intention Recognition"); + } + + @Override + protected void onStop() { + super.onStop(); + NluClient.getInstance().destroy(this); + } +} diff --git a/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/BaseSlice.java b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/BaseSlice.java new file mode 100644 index 0000000000000000000000000000000000000000..5037c0d91f6fe3c0863370db50420c50924eaad0 --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/BaseSlice.java @@ -0,0 +1,96 @@ +/* + * 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. + */ + +package ohos.samples.aifunctionset.slice; + +import ohos.aafwk.ability.AbilitySlice; + +import ohos.samples.aifunctionset.ResourceTable; + +import ohos.aafwk.content.Intent; +import ohos.agp.components.Component; +import ohos.agp.components.DirectionalLayout; +import ohos.agp.components.Text; +import ohos.agp.window.dialog.ToastDialog; + +/** + * Base Slice + */ +public abstract class BaseSlice extends AbilitySlice { + /** + * common baseSlice root layout + */ + public DirectionalLayout rootLayout; + + /** + * current slice layout + */ + public Component currComponent; + + /** + * slice title + */ + public Text aiTitle; + + /** + * slice desc + */ + public Text aiDesc; + + @Override + protected void onStart(Intent intent) { + super.onStart(intent); + super.setUIContent(ResourceTable.Layout_base_layout); + + initCommons(); + initLayout(); + setTitle(); + } + + private void initCommons() { + rootLayout = (DirectionalLayout) findComponentById(ResourceTable.Id_root_layout); + aiTitle = (Text) findComponentById(ResourceTable.Id_title); + aiDesc = (Text) findComponentById(ResourceTable.Id_desc); + Component back = findComponentById(ResourceTable.Id_back); + back.setClickedListener(component -> terminate()); + } + + /** + * common toast method + * + * @param msg toast content + */ + public void showTips(String msg) { + new ToastDialog(this).setContentText(msg).show(); + } + + /** + * init slice layout + */ + public abstract void initLayout(); + + /** + * set slice title and desc + */ + public abstract void setTitle(); + + @Override + protected void onStop() { + super.onStop(); + if (currComponent != null) { + rootLayout.removeComponent(currComponent); + } + } +} diff --git a/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/DocumentCorrectionSlice.java b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/DocumentCorrectionSlice.java new file mode 100644 index 0000000000000000000000000000000000000000..23fe95948c163304361746f51374b39720fe3931 --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/DocumentCorrectionSlice.java @@ -0,0 +1,110 @@ +/* + * 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. + */ + +package ohos.samples.aifunctionset.slice; + +import ohos.samples.aifunctionset.ResourceTable; +import ohos.samples.aifunctionset.utils.LogUtil; +import ohos.samples.aifunctionset.utils.WidgetHelper; + +import ohos.agp.components.Component; +import ohos.agp.components.Image; +import ohos.agp.components.LayoutScatter; +import ohos.ai.cv.common.ConnectionCallback; +import ohos.ai.cv.common.ImageResult; +import ohos.ai.cv.common.VisionConfiguration; +import ohos.ai.cv.common.VisionImage; +import ohos.ai.cv.common.VisionManager; +import ohos.ai.cv.docrefine.DocCoordinates; +import ohos.ai.cv.docrefine.DocRefineConfiguration; +import ohos.ai.cv.docrefine.IDocRefine; +import ohos.media.image.PixelMap; + +/** + * Document Correction Slice + */ +public class DocumentCorrectionSlice extends BaseSlice { + private static final String IMAGE_PATH = "entry/resources/rawfile/doc_check.png"; + + private Image outImage; + + private IDocRefine docRefine; + + @Override + public void initLayout() { + currComponent = LayoutScatter.getInstance(this) + .parse(ResourceTable.Layout_document_correction_slice, null, false); + rootLayout.addComponent(currComponent); + initComponents(); + initEngine(); + } + + private void initComponents() { + Image originalImage = (Image) findComponentById(ResourceTable.Id_image); + outImage = (Image) findComponentById(ResourceTable.Id_out_image); + Component startButton = findComponentById(ResourceTable.Id_start); + startButton.setClickedListener(this::doSuperResolution); + originalImage.setPixelMap(WidgetHelper.getPixelMapFromRaw(this, IMAGE_PATH)); + } + + private void initEngine() { + int result = VisionManager.init(this, connectionCallback); + LogUtil.info(getLocalClassName(), "VisionManager.init result code : " + result); + } + + private void doSuperResolution(Component component) { + docRefine = VisionManager.getDocRefine(this); + PixelMap pixelMap = WidgetHelper.getPixelMapFromRaw(this, IMAGE_PATH); + + VisionImage image = VisionImage.fromPixelMap(pixelMap); + DocRefineConfiguration.Builder builder = new DocRefineConfiguration.Builder(); + builder.setProcessMode(VisionConfiguration.MODE_IN); + DocRefineConfiguration configuration = builder.build(); + docRefine.setVisionConfiguration(configuration); + ImageResult imageResult = new ImageResult(); + + DocCoordinates docCoordinates = new DocCoordinates(); + docRefine.docDetect(image, docCoordinates, null); + int result = docRefine.docRefine(image, docCoordinates, imageResult, null); + showTips("DocDetect : " + (result == 0 ? "Succeeded " : "Failed code = " + result)); + outImage.setPixelMap(imageResult.getPixelMap()); + } + + @Override + public void setTitle() { + aiTitle.setText("Document Correction"); + } + + private final ConnectionCallback connectionCallback = new ConnectionCallback() { + @Override + public void onServiceConnect() { + LogUtil.info(getLocalClassName(), "Service connect succeeded"); + } + + @Override + public void onServiceDisconnect() { + LogUtil.info(getLocalClassName(), "Service disconnect succeeded"); + } + }; + + @Override + protected void onStop() { + super.onStop(); + if (docRefine != null) { + docRefine.release(); + } + VisionManager.destroy(); + } +} diff --git a/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/EntityIdentificationSlice.java b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/EntityIdentificationSlice.java new file mode 100644 index 0000000000000000000000000000000000000000..961319a6deabd2969b9b8502432aab5dcd1809cb --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/EntityIdentificationSlice.java @@ -0,0 +1,86 @@ +/* + * 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. + */ + +package ohos.samples.aifunctionset.slice; + +import ohos.samples.aifunctionset.ResourceTable; + +import ohos.agp.components.Component; +import ohos.agp.components.LayoutScatter; +import ohos.agp.components.TextField; +import ohos.ai.nlu.NluClient; +import ohos.ai.nlu.NluRequestType; +import ohos.ai.nlu.ResponseResult; +import ohos.utils.zson.ZSONObject; + +import java.util.HashMap; +import java.util.Map; + +/** + * Entity Identification Slice + */ +public class EntityIdentificationSlice extends BaseSlice { + private TextField inputText; + + private TextField outText; + + private boolean initEngineResult; + + @Override + public void initLayout() { + currComponent = LayoutScatter.getInstance(this) + .parse(ResourceTable.Layout_word_segmentation_slice, null, false); + rootLayout.addComponent(currComponent); + initEngine(); + initComponents(); + } + + private void initEngine() { + NluClient.getInstance().init(this, result -> initEngineResult = true, true); + } + + private void initComponents() { + inputText = (TextField) findComponentById(ResourceTable.Id_input_text); + outText = (TextField) findComponentById(ResourceTable.Id_out_text); + Component startButton = findComponentById(ResourceTable.Id_start_parse); + startButton.setClickedListener(this::start); + inputText.setText("I like the beach."); + } + + private void start(Component component) { + Map map = new HashMap<>(); + map.put("text", inputText.getText()); + String requestJson = ZSONObject.toZSONString(map); + if (initEngineResult) { + ResponseResult responseResult = NluClient.getInstance() + .getEntity(requestJson, NluRequestType.REQUEST_TYPE_LOCAL); + if (responseResult != null) { + String result = responseResult.getResponseResult(); + outText.setText("Result:" + System.lineSeparator() + result); + } + } + } + + @Override + public void setTitle() { + aiTitle.setText("Entity Identification"); + } + + @Override + protected void onStop() { + super.onStop(); + NluClient.getInstance().destroy(this); + } +} diff --git a/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/IMIntentRecognitionSlice.java b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/IMIntentRecognitionSlice.java new file mode 100644 index 0000000000000000000000000000000000000000..b9e0f6601f9fe92dc00c8ca7ee2db4ef0a8a3c5e --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/IMIntentRecognitionSlice.java @@ -0,0 +1,88 @@ +/* + * 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. + */ + +package ohos.samples.aifunctionset.slice; + +import ohos.samples.aifunctionset.ResourceTable; + +import ohos.agp.components.Component; +import ohos.agp.components.LayoutScatter; +import ohos.agp.components.TextField; +import ohos.ai.nlu.NluClient; +import ohos.ai.nlu.NluRequestType; +import ohos.ai.nlu.ResponseResult; +import ohos.utils.zson.ZSONObject; + +import java.util.HashMap; +import java.util.Map; + +/** + * IM Intent Recognition Slice + */ +public class IMIntentRecognitionSlice extends BaseSlice { + private TextField inputText; + + private TextField outText; + + private boolean initEngineResult; + + + @Override + public void initLayout() { + currComponent = LayoutScatter.getInstance(this) + .parse(ResourceTable.Layout_word_segmentation_slice, null, false); + rootLayout.addComponent(currComponent); + + initIMEngine(); + initComponents(); + } + + private void initIMEngine() { + NluClient.getInstance().init(this, result -> initEngineResult = true, true); + } + + private void initComponents() { + inputText = (TextField) findComponentById(ResourceTable.Id_input_text); + outText = (TextField) findComponentById(ResourceTable.Id_out_text); + Component startButton = findComponentById(ResourceTable.Id_start_parse); + startButton.setClickedListener(this::start); + inputText.setText("Your personal credit card bill this month is $198.00, due date December 30."); + } + + private void start(Component component) { + Map map = new HashMap<>(); + map.put("text", inputText.getText()); + String requestJson = ZSONObject.toZSONString(map); + if (initEngineResult) { + ResponseResult responseResult = NluClient.getInstance() + .getChatIntention(requestJson, NluRequestType.REQUEST_TYPE_LOCAL); + if (responseResult != null) { + String result = responseResult.getResponseResult(); + outText.setText("Result:" + System.lineSeparator() + result); + } + } + } + + @Override + public void setTitle() { + aiTitle.setText("IM Intent Recognition"); + } + + @Override + protected void onStop() { + super.onStop(); + NluClient.getInstance().destroy(this); + } +} diff --git a/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/ImageSuperResolutionSlice.java b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/ImageSuperResolutionSlice.java new file mode 100644 index 0000000000000000000000000000000000000000..b57dfcd56bf0038f8aeca9d366aaab6af2bde2bc --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/ImageSuperResolutionSlice.java @@ -0,0 +1,108 @@ +/* + * 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. + */ + +package ohos.samples.aifunctionset.slice; + +import ohos.samples.aifunctionset.ResourceTable; +import ohos.samples.aifunctionset.utils.LogUtil; +import ohos.samples.aifunctionset.utils.WidgetHelper; + +import ohos.agp.components.Component; +import ohos.agp.components.Image; +import ohos.agp.components.LayoutScatter; +import ohos.ai.cv.common.ConnectionCallback; +import ohos.ai.cv.common.ImageResult; +import ohos.ai.cv.common.VisionConfiguration; +import ohos.ai.cv.common.VisionImage; +import ohos.ai.cv.common.VisionManager; +import ohos.ai.cv.sr.IImageSuperResolution; +import ohos.ai.cv.sr.SisrConfiguration; +import ohos.media.image.PixelMap; + +/** + * Image Super Resolution Slice + */ +public class ImageSuperResolutionSlice extends BaseSlice { + private static final String IMAGE_PATH = "entry/resources/rawfile/super_image.png"; + + private Image outImage; + + private IImageSuperResolution imageSuperResolution; + + @Override + public void initLayout() { + currComponent = LayoutScatter.getInstance(this) + .parse(ResourceTable.Layout_image_super_resolution_slice, null, false); + rootLayout.addComponent(currComponent); + initComponents(); + initEngine(); + } + + private void initComponents() { + Image originalImage = (Image) findComponentById(ResourceTable.Id_image); + outImage = (Image) findComponentById(ResourceTable.Id_out_image); + Component startButton = findComponentById(ResourceTable.Id_start); + startButton.setClickedListener(this::doSuperResolution); + originalImage.setPixelMap(WidgetHelper.getPixelMapFromRaw(this, IMAGE_PATH)); + } + + private void initEngine() { + int result = VisionManager.init(this, connectionCallback); + LogUtil.info(getLocalClassName(), "VisionManager.init result code : " + result); + } + + private void doSuperResolution(Component component) { + imageSuperResolution = VisionManager.getSisr(this); + SisrConfiguration.Builder builder = new SisrConfiguration.Builder(); + builder.setProcessMode(VisionConfiguration.MODE_IN); + SisrConfiguration config = builder.build(); + config.setScale(SisrConfiguration.SISR_SCALE_3X); + config.setQuality(SisrConfiguration.SISR_QUALITY_HIGH); + imageSuperResolution.setVisionConfiguration(config); + + PixelMap pixelMap = WidgetHelper.getPixelMapFromRaw(this, IMAGE_PATH); + VisionImage image = VisionImage.fromPixelMap(pixelMap); + ImageResult imageResult = new ImageResult(); + int result = imageSuperResolution.doSuperResolution(image, imageResult, null); + showTips("DoSuperResolution : " + (result == 0 ? "succeeded " : "failed code = " + result)); + outImage.setPixelMap(imageResult.getPixelMap()); + } + + @Override + public void setTitle() { + aiTitle.setText("Image Super Resolution"); + } + + private final ConnectionCallback connectionCallback = new ConnectionCallback() { + @Override + public void onServiceConnect() { + LogUtil.info(getLocalClassName(), "Service connect succeeded"); + } + + @Override + public void onServiceDisconnect() { + LogUtil.info(getLocalClassName(), "Service disconnect succeeded"); + } + }; + + @Override + protected void onStop() { + super.onStop(); + if (imageSuperResolution != null) { + imageSuperResolution.release(); + } + VisionManager.destroy(); + } +} diff --git a/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/KeywordExtractionSlice.java b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/KeywordExtractionSlice.java new file mode 100644 index 0000000000000000000000000000000000000000..19d64fc285b2428e5f94b2c04d842ff6bb8203d7 --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/KeywordExtractionSlice.java @@ -0,0 +1,88 @@ +/* + * 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. + */ + +package ohos.samples.aifunctionset.slice; + +import ohos.samples.aifunctionset.ResourceTable; + +import ohos.agp.components.Component; +import ohos.agp.components.LayoutScatter; +import ohos.agp.components.TextField; +import ohos.ai.nlu.NluClient; +import ohos.ai.nlu.NluRequestType; +import ohos.ai.nlu.ResponseResult; +import ohos.utils.zson.ZSONObject; + +import java.util.HashMap; +import java.util.Map; + +/** + * Keyword Extraction Slice + */ +public class KeywordExtractionSlice extends BaseSlice { + private TextField inputText; + + private TextField outText; + + private boolean initEngineResult; + + @Override + public void initLayout() { + currComponent = LayoutScatter.getInstance(this) + .parse(ResourceTable.Layout_word_segmentation_slice, null, false); + rootLayout.addComponent(currComponent); + + initEngine(); + initComponents(); + } + + private void initEngine() { + NluClient.getInstance().init(this, result -> initEngineResult = true, true); + } + + private void initComponents() { + inputText = (TextField) findComponentById(ResourceTable.Id_input_text); + outText = (TextField) findComponentById(ResourceTable.Id_out_text); + Component startButton = findComponentById(ResourceTable.Id_start_parse); + startButton.setClickedListener(this::start); + inputText.setText("Let's go to class together today."); + } + + private void start(Component component) { + Map map = new HashMap<>(); + map.put("number", "2"); + map.put("body", inputText.getText()); + String requestJson = ZSONObject.toZSONString(map); + if (initEngineResult) { + ResponseResult responseResult = NluClient.getInstance() + .getKeywords(requestJson, NluRequestType.REQUEST_TYPE_LOCAL); + if (responseResult != null) { + String result = responseResult.getResponseResult(); + outText.setText("Result:" + System.lineSeparator() + result); + } + } + } + + @Override + public void setTitle() { + aiTitle.setText("Keyword Extraction"); + } + + @Override + protected void onStop() { + super.onStop(); + NluClient.getInstance().destroy(this); + } +} diff --git a/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/PartOfSpeechTaggingSlice.java b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/PartOfSpeechTaggingSlice.java new file mode 100644 index 0000000000000000000000000000000000000000..ec84af31ca279bff5161a00a579c7e60542cab9e --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/PartOfSpeechTaggingSlice.java @@ -0,0 +1,88 @@ +/* + * 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. + */ + +package ohos.samples.aifunctionset.slice; + +import ohos.samples.aifunctionset.ResourceTable; + +import ohos.agp.components.Component; +import ohos.agp.components.LayoutScatter; +import ohos.agp.components.TextField; +import ohos.ai.nlu.NluClient; +import ohos.ai.nlu.NluRequestType; +import ohos.ai.nlu.ResponseResult; +import ohos.utils.zson.ZSONObject; + +import java.util.HashMap; +import java.util.Map; + +/** + * Part Of Speech Tagging Slice + */ +public class PartOfSpeechTaggingSlice extends BaseSlice { + private TextField inputText; + + private TextField outText; + + private boolean initEngineResult; + + @Override + public void initLayout() { + currComponent = LayoutScatter.getInstance(this) + .parse(ResourceTable.Layout_word_segmentation_slice, null, false); + rootLayout.addComponent(currComponent); + + initEngine(); + initComponents(); + } + + private void initEngine() { + NluClient.getInstance().init(this, result -> initEngineResult = true, true); + } + + private void initComponents() { + outText = (TextField) findComponentById(ResourceTable.Id_out_text); + inputText = (TextField) findComponentById(ResourceTable.Id_input_text); + Component startButton = findComponentById(ResourceTable.Id_start_parse); + startButton.setClickedListener(this::start); + inputText.setText("I want to see a movie about speed and passion."); + } + + private void start(Component component) { + Map map = new HashMap<>(); + map.put("text", inputText.getText()); + map.put("type", 0); + String requestJson = ZSONObject.toZSONString(map); + if (initEngineResult) { + ResponseResult responseResult = NluClient.getInstance() + .getWordPos(requestJson, NluRequestType.REQUEST_TYPE_LOCAL); + if (responseResult != null) { + String result = responseResult.getResponseResult(); + outText.setText("Result:" + System.lineSeparator() + result); + } + } + } + + @Override + public void setTitle() { + aiTitle.setText("Part of Speech Tagging"); + } + + @Override + protected void onStop() { + super.onStop(); + NluClient.getInstance().destroy(this); + } +} diff --git a/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/QRCodeGenerationSlice.java b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/QRCodeGenerationSlice.java new file mode 100644 index 0000000000000000000000000000000000000000..3c5df1407603ccb6e0867e4ccc6e1b0d2d998cf3 --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/QRCodeGenerationSlice.java @@ -0,0 +1,97 @@ +/* + * 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. + */ + +package ohos.samples.aifunctionset.slice; + +import ohos.samples.aifunctionset.ResourceTable; +import ohos.samples.aifunctionset.utils.LogUtil; + +import ohos.agp.components.Component; +import ohos.agp.components.Image; +import ohos.agp.components.LayoutScatter; +import ohos.ai.cv.common.ConnectionCallback; +import ohos.ai.cv.common.VisionManager; +import ohos.ai.cv.qrcode.IBarcodeDetector; +import ohos.media.image.ImageSource; +import ohos.media.image.PixelMap; + +/** + * QR Code Generation Slice + */ +public class QRCodeGenerationSlice extends BaseSlice { + private Image outImage; + + private IBarcodeDetector barcodeDetector; + + @Override + public void initLayout() { + currComponent = LayoutScatter.getInstance(this) + .parse(ResourceTable.Layout_qr_code_generation_slice, null, false); + rootLayout.addComponent(currComponent); + initEngine(); + initComponents(); + } + + private void initEngine() { + VisionManager.init(this, connectionCallback); + } + + private void initComponents() { + outImage = (Image) findComponentById(ResourceTable.Id_out_image); + Component startButton = findComponentById(ResourceTable.Id_start); + startButton.setClickedListener(this::start); + } + + private void start(Component component) { + barcodeDetector = VisionManager.getBarcodeDetector(this); + int length = 600; + byte[] byteArray = new byte[length * length * 4]; + int result = barcodeDetector.detect("This is a TestCase of IBarcodeDetector", byteArray, length, length); + showTips("Detect : " + (result == 0 ? "Succeeded " : "Failed code = " + result)); + if (result == 0) { + ImageSource.SourceOptions srcOpts = new ImageSource.SourceOptions(); + srcOpts.formatHint = "image/png"; + ImageSource imageSource = ImageSource.create(byteArray, srcOpts); + PixelMap pixelMap = imageSource.createPixelmap(null); + outImage.setPixelMap(pixelMap); + } + } + + @Override + public void setTitle() { + aiTitle.setText("QRCode Generation"); + } + + private final ConnectionCallback connectionCallback = new ConnectionCallback() { + @Override + public void onServiceConnect() { + LogUtil.info(getLocalClassName(), "Service connect succeeded"); + } + + @Override + public void onServiceDisconnect() { + LogUtil.info(getLocalClassName(), "Service disconnect succeeded"); + } + }; + + @Override + protected void onStop() { + super.onStop(); + if (barcodeDetector != null) { + barcodeDetector.release(); + } + VisionManager.destroy(); + } +} diff --git a/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/SpeechRecognitionSlice.java b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/SpeechRecognitionSlice.java new file mode 100644 index 0000000000000000000000000000000000000000..b2d9dac6da1c8cdbfe075d7c7caebd8735477e0d --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/SpeechRecognitionSlice.java @@ -0,0 +1,277 @@ +/* + * 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. + */ + +package ohos.samples.aifunctionset.slice; + +import ohos.samples.aifunctionset.ResourceTable; +import ohos.samples.aifunctionset.bean.AsrBean; +import ohos.samples.aifunctionset.utils.LogUtil; + +import ohos.agp.components.Component; +import ohos.agp.components.LayoutScatter; +import ohos.agp.components.TextField; +import ohos.ai.asr.AsrClient; +import ohos.ai.asr.AsrIntent; +import ohos.ai.asr.AsrListener; +import ohos.ai.asr.util.AsrResultKey; +import ohos.eventhandler.EventHandler; +import ohos.eventhandler.EventRunner; +import ohos.eventhandler.InnerEvent; +import ohos.global.resource.RawFileEntry; +import ohos.global.resource.Resource; +import ohos.utils.PacMap; +import ohos.utils.zson.ZSONException; +import ohos.utils.zson.ZSONObject; + +import java.io.BufferedInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; + +/** + * Speech Recognition Slice + */ + +public class SpeechRecognitionSlice extends BaseSlice { + private static final String TAG = SpeechRecognitionSlice.class.getSimpleName(); + + private static final int EVENT_MSG_INIT = 0x1000001; + + private static final int EVENT_MSG_PARSE_START = 0x1000002; + + private static final int EVENT_MSG_PARSE_END = 0x1000003; + + private static final int EVENT_MSG_ERROR = 0x1000004; + + private static final int VALID_LENGTH = 1280; + + private static final String RAW_AUDIO_WAV = "entry/resources/rawfile/asr_test.wav"; + + private static final String RAW_AUDIO_PCM = "entry/resources/rawfile/asr_date_conversion.pcm"; + + private AsrClient asrClient; + + private TextField outText; + + private String result; + + private String wavCachePath; + + private final EventHandler handler = new EventHandler(EventRunner.current()) { + @Override + protected void processEvent(InnerEvent event) { + switch (event.eventId) { + case EVENT_MSG_INIT: + showTips("InitAIEngine Success"); + break; + case EVENT_MSG_PARSE_START: + outText.setText("Doing now, please wait a moment ..."); + break; + case EVENT_MSG_PARSE_END: + parseJson(); + break; + case EVENT_MSG_ERROR: + showTips(result); + break; + } + } + }; + + @Override + public void initLayout() { + currComponent = LayoutScatter.getInstance(this) + .parse(ResourceTable.Layout_speech_recognition_slice, null, false); + rootLayout.addComponent(currComponent); + initData(); + initComponents(); + initAIEngine(); + } + + private void initData() { + wavCachePath = new File(getFilesDir(), "asr_test.wav").getPath(); + String pcmCachePath = new File(getFilesDir(), "asr_date_conversion.pcm").getPath(); + writeToDisk(RAW_AUDIO_WAV, wavCachePath); + writeToDisk(RAW_AUDIO_PCM, pcmCachePath); + } + + private void initComponents() { + outText = (TextField) findComponentById(ResourceTable.Id_out_text); + Component startButton = findComponentById(ResourceTable.Id_start_parse); + startButton.setClickedListener(this::start); + } + + private void start(Component component) { + showTips("start parse ..."); + asrClient.startListening(new AsrIntent()); + File file = new File(wavCachePath); + if (!file.exists()) { + return; + } + int initialSize = new Long(file.length()).intValue(); + try (ByteArrayOutputStream bos = new ByteArrayOutputStream(initialSize); + BufferedInputStream in = new BufferedInputStream(new FileInputStream(file))) { + byte[] buffer = new byte[VALID_LENGTH]; + int len; + while (true) { + len = in.read(buffer, 0, VALID_LENGTH); + if (len == -1) { + break; + } + bos.reset(); + bos.write(buffer, 0, len); + asrClient.writePcm(bos.toByteArray(), VALID_LENGTH); + } + } catch (IOException e) { + LogUtil.error(TAG, "startParse : IOException "); + } + } + + private void initAIEngine() { + asrClient = AsrClient.createAsrClient(this).orElse(null); + if (asrClient != null) { + AsrIntent asrIntent = new AsrIntent(); + useDefaultAsrIntent(asrIntent); + asrIntent.setAudioSourceType(AsrIntent.AsrAudioSrcType.ASR_SRC_TYPE_PCM); + asrClient.init(asrIntent, asrListener); + } + } + + private void useDefaultAsrIntent(AsrIntent asrIntent) { + asrIntent.setVadEndWaitMs(2000); + asrIntent.setVadFrontWaitMs(4800); + asrIntent.setTimeoutThresholdMs(20000); + } + + @Override + public void setTitle() { + aiTitle.setText("Speech Recognition"); + } + + @Override + protected void onStop() { + super.onStop(); + release(); + } + + private void parseJson() { + try { + AsrBean asrBean = ZSONObject.stringToClass(result, AsrBean.class); + if (asrBean != null && asrBean.getResult().size() > 0) { + AsrBean.Result resultContent = asrBean.getResult().get(0); + outText.setText("Result:" + System.lineSeparator() + resultContent.getWord()); + } + } catch (ZSONException e) { + LogUtil.error(TAG, "parseJson ZSONException"); + } + } + + private final AsrListener asrListener = new AsrListener() { + @Override + public void onInit(PacMap pacMap) { + result = pacMap.getString(AsrResultKey.RESULTS_RECOGNITION); + handler.sendEvent(EVENT_MSG_INIT); + } + + @Override + public void onBeginningOfSpeech() { + LogUtil.info(TAG, "onBeginningOfSpeech"); + } + + @Override + public void onRmsChanged(float value) { + LogUtil.info(TAG, "onRmsChanged :" + value); + } + + @Override + public void onBufferReceived(byte[] bytes) { + LogUtil.info(TAG, "onRmsChanged :" + new String(bytes)); + } + + @Override + public void onEndOfSpeech() { + LogUtil.info(TAG, "onEndOfSpeech "); + } + + @Override + public void onError(int errorCode) { + result = "onError code :" + errorCode; + handler.sendEvent(EVENT_MSG_ERROR); + } + + @Override + public void onResults(PacMap pacMap) { + LogUtil.info(TAG, "onResults :" + result); + result = pacMap.getString(AsrResultKey.RESULTS_RECOGNITION); + handler.sendEvent(EVENT_MSG_PARSE_END); + } + + @Override + public void onIntermediateResults(PacMap pacMap) { + LogUtil.info(TAG, "onIntermediateResults :" + result); + result = pacMap.getString(AsrResultKey.RESULTS_RECOGNITION); + handler.sendEvent(EVENT_MSG_PARSE_END); + } + + @Override + public void onEnd() { + LogUtil.info(TAG, "onEnd"); + } + + @Override + public void onEvent(int i, PacMap pacMap) { + LogUtil.info(TAG, "onEvent"); + } + + @Override + public void onAudioStart() { + LogUtil.info(TAG, "onAudioStart"); + handler.sendEvent(EVENT_MSG_PARSE_START); + } + + @Override + public void onAudioEnd() { + LogUtil.info(TAG, "onAudioEnd"); + } + }; + + private void release() { + if (asrClient != null) { + asrClient.stopListening(); + asrClient.cancel(); + asrClient.destroy(); + } + } + + private void writeToDisk(String rawFilePathString, String targetFilePath) { + File file = new File(targetFilePath); + if (file.exists()) { + return; + } + RawFileEntry rawFileEntry = getResourceManager().getRawFileEntry(rawFilePathString); + try (FileOutputStream output = new FileOutputStream(new File(targetFilePath))) { + Resource resource = rawFileEntry.openRawFile(); + byte[] cache = new byte[1024]; + int len = resource.read(cache); + while (len != -1) { + output.write(cache, 0, len); + len = resource.read(cache); + } + } catch (IOException e) { + LogUtil.error(TAG, "writeToDisk IOException"); + } + } +} diff --git a/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/TextImageSuperResolutionSlice.java b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/TextImageSuperResolutionSlice.java new file mode 100644 index 0000000000000000000000000000000000000000..e3dbbc6e58bf573a16ee562c663e0195e16c353a --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/TextImageSuperResolutionSlice.java @@ -0,0 +1,107 @@ +/* + * 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. + */ + +package ohos.samples.aifunctionset.slice; + +import ohos.samples.aifunctionset.ResourceTable; +import ohos.samples.aifunctionset.utils.LogUtil; +import ohos.samples.aifunctionset.utils.WidgetHelper; + +import ohos.agp.components.Component; +import ohos.agp.components.Image; +import ohos.agp.components.LayoutScatter; +import ohos.ai.cv.common.ConnectionCallback; +import ohos.ai.cv.common.ImageResult; +import ohos.ai.cv.common.VisionConfiguration; +import ohos.ai.cv.common.VisionImage; +import ohos.ai.cv.common.VisionManager; +import ohos.ai.cv.sr.ITxtImageSuperResolution; +import ohos.ai.cv.sr.TxtImageSuperResolutionConfiguration; +import ohos.media.image.PixelMap; + +/** + * Text Image Super Resolution Slice + */ +public class TextImageSuperResolutionSlice extends BaseSlice { + private static final String IMAGE_PATH = "entry/resources/rawfile/super_text.png"; + + private Image outImage; + + private ITxtImageSuperResolution txtImageSuperResolution; + + @Override + public void initLayout() { + currComponent = LayoutScatter.getInstance(this) + .parse(ResourceTable.Layout_text_image_superresolution_slice, null, false); + rootLayout.addComponent(currComponent); + initComponents(); + initHiAIEngine(); + } + + private void initComponents() { + Image originalImage = (Image) findComponentById(ResourceTable.Id_image); + outImage = (Image) findComponentById(ResourceTable.Id_out_image); + Component startButton = findComponentById(ResourceTable.Id_start); + startButton.setClickedListener(this::doSuperResolution); + originalImage.setPixelMap(WidgetHelper.getPixelMapFromRaw(this, IMAGE_PATH)); + } + + private void initHiAIEngine() { + int result = VisionManager.init(this, connectionCallback); + LogUtil.info(getLocalClassName(), "VisionManager.init result code : " + result); + } + + private void doSuperResolution(Component component) { + txtImageSuperResolution = VisionManager.getTisr(this); + PixelMap pixelMap = WidgetHelper.getPixelMapFromRaw(this, IMAGE_PATH); + + VisionImage image = VisionImage.fromPixelMap(pixelMap); + TxtImageSuperResolutionConfiguration.Builder builder = new TxtImageSuperResolutionConfiguration.Builder(); + builder.setProcessMode(VisionConfiguration.MODE_IN); + TxtImageSuperResolutionConfiguration paras = builder.build(); + txtImageSuperResolution.setVisionConfiguration(paras); + + ImageResult imageResult = new ImageResult(); + int result = txtImageSuperResolution.doSuperResolution(image, imageResult, null); + showTips("DoSuperResolution : " + (result == 0 ? "Succeeded " : "Failed code = " + result)); + outImage.setPixelMap(imageResult.getPixelMap()); + } + + @Override + public void setTitle() { + aiTitle.setText("Text Image Super Resolution"); + } + + private final ConnectionCallback connectionCallback = new ConnectionCallback() { + @Override + public void onServiceConnect() { + LogUtil.info(getLocalClassName(), "Service connect succeeded"); + } + + @Override + public void onServiceDisconnect() { + LogUtil.info(getLocalClassName(), "Service disconnect succeeded"); + } + }; + + @Override + protected void onStop() { + super.onStop(); + if (txtImageSuperResolution != null) { + txtImageSuperResolution.release(); + } + VisionManager.destroy(); + } +} diff --git a/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/TextRecognitionSlice.java b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/TextRecognitionSlice.java new file mode 100644 index 0000000000000000000000000000000000000000..d8dc837637795ca04d5c9580abdc02e6dcffc6b7 --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/TextRecognitionSlice.java @@ -0,0 +1,107 @@ +/* + * 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. + */ + +package ohos.samples.aifunctionset.slice; + +import ohos.samples.aifunctionset.ResourceTable; +import ohos.samples.aifunctionset.utils.LogUtil; +import ohos.samples.aifunctionset.utils.WidgetHelper; + +import ohos.agp.components.Component; +import ohos.agp.components.Image; +import ohos.agp.components.LayoutScatter; +import ohos.agp.components.TextField; +import ohos.ai.cv.common.ConnectionCallback; +import ohos.ai.cv.common.VisionConfiguration; +import ohos.ai.cv.common.VisionImage; +import ohos.ai.cv.common.VisionManager; +import ohos.ai.cv.text.ITextDetector; +import ohos.ai.cv.text.Text; +import ohos.ai.cv.text.TextConfiguration; +import ohos.media.image.PixelMap; + +/** + * Text Recognition Slice + */ +public class TextRecognitionSlice extends BaseSlice { + private static final String IMAGE_PATH = "entry/resources/rawfile/text_recognition.png"; + + private TextField outText; + + private ITextDetector textDetector; + + @Override + public void initLayout() { + currComponent = LayoutScatter.getInstance(this).parse(ResourceTable.Layout_text_recognition_slice, null, false); + rootLayout.addComponent(currComponent); + initComponents(); + initEngine(); + } + + private void initComponents() { + Image originalImage = (Image) findComponentById(ResourceTable.Id_image); + outText = (TextField) findComponentById(ResourceTable.Id_out_text); + Component startButton = findComponentById(ResourceTable.Id_start); + startButton.setClickedListener(this::doSuperResolution); + originalImage.setPixelMap(WidgetHelper.getPixelMapFromRaw(this, IMAGE_PATH)); + } + + private void initEngine() { + int result = VisionManager.init(this, connectionCallback); + LogUtil.info(getLocalClassName(), "VisionManager.init result code : " + result); + } + + private void doSuperResolution(Component component) { + textDetector = VisionManager.getTextDetector(this); + TextConfiguration.Builder builder = new TextConfiguration.Builder(); + builder.setProcessMode(VisionConfiguration.MODE_IN); + builder.setLanguage(TextConfiguration.ENGLISH); + TextConfiguration config = builder.build(); + + textDetector.setVisionConfiguration(config); + PixelMap pixelMap = WidgetHelper.getPixelMapFromRaw(this, IMAGE_PATH); + VisionImage image = VisionImage.fromPixelMap(pixelMap); + Text text = new Text(); + int result = textDetector.detect(image, text, null); + showTips("Text Detect : " + (result == 0 ? "Succeeded " : "Failed code = " + result)); + this.outText.setText("Result:" + System.lineSeparator() + text.getValue()); + } + + @Override + public void setTitle() { + aiTitle.setText("Text Recognition"); + } + + private final ConnectionCallback connectionCallback = new ConnectionCallback() { + @Override + public void onServiceConnect() { + LogUtil.info(getLocalClassName(), "Service connect succeeded"); + } + + @Override + public void onServiceDisconnect() { + LogUtil.info(getLocalClassName(), "Service disconnect succeeded"); + } + }; + + @Override + protected void onStop() { + super.onStop(); + if (textDetector != null) { + textDetector.release(); + } + VisionManager.destroy(); + } +} diff --git a/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/TextToSpeechSlice.java b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/TextToSpeechSlice.java new file mode 100644 index 0000000000000000000000000000000000000000..8ad2b2c79c9ebc20d4e5e48388502f8e736570c7 --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/TextToSpeechSlice.java @@ -0,0 +1,137 @@ +/* + * 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. + */ + +package ohos.samples.aifunctionset.slice; + +import ohos.samples.aifunctionset.ResourceTable; +import ohos.samples.aifunctionset.utils.LogUtil; + +import ohos.agp.components.Component; +import ohos.agp.components.LayoutScatter; +import ohos.agp.components.TextField; +import ohos.ai.tts.TtsClient; +import ohos.ai.tts.TtsListener; +import ohos.ai.tts.TtsParams; +import ohos.ai.tts.constants.TtsEvent; +import ohos.eventhandler.EventHandler; +import ohos.eventhandler.EventRunner; +import ohos.eventhandler.InnerEvent; +import ohos.utils.PacMap; + +import java.util.UUID; + +/** + * Text To Speech Slice + */ +public class TextToSpeechSlice extends BaseSlice { + private static final String TAG = SpeechRecognitionSlice.class.getSimpleName(); + + private static final int EVENT_MSG_INIT = 0x1000001; + + private boolean initItsResult; + + private TextField inputText; + + private final EventHandler handler = new EventHandler(EventRunner.current()) { + @Override + protected void processEvent(InnerEvent event) { + initTTSEngine(); + } + }; + + @Override + public void initLayout() { + currComponent = LayoutScatter.getInstance(this).parse(ResourceTable.Layout_text_to_speech_slice, null, false); + rootLayout.addComponent(currComponent); + + initTTSEngine(); + initComponents(); + } + + @Override + public void setTitle() { + aiTitle.setText("Text To Speech"); + } + + private void initComponents() { + inputText = (TextField) findComponentById(ResourceTable.Id_input_text); + Component startPlay = findComponentById(ResourceTable.Id_start_play); + startPlay.setClickedListener(this::startPlay); + } + + private void startPlay(Component component) { + if (initItsResult) { + TtsClient.getInstance().speakText(inputText.getText(), null); + } else { + showTips("InitTTSEngine Failed"); + } + } + + private void initTTSEngine() { + TtsClient.getInstance().create(this, ttsListener); + TtsParams ttsParams = new TtsParams(); + ttsParams.setDeviceId(UUID.randomUUID().toString()); + initItsResult = TtsClient.getInstance().init(ttsParams); + if (initItsResult) { + showTips("InitTTSEngine Succeeded"); + } else { + handler.sendEvent(EVENT_MSG_INIT, 1000); + } + } + + private final TtsListener ttsListener = new TtsListener() { + @Override + public void onEvent(int eventType, PacMap pacMap) { + if (eventType == TtsEvent.CREATE_TTS_CLIENT_SUCCESS) { + LogUtil.info(TAG, "TTS Client create succeeded"); + } + } + + @Override + public void onStart(String utteranceId) { + LogUtil.info(TAG, utteranceId + " audio synthesis begins"); + } + + @Override + public void onProgress(String utteranceId, byte[] audioData, int progress) { + LogUtil.info(TAG, utteranceId + " audio synthesis progress:" + progress); + } + + @Override + public void onFinish(String utteranceId) { + LogUtil.info(TAG, utteranceId + " audio synthesis completed"); + } + + @Override + public void onSpeechStart(String utteranceId) { + LogUtil.info(TAG, utteranceId + " begins to speech"); + } + + @Override + public void onSpeechProgressChanged(String utteranceId, int progress) { + LogUtil.info(TAG, utteranceId + " speech progress:" + progress); + } + + @Override + public void onSpeechFinish(String utteranceId) { + LogUtil.info(TAG, utteranceId + " speech completed"); + } + + @Override + public void onError(String utteranceId, String errorMessage) { + LogUtil.info(TAG, utteranceId + " errorMessage: " + errorMessage); + } + }; +} diff --git a/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/WordSegmentationSlice.java b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/WordSegmentationSlice.java new file mode 100644 index 0000000000000000000000000000000000000000..d8d7e887d5b6f54729e1beebb9abfe16e0c0101d --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/slice/WordSegmentationSlice.java @@ -0,0 +1,88 @@ +/* + * 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. + */ + +package ohos.samples.aifunctionset.slice; + +import ohos.samples.aifunctionset.ResourceTable; + +import ohos.agp.components.Component; +import ohos.agp.components.LayoutScatter; +import ohos.agp.components.TextField; +import ohos.ai.nlu.NluClient; +import ohos.ai.nlu.NluRequestType; +import ohos.ai.nlu.ResponseResult; +import ohos.utils.zson.ZSONObject; + +import java.util.HashMap; +import java.util.Map; + +/** + * Word Segmentation Slice + */ +public class WordSegmentationSlice extends BaseSlice { + private TextField inputText; + + private TextField outText; + + private boolean initEngineResult; + + @Override + public void initLayout() { + currComponent = LayoutScatter.getInstance(this) + .parse(ResourceTable.Layout_word_segmentation_slice, null, false); + rootLayout.addComponent(currComponent); + + initEngine(); + initComponents(); + } + + private void initEngine() { + NluClient.getInstance().init(this, result -> initEngineResult = true, true); + } + + private void initComponents() { + outText = (TextField) findComponentById(ResourceTable.Id_out_text); + inputText = (TextField) findComponentById(ResourceTable.Id_input_text); + Component startButton = findComponentById(ResourceTable.Id_start_parse); + startButton.setClickedListener(this::start); + inputText.setText("It's a nice day. Let's go to the movies."); + } + + private void start(Component component) { + Map map = new HashMap<>(); + map.put("text", inputText.getText()); + map.put("type", 0); + String requestJson = ZSONObject.toZSONString(map); + if (initEngineResult) { + ResponseResult responseResult = NluClient.getInstance() + .getWordSegment(requestJson, NluRequestType.REQUEST_TYPE_LOCAL); + if (responseResult != null) { + String result = responseResult.getResponseResult(); + outText.setText("Result:" + System.lineSeparator() + result); + } + } + } + + @Override + public void setTitle() { + aiTitle.setText("Word Segmentation"); + } + + @Override + protected void onStop() { + super.onStop(); + NluClient.getInstance().destroy(this); + } +} diff --git a/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/utils/LogUtil.java b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/utils/LogUtil.java new file mode 100644 index 0000000000000000000000000000000000000000..cb18877cdd75f0851af1063527f6722b534ae2a9 --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/utils/LogUtil.java @@ -0,0 +1,58 @@ +/* + * 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. + */ + +package ohos.samples.aifunctionset.utils; + +import ohos.hiviewdfx.HiLog; +import ohos.hiviewdfx.HiLogLabel; + +import java.util.Locale; + +/** + * LogUtil + */ +public class LogUtil { + private static final String TAG_LOG = "AI "; + + private static final int DOMAIN_ID = 0xD000F00; + + private static final HiLogLabel LABEL_LOG = new HiLogLabel(3, DOMAIN_ID, LogUtil.TAG_LOG); + + private static final String LOG_FORMAT = "%s: %s"; + + private LogUtil() { + /* Do nothing */ + } + + /** + * Print info log + * + * @param tag log tag + * @param msg log message + */ + public static void info(String tag, String msg) { + HiLog.info(LABEL_LOG, String.format(Locale.ROOT, LOG_FORMAT, tag, msg)); + } + + /** + * Print error log + * + * @param tag log tag + * @param msg log message + */ + public static void error(String tag, String msg) { + HiLog.error(LABEL_LOG, String.format(Locale.ROOT, LOG_FORMAT, tag, msg)); + } +} diff --git a/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/utils/WidgetHelper.java b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/utils/WidgetHelper.java new file mode 100644 index 0000000000000000000000000000000000000000..f84336a8f465a239a9c35c2828bf9cd4b8147163 --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/java/ohos/samples/aifunctionset/utils/WidgetHelper.java @@ -0,0 +1,49 @@ +/* + * 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. + */ + +package ohos.samples.aifunctionset.utils; + +import ohos.app.Context; +import ohos.global.resource.RawFileEntry; +import ohos.global.resource.Resource; +import ohos.media.image.ImageSource; +import ohos.media.image.PixelMap; + +import java.io.IOException; + +/** + * Widget helper + * + */ +public final class WidgetHelper { + /** + * Rawfile to PixelMap + * + * @param context app context + * @param path copy file's path + * @return PixelMap pixelMap + */ + public static PixelMap getPixelMapFromRaw(Context context, String path) { + try { + RawFileEntry rawFileEntry = context.getResourceManager().getRawFileEntry(path); + Resource resource = rawFileEntry.openRawFile(); + ImageSource imageSource = ImageSource.create(resource, new ImageSource.SourceOptions()); + return imageSource.createPixelmap(null); + } catch (IOException e) { + LogUtil.error("getPixelMapFromRaw", "IOException :" + e.toString()); + } + return null; + } +} diff --git a/AI/AIFunctionSet/entry/src/main/resources/base/element/string.json b/AI/AIFunctionSet/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..5877d2b2c1d2e905e9113990d7e8ba019c97171b --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/resources/base/element/string.json @@ -0,0 +1,76 @@ +{ + "string": [ + { + "name": "app_name", + "value": "AIFunctionSet" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + }, + { + "name": "start", + "value": "Start" + }, + { + "name": "text_recognition", + "value": "Text Recognition" + }, + { + "name": "image_super_resolution", + "value": "Image Super Resolution" + }, + { + "name": "document_correction", + "value": "Document Correction" + }, + { + "name": "qc_code", + "value": "QRCode Generation" + }, + { + "name": "text_image_super_resolution", + "value": "Text Image Super Resolution" + }, + { + "name": "word_segmentation", + "value": "Word Segmentation" + }, + { + "name": "part_of_speech_tagging", + "value": "Part Of Speech Tagging" + }, + { + "name": "assistant", + "value": "Assistant Intention Recognition" + }, + { + "name": "im_intent", + "value": "IM Intent Recognition" + }, + { + "name": "keyword", + "value": "Keyword Extraction" + }, + { + "name": "entity", + "value": "Entity Identification" + }, + { + "name": "speech_recognition", + "value": "Speech Recognition" + }, + { + "name": "text_to_speech", + "value": "Text To Speech" + }, + { + "name": "file_path", + "value": "File Path:/data/user/0/ohos.samples.ai/files/asr_test.wav" + }, + { + "name": "enter_keyword_tips", + "value": "Please enter a keyword" + } + ] +} \ No newline at end of file diff --git a/AI/AIFunctionSet/entry/src/main/resources/base/graphic/button_bg.xml b/AI/AIFunctionSet/entry/src/main/resources/base/graphic/button_bg.xml new file mode 100644 index 0000000000000000000000000000000000000000..f4a98035344fc8f1a3211c66ec8098eb24fdaf66 --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/resources/base/graphic/button_bg.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/AI/AIFunctionSet/entry/src/main/resources/base/graphic/text_bg.xml b/AI/AIFunctionSet/entry/src/main/resources/base/graphic/text_bg.xml new file mode 100644 index 0000000000000000000000000000000000000000..b428e6b4f47cf21e596368de884fe52d98ba90a6 --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/resources/base/graphic/text_bg.xml @@ -0,0 +1,26 @@ + + + + + + + + \ No newline at end of file diff --git a/AI/AIFunctionSet/entry/src/main/resources/base/graphic/textfield_bg.xml b/AI/AIFunctionSet/entry/src/main/resources/base/graphic/textfield_bg.xml new file mode 100644 index 0000000000000000000000000000000000000000..32ba5fbe5cf260dd4fac82f3d051098e6ddc8b38 --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/resources/base/graphic/textfield_bg.xml @@ -0,0 +1,25 @@ + + + + + + + \ No newline at end of file diff --git a/AI/AIFunctionSet/entry/src/main/resources/base/layout/base_layout.xml b/AI/AIFunctionSet/entry/src/main/resources/base/layout/base_layout.xml new file mode 100644 index 0000000000000000000000000000000000000000..2954bc9365078bdcb5ed961a8879c23b4b372c95 --- /dev/null +++ b/AI/AIFunctionSet/entry/src/main/resources/base/layout/base_layout.xml @@ -0,0 +1,66 @@ + + + + + + + + {{ dateTime }} + + {{ result1 }} + + {{ result }} + + {{ result2 }} + diff --git a/JSUI/International/entry/src/main/js/default/pages/index/index.js b/JSUI/International/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..8b1ee9201521236450da04b27a5b1e87f364558e --- /dev/null +++ b/JSUI/International/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,52 @@ +/* + * 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. + */ + +import Intl from '@ohos.intl'; + +export default { + data: { + result: '', + result1: '', + result2: '', + date: null, + dateTime: '' + }, + onInit() { + this.date = new Date(); + this.dateTime = this.date.getFullYear() + '-' + this.date.getMonth() + '-' + this.date.getDay() + '-' + + this.date.getDate() + '-' + this.date.getMinutes() + '-' + this.date.getSeconds(); + }, + cn() { + var dateFmt = new Intl.DateTimeFormat('zh-CN'); + var date = new Date(this.date.getFullYear(), this.date.getMonth(), this.date.getDay(), this.date.getDate(), + this.date.getMinutes(), this.date.getSeconds()); + this.result = dateFmt.format(date); + }, + en() { + var dateFmt1 = new Intl.DateTimeFormat('en-GB'); + var date = new Date(this.date.getFullYear(), this.date.getMonth(), this.date.getDay(), this.date.getDate(), + this.date.getMinutes(), this.date.getSeconds()); + this.result1 = dateFmt1.format(date); + }, + ja() { + var dateFmt2 = new Intl.DateTimeFormat('ja-JP'); + var date = new Date(this.date.getFullYear(), this.date.getMonth(), this.date.getDay(), this.date.getDate(), + this.date.getMinutes(), this.date.getSeconds()); + this.result2 = dateFmt2.format(date); + } +} + + + diff --git a/JSUI/International/entry/src/main/resources/base/element/string.json b/JSUI/International/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..8afbe446a5f687a3177c8cc26351e3897ee72411 --- /dev/null +++ b/JSUI/International/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "International" + }, + { + "name": "mainability_description", + "value": "JS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/JSUI/International/entry/src/main/resources/base/media/icon.png b/JSUI/International/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/JSUI/International/entry/src/main/resources/base/media/icon.png differ diff --git a/JSUI/International/screenshots/device/screen.png b/JSUI/International/screenshots/device/screen.png new file mode 100644 index 0000000000000000000000000000000000000000..3d72ccfdf6c7b14c9f3a5b96d68e5867ceaffa48 Binary files /dev/null and b/JSUI/International/screenshots/device/screen.png differ diff --git a/JSUI/International/settings.gradle b/JSUI/International/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..4773db73233a570c2d0c01a22e75321acfbf7a07 --- /dev/null +++ b/JSUI/International/settings.gradle @@ -0,0 +1 @@ +include ':entry' diff --git a/JSUI/JsAdaptivePortalList/README.md b/JSUI/JsAdaptivePortalList/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e1e38a050137f63bfe8d0a31e977383c02ce5169 --- /dev/null +++ b/JSUI/JsAdaptivePortalList/README.md @@ -0,0 +1,13 @@ +# Adaptive Portal List + +### Introduction + +This sample provides a list that displays properly on devices of different sizes. By leveraging adaptive features, such as stretching, zooming, equalization, and proportion, with polymorphic components and responsive layouts, this sample automatically adapts its layout to screens of different sizes. + +### Usage + +You can install the demo app on different types of devices to view the adaptation effect. + +### Constraints + +This sample can only be run on large-system devices. diff --git a/JSUI/JsAdaptivePortalList/README_zh.md b/JSUI/JsAdaptivePortalList/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..08bec1b4c9f57d7cbb4d09a66025f59289fa15fa --- /dev/null +++ b/JSUI/JsAdaptivePortalList/README_zh.md @@ -0,0 +1,13 @@ +# 多设备自适应的效率型首页 + +### 简介 + +本示例展示了一个列表页面,在不同尺寸的设备上,通过拉伸、缩放、均分、占比等自适应能力,使用多态控件、布局和组件的延展性以及响应式布局的运用,自适应展示为合理的布局效果。 + +### 使用说明 + +开发者可将本示例安装到不同类型设备上,查看自适应效果 + +### 约束与限制 + +本示例仅支持在大型系统上运行。 diff --git a/JSUI/JsAdaptivePortalList/build.gradle b/JSUI/JsAdaptivePortalList/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..078a938c864dba35fdfe799e50c9237dac685afe --- /dev/null +++ b/JSUI/JsAdaptivePortalList/build.gradle @@ -0,0 +1,36 @@ +// 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#section1112183053510 +ohos { + compileSdkVersion 6 + defaultConfig { + compatibleSdkVersion 6 + } +} + +buildscript { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + } + dependencies { + classpath 'com.huawei.ohos:hap:2.4.4.2' + } +} + +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + jcenter() + } +} diff --git a/JSUI/JsAdaptivePortalList/entry/build.gradle b/JSUI/JsAdaptivePortalList/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..fac23f31a7b3ea6a1a9977c974c20ae13287bf52 --- /dev/null +++ b/JSUI/JsAdaptivePortalList/entry/build.gradle @@ -0,0 +1,21 @@ +apply plugin: 'com.huawei.ohos.hap' +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + compileSdkVersion 6 + defaultConfig { + compatibleSdkVersion 6 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } + +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) +} \ No newline at end of file diff --git a/JSUI/JsAdaptivePortalList/entry/src/main/config.json b/JSUI/JsAdaptivePortalList/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..02621350d645c5d965f5202f2f9534db64a96ad8 --- /dev/null +++ b/JSUI/JsAdaptivePortalList/entry/src/main/config.json @@ -0,0 +1,57 @@ +{ + "app": { + "bundleName": "ohos.samples.adaptiveportallist", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.samples.adaptiveportallist", + "name": ".MyApplication", + "mainAbility": "ohos.samples.adaptiveportallist.MainAbility", + "deviceType": [ + "phone", + "tablet" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "ohos.samples.adaptiveportallist.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:entry_MainAbility", + "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/JSUI/JsAdaptivePortalList/entry/src/main/java/ohos/samples/adaptiveportallist/MainAbility.java b/JSUI/JsAdaptivePortalList/entry/src/main/java/ohos/samples/adaptiveportallist/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..a051e5e5a9e309ba9351fee98808852ccc76d4e8 --- /dev/null +++ b/JSUI/JsAdaptivePortalList/entry/src/main/java/ohos/samples/adaptiveportallist/MainAbility.java @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package ohos.samples.adaptiveportallist; + +import ohos.ace.ability.AceAbility; +import ohos.aafwk.content.Intent; + +public class MainAbility extends AceAbility { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + } + + @Override + public void onStop() { + super.onStop(); + } +} diff --git a/JSUI/JsAdaptivePortalList/entry/src/main/java/ohos/samples/adaptiveportallist/MyApplication.java b/JSUI/JsAdaptivePortalList/entry/src/main/java/ohos/samples/adaptiveportallist/MyApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..27ca43f821268f0316667dbb20541801254ee5a4 --- /dev/null +++ b/JSUI/JsAdaptivePortalList/entry/src/main/java/ohos/samples/adaptiveportallist/MyApplication.java @@ -0,0 +1,25 @@ +/* + * 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. + */ + +package ohos.samples.adaptiveportallist; + +import ohos.aafwk.ability.AbilityPackage; + +public class MyApplication extends AbilityPackage { + @Override + public void onInitialize() { + super.onInitialize(); + } +} diff --git a/JSUI/JsAdaptivePortalList/entry/src/main/js/default/app.js b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..aedcefe0054c6e16c40491f4d1abc20a4dc1c6ef --- /dev/null +++ b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/app.js @@ -0,0 +1,8 @@ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/images/add.png b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/images/add.png new file mode 100644 index 0000000000000000000000000000000000000000..118a438b1ca198cae96a5c170be733163698acee Binary files /dev/null and b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/images/add.png differ diff --git a/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/images/circle.png b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/images/circle.png new file mode 100644 index 0000000000000000000000000000000000000000..4d1341ed59d3d963502b2611cb5a7366f9c8a771 Binary files /dev/null and b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/images/circle.png differ diff --git a/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/images/home_person_picture.png b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/images/home_person_picture.png new file mode 100644 index 0000000000000000000000000000000000000000..dcb9bf9a616de71796681c6bdd811757612b171b Binary files /dev/null and b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/images/home_person_picture.png differ diff --git a/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/images/icon_person_blue.png b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/images/icon_person_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..c010be05f36e74b8533d33be0d179b7670e4a57d Binary files /dev/null and b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/images/icon_person_blue.png differ diff --git a/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/images/icon_person_gray.png b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/images/icon_person_gray.png new file mode 100644 index 0000000000000000000000000000000000000000..db275e4b13a73c30ff1f19d4729849630c3d356a Binary files /dev/null and b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/images/icon_person_gray.png differ diff --git a/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/images/more.png b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/images/more.png new file mode 100644 index 0000000000000000000000000000000000000000..e9fd24ddc0e5e8269d51f2a3b537c0c8b5328e1b Binary files /dev/null and b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/images/more.png differ diff --git a/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/template-tabbar.css b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/template-tabbar.css new file mode 100644 index 0000000000000000000000000000000000000000..ebef4c22fd6aaae288afeeff716f10861b834de9 --- /dev/null +++ b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/template-tabbar.css @@ -0,0 +1,50 @@ +/* + * 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. + */ + +.div-tab-bar-bottom { + align-items: center; + justify-content: center; + flex-direction: column; + width: 25%; + height: 56px; +} + +.icons { + width: 100%; + justify-content: center; +} + +.img-tab-bar-bottom { + width: 24px; + height: 24px; + flex-shrink: 0; +} + +.txt-tab-bar-bottom { + font-size: 10px; + text-align: center; + margin-top: 4px; +} + +@media screen and (min-aspect-ratio: 1) { + .div-tab-bar-bottom { + width: 100%; + height: 25%; + } + .txt-tab-bar-bottom { + font-size: 10px; + text-align: center; + } +} \ No newline at end of file diff --git a/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/template-tabbar.hml b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/template-tabbar.hml new file mode 100644 index 0000000000000000000000000000000000000000..35ebf5dabba7ee3b4f71cf4c09cf3667e660f962 --- /dev/null +++ b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/common/template-tabbar.hml @@ -0,0 +1,21 @@ + + +
+
+ +
+ {{ text }} +
\ No newline at end of file diff --git a/JSUI/JsAdaptivePortalList/entry/src/main/js/default/i18n/en-US.json b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..670deafb80b6d799b50532cf8be840202475cdb4 --- /dev/null +++ b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,13 @@ +{ + "strings": { + "title": "title", + "search_hint": "search", + "item_name": "double lines", + "item_description": "item description", + "item_right_text": "item right text", + "second_page": "Second page", + "third_page": "Third page", + "fourth_page": "Fourth page", + "fifth_page": "Fifth page" + } +} \ No newline at end of file diff --git a/JSUI/JsAdaptivePortalList/entry/src/main/js/default/i18n/zh-CN.json b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..5b04786a43fc9f06c0c860cd8ad377fae7117e45 --- /dev/null +++ b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,13 @@ +{ + "strings": { + "title": "标题", + "search_hint": "搜索", + "item_name": "双行列表", + "item_description": "辅助文本", + "item_right_text": "右侧文本", + "second_page": "第二页", + "third_page": "第三页", + "fourth_page": "第四页", + "fifth_page": "第五页" + } +} \ No newline at end of file diff --git a/JSUI/JsAdaptivePortalList/entry/src/main/js/default/pages/index/index.css b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..c71b7d504a9f7b13af0e892571251accfe7f486f --- /dev/null +++ b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,176 @@ +/* + * 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 { + flex-direction: column; + justify-content: flex-start; + align-items: flex-start; + width: 100%; + height: 100%; + background-color: white; +} +.top-tool-bar { + display: flex; + flex-direction: row; + justify-content: flex-end; + align-items: center; + width: 100%; + height: 56px; + padding-left: 24px; + padding-right: 24px; +} +.toolbar-image-add{ + width: 24px; + height: 24px; + margin-right: 40px; + opacity: 0.9; +} +.toolbar-image-more { + width: 24px; + height: 24px; + opacity: 0.9; +} +.div-content { + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + background-color: white; +} +.title { + font-size: 30px; + color: black; + opacity: 0.9; + align-content: center; + height: 56px; + margin-left: 24px; + font-weight: bold; +} +.tabs { + width: 100%; +} +.tabContent { + width: 100%; + flex-direction: column; +} +.item-content { + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: flex-start; + width: 100%; + height: 100%; +} +.search { + height: 56px; + margin: 0 16px; + align-items: center; +} +.item-title { + width: 100%; + height: 100%; + font-size: 18px; + text-align: center; +} +.bottom-bar-wrapper { + width: 100%; + height: 56px; + flex-direction: row; + justify-content: center; + align-items: center; + background-color: #F6F4F1; +} +.search-bar { + width: 100%; + height: 40px; + font-size: 16px; +} +.list-wrapper { + width: 100%; + flex-direction: column; + background-color: #F6F4F1; + margin-top: 8px; +} +.list-items { + width: 100%; + flex-direction: column; + padding-left: 24px; + padding-right: 24px; + height: 72px; + align-items: center; + margin-bottom: 1px; + background-color: white; +} +.item-wrapper { + flex-direction: row; + justify-content: space-between; + align-items: center; + width: 100%; + height: 100%; + margin: 8px 0; +} +.item-icon { + width: 50px; + height: 50px; + object-fit: contain; +} +.item-name-description-wrapper { + flex-direction: column; + justify-content: center; + margin-left: 16px; + flex-grow: 1; + flex-shrink: 1; +} +.item-name { + text-align: left; + font-size: 16px; + font-weight: bold; +} +.item-description { + text-align: left; + font-size: 14px; + opacity: 0.75; + margin-top: 4px; +} +.item-right-part-wrapper { + flex-direction: column; + justify-content: center; + align-items: flex-end; +} +.item-right-text { + font-size: 14px; + opacity: 0.75; +} +.item-right-circle { + width: 12px; + height: 12px; + object-fit: contain; + margin-top: 4px; +} + +@media screen and (min-aspect-ratio: 1) { + .container { + flex-direction: row; + justify-content: center; + background-color: #F6F4F1; + align-items: center; + } + .bottom-bar-wrapper { + width: 96px; + height: 400px; + flex-direction: column; + justify-content: space-between; + } +} \ No newline at end of file diff --git a/JSUI/JsAdaptivePortalList/entry/src/main/js/default/pages/index/index.hml b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..207a20f0dd225652a3fa2619fe3ef98df8d2c078 --- /dev/null +++ b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,68 @@ + + + +
+
+ +
+
+
+ + + +
+ + +
+ {{ $t('strings.title') }} + + + +
+ +
+ {{ $t('strings.item_name') }} + {{ $t('strings.item_description') }} +
+
+ {{ $t('strings.item_right_text') }} + +
+
+
+
+
+
+ {{ $t('strings.second_page') }} +
+
+ {{ $t('strings.third_page') }} +
+
+ {{ $t('strings.fourth_page') }} +
+
+ {{ $t('strings.fifth_page') }} +
+
+
+
+
+ +
+
\ No newline at end of file diff --git a/JSUI/JsAdaptivePortalList/entry/src/main/js/default/pages/index/index.js b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..2fd9614d31297bba1ce0e8f93dfdabfd9674a42f --- /dev/null +++ b/JSUI/JsAdaptivePortalList/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +import mediaquery from '@system.mediaquery'; + +export default { + data: { + list_data: Array(16).fill().map((_, index) => ({id: "item_" + index})), + tabBars: [ + {icon: "icon_person_blue.png", text: "页签"}, + {icon: "icon_person_gray.png", text: "页签"}, + {icon: "icon_person_gray.png", text: "页签"}, + {icon: "icon_person_gray.png", text: "页签"}, + ], + menu_tabs_index: 0, + isTabletLandscape: false + }, + onInit() { + this.regMediaQuery(); + }, + regMediaQuery() { + let mq = mediaquery.matchMedia('(min-aspect-ratio: 1)'); + mq.addListener((data) => { this.isTabletLandscape = data.matches; }); + } +} \ No newline at end of file diff --git a/JSUI/JsAdaptivePortalList/entry/src/main/resources/base/element/string.json b/JSUI/JsAdaptivePortalList/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1fbb94802deb844d7dcb18e3c0f35db9ae8fe86c --- /dev/null +++ b/JSUI/JsAdaptivePortalList/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "AdaptivePortalList" + }, + { + "name": "mainability_description", + "value": "JS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/JSUI/JsAdaptivePortalList/entry/src/main/resources/base/media/icon.png b/JSUI/JsAdaptivePortalList/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/JSUI/JsAdaptivePortalList/entry/src/main/resources/base/media/icon.png differ diff --git a/JSUI/JsAdaptivePortalList/screenshots/device/phone.png b/JSUI/JsAdaptivePortalList/screenshots/device/phone.png new file mode 100644 index 0000000000000000000000000000000000000000..9c5ff73453d082210ebd7cf5848e503bde1ab903 Binary files /dev/null and b/JSUI/JsAdaptivePortalList/screenshots/device/phone.png differ diff --git a/JSUI/JsAdaptivePortalList/screenshots/device/tablet1.png b/JSUI/JsAdaptivePortalList/screenshots/device/tablet1.png new file mode 100644 index 0000000000000000000000000000000000000000..e71272ef0852520365b46ec3ec28746321b0b719 Binary files /dev/null and b/JSUI/JsAdaptivePortalList/screenshots/device/tablet1.png differ diff --git a/JSUI/JsAdaptivePortalList/screenshots/device/tablet2.png b/JSUI/JsAdaptivePortalList/screenshots/device/tablet2.png new file mode 100644 index 0000000000000000000000000000000000000000..b48a329819f3bc9e3d92cf92b2cca7beaa0c753b Binary files /dev/null and b/JSUI/JsAdaptivePortalList/screenshots/device/tablet2.png differ diff --git a/JSUI/JsAdaptivePortalList/settings.gradle b/JSUI/JsAdaptivePortalList/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..4773db73233a570c2d0c01a22e75321acfbf7a07 --- /dev/null +++ b/JSUI/JsAdaptivePortalList/settings.gradle @@ -0,0 +1 @@ +include ':entry' diff --git a/JSUI/JsAdaptivePortalPage/README.md b/JSUI/JsAdaptivePortalPage/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1eaa5024255935aaeebd13514f3621fbb6eec08e --- /dev/null +++ b/JSUI/JsAdaptivePortalPage/README.md @@ -0,0 +1,15 @@ +# Multi-Device Adaptive FA Page + +### Introduction + +This sample provides a typical information presentation page of applications, including the search bar and list. By leveraging adaptive features such as stretching, zooming, hiding, equalization, and proportion, this sample automatically adapts its layouts to screens of different sizes and presents a proper layout on them based on polymorphic components and responsive layouts. + +### Usage + +Touch the tabs to switch between tab pages. You can swipe up and down on the content page and swipe left and right on the list to view hidden content. + +You can install the app on different types of devices to view the adaptation effect. + +### Constraints + +This sample can only be run on large-system devices. diff --git a/JSUI/JsAdaptivePortalPage/README_zh.md b/JSUI/JsAdaptivePortalPage/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..6af364b36b3ca1efb4d39a8a8b190aaa50830100 --- /dev/null +++ b/JSUI/JsAdaptivePortalPage/README_zh.md @@ -0,0 +1,15 @@ +# 多设备自适应的FA页面 + +### 简介 + +本示例构建了常见应用的信息展示页面,包含搜索栏,列表展示。在不同尺寸的设备上,通过拉伸、缩放、隐藏、均分、占比等自适应能力,使用多态控件、布局和组件的延展性以及响应式布局的运用,自适应展示为合理的布局效果。 + +### 使用说明 + +点击tab-bar按钮进行页面切换,可上下滑动内容页,左右滑动列表查看隐藏内容。 + +开发者可将本示例安装到不同类型设备上,查看自适应效果。 + +### 约束与限制 + +本示例仅支持在大型系统上运行。 \ No newline at end of file diff --git a/JSUI/JsAdaptivePortalPage/build.gradle b/JSUI/JsAdaptivePortalPage/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..078a938c864dba35fdfe799e50c9237dac685afe --- /dev/null +++ b/JSUI/JsAdaptivePortalPage/build.gradle @@ -0,0 +1,36 @@ +// 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#section1112183053510 +ohos { + compileSdkVersion 6 + defaultConfig { + compatibleSdkVersion 6 + } +} + +buildscript { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + } + dependencies { + classpath 'com.huawei.ohos:hap:2.4.4.2' + } +} + +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + jcenter() + } +} diff --git a/JSUI/JsAdaptivePortalPage/entry/build.gradle b/JSUI/JsAdaptivePortalPage/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..fac23f31a7b3ea6a1a9977c974c20ae13287bf52 --- /dev/null +++ b/JSUI/JsAdaptivePortalPage/entry/build.gradle @@ -0,0 +1,21 @@ +apply plugin: 'com.huawei.ohos.hap' +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + compileSdkVersion 6 + defaultConfig { + compatibleSdkVersion 6 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } + +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) +} \ No newline at end of file diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/config.json b/JSUI/JsAdaptivePortalPage/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..0fbc2404c8ce6fa3629fdd12288c9acb97d934da --- /dev/null +++ b/JSUI/JsAdaptivePortalPage/entry/src/main/config.json @@ -0,0 +1,58 @@ +{ + "app": { + "bundleName": "ohos.samples.adaptiveportalpage", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.samples.adaptiveportalpage", + "name": ".MyApplication", + "mainAbility": "ohos.samples.adaptiveportalpage.MainAbility", + "deviceType": [ + "phone", + "tablet", + "tv" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "ohos.samples.adaptiveportalpage.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:entry_MainAbility", + "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/JSUI/JsAdaptivePortalPage/entry/src/main/java/ohos/samples/adaptiveportalpage/MainAbility.java b/JSUI/JsAdaptivePortalPage/entry/src/main/java/ohos/samples/adaptiveportalpage/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..627a436c0aa3eec372ac9bd722b79a19b4451f3b --- /dev/null +++ b/JSUI/JsAdaptivePortalPage/entry/src/main/java/ohos/samples/adaptiveportalpage/MainAbility.java @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package ohos.samples.adaptiveportalpage; + +import ohos.ace.ability.AceAbility; +import ohos.aafwk.content.Intent; + +public class MainAbility extends AceAbility { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + } + + @Override + public void onStop() { + super.onStop(); + } +} diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/java/ohos/samples/adaptiveportalpage/MyApplication.java b/JSUI/JsAdaptivePortalPage/entry/src/main/java/ohos/samples/adaptiveportalpage/MyApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..6cd1bee6a473bd44608b413af09e221583d8a787 --- /dev/null +++ b/JSUI/JsAdaptivePortalPage/entry/src/main/java/ohos/samples/adaptiveportalpage/MyApplication.java @@ -0,0 +1,25 @@ +/* + * 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. + */ + +package ohos.samples.adaptiveportalpage; + +import ohos.aafwk.ability.AbilityPackage; + +public class MyApplication extends AbilityPackage { + @Override + public void onInitialize() { + super.onInitialize(); + } +} diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/app.js b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..aedcefe0054c6e16c40491f4d1abc20a4dc1c6ef --- /dev/null +++ b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/app.js @@ -0,0 +1,8 @@ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/icon_person_blue.png b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/icon_person_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..c010be05f36e74b8533d33be0d179b7670e4a57d Binary files /dev/null and b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/icon_person_blue.png differ diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/icon_person_gray.png b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/icon_person_gray.png new file mode 100644 index 0000000000000000000000000000000000000000..db275e4b13a73c30ff1f19d4729849630c3d356a Binary files /dev/null and b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/icon_person_gray.png differ diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/img_sq.png b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/img_sq.png new file mode 100644 index 0000000000000000000000000000000000000000..b857dd92358468946474c31ae42b68619e224b6e Binary files /dev/null and b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/img_sq.png differ diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/item.png b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/item.png new file mode 100644 index 0000000000000000000000000000000000000000..54a9238cd58b297940ca3bb5a80d6bb0df2cb3d2 Binary files /dev/null and b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/item.png differ diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/item_tv.png b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/item_tv.png new file mode 100644 index 0000000000000000000000000000000000000000..dea296a9a580aecab842a45a4065d1f201cc7f08 Binary files /dev/null and b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/item_tv.png differ diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/more.png b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/more.png new file mode 100644 index 0000000000000000000000000000000000000000..bfebc6fc5d445371169d555b6c8bfaafcbbac078 Binary files /dev/null and b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/more.png differ diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/more_tv.png b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/more_tv.png new file mode 100644 index 0000000000000000000000000000000000000000..d3bff2fd73018adb8e27883a978c6112091002c8 Binary files /dev/null and b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/more_tv.png differ diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/search_tv.png b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/search_tv.png new file mode 100644 index 0000000000000000000000000000000000000000..562f1d4a2a56a8e5f379b3ddfd04c9051888d808 Binary files /dev/null and b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/search_tv.png differ diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/tab_bar_right.png b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/tab_bar_right.png new file mode 100644 index 0000000000000000000000000000000000000000..c730b81668b073ce2560c042d85aa81e624f75dd Binary files /dev/null and b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/tab_bar_right.png differ diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/tab_bar_right_tv.png b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/tab_bar_right_tv.png new file mode 100644 index 0000000000000000000000000000000000000000..97d91bf9b03a840ed3dbd26c1b2df37e06ce80bc Binary files /dev/null and b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/tab_bar_right_tv.png differ diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/tv/icon_person_blue.png b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/tv/icon_person_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..7153a42c7f47cc2607461cafb6687f9a88edac55 Binary files /dev/null and b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/tv/icon_person_blue.png differ diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/tv/icon_person_gray.png b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/tv/icon_person_gray.png new file mode 100644 index 0000000000000000000000000000000000000000..772af9169f57388f2f2e3828e54276e077fe3a9e Binary files /dev/null and b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/images/tv/icon_person_gray.png differ diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/template-card-item.css b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/template-card-item.css new file mode 100644 index 0000000000000000000000000000000000000000..d9cc64a0e1ec3f094f61a19f946f50ae3b27a94c --- /dev/null +++ b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/template-card-item.css @@ -0,0 +1,77 @@ +/* + * 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. + */ + +.div-list-item-three { + flex-direction: row; + align-items: center; + width: 100%; + margin-top: 2px; + height: 33%; + border-radius: 10px; +} + +.img-hmqs-three { + margin-left: 12px; + width: 48px; + height: 48px; + background-image: url('/common/images/item.png'); + background-size: 48px 48px; +} + +.div-txt-hmqs-three { + width: 220px; + height: 100%; + flex-direction: column; + justify-content: center; + margin-left: 20px; +} + +.txt-list-three-item-top { + font-size: 14px; + text-color: black; + width: 100%; +} + +.div-list-three-item-right-down { + flex-direction: row; + justify-content: flex-start; + align-items: center; +} + +.img-list-three-item-right-down { + width: 18px; + height: 18px; + flex-shrink: 0; +} + +.txt-list-three-item-bottom { + font-size: 12px; + text-color: #BCBCBC; + margin-left: 4px; +} + +@media screen and (min-aspect-ratio: 1.7) { + .img-hmqs-three { + background-image: url('/common/images/item_tv.png'); + } + + .txt-list-three-item-top { + text-color: #d9ffffff; + } + + .txt-list-three-item-bottom { + text-color: #d9ffffff; + } +} \ No newline at end of file diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/template-card-item.hml b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/template-card-item.hml new file mode 100644 index 0000000000000000000000000000000000000000..c2849f026c5c35bae09020cbd15732aafbb8382e --- /dev/null +++ b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/template-card-item.hml @@ -0,0 +1,25 @@ + + +
+ +
+ {{ title }} +
+ + {{ author }} +
+
+
\ No newline at end of file diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/template-group-header.css b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/template-group-header.css new file mode 100644 index 0000000000000000000000000000000000000000..f7698bddde8c04adb3445e5d052414a80851fa09 --- /dev/null +++ b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/template-group-header.css @@ -0,0 +1,81 @@ +/* + * 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. + */ + +.content-title-more { + width: 100%; + height: 48px; + flex-direction: row; + justify-content: center; + flex-wrap: nowrap; + align-content: center; + background-color: #F6F4F1; +} + +.div-title-left { + width: 50%; + height: 100%; + flex-direction: column; + justify-content: center; + margin-left: 24px; +} + +.txt-content-title { + font-size: 16px; + font-weight: bold; + text-color: black; +} + +.div-title-right { + flex-direction: row; + width: 50%; + height: 100%; + justify-content: flex-end; + margin-right: 24px; + align-items: center; +} + +.txt-content-more { + font-size: 12px; + text-color: #A3A3A3; + margin-right: 10px; +} + +.img-content-more { + width: 12px; + height: 24px; + flex-shrink: 0; + background-image: url('/common/images/more.png'); + background-size: 12px 24px; +} + +@media screen and (min-aspect-ratio: 1.7) { + .content-title-more { + background-color: black; + } + + .img-content-more { + background-image: url('/common/images/more_tv.png'); + background-size: 12px 24px; + background-position: right; + } + + .txt-content-title { + text-color: #d9ffffff; + } + + .txt-content-more { + text-color: #d9ffffff; + } +} \ No newline at end of file diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/template-group-header.hml b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/template-group-header.hml new file mode 100644 index 0000000000000000000000000000000000000000..10309345686b860e5a1e33f68e4dfd59351ba904 --- /dev/null +++ b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/template-group-header.hml @@ -0,0 +1,24 @@ + + +
+
+ {{ $t('strings.txt-content-title')}} +
+
+ {{ $t('strings.txt-content-more') }} + +
+
\ No newline at end of file diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/template-tabbar.css b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/template-tabbar.css new file mode 100644 index 0000000000000000000000000000000000000000..c04fe3e89c762224f8e8802c5ed605d79f5916c9 --- /dev/null +++ b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/template-tabbar.css @@ -0,0 +1,69 @@ +/* + * 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. + */ + +.div-tab-bar-bottom { + align-items: center; + justify-content: center; + flex-direction: column; + width: 20%; + height: 100%; +} + +.icons { + width: 100%; + margin-bottom: 2px; + justify-content: center; +} + +.img-tab-bar-bottom { + width: 24px; + height: 24px; + flex-shrink: 0; + margin-top: 8px; +} + +.txt-tab-bar-bottom { + font-size: 10px; + margin-bottom: 6px; + text-align: center; +} + +@media screen and (min-aspect-ratio: 1.6) { + .div-tab-bar-bottom { + width: 100%; + height: 20%; + } + .img-tab-bar-bottom { + margin-bottom: 2px; + } + .txt-tab-bar-bottom { + font-size: 10px; + text-align: center; + } +} + +@media screen and (min-aspect-ratio: 1.7) { + .div-tab-bar-bottom { + width: 100%; + height: 20%; + } + .img-tab-bar-bottom { + margin-bottom: 2px; + } + .txt-tab-bar-bottom { + font-size: 10px; + text-align: center; + } +} \ No newline at end of file diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/template-tabbar.hml b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/template-tabbar.hml new file mode 100644 index 0000000000000000000000000000000000000000..35ebf5dabba7ee3b4f71cf4c09cf3667e660f962 --- /dev/null +++ b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/common/template-tabbar.hml @@ -0,0 +1,21 @@ + + +
+
+ +
+ {{ text }} +
\ No newline at end of file diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/i18n/en-US.json b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..f70e77a52a041759a4c849e04f533d5666f26c52 --- /dev/null +++ b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,11 @@ +{ + "strings": { + "SearchHint": "Search...", + "swiper-text1": "Banner", + "swiper-text2": "Description", + "txt-show": "Other pages", + "txt-content-title": "Content title", + "txt-content-more": "more", + "content": "pages" + } +} \ No newline at end of file diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/i18n/zh-CN.json b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..65004ca7699d171e1bad7051f88677fe2d84d2b3 --- /dev/null +++ b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,11 @@ +{ + "strings": { + "SearchHint": "Search...", + "swiper-text1": "Banner", + "swiper-text2": "Description", + "txt-show": "Other pages", + "txt-content-title": "内容子标题", + "txt-content-more": "更多", + "content": "页签" + } +} \ No newline at end of file diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/pages/index/index.css b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..ea3cfc01d4b6b9594f8d540545c976ea46ea3c61 --- /dev/null +++ b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,415 @@ +/* + * 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 { + flex-direction: column; + align-items: center; + background-color: #F6F4F1; + width: 100%; + height: 100%; +} + +.tab-bar-bottom { + width: 100%; + height: 56px; + flex-direction: row; + background-color: #F6F4F1; + justify-content: space-between; +} + +.div-tabs-bottom { + width: 100%; + height: 100%; + display: flex; + flex-direction: column; +} + +.div-tab-content { + width: 100%; + height: 150%; + background-color: #F6F4F1; +} + +.div-content-one { + width: 100%; + height: 150%; + flex-direction: column; + align-items: center; + justify-content: flex-start; +} + +.search-title { + width: 100%; + height: 40px; + margin-top: 8px; + margin-left: 16px; + margin-right: 16px; +} + +.img-tab-bar-right { + width: 24px; + height: 24px; + position: absolute; + right: 24px; + top: 68px; +} + +.div-tabs { + width: 100%; + margin-top: 8px; +} + +.div-tab-bar { + width: 100%; + height: 56px; + margin-right: 56px; +} + +.txt-tab-bar { + color: gray; + font-size: 16px; + text-align: center; +} + +.txt-tab-bar:active { + color: #035AFE; + font-size: 18px; + font-weight: bold; +} + +.item-content { + width: 100%; + flex-direction: column; + align-items: center; +} + +.list-one { + flex-direction: row; + align-items: center; + margin-top: 18px; + justify-content: space-between; + width: 100%; + height: 72px; + padding-left: 8px; + background-color: #F6F4F1; +} + +.div-list-item-one { + flex-direction: column; + align-items: center; + justify-content: flex-start; + width: 52px; + height: 64px; +} + +.button-circle { + width: 40px; + height: 40px; + background-color: #CCCCCC; +} + +.txt-list-item-one { + font-size: 14px; + margin-top: 6px; +} + +.list-two { + height: 144px; + flex-direction: row; + justify-content: center; + align-items: flex-start; + background-color: #F6F4F1; +} + +.item-two { + width: 104px; + height: 144px; + margin-left: 12px; + background-color: #F6F4F1; +} + +.div-list-item-two { + flex-direction: column; + align-items: center; + justify-content: flex-start; + height: 100%; + width: 100%; +} + +.img-hmqs { + width: 104px; + height: 104px; + flex-shrink: 0; + border-radius: 10px; +} + +.div-txt-hmqs { + width: 100%; + margin-top: 6px; + flex-direction: row; +} + +.txt-list-item-two { + font-size: 16px; +} + +.list-three { + width: 100%; + height: 224px; + flex-direction: row; + justify-content: center; + margin-top: 8px; + background-color: #F6F4F1; +} + +.item-three { + display: flex; + flex-direction: column; + border-radius: 10px; + margin-left: 12px; + margin-right: -4px; + width: 95%; + background-color: white; +} + +.divider { + color: #1affffff; + stroke-width: 1px; + line-cap: round; + margin-left: 24px; + margin-right: 24px; +} + +.div-content-others { + width: 100%; + height: 100%; + flex-direction: column; + align-items: center; + justify-content: center; + background-color: white; +} + +.txt-show-page { + text-color: black; + font-size: 30px; +} + +@media screen and (min-aspect-ratio: 0.8) { + .list-one { + width: 558px; + height: 72px; + padding-left: 13px; + } + + .div-list-item-one { + width: 81px; + height: 64px; + } + + .item-two { + margin-left: 16px; + } + + .item-three { + width: 48%; + } +} + +@media screen and (min-aspect-ratio: 0.6) { + .search-title { + margin-left: 24px; + margin-right: 24px; + } + + .img-tab-bar-right { + top: 65px; + } + + .list-one { + width: 100%; + height: 72px; + margin-left: 24px; + margin-right: 24px; + padding-left: 16px; + background-color: #F6F4F1; + } + + .div-list-item-one { + width: 110px; + height: 64px; + } + + .item-two { + margin-left: 16px; + } + + .item-three { + width: 48%; + background-color: white; + } +} + +@media screen and (min-aspect-ratio: 1.6) { + .search-title { + margin-left: 24px; + margin-right: 24px; + } + + .img-tab-bar-right { + top: 65px; + } + + .list-one { + width: 963px; + height: 72px; + margin-left: 99px; + margin-right: 122px; + padding-left: 21px; + background-color: #F6F4F1; + } + + .div-list-item-one { + width: 140px; + height: 64px; + } + + .item-two { + margin-right: 46px; + } + + .item-three { + width: 32%; + background-color: white; + } + + .tab-bar-bg{ + width: 96px; + height: 100%; + flex-direction: column; + align-items: center; + justify-content: center; + background-color: #F6F4F1; + } + + .tab-bar-bottom { + width: 96px; + height: 400px; + flex-direction: column; + align-items: center; + background-color: #F6F4F1; + justify-content: space-between; + } + + .container { + flex-direction: row; + justify-content: center; + background-color: #F6F4F1; + } +} + +@media screen and (min-aspect-ratio: 1.7) { + .container { + flex-direction: row; + justify-content: center; + background-color: black; + } + + .img-tab-bar-right { + top: 65px; + } + + .div-list-item-one { + width: 81px; + height: 61px; + } + + .item-two { + margin-right: 18px; + background-color: black; + } + + .item-three { + width: 48%; + background-color: #1affffff; + } + + .txt-list-item-one { + text-color: #99ffffff; + } + + .txt-list-item-two { + text-color: #99ffffff; + } + + .tab-bar-bg{ + width: 96px; + height: 100%; + flex-direction: column; + align-items: center; + justify-content: center; + background-color: #1affffff; + } + + .tab-bar-bottom { + width: 96px; + height: 400px; + flex-direction: column; + justify-content: space-between; + background-color: #00ffffff + } + + .search-title { + margin-left: 24px; + margin-right: 24px; + background-color: #1affffff; + placeholder-color: #99ffffff; + text-color: #99ffffff; + } + + .div-tab-bar { + background-color: black; + } + + .div-tab-content { + background-color: black; + } + + .list-one { + width: 629px; + height: 61px; + background-color: black; + } + + .button-circle { + background-color: #1affffff; + } + + .div-list-item-one { + width: 81px; + height: 61px; + } + + .list-two { + background-color: black; + } + + .list-three { + background-color: black; + } + + .txt-tab-bar:active { + color: #3F97E9; + } +} \ No newline at end of file diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/pages/index/index.hml b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..e1f8788ec0a9d80bd1b200769c44b29a4f853482 --- /dev/null +++ b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,128 @@ + + + + + + +
+
+
+ +
+
+ + +
+ + + + + {{ $item }} + + + + +
+
+ + {{ $item.title }} +
+
+ + + +
+ +
+ {{ $item.title }} +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ {{ $t('strings.txt-show') }} +
+
+ {{ $t('strings.txt-show') }} +
+
+ {{ $t('strings.txt-show') }} +
+
+ {{ $t('strings.txt-show') }} +
+
+ {{ $t('strings.txt-show') }} +
+
+
+
+
+ {{ $t('strings.txt-show') }} +
+
+ {{ $t('strings.txt-show') }} +
+
+ {{ $t('strings.txt-show') }} +
+
+ {{ $t('strings.txt-show') }} +
+
+
+
+ +
+
\ No newline at end of file diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/pages/index/index.js b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..436d7d83b6f7c9d9c599e7807da111910bc5d4c3 --- /dev/null +++ b/JSUI/JsAdaptivePortalPage/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,44 @@ +/* + * 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. + */ + +import mediaquery from '@system.mediaquery'; + +export default { + data: { + subTabList: ["子页签", "页签", "页签", "页签", "页签", "页签", "页签", "页签", "页签", "页签", "页签", "页签", "页签", "页签", "页签", "页签", "页签", "页签", "页签", "页签", "页签"], + listOne: Array(5).fill().map((_, index) => ({ uri: "", title: "item", id: "item_" + index})), + listTwo: Array(16).fill().map((_, index) => ({ uri: "", title: "item " + index, id: "item_" + index})), + listThree: Array(16).fill().map((_, index) => ({ msg1: "The End Of The World", msg2: "Justin Timberland", id: "item_" + index})), + tabBars: [ + { icon: "icon_person_blue.png", text: "页签" }, + { icon: "icon_person_gray.png", text: "页签" }, + { icon: "icon_person_gray.png", text: "页签" }, + { icon: "icon_person_gray.png", text: "页签" }, + { icon: "icon_person_gray.png", text: "页签" }, + ], + isTablet: false, + isTv: false, + menu_tabs_index: 0 + }, + onInit() { + this.regMediaQuery(); + }, + regMediaQuery() { + let mediaQueryTablet = mediaquery.matchMedia('(device-type:tablet) and (orientation: landscape)'); + let mediaQueryTv = mediaquery.matchMedia('(device-type: tv)'); + mediaQueryTablet.addListener((data) => { this.isTablet = data.matches; }); + mediaQueryTv.addListener((data) => {this.isTv = data.matches; }); + } +} \ No newline at end of file diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/resources/base/element/string.json b/JSUI/JsAdaptivePortalPage/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..b9d0cc7db5423e594eadc78618c907b331f19269 --- /dev/null +++ b/JSUI/JsAdaptivePortalPage/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "AdaptivePortalPage" + }, + { + "name": "mainability_description", + "value": "JS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/JSUI/JsAdaptivePortalPage/entry/src/main/resources/base/media/icon.png b/JSUI/JsAdaptivePortalPage/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/JSUI/JsAdaptivePortalPage/entry/src/main/resources/base/media/icon.png differ diff --git a/JSUI/JsAdaptivePortalPage/screenshots/device/phone.png b/JSUI/JsAdaptivePortalPage/screenshots/device/phone.png new file mode 100644 index 0000000000000000000000000000000000000000..2d5887fb0211c5b62eaf7021c05dcb5ecaacc384 Binary files /dev/null and b/JSUI/JsAdaptivePortalPage/screenshots/device/phone.png differ diff --git a/JSUI/JsAdaptivePortalPage/screenshots/device/tablet1.png b/JSUI/JsAdaptivePortalPage/screenshots/device/tablet1.png new file mode 100644 index 0000000000000000000000000000000000000000..39097cd95d4e3e8121b809eecfb69cd7ee756ffa Binary files /dev/null and b/JSUI/JsAdaptivePortalPage/screenshots/device/tablet1.png differ diff --git a/JSUI/JsAdaptivePortalPage/screenshots/device/tablet2.png b/JSUI/JsAdaptivePortalPage/screenshots/device/tablet2.png new file mode 100644 index 0000000000000000000000000000000000000000..90be56fc359d3e1a4db13aaca24054b8b1acdebc Binary files /dev/null and b/JSUI/JsAdaptivePortalPage/screenshots/device/tablet2.png differ diff --git a/JSUI/JsAdaptivePortalPage/screenshots/device/tv.png b/JSUI/JsAdaptivePortalPage/screenshots/device/tv.png new file mode 100644 index 0000000000000000000000000000000000000000..801972b98f6020f63b259b281ccd6410a9f81a9a Binary files /dev/null and b/JSUI/JsAdaptivePortalPage/screenshots/device/tv.png differ diff --git a/JSUI/JsAdaptivePortalPage/settings.gradle b/JSUI/JsAdaptivePortalPage/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..4773db73233a570c2d0c01a22e75321acfbf7a07 --- /dev/null +++ b/JSUI/JsAdaptivePortalPage/settings.gradle @@ -0,0 +1 @@ +include ':entry' diff --git a/JSUI/JsAdaptiveServiceWidget/README_en.md b/JSUI/JsAdaptiveServiceWidget/README_en.md new file mode 100644 index 0000000000000000000000000000000000000000..8d52935eccd7c11bec3374c51133d7dad41f2ed7 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/README_en.md @@ -0,0 +1,18 @@ +# Multi-Device Adaptive Service Widget + +### Introduction + +This sample shows how five service widgets adapt to devices of different sizes. They are immersive, graphic, grid, plain text, and multi-dimensional information service widgets. When a service widget is extremely wide or high, it can be displayed through adaptive capabilities such as stretching, scaling, hiding, wrapping, and equalization. + +### Usage + +Method 1: Swipe up on the sample app icon and select a size to add a service widget to the screen. + +Method 2: Touch and hold the sample app icon until Service Widgets is displayed. Touch Service Widgets and select a size to add a service widget to the screen. + +You can install the app on different types of devices and view the adaption effect. + +### Constraints + +This sample can only be run on large-system devices. + diff --git a/JSUI/JsAdaptiveServiceWidget/README_zh.md b/JSUI/JsAdaptiveServiceWidget/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..c0c49abd38a541e2db06c01fa06a61393904e702 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/README_zh.md @@ -0,0 +1,15 @@ +# 多设备自适应服务卡片 + +### 简介 + +本示例分别通过沉浸式卡片、图文卡片、宫格卡片、纯文本卡片、多维度信息卡片五种类型,展示了卡片在不同尺寸设备上的自适应能力。当卡片在极宽和极高的情况下,通过拉伸、缩放、隐藏、折行、均分等自适应能力将卡片展示出来。 + +### 使用说明 + +方式一:上滑本示例应用图标,选择需要的卡片尺寸添加屏幕。 + +方式二:长按示例应用,等待出现服务卡片字样,点击后选择需要的卡片尺寸,添加到屏幕。 + +### 约束与限制 + +本示例支持在大型设备上运行。 diff --git a/JSUI/JsAdaptiveServiceWidget/build.gradle b/JSUI/JsAdaptiveServiceWidget/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..91af1ca64995ab365fbf9f4d6b6c9a5f816d163f --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/build.gradle @@ -0,0 +1,36 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +apply plugin: 'com.huawei.ohos.app' + +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } +} + +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.2' + } +} + +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + jcenter() + } +} \ No newline at end of file diff --git a/JSUI/JsAdaptiveServiceWidget/entry/build.gradle b/JSUI/JsAdaptiveServiceWidget/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..83f59debbd68242b503a22270f4378d7843ca204 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/build.gradle @@ -0,0 +1,19 @@ +apply plugin: 'com.huawei.ohos.hap' +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) +} \ No newline at end of file diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/config.json b/JSUI/JsAdaptiveServiceWidget/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..55ee1c66938b3e9b22a71532e66da3f577958f83 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/config.json @@ -0,0 +1,191 @@ +{ + "app": { + "bundleName": "ohos.samples.adaptiveservicewidget", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.samples.adaptiveservicewidget", + "name": ".MyApplication", + "mainAbility": "ohos.samples.adaptiveservicewidget.MainAbility", + "deviceType": [ + "phone", + "tablet" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "ohos.samples.adaptiveservicewidget.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard", + "formsEnabled": true, + "forms": [ + { + "jsComponentName": "complex", + "isDefault": true, + "scheduledUpdateTime": "10:30", + "defaultDimension": "4*4", + "name": "complex", + "description": "This is a service widget", + "colorMode": "auto", + "type": "JS", + "supportDimensions": [ + "4*4" + ], + "updateEnabled": true, + "updateDuration": 1 + }, + { + "jsComponentName": "text", + "isDefault": false, + "scheduledUpdateTime": "10:30", + "defaultDimension": "2*2", + "name": "text", + "description": "This is a service widget", + "colorMode": "auto", + "type": "JS", + "supportDimensions": [ + "2*2", + "4*4" + ], + "updateEnabled": true, + "updateDuration": 1 + }, + { + "jsComponentName": "immersive", + "isDefault": false, + "scheduledUpdateTime": "10:30", + "defaultDimension": "2*2", + "name": "immersive", + "description": "This is a service widget", + "colorMode": "auto", + "type": "JS", + "supportDimensions": [ + "2*2" + ], + "updateEnabled": true, + "updateDuration": 1 + }, + { + "jsComponentName": "grid", + "isDefault": false, + "scheduledUpdateTime": "10:30", + "defaultDimension": "2*2", + "name": "grid", + "description": "This is a service widget", + "colorMode": "auto", + "type": "JS", + "supportDimensions": [ + "2*2" + ], + "updateEnabled": true, + "updateDuration": 1 + }, + { + "jsComponentName": "imgText", + "isDefault": false, + "scheduledUpdateTime": "10:30", + "defaultDimension": "2*4", + "name": "imgText", + "description": "This is a service widget", + "colorMode": "auto", + "type": "JS", + "supportDimensions": [ + "2*4" + ], + "updateEnabled": true, + "updateDuration": 1 + } + ] + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": true + } + }, + { + "pages": [ + "pages/index/index" + ], + "name": "complex", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "type": "form" + }, + { + "pages": [ + "pages/index/index" + ], + "name": "text", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "type": "form" + }, + { + "pages": [ + "pages/index/index" + ], + "name": "immersive", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "type": "form" + }, + { + "pages": [ + "pages/index/index" + ], + "name": "grid", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "type": "form" + }, + { + "pages": [ + "pages/index/index" + ], + "name": "imgText", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "type": "form" + } + ] + } +} \ No newline at end of file diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/java/ohos/samples/adaptiveservicewidget/MainAbility.java b/JSUI/JsAdaptiveServiceWidget/entry/src/main/java/ohos/samples/adaptiveservicewidget/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..7f17b04d2ba72825f9bd97f743cd351790de34f8 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/java/ohos/samples/adaptiveservicewidget/MainAbility.java @@ -0,0 +1,61 @@ +/* + * 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. + */ + +package ohos.samples.adaptiveservicewidget; + +import ohos.aafwk.ability.ProviderFormInfo; +import ohos.aafwk.content.Intent; +import ohos.ace.ability.AceAbility; +import ohos.hiviewdfx.HiLog; +import ohos.hiviewdfx.HiLogLabel; + +/** + * MyApplication + * + * @since 2021-08-09 + */ +public class MainAbility extends AceAbility { + private static final HiLogLabel TAG = new HiLogLabel(HiLog.DEBUG, 0x0, MainAbility.class.getName()); + + @Override + public void onStart(Intent intent) { + HiLog.info(TAG, "onStart"); + super.onStart(intent); + } + + @Override + protected ProviderFormInfo onCreateForm(Intent intent) { + HiLog.info(TAG, "onCreateForm"); + return super.onCreateForm(intent); + } + + @Override + protected void onUpdateForm(long formId) { + HiLog.info(TAG, "onUpdateForm"); + super.onUpdateForm(formId); + } + + @Override + protected void onDeleteForm(long formId) { + HiLog.info(TAG, "onDeleteForm: formId=" + formId); + super.onDeleteForm(formId); + } + + @Override + protected void onTriggerFormEvent(long formId, String message) { + HiLog.info(TAG, "onTriggerFormEvent: " + message); + super.onTriggerFormEvent(formId, message); + } +} \ No newline at end of file diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/java/ohos/samples/adaptiveservicewidget/MyApplication.java b/JSUI/JsAdaptiveServiceWidget/entry/src/main/java/ohos/samples/adaptiveservicewidget/MyApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..0f9a7714f1059b032fba93ec46c442707dc73107 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/java/ohos/samples/adaptiveservicewidget/MyApplication.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package ohos.samples.adaptiveservicewidget; + +import ohos.aafwk.ability.AbilityPackage; + +/** + * MyApplication + * + * @since 2021-08-09 + */ +public class MyApplication extends AbilityPackage { + @Override + public void onInitialize() { + super.onInitialize(); + } +} \ No newline at end of file diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/complex/common/ic_add.svg b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/complex/common/ic_add.svg new file mode 100644 index 0000000000000000000000000000000000000000..83801893cd9710f18016d347ec2b962488751133 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/complex/common/ic_add.svg @@ -0,0 +1,30 @@ + + + Public/ic_public_add_norm_filled + + + + + + + + + + \ No newline at end of file diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/complex/common/ic_gift.svg b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/complex/common/ic_gift.svg new file mode 100644 index 0000000000000000000000000000000000000000..479d3790d7f1f83eded09ebec9f1c6ec396c2710 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/complex/common/ic_gift.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/complex/pages/index/index.css b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/complex/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..fce2a04c3490485cfc42e0dd459687c327f21c9c --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/complex/pages/index/index.css @@ -0,0 +1,255 @@ +/* + * 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 { + flex-direction: column; + margin: 12px; +} + +.region-title { + flex-direction: row; + width: 100%; + position: relative; + flex-shrink: 0; +} + +.left-image { + width: 20px; + height: 20px; +} + +.left-text { + font-size: 14px; + margin-left: 5px; + color: coral; + font-weight: bold; +} + +.right-text { + font-size: 9px; + opacity: 0.6; + position: absolute; + right: 0px; + bottom: 0px; +} + +.region-plates { + margin-top: 5px; + flex-direction: row; + justify-content: space-between; + height: 60px; + align-content: center; + flex-shrink: 0; +} + +.exponent-left { + padding: 6px; + margin-right: 4px; + border-radius: 10px; + flex-direction: column; + background-color: #FFF8F8; + justify-content: space-evenly; +} + +.exponent-text { + prefer-font-sizes: 12px,10px; + text-overflow: ellipsis; + max-lines: 1; + flex-grow: 1; + width: 80%; + font-weight: bold; + opacity: 0.8; +} + +.exponent-num-red { + font-size: 10px; + margin-top: 3px; + margin-bottom: 3px; + color: #FE3D3B; + font-weight: bold; + opacity: 0.8; +} + +.exponent-div { + flex-direction: row; +} + +.row-div { + flex-direction: row; + position: relative; + height: 20px; +} + +.region-row-div { + flex-direction: row; + height: 50px; + position: relative; +} + +.exponent-float-red { + font-size: 10px; + color: #FE3D3B; + font-weight: bold; + opacity: 0.8; +} + +.exponent-per-red { + font-size: 9px; + color: #FE3D3B; + font-weight: bold; + opacity: 0.8; + margin-left: 7px; +} + +.exponent-mid { + padding: 6px; + margin-right: 2px; + margin-left: 2px; + border-radius: 10px; + flex-direction: column; + background-color: #F4FDF4; + justify-content: space-evenly; +} + +.fund-text { + font-size: 10px; + opacity: 0.6; + position: absolute; +} + +.time-text-front { + font-size: 10px; + opacity: 0.6; + position: absolute; + right: 50px; +} + +.time-text-after { + font-size: 10px; + opacity: 0.6; + position: absolute; + right: 0px; +} + +.exponent-num-green { + font-size: 10px; + margin-top: 3px; + margin-bottom: 3px; + color: #52C45E; + font-weight: bold; + opacity: 0.8; +} + +.exponent-float-green { + font-size: 10px; + color: #52C45E; + font-weight: bold; + opacity: 0.8; +} + +.exponent-per-green { + font-size: 9px; + color: #52C45E; + font-weight: bold; + opacity: 0.8; + margin-left: 7px; +} + +.exponent-right { + padding: 6px; + margin-left: 4px; + border-radius: 10px; + flex-direction: column; + background-color: #F4FDF4; + justify-content: space-evenly; +} + +.region-fund { + flex-direction: column; + margin-top: 10px; +} + +.region-fund-item { + flex-direction: column; + justify-content: space-evenly; +} + +.column-div { + flex-direction: column; +} + +.coded-text { + font-size: 10px; + opacity: 0.6; + padding-top: 5px; +} + +.per-text { + font-size: 10px; + color: #FE3D3B; + font-weight: bold; + opacity: 0.8; + position: absolute; + right: 50px; + top: 10px; +} + +.per-text-red { + font-size: 10px; + color: #FE3D3B; + font-weight: bold; + opacity: 0.8; + position: absolute; + right: 0px; + top: 10px; +} + +.per-text-green { + font-size: 10px; + color: #52C45E; + font-weight: bold; + opacity: 0.8; + position: absolute; + right: 0px; + top: 10px; +} + +.region-bottom { + flex-direction: row; + padding-top: 5px; + height: 75px; + justify-content: space-evenly; +} + +.region-bottom-item { + flex-direction: column; + flex-wrap: wrap; + justify-content: center; +} + +.region-bottom-image { + height: 24px; + width: 24px; + flex-shrink: 0; +} + +.region-bottom-text { + margin-top: 3px; + font-size: 10px; + font-weight: bold; + opacity: 0.8; + flex-shrink: 0; + left: 2px; +} \ No newline at end of file diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/complex/pages/index/index.hml b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/complex/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..2a50f7fa22e49184dbebce225db1d2b4842b59cc --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/complex/pages/index/index.hml @@ -0,0 +1,55 @@ + + +
+
+ + {{ title }} + {{ time }} +
+
+
+ {{ $item.name }} + {{ $item.num }} +
+ {{ $item.float }} + {{ $item.per }} +
+
+
+
+
+ {{ fundText }} + {{ timeText }} + {{ timeText }} +
+
+
+
+ {{ $item.name }} + {{ $item.coded }} +
+ {{ $item.perFront }} + {{ $item.perAfter }} +
+
+
+
+
+ + {{ $item.text }} +
+
+
\ No newline at end of file diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/complex/pages/index/index.json b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/complex/pages/index/index.json new file mode 100644 index 0000000000000000000000000000000000000000..cdbc0aea65bf8b16632022a7db54998cfb485799 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/complex/pages/index/index.json @@ -0,0 +1,114 @@ +{ + "data": { + "title": "天天基金", + "time": "交易日更新净值时间:16:00-23:00", + "fundText": "基金名称", + "timeText": "近一周", + "arrayPlates": [ + { + "id": 1, + "name": "上证指数", + "num": 3000.00, + "float": 36.12, + "per": "1.03%", + "exponent": "exponent-left", + "exponentNum": "exponent-float-red", + "exponentFloat": "exponent-float-red", + "exponentPer": "exponent-per-red" + }, + { + "id": 2, + "name": "深圳成指", + "num": 3000.00, + "float": -36.12, + "per": "-1.03%", + "exponent": "exponent-mid", + "exponentNum": "exponent-num-green", + "exponentFloat": "exponent-float-green", + "exponentPer": "exponent-per-green" + }, + { + "id": 3, + "name": "创业板指", + "num": 3000.00, + "float": -36.12, + "per": "-1.03%", + "exponent": "exponent-right", + "exponentNum": "exponent-num-green", + "exponentFloat": "exponent-float-green", + "exponentPer": "exponent-per-green" + } + ], + "array": [ + { + "id": 1, + "name": "某某投资有限集团内需精选混合(LOF)", + "coded": 161810, + "perFront": "2.87%", + "perAfter": "2.87%", + "displayIndex": 4, + "perTextAfter": "per-text-red" + }, + { + "id": 2, + "name": "银华内需精选混合(LOF)", + "coded": 161810, + "perFront": "2.87%", + "perAfter": "-2.87%", + "displayIndex": 4, + "perTextAfter": "per-text-green" + }, + { + "id": 3, + "name": "银华内需精选混合(LOF)", + "coded": 161810, + "perFront": "2.87%", + "perAfter": "-2.87%", + "displayIndex": 3, + "perTextAfter": "per-text-green" + }, + { + "id": 4, + "name": "银华内需精选混合(LOF)", + "coded": 161810, + "perFront": "2.87%", + "perAfter": "-2.87%", + "displayIndex": 2, + "perTextAfter": "per-text-green" + }, + { + "id": 5, + "name": "银华内需精选混合(LOF)", + "coded": 161810, + "perFront": "2.87%", + "perAfter": "-2.87%", + "displayIndex": 1, + "perTextAfter": "per-text-green" + } + ], + "arrayImage": [ + { + "id": 1, + "text": "排行" + }, + { + "id": 2, + "text": "榜单" + }, + { + "id": 3, + "text": "学堂" + } + ] + }, + "actions": { + "routerEvent": { + "action": "router", + "bundleName": "ohos.samples.adaptiveservicewidget", + "abilityName": "ohos.samples.adaptiveservicewidget.MainAbility", + "params": { + "message": "add detail" + } + } + } +} diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/default/app.js b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..8e47afff13e928a74fdcc01a108e4422404b9ac9 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/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/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/default/i18n/en-US.json b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..58c0034c744d6366af797982451d01c3ddb93dd3 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,5 @@ +{ + "strings": { + "text": "Usage\n\nMethod 1: Swipe up on the sample app icon and select a size to add service widget to the screen.\n\nMethod 2: Touch and hold the sample app icon until Service Widgets is displayed. Touch Service Widgets and select a size to add a service widget to the screen.\n\nYou can install the app on different types of devices and view the adaptation effect.\n" + } +} \ No newline at end of file diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/default/i18n/zh-CN.json b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..8ec76e93983e5664d404adc2213881929559c756 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,5 @@ +{ + "strings": { + "text": "使用说明\n\n方式一:上滑本示例应用图标,选择需要的卡片尺寸添加到屏幕。\n\n方式二:长按示例应用,等待出现服务卡片字样,点击后选择需要的卡片尺寸,添加到屏幕。\n\n可以将此应用安装到不同类型的设备上,查看自适应效果。\n" + } +} \ No newline at end of file diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/default/pages/index/index.css b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..26bc0e7929c7d74dd7e7e4b84547165d25b6b787 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,26 @@ +/* + * 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 { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 16px; + color: #000000; + opacity: 0.9; +} \ No newline at end of file diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/default/pages/index/index.hml b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..d89a180473d3e28078734b0b7bea6e6850f5f11f --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,20 @@ + + +
+ + {{ text }} + +
diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/default/pages/index/index.js b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..456819aff124de563a5b968cfdcb18ca7d0291df --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/default/pages/index/index.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 { + data: { + text: "" + }, + onInit() { + this.text = this.$t('strings.text'); + } +} diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/grid/common/ic_app.svg b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/grid/common/ic_app.svg new file mode 100644 index 0000000000000000000000000000000000000000..cabb1c4f3e64d96d2f910725907aa09bf6407f9d --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/grid/common/ic_app.svg @@ -0,0 +1,8 @@ + + + ic_1 + + + + + \ No newline at end of file diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/grid/common/image.png b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/grid/common/image.png new file mode 100644 index 0000000000000000000000000000000000000000..e1b755789ae81660ad15eb2869496afa40dcd3d4 Binary files /dev/null and b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/grid/common/image.png differ diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/grid/i18n/en-US.json b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/grid/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..f32a8cc1dbb90479438ec4df7e67d17bde025e8d --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/grid/i18n/en-US.json @@ -0,0 +1,5 @@ +{ + "strings": { + "title": "Hello·World" + } +} \ No newline at end of file diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/grid/i18n/zh-CN.json b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/grid/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..fdd2276494702d48870a5a1c0c74a9a91fdf8c61 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/grid/i18n/zh-CN.json @@ -0,0 +1,5 @@ +{ + "strings": { + "title": "你好·世界" + } +} \ No newline at end of file diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/grid/pages/index/index.css b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/grid/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..4cf68faa1c91972069c20e54289069a4b7f1848b --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/grid/pages/index/index.css @@ -0,0 +1,82 @@ +/* + * 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 { + flex-direction: column; + justify-content: center; + align-items: center; + margin: 12px; +} + +.header-div { + width: 100%; + height: 20px; + align-content: center; + align-items: center; +} + +.image-up { + width: 20px; + height: 20px; + border-radius: 10px; +} + +.text-up { + margin-left: 8px; + color: #F58508; + font-size: 12px; + min-font-size: 10px; + font-weight: normal; +} + +.main-div { + margin-top: 7.5px; + justify-content: space-evenly; + align-items: center; + width: 100%; + height: 51.5px; + flex-direction: row; + flex-shrink: 1; + flex-grow: 1; +} + +.image-radius { + border-radius: 4px; +} + +.text-down { + background-color: aliceblue; + text-color: black; + font-size: 10px; + min-font-size: 8px; + font-weight: normal; + height: 14px; + width: 36px; + border-radius: 4px; + text-align: center; +} + +.stack-left { + margin-right: 5%; + justify-content: flex-end; + align-items: flex-end; + align-content: flex-end; +} +.stack-right { + margin-left: 5%; + justify-content: flex-end; + align-items: flex-end; + align-content: flex-end; +} \ No newline at end of file diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/grid/pages/index/index.hml b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/grid/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..4f2fa11cde251c26a7fb140cb44ff1d3f3dbbddf --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/grid/pages/index/index.hml @@ -0,0 +1,41 @@ + + +
+
+ + {{ $t('strings.title') }} +
+
+ + + 0.33 + + + + 0.33 + +
+
+ + + 0.33 + + + + 0.33 + +
+
\ No newline at end of file diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/grid/pages/index/index.json b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/grid/pages/index/index.json new file mode 100644 index 0000000000000000000000000000000000000000..ea66244e37648f58c84bdaecaaaf7b9f15081982 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/grid/pages/index/index.json @@ -0,0 +1,18 @@ +{ + "data": { + "title": "Title", + "detail": "Text", + "iconTitle": "Picture" + }, + "actions": { + "routerEvents": { + "action": "router", + "bundleName": "ohos.samples.adaptiveservicewidget", + "abilityName": "ohos.samples.adaptiveservicewidget.MainAbility", + "params": { + "message": "add detail" + } + } + } +} + diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/imgText/common/ic_app.svg b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/imgText/common/ic_app.svg new file mode 100644 index 0000000000000000000000000000000000000000..52e38085b88e900690a4a9fc989251874d82c452 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/imgText/common/ic_app.svg @@ -0,0 +1,8 @@ + + + ic_2 + + + + + \ No newline at end of file diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/imgText/common/poster1.png b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/imgText/common/poster1.png new file mode 100644 index 0000000000000000000000000000000000000000..ecc0b7831969dfaec8fcf6b2971aaeb69295926f Binary files /dev/null and b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/imgText/common/poster1.png differ diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/imgText/common/poster2.png b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/imgText/common/poster2.png new file mode 100644 index 0000000000000000000000000000000000000000..94d8f9816ceecaf622ca141a3ab3fffde849e5ea Binary files /dev/null and b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/imgText/common/poster2.png differ diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/imgText/pages/index/index.css b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/imgText/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..08acd812db0a38b20931a22c906164554ba2c2f6 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/imgText/pages/index/index.css @@ -0,0 +1,114 @@ +/* + * 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 { + flex-direction: column; + width: 100%; + height: 100%; + margin-left: 12px; + margin-bottom: 12px; + margin-top: 12px; + flex-wrap: nowrap; +} + +.header-div { + width: 100%; + margin-right: 12px; +} + +.image-div { + justify-content: flex-start; +} + +.image-up { + width: 60px; + height: 20px; +} + +.text-div { + justify-content: flex-end; +} + +.text-right-up { + height: 20px; + margin-top: 3px; + margin-bottom: 3px; + margin-left: 4px; + min-font-size: 10px; + color: black; + font-size: 10px; + font-weight: normal; +} + +.main-div { + flex-wrap: nowrap; + margin-top: 4px; + justify-content: space-between; + align-items: center; + width: 100%; + height: 100%; +} + +.item-div { + flex-direction: column; + width: 75px; + height: 100%; + flex-grow: 1; + flex-shrink: 0; + margin-right: 12px; +} + +@media (device-type: tablet) { + .item-div { + flex-direction: column; + width: 90px; + height: 100%; + flex-grow: 1; + flex-shrink: 0; + margin-right: 12px; + } +} + +.item-image { + flex-direction: row; + width: 100%; + height: 70px; + border-radius: 14px; + flex-grow: 1; + flex-shrink: 1; +} + +.item-title-up { + width: 90px; + font-size: 12px; + min-font-size: 10px; + margin-top: 2px; + font-weight: bold; + opacity: 0.9; + color: black; + text-overflow: ellipsis; + max-lines: 1; +} + +.item-title-down { + width: 90px; + font-size: 10px; + margin-top: 2px; + font-weight: normal; + opacity: 0.6; + color: black; + text-overflow: ellipsis; + max-lines: 1; +} \ No newline at end of file diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/imgText/pages/index/index.hml b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/imgText/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..4523b3c5c33f8ad208deaf7ccb0443d6022c3175 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/imgText/pages/index/index.hml @@ -0,0 +1,32 @@ + + +
+ +
+ +
+
+ {{title}} +
+
+
+
+ + {{ $item.title }} + {{ $item.detail }} +
+
+
\ No newline at end of file diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/imgText/pages/index/index.json b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/imgText/pages/index/index.json new file mode 100644 index 0000000000000000000000000000000000000000..211fc62d00ac785bb6ecbecf2df315116229ff23 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/imgText/pages/index/index.json @@ -0,0 +1,59 @@ +{ + "data": { + "title": "完整推荐", + "list": [ + { + "id": 1, + "title": "今日美食推荐", + "detail": "一碗香喷喷的油泼面,回到儿时的青涩回忆", + "poster": "/common/poster1.png", + "displayIndex": 3 + }, + { + "id": 2, + "title": "今日电影推荐", + "detail": "好看的电影,每一步都令人深刻", + "poster": "/common/poster2.png", + "displayIndex": 3 + }, + { + "id": 3, + "title": "今日音乐推荐", + "detail": "一缕美妙的歌声,令人念念不忘", + "poster": "/common/poster2.png", + "displayIndex": 2 + }, + { + "id": 4, + "title": "今日美食推荐", + "detail": "一碗香喷喷的油泼面,回到儿时的青涩回忆", + "poster": "/common/poster2.png", + "displayIndex": 1 + }, + { + "id": 5, + "title": "今日美食推荐", + "detail": "一碗香喷喷的油泼面,回到儿时的青涩回忆", + "poster": "/common/poster2.png", + "displayIndex": 1 + }, + { + "id": 6, + "title": "今日美食推荐", + "detail": "一碗香喷喷的油泼面,回到儿时的青涩回忆", + "poster": "/common/poster2.png", + "displayIndex": 1 + } + ] + }, + "actions": { + "routerEvent": { + "action": "router", + "bundleName": "ohos.samples.adaptiveservicewidget", + "abilityName": "ohos.samples.adaptiveservicewidget.MainAbility", + "params": { + "message": "add detail" + } + } + } +} diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/immersive/common/envelope.png b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/immersive/common/envelope.png new file mode 100644 index 0000000000000000000000000000000000000000..8c25c4aaecedee3eed8aad54a9be701f7ee201b2 Binary files /dev/null and b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/immersive/common/envelope.png differ diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/immersive/pages/index/index.css b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/immersive/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..10f45c928940cb8619806284d27d579cfecaae6a --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/immersive/pages/index/index.css @@ -0,0 +1,39 @@ +/* + * 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 { + flex-direction: column; + background-color: #F3D4B4; +} + +.image-div { + height: 70%; + display: flex; +} + +.image { + object-fit: contain; +} + +.button-div { + justify-content: center; + align-items: center; +} + +.button { + background-color: #E5A466; + width: 84%; + height: 32px; +} \ No newline at end of file diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/immersive/pages/index/index.hml b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/immersive/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..d15d47279b4597b051ebdca2ca9bc1fc2137006e --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/immersive/pages/index/index.hml @@ -0,0 +1,23 @@ + + +
+
+ +
+
+ +
+
\ No newline at end of file diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/immersive/pages/index/index.json b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/immersive/pages/index/index.json new file mode 100644 index 0000000000000000000000000000000000000000..c9ec294686b5e856b800743e6035377f8d8ce332 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/immersive/pages/index/index.json @@ -0,0 +1,18 @@ +{ + "data": { + "title": "Title", + "detail": "Text", + "iconTitle": "Picture" + }, + "actions": { + "routerEvent": { + "action": "router", + "bundleName": "ohos.samples.adaptiveservicewidget", + "abilityName": "ohos.samples.adaptiveservicewidget.MainAbility", + "params": { + "message": "add detail" + } + } + } +} + diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/text/pages/index/index.css b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/text/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..ea5b509d6ac2e5bb21ffdaf2cdfa3c904a570c5d --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/text/pages/index/index.css @@ -0,0 +1,63 @@ +/* + * 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 { + flex-direction: column; + margin: 6px; +} + +.main-div { + display: flex; + flex-direction: column; + justify-content: space-evenly; + padding: 5%; +} + +.display-div { + display: flex; +} + +.exponent-div { + prefer-font-sizes: 15px, 20px; + text-overflow: ellipsis; + max-lines: 1; + flex-grow: 1; + opacity: 0.8; +} + +.exponent { + prefer-font-sizes: 15px, 20px; + text-overflow: ellipsis; + max-lines: 1; + opacity: 0.8; + align-items: flex-end; + text-align: right; +} + +.coded-div { + prefer-font-sizes: 10px, 15px; + text-overflow: ellipsis; + max-lines: 1; + flex-grow: 1; + opacity: 0.6; +} + +.per-div { + prefer-font-sizes: 10px, 15px; + text-overflow: ellipsis; + max-lines: 1; + color: crimson; + align-items: flex-end; +} diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/text/pages/index/index.hml b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/text/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..434ea8fb8863ff58a3e41dfc3136cd35e66fed82 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/text/pages/index/index.hml @@ -0,0 +1,27 @@ + + +
+
+
+ {{ $item.name }} + {{ $item.exponent }} +
+
+ {{ $item.coded }} + {{ $item.per }} +
+
+
\ No newline at end of file diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/text/pages/index/index.json b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/text/pages/index/index.json new file mode 100644 index 0000000000000000000000000000000000000000..7c774a45b9fa1f26b7c60b3a9430bb63ed65c967 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/js/text/pages/index/index.json @@ -0,0 +1,37 @@ +{ + "data": { + "array": [ + { + "id": 1, + "name": "上证指数", + "exponent": "3599.54", + "coded": "000001", + "per": "0.21%" + }, + { + "id": 2, + "name": "上证指数", + "exponent": "3599.54", + "coded": "000001", + "per": "0.21%" + }, + { + "id": 3, + "name": "上证指数", + "exponent": "3599.54", + "coded": "000001", + "per": "0.21%" + } + ] + }, + "actions": { + "routerEvent": { + "action": "router", + "bundleName": "ohos.samples.adaptiveservicewidget", + "abilityName": "ohos.samples.adaptiveservicewidget.MainAbility", + "params": { + "message": "add detail" + } + } + } +} diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/resources/base/element/string.json b/JSUI/JsAdaptiveServiceWidget/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..3fc1d9f9cd4e973e7fbd0f42a867fa117cf5a887 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "AdaptiveServiceWidget" + }, + { + "name": "mainability_description", + "value": "Service widget example" + } + ] +} \ No newline at end of file diff --git a/JSUI/JsAdaptiveServiceWidget/entry/src/main/resources/base/media/icon.png b/JSUI/JsAdaptiveServiceWidget/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/JSUI/JsAdaptiveServiceWidget/entry/src/main/resources/base/media/icon.png differ diff --git a/JSUI/JsAdaptiveServiceWidget/screenshots/device/phone1.png b/JSUI/JsAdaptiveServiceWidget/screenshots/device/phone1.png new file mode 100644 index 0000000000000000000000000000000000000000..c8d47495236885ad1d605ac37ae2fb168ba8d685 Binary files /dev/null and b/JSUI/JsAdaptiveServiceWidget/screenshots/device/phone1.png differ diff --git a/JSUI/JsAdaptiveServiceWidget/screenshots/device/phone2.png b/JSUI/JsAdaptiveServiceWidget/screenshots/device/phone2.png new file mode 100644 index 0000000000000000000000000000000000000000..9cb645dc6086aa951ea257e8af3380c6bba1e82d Binary files /dev/null and b/JSUI/JsAdaptiveServiceWidget/screenshots/device/phone2.png differ diff --git a/JSUI/JsAdaptiveServiceWidget/screenshots/device/tablet1.png b/JSUI/JsAdaptiveServiceWidget/screenshots/device/tablet1.png new file mode 100644 index 0000000000000000000000000000000000000000..ad4a8b3a7d8ff346e7b52738a27a310cacc5936d Binary files /dev/null and b/JSUI/JsAdaptiveServiceWidget/screenshots/device/tablet1.png differ diff --git a/JSUI/JsAdaptiveServiceWidget/screenshots/device/tablet2.png b/JSUI/JsAdaptiveServiceWidget/screenshots/device/tablet2.png new file mode 100644 index 0000000000000000000000000000000000000000..c2fb4ebc392eed331ec99546561e1e905e60c5e9 Binary files /dev/null and b/JSUI/JsAdaptiveServiceWidget/screenshots/device/tablet2.png differ diff --git a/JSUI/JsAdaptiveServiceWidget/settings.gradle b/JSUI/JsAdaptiveServiceWidget/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..4773db73233a570c2d0c01a22e75321acfbf7a07 --- /dev/null +++ b/JSUI/JsAdaptiveServiceWidget/settings.gradle @@ -0,0 +1 @@ +include ':entry' diff --git a/JSUI/JsAnimation/README.md b/JSUI/JsAnimation/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8c19b5b1496ac926ffe179cba4f7f6cba4756370 --- /dev/null +++ b/JSUI/JsAnimation/README.md @@ -0,0 +1,7 @@ +# Example Animation App + +- This example JS-based animation app allows you to evaluate the basic animation capabilities of components, including rotation, translation, display/hide, and shadow. It also supports adjustment of the animation load. You can use the sample code as reference for your app development. This example applies to large systems \(reference memory ≥ 1 GB\). + 1. The app uses the following typical components: div, stack, video, image, text, input, and button. + 2. The app offers animation capabilities including rotation, translation, display/hide, and shadow. + + diff --git a/JSUI/JsAnimation/README_zh.md b/JSUI/JsAnimation/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..45efd8be32ddc95ff01a599afbf2b67b90b6b7fc --- /dev/null +++ b/JSUI/JsAnimation/README_zh.md @@ -0,0 +1,13 @@ +# 动效示例应用 + +### 简介 + +该应用是一个体现组件动效基础能力的JS应用,包含组件的旋转、平移、显隐切换,以及组件阴影等功能,其中动效负载可调节。开发者可借鉴使用相关动效能力。 + +### 使用说明 + +本示例展示了一组动效包括阴影,旋转,平移等。 + +### 约束与限制 + +本示例仅支持在大型系统上运行,且参考内存 ≥ 1GiB。 diff --git a/JSUI/JsAnimation/build.gradle b/JSUI/JsAnimation/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..4e8a6aadbd114fd91535e3347c8a293ad0fab769 --- /dev/null +++ b/JSUI/JsAnimation/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' + +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } +} + +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.2' + } +} + +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + jcenter() + } +} + diff --git a/JSUI/JsAnimation/entry/build.gradle b/JSUI/JsAnimation/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..83f59debbd68242b503a22270f4378d7843ca204 --- /dev/null +++ b/JSUI/JsAnimation/entry/build.gradle @@ -0,0 +1,19 @@ +apply plugin: 'com.huawei.ohos.hap' +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) +} \ No newline at end of file diff --git a/JSUI/JsAnimation/entry/src/main/config.json b/JSUI/JsAnimation/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..33bb0c0e03c1770213beeedf9c7352aa6c6529bc --- /dev/null +++ b/JSUI/JsAnimation/entry/src/main/config.json @@ -0,0 +1,57 @@ +{ + "app": { + "bundleName": "ohos.samples.animation", + "vendor": "samples", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.samples.animation", + "name": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": ".MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index", + "pages/index/setPage/setPage" + ], + "name": "default", + "window": { + "designWidth": 750, + "autoDesignWidth": true + } + } + ] + } +} \ No newline at end of file diff --git a/JSUI/JsAnimation/entry/src/main/java/ohos/samples/animation/MainAbility.java b/JSUI/JsAnimation/entry/src/main/java/ohos/samples/animation/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..9311d8a81f0c8a3890b6088cb5af5df656aa5d42 --- /dev/null +++ b/JSUI/JsAnimation/entry/src/main/java/ohos/samples/animation/MainAbility.java @@ -0,0 +1,31 @@ +/* + * 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. + */ +package ohos.samples.animation; + +import ohos.ace.ability.AceAbility; +import ohos.aafwk.content.Intent; + +public class MainAbility extends AceAbility { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + } + + @Override + public void onStop() { + super.onStop(); + } + +} diff --git a/JSUI/JsAnimation/entry/src/main/js/default/app.js b/JSUI/JsAnimation/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..c158442201abb1888ae8fb1d57f150c5ec26c36b --- /dev/null +++ b/JSUI/JsAnimation/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * 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/JSUI/JsAnimation/entry/src/main/js/default/common/animator/butterfly.mp4 b/JSUI/JsAnimation/entry/src/main/js/default/common/animator/butterfly.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..971444d2723974a95921ebe97779107ca7499318 Binary files /dev/null and b/JSUI/JsAnimation/entry/src/main/js/default/common/animator/butterfly.mp4 differ diff --git a/JSUI/JsAnimation/entry/src/main/js/default/common/animator/show.mp4 b/JSUI/JsAnimation/entry/src/main/js/default/common/animator/show.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..5c8aa5ddadc6f51a48ad5fb59dc6a76ff1b568d0 Binary files /dev/null and b/JSUI/JsAnimation/entry/src/main/js/default/common/animator/show.mp4 differ diff --git a/JSUI/JsAnimation/entry/src/main/js/default/common/arrow.png b/JSUI/JsAnimation/entry/src/main/js/default/common/arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..46b3637c4726543fa3466c8c7bbdcf9c148c8d5a Binary files /dev/null and b/JSUI/JsAnimation/entry/src/main/js/default/common/arrow.png differ diff --git a/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/001.png b/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/001.png new file mode 100644 index 0000000000000000000000000000000000000000..a1312a7a8dd7bafa42294bb447901f9b87b168ce Binary files /dev/null and b/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/001.png differ diff --git a/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/002.png b/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/002.png new file mode 100644 index 0000000000000000000000000000000000000000..7f6771dbeac9c037a4183369be58d3544a407fb9 Binary files /dev/null and b/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/002.png differ diff --git a/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/003.png b/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/003.png new file mode 100644 index 0000000000000000000000000000000000000000..d065230652934bdd8c9a0c87ad201d4a8cda0fcb Binary files /dev/null and b/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/003.png differ diff --git a/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/004.png b/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/004.png new file mode 100644 index 0000000000000000000000000000000000000000..705d9184884e52bf7a371e89f4f61e573ce138de Binary files /dev/null and b/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/004.png differ diff --git a/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/005.png b/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/005.png new file mode 100644 index 0000000000000000000000000000000000000000..a1312a7a8dd7bafa42294bb447901f9b87b168ce Binary files /dev/null and b/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/005.png differ diff --git a/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/006.png b/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/006.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/006.png differ diff --git a/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/007.png b/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/007.png new file mode 100644 index 0000000000000000000000000000000000000000..9ed4fbcbb8d77582afb2b6101180c97b08f21c31 Binary files /dev/null and b/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/007.png differ diff --git a/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/008.png b/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/008.png new file mode 100644 index 0000000000000000000000000000000000000000..e76eb74da07e5de1bd0282d60431c32546164605 Binary files /dev/null and b/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/008.png differ diff --git a/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/009.png b/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/009.png new file mode 100644 index 0000000000000000000000000000000000000000..705d9184884e52bf7a371e89f4f61e573ce138de Binary files /dev/null and b/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/009.png differ diff --git a/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/010.png b/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/010.png new file mode 100644 index 0000000000000000000000000000000000000000..c14053233a161826197f2b1bb5ba26f4af1fe33c Binary files /dev/null and b/JSUI/JsAnimation/entry/src/main/js/default/common/gallery/010.png differ diff --git a/JSUI/JsAnimation/entry/src/main/js/default/i18n/animators.json b/JSUI/JsAnimation/entry/src/main/js/default/i18n/animators.json new file mode 100644 index 0000000000000000000000000000000000000000..65b1d16451d2855e2421c2c0071049020224b847 --- /dev/null +++ b/JSUI/JsAnimation/entry/src/main/js/default/i18n/animators.json @@ -0,0 +1,14 @@ +{ + "videoopa":{ + "videoopa_1": true, + "videoopa_2": true, + "videoopa_3": false + }, + "videomove": { + "videomove_1": true, + "videomove_2": true, + "videomove_3": false + }, + "imgmove": [true,true,true,true,true,true,false,false,false,false], + "shadow": false +} \ No newline at end of file diff --git a/JSUI/JsAnimation/entry/src/main/js/default/i18n/en-US.json b/JSUI/JsAnimation/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..55561b83737c3c31d082fbfa11e5fc987a351104 --- /dev/null +++ b/JSUI/JsAnimation/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + }, + "Files": { + } +} \ No newline at end of file diff --git a/JSUI/JsAnimation/entry/src/main/js/default/i18n/zh-CN.json b/JSUI/JsAnimation/entry/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..cce1af06761a42add0cac1a0567aa3237eda8cb4 --- /dev/null +++ b/JSUI/JsAnimation/entry/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + }, + "Files": { + } +} \ No newline at end of file diff --git a/JSUI/JsAnimation/entry/src/main/js/default/pages/index/index.css b/JSUI/JsAnimation/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..bbac49e15ef51c932a3d8481d74e1719039cd7fc --- /dev/null +++ b/JSUI/JsAnimation/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,362 @@ +/* + * 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 { + flex-direction: column; + align-items: center; +} +.top { + background-color: rgba(30, 144, 255, 0.7); + padding: 0px 20px; + width: 100%; + height: 8%; + align-items: center; +} +.icons_div1 { + width: 15%; +} +.icon1 { + height: 50px; + width: 20px; + object-fit: contain; +} +image { + object-fit: contain; +} +.content { + width: 100%; + height: 92%; +} +stack { + width: 100%; + height: 100%; +} +.video1_1 { + width: 100%; + height: 100%; + object-fit: fill; + animation-name: bigVideo1; + animation-duration: 5000ms; + animation-iteration-count: -1; +} +.video1_2 { + width: 100%; + height: 100%; + object-fit: fill; + animation-name: bigVideo2; + animation-duration: 5000ms; + animation-iteration-count: -1; +} +.video1_3 { + width: 100%; + height: 100%; + object-fit: fill; + animation-name: bigVideo3; + animation-duration: 5000ms; + animation-iteration-count: -1; +} +.text1 { + font-family: Sans-serif; + margin-top: 250px; + color: blue; + font-weight: bold; + font-size: 26px; + animation-name: Text1; + animation-duration: 5000ms; + animation-iteration-count: -1; +} +.text2 { + font-family: Monospace; + margin-top: 250px; + color: red; + font-style: italic; + font-size: 18px; + animation-name: Text2; + animation-duration: 5000ms; + animation-iteration-count: -1; +} +.videosmall { + width: 100px; + height: 100px; + object-fit: cover; +} +.video_center1 { + animation-name: videocenter1; + animation-duration: 5000ms; + animation-iteration-count: -1; +} +.video_center2 { + animation-name: videocenter2; + animation-duration: 5000ms; + animation-iteration-count: -1; +} +.video2_1 { + animation-name: smallVideo1; + animation-duration: 5000ms; + animation-iteration-count: -1; +} +.video2_2 { + animation-name: smallVideo2; + animation-duration: 5000ms; + animation-iteration-count: -1; +} +.video3_1 { + animation-name: smallVideo3; + animation-duration: 5000ms; + animation-iteration-count: -1; +} +.video3_2 { + animation-name: smallVideo4; + animation-duration: 5000ms; + animation-iteration-count: -1; +} +.img { + width: 100px; + height: 100px; + object-fit: cover; + animation-duration: 5000ms; + animation-iteration-count: -1; +} +.img0_1 { + animation-name: img1; + animation-timing-function: linear; +} +.img0_2 { + animation-name: img2; + animation-timing-function: linear; +} +.img1_1 { + animation-name: img1; + animation-timing-function: ease-in; +} +.img1_2 { + animation-name: img2; + animation-timing-function: ease-in; +} +.img2_1 { + animation-name: img1; + animation-timing-function: ease-in-out; +} +.img2_2 { + animation-name: img2; + animation-timing-function: ease-in-out; +} +.img3_1 { + animation-name: img3; + animation-timing-function: linear; +} +.img3_2 { + animation-name: img4; + animation-timing-function: linear; +} +.img4_1 { + animation-name: img3; + animation-timing-function: ease-in; +} +.img4_2 { + animation-name: img4; + animation-timing-function: ease-in; +} +.img5_1 { + animation-name: img5; + animation-timing-function: ease-in-out; +} +.img5_2 { + animation-name: img6; + animation-timing-function: ease-in-out; +} +.img6_1 { + animation-name: img5; + animation-timing-function: linear; +} +.img6_2 { + animation-name: img6; + animation-timing-function: linear; +} +.img7_1 { + animation-name: img7; + animation-timing-function: ease-in; +} +.img7_2 { + animation-name: img8; + animation-timing-function: ease-in; +} +.img8_1 { + animation-name: img7; + animation-timing-function: ease-in-out; +} +.img8_2 { + animation-name: img8; + animation-timing-function: ease-in-out; +} +.img9_1 { + animation-name: img7; + animation-timing-function: ease-out; +} +.img9_2 { + animation-name: img8; + animation-timing-function: ease-out; +} +@keyframes bigVideo1 { + from { + opacity: 1; + } + to { + opacity: 0; + } +} +@keyframes bigVideo2 { + from { + opacity: 0; + } + to { + opacity: 1; + } +} +@keyframes bigVideo3 { + from { + opacity: 0; + } + to { + opacity: 1; + } +} +@keyframes Text1 { + from { + transform: rotate(0); + } + to { + transform: rotate(360); + } +} +@keyframes Text2 { + from { + transform: rotate(360); + } + to { + transform: rotate(0); + } +} +@keyframes videocenter1 { + from { + transform: translate(130px, 0px) rotate(0); + } + to { + transform: translate(130px, 560px) rotate(360); + } +} +@keyframes videocenter2 { + from { + transform: translate(130px, 560px) rotate(360); + } + to { + transform: translate(130px, 0px) rotate(0); + } +} +@keyframes smallVideo1 { + from { + transform: translate(0px, 0px) rotate(0); + } + to { + transform: translate(260px, 560px) rotate(360); + } +} +@keyframes smallVideo2 { + from { + transform: translate(260px, 560px) rotate(360); + } + to { + transform: translate(0px, 0px) rotate(0); + } +} +@keyframes smallVideo3 { + from { + transform: translate(260px, 0px) rotate(0); + } + to { + transform: translate(0px, 560px) rotate(360); + } +} +@keyframes smallVideo4 { + from { + transform: translate(0px, 560px) rotate(360); + } + to { + transform: translate(260px, 0px) rotate(0); + } +} +@keyframes img1 { + from { + transform: translate(0px, 0px); + } + to { + transform: translate(0px, 560px); + } +} +@keyframes img2 { + from { + transform: translate(0px, 560px); + } + to { + transform: translate(0px, 0px); + } +} +@keyframes img3 { + from { + transform: translate(130px, 0px); + } + to { + transform: translate(130px, 560px); + } +} +@keyframes img4 { + from { + transform: translate(130px, 560px); + } + to { + transform: translate(130px, 0px); + } +} +@keyframes img5 { + from { + transform: translate(0px, 0px); + } + to { + transform: translate(260px, 560px); + } +} +@keyframes img6 { + from { + transform: translate(260px, 560px); + } + to { + transform: translate(0px, 0px); + } +} +@keyframes img7 { + from { + transform: translate(260px, 0px); + } + to { + transform: translate(260px, 560px); + } +} +@keyframes img8 { + from { + transform: translate(260px, 560px); + } + to { + transform: translate(260px, 0px); + } +} \ No newline at end of file diff --git a/JSUI/JsAnimation/entry/src/main/js/default/pages/index/index.hml b/JSUI/JsAnimation/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..5ebc450909f771a5210d9ab8fcf07fc61d5e0846 --- /dev/null +++ b/JSUI/JsAnimation/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,77 @@ + +
+
+
+ +
+
+ + Transitions & Animators + +
+
+
+ + + + + + + + + + + + + + + + + + + Harmony OS Harmony OSHarmony OSHarmony OSHarmony OSHarmony OSHarmony OSHarmony OSHarmony OSHarmony OSHarmony OS + Harmony OSHarmony OSHarmony + + + Harmony OSHarmony OSHarmony OSHarmony OSHarmony OSHarmony OSHarmony OSHarmony OSHarmony OSHarmony OSHarmony OS + Harmony OSHarmony OSHarmony OSHarmony OSHarmony OSHarmony OSHarmony OSHarmony OSHarmony OSHarmony OSHarmony OS + Harmony OSHarmony OSHarmony OSHarmony OSHarmony OSHarmony OSHarmony OSHarmony OSHarmony OSHarmony OSHarmony OS + Harmony OSHarmony OS + + +
+
+ + +
+
\ No newline at end of file diff --git a/JSUI/JsAnimation/entry/src/main/js/default/pages/index/index.js b/JSUI/JsAnimation/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..73d891620067afbc96050dbd31f605eae3b903d7 --- /dev/null +++ b/JSUI/JsAnimation/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,176 @@ +/* + * 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. + */ +import router from '@system.router' +import animatordata from '../../i18n/animators.json' + +export default { + data: { + video2: 'video2_1', + video3: 'video3_1', + img1: 'img1_1', + img2: 'img2_1', + img3: 'img3_1', + img4: 'img4_1', + img5: 'img5_1', + img6: 'img6_1', + img7: 'img7_1', + img8: 'img8_1', + img9: 'img9_1', + img0: 'img0_1', + video_center: 'video_center1', + flag1: true, + flag2: false, + i: 1, + video_opa: '', + pass: false, + videoopa_1: true, + videoopa_2: true, + videoopa_3: true, + videomove_1: true, + videomove_2: true, + videomove_3: true, + imgflag: [true, true, true, true, true, true, true, true, true, true], + shadow: true + }, + onInit() { + console.info("ssss"+ JSON.stringify(animatordata.videoopa)) + this.pass = this.pass; + if (this.pass === true) { + if (this.message[0] == 1) { + this.videoopa_1 = true; + this.videoopa_2 = false; + this.videoopa_3 = false; + } else if (this.message[0] == 2) { + this.videoopa_1 = true; + this.videoopa_2 = true; + this.videoopa_3 = false; + } else { + this.videoopa_1 = true; + this.videoopa_2 = true; + this.videoopa_3 = true; + } + if (this.message[1] == 1) { + this.videomove_1 = true; + this.videomove_2 = false; + this.videomove_3 = false; + } else if (this.message[1] == 2) { + this.videomove_1 = true; + this.videomove_2 = true; + this.videomove_3 = false; + } else { + this.videomove_1 = true; + this.videomove_2 = true; + this.videomove_3 = true; + } + for (var i = 9;i >= this.message[2]; i--) { + this.imgflag[i] = false; + } + } else { + this.videoopa_1 = animatordata.videoopa.videoopa_1; + this.videoopa_2 = animatordata.videoopa.videoopa_2; + this.videoopa_3 = animatordata.videoopa.videoopa_3; + this.videomove_1 = animatordata.videomove.videomove_1; + this.videomove_2 = animatordata.videomove.videomove_2; + this.videomove_3 = animatordata.videomove.videomove_3; + this.imgflag = animatordata.imgmove; + } + }, + onReady() { + setInterval(()=>{ + ++this.i; + if (this.i % 2 === 0) { + this.video2 = ''; + this.video3 = ''; + this.img1 = ''; + this.img2 = ''; + this.img3 = ''; + this.img4 = ''; + this.img5 = ''; + this.img6 = ''; + this.img7 = ''; + this.img8 = ''; + this.img9 = ''; + this.img0 = ''; + this.video_center = ''; + this.video2 = 'video2_2'; + this.video3 = 'video3_2'; + this.img1 = 'img1_2'; + this.img2 = 'img2_2'; + this.img3 = 'img3_2'; + this.img4 = 'img4_2'; + this.img5 = 'img5_2'; + this.img6 = 'img6_2'; + this.img7 = 'img7_2'; + this.img8 = 'img8_2'; + this.img9 = 'img9_2'; + this.img0 = 'img0_2'; + this.video_center = 'video_center2'; + this.flag1 = false; + this.flag2 = true; + } else { + this.video2 = ''; + this.video3 = ''; + this.img1 = ''; + this.img2 = ''; + this.img3 = ''; + this.img4 = ''; + this.img5 = ''; + this.img6 = ''; + this.img7 = ''; + this.img8 = ''; + this.img9 = ''; + this.img0 = ''; + this.video_center = ''; + this.video2 = 'video2_1'; + this.video3 = 'video3_1'; + this.img1 = 'img1_1'; + this.img2 = 'img2_1'; + this.img3 = 'img3_1'; + this.img4 = 'img4_1'; + this.img5 = 'img5_1'; + this.img6 = 'img6_1'; + this.img7 = 'img7_1'; + this.img8 = 'img8_1'; + this.img9 = 'img9_1'; + this.img0 = 'img0_1'; + this.video_center = 'video_center1'; + this.flag1 = true; + this.flag2 = false; + } + },5000); + }, + redirect_setting(){ + router.push({ + uri:'pages/index/setPage/setPage' + }) + }, + back() { + router.back(); + }, + playComplete1() { + this.$element('video1_1').start(); + this.$element('video1_2').start(); + this.$element('video1_3').start(); + }, + playComplete2() { + this.$element('video2_1').start(); + }, + playComplete3() { + this.$element('video2_2').start(); + }, + playComplete4() { + this.$element('video2_3').start(); + }, +} \ No newline at end of file diff --git a/JSUI/JsAnimation/entry/src/main/js/default/pages/index/setPage/setPage.css b/JSUI/JsAnimation/entry/src/main/js/default/pages/index/setPage/setPage.css new file mode 100644 index 0000000000000000000000000000000000000000..805972f1d44e7b921ca7ba61b79f9d8673de005c --- /dev/null +++ b/JSUI/JsAnimation/entry/src/main/js/default/pages/index/setPage/setPage.css @@ -0,0 +1,72 @@ +/* + * 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 { + flex-direction: column; + align-items: center; +} +.content { + flex-direction: column; + align-items: center; + justify-content: center; + border: 1px solid #000000; + border-radius: 10px; +} +input { + height: 50px; +} +.title { + font-size: 25px; + font-weight: bold; + margin: 20px 0px 30px; + width: 95%; + text-align: center; +} +.imgshrink { + width: 90%; + margin: 10px 0px; + justify-content: space-between; + align-items: center; +} +.imgshrink text { + font-size: 15px; +} +.imgshrink button { + width: 40%; +} +.setnum { + width: 90%; + justify-content: space-between; + margin: 10px 0px; +} +.setnum button { + width: 30%; + height: 50px; +} +.setnum text { + font-size: 15px; +} +.setnum input { + height: 50px; + width: 70%; +} +.submit { + margin: 10px 0px; + width: 90%; + justify-content: space-between; +} +.submit button { + width: 40%; + height: 40px; +} \ No newline at end of file diff --git a/JSUI/JsAnimation/entry/src/main/js/default/pages/index/setPage/setPage.hml b/JSUI/JsAnimation/entry/src/main/js/default/pages/index/setPage/setPage.hml new file mode 100644 index 0000000000000000000000000000000000000000..7d849819dced06d5ede8716fb7aaa8f11ca41ba0 --- /dev/null +++ b/JSUI/JsAnimation/entry/src/main/js/default/pages/index/setPage/setPage.hml @@ -0,0 +1,69 @@ + +
+
+ + 负载配置 + +
+
+ + 视频显隐数量 + + + + 1 + + + + 2 + + + + 3 + +
+
+
+
+ + 视频移动数量 + + + + 1 + + + + 2 + + + + 3 + +
+
+
+ + 图片移动数量 + + +
+
+ + +
+
+
\ No newline at end of file diff --git a/JSUI/JsAnimation/entry/src/main/js/default/pages/index/setPage/setPage.js b/JSUI/JsAnimation/entry/src/main/js/default/pages/index/setPage/setPage.js new file mode 100644 index 0000000000000000000000000000000000000000..dd721530e58deb367273de2a6f9dda22a15ea039 --- /dev/null +++ b/JSUI/JsAnimation/entry/src/main/js/default/pages/index/setPage/setPage.js @@ -0,0 +1,87 @@ +/* + * 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. + */ +import router from '@system.router' +import prompt from '@system.prompt' + +export default { + data: { + videonumopa: 2, + videonummove: 2, + num: 6, + }, + onInit() { + }, + changeOpa1(e) { + if (e.checked === true) { + this.videonumopa = e.target.attr.value; + } + }, + changeOpa2(e) { + if (e.checked === true) { + this.videonumopa = e.target.attr.value; + } + }, + changeOpa3(e) { + if (e.checked === true) { + this.videonumopa = e.target.attr.value; + } + }, + changeMove1(e) { + if (e.checked === true) { + this.videonummove = e.target.attr.value; + } + }, + changeMove2(e) { + if (e.checked === true) { + this.videonummove = e.target.attr.value; + } + }, + changeMove3(e) { + if (e.checked === true) { + this.videonummove = e.target.attr.value; + } + }, + changeNum(e) { + this.num = e.text; + }, + redirect() { + if (this.num > 10) { + var that = this; + prompt.showDialog({ + message: '图片数量最大为10', + buttons: [ + { + text: '确定', + color:'#000000' + }, + ], + success: function () { + that.num = ''; + } + }) + } else { + router.push({ + uri: 'pages/index/index', + params: { + message: [this.videonumopa, this.videonummove, this.num], + pass: true + } + }); + } + }, + back() { + router.back(); + } +} \ No newline at end of file diff --git a/JSUI/JsAnimation/entry/src/main/resources/base/element/string.json b/JSUI/JsAnimation/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..c96efbe0923c4291861f6e9e4dd7bfadb6c852bb --- /dev/null +++ b/JSUI/JsAnimation/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "animation" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/JSUI/JsAnimation/entry/src/main/resources/base/media/icon.png b/JSUI/JsAnimation/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/JSUI/JsAnimation/entry/src/main/resources/base/media/icon.png differ diff --git a/JSUI/JsAnimation/screenshots/device/animation.png b/JSUI/JsAnimation/screenshots/device/animation.png new file mode 100644 index 0000000000000000000000000000000000000000..04169a5b340fa6a7edff5e7479fb02c555d8990c Binary files /dev/null and b/JSUI/JsAnimation/screenshots/device/animation.png differ diff --git a/JSUI/JsAnimation/settings.gradle b/JSUI/JsAnimation/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..7dc3285c045cc590e49d231a4280ef52ba646d91 --- /dev/null +++ b/JSUI/JsAnimation/settings.gradle @@ -0,0 +1,15 @@ +/* + * 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. + */ +include ':entry' diff --git a/JSUI/JsApp/README_zh.md b/JSUI/JsApp/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..c9ad221b51eb001b363b0b8fd66f13d81d786020 --- /dev/null +++ b/JSUI/JsApp/README_zh.md @@ -0,0 +1,16 @@ +# JsApp + +### 简介 + +本示例适用于介绍如何开发一个 JS FA 应用。 + +此应用相对于 Hello World 应用模板具备更复杂的页面布局、页面样式和页面逻辑。 + +### 使用说明 + +在应用页面可以通过将焦点移动到不同颜色的圆形来选择不同的食物图片,也可以进行添加到购物车操作。 + +### 约束与限制 + +本示例仅支持在标准系统上运行。 + diff --git a/JSUI/JsApp/build.gradle b/JSUI/JsApp/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..4e8a6aadbd114fd91535e3347c8a293ad0fab769 --- /dev/null +++ b/JSUI/JsApp/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' + +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } +} + +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.2' + } +} + +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + jcenter() + } +} + diff --git a/JSUI/JsApp/entry/build.gradle b/JSUI/JsApp/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..83f59debbd68242b503a22270f4378d7843ca204 --- /dev/null +++ b/JSUI/JsApp/entry/build.gradle @@ -0,0 +1,19 @@ +apply plugin: 'com.huawei.ohos.hap' +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) +} \ No newline at end of file diff --git a/JSUI/JsApp/entry/src/main/config.json b/JSUI/JsApp/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..5468e9138333d20df48d997529436c4f1c41c43f --- /dev/null +++ b/JSUI/JsApp/entry/src/main/config.json @@ -0,0 +1,60 @@ +{ + "app": { + "bundleName": "ohos.samples.jsapplication", + "version": { + "code": 2000000, + "name": "2.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.samples.jsapplication", + "name": ".MainAbility", + "reqCapabilities": [ + "video_support" + ], + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "formsEnabled": false, + "visible": true, + "name": ".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": false + } + } + ] + } +} \ No newline at end of file diff --git a/JSUI/JsApp/entry/src/main/java/ohos/samples/jsapplication/MainAbility.java b/JSUI/JsApp/entry/src/main/java/ohos/samples/jsapplication/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..c534fd507d5287813225f34edde8a89ba634bd83 --- /dev/null +++ b/JSUI/JsApp/entry/src/main/java/ohos/samples/jsapplication/MainAbility.java @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package ohos.samples.jsapplication; + +import ohos.ace.ability.AceAbility; +import ohos.aafwk.content.Intent; + +/** + * MainAbility + */ +public class MainAbility extends AceAbility { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + } + + @Override + public void onStop() { + super.onStop(); + } +} diff --git a/JSUI/JsApp/entry/src/main/js/default/app.js b/JSUI/JsApp/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..8e47afff13e928a74fdcc01a108e4422404b9ac9 --- /dev/null +++ b/JSUI/JsApp/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/JSUI/JsApp/entry/src/main/js/default/common/item_000.png b/JSUI/JsApp/entry/src/main/js/default/common/item_000.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsApp/entry/src/main/js/default/common/item_000.png differ diff --git a/JSUI/JsApp/entry/src/main/js/default/common/item_001.png b/JSUI/JsApp/entry/src/main/js/default/common/item_001.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd12c6d4eebca7adc2f5518607f95eb2b643724 Binary files /dev/null and b/JSUI/JsApp/entry/src/main/js/default/common/item_001.png differ diff --git a/JSUI/JsApp/entry/src/main/js/default/common/item_002.png b/JSUI/JsApp/entry/src/main/js/default/common/item_002.png new file mode 100644 index 0000000000000000000000000000000000000000..c3397451a9c6d8f42bee7da33b648c18925732aa Binary files /dev/null and b/JSUI/JsApp/entry/src/main/js/default/common/item_002.png differ diff --git a/JSUI/JsApp/entry/src/main/js/default/common/item_003.png b/JSUI/JsApp/entry/src/main/js/default/common/item_003.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsApp/entry/src/main/js/default/common/item_003.png differ diff --git a/JSUI/JsApp/entry/src/main/js/default/i18n/en-US.json b/JSUI/JsApp/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..55561b83737c3c31d082fbfa11e5fc987a351104 --- /dev/null +++ b/JSUI/JsApp/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + }, + "Files": { + } +} \ No newline at end of file diff --git a/JSUI/JsApp/entry/src/main/js/default/pages/index/index.css b/JSUI/JsApp/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..037391981436618124cac9d54f1bc359f35d9beb --- /dev/null +++ b/JSUI/JsApp/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,109 @@ +/* + * 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 { + flex-direction: column; +} + +.title { + align-items: flex-start; + flex-direction: column; + margin-top: 10px; + padding-left: 60px; + padding-right: 160px; +} + +.name { + font-size: 20px; +} + +.sub-title { + font-size: 15px; + color: #7a787d; + margin-top: 10px; +} + +.swiper-style { + height: 250px; + width: 350px; + indicator-color: #4682b4; + indicator-selected-color: #f0e68c; + indicator-size: 10px; + margin-left: 50px; +} + +.image-mode { + object-fit: contain; +} + +.color-column { + flex-direction: row; + align-content: center; + margin-top: 20px; +} + +.color-item { + height: 50px; + width: 50px; + margin-left: 50px; + padding-left: 10px; +} + +.color-item:focus { + background-color: black; +} + +.description-first-paragraph { + padding-left: 60px; + padding-right: 60px; + padding-top: 60px; +} + +.description { + color: #7a787d; + font-size: 15px; +} + +.cart { + justify-content: center; + margin-top: 10px; +} + +.cart-text { + font-size: 20px; + text-align: center; + width: 300px; + height: 50px; + background-color: #6495ed; + color: white; +} + +.cart-text-focus { + font-size: 20px; + text-align: center; + width: 300px; + height: 50px; + background-color: #4169e1; + color: white; +} + +.add-cart-text { + font-size: 20px; + text-align: center; + width: 300px; + height: 50px; + background-color: #ffd700; + color: white; +} \ No newline at end of file diff --git a/JSUI/JsApp/entry/src/main/js/default/pages/index/index.hml b/JSUI/JsApp/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..1363ec1dc848209a735335f4584f769bca4b8628 --- /dev/null +++ b/JSUI/JsApp/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,35 @@ + + +
+
+ Merchandise + Choose What You Like +
+
+ + + +
+
+ {{descriptionFirstParagraph}} +
+
+
+
+ + {{cartText}} +
+
\ No newline at end of file diff --git a/JSUI/JsApp/entry/src/main/js/default/pages/index/index.js b/JSUI/JsApp/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1ac4050424bbb372b72ebd7aea7d7d7ef3fc3dae --- /dev/null +++ b/JSUI/JsApp/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,50 @@ +/* + * 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 { + data: { + cartText: 'Add To Cart', + cartStyle: 'cart-text', + isCartEmpty: true, + descriptionFirstParagraph: 'This is the merchandise page that includes fresh fruit, meat, snacks, merchandise, and more. \nYou can pick anything you like and add it to your cart. \nYour order will arrive within 48 hours. We guarantee that we are organic and healthy. \n Feel free to ask our 24-hour online service to learn more about our platforms and products.', + imageList: ['/common/item_000.png', '/common/item_001.png', '/common/item_002.png', '/common/item_003.png'], + + }, + + swipeToIndex(index) { + this.$element('swiperImage').swipeTo({index: index}); + }, + + + addCart() { + if (this.isCartEmpty) { + this.cartText = 'Cart + 1'; + this.cartStyle = 'add-cart-text'; + this.isCartEmpty = false; + } + }, + + getFocus() { + if (this.isCartEmpty) { + this.cartStyle = 'cart-text-focus'; + } + }, + + lostFocus() { + if (this.isCartEmpty) { + this.cartStyle = 'cart-text'; + } + }, +} \ No newline at end of file diff --git a/JSUI/JsApp/entry/src/main/resources/base/element/string.json b/JSUI/JsApp/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f0ec9839fe979ba2756f950339e0f958c89f0c2c --- /dev/null +++ b/JSUI/JsApp/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "JSapplication" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/JSUI/JsApp/entry/src/main/resources/base/media/icon.png b/JSUI/JsApp/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/JSUI/JsApp/entry/src/main/resources/base/media/icon.png differ diff --git a/JSUI/JsApp/screenshots/device/JsApplication1.png b/JSUI/JsApp/screenshots/device/JsApplication1.png new file mode 100644 index 0000000000000000000000000000000000000000..4d45157af719703f47bda0d35e9f705b64912334 Binary files /dev/null and b/JSUI/JsApp/screenshots/device/JsApplication1.png differ diff --git a/JSUI/JsApp/screenshots/device/jsapplication.png b/JSUI/JsApp/screenshots/device/jsapplication.png new file mode 100644 index 0000000000000000000000000000000000000000..8dd5fddf860a6d9b0886a93a9fe9465265f69e44 Binary files /dev/null and b/JSUI/JsApp/screenshots/device/jsapplication.png differ diff --git a/JSUI/JsApp/settings.gradle b/JSUI/JsApp/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..1ca4151b64fa836a72c0db9a9a8a4cf0ffcc32c1 --- /dev/null +++ b/JSUI/JsApp/settings.gradle @@ -0,0 +1,15 @@ +/* + * 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. + */ +include 'entry' diff --git a/JSUI/JsCallJava/README_zh.md b/JSUI/JsCallJava/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..752d8159aa4075255058c64424b0e4f901b7d46a --- /dev/null +++ b/JSUI/JsCallJava/README_zh.md @@ -0,0 +1,15 @@ +# JsCallJava + +### 简介 + +JS UI 框架提供了 JS FA(Feature Ability)调用 Java PA(Particle Ability)的机制,该机制提供了一种通道来传递方法调用、数据返回以及订阅事件上报。 + +本示例是以 JS 端调用 Java 端实时获取/监听电池电量为例来说明 JS FA(Feature Ability)调用 Java PA(Particle Ability)的机制。 + +### 使用说明 + +应用主界面有3个按钮,点击对应按钮显示对应文本通知。 + +### 约束与限制 + +本示例仅支持在大型系统上运行。 diff --git a/JSUI/JsCallJava/build.gradle b/JSUI/JsCallJava/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..4e8a6aadbd114fd91535e3347c8a293ad0fab769 --- /dev/null +++ b/JSUI/JsCallJava/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' + +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } +} + +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.2' + } +} + +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + jcenter() + } +} + diff --git a/JSUI/JsCallJava/entry/build.gradle b/JSUI/JsCallJava/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..83f59debbd68242b503a22270f4378d7843ca204 --- /dev/null +++ b/JSUI/JsCallJava/entry/build.gradle @@ -0,0 +1,19 @@ +apply plugin: 'com.huawei.ohos.hap' +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) +} \ No newline at end of file diff --git a/JSUI/JsCallJava/entry/src/main/config.json b/JSUI/JsCallJava/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..70cd1bc680db3c355e6577c8faac33db5fdd093c --- /dev/null +++ b/JSUI/JsCallJava/entry/src/main/config.json @@ -0,0 +1,60 @@ +{ + "app": { + "bundleName": "ohos.samples.jscalljava", + "version": { + "code": 2000000, + "name": "2.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.samples.jscalljava", + "name": ".MainAbility", + "reqCapabilities": [ + "video_support" + ], + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "formsEnabled": false, + "visible": true, + "name": ".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": false + } + } + ] + } +} \ No newline at end of file diff --git a/JSUI/JsCallJava/entry/src/main/java/ohos/samples/jscalljava/BatteryInternalAbility.java b/JSUI/JsCallJava/entry/src/main/java/ohos/samples/jscalljava/BatteryInternalAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..3de1078e46bac5c58f451aaf2ffeee976755bcef --- /dev/null +++ b/JSUI/JsCallJava/entry/src/main/java/ohos/samples/jscalljava/BatteryInternalAbility.java @@ -0,0 +1,184 @@ +/* + * 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. + */ + +package ohos.samples.jscalljava; + +import ohos.ace.ability.AceInternalAbility; +import ohos.batterymanager.BatteryInfo; +import ohos.event.commonevent.CommonEventData; +import ohos.event.commonevent.CommonEventManager; +import ohos.event.commonevent.CommonEventSubscribeInfo; +import ohos.event.commonevent.CommonEventSubscriber; +import ohos.event.commonevent.CommonEventSupport; +import ohos.event.commonevent.MatchingSkills; +import ohos.hiviewdfx.HiLog; +import ohos.hiviewdfx.HiLogLabel; +import ohos.rpc.IRemoteObject; +import ohos.rpc.MessageOption; +import ohos.rpc.MessageParcel; +import ohos.rpc.RemoteException; + +/** + * Internal Ability + */ +public class BatteryInternalAbility extends AceInternalAbility { + private static final int BATTERY_LEVEL_NOT_AVAILABLE = 1001; + + private static final int BATTERY_SUBSCRIBE_FAILURE = 1002; + + private static final int BATTERY_UNSUBSCRIBE_FAILURE = 1003; + + private static final String TAG = BatteryInternalAbility.class.getSimpleName(); + + private static final HiLogLabel LABEL_LOG = new HiLogLabel(3, 0xD000F00, TAG); + + private static final int DEFAULT_TYPE = 0; + + private static BatteryInternalAbility instance; + + private static final String BUNDLE_NAME = "ohos.samples.jscalljava"; + + private static final String ABILITY_NAME = "BatteryInternalAbility"; + + private CommonEventSubscriber subscriber; + + private BatteryInternalAbility() { + super(BUNDLE_NAME, ABILITY_NAME); + } + + /** + * Business execution + * + * @param code Request Code. + * @param data Receives MessageParcel object. + * @param reply The MessageParcel object is returned. + * @param option Indicates whether the operation is synchronous or asynchronous. + * @return If the operation is successful, true is returned. Otherwise, false is returned. + */ + public boolean onRemoteRequest(int code, MessageParcel data, MessageParcel reply, MessageOption option) { + switch (code) { + case BATTERY_LEVEL_NOT_AVAILABLE: + reply.writeString(getBatteryInfo()); + break; + case BATTERY_SUBSCRIBE_FAILURE: + subscribeEvent(data, reply, option); + break; + case BATTERY_UNSUBSCRIBE_FAILURE: + unSubscribeBatteryEvent(reply); + break; + default: + reply.writeString("service not defined"); + return false; + } + return true; + } + + private void subscribeEvent(MessageParcel data, MessageParcel reply, MessageOption option) { + MatchingSkills matchingSkills = new MatchingSkills(); + matchingSkills.addEvent(CommonEventSupport.COMMON_EVENT_BATTERY_CHANGED); + IRemoteObject notifier = data.readRemoteObject(); + CommonEventSubscribeInfo subscribeInfo = new CommonEventSubscribeInfo(matchingSkills); + subscriber = new CommonEventSubscriber(subscribeInfo) { + @Override + public void onReceiveEvent(CommonEventData commonEventData) { + replyMsg(notifier); + } + }; + if (option.getFlags() == MessageOption.TF_SYNC) { + reply.writeString("subscribe common event success"); + } + try { + CommonEventManager.subscribeCommonEvent(subscriber); + reply.writeString(" subscribe common event success"); + } catch (RemoteException e) { + HiLog.info(LABEL_LOG, "%{public}s", "RemoteException in subscribeNotificationEvents!"); + } + } + + private void replyMsg(IRemoteObject notifier) { + MessageParcel notifyData = MessageParcel.obtain(); + notifyData.writeString("{\"msg\":\"" + getBatteryInfo() + "\"}"); + try { + notifier.sendRequest(DEFAULT_TYPE, notifyData, MessageParcel.obtain(), new MessageOption()); + } catch (RemoteException exception) { + HiLog.info(LABEL_LOG, "%{public}s", "replyMsg RemoteException !"); + } finally { + notifyData.reclaim(); + } + } + + private String getBatteryInfo() { + StringBuilder stringBuilder = new StringBuilder(); + boolean isCharging = getChargingStatus(); + double batteryValue = getBatteryLevel(); + stringBuilder.append(batteryValue).append(" % Battery Left").append(System.lineSeparator()) + .append("isCharging: ") + .append(isCharging); + return stringBuilder.toString(); + } + + private void unSubscribeBatteryEvent(MessageParcel reply) { + try { + CommonEventManager.unsubscribeCommonEvent(subscriber); + reply.writeString("Unsubscribe common event success!"); + } catch (RemoteException | IllegalArgumentException exception) { + reply.writeString("Battery Unsubscribe failed!"); + HiLog.info(LABEL_LOG, "%{public}s", "Battery Unsubscribe failed!"); + } + subscriber = null; + } + + private int getBatteryLevel() { + BatteryInfo batteryInfo = new BatteryInfo(); + return batteryInfo.getCapacity(); + } + + private boolean getChargingStatus() { + BatteryInfo batteryInfo = new BatteryInfo(); + BatteryInfo.BatteryChargeState batteryStatus = batteryInfo.getChargingStatus(); + return (batteryStatus == BatteryInfo.BatteryChargeState.ENABLE + || batteryStatus == BatteryInfo.BatteryChargeState.FULL); + } + + /** + * BatteryInternalAbility + * + * @return If the instance is NULL, Get new instance. Otherwise, instance is returned. + */ + public static BatteryInternalAbility getInstance() { + if (instance == null) { + synchronized (BatteryInternalAbility.class) { + if (instance == null) { + instance = new BatteryInternalAbility(); + } + } + } + return instance; + } + + /** + * init Internal ability + */ + public void register() { + this.setInternalAbilityHandler(this::onRemoteRequest); + } + + /** + * Internal ability release + */ + public void deregister() { + this.setInternalAbilityHandler(null); + } +} diff --git a/JSUI/JsCallJava/entry/src/main/java/ohos/samples/jscalljava/MainAbility.java b/JSUI/JsCallJava/entry/src/main/java/ohos/samples/jscalljava/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..e8dbbe7d4f74693d083de20cd0d720a84db0be4b --- /dev/null +++ b/JSUI/JsCallJava/entry/src/main/java/ohos/samples/jscalljava/MainAbility.java @@ -0,0 +1,36 @@ +/* + * 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. + */ + +package ohos.samples.jscalljava; + +import ohos.aafwk.content.Intent; +import ohos.ace.ability.AceAbility; + +/** + * MainAbility AceAbility + */ +public class MainAbility extends AceAbility { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + BatteryInternalAbility.getInstance().register(); + } + + @Override + public void onStop() { + super.onStop(); + BatteryInternalAbility.getInstance().deregister(); + } +} diff --git a/JSUI/JsCallJava/entry/src/main/js/default/app.js b/JSUI/JsCallJava/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..8e47afff13e928a74fdcc01a108e4422404b9ac9 --- /dev/null +++ b/JSUI/JsCallJava/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/JSUI/JsCallJava/entry/src/main/js/default/common/css/common.css b/JSUI/JsCallJava/entry/src/main/js/default/common/css/common.css new file mode 100644 index 0000000000000000000000000000000000000000..a1bf8623ec88fc4379f95a38ad829681458c943a --- /dev/null +++ b/JSUI/JsCallJava/entry/src/main/js/default/common/css/common.css @@ -0,0 +1,33 @@ +/* + * 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 { + flex-direction: column; + background-color: white; +} + +.rounded { + border-radius: 1px; + margin-right: 1px; + margin-left: 1px; + padding-top: 25px; + padding-bottom: 25px; + color: grey; +} + +.padding { + padding-top: 20px; + border-radius: 0px; +} \ No newline at end of file diff --git a/JSUI/JsCallJava/entry/src/main/js/default/i18n/en-US.json b/JSUI/JsCallJava/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..10ba7c7f1082eef32e069e1b43e189a414ab1b49 --- /dev/null +++ b/JSUI/JsCallJava/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,10 @@ +{ + "Strings": { + "getBatteryLevelEvent": "Click the button to get current battery Level", + "batteryLevel": "Get Battery Level", + "batterySubscribeEvent": "Click the button to subscribe for battery Level changes", + "batterySubscribe": "Subscribe Battery Event", + "batteryUnSubscribeEvent": "Click the button to unSubscribe for battery Level changes", + "batteryUnSubscribe": "UnSubscribe Battery Event" + } +} \ No newline at end of file diff --git a/JSUI/JsCallJava/entry/src/main/js/default/pages/index/index.css b/JSUI/JsCallJava/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..e8c65a106bc64219dabdcf78d324c8222fad8724 --- /dev/null +++ b/JSUI/JsCallJava/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,42 @@ +/* + * 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. + */ + +@import "../../common/css/common.css"; +.divAli { + flex-direction: column; + justify-content: center; + align-items: center; + font-size: 40px; + margin-top: 10px; + margin-right: 10px; + margin-left: 10px; + margin-bottom: 10px; + padding-top: 40px; + padding-bottom: 40px; +} +.button-controller { + align-items: center; + justify-content: center; + padding-top: 20px; + padding-bottom: 20px; +} + +.btn3 { + width: 70%; + height: 80px; + font-size: 30px; + background-color: #1976D2; + text-color: white; +} \ No newline at end of file diff --git a/JSUI/JsCallJava/entry/src/main/js/default/pages/index/index.hml b/JSUI/JsCallJava/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..66b6be69947246cdb317d47d9798de27bf6dc45e --- /dev/null +++ b/JSUI/JsCallJava/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,35 @@ + + +
+ +
+ {{$t('Strings.getBatteryLevelEvent')}} + +
+ +
+ {{$t('Strings.batterySubscribeEvent')}} + +
+ +
+ {{$t('Strings.batteryUnSubscribeEvent')}} + +
+ +
+
+
\ No newline at end of file diff --git a/JSUI/JsCallJava/entry/src/main/js/default/pages/index/index.js b/JSUI/JsCallJava/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..deb81eeb83e56cc89463131ba183c3ce655d1ffb --- /dev/null +++ b/JSUI/JsCallJava/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,79 @@ +/* + * 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. + */ +import prompt from '@system.prompt' + +export default { + batteryLevel: function () { + this.getBatteryLevel(); + }, + batterySubscribe: function () { + this.batteryLevelSubscribe(); + }, + batteryUnSubscribe: function () { + this.batteryLevelUnSubscribe(); + }, + initAction: function (code) { + var actionData = {}; + var action = {}; + action.bundleName = "ohos.samples.jscalljava"; + action.abilityName = "BatteryInternalAbility"; + action.messageCode = code; + action.data = actionData; + action.abilityType = 1; + action.syncOption = 0; + return action; + }, + getBatteryLevel: async function () { + try { + var action = this.initAction(1001); + var result = await FeatureAbility.callAbility(action); + console.info(" result = " + result); + this.showToast(result); + } catch (pluginError) { + console.error("getBatteryLevel : Plugin Error = " + pluginError); + } + }, + batteryLevelSubscribe: async function () { + try { + var action = this.initAction(1002); + var that = this; + var result = await FeatureAbility.subscribeAbilityEvent(action,function (batteryLevel) { + console.info(" batteryLevel info is: " + batteryLevel); + var batteryData = JSON.parse(batteryLevel).data; + that.showToast(" batteryState change: " + batteryData.msg); + }); + this.showToast(" subscribe result " + result); + console.info(" subscribeCommonEvent result = " + result); + } catch (pluginError) { + console.error("subscribeCommonEvent error : result= " + result + JSON.stringify(pluginError)); + } + }, + batteryLevelUnSubscribe: async function () { + try { + var action = this.initAction(1003); + var result = await FeatureAbility.unsubscribeAbilityEvent(action); + FeatureAbility.callAbility(action); + this.showToast("unsubscribe result " + result); + } catch (pluginError) { + console.error("batteryLevelUnSubscribe error : " + JSON.stringify(pluginError)); + this.showToast("batteryLevelUnSubscribe error : " + JSON.stringify(pluginError)); + } + }, + showToast: function (msg) { + prompt.showToast({ + message: msg + }); + } +} diff --git a/JSUI/JsCallJava/entry/src/main/resources/base/element/string.json b/JSUI/JsCallJava/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..7eb3060e60f81b7058f5e120857b33d76480d2a3 --- /dev/null +++ b/JSUI/JsCallJava/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "JsCallJava" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/JSUI/JsCallJava/entry/src/main/resources/base/media/icon.png b/JSUI/JsCallJava/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/JSUI/JsCallJava/entry/src/main/resources/base/media/icon.png differ diff --git a/JSUI/JsCallJava/screenshots/device/jscalljava.png b/JSUI/JsCallJava/screenshots/device/jscalljava.png new file mode 100644 index 0000000000000000000000000000000000000000..ed1c690e0e5a4998042deb49f0c71b01d354216a Binary files /dev/null and b/JSUI/JsCallJava/screenshots/device/jscalljava.png differ diff --git a/JSUI/JsCallJava/settings.gradle b/JSUI/JsCallJava/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..1ca4151b64fa836a72c0db9a9a8a4cf0ffcc32c1 --- /dev/null +++ b/JSUI/JsCallJava/settings.gradle @@ -0,0 +1,15 @@ +/* + * 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. + */ +include 'entry' diff --git a/JSUI/JsComponents/README_zh.md b/JSUI/JsComponents/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..420ea25c326e883fc6fcdaf0643176bbd4395e27 --- /dev/null +++ b/JSUI/JsComponents/README_zh.md @@ -0,0 +1,7 @@ +# JsComponents + +- 本示例适用于介绍如何使用組件开发一个用戶界面 。 + + 组件 Component 是构建页面的核心,每个组件通过对数据和方法的简单封装,实现独立的可视、可交互功能单元。 + + 组件之间相互独立,随取随用,也可以在需求相同的地方重复使用。 diff --git a/JSUI/JsComponents/build.gradle b/JSUI/JsComponents/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..4e8a6aadbd114fd91535e3347c8a293ad0fab769 --- /dev/null +++ b/JSUI/JsComponents/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' + +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } +} + +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.2' + } +} + +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + jcenter() + } +} + diff --git a/JSUI/JsComponents/entry/build.gradle b/JSUI/JsComponents/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..83f59debbd68242b503a22270f4378d7843ca204 --- /dev/null +++ b/JSUI/JsComponents/entry/build.gradle @@ -0,0 +1,19 @@ +apply plugin: 'com.huawei.ohos.hap' +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) +} \ No newline at end of file diff --git a/JSUI/JsComponents/entry/src/main/config.json b/JSUI/JsComponents/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..79ef852359ac367033a1f4b3f01d186eb07098bd --- /dev/null +++ b/JSUI/JsComponents/entry/src/main/config.json @@ -0,0 +1,63 @@ +{ + "app": { + "bundleName": "ohos.samples.jscomponents", + "version": { + "code": 2000000, + "name": "2.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.samples.jscomponents", + "name": ".MainAbility", + "reqCapabilities": [ + "video_support" + ], + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "portrait", + "visible": true, + "formsEnabled": false, + "name": ".MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index", + "pages/details/details", + "pages/comp/comp" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/JSUI/JsComponents/entry/src/main/java/ohos/samples/jscomponents/MainAbility.java b/JSUI/JsComponents/entry/src/main/java/ohos/samples/jscomponents/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..97f5de692ccdfb52647656e49cc6083374e689a5 --- /dev/null +++ b/JSUI/JsComponents/entry/src/main/java/ohos/samples/jscomponents/MainAbility.java @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package ohos.samples.jscomponents; + +import ohos.ace.ability.AceAbility; +import ohos.aafwk.content.Intent; + +/** + * MainAbility + */ +public class MainAbility extends AceAbility { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + } + + @Override + public void onStop() { + super.onStop(); + } +} diff --git a/JSUI/JsComponents/entry/src/main/js/default/app.js b/JSUI/JsComponents/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..8e47afff13e928a74fdcc01a108e4422404b9ac9 --- /dev/null +++ b/JSUI/JsComponents/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/JSUI/JsComponents/entry/src/main/js/default/common/common.png b/JSUI/JsComponents/entry/src/main/js/default/common/common.png new file mode 100644 index 0000000000000000000000000000000000000000..9ed4fbcbb8d77582afb2b6101180c97b08f21c31 Binary files /dev/null and b/JSUI/JsComponents/entry/src/main/js/default/common/common.png differ diff --git a/JSUI/JsComponents/entry/src/main/js/default/common/ice.png b/JSUI/JsComponents/entry/src/main/js/default/common/ice.png new file mode 100644 index 0000000000000000000000000000000000000000..6ebbe6521fa8f6b75d263cf9a6858529fc86fa87 Binary files /dev/null and b/JSUI/JsComponents/entry/src/main/js/default/common/ice.png differ diff --git a/JSUI/JsComponents/entry/src/main/js/default/common/like.png b/JSUI/JsComponents/entry/src/main/js/default/common/like.png new file mode 100644 index 0000000000000000000000000000000000000000..333097c19148612410c54eff2ad8de4eda8664fc Binary files /dev/null and b/JSUI/JsComponents/entry/src/main/js/default/common/like.png differ diff --git a/JSUI/JsComponents/entry/src/main/js/default/common/unlike.png b/JSUI/JsComponents/entry/src/main/js/default/common/unlike.png new file mode 100644 index 0000000000000000000000000000000000000000..257ff34bf2f4bc78b68ef46dcbf6294a6196806d Binary files /dev/null and b/JSUI/JsComponents/entry/src/main/js/default/common/unlike.png differ diff --git a/JSUI/JsComponents/entry/src/main/js/default/i18n/en-US.json b/JSUI/JsComponents/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..55561b83737c3c31d082fbfa11e5fc987a351104 --- /dev/null +++ b/JSUI/JsComponents/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + }, + "Files": { + } +} \ No newline at end of file diff --git a/JSUI/JsComponents/entry/src/main/js/default/pages/comp/comp.css b/JSUI/JsComponents/entry/src/main/js/default/pages/comp/comp.css new file mode 100644 index 0000000000000000000000000000000000000000..cfecb7c9378d96b8572e058a5c9d16c505a7d7cc --- /dev/null +++ b/JSUI/JsComponents/entry/src/main/js/default/pages/comp/comp.css @@ -0,0 +1,35 @@ +/* + * 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. + */ + +.item { + width: 700px; + flex-direction: column; + height: 300px; + align-items: center; + margin-top: 100px; +} +.text-style { + width: 100%; + text-align: center; + font-weight: 500; + font-family: Courier; + font-size: 36px; +} +.title-style { + font-weight: 500; + font-family: Courier; + font-size: 50px; + color: #00ffff; +} \ No newline at end of file diff --git a/JSUI/JsComponents/entry/src/main/js/default/pages/comp/comp.hml b/JSUI/JsComponents/entry/src/main/js/default/pages/comp/comp.hml new file mode 100644 index 0000000000000000000000000000000000000000..564dac3e90211b76ff438e74d6059867a7bc1edd --- /dev/null +++ b/JSUI/JsComponents/entry/src/main/js/default/pages/comp/comp.hml @@ -0,0 +1,25 @@ + + +
+ {{title}} + + + Click here to view hidden text + + + hello worldshow + +
\ No newline at end of file diff --git a/JSUI/JsComponents/entry/src/main/js/default/pages/comp/comp.js b/JSUI/JsComponents/entry/src/main/js/default/pages/comp/comp.js new file mode 100644 index 0000000000000000000000000000000000000000..65c31d2eb558016ab984478d3bdbf423291cb1a5 --- /dev/null +++ b/JSUI/JsComponents/entry/src/main/js/default/pages/comp/comp.js @@ -0,0 +1,34 @@ +/* + * 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 { + props: { + title: { + default: 'title', + }, + showObject: {}, + }, + data() { + return { + display: this.showObject, + }; + }, + childClicked() { + this.$emit('eventType1', { + text: 'Get Child Component Parameter' + }); + this.show = !this.show; + }, +} \ No newline at end of file diff --git a/JSUI/JsComponents/entry/src/main/js/default/pages/details/details.css b/JSUI/JsComponents/entry/src/main/js/default/pages/details/details.css new file mode 100644 index 0000000000000000000000000000000000000000..0423993d00a1e0109068a742f275d31732eff349 --- /dev/null +++ b/JSUI/JsComponents/entry/src/main/js/default/pages/details/details.css @@ -0,0 +1,25 @@ +/* + * 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 { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 50px; + margin-bottom: 50px; +} \ No newline at end of file diff --git a/JSUI/JsComponents/entry/src/main/js/default/pages/details/details.hml b/JSUI/JsComponents/entry/src/main/js/default/pages/details/details.hml new file mode 100644 index 0000000000000000000000000000000000000000..ddd5391627940d895722f82b25e3ac61865e4bf0 --- /dev/null +++ b/JSUI/JsComponents/entry/src/main/js/default/pages/details/details.hml @@ -0,0 +1,21 @@ + + +
+ + This is the detail page. + + +
\ No newline at end of file diff --git a/JSUI/JsComponents/entry/src/main/js/default/pages/details/details.js b/JSUI/JsComponents/entry/src/main/js/default/pages/details/details.js new file mode 100644 index 0000000000000000000000000000000000000000..106a6d140f489873d289d5322bde12563708ce80 --- /dev/null +++ b/JSUI/JsComponents/entry/src/main/js/default/pages/details/details.js @@ -0,0 +1,25 @@ +/* + * 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. + */ + +import router from '@system.router'; + +export default { + data: { + title: 'World' + }, + launch: function () { + router.back(); + } +} diff --git a/JSUI/JsComponents/entry/src/main/js/default/pages/index/index.css b/JSUI/JsComponents/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..aa066a3428ca66d1217041670324217f9e2177d1 --- /dev/null +++ b/JSUI/JsComponents/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,277 @@ +/* + * 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 { + text-align: center; + position: relative; + flex-direction: column; + background-color: #ffffff; +} +.header { + background-color: #F1F1F1; + text-align: center; + position: relative; + width: 100%; + height: 600px; +} +.left-container { + flex-direction: column; + margin-left: 48px; + width: 50%; +} +.title-text { + color: #1a1a1a; + font-size: 36px; + height: 90px; + width: 400px; +} +.paragraph-text { + color: #000000; + margin-top: 12px; + font-size: 20px; + line-height: 30px; +} +.comment-title { + font-size: 24px; + color: #1a1a1a; + font-weight: bold; + margin-top: 10px; + margin-bottom: 10px; +} + +.comment-key { + width: 100px; + height: 50px; + margin-left: 10px; + font-size: 20px; + color: #1a1a1a; + font-weight: bold; +} +.comment-key:focus { + color: #007dff; +} +.comment-text { + width: 386px; + height: 50px; + text-align: left; + line-height: 35px; + font-size: 20px; + color: #000000; + border-bottom-color: #bcbcbc; + border-bottom-width: 0.5px; +} +.comment { + width: 386px; + height: 50px; + background-color: lightgrey; +} +.right-container { + width: 50%; + justify-content: center; +} +.img { + margin-top: 50px; + object-fit: contain; + width: 300px; + height: 300px; +} +.desc-text { + width: 683.3px; + font-size: 35.4px; +} +.tab-bar { + background-color: #F1F1F1; + text-align: center; + position: relative; + width: 50%; + height: 100px; +} +.image-click { + text-align: center; + position: absolute; + width: 100%; + top: 10px; + margin-top: 10px; + height: 100px; +} +.like { + width: 200px; + height: 100px; + margin-top: 10px; + border: 2px solid #bcbcbc; + justify-content: space-between; + align-items: center; + border-radius: 8px; +} +.like-img { + width: 50px; + height: 50px; + margin-left: 14px; +} +.tab-image { + width: 50px; + height: 50px; + margin-left: 14px; +} +.like-num { + color: #bcbcbc; + font-size: 20px; + margin-right: 17px; +} +.tab-container { + background-color: #F1F1F1; + text-align: center; + position: relative; + width: 100%; + height: 200px; +} +.list { + background-color: #F1F1F1; + text-align: center; + position: relative; + width: 100%; + height: 200px; +} +.listItem { + font-size: 18px; + color: #1a1a1a; + margin-top: 10px; + margin-bottom: 10px; +} +.static-animation-container { + flex-direction: column; + align-items: center; + margin-left: 24px; + margin-right: 24px; +} +.translate { + height: 150px; + width: 300px; + font-size: 50px; + background-color: #008000; + transform: translate(200px); +} +.rotate { + height: 150px; + width: 300px; + font-size: 50px; + background-color: #008000; + transform-origin: 200px 100px; + transform: rotateY(45deg); +} +.scale { + height: 150px; + width: 300px; + font-size: 50px; + background-color: #008000; + transform: scaleX(-1.5); +} + +.item-container { + flex-direction: column; +} +.animation-header { + margin-bottom: 20px; +} +.animation-item { + background-color: #f76160; +} +.animation-txt { + text-align: center; + width: 100%; + height: 100px; + margin-top: 10px; +} +.animation-button { + width: 200px; + font-size: 30px; + margin-top: 20px; + background-color: #09ba07; +} +.animation-color { + animation-name: Color; + animation-duration: 8000ms; +} +.animation-opacity { + animation-name: Opacity; + animation-duration: 8000ms; +} +.gesture-container { + flex-direction: column; + justify-content: center; + align-items: center; + margin-bottom: 20px; +} +.gesture-text-container { + margin-top: 10px; + flex-direction: column; + width: 750px; + height: 50px; + background-color: #09ba07; +} +.gesture-text-style { + width: 100%; + line-height: 50px; + text-align: center; + font-size: 24px; + color: #ffffff; +} +.key-card-box { + flex-direction: column; + justify-content: center; + margin-bottom: 20px; + margin-top: 20px; +} +.key-content-box { + align-items: center; + height: 200px; + flex-direction: column; + margin-left: 200px; + margin-right: 200px; +} +.key-content-text { + font-size: 40px; + text-align: center; +} +.routing-container { + flex-direction: column; + justify-content: center; + align-items: center; +} +.routing-title { + font-size: 50px; + margin-bottom: 50px; +} +.custom-container { + flex: 1; + flex-direction: column; + align-content: center; +} +@keyframes Color { + from { + background-color: #f76160; + } + to { + background-color: #09ba07; + } +} +@keyframes Opacity { + from { + opacity: 0.9; + } + to { + opacity: 0.1; + } +} \ No newline at end of file diff --git a/JSUI/JsComponents/entry/src/main/js/default/pages/index/index.hml b/JSUI/JsComponents/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..8555a4d33e8de871221a235ad84c8b7fff16e85a --- /dev/null +++ b/JSUI/JsComponents/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,222 @@ + + + + + +
+ + Case 1:Build Layout + +
+
+ +
+ {{headTitle}} + + {{paragraphFirst}} + + {{paragraphSecond}} + + + Comment + +
+ + + Done + +
+
+ {{inputValue}} + + + Delete + +
+
+
+ +
+
+ +
+ + Case 2:Add Interaction + +
+
+ + + + +
+ + Case 3:Add an External Container + +
+
+ +
+
+ + + + Image Show + + + + + + +
+
+ + + {{$item.value0}} + + + + {{$item.value1}} + + + + {{$item.value2}} + + + + {{$item.value3}} + + + +
+
+
+ +
+ + Case 4:Add Static Animation + +
+
+ +
+ + hello + + + hello + + + hello + +
+
+ +
+ + Case 5:Add Continuous Animation + +
+
+ +
+ + continuous animation + +
+ + color + +
+
+ + opacity + +
+ +
+
+ +
+ + Case 6:Add Gesture Event + +
+
+ +
+
+ {{onClick}} + +
+
+ {{touchstart}} + +
+
+ {{touchmove}} + +
+
+ {{touchend}} + +
+
+ {{touchcancel}} + +
+
+ {{onLongPress}} + +
+
+
+ +
+ + Case 7:Add Page Routing + +
+
+ +
+ + This is the index page. + + +
+
+ +
+ + Case 8:Add Custom Component + +
+
+ +
+ + Parent Component:{{text}} + + +
+
+
\ No newline at end of file diff --git a/JSUI/JsComponents/entry/src/main/js/default/pages/index/index.js b/JSUI/JsComponents/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3381451bbef958443f379640f012daf532c7a672 --- /dev/null +++ b/JSUI/JsComponents/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,120 @@ +/* + * 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. + */ + +import router from '@system.router'; + +export default { + data: { + inputValue: '', + commentText: false, + likeImage: '/common/unlike.png', + isPressed: false, + total: 20, + headTitle: 'Capture the Beauty in This Moment', + paragraphFirst: 'Capture the beauty of light during the transition and fusion of ice and water. At the instant of movement and stillness, softness and rigidity, force and beauty, condensing moving moments.', + paragraphSecond: 'Reflecting the purity of nature, the innovative design upgrades your visual entertainment and ergonomic comfort. Effortlessly capture what you see and let it speak for what you feel.', + middleImage: '/common/common.png', + textList: [{ + value0: 'JS FA' + }, { + value1: 'JS AA' + }, { + value2: 'Java FA' + }, { + value3: 'Java AA' + }], + tabImage: '/common/ice.png', + colorParam: '', + opacityParam: '', + touchstart: 'touchstart', + touchmove: 'touchmove', + touchend: 'touchend', + touchcancel: 'touchcancel', + onClick: 'onclick', + onLongPress: 'onlongpress', + up: 'up', + down: 'down', + text: 'start', + showState: false + }, + textClicked (e) { + this.text = e.detail.text; + }, + focusUp: function () { + this.up = 'up focused'; + }, + blurUp: function () { + this.up = 'up'; + }, + keyUp: function () { + this.up = 'up keyed'; + }, + focusDown: function () { + this.down = 'down focused'; + }, + blurDown: function () { + this.down = 'down'; + }, + keyDown: function () { + this.down = 'down keyed'; + }, + touchCancel: function () { + this.touchcancel = 'canceled'; + }, + touchEnd: function () { + this.touchend = 'ended'; + }, + touchMove: function () { + this.touchmove = 'moved'; + }, + touchStart: function () { + this.touchstart = 'touched'; + }, + longPress: function () { + this.onLongPress = 'longpressed'; + }, + click: function () { + this.onClick = 'clicked'; + }, + showAnimation: function () { + this.colorParam = ''; + this.opacityParam = ''; + this.colorParam = 'animation-color'; + this.opacityParam = 'animation-opacity'; + }, + update() { + this.commentText = !this.commentText; + }, + updateValue(e) { + this.inputValue = e.text; + }, + likeClick() { + var temp; + if (!this.isPressed) { + temp = this.total + 1; + this.likeImage = '/common/like.png'; + } else { + temp = this.total - 1; + this.likeImage = '/common/unlike.png'; + } + this.total = temp; + this.isPressed = !this.isPressed; + }, + launch: function () { + router.push({ + uri: 'pages/details/details', + }); + } +} \ No newline at end of file diff --git a/JSUI/JsComponents/entry/src/main/resources/base/element/string.json b/JSUI/JsComponents/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..743f5827ae4eb39269915a01e9b42192e4fd427e --- /dev/null +++ b/JSUI/JsComponents/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "JsComponents" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/JSUI/JsComponents/entry/src/main/resources/base/media/icon.png b/JSUI/JsComponents/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/JSUI/JsComponents/entry/src/main/resources/base/media/icon.png differ diff --git a/JSUI/JsComponents/screenshots/device/main1.png b/JSUI/JsComponents/screenshots/device/main1.png new file mode 100644 index 0000000000000000000000000000000000000000..59a21fd503ad2843c60f18f85eeb73a50a0ee228 Binary files /dev/null and b/JSUI/JsComponents/screenshots/device/main1.png differ diff --git a/JSUI/JsComponents/screenshots/device/main2.png b/JSUI/JsComponents/screenshots/device/main2.png new file mode 100644 index 0000000000000000000000000000000000000000..d56c780064ef52c442fa6532fd91ee8365d0ff2e Binary files /dev/null and b/JSUI/JsComponents/screenshots/device/main2.png differ diff --git a/JSUI/JsComponents/settings.gradle b/JSUI/JsComponents/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..1ca4151b64fa836a72c0db9a9a8a4cf0ffcc32c1 --- /dev/null +++ b/JSUI/JsComponents/settings.gradle @@ -0,0 +1,15 @@ +/* + * 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. + */ +include 'entry' diff --git a/JSUI/JsFACard/README.md b/JSUI/JsFACard/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b9a6d82989cf6ac7a873b5237d7745ba99ef7ef2 --- /dev/null +++ b/JSUI/JsFACard/README.md @@ -0,0 +1,14 @@ +# JS Service Widget Development + +### Introduction + +This sample demonstrates service widgets. Service widgets are used to present important information about apps, allowing users to access desired services instantly via shortcut gestures. + +### Usage + +Swipe up the icon of the sample app, select a service widget size, and touch **ADD TO HOME SCREEN** to add the service widget to the home screen. Alternatively, touch and hold the sample app icon until **Service Widgets** is displayed, touch **Service Widgets**, select a service widget size, and touch **ADD TO HOME SCREEN** to add the service widget to the home screen. You can touch a service widget on the home screen to go to the home page of the sample app. + +### Constraints + +This sample can only be run on large-system devices. A maximum of 16 service widgets can be configured for a single app. + diff --git a/JSUI/JsFACard/READNE_zh.md b/JSUI/JsFACard/READNE_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..d7d41afc11654362203bfdb8460918b0bdd479e8 --- /dev/null +++ b/JSUI/JsFACard/READNE_zh.md @@ -0,0 +1,14 @@ +# JS 卡片开发 + +### 简介 + +本示例展示了服务卡片功能,通过服务卡片将用户应用程序的重要信息展示在桌面,用户可通过快捷手势使用卡片,以达到服务直达、减少层级跳转的目的。 + +### 使用说明 + +上滑本示例应用图标,选择需要的卡片尺寸添加到屏幕,也可以长按示例应用,等待出现服务卡片字样,点击后选择卡片尺寸,添加到桌面。可以点击在桌面上的卡片进入示例应用的主页面。 + +### 约束与限制 + +本示例仅支持在大型系统上运行,对于同一个应用,最多支持配置16张卡片。 + diff --git a/JSUI/JsFACard/build.gradle b/JSUI/JsFACard/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..91af1ca64995ab365fbf9f4d6b6c9a5f816d163f --- /dev/null +++ b/JSUI/JsFACard/build.gradle @@ -0,0 +1,36 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +apply plugin: 'com.huawei.ohos.app' + +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } +} + +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.2' + } +} + +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + jcenter() + } +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/build.gradle b/JSUI/JsFACard/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..7321aa676e8d1768815335fe0813207cbda5f160 --- /dev/null +++ b/JSUI/JsFACard/entry/build.gradle @@ -0,0 +1,20 @@ +apply plugin: 'com.huawei.ohos.hap' +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } + compileOptions { annotationEnabled true } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/config.json b/JSUI/JsFACard/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..0c7d85a3fdad8fae247593e0cee967f73d7846a0 --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/config.json @@ -0,0 +1,201 @@ +{ + "app": { + "bundleName": "ohos.samples.jsfacard", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": { + "default": { + "keepAlive": true + } + }, + "module": { + "package": "ohos.samples.jsfacard", + "name": ".MyApplication", + "mainAbility": "ohos.samples.jsfacard.ClockAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "reqPermissions": [ + { + "name": "ohos.permission.KEEP_BACKGROUND_RUNNING", + "reason": "keep service ability backgroud running", + "usedScene": { + "ability": [ + "ohos.samples.jsfacard.TimerAbility" + ], + "when": "always" + } + } + ], + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": ".ClockAbility", + "icon": "$media:icon", + "description": "$string:clockability_description", + "formsEnabled": true, + "label": "$string:app_name", + "type": "page", + "launchType": "singleton", + "forms": [ + { + "jsComponentName": "clock1x2", + "isDefault": true, + "scheduledUpdateTime": "10:30", + "defaultDimension": "1*2", + "name": "clock1x2", + "description": "This is a service widget", + "colorMode": "auto", + "type": "JS", + "supportDimensions": [ + "1*2" + ], + "updateEnabled": true, + "updateDuration": 1 + } + ] + }, + { + "name": "ohos.samples.jsfacard.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:entry_MainAbility", + "type": "page", + "formsEnabled": true, + "launchType": "standard", + "forms": [ + { + "jsComponentName": "jsmusictemplate", + "isDefault": false, + "scheduledUpdateTime": "10:30", + "defaultDimension": "2*4", + "name": "jsmusictemplate", + "description": "This is a service widget", + "colorMode": "auto", + "type": "JS", + "supportDimensions": [ + "2*4" + ], + "updateEnabled": true, + "updateDuration": 1 + }, + { + "jsComponentName": "jscardtemplate", + "isDefault": false, + "scheduledUpdateTime": "10:30", + "defaultDimension": "4*4", + "name": "jscardtemplate", + "description": "This is a service widget", + "colorMode": "auto", + "type": "JS", + "supportDimensions": [ + "4*4" + ], + "updateEnabled": true, + "updateDuration": 1 + }, + { + "jsComponentName": "card", + "isDefault": true, + "scheduledUpdateTime": "10:30", + "defaultDimension": "2*4", + "name": "card", + "description": "This is a service widget", + "colorMode": "auto", + "type": "JS", + "supportDimensions": [ + "2*4" + ], + "updateEnabled": true, + "updateDuration": 1 + } + ] + }, + { + "name": "ohos.samples.jsfacard.TimerAbility", + "icon": "$media:icon", + "description": "$string:timerability_description", + "type": "service", + "visible": true, + "backgroundModes": [ + "dataTransfer", + "location" + ] + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": true + } + }, + { + "pages": [ + "pages/index/index" + ], + "name": "card", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "type": "form" + }, + { + "pages": [ + "pages/index/index" + ], + "name": "jscardtemplate", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "type": "form" + }, + { + "pages": [ + "pages/index/index" + ], + "name": "jsmusictemplate", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "type": "form" + }, + { + "pages": [ + "pages/index/index" + ], + "name": "clock1x2", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "type": "form" + } + ] + } +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/ClockAbility.java b/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/ClockAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..2a91661f544b9b0d84345f9cfce962d108725ecb --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/ClockAbility.java @@ -0,0 +1,115 @@ +/* + * 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. + */ + +package ohos.samples.jsfacard; + +import ohos.aafwk.ability.Ability; +import ohos.aafwk.ability.AbilitySlice; +import ohos.aafwk.ability.FormBindingData; +import ohos.aafwk.ability.ProviderFormInfo; +import ohos.aafwk.content.Intent; +import ohos.aafwk.content.Operation; +import ohos.data.DatabaseHelper; +import ohos.data.orm.OrmContext; +import ohos.samples.jsfacard.database.Form; +import ohos.samples.jsfacard.database.FormDatabase; +import ohos.samples.jsfacard.slice.ClockAbilitySlice; +import ohos.samples.jsfacard.utils.DatabaseUtils; +import ohos.samples.jsfacard.utils.DateUtils; +import ohos.samples.jsfacard.utils.LogUtils; +import ohos.utils.zson.ZSONObject; + +/** + * ClockAbility + * + * @since 2021-08-20 + */ +public class ClockAbility extends Ability { + private static final String TAG = ClockAbility.class.getName(); + + private static final int INVALID_FORM_ID = -1; + + private static final String EMPTY_STRING = ""; + + private static final int DEFAULT_DIMENSION_1x2 = 1; + + private OrmContext connect; + + private final DatabaseHelper helper = new DatabaseHelper(this); + + @Override + public void onStart(Intent intent) { + super.onStart(intent); + startTimerAbility(); + connect = helper.getOrmContext("FormDatabase", "FormDatabase.db", FormDatabase.class); + super.setMainRoute(ClockAbilitySlice.class.getName()); + } + + private void startTimerAbility(){ + Intent intentService = new Intent(); + Operation operation = new Intent.OperationBuilder() + .withDeviceId("") + .withBundleName(getBundleName()) + .withAbilityName(TimerAbility.class.getName()) + .build(); + intentService.setOperation(operation); + startAbility(intentService); + } + + @Override + protected ProviderFormInfo onCreateForm(Intent intent) { + startTimerAbility(); + ProviderFormInfo providerFormInfo = new ProviderFormInfo(); + LogUtils.info(TAG, "onCreateForm()"); + if (intent == null) { + return providerFormInfo; + } + + long formId; + if (intent.hasParameter(AbilitySlice.PARAM_FORM_IDENTITY_KEY)) { + formId = intent.getLongParam(AbilitySlice.PARAM_FORM_IDENTITY_KEY, INVALID_FORM_ID); + } else { + return providerFormInfo; + } + + String formName = EMPTY_STRING; + if (intent.hasParameter(AbilitySlice.PARAM_FORM_NAME_KEY)) { + formName = intent.getStringParam(AbilitySlice.PARAM_FORM_NAME_KEY); + } + + int dimension = DEFAULT_DIMENSION_1x2; + if (intent.hasParameter(AbilitySlice.PARAM_FORM_DIMENSION_KEY)) { + dimension = intent.getIntParam(AbilitySlice.PARAM_FORM_DIMENSION_KEY, DEFAULT_DIMENSION_1x2); + } + + if (connect == null) { + connect = helper.getOrmContext("FormDatabase", "FormDatabase.db", FormDatabase.class); + } + Form form = new Form(formId, formName, dimension); + DatabaseUtils.insertForm(form, connect); + + ZSONObject zsonObject = DateUtils.getZsonObject(); + LogUtils.info(TAG, "onCreateForm()" + zsonObject); + providerFormInfo.setJsBindingData(new FormBindingData(zsonObject)); + return providerFormInfo; + } + + @Override + protected void onDeleteForm(long formId) { + LogUtils.info(TAG, "onDeleteForm():formId=" + formId); + super.onDeleteForm(formId); + DatabaseUtils.deleteFormData(formId, connect); + } +} diff --git a/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/MainAbility.java b/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..fcc2bf5598a4281b6939568d4d470ebc5fa58e5e --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/MainAbility.java @@ -0,0 +1,127 @@ +/* + * 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. + */ + +package ohos.samples.jsfacard; + +import ohos.aafwk.ability.Ability; +import ohos.aafwk.ability.FormBindingData; +import ohos.aafwk.ability.FormException; +import ohos.aafwk.ability.ProviderFormInfo; +import ohos.aafwk.content.Intent; +import ohos.global.resource.NotExistException; +import ohos.global.resource.Resource; +import ohos.samples.jsfacard.utils.LogUtils; +import ohos.utils.zson.ZSONObject; + +import java.io.ByteArrayOutputStream; +import java.io.FileNotFoundException; +import java.io.IOException; + +/** + * Main ability + * + * @since 2021-08-20 + */ +public class MainAbility extends Ability { + private static final String TAG = MainAbility.class.getName(); + + private static final int CACHE_SIZE = 1024 * 20; + + private static final String STATUS = "status"; + + private static final String PLAY = "play"; + + private static final String PAUSE = "pause"; + + private static boolean isStatus = true; + + @Override + public void onStart(Intent intent) { + LogUtils.info(TAG, "onStart"); + super.onStart(intent); + } + + @Override + protected ProviderFormInfo onCreateForm(Intent intent) { + LogUtils.info(TAG, "onCreateForm"); + ProviderFormInfo providerFormInfo = new ProviderFormInfo(); + try { + Resource resourceImageSrc = getResourceManager().getResource(ResourceTable.Media_ic_image); + Resource resourceBlueSrc = getResourceManager().getResource(ResourceTable.Media_ic_blue); + byte[] bytesImageSrc = imageConvertToByteArray(resourceImageSrc); + byte[] bytesBlueSrc = imageConvertToByteArray(resourceBlueSrc); + ZSONObject zsonObject = new ZSONObject(); + zsonObject.put("imageSrc", "memory://ic_image.png"); + zsonObject.put("imageBlueSrc", "memory://ic_blue.svg"); + FormBindingData formBindingData = new FormBindingData(zsonObject); + formBindingData.addImageData("ic_image.png", bytesImageSrc); + formBindingData.addImageData("ic_blue.svg", bytesBlueSrc); + providerFormInfo.setJsBindingData(formBindingData); + } catch (IOException e) { + LogUtils.info(TAG, "IOException" + e.getMessage()); + } catch (NotExistException e) { + LogUtils.info(TAG, "NotExistException" + e.getMessage()); + } + return providerFormInfo; + } + + private byte[] imageConvertToByteArray(Resource resource) { + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + byte[] bytes = new byte[CACHE_SIZE]; + try { + int len; + while (-1 != (len = resource.read(bytes))) { + byteArrayOutputStream.write(bytes, 0, len); + } + } catch (FileNotFoundException e) { + LogUtils.info(TAG, "FileNotFoundException" + e.getMessage()); + } catch (IOException e) { + LogUtils.info(TAG, "IOException" + e.getMessage()); + } + return byteArrayOutputStream.toByteArray(); + } + + @Override + protected void onUpdateForm(long formId) { + LogUtils.info(TAG, "onUpdateForm"); + super.onUpdateForm(formId); + } + + @Override + protected void onDeleteForm(long formId) { + LogUtils.info(TAG, "onDeleteForm: formId=" + formId); + super.onDeleteForm(formId); + } + + @Override + protected void onTriggerFormEvent(long formId, String message) { + LogUtils.info(TAG, "onTriggerFormEvent: formId=" + formId); + super.onTriggerFormEvent(formId, message); + ZSONObject zsonObject = new ZSONObject(); + if (isStatus) { + zsonObject.put(STATUS, PAUSE); + isStatus = false; + } else { + zsonObject.put(STATUS, PLAY); + isStatus = true; + } + FormBindingData formBindingData = new FormBindingData(zsonObject); + try { + updateForm(formId, formBindingData); + } catch (FormException e) { + LogUtils.info(TAG, "onTriggerFormEvent:" + e.getMessage()); + } + } +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/MyApplication.java b/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/MyApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..0f5104439f69ae48a093735a838e5c0a3dca725b --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/MyApplication.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package ohos.samples.jsfacard; + +import ohos.aafwk.ability.AbilityPackage; + +/** + * MyApplication + * + * @since 2021-08-20 + */ +public class MyApplication extends AbilityPackage { + @Override + public void onInitialize() { + super.onInitialize(); + } +} diff --git a/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/TimerAbility.java b/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/TimerAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..035f683923d21673f1242a74fce7e63b71f067ff --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/TimerAbility.java @@ -0,0 +1,112 @@ +/* + * 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. + */ + +package ohos.samples.jsfacard; + +import ohos.aafwk.ability.Ability; +import ohos.aafwk.ability.FormBindingData; +import ohos.aafwk.ability.FormException; +import ohos.aafwk.content.Intent; +import ohos.data.DatabaseHelper; +import ohos.data.orm.OrmContext; +import ohos.data.orm.OrmPredicates; +import ohos.event.notification.NotificationRequest; +import ohos.samples.jsfacard.database.Form; +import ohos.samples.jsfacard.database.FormDatabase; +import ohos.samples.jsfacard.utils.DatabaseUtils; +import ohos.samples.jsfacard.utils.DateUtils; +import ohos.samples.jsfacard.utils.LogUtils; +import ohos.utils.zson.ZSONObject; + +import java.util.List; +import java.util.Timer; +import java.util.TimerTask; + +/** + * TimerAbility + * + * @since 2021-08-20 + */ +public class TimerAbility extends Ability { + private static final String TAG = TimerAbility.class.getName(); + + private static final long UPDATE_PERIOD = 1000L; + + private static final int NOTICE_ID = 1005; + + private OrmContext connect; + + private final DatabaseHelper helper = new DatabaseHelper(this); + + @Override + public void onStart(Intent intent) { + LogUtils.info(TAG, "TimerAbility::onStart"); + connect = helper.getOrmContext("FormDatabase", "FormDatabase.db", FormDatabase.class); + startTimer(); + super.onStart(intent); + } + + private void startTimer() { + Timer timer = new Timer(); + timer.schedule(new TimerTask() { + @Override + public void run() { + updateForms(); + notice(); + } + }, 0, UPDATE_PERIOD); + } + + private void updateForms() { + OrmPredicates ormPredicates = new OrmPredicates(Form.class); + List
formList = connect.query(ormPredicates); + if (formList.size() <= 0) { + return; + } + for (Form form : formList) { + Long updateFormId = form.getFormId(); + ZSONObject zsonObject = DateUtils.getZsonObject(); + LogUtils.info(TAG, "updateForm FormException " + zsonObject); + try { + updateForm(updateFormId, new FormBindingData(zsonObject)); + } catch (FormException e) { + DatabaseUtils.deleteFormData(form.getFormId(), connect); + LogUtils.info(TAG, "updateForm FormException " + e.getMessage()); + } + } + } + + private void notice() { + NotificationRequest request = new NotificationRequest(NOTICE_ID); + request.setAlertOneTime(true); + NotificationRequest.NotificationNormalContent content = new NotificationRequest.NotificationNormalContent(); + content.setText(DateUtils.getCurrentDate("yyyy-MM-dd HH:mm:ss")); + NotificationRequest.NotificationContent notificationContent = new NotificationRequest.NotificationContent(content); + request.setContent(notificationContent); + keepBackgroundRunning(NOTICE_ID, request); + } + + @Override + public void onBackground() { + LogUtils.info(TAG, "TimerAbility::onBackground"); + super.onBackground(); + } + + @Override + public void onStop() { + LogUtils.info(TAG, "TimerAbility::onStop"); + super.onStop(); + } +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/database/Form.java b/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/database/Form.java new file mode 100644 index 0000000000000000000000000000000000000000..d03f6fc968645b62b0f0c3809e8b202864f16bdc --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/database/Form.java @@ -0,0 +1,67 @@ +/* + * 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. + */ + +package ohos.samples.jsfacard.database; + +import ohos.data.orm.OrmObject; +import ohos.data.orm.annotation.Entity; +import ohos.data.orm.annotation.PrimaryKey; + +/** + * Card Table + * + * @since 2021-08-20 + */ +@Entity(tableName = "form") +public class Form extends OrmObject { + @PrimaryKey() + private Long formId; + + private String formName; + + private Integer dimension; + + public Form(Long formId, String formName, Integer dimension) { + this.formId = formId; + this.formName = formName; + this.dimension = dimension; + } + + public Form() { } + + public Integer getDimension() { + return dimension; + } + + public void setDimension(Integer dimension) { + this.dimension = dimension; + } + + public Long getFormId() { + return formId; + } + + public void setFormId(Long formId) { + this.formId = formId; + } + + public String getFormName() { + return formName; + } + + public void setFormName(String formName) { + this.formName = formName; + } +} diff --git a/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/database/FormDatabase.java b/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/database/FormDatabase.java new file mode 100644 index 0000000000000000000000000000000000000000..10703e7a066345dc186434e0fe7837e34164f9ca --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/database/FormDatabase.java @@ -0,0 +1,29 @@ +/* + * 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. + */ + +package ohos.samples.jsfacard.database; + +import ohos.data.orm.OrmDatabase; +import ohos.data.orm.annotation.Database; + +/** + * Card Database + * + * @since 2021-08-20 + */ +@Database( + entities = {Form.class}, + version = 1) +public abstract class FormDatabase extends OrmDatabase { } diff --git a/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/slice/ClockAbilitySlice.java b/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/slice/ClockAbilitySlice.java new file mode 100644 index 0000000000000000000000000000000000000000..c0b811c64241c1f1cf2de45281c3fcee94025279 --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/slice/ClockAbilitySlice.java @@ -0,0 +1,133 @@ +/* + * 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. + */ + +package ohos.samples.jsfacard.slice; + +import ohos.aafwk.ability.AbilitySlice; +import ohos.aafwk.content.Intent; +import ohos.agp.components.Component; +import ohos.agp.components.Text; +import ohos.eventhandler.EventHandler; +import ohos.eventhandler.EventRunner; +import ohos.eventhandler.InnerEvent; +import ohos.samples.jsfacard.ResourceTable; +import ohos.samples.jsfacard.utils.DateUtils; +import ohos.samples.jsfacard.utils.LogUtils; + +import java.util.Calendar; +import java.util.Timer; +import java.util.TimerTask; + +/** + * ClockAbilitySlice + * + * @since 2021-08-20 + */ +public class ClockAbilitySlice extends AbilitySlice { + private static final String TAG = ClockAbilitySlice.class.getName(); + + private static final long SEND_PERIOD = 1000L; + + private Timer timer; + + private MyEventHandler myEventHandler; + + private final Runnable runnable = new Runnable() { + @Override + public void run() { + initHandler(); + } + + private void initHandler() { + EventRunner eventRunner = EventRunner.getMainEventRunner(); + if (eventRunner == null) { + return; + } + myEventHandler = new MyEventHandler(eventRunner); + } + }; + + @Override + public void onStart(Intent intent) { + super.onStart(intent); + super.setUIContent(ResourceTable.Layout_timer_progress_clock_1x2); + initComponent(); + startTimer(); + } + + private void initComponent() { + Calendar now = Calendar.getInstance(); + Component hourComponent = findComponentById(ResourceTable.Id_hour); + if (hourComponent instanceof Text) { + Text hourText = (Text) hourComponent; + int hour = now.get(Calendar.HOUR_OF_DAY); + hourText.setText(DateUtils.setTextValue(hour)); + } + Component minComponent = findComponentById(ResourceTable.Id_min); + if (minComponent instanceof Text) { + Text minText = (Text) minComponent; + int min = now.get(Calendar.MINUTE); + minText.setText(DateUtils.setTextValue(min)); + } + Component secComponent = findComponentById(ResourceTable.Id_sec); + if (secComponent instanceof Text) { + Text secText = (Text) secComponent; + int sec = now.get(Calendar.SECOND); + secText.setText(DateUtils.setTextValue(sec)); + } + } + + private void startTimer() { + timer = new Timer(); + timer.schedule(new TimerTask() { + @Override + public void run() { + runnable.run(); + myEventHandler.sendEvent(1); + } + }, 0, SEND_PERIOD); + } + + @Override + public void onActive() { + super.onActive(); + } + + @Override + public void onForeground(Intent intent) { + super.onForeground(intent); + } + + @Override + protected void onStop() { + LogUtils.info(TAG, " start to destroy slice"); + timer.cancel(); + } + + private class MyEventHandler extends EventHandler { + MyEventHandler(EventRunner runner) throws IllegalArgumentException { + super(runner); + } + + @Override + protected void processEvent(InnerEvent event) { + super.processEvent(event); + int eventId = event.eventId; + if (eventId == 1) { + initComponent(); + } + } + } +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/utils/DatabaseUtils.java b/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/utils/DatabaseUtils.java new file mode 100644 index 0000000000000000000000000000000000000000..ff8435e51af17713998a5c56f723040f48c4164a --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/utils/DatabaseUtils.java @@ -0,0 +1,56 @@ +/* + * 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. + */ + +package ohos.samples.jsfacard.utils; + +import ohos.data.orm.OrmContext; +import ohos.data.orm.OrmPredicates; +import ohos.samples.jsfacard.database.Form; + +import java.util.List; + +/** + * Card Database Operations + * + * @since 2021-08-20 + */ +public class DatabaseUtils { + /** + * delete form data + * + * @param formId form id + * @param connect data connection + */ + public static void deleteFormData(long formId, OrmContext connect) { + OrmPredicates where = connect.where(Form.class); + where.equalTo("formId", formId); + List query = connect.query(where); + if (!query.isEmpty()) { + connect.delete(query.get(0)); + connect.flush(); + } + } + + /** + * insert card info + * + * @param form card object + * @param connect data connection + */ + public static void insertForm(Form form, OrmContext connect) { + connect.insert(form); + connect.flush(); + } +} diff --git a/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/utils/DateUtils.java b/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/utils/DateUtils.java new file mode 100644 index 0000000000000000000000000000000000000000..1a868977a7f057290b02a4936b649752f999f687 --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/utils/DateUtils.java @@ -0,0 +1,77 @@ +/* + * 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. + */ + +package ohos.samples.jsfacard.utils; + +import ohos.utils.zson.ZSONObject; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; + +/** + * Date time util + * + * @since 2021-08-20 + */ +public class DateUtils { + private static final int TIME_LENGTH = 2; + + /** + * current time + * + * @param format format + * @return corresponding format string + */ + public static String getCurrentDate(String format) { + DateFormat dateFormat = new SimpleDateFormat(format); + Date date = new Date(); + return dateFormat.format(date); + } + + /** + * get the data that the page needs + * + * @return corresponding data + */ + public static ZSONObject getZsonObject() { + ZSONObject result = new ZSONObject(); + Calendar now = Calendar.getInstance(); + int hour = now.get(Calendar.HOUR_OF_DAY); + result.put("hour", setTextValue(hour)); + int min = now.get(Calendar.MINUTE); + result.put("min", setTextValue(min)); + int sec = now.get(Calendar.SECOND); + result.put("sec", setTextValue(sec)); + return result; + } + + /** + * set text value + * + * @param now current time + * @return corresponding format string + */ + public static String setTextValue(int now) { + String text = String.valueOf(now); + if (text.length() < TIME_LENGTH) { + text = "0" + text; + } else { + text = text + ""; + } + return text; + } +} diff --git a/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/utils/LogUtils.java b/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/utils/LogUtils.java new file mode 100644 index 0000000000000000000000000000000000000000..bd158aceee966f64615617e65da8c76811907592 --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/java/ohos/samples/jsfacard/utils/LogUtils.java @@ -0,0 +1,74 @@ +/* + * 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. + */ + +package ohos.samples.jsfacard.utils; + +import ohos.hiviewdfx.HiLog; +import ohos.hiviewdfx.HiLogLabel; + +/** + * LogUtils + * + * @since 2021-08-20 + */ +public class LogUtils { + private static final String TAG_LOG = "LogUtil"; + + private static final HiLogLabel LABEL_LOG = new HiLogLabel(0, 0, LogUtils.TAG_LOG); + + private static final String LOG_FORMAT = "%{public}s: %{public}s"; + + private LogUtils() { } + + /** + * Print debug log + * + * @param tag log tag + * @param msg log message + */ + public static void debug(String tag, String msg) { + HiLog.debug(LABEL_LOG, LOG_FORMAT, tag, msg); + } + + /** + * Print info log + * + * @param tag log tag + * @param msg log message + */ + public static void info(String tag, String msg) { + HiLog.info(LABEL_LOG, LOG_FORMAT, tag, msg); + } + + /** + * Print warn log + * + * @param tag log tag + * @param msg log message + */ + public static void warn(String tag, String msg) { + HiLog.warn(LABEL_LOG, LOG_FORMAT, tag, msg); + } + + /** + * Print error log + * + * @param tag log tag + * @param msg log message + */ + public static void error(String tag, String msg) { + HiLog.error(LABEL_LOG, LOG_FORMAT, tag, msg); + } +} diff --git a/JSUI/JsFACard/entry/src/main/js/card/i18n/en-US.json b/JSUI/JsFACard/entry/src/main/js/card/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..95afaba20b6a7458e2da68f1b41b9bcbeabdc6f5 --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/card/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "music": "Music", + "singer": "Singer" + } +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/js/card/i18n/zh-CN.json b/JSUI/JsFACard/entry/src/main/js/card/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..f91dfd0066a88ad7d557e797e88d1f82d806b662 --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/card/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "music": "音乐", + "singer": "歌手" + } +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/js/card/pages/index/index.css b/JSUI/JsFACard/entry/src/main/js/card/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..5afbbcbd9c738803f33d2609f2bde78d293e4b1f --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/card/pages/index/index.css @@ -0,0 +1,79 @@ +/* + * 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 { + flex-direction: column; + justify-content: center; + width: 100%; + height: 100%; +} + +.main-div { + flex-direction: row; + width: 100%; + height: 100%; + align-items: center; + padding: 8% 15px; + min-height: 126px; + max-height: 150px; + display-index: 2; +} + +.main-image { + width: 126px; + aspect-ratio: 1; + border-radius: 14px; + flex-shrink: 0; + display-index: 2; +} + +.right-div { + flex-direction: column; + margin: 13% 0px 0px; + display-index: 1; + width: 154px; + flex-grow: 1; + justify-content: space-evenly; +} + +.bottom-div { + flex-direction: column; + display-index: 1; + height: 100px; + padding-start: 12px; + padding-end: 12px; +} + +.image-div { + justify-content: space-between; +} + +.check-image { + width: 30px; + aspect-ratio: 1; +} + +.music-text { + font-size: 16px; + font-weight: 500; + margin-bottom: 2px; +} + +.singer-text { + font-size: 12px; + opacity: 0.6; + font-weight: normal; + margin-bottom: 24px; +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/js/card/pages/index/index.hml b/JSUI/JsFACard/entry/src/main/js/card/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..76efa47644fa78f4849a60a8a74b2f8121f162fc --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/card/pages/index/index.hml @@ -0,0 +1,41 @@ + + +
+
+ +
+ {{ $t('strings.music') }} + {{ $t('strings.singer') }} + +
+ + + + +
+
+
+
+ {{ $t('strings.music') }} + {{ $t('strings.singer') }} +
+ + + + +
+
+
\ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/js/card/pages/index/index.json b/JSUI/JsFACard/entry/src/main/js/card/pages/index/index.json new file mode 100644 index 0000000000000000000000000000000000000000..73306f9d1be1973475970971ef318ba899e22352 --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/card/pages/index/index.json @@ -0,0 +1,16 @@ +{ + "data": { + "imageSrc": "", + "imageBlueSrc": "" + }, + "actions": { + "activeEvent": { + "action": "message", + "bundleName": "ohos.samples.jsfacard", + "abilityName": "ohos.samples.jsfacard.MainAbility", + "params": { + "message": "add detail" + } + } + } +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/js/clock1x2/pages/index/index.css b/JSUI/JsFACard/entry/src/main/js/clock1x2/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..cd48aac893dde1ca72ee45feaa217eb0b7c8e033 --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/clock1x2/pages/index/index.css @@ -0,0 +1,41 @@ +/* + * 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 { + flex-direction: column; + align-content: center; + align-items: center; + justify-content: center; + background-color: #A4D7E5; +} + +.title { + flex-direction: row; + align-items: center; + align-content: center; + justify-content: center; +} + +.title-text { + margin-right: 7px; + margin-bottom: 3px; + font-size: 10px; + opacity: 0.6; +} + +.time-text { + padding: 1px; + font-size: 16px; + opacity: 1.2; +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/js/clock1x2/pages/index/index.hml b/JSUI/JsFACard/entry/src/main/js/clock1x2/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..f1b3d06517af2b54a8b9e43b261ed2c636b7b2c2 --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/clock1x2/pages/index/index.hml @@ -0,0 +1,29 @@ + + +
+
+
+ {{ $item.title }} +
+
+
+ {{hour}} + : + {{min}} + : + {{sec}} +
+
\ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/js/clock1x2/pages/index/index.json b/JSUI/JsFACard/entry/src/main/js/clock1x2/pages/index/index.json new file mode 100644 index 0000000000000000000000000000000000000000..b5cc755c701ce7a37986915f108f237c3519ae04 --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/clock1x2/pages/index/index.json @@ -0,0 +1,31 @@ +{ + "data": { + "titleList": [ + { + "id": 1, + "title": "HOUR" + }, + { + "id": 2, + "title": "MIN" + }, + { + "id": 3, + "title": "SEC" + } + ], + "hour": "", + "min": "", + "sec": "" + }, + "actions": { + "routerEvent": { + "action": "router", + "bundleName": "ohos.samples.jsfacard", + "abilityName": ".ClockAbility", + "params": { + "message": "add detail" + } + } + } +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/js/default/app.js b/JSUI/JsFACard/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..8e47afff13e928a74fdcc01a108e4422404b9ac9 --- /dev/null +++ b/JSUI/JsFACard/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/JSUI/JsFACard/entry/src/main/js/default/common/images/Wallpaper.png b/JSUI/JsFACard/entry/src/main/js/default/common/images/Wallpaper.png new file mode 100644 index 0000000000000000000000000000000000000000..60d4841a80eb20c63de74306cb7f8350d6a85c48 Binary files /dev/null and b/JSUI/JsFACard/entry/src/main/js/default/common/images/Wallpaper.png differ diff --git a/JSUI/JsFACard/entry/src/main/js/default/i18n/en-US.json b/JSUI/JsFACard/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/js/default/i18n/zh-CN.json b/JSUI/JsFACard/entry/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/js/default/pages/index/index.css b/JSUI/JsFACard/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..d40090fe59f3d152a0ca5128bf51369166f65c23 --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,59 @@ +/* + * 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 { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 40px; + color: #000000; + opacity: 0.9; +} + +@media screen and (device-type: tablet) and (orientation: landscape) { + .title { + font-size: 100px; + } +} + +@media screen and (device-type: wearable) { + .title { + font-size: 28px; + color: #FFFFFF; + } +} + +@media screen and (device-type: tv) { + .container { + background-image: url("../../common/images/Wallpaper.png"); + background-size: cover; + background-repeat: no-repeat; + background-position: center; + } + + .title { + font-size: 100px; + color: #FFFFFF; + } +} + +@media screen and (device-type: phone) and (orientation: landscape) { + .title { + font-size: 60px; + } +} diff --git a/JSUI/JsFACard/entry/src/main/js/default/pages/index/index.hml b/JSUI/JsFACard/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..1902b8746737ba8bd2fb89d049bc56e01878ce23 --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,20 @@ + + +
+ + {{ $t('strings.hello') }} {{ title }} + +
diff --git a/JSUI/JsFACard/entry/src/main/js/default/pages/index/index.js b/JSUI/JsFACard/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..63f1dda0335591afcfdb78c38bae73e4dae4c861 --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/default/pages/index/index.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 { + data: { + title: "" + }, + onInit() { + this.title = this.$t('strings.world'); + } +} diff --git a/JSUI/JsFACard/entry/src/main/js/jscardtemplate/common/ic_default_image.png b/JSUI/JsFACard/entry/src/main/js/jscardtemplate/common/ic_default_image.png new file mode 100644 index 0000000000000000000000000000000000000000..d26a30caccb7c77a7b37f21b0d819cf7b969bf9c Binary files /dev/null and b/JSUI/JsFACard/entry/src/main/js/jscardtemplate/common/ic_default_image.png differ diff --git a/JSUI/JsFACard/entry/src/main/js/jscardtemplate/i18n/en-US.json b/JSUI/JsFACard/entry/src/main/js/jscardtemplate/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..06a27810eba3ed5c5c5b168afcf1645f27e14d15 --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/jscardtemplate/i18n/en-US.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "Hello", + "world": "World", + "title": "Title", + "text": "Text" + } +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/js/jscardtemplate/i18n/zh-CN.json b/JSUI/JsFACard/entry/src/main/js/jscardtemplate/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..9e396b2954f8d05c54897834f30d5155d3cfcd19 --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/jscardtemplate/i18n/zh-CN.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "您好", + "world": "世界", + "title": "标题", + "text": "文本" + } +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/js/jscardtemplate/pages/index/index.css b/JSUI/JsFACard/entry/src/main/js/jscardtemplate/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..e9c6b9ff37089c645af63d7b939323848e03d15f --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/jscardtemplate/pages/index/index.css @@ -0,0 +1,73 @@ +/* + * 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 { + flex-direction: column; + width: 100%; + height: 100%; +} + +.header-div { + width: 100%; + height: 50%; + flex-shrink: 0; + background-color: dodgerblue; + border-top-left-radius: 14px; + border-top-right-radius: 14px; + flex-direction: column; + justify-content: flex-end; + padding: 12px; +} + +.header-title { + font-size: 16px; + font-weight: 500; + margin-bottom: 2px; + color: white; +} + +.header-description { + font-size: 14px; + color: white; +} + +.foot-div { + justify-content: space-evenly; + align-items: center; + width: 100%; + height: 50%; + flex-direction: row; + flex-shrink: 0; +} + +.item-div { + flex-direction: column; + height: 100%; + width: 84px; + justify-content: center; + align-items: center; +} + +.item-image { + width: 84px; + height: 126px; + border-radius: 14px; +} + +.item-title { + font-size: 14px; + font-weight: 500; + margin-top: 2px; +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/js/jscardtemplate/pages/index/index.hml b/JSUI/JsFACard/entry/src/main/js/jscardtemplate/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..da1eab6a4f7e4a6cc5e009fce17f506c8dc85b1a --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/jscardtemplate/pages/index/index.hml @@ -0,0 +1,43 @@ + + +
+
+ {{ $t('strings.title') }} + {{ $t('strings.text') }} +
+
+
+ + {{ $t('strings.title') }} +
+
+ + {{ $t('strings.title') }} +
+
+ + {{ $t('strings.title') }} +
+
+ + {{ $t('strings.title') }} +
+
+ + {{ $t('strings.title') }} +
+
+
\ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/js/jscardtemplate/pages/index/index.json b/JSUI/JsFACard/entry/src/main/js/jscardtemplate/pages/index/index.json new file mode 100644 index 0000000000000000000000000000000000000000..d9421ac5eb3962743df770a9c3155b738b4c5ab6 --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/jscardtemplate/pages/index/index.json @@ -0,0 +1,13 @@ +{ + "data": {}, + "actions": { + "activeEvent": { + "action": "message", + "bundleName": "ohos.samples.jsfacard", + "abilityName": "ohos.samples.jsfacard.MainAbility", + "params": { + "message": "add detail" + } + } + } +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/common/ic_default_image.png b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/common/ic_default_image.png new file mode 100644 index 0000000000000000000000000000000000000000..3af559f74358e9f54aebbb6f765bf9f5f493760e Binary files /dev/null and b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/common/ic_default_image.png differ diff --git a/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/common/ic_favor.svg b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/common/ic_favor.svg new file mode 100644 index 0000000000000000000000000000000000000000..4316e98b18cabfb99b6aad5368f32362fa467b12 --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/common/ic_favor.svg @@ -0,0 +1,31 @@ + + + Public/ic_public_favor_filled + + + + + + + + + + \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/common/ic_ranking.svg b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/common/ic_ranking.svg new file mode 100644 index 0000000000000000000000000000000000000000..faa46fc72cf8086e0f34ea99b8fbc00eedcd310b --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/common/ic_ranking.svg @@ -0,0 +1,29 @@ + + + + + + + + + diff --git a/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/common/ic_recommend.svg b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/common/ic_recommend.svg new file mode 100644 index 0000000000000000000000000000000000000000..205a88c0405902a92d5e36060eef257e37287cf4 --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/common/ic_recommend.svg @@ -0,0 +1,25 @@ + + + + + + + + + diff --git a/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/common/ic_search.svg b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/common/ic_search.svg new file mode 100644 index 0000000000000000000000000000000000000000..81beb56fd3b36415f3afaabe32e5bad38d97fd9c --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/common/ic_search.svg @@ -0,0 +1,31 @@ + + + Public/ic_public_search_filled + + + + + + + + + + \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/common/pause.svg b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/common/pause.svg new file mode 100644 index 0000000000000000000000000000000000000000..ff1be4c8181ee5cf630e102017a18cae92712dfb --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/common/pause.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/common/play.svg b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/common/play.svg new file mode 100644 index 0000000000000000000000000000000000000000..2decbc95faeaf8b29b2fdc643b14814232c3eccd --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/common/play.svg @@ -0,0 +1,31 @@ + + + Public/ic_public_play_norm + + + + + + + + + + \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/i18n/en-US.json b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..fe5f405e2084dcbda33caaa669b899a2319d1e7c --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/i18n/en-US.json @@ -0,0 +1,8 @@ +{ + "strings": { + "search": "search", + "favor": "favor", + "recommend": "search", + "ranking": "favor" + } +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/i18n/zh-CN.json b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..58ba2a5b8fe8166c7911f51a5a842f4ff692a99f --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/i18n/zh-CN.json @@ -0,0 +1,8 @@ +{ + "strings": { + "search": "搜索", + "favor": "喜欢", + "recommend": "推荐", + "ranking": "排行" + } +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/pages/index/index.css b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..b8bd80ecb76510c01bce4896e81bc84ef3f71b22 --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/pages/index/index.css @@ -0,0 +1,116 @@ +/* + * 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. + */ + +.background { + width: 100%; + height: 100%; + background-image: url("/common/ic_default_image.png"); +} + +.container { + width: 100%; + height: 100%; + background-color: #4D000000; + align-items: center; + backdrop-filter: blur(2px); + padding: 12px 0px 0px 12px; +} + +.cover-image { + flex-shrink: 0; + flex-weight: 3; + min-width: 126px; + margin-right: 12px; + height: 100%; + margin-bottom: 12px; + display: flex; + justify-content: center; + align-items: center; + align-content: center; +} + +.default_image { + border-radius: 14px; +} + +.status-image { + width: 32px; + height: 32px; +} + +.absolute-text { + font-size: 16px; + color: white; + position: absolute; + left: 12px; + bottom: 18px; +} + +.absolute-button { + color: white; + position: absolute; + left: 12px; + bottom: 18px; +} + +.main-div { + flex-direction: column; + flex-weight: 2; + min-width: 75px; + margin-right: 12px; + justify-content: space-between; +} + +.wrap-div { + flex-weight: 1; + margin-bottom: 12px; + background-color: #19FFFFFF; + border-radius: 14px; + width: 100%; + min-height: 46px; + flex-wrap: wrap; + flex-direction: column; + justify-content: center; + align-content: center; + align-items: center; +} + +.image-div { + width: 24px; + aspect-ratio: 1; + flex-shrink: 0; + justify-content: center; + align-content: center; + align-items: center; +} + +.image-text { + font-size: 12px; + color: white; + text-align: center; + margin: 0px 12px; +} + +.large-display-index { + display-index: 3; +} + +.medium-display-index { + display-index: 2; +} + +.small-display-index { + display-index: 1; +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/pages/index/index.hml b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..ffb67320bc886addf90a5b61ec1abb6f5b0eac5e --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/pages/index/index.hml @@ -0,0 +1,60 @@ + + +
+
+ + + + +
+
+ + {{ $t('strings.search') }} +
+
+ + {{ $t('strings.favor') }} +
+
+ + {{ $t('strings.ranking') }} +
+
+ + {{ $t('strings.recommend') }} +
+
+ +
+
+ + {{ $t('strings.ranking') }} +
+
+ + {{ $t('strings.recommend') }} +
+
+ + {{ $t('strings.favor') }} +
+
+ + {{ $t('strings.search') }} +
+
+
+
\ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/pages/index/index.json b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/pages/index/index.json new file mode 100644 index 0000000000000000000000000000000000000000..f07bbdec9fa4f1315ee359cafdbe8e54d4a9a48b --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/js/jsmusictemplate/pages/index/index.json @@ -0,0 +1,13 @@ +{ + "data": { + "status": "play" + }, + "actions": { + "messageEvent": { + "action": "message", + "params": { + "message": "music change status" + } + } + } +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/resources/base/element/string.json b/JSUI/JsFACard/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1bc16f7a67d1342f8c6947ff2772e3e8faf76984 --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/resources/base/element/string.json @@ -0,0 +1,48 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "JsFACard" + }, + { + "name": "app_name", + "value": "JsFACard" + }, + { + "name": "mainability_description", + "value": "Java_Empty Ability" + }, + { + "name": "clockability_description", + "value": "Java_Empty Ability" + }, + { + "name": "hour", + "value": "HOUR" + }, + { + "name": "min", + "value": "MIN" + }, + { + "name": "sec", + "value": "SEC" + }, + { + "name": "time", + "value": "00" + }, + { + "name": "symbol", + "value": ":" + }, + { + "name": "text_font", + "value": "HwChinese-medium" + }, + { + "name": "timerability_description", + "value": "hap sample empty service" + } + ] +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/resources/base/graphic/background_ability_clock.xml b/JSUI/JsFACard/entry/src/main/resources/base/graphic/background_ability_clock.xml new file mode 100644 index 0000000000000000000000000000000000000000..e5413eb29c94f089b8f5e88196566a1d623c09cb --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/resources/base/graphic/background_ability_clock.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/resources/base/layout/timer_progress_clock_1x2.xml b/JSUI/JsFACard/entry/src/main/resources/base/layout/timer_progress_clock_1x2.xml new file mode 100644 index 0000000000000000000000000000000000000000..a6788d5aed592776fab373758051a00584a9eef6 --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/resources/base/layout/timer_progress_clock_1x2.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/resources/base/media/ic_blue.svg b/JSUI/JsFACard/entry/src/main/resources/base/media/ic_blue.svg new file mode 100644 index 0000000000000000000000000000000000000000..79fb28c566dd90caa2725bd6841d5bac6c1f262e --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/resources/base/media/ic_blue.svg @@ -0,0 +1,25 @@ + + + + Public/ic_public_list_add_light + Created with Sketch. + + + + + \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/resources/base/media/ic_image.png b/JSUI/JsFACard/entry/src/main/resources/base/media/ic_image.png new file mode 100644 index 0000000000000000000000000000000000000000..872f8b8808cd8e60b9bf393e39ba5526e9db5b30 Binary files /dev/null and b/JSUI/JsFACard/entry/src/main/resources/base/media/ic_image.png differ diff --git a/JSUI/JsFACard/entry/src/main/resources/base/media/icon.png b/JSUI/JsFACard/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/JSUI/JsFACard/entry/src/main/resources/base/media/icon.png differ diff --git a/JSUI/JsFACard/entry/src/main/resources/en/element/string.json b/JSUI/JsFACard/entry/src/main/resources/en/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..03fe01d7df836107537ae7b46fa88e150185381e --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/resources/en/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "JsFACard" + }, + { + "name": "app_name", + "value": "JsFACard" + }, + { + "name": "clockability_description", + "value": "Java_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/JSUI/JsFACard/entry/src/main/resources/zh/element/string.json b/JSUI/JsFACard/entry/src/main/resources/zh/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..6afa3dd6f3f01ef976c52e47c20b409d94d4c05a --- /dev/null +++ b/JSUI/JsFACard/entry/src/main/resources/zh/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "Js卡片" + }, + { + "name": "clockability_description", + "value": "Java_Empty Ability" + }, + { + "name": "app_name", + "value": "Js卡片" + } + ] +} \ No newline at end of file diff --git a/JSUI/JsFACard/screenshots/device/Card.png b/JSUI/JsFACard/screenshots/device/Card.png new file mode 100644 index 0000000000000000000000000000000000000000..601edc117dd7831b030649c9d5fc2f61367dbd04 Binary files /dev/null and b/JSUI/JsFACard/screenshots/device/Card.png differ diff --git "a/JSUI/JsFACard/screenshots/device/Clock1\303\2272.png" "b/JSUI/JsFACard/screenshots/device/Clock1\303\2272.png" new file mode 100644 index 0000000000000000000000000000000000000000..442aff8184581a774d54d04678d1682c14aaed69 Binary files /dev/null and "b/JSUI/JsFACard/screenshots/device/Clock1\303\2272.png" differ diff --git a/JSUI/JsFACard/screenshots/device/JsCardTemplate.png b/JSUI/JsFACard/screenshots/device/JsCardTemplate.png new file mode 100644 index 0000000000000000000000000000000000000000..cb083b0528a2ef53f0a34f8ebca66e458d782d89 Binary files /dev/null and b/JSUI/JsFACard/screenshots/device/JsCardTemplate.png differ diff --git a/JSUI/JsFACard/screenshots/device/JsMusicTemplate.png b/JSUI/JsFACard/screenshots/device/JsMusicTemplate.png new file mode 100644 index 0000000000000000000000000000000000000000..9cdd1d176c58168c66b4c7ff0247f1e47f69c620 Binary files /dev/null and b/JSUI/JsFACard/screenshots/device/JsMusicTemplate.png differ diff --git a/JSUI/JsFACard/settings.gradle b/JSUI/JsFACard/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..4773db73233a570c2d0c01a22e75321acfbf7a07 --- /dev/null +++ b/JSUI/JsFACard/settings.gradle @@ -0,0 +1 @@ +include ':entry' diff --git a/JSUI/JsGallery/README.md b/JSUI/JsGallery/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7c0ae15078e4a26623c12beb9f642f65bdb2bd82 --- /dev/null +++ b/JSUI/JsGallery/README.md @@ -0,0 +1,8 @@ +# Example Gallery App + +- This example JS-based gallery app offers the photo browsing and editing functions. It uses the lazy loading feature to improve performance. You can add or replace image resources as needed to build your own gallery. This example applies to large systems \(reference memory ≥ 1 GB\). + 1. The initial page consists of 200 images, which are displayed in eight columns. + 2. An icon is provided in the upper right corner for you to switch between 4, 8, and 12 columns. + 3. A **Settings** button is provided in the upper left corner for you to access the **Settings** page. After you set the number of columns and the total number of images and click **OK**, the home page is updated according to your settings. + + diff --git a/JSUI/JsGallery/README_zh.md b/JSUI/JsGallery/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..3f8a183b3b7e21769724e9880a62e9bf2e7bdf59 --- /dev/null +++ b/JSUI/JsGallery/README_zh.md @@ -0,0 +1,6 @@ +# 图库示例应用 + +- 该应用是一个仿图库的JS应用,模拟多图片场景,使用了懒加载特性,开发者可自行添加或者更换图片资源,构建自己的多图场景。适用于大型系统(参考内存≥1GiB)。 + 1. 初始页面由200张图片组成,显示为8列。 + 2. 点击右上角的图标,可以在4、8、12列之间切换。 + 3. 点击左上角的“设置”,可以进入设置页面,可以动态输入需要设置的列数和图片总数,点击“确定”返回主页面,图片布局刷新。 diff --git a/JSUI/JsGallery/build.gradle b/JSUI/JsGallery/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..4e8a6aadbd114fd91535e3347c8a293ad0fab769 --- /dev/null +++ b/JSUI/JsGallery/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' + +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } +} + +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.2' + } +} + +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + jcenter() + } +} + diff --git a/JSUI/JsGallery/entry/build.gradle b/JSUI/JsGallery/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..83f59debbd68242b503a22270f4378d7843ca204 --- /dev/null +++ b/JSUI/JsGallery/entry/build.gradle @@ -0,0 +1,19 @@ +apply plugin: 'com.huawei.ohos.hap' +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) +} \ No newline at end of file diff --git a/JSUI/JsGallery/entry/src/main/config.json b/JSUI/JsGallery/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..65faa20e39f118c1de17fbcc1bf66deb31a0f4c6 --- /dev/null +++ b/JSUI/JsGallery/entry/src/main/config.json @@ -0,0 +1,58 @@ +{ + "app": { + "bundleName": "ohos.samples.gallery", + "vendor": "samples", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.samples.gallery", + "name": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": ".MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index", + "pages/index/setPage/setPage", + "pages/index/bigimg/bigimg" + ], + "name": "default", + "window": { + "designWidth": 750, + "autoDesignWidth": true + } + } + ] + } +} \ No newline at end of file diff --git a/JSUI/JsGallery/entry/src/main/java/ohos/samples/gallery/MainAbility.java b/JSUI/JsGallery/entry/src/main/java/ohos/samples/gallery/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..cf5427d10d45de552626cc263263ca7f8f0bc86a --- /dev/null +++ b/JSUI/JsGallery/entry/src/main/java/ohos/samples/gallery/MainAbility.java @@ -0,0 +1,31 @@ +/* + * 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. + */ +package ohos.samples.gallery; + +import ohos.ace.ability.AceAbility; +import ohos.aafwk.content.Intent; + +public class MainAbility extends AceAbility { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + } + + @Override + public void onStop() { + super.onStop(); + } + +} diff --git a/JSUI/JsGallery/entry/src/main/js/default/app.js b/JSUI/JsGallery/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..c158442201abb1888ae8fb1d57f150c5ec26c36b --- /dev/null +++ b/JSUI/JsGallery/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * 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/JSUI/JsGallery/entry/src/main/js/default/common/arrow.png b/JSUI/JsGallery/entry/src/main/js/default/common/arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..46b3637c4726543fa3466c8c7bbdcf9c148c8d5a Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/arrow.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0001.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0001.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0001.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0002.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0002.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0002.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0003.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0003.png new file mode 100644 index 0000000000000000000000000000000000000000..5368e02988a816b6f9fe59f5082c1f206ebc18c1 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0003.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0004.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0004.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0004.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0005.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0005.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0005.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0006.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0006.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0006.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0007.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0007.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0007.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0008.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0008.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0008.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0009.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0009.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0009.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0010.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0010.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0010.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0011.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0011.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0011.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0012.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0012.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0012.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0013.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0013.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0013.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0014.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0014.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0014.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0015.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0015.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0015.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0016.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0016.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0016.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0017.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0017.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0017.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0018.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0018.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0018.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0019.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0019.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0019.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0020.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0020.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0020.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0021.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0021.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0021.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0022.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0022.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0022.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0023.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0023.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0023.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0024.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0024.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0024.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0025.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0025.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0025.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0026.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0026.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0026.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0027.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0027.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0027.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0028.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0028.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0028.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0029.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0029.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0029.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0030.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0030.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0030.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0031.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0031.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd12c6d4eebca7adc2f5518607f95eb2b643724 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0031.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0032.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0032.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd12c6d4eebca7adc2f5518607f95eb2b643724 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0032.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0033.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0033.png new file mode 100644 index 0000000000000000000000000000000000000000..5368e02988a816b6f9fe59f5082c1f206ebc18c1 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0033.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0034.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0034.png new file mode 100644 index 0000000000000000000000000000000000000000..5368e02988a816b6f9fe59f5082c1f206ebc18c1 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0034.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0035.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0035.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0035.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0036.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0036.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0036.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0037.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0037.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0037.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0038.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0038.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0038.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0039.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0039.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0039.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0040.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0040.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0040.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0041.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0041.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0041.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0042.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0042.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd12c6d4eebca7adc2f5518607f95eb2b643724 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0042.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0043.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0043.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd12c6d4eebca7adc2f5518607f95eb2b643724 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0043.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0044.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0044.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd12c6d4eebca7adc2f5518607f95eb2b643724 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0044.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0045.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0045.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd12c6d4eebca7adc2f5518607f95eb2b643724 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0045.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0046.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0046.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0046.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0047.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0047.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd12c6d4eebca7adc2f5518607f95eb2b643724 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0047.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0048.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0048.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd12c6d4eebca7adc2f5518607f95eb2b643724 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0048.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0049.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0049.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd12c6d4eebca7adc2f5518607f95eb2b643724 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0049.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0050.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0050.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd12c6d4eebca7adc2f5518607f95eb2b643724 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0050.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0051.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0051.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd12c6d4eebca7adc2f5518607f95eb2b643724 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0051.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0052.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0052.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd12c6d4eebca7adc2f5518607f95eb2b643724 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0052.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0053.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0053.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd12c6d4eebca7adc2f5518607f95eb2b643724 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0053.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0054.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0054.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd12c6d4eebca7adc2f5518607f95eb2b643724 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0054.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0055.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0055.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd12c6d4eebca7adc2f5518607f95eb2b643724 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0055.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0056.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0056.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd12c6d4eebca7adc2f5518607f95eb2b643724 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0056.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0057.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0057.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0057.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0058.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0058.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd12c6d4eebca7adc2f5518607f95eb2b643724 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0058.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0059.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0059.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd12c6d4eebca7adc2f5518607f95eb2b643724 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0059.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0060.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0060.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd12c6d4eebca7adc2f5518607f95eb2b643724 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0060.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0061.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0061.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd12c6d4eebca7adc2f5518607f95eb2b643724 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0061.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0062.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0062.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd12c6d4eebca7adc2f5518607f95eb2b643724 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0062.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0063.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0063.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd12c6d4eebca7adc2f5518607f95eb2b643724 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0063.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0064.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0064.png new file mode 100644 index 0000000000000000000000000000000000000000..5368e02988a816b6f9fe59f5082c1f206ebc18c1 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0064.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0065.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0065.png new file mode 100644 index 0000000000000000000000000000000000000000..5368e02988a816b6f9fe59f5082c1f206ebc18c1 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0065.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0066.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0066.png new file mode 100644 index 0000000000000000000000000000000000000000..5368e02988a816b6f9fe59f5082c1f206ebc18c1 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0066.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0067.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0067.png new file mode 100644 index 0000000000000000000000000000000000000000..5368e02988a816b6f9fe59f5082c1f206ebc18c1 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0067.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0068.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0068.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0068.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0069.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0069.png new file mode 100644 index 0000000000000000000000000000000000000000..5368e02988a816b6f9fe59f5082c1f206ebc18c1 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0069.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0070.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0070.png new file mode 100644 index 0000000000000000000000000000000000000000..5368e02988a816b6f9fe59f5082c1f206ebc18c1 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0070.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0071.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0071.png new file mode 100644 index 0000000000000000000000000000000000000000..5368e02988a816b6f9fe59f5082c1f206ebc18c1 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0071.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0072.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0072.png new file mode 100644 index 0000000000000000000000000000000000000000..5368e02988a816b6f9fe59f5082c1f206ebc18c1 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0072.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0073.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0073.png new file mode 100644 index 0000000000000000000000000000000000000000..5368e02988a816b6f9fe59f5082c1f206ebc18c1 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0073.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0074.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0074.png new file mode 100644 index 0000000000000000000000000000000000000000..5368e02988a816b6f9fe59f5082c1f206ebc18c1 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0074.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0075.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0075.png new file mode 100644 index 0000000000000000000000000000000000000000..5368e02988a816b6f9fe59f5082c1f206ebc18c1 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0075.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0076.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0076.png new file mode 100644 index 0000000000000000000000000000000000000000..5368e02988a816b6f9fe59f5082c1f206ebc18c1 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0076.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0077.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0077.png new file mode 100644 index 0000000000000000000000000000000000000000..5368e02988a816b6f9fe59f5082c1f206ebc18c1 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0077.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0078.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0078.png new file mode 100644 index 0000000000000000000000000000000000000000..5368e02988a816b6f9fe59f5082c1f206ebc18c1 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0078.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0079.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0079.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0079.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0080.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0080.png new file mode 100644 index 0000000000000000000000000000000000000000..5368e02988a816b6f9fe59f5082c1f206ebc18c1 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0080.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0081.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0081.png new file mode 100644 index 0000000000000000000000000000000000000000..5368e02988a816b6f9fe59f5082c1f206ebc18c1 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0081.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0082.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0082.png new file mode 100644 index 0000000000000000000000000000000000000000..5368e02988a816b6f9fe59f5082c1f206ebc18c1 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0082.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0083.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0083.png new file mode 100644 index 0000000000000000000000000000000000000000..5368e02988a816b6f9fe59f5082c1f206ebc18c1 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0083.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0084.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0084.png new file mode 100644 index 0000000000000000000000000000000000000000..5368e02988a816b6f9fe59f5082c1f206ebc18c1 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0084.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0085.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0085.png new file mode 100644 index 0000000000000000000000000000000000000000..5368e02988a816b6f9fe59f5082c1f206ebc18c1 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0085.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0086.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0086.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0086.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0087.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0087.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0087.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0088.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0088.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0088.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0089.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0089.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0089.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0090.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0090.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0090.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0091.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0091.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0091.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0092.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0092.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0092.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0093.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0093.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0093.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0094.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0094.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0094.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0095.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0095.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0095.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0096.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0096.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0096.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0097.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0097.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0097.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0098.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0098.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0098.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0099.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0099.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0099.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0100.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0100.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0100.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0101.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0101.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0101.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0102.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0102.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0102.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0103.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0103.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0103.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0104.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0104.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0104.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0105.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0105.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0105.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0106.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0106.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0106.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0107.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0107.png new file mode 100644 index 0000000000000000000000000000000000000000..69c6caacfe57c4d974502a8419ad5a7831661a2b Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0107.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0108.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0108.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0108.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0109.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0109.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0109.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0110.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0110.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0110.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0111.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0111.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0111.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0112.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0112.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0112.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0113.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0113.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0113.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0114.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0114.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0114.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0115.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0115.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0115.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0116.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0116.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0116.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0117.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0117.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0117.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0118.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0118.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0118.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0119.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0119.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0119.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0120.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0120.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0120.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0121.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0121.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0121.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0122.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0122.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0122.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0123.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0123.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0123.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0124.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0124.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0124.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0125.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0125.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0125.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0126.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0126.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0126.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0127.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0127.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0127.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0128.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0128.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0128.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0129.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0129.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0129.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0130.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0130.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0130.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0131.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0131.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0131.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0132.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0132.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0132.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0133.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0133.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0133.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0134.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0134.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0134.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0135.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0135.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0135.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0136.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0136.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0136.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0137.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0137.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0137.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0138.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0138.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0138.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0139.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0139.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0139.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0140.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0140.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0140.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0141.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0141.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0141.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0142.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0142.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0142.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0143.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0143.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0143.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0144.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0144.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0144.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0145.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0145.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0145.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0146.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0146.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0146.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0147.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0147.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0147.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0148.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0148.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0148.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0149.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0149.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0149.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0150.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0150.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0150.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0151.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0151.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0151.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0152.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0152.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0152.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0153.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0153.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0153.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0154.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0154.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0154.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0155.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0155.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0155.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0156.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0156.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0156.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0157.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0157.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0157.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0158.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0158.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0158.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0159.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0159.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0159.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0160.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0160.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0160.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0161.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0161.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0161.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0162.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0162.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0162.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0163.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0163.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0163.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0164.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0164.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0164.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0165.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0165.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0165.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0166.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0166.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0166.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0167.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0167.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0167.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0168.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0168.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0168.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0169.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0169.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0169.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0170.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0170.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0170.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0171.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0171.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0171.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0172.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0172.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0172.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0173.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0173.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0173.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0174.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0174.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0174.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0175.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0175.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0175.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0176.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0176.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0176.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0177.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0177.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0177.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0178.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0178.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0178.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0179.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0179.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0179.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0180.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0180.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0180.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0181.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0181.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0181.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0182.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0182.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0182.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0183.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0183.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0183.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0184.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0184.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0184.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0185.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0185.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0185.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0186.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0186.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0186.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0187.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0187.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0187.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0188.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0188.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0188.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0189.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0189.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0189.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0190.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0190.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0190.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0191.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0191.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0191.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0192.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0192.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0192.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0193.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0193.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0193.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0194.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0194.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0194.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0195.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0195.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0195.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0196.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0196.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0196.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0197.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0197.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0197.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0198.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0198.png new file mode 100644 index 0000000000000000000000000000000000000000..cf963d769f6a8d0768be96236239795c70666809 Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0198.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0199.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0199.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0199.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0200.png b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0200.png new file mode 100644 index 0000000000000000000000000000000000000000..06caf27ffa9c1684f41b5e6381789c2890c195ba Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/image/LOADPIC_0200.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/setlayout.png b/JSUI/JsGallery/entry/src/main/js/default/common/setlayout.png new file mode 100644 index 0000000000000000000000000000000000000000..5414f0cbf90a54976f3f227b439f618057208e3c Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/setlayout.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/common/tip.png b/JSUI/JsGallery/entry/src/main/js/default/common/tip.png new file mode 100644 index 0000000000000000000000000000000000000000..bfddb0c8b1d824c808bcc2eef116802e1ce9d36f Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/js/default/common/tip.png differ diff --git a/JSUI/JsGallery/entry/src/main/js/default/i18n/en-US.json b/JSUI/JsGallery/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..55561b83737c3c31d082fbfa11e5fc987a351104 --- /dev/null +++ b/JSUI/JsGallery/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + }, + "Files": { + } +} \ No newline at end of file diff --git a/JSUI/JsGallery/entry/src/main/js/default/i18n/gallery.json b/JSUI/JsGallery/entry/src/main/js/default/i18n/gallery.json new file mode 100644 index 0000000000000000000000000000000000000000..94c2c7637ef27680c672dfde62e37389a5b3bc6b --- /dev/null +++ b/JSUI/JsGallery/entry/src/main/js/default/i18n/gallery.json @@ -0,0 +1,9 @@ +{ + "itemCount": 200, + "shrink": false, + "numColumns": { + "orderedByDays": 8, + "orderedByMonths": 4, + "orderedByYears": 10 + } +} \ No newline at end of file diff --git a/JSUI/JsGallery/entry/src/main/js/default/i18n/zh-CN.json b/JSUI/JsGallery/entry/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..cce1af06761a42add0cac1a0567aa3237eda8cb4 --- /dev/null +++ b/JSUI/JsGallery/entry/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + }, + "Files": { + } +} \ No newline at end of file diff --git a/JSUI/JsGallery/entry/src/main/js/default/pages/index/bigimg/bigimg.css b/JSUI/JsGallery/entry/src/main/js/default/pages/index/bigimg/bigimg.css new file mode 100644 index 0000000000000000000000000000000000000000..ad04cff512e5f8fb959aca38c58bf1a933495218 --- /dev/null +++ b/JSUI/JsGallery/entry/src/main/js/default/pages/index/bigimg/bigimg.css @@ -0,0 +1,78 @@ +/* + * 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 { + flex-direction: column; + align-items: center; + justify-content: center; + background-color: #000000; + height: 100%; +} +stack { + align-items: center; + justify-content: center; + width: 100%; + height: 95%; +} +.content { + align-items: center; + justify-content: center; + width: 100%; + height: 100%; +} +.content>image { + width: 90%; + height: 60%; + object-fit: cover; +} +image { + object-fit: contain; +} +.top { + background-color: rgb(10, 154, 255); + padding: 0px 20px; + width: 100%; + height: 7%; + justify-content: space-between; + align-items: center; +} +.icons-div { + width: 15%; +} +.icon { + height: 50px; + width: 20px; + object-fit: contain; +} +.positiondiv { + width: 100%; + height: 100%; + flex-direction: column; + background-color: #80000000; + justify-content: center; + align-items: center; +} +.positiondiv div { + justify-content: center; + align-items: center; +} +.positiondiv text { + text-align: center; + font-size: 15px; + color: #FFFFFF; +} +.hidetext { + padding: 10px 20px; + border: 1px solid #FFFFFF; +} \ No newline at end of file diff --git a/JSUI/JsGallery/entry/src/main/js/default/pages/index/bigimg/bigimg.hml b/JSUI/JsGallery/entry/src/main/js/default/pages/index/bigimg/bigimg.hml new file mode 100644 index 0000000000000000000000000000000000000000..119d5fa236c872b74f5eca6245e242e3696b7e55 --- /dev/null +++ b/JSUI/JsGallery/entry/src/main/js/default/pages/index/bigimg/bigimg.hml @@ -0,0 +1,44 @@ + +
+
+
+ +
+ +
+ +
+ +
+
+
+ + + File information + +
+ + LOADPIC_{{imgsrc}} + + {{width}}X{{height}} + + + Close Info Overlay + +
+
+
\ No newline at end of file diff --git a/JSUI/JsGallery/entry/src/main/js/default/pages/index/bigimg/bigimg.js b/JSUI/JsGallery/entry/src/main/js/default/pages/index/bigimg/bigimg.js new file mode 100644 index 0000000000000000000000000000000000000000..1225626a12e2b7934a462a5079e824fdc6c8ff33 --- /dev/null +++ b/JSUI/JsGallery/entry/src/main/js/default/pages/index/bigimg/bigimg.js @@ -0,0 +1,39 @@ +/* + * 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. + */ +import router from '@system.router' +export default { + data:{ + imgsrc: '', + width:'', + height:'', + display:false + }, + onInit() { + this.imgsrc=this.url; + }, + loadComplete(e){ + this.width=e.width; + this.height=e.height; + }, + back() { + router.back(); + }, + showInfo(){ + this.display=true; + }, + hideInfo(){ + this.display=false; + }, +} \ No newline at end of file diff --git a/JSUI/JsGallery/entry/src/main/js/default/pages/index/index.css b/JSUI/JsGallery/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..b0de285d3d58334257b8394706da8d588d5b59c7 --- /dev/null +++ b/JSUI/JsGallery/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,52 @@ +/* + * 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 { + flex-direction: column; + align-items: center; + width: 100%; +} +.top { + background-color: rgba(30, 144, 255, 0.7); + padding: 0px 20px; + width: 100%; + height: 8%; + justify-content: space-between; + align-items: center; +} +.icons-div { + width: 15%; +} +.icon { + height: 50px; + width: 20px; + object-fit: contain; +} +.operating { + align-items: center; + justify-content: space-between; +} +.operating text { + color: #FFFFFF; + font-size: 22px; +} +.imgs { + object-fit: cover; + border: 1px solid #10808080; +} +.colnum { + width: 20px; + height: 20px; + object-fit: contain; +} \ No newline at end of file diff --git a/JSUI/JsGallery/entry/src/main/js/default/pages/index/index.hml b/JSUI/JsGallery/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..b9c79015a29cbe34ecbc7e35f6928750aff7e080 --- /dev/null +++ b/JSUI/JsGallery/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,32 @@ + +
+
+
+ +
+
+ 设置 + +
+
+ + + + + +
\ No newline at end of file diff --git a/JSUI/JsGallery/entry/src/main/js/default/pages/index/index.js b/JSUI/JsGallery/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..67b51d4d5b04b504fd1c62cedbec56af03aea856 --- /dev/null +++ b/JSUI/JsGallery/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,103 @@ +/* + * 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. + */ +import router from '@system.router' +import gallerydata from '../../i18n/gallery.json' + +var i = 0; + +export default { + data: { + columns: 8, + imgsrc: [], + repeatedlength: 5000, + tempList: [], + beginIndex: 0, + endIndex: 0, + passValue: false, + height: '', + }, + onInit() { + this.passValue = this.pass; + if (this.passValue === true) { + this.columns = this.message[0]; + this.repeatedlength = this.message[1]; + this.height = 375 / this.message[0]; + } else { + this.imgtype = gallerydata.shrink; + this.columns = gallerydata.numColumns.orderedByDays; + this.repeatedlength = gallerydata.itemCount; + this.height = 375 / gallerydata.numColumns.orderedByDays; + } + if (this.imgtype === true) { + for (var i = 1;i <= 200; i++) { + this.imgsrc.push({ + SourceFile: '/common/image/LOADPIC_' + ('0000' + i).slice(-4) + '.png', + order: i + }) + } + } else { + for (var j = 1;j <= 200; j++) { + this.imgsrc.push({ + SourceFile: '/common/image/LOADPIC_' + ('0000' + j).slice(-4) + '.png', + order: j + }) + } + } + }, + redirectSetting(){ + router.push({ + uri:'pages/index/setPage/setPage' + }) + }, + back() { + router.back(); + }, + setColumn() { + i++; + if (i % 3 === 0) { + this.columns = gallerydata.numColumns.orderedByDays; + this.height = 375 / gallerydata.numColumns.orderedByDays; + } else if (i % 3 === 1) { + this.columns = gallerydata.numColumns.orderedByMonths; + this.height = 375 / gallerydata.numColumns.orderedByMonths; + } else { + this.columns = gallerydata.numColumns.orderedByYears; + this.height = 375 / gallerydata.numColumns.orderedByYears; + } + }, + redirect(e) { + var imgsrc = e.target.attr.data; + router.push({ + uri: 'pages/index/bigimg/bigimg', + params: { + url: imgsrc + } + }); + }, + buildItem(param) { + if (this.imgsrc.length == 0) { + return; + } + this.beginIndex = param.begin; + this.endIndex = param.end; + let tempArray = []; + for (let index = this.beginIndex;index < this.endIndex; ++index) { + let tempIndex = index % this.imgsrc.length; + let tempValue = JSON.parse(JSON.stringify(this.imgsrc[tempIndex])); + tempArray.push(tempValue); + } + this.tempList = tempArray; + } +} \ No newline at end of file diff --git a/JSUI/JsGallery/entry/src/main/js/default/pages/index/setPage/setPage.css b/JSUI/JsGallery/entry/src/main/js/default/pages/index/setPage/setPage.css new file mode 100644 index 0000000000000000000000000000000000000000..8e87abcaef5a690aa1a261e14c596da6bddb6fdd --- /dev/null +++ b/JSUI/JsGallery/entry/src/main/js/default/pages/index/setPage/setPage.css @@ -0,0 +1,72 @@ +/* + * 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 { + flex-direction: column; + align-items: center; +} +.content { + flex-direction: column; + align-items: center; + justify-content: center; + border: 1px solid #000000; + border-radius: 10px; +} +input { + height: 50px; +} +.title { + font-size: 25px; + font-weight: bold; + margin: 20px 0px 30px; + width: 95%; + text-align: center; +} +.imgshrink { + width: 90%; + margin: 10px 0px; + justify-content: space-between; + align-items: center; +} +.imgshrink text { + font-size: 15px; +} +.imgshrink button { + width: 40%; +} +.setnum { + flex-direction: column; + width: 90%; + justify-content: flex-start; + margin: 10px 0px; +} +.setnum div { + margin: 10px 0px; +} +.setnum text { + font-size: 15px; + margin-right: 10px; +} +.setnum input { + width: 60%; +} +.submit { + margin: 10px 0px; + width: 90%; + justify-content: space-between; +} +.submit button { + width: 40%; + height:40px; +} \ No newline at end of file diff --git a/JSUI/JsGallery/entry/src/main/js/default/pages/index/setPage/setPage.hml b/JSUI/JsGallery/entry/src/main/js/default/pages/index/setPage/setPage.hml new file mode 100644 index 0000000000000000000000000000000000000000..cb8e810edb545451f71de6de1b66bc38bf246ed8 --- /dev/null +++ b/JSUI/JsGallery/entry/src/main/js/default/pages/index/setPage/setPage.hml @@ -0,0 +1,39 @@ + +
+
+ + 负载配置 + +
+
+ + 列数: + + +
+
+ + 张数: + + +
+
+
+ + +
+
+
\ No newline at end of file diff --git a/JSUI/JsGallery/entry/src/main/js/default/pages/index/setPage/setPage.js b/JSUI/JsGallery/entry/src/main/js/default/pages/index/setPage/setPage.js new file mode 100644 index 0000000000000000000000000000000000000000..516e36398ee36f26735a63f73b4512da8df35e54 --- /dev/null +++ b/JSUI/JsGallery/entry/src/main/js/default/pages/index/setPage/setPage.js @@ -0,0 +1,42 @@ +/* + * 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. + */ +import router from "@system.router" + +export default { + data: { + col: 8, + num: 5000 + }, + onInit() { + }, + changeCol(e) { + this.col = e.text; + }, + changeNum(e) { + this.num = e.text; + }, + redirect() { + router.push({ + uri: "pages/index/index", + params: { + message: [this.col, this.num], + pass: true + } + }) + }, + back() { + router.back(); + } +} \ No newline at end of file diff --git a/JSUI/JsGallery/entry/src/main/resources/base/element/string.json b/JSUI/JsGallery/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..0a6ce1817b972d5bda8a50ad0aca4f4000805c26 --- /dev/null +++ b/JSUI/JsGallery/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "gallery" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/JSUI/JsGallery/entry/src/main/resources/base/media/icon.png b/JSUI/JsGallery/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/JSUI/JsGallery/entry/src/main/resources/base/media/icon.png differ diff --git a/JSUI/JsGallery/screenshots/device/gallery_cols4.png b/JSUI/JsGallery/screenshots/device/gallery_cols4.png new file mode 100644 index 0000000000000000000000000000000000000000..d0c76bbe7252adefad783bf70712e7ae26a71785 Binary files /dev/null and b/JSUI/JsGallery/screenshots/device/gallery_cols4.png differ diff --git a/JSUI/JsGallery/screenshots/device/gallery_cols8.png b/JSUI/JsGallery/screenshots/device/gallery_cols8.png new file mode 100644 index 0000000000000000000000000000000000000000..e89ee619aacafb2fa742201126029d22ec5f419e Binary files /dev/null and b/JSUI/JsGallery/screenshots/device/gallery_cols8.png differ diff --git a/JSUI/JsGallery/settings.gradle b/JSUI/JsGallery/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..7dc3285c045cc590e49d231a4280ef52ba646d91 --- /dev/null +++ b/JSUI/JsGallery/settings.gradle @@ -0,0 +1,15 @@ +/* + * 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. + */ +include ':entry' diff --git a/JSUI/JsShopping/README.md b/JSUI/JsShopping/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d41bbf9c4557ba0f5cf72869553b2755d7f1a3cd --- /dev/null +++ b/JSUI/JsShopping/README.md @@ -0,0 +1,8 @@ +# Example Shopping App + +- This example JS-based shopping app uses a hybrid layout containing resources such as images, videos, and text. To optimize memory and performance, the lazy loading feature has been used for the sliding list. You can use the sample code as reference for your app development. This example applies to large systems \(reference memory ≥ 1 GB\). + 1. The app consists of three pages: home page, details page, and comment page. + 2. The home page comprises a nested layout of text and images. It uses the lazy loading feature to implement a sliding list. + 3. The details page comprises **swiper** components with nested images and videos. You can click scrolling images on the home page to access the respective details page. + + diff --git a/JSUI/JsShopping/README_zh.md b/JSUI/JsShopping/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..2ae27b68718b8bd3d2e3bd6509ab4c34448a677d --- /dev/null +++ b/JSUI/JsShopping/README_zh.md @@ -0,0 +1,6 @@ +# 购物示例应用 + +- 这是一个仿购物类的JS应用,使用了混合的布局,包含图片、视频、文本等资源。为了优化内存与性能体验,在滑动列表场景下使用了懒加载特性,开发者可借鉴使用。适用于大型系统(参考内存≥1GiB)。 + 1. 应用包含首页,详情页,评论页,共三个页面。 + 2. 首页包括文本图片的嵌套布局,使用list懒加载特性,实现滑动列表场景。 + 3. 通过点击轮播图跳转到详情页,在详情页的swiper组件中嵌套图片与视频资源。 diff --git a/JSUI/JsShopping/build.gradle b/JSUI/JsShopping/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..4e8a6aadbd114fd91535e3347c8a293ad0fab769 --- /dev/null +++ b/JSUI/JsShopping/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' + +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } +} + +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.2' + } +} + +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + jcenter() + } +} + diff --git a/JSUI/JsShopping/entry/build.gradle b/JSUI/JsShopping/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..83f59debbd68242b503a22270f4378d7843ca204 --- /dev/null +++ b/JSUI/JsShopping/entry/build.gradle @@ -0,0 +1,19 @@ +apply plugin: 'com.huawei.ohos.hap' +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/config.json b/JSUI/JsShopping/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..c09132696234c22bec60c7554b9409112ef4a83b --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/config.json @@ -0,0 +1,58 @@ +{ + "app": { + "bundleName": "ohos.samples.shopping", + "vendor": "samples", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.samples.shopping", + "name": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": ".MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index", + "pages/performance/performance", + "pages/detailPage/detail/detail" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/java/ohos/samples/shopping/MainAbility.java b/JSUI/JsShopping/entry/src/main/java/ohos/samples/shopping/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..eae9e571ce58f98cdc06e0f1209de10cf6e52fbd --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/java/ohos/samples/shopping/MainAbility.java @@ -0,0 +1,31 @@ +/* + * 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. + */ +package ohos.samples.shopping; + +import ohos.ace.ability.AceAbility; +import ohos.aafwk.content.Intent; + +public class MainAbility extends AceAbility { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + } + + @Override + public void onStop() { + super.onStop(); + } + +} diff --git a/JSUI/JsShopping/entry/src/main/js/default/app.js b/JSUI/JsShopping/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..c158442201abb1888ae8fb1d57f150c5ec26c36b --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * 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/JSUI/JsShopping/entry/src/main/js/default/common/Icon/04.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/04.png new file mode 100644 index 0000000000000000000000000000000000000000..48612ec22106afdb497795235076aac7420a6c84 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/04.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/arrow.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..41cf4887ca721795de7dff77fb87aeb1e813ab41 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/arrow.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/arrows.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/arrows.png new file mode 100644 index 0000000000000000000000000000000000000000..94af7a001b47fbfd60b6c8775b153de71846d6e0 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/arrows.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/barcode.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/barcode.png new file mode 100644 index 0000000000000000000000000000000000000000..63aa672c7b919a2d96d95e7e9154ff321167c6d3 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/barcode.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/cart.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/cart.png new file mode 100644 index 0000000000000000000000000000000000000000..a88afd041bf43fdeb5ff984be0e2c6d85aeed4ee Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/cart.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/classification.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/classification.png new file mode 100644 index 0000000000000000000000000000000000000000..52a2f2e0b9015f724e3c25ce8100327a4b5d2762 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/classification.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/comment.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/comment.png new file mode 100644 index 0000000000000000000000000000000000000000..a86db7e427a4d6ea2586ed169ca1ae492d47f9bf Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/comment.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/ellipsis_vertical_line.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/ellipsis_vertical_line.png new file mode 100644 index 0000000000000000000000000000000000000000..14f5f6278d9e369f735a012680c235f47d7c445a Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/ellipsis_vertical_line.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/find.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/find.png new file mode 100644 index 0000000000000000000000000000000000000000..eca6f67294b4dd9a6397488ac61c07258e6b124c Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/find.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/home.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/home.png new file mode 100644 index 0000000000000000000000000000000000000000..ae1d6ed7deddf39ca0413fec49a9601d9581bd3c Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/home.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/icon-test.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/icon-test.png new file mode 100644 index 0000000000000000000000000000000000000000..586821e50127f283c0265e04dd5a9ac916d1dd2e Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/icon-test.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/insert-top.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/insert-top.png new file mode 100644 index 0000000000000000000000000000000000000000..d0e9b47529ea2b64819cf1337ffdff81cb05e62e Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/insert-top.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/like.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/like.png new file mode 100644 index 0000000000000000000000000000000000000000..4fa1daaa72115d44227cee4067c352cc7608efa3 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/like.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/love.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/love.png new file mode 100644 index 0000000000000000000000000000000000000000..e18d676264e0d009c2e4db4d3daac21d8227c46d Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/love.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/masonry.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/masonry.png new file mode 100644 index 0000000000000000000000000000000000000000..e18d676264e0d009c2e4db4d3daac21d8227c46d Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/masonry.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/more.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/more.png new file mode 100644 index 0000000000000000000000000000000000000000..20296fc17af31e3923b36ef575d275284802a490 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/more.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/nav_classification.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/nav_classification.png new file mode 100644 index 0000000000000000000000000000000000000000..2553f225cbda4568f5b1abe1494e65236a1be9ac Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/nav_classification.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/persons.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/persons.png new file mode 100644 index 0000000000000000000000000000000000000000..9d04979d058b6c788236c83fa5b2d89857497e54 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/persons.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/phonecall.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/phonecall.png new file mode 100644 index 0000000000000000000000000000000000000000..1eddfc445e0f81e7303cdb70687da1114d09a851 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/phonecall.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/photo.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/photo.png new file mode 100644 index 0000000000000000000000000000000000000000..25749a314d01da68314f50528e8be6e3b7577587 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/photo.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/scan.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/scan.png new file mode 100644 index 0000000000000000000000000000000000000000..50684c355412406dddb64f5413be7bd8d6c7a43f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/scan.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/search.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/search.png new file mode 100644 index 0000000000000000000000000000000000000000..b95456ae6241e1f743de003f7a719d383bb3effa Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/search.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/selected_cart.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/selected_cart.png new file mode 100644 index 0000000000000000000000000000000000000000..db0b8bea5be096658821b8ae728d728ba97ecbef Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/selected_cart.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/selected_find.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/selected_find.png new file mode 100644 index 0000000000000000000000000000000000000000..23b541b59a4adccc8564f06cb9cb092d4e20cd91 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/selected_find.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/selected_home.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/selected_home.png new file mode 100644 index 0000000000000000000000000000000000000000..be9264d347787b82c2f4f9fdab97b0714edddbea Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/selected_home.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/selected_star.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/selected_star.png new file mode 100644 index 0000000000000000000000000000000000000000..3c9a882f5f04102794e44b55051722aa8f1e7b52 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/selected_star.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/selected_user.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/selected_user.png new file mode 100644 index 0000000000000000000000000000000000000000..cf67db0dfa7af6cbf18780cb1670ef584c433645 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/selected_user.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/selecteds.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/selecteds.png new file mode 100644 index 0000000000000000000000000000000000000000..505f7493af32a1d4612077b82eb992984d6eec5f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/selecteds.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/service.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/service.png new file mode 100644 index 0000000000000000000000000000000000000000..873e2b50d7c8a5a4373e75a029b4b1e86a23869c Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/service.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/shop.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/shop.png new file mode 100644 index 0000000000000000000000000000000000000000..dd2645f056f5858c726007726f5d912c664fc3ac Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/shop.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/star.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/star.png new file mode 100644 index 0000000000000000000000000000000000000000..e310653671565d8a41d743e28c66a880faf0901d Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/star.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/stars.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/stars.png new file mode 100644 index 0000000000000000000000000000000000000000..8f3f94cc855c37642aafef91e851ff29159d4e38 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/stars.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/suns.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/suns.png new file mode 100644 index 0000000000000000000000000000000000000000..3d3224725b3fa3ae094f268e6c3b1ef8deed7212 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/suns.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/twoarrow.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/twoarrow.png new file mode 100644 index 0000000000000000000000000000000000000000..2426cd36868bc4d66c881388baa48eb30048de7f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/twoarrow.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/user.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/user.png new file mode 100644 index 0000000000000000000000000000000000000000..2ba1fdb13de6b27df80594ca463070a6ebb7977e Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/user.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/Icon/vip.png b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/vip.png new file mode 100644 index 0000000000000000000000000000000000000000..64da4ea289dc943903f2d0989585099c7aa3eb86 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/Icon/vip.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailData.js b/JSUI/JsShopping/entry/src/main/js/default/common/detailData.js new file mode 100644 index 0000000000000000000000000000000000000000..cc1b0fed0d94aa2bb5067f164c02f706bf13cb25 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/common/detailData.js @@ -0,0 +1,502 @@ +/* + * 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. + */ +var detailData = { + commonimg: [ + { + url: '/common/Icon/arrows.png' + }, + { + url: 'common/images_detail/img/icon_add.png' + }, + { + url: 'common/images_detail/img/icon_reduce.png' + }, + { + url: 'common/images_detail/img/icon_reduce_black.png' + }, + { + url: '/common/Icon/shop.png' + }, + { + url: '/common/Icon/stars.png' + }, + { + url: '/common/Icon/selected_star.png' + }, + { + url: '/common/Icon/phonecall.png' + }, + { + url: 'common/images_detail/tab_icon.png' + }, + { + url: '/common/Icon/service.png' + }, + ], + goodsimgs: { + videos: { + url: '/common/detailImg/swiperImg/swiper4.png', + videourl: '/common/detailImg/swiperImg/swiper.mp4', + flag: true + }, + goodImgList: [ + { + url: '/common/detailImg/swiperImg/swiper1.png', + videourl: '', + flag: false + }, + { + url: '/common/detailImg/swiperImg/swiper2.png', + videourl: '', + flag: false + }, + { + url: '/common/detailImg/swiperImg/swiper3.png', + videourl: '', + flag: false + } + ], + }, + specficlist: { + texts: { + intro: '【首降600+12期免息】XX/XXMate 40 Pro 5G 全网通 (亮黑色) 全球n多人的选择,你值得拥有' + }, + imgicon: [ + { + url: '/common/Icon/icon-test.png' + }, + { + url: '/common/Icon/like.png' + }, + { + url: '/common/Icon/persons.png' + }, + { + url: '/common/detailImg/deliverImg/deliver_logo1.png' + }, + { + url: '/common/detailImg/deliverImg/deliver_logo2.png' + }, + { + url: '/common/detailImg/deliverImg/deliver_logo3.png' + }, + { + url: '/common/Icon/04.png' + }, + { + url: '/common/detailImg/evaluationImg/evaluation_logo3.png' + }, + + ], + phonetype: [ + { + url: '/common/detailImg/deliverImg/deliver_type1.png', + color_choose: '亮黑色' + }, + { + url: '/common/detailImg/deliverImg/deliver_type2.png', + color_choose: '星河银' + }, + { + url: '/common/detailImg/deliverImg/deliver_type3.png', + color_choose: '翡翠冷' + }, + { + url: '/common/detailImg/deliverImg/deliver_type4.png', + color_choose: '紫罗兰', + }, + { + url: '/common/detailImg/deliverImg/deliver_type5.png', + color_choose: '丹霞橙' + } + ] + }, + comment: { + keywordList: ['豪华', '上档次', '时尚美观'], + detail: { + userName: 'userName', + userIcon: '/common/detailImg/evaluationImg/eva_user.png', + commentsText: '相对而言,XX手机有着更高的网速,更高的内存,更清晰的画质以及更少的耗电量。', + }, + showImg: [ + { + url: '/common/detailImg/evaluationImg/buyersShow1.png' + }, + { + url: '/common/detailImg/evaluationImg/buyersShow2.png' + }, + { + url: '/common/detailImg/evaluationImg/buyersShow3.png' + }, + { + url: '/common/detailImg/evaluationImg/buyersShow4.png' + } + ], + icon: [ + { + url: '/common/detailImg/evaluationImg/evaluation_logo.jpg' + }, + { + url: '/common/detailImg/evaluationImg/evaluation_logo1.png' + }, + { + url: '/common/detailImg/evaluationImg/evaluation_logo2.png' + }, + { + url: '/common/detailImg/evaluationImg/evaluation_logo3.png' + }, + ] + }, + recommendgood: { + recommendgood: [ + { + icon: '/common/detailImg/recommendImg/recommend1.png', + title: 'XX Mate 40 5G 全网通', + price: '¥196', + id: '1' + }, + { + icon: '/common/detailImg/recommendImg/recommend2.png', + title: 'XX手机 大多数人的选择', + price: '¥339.98', + id: '2' + }, + { + icon: '/common/detailImg/recommendImg/recommend3.png', + title: 'XX Mate 40 Pro 5G 全网通', + price: '¥188', + id: '3' + }, + { + icon: '/common/detailImg/recommendImg/recommend4.png', + title: 'XX Mate 40 5G 全网通', + price: '¥196', + id: '4' + }, + { + icon: '/common/detailImg/recommendImg/recommend5.png', + title: 'XX手机 大多数人的选择', + price: '¥339.98', + id: '5' + }, + { + icon: '/common/detailImg/recommendImg/recommend6.png', + title: 'XX Mate 40 Pro 5G 全网通', + price: '¥188', + id: '6' + } + ], + img: [ + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img1.png', + title: 'XX Mate 40 5G 全网通', + price: '¥196', + id: '1' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img2.png', + title: 'XX手机 大多数人的选择', + price: '¥339.98', + id: '2' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img3.png', + title: 'XX Mate 40 Pro 5G 全网通', + price: '¥188', + id: '3' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img4.png', + title: 'XX Mate 40 5G 全网通', + price: '¥196', + id: '4' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img5.png', + title: 'XX手机 大多数人的选择', + price: '¥339.98', + id: '5' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img6.png', + title: 'XX Mate 40 Pro 5G 全网通', + price: '¥188', + id: '6' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img7.png', + title: 'XX Mate 40 5G 全网通', + price: '¥196', + id: '1' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img8.png', + title: 'XX手机 大多数人的选择', + price: '¥339.98', + id: '2' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img9.png', + title: 'XX Mate 40 Pro 5G 全网通', + price: '¥188', + id: '3' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img10.png', + title: 'XX Mate 40 5G 全网通', + price: '¥196', + id: '4' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img11.png', + title: 'XX手机 大多数人的选择', + price: '¥339.98', + id: '5' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img12.png', + title: 'XX Mate 40 Pro 5G 全网通', + price: '¥188', + id: '6' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img13.png', + title: 'XX Mate 40 5G 全网通', + price: '¥196', + id: '1' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img14.png', + title: 'XX手机 大多数人的选择', + price: '¥339.98', + id: '2' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img15.png', + title: 'XX Mate 40 Pro 5G 全网通', + price: '¥188', + id: '3' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img16.png', + title: 'XX Mate 40 5G 全网通', + price: '¥196', + id: '4' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img17.png', + title: 'XX手机 大多数人的选择', + price: '¥339.98', + id: '5' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img18.png', + title: 'XX Mate 40 Pro 5G 全网通', + price: '¥188', + id: '6' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img19.png', + title: 'XX Mate 40 5G 全网通', + price: '¥196', + id: '1' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img20.png', + title: 'XX手机 大多数人的选择', + price: '¥339.98', + id: '2' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img21.png', + title: 'XX Mate 40 Pro 5G 全网通', + price: '¥188', + id: '3' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img22.png', + title: 'XX Mate 40 5G 全网通', + price: '¥196', + id: '4' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img23.png', + title: 'XX手机 大多数人的选择', + price: '¥339.98', + id: '5' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img24.png', + title: 'XX Mate 40 Pro 5G 全网通', + price: '¥188', + id: '6' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img25.png', + title: 'XX Mate 40 5G 全网通', + price: '¥196', + id: '1' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img26.png', + title: 'XX手机 大多数人的选择', + price: '¥339.98', + id: '2' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img27.png', + title: 'XX Mate 40 Pro 5G 全网通', + price: '¥188', + id: '3' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img28.png', + title: 'XX Mate 40 5G 全网通', + price: '¥196', + id: '4' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img29.png', + title: 'XX手机 大多数人的选择', + price: '¥339.98', + id: '5' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img30.png', + title: 'XX Mate 40 Pro 5G 全网通', + price: '¥188', + id: '6' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img31.png', + title: 'XX Mate 40 5G 全网通', + price: '¥196', + id: '1' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img32.png', + title: 'XX手机 大多数人的选择', + price: '¥339.98', + id: '2' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img33.png', + title: 'XX Mate 40 Pro 5G 全网通', + price: '¥188', + id: '3' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img34.png', + title: 'XX Mate 40 5G 全网通', + price: '¥196', + id: '4' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img35.png', + title: 'XX手机 大多数人的选择', + price: '¥339.98', + id: '5' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img36.png', + title: 'XX Mate 40 Pro 5G 全网通', + price: '¥188', + id: '6' + }, + { + icon: '/common/detailImg/recommendImg/recom_imgs/recom_img37.png', + title: 'XX Mate 40 Pro 5G 全网通', + price: '¥188', + id: '6' + }, + ] + }, + goodintroduced: [ + { + url: 'common/detailImg/recommendImg/attention/list_0.jpg' + }, + { + url: 'common/detailImg/recommendImg/attention/list_1.jpg' + }, + { + url: 'common/detailImg/recommendImg/attention/list_2.jpg' + }, + { + url: 'common/detailImg/recommendImg/attention/list_3.jpg' + }, + { + url: 'common/detailImg/recommendImg/attention/list_4.jpg' + }, + { + url: 'common/detailImg/recommendImg/attention/list_5.jpg' + }, + { + url: 'common/detailImg/recommendImg/attention/list_6.jpg' + }, + { + url: 'common/detailImg/recommendImg/attention/list_7.jpg' + }, + { + url: 'common/detailImg/recommendImg/attention/list_8.jpg' + }, + { + url: 'common/detailImg/recommendImg/attention/list_9.jpg' + }, + { + url: 'common/detailImg/recommendImg/attention/list_10.jpg' + }, + { + url: 'common/detailImg/recommendImg/attention/list_11.jpg' + }, + { + url: 'common/detailImg/recommendImg/attention/list_12.jpg' + }, + { + url: 'common/detailImg/recommendImg/attention/list_13.jpg' + }, + { + url: 'common/detailImg/recommendImg/attention/list_14.jpg' + }, + { + url: 'common/detailImg/recommendImg/attention/list_15.jpg' + }, + { + url: 'common/detailImg/recommendImg/attention/list_16.jpg' + }, + { + url: 'common/detailImg/recommendImg/attention/list_17.jpg' + }, + { + url: 'common/detailImg/recommendImg/attention/list_18.jpg' + }, + { + url: 'common/detailImg/recommendImg/attention/list_19.jpg' + }, + { + url: 'common/detailImg/recommendImg/attention/list_20.jpg' + }, + { + url: 'common/detailImg/recommendImg/attention/list_21.jpg' + }, + { + url: 'common/detailImg/recommendImg/attention/list_22.jpg' + }, + { + url: 'common/detailImg/recommendImg/attention/list_23.jpg' + }, + ], +} + +export default detailData; \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_logo1.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_logo1.png new file mode 100644 index 0000000000000000000000000000000000000000..4af4f04cc8c6a6309a4c8655b49229f20b4455f6 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_logo1.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_logo2.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_logo2.png new file mode 100644 index 0000000000000000000000000000000000000000..22bd457c31e015cbb0c98c6afde1bb70b4b6a1e5 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_logo2.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_logo3.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_logo3.png new file mode 100644 index 0000000000000000000000000000000000000000..439a91e3ca36476c9e026c95be11308b9f48ab5e Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_logo3.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_type1.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_type1.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf33cc27eca2adb471fefe5a7dfde782cf87b75 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_type1.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_type2.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_type2.png new file mode 100644 index 0000000000000000000000000000000000000000..f7c8f95862bb029a50b856401269ee03c933b407 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_type2.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_type3.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_type3.png new file mode 100644 index 0000000000000000000000000000000000000000..d3051e228bc7be3df44f1e1adbd1adf9f8d0bc4a Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_type3.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_type4.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_type4.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_type4.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_type5.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_type5.png new file mode 100644 index 0000000000000000000000000000000000000000..705d9184884e52bf7a371e89f4f61e573ce138de Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/deliverImg/deliver_type5.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/buyersShow1.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/buyersShow1.png new file mode 100644 index 0000000000000000000000000000000000000000..033e995ff199ebdae253e3223f27c3e8b0b621f4 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/buyersShow1.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/buyersShow2.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/buyersShow2.png new file mode 100644 index 0000000000000000000000000000000000000000..f0b2997c09b812135cce582922b27afed3c9afdb Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/buyersShow2.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/buyersShow3.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/buyersShow3.png new file mode 100644 index 0000000000000000000000000000000000000000..f85c8c7466108ae7bc6034922d4c35557f3388c0 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/buyersShow3.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/buyersShow4.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/buyersShow4.png new file mode 100644 index 0000000000000000000000000000000000000000..f0b2997c09b812135cce582922b27afed3c9afdb Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/buyersShow4.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/eva_user.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/eva_user.png new file mode 100644 index 0000000000000000000000000000000000000000..a2ce05ee83c76c20b107a58f90121cb07becb517 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/eva_user.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/evaluation_logo.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/evaluation_logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0f616e3b629f4686f944f4ed8706ca8c95fc965a Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/evaluation_logo.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/evaluation_logo1.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/evaluation_logo1.png new file mode 100644 index 0000000000000000000000000000000000000000..4af4f04cc8c6a6309a4c8655b49229f20b4455f6 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/evaluation_logo1.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/evaluation_logo2.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/evaluation_logo2.png new file mode 100644 index 0000000000000000000000000000000000000000..22bd457c31e015cbb0c98c6afde1bb70b4b6a1e5 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/evaluation_logo2.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/evaluation_logo3.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/evaluation_logo3.png new file mode 100644 index 0000000000000000000000000000000000000000..439a91e3ca36476c9e026c95be11308b9f48ab5e Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/evaluationImg/evaluation_logo3.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_1.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1b2f43a3ddcf70d5a716c5d901d3e4ca2b3ef907 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_1.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_10.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_10.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6db7172dc7fc1f9817382cfe2595207d5f6d1d0d Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_10.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_11.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_11.jpg new file mode 100644 index 0000000000000000000000000000000000000000..58d8accb0fc3ce82970e837a7cdbf145f27a42cd Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_11.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_12.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_12.jpg new file mode 100644 index 0000000000000000000000000000000000000000..46b8707b61219369851bde056847b3e3e320d1ca Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_12.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_13.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_13.jpg new file mode 100644 index 0000000000000000000000000000000000000000..797150b6ec428d4e0b9d6e9778a629d63a7fdd6f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_13.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_14.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_14.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ebe7d9ed5dd8c41686d23978d6270e3221d2c7ff Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_14.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_15.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_15.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ebe7d9ed5dd8c41686d23978d6270e3221d2c7ff Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_15.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_16.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_16.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8a1cba699068e796a03d914362b806384314d22a Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_16.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_17.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_17.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3773eccdcf3a68cb415c8a85177b50f1fe21969f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_17.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_18.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_18.jpg new file mode 100644 index 0000000000000000000000000000000000000000..499edc97bef3804aa96369ed1c4678d3eda9ff86 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_18.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_19.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_19.jpg new file mode 100644 index 0000000000000000000000000000000000000000..499edc97bef3804aa96369ed1c4678d3eda9ff86 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_19.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_2.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1b2f43a3ddcf70d5a716c5d901d3e4ca2b3ef907 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_2.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_20.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_20.jpg new file mode 100644 index 0000000000000000000000000000000000000000..499edc97bef3804aa96369ed1c4678d3eda9ff86 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_20.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_21.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_21.jpg new file mode 100644 index 0000000000000000000000000000000000000000..499edc97bef3804aa96369ed1c4678d3eda9ff86 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_21.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_22.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_22.jpg new file mode 100644 index 0000000000000000000000000000000000000000..642b7933bddf84bc305be30634a328a602527894 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_22.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_23.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_23.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8d6d20bf7a86454ca0deecff464999ed1f5a13bc Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_23.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_3.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..28b681b431307017d350f67e9d49a20825f516aa Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_3.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_4.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2a8de70dcdb8bbd217bbc64e53ea8cf180801f01 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_4.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_5.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_5.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1614984f119d0bf9ed17b0618322574921ff0a45 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_5.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_6.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_6.jpg new file mode 100644 index 0000000000000000000000000000000000000000..359a7367da7178732fa4481aae70f3e18de150b3 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_6.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_7.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_7.jpg new file mode 100644 index 0000000000000000000000000000000000000000..91a39a416481384fae179e5c7022aa2112e5b515 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_7.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_8.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_8.jpg new file mode 100644 index 0000000000000000000000000000000000000000..dca04cc8076df63d28f0cfc0f69af2b746829f7d Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_8.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_9.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_9.jpg new file mode 100644 index 0000000000000000000000000000000000000000..cd39a5e40d41220e86272346da616f363341837d Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/attention/list_9.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img1.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img1.png new file mode 100644 index 0000000000000000000000000000000000000000..44253af669791059a8f8e27fb307968b90a846a6 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img1.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img10.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img10.png new file mode 100644 index 0000000000000000000000000000000000000000..705d9184884e52bf7a371e89f4f61e573ce138de Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img10.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img11.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img11.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf33cc27eca2adb471fefe5a7dfde782cf87b75 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img11.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img12.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img12.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img12.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img13.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img13.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf33cc27eca2adb471fefe5a7dfde782cf87b75 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img13.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img14.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img14.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf33cc27eca2adb471fefe5a7dfde782cf87b75 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img14.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img15.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img15.png new file mode 100644 index 0000000000000000000000000000000000000000..d3051e228bc7be3df44f1e1adbd1adf9f8d0bc4a Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img15.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img16.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img16.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf33cc27eca2adb471fefe5a7dfde782cf87b75 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img16.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img17.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img17.png new file mode 100644 index 0000000000000000000000000000000000000000..d3051e228bc7be3df44f1e1adbd1adf9f8d0bc4a Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img17.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img18.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img18.png new file mode 100644 index 0000000000000000000000000000000000000000..d3051e228bc7be3df44f1e1adbd1adf9f8d0bc4a Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img18.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img19.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img19.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img19.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img2.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img2.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img2.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img20.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img20.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img20.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img21.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img21.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img21.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img22.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img22.png new file mode 100644 index 0000000000000000000000000000000000000000..d3051e228bc7be3df44f1e1adbd1adf9f8d0bc4a Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img22.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img23.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img23.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img23.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img24.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img24.png new file mode 100644 index 0000000000000000000000000000000000000000..d3051e228bc7be3df44f1e1adbd1adf9f8d0bc4a Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img24.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img25.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img25.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img25.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img26.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img26.png new file mode 100644 index 0000000000000000000000000000000000000000..705d9184884e52bf7a371e89f4f61e573ce138de Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img26.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img27.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img27.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img27.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img28.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img28.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf33cc27eca2adb471fefe5a7dfde782cf87b75 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img28.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img29.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img29.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf33cc27eca2adb471fefe5a7dfde782cf87b75 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img29.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img3.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img3.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf33cc27eca2adb471fefe5a7dfde782cf87b75 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img3.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img30.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img30.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf33cc27eca2adb471fefe5a7dfde782cf87b75 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img30.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img31.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img31.png new file mode 100644 index 0000000000000000000000000000000000000000..705d9184884e52bf7a371e89f4f61e573ce138de Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img31.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img32.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img32.png new file mode 100644 index 0000000000000000000000000000000000000000..d3051e228bc7be3df44f1e1adbd1adf9f8d0bc4a Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img32.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img33.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img33.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img33.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img34.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img34.png new file mode 100644 index 0000000000000000000000000000000000000000..44253af669791059a8f8e27fb307968b90a846a6 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img34.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img35.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img35.png new file mode 100644 index 0000000000000000000000000000000000000000..d3051e228bc7be3df44f1e1adbd1adf9f8d0bc4a Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img35.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img36.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img36.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf33cc27eca2adb471fefe5a7dfde782cf87b75 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img36.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img37.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img37.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img37.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img4.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img4.png new file mode 100644 index 0000000000000000000000000000000000000000..44253af669791059a8f8e27fb307968b90a846a6 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img4.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img5.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img5.png new file mode 100644 index 0000000000000000000000000000000000000000..d3051e228bc7be3df44f1e1adbd1adf9f8d0bc4a Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img5.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img6.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img6.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img6.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img7.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img7.png new file mode 100644 index 0000000000000000000000000000000000000000..705d9184884e52bf7a371e89f4f61e573ce138de Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img7.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img8.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img8.png new file mode 100644 index 0000000000000000000000000000000000000000..705d9184884e52bf7a371e89f4f61e573ce138de Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img8.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img9.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img9.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recom_imgs/recom_img9.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recommend1.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recommend1.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf33cc27eca2adb471fefe5a7dfde782cf87b75 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recommend1.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recommend2.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recommend2.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf33cc27eca2adb471fefe5a7dfde782cf87b75 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recommend2.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recommend3.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recommend3.png new file mode 100644 index 0000000000000000000000000000000000000000..d3051e228bc7be3df44f1e1adbd1adf9f8d0bc4a Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recommend3.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recommend4.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recommend4.png new file mode 100644 index 0000000000000000000000000000000000000000..705d9184884e52bf7a371e89f4f61e573ce138de Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recommend4.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recommend5.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recommend5.png new file mode 100644 index 0000000000000000000000000000000000000000..705d9184884e52bf7a371e89f4f61e573ce138de Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recommend5.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recommend6.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recommend6.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/recommendImg/recommend6.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/swiperImg/swiper.mp4 b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/swiperImg/swiper.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..edffdb1b1a7d6c088697676b26ec7f5a183765d7 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/swiperImg/swiper.mp4 differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/swiperImg/swiper1.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/swiperImg/swiper1.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/swiperImg/swiper1.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/swiperImg/swiper2.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/swiperImg/swiper2.png new file mode 100644 index 0000000000000000000000000000000000000000..b4cbfcc43e07c9cf0558b40cd76ea9ee00319a83 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/swiperImg/swiper2.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/swiperImg/swiper3.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/swiperImg/swiper3.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf33cc27eca2adb471fefe5a7dfde782cf87b75 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/swiperImg/swiper3.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/swiperImg/swiper4.png b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/swiperImg/swiper4.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/detailImg/swiperImg/swiper4.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/bannerImg/banner1.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/bannerImg/banner1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..dfd74b3c24c3d639b5b11941258141c653cabb63 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/bannerImg/banner1.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/bannerImg/banner2.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/bannerImg/banner2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d4949d00af9746ecdc59f430a907ea24dc874886 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/bannerImg/banner2.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/bannerImg/banner3.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/bannerImg/banner3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e2f141545ab6dfc1b0f50ef6e1dc93c489b869ee Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/bannerImg/banner3.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/bannerImg/banner4.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/bannerImg/banner4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a54a14103e7bdbc1c0d56285bb319176d5ff1781 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/bannerImg/banner4.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/bannerImg/banner5.jpg b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/bannerImg/banner5.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9711b8ca443354951cfe60a647f2cac855d5d387 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/bannerImg/banner5.jpg differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core1.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core1.png new file mode 100644 index 0000000000000000000000000000000000000000..23510e212aeb39e547665f07c9e732ceea4e7da0 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core1.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core10.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core10.png new file mode 100644 index 0000000000000000000000000000000000000000..e51c67014ca0e59fea3b1880e352b154a5df2467 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core10.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core11.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core11.png new file mode 100644 index 0000000000000000000000000000000000000000..c974ad896f07df5d79867552097447d47ec6b889 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core11.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core12.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core12.png new file mode 100644 index 0000000000000000000000000000000000000000..914c6a1586524a4e632815fa7b4f2fc3b7709bb8 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core12.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core13.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core13.png new file mode 100644 index 0000000000000000000000000000000000000000..ecc02f91f4d7d63f119287a2388dffe21bc225ef Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core13.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core14.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core14.png new file mode 100644 index 0000000000000000000000000000000000000000..ad9a7c678eaae3413a4828f7bedd1de9bacaf375 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core14.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core15.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core15.png new file mode 100644 index 0000000000000000000000000000000000000000..eec7a4f2c4a7a18e7d2eae69f33d6cb091f5d3d6 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core15.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core16.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core16.png new file mode 100644 index 0000000000000000000000000000000000000000..7b25479a73535482c19db43e962c1cbe35d2caec Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core16.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core17.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core17.png new file mode 100644 index 0000000000000000000000000000000000000000..fb3c8f7bcf0c74e0aa403c8553679e571713d5e3 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core17.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core18.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core18.png new file mode 100644 index 0000000000000000000000000000000000000000..d34aae7e8c8275eea534a1a8e102d1e5eadbf011 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core18.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core19.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core19.png new file mode 100644 index 0000000000000000000000000000000000000000..0ffa970003f90de0dd664720f34a161f3dfba97e Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core19.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core2.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core2.png new file mode 100644 index 0000000000000000000000000000000000000000..bcd11fa2e105805f52ef537fbfb16bd62331b403 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core2.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core3.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core3.png new file mode 100644 index 0000000000000000000000000000000000000000..e38acff1a11d9ae9e147cb9e0c5c250b5c75220f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core3.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core4.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core4.png new file mode 100644 index 0000000000000000000000000000000000000000..d6952e9cff4aa423e6934276a9ffdfd573dcdd36 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core4.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core5.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core5.png new file mode 100644 index 0000000000000000000000000000000000000000..ce8d3b1a1ac317375aade0ee9adb5e87aece0789 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core5.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core6.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core6.png new file mode 100644 index 0000000000000000000000000000000000000000..b263c63ce3aad20ba20486df8892fcc1a2ce45a2 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core6.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core7.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core7.png new file mode 100644 index 0000000000000000000000000000000000000000..1e277004cbcc494adbe09fcaa7900a6621e6285d Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core7.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core8.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core8.png new file mode 100644 index 0000000000000000000000000000000000000000..8648828d8546ff5808deda9b1a88a924b03d38a1 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core8.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core9.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core9.png new file mode 100644 index 0000000000000000000000000000000000000000..c650f1287c1846d50c36b42ce708aaa8509940ce Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/coreImg/core9.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro1.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro1.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf33cc27eca2adb471fefe5a7dfde782cf87b75 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro1.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro2.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro2.png new file mode 100644 index 0000000000000000000000000000000000000000..f7c8f95862bb029a50b856401269ee03c933b407 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro2.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro3.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro3.png new file mode 100644 index 0000000000000000000000000000000000000000..f7c8f95862bb029a50b856401269ee03c933b407 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro3.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro4.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro4.png new file mode 100644 index 0000000000000000000000000000000000000000..d3051e228bc7be3df44f1e1adbd1adf9f8d0bc4a Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro4.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro5.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro5.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro5.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro6.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro6.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro6.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro7.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro7.png new file mode 100644 index 0000000000000000000000000000000000000000..b4cbfcc43e07c9cf0558b40cd76ea9ee00319a83 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro7.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro8.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro8.png new file mode 100644 index 0000000000000000000000000000000000000000..705d9184884e52bf7a371e89f4f61e573ce138de Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro8.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro9.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro9.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro9.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_logo1.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_logo1.png new file mode 100644 index 0000000000000000000000000000000000000000..fc78ba4b07b2600aeccf86e2cdebcc89dccebd77 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_logo1.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_logo2.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_logo2.png new file mode 100644 index 0000000000000000000000000000000000000000..901ec370b14ad64b06729870114a7533bef55c94 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_logo2.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_logo3.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_logo3.png new file mode 100644 index 0000000000000000000000000000000000000000..ee1b054e9db485d0da1e4f219e25b36fd7aa6c04 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_logo3.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_logo4.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_logo4.png new file mode 100644 index 0000000000000000000000000000000000000000..574508fb71a2c3bd66ad6ff63e0a7984811c0130 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_logo4.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_logo5.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_logo5.png new file mode 100644 index 0000000000000000000000000000000000000000..583a0bfaf3a55ac37468be6bb4b3c1e2f09b5e66 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_logo5.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_other1.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_other1.png new file mode 100644 index 0000000000000000000000000000000000000000..22bd457c31e015cbb0c98c6afde1bb70b4b6a1e5 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_other1.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_other2.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_other2.png new file mode 100644 index 0000000000000000000000000000000000000000..439a91e3ca36476c9e026c95be11308b9f48ab5e Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_other2.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_title1.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_title1.png new file mode 100644 index 0000000000000000000000000000000000000000..027f64da993cf9a0cbcbdbc8a1deb997cb2b1d21 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_title1.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_title2.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_title2.png new file mode 100644 index 0000000000000000000000000000000000000000..849dec3b281c1a72b49e3fc7f180f6bc870fd74d Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_title2.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_title3.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_title3.png new file mode 100644 index 0000000000000000000000000000000000000000..13fb8f7dcdd103dea14c46a1f95b70c32e0167eb Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_title3.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_title4.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_title4.png new file mode 100644 index 0000000000000000000000000000000000000000..421fac4987b7dbc1f2e3c7119c13847db8c19fe2 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_title4.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_title5.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_title5.png new file mode 100644 index 0000000000000000000000000000000000000000..373cfec88a2743c88bdcf8b5407a8a2c9c5714f7 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/microImg/micro_title5.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product001.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product001.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf33cc27eca2adb471fefe5a7dfde782cf87b75 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product001.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product002.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product002.png new file mode 100644 index 0000000000000000000000000000000000000000..6ae49df3f63d66904615812ba537a4e532dc8f87 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product002.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product003.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product003.png new file mode 100644 index 0000000000000000000000000000000000000000..44253af669791059a8f8e27fb307968b90a846a6 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product003.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product004.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product004.png new file mode 100644 index 0000000000000000000000000000000000000000..4aececb9d36a633a0ab2e6cf36776f151c406e4f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product004.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product005.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product005.png new file mode 100644 index 0000000000000000000000000000000000000000..e76eb74da07e5de1bd0282d60431c32546164605 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product005.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product006.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product006.png new file mode 100644 index 0000000000000000000000000000000000000000..44253af669791059a8f8e27fb307968b90a846a6 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product006.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product007.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product007.png new file mode 100644 index 0000000000000000000000000000000000000000..44253af669791059a8f8e27fb307968b90a846a6 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product007.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product008.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product008.png new file mode 100644 index 0000000000000000000000000000000000000000..9adb757c7cfd693c267929bea166c01cd4bea9cb Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product008.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product009.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product009.png new file mode 100644 index 0000000000000000000000000000000000000000..1a84f372a8d7cef7304e34c30cca5fb9bbd1e1d3 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product009.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product010.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product010.png new file mode 100644 index 0000000000000000000000000000000000000000..45bf20d16a268649345bc964b68948d1b262d626 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product010.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product011.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product011.png new file mode 100644 index 0000000000000000000000000000000000000000..e4d02311e23830ef20c3a327914760cbd4e5d1e6 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product011.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product012.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product012.png new file mode 100644 index 0000000000000000000000000000000000000000..d0566734f2ce1888ca3dcb3adef7692ff68c58f9 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product012.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product013.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product013.png new file mode 100644 index 0000000000000000000000000000000000000000..eea884d7e679382e42921485240b768a532145be Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product013.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product014.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product014.png new file mode 100644 index 0000000000000000000000000000000000000000..49ad8f50dc013e5b4eceabb40f5ff321986655b5 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product014.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product015.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product015.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product015.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product016.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product016.png new file mode 100644 index 0000000000000000000000000000000000000000..938824bd09b5e76ecbd4fe92ddead80a872d8d55 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product016.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product017.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product017.png new file mode 100644 index 0000000000000000000000000000000000000000..86b0a9629ee0706f499ad059bb41c1c9460a12af Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product017.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product018.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product018.png new file mode 100644 index 0000000000000000000000000000000000000000..4837ad597be0512798307a03cde3c6438ccad3d9 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product018.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product019.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product019.png new file mode 100644 index 0000000000000000000000000000000000000000..da5a42b2f0bdd6393692ff56b3524b5c10a37564 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product019.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product020.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product020.png new file mode 100644 index 0000000000000000000000000000000000000000..88a8462f9002b73131dcb072cf6af309a71640cf Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product020.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product021.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product021.png new file mode 100644 index 0000000000000000000000000000000000000000..7b31048207474c8913b5ae4649acbb21dbac784c Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product021.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product022.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product022.png new file mode 100644 index 0000000000000000000000000000000000000000..417a04a54bbf47fe383073c7e90b77630b50bbb7 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product022.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product023.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product023.png new file mode 100644 index 0000000000000000000000000000000000000000..7f6771dbeac9c037a4183369be58d3544a407fb9 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product023.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product024.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product024.png new file mode 100644 index 0000000000000000000000000000000000000000..7f6771dbeac9c037a4183369be58d3544a407fb9 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product024.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product025.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product025.png new file mode 100644 index 0000000000000000000000000000000000000000..c492febcf52ca80615c525b4af0e75d6dacb317d Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product025.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product026.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product026.png new file mode 100644 index 0000000000000000000000000000000000000000..5f78782102faf9de1732a0e48a881f59475cd8ca Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product026.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product027.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product027.png new file mode 100644 index 0000000000000000000000000000000000000000..61a9dd4fc5033b5a45bacb702e5e924e91660ec9 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product027.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product028.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product028.png new file mode 100644 index 0000000000000000000000000000000000000000..f217ad4e94a8d363f9cb54d9da70d12685277a21 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product028.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product029.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product029.png new file mode 100644 index 0000000000000000000000000000000000000000..a4c10694f69f86d1048c7df4451962e1ccd1d20a Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product029.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product030.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product030.png new file mode 100644 index 0000000000000000000000000000000000000000..7f04ac0ba5eafeb72999a119bd55f6c9142ac0db Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product030.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product031.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product031.png new file mode 100644 index 0000000000000000000000000000000000000000..0c5f12c6db5306e834ad3de6995746992f4c0da5 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product031.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product032.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product032.png new file mode 100644 index 0000000000000000000000000000000000000000..d3051e228bc7be3df44f1e1adbd1adf9f8d0bc4a Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product032.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product033.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product033.png new file mode 100644 index 0000000000000000000000000000000000000000..e8b94244ceb0ba88407a50b3cf3ac944ba17c98a Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product033.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product034.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product034.png new file mode 100644 index 0000000000000000000000000000000000000000..c10dbdbc3fc4ac34c2e2b72d08dfc788608b1bb1 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product034.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product035.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product035.png new file mode 100644 index 0000000000000000000000000000000000000000..3058dcd80da66d80ed4a17ade705036470c9c01c Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product035.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product036.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product036.png new file mode 100644 index 0000000000000000000000000000000000000000..21ece0bb0091227a207d5c8b90d58d290586474f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product036.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product037.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product037.png new file mode 100644 index 0000000000000000000000000000000000000000..7a2c4fb97580e6b1a6603e972914c4c6aa30f27e Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product037.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product038.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product038.png new file mode 100644 index 0000000000000000000000000000000000000000..9ed4fbcbb8d77582afb2b6101180c97b08f21c31 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product038.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product039.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product039.png new file mode 100644 index 0000000000000000000000000000000000000000..72f763b83274168c03ef05285227afc2ee61344a Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product039.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product040.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product040.png new file mode 100644 index 0000000000000000000000000000000000000000..9de0d85f2417e17ba73144820853110fc25ac6ce Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product040.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product041.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product041.png new file mode 100644 index 0000000000000000000000000000000000000000..d065230652934bdd8c9a0c87ad201d4a8cda0fcb Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product041.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product042.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product042.png new file mode 100644 index 0000000000000000000000000000000000000000..dabc0a74c1345e8e3c0b94a8c0625252165c6521 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product042.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product043.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product043.png new file mode 100644 index 0000000000000000000000000000000000000000..73fb83e55d0372a43d4ffea49dffafa02e43313b Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product043.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product044.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product044.png new file mode 100644 index 0000000000000000000000000000000000000000..f7c8f95862bb029a50b856401269ee03c933b407 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product044.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product045.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product045.png new file mode 100644 index 0000000000000000000000000000000000000000..dd333788e7b95c97d09956604b3c0238cef49992 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product045.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product046.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product046.png new file mode 100644 index 0000000000000000000000000000000000000000..705d9184884e52bf7a371e89f4f61e573ce138de Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product046.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product047.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product047.png new file mode 100644 index 0000000000000000000000000000000000000000..41f557f870880fe317fb11c97558958a7fa03e45 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product047.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product048.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product048.png new file mode 100644 index 0000000000000000000000000000000000000000..4d2f5c932b1375f8bec7357d83ee494a3914fdf1 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product048.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product049.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product049.png new file mode 100644 index 0000000000000000000000000000000000000000..ce3a65a2a9be7c11b410284d87da4f5b3d34b88a Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product049.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product050.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product050.png new file mode 100644 index 0000000000000000000000000000000000000000..978c55a0d8d562a38571cc2fae91b2dc49ed3a48 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product050.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product051.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product051.png new file mode 100644 index 0000000000000000000000000000000000000000..ee5b1649e8e9afa6f8c822d06bb76e7a59770edf Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product051.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product052.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product052.png new file mode 100644 index 0000000000000000000000000000000000000000..6f31d0e62d52f2984e3860560f8bfbdb99e06709 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product052.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product053.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product053.png new file mode 100644 index 0000000000000000000000000000000000000000..c85884506f1f19c09c4d75a91c46e93e52f231e5 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product053.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product054.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product054.png new file mode 100644 index 0000000000000000000000000000000000000000..921bae5ad26b43270f2bb3ea0cadabcd46788d81 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product054.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product055.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product055.png new file mode 100644 index 0000000000000000000000000000000000000000..641f11b6473f09d1b6f7fc2acdc278a70ca2ed72 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product055.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product056.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product056.png new file mode 100644 index 0000000000000000000000000000000000000000..9a531e5ddea4a99ac7958f20830bd0ab30718d4f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product056.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product057.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product057.png new file mode 100644 index 0000000000000000000000000000000000000000..6b5a319c1229feffcf5a69556c7bf0f3911ffd77 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product057.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product058.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product058.png new file mode 100644 index 0000000000000000000000000000000000000000..6b5a319c1229feffcf5a69556c7bf0f3911ffd77 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product058.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product059.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product059.png new file mode 100644 index 0000000000000000000000000000000000000000..0b6b33d0064b66fc90d67212d7ec789c51ee6afa Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product059.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product060.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product060.png new file mode 100644 index 0000000000000000000000000000000000000000..99b00be7410fed72ff5afed2b5be9ebeb50eff3f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product060.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product061.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product061.png new file mode 100644 index 0000000000000000000000000000000000000000..ba714fc6a8ad74c0d694491eca6390f7569666e5 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product061.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product062.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product062.png new file mode 100644 index 0000000000000000000000000000000000000000..ba714fc6a8ad74c0d694491eca6390f7569666e5 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product062.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product063.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product063.png new file mode 100644 index 0000000000000000000000000000000000000000..8a6f681fdb147596fe60a78f54b6621490acf436 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product063.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product064.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product064.png new file mode 100644 index 0000000000000000000000000000000000000000..1215a3de7f36eb3e27f4ae314caa5724824d2d7b Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product064.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product065.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product065.png new file mode 100644 index 0000000000000000000000000000000000000000..74fc820f4c5d049e88761b3d34e1f5a5816e5d16 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product065.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product066.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product066.png new file mode 100644 index 0000000000000000000000000000000000000000..c14053233a161826197f2b1bb5ba26f4af1fe33c Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product066.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product067.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product067.png new file mode 100644 index 0000000000000000000000000000000000000000..b22930d3cb279591ece505d4cc4303f5b42a5d14 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product067.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product068.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product068.png new file mode 100644 index 0000000000000000000000000000000000000000..9bc3f632a780248915639ece2c87dc160ee26809 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product068.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product069.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product069.png new file mode 100644 index 0000000000000000000000000000000000000000..305372640a91ec89c396268eaf1ee348ef9b53de Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product069.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product070.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product070.png new file mode 100644 index 0000000000000000000000000000000000000000..e61848828914add9583aabc341ecbc61127a636e Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product070.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product071.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product071.png new file mode 100644 index 0000000000000000000000000000000000000000..d8f9eadcd1b952326864533559bb1ab20d862f3c Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product071.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product072.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product072.png new file mode 100644 index 0000000000000000000000000000000000000000..0db84811a60bbc7e21c25c36648ce49d53a50d71 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product072.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product073.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product073.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf33cc27eca2adb471fefe5a7dfde782cf87b75 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product073.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product074.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product074.png new file mode 100644 index 0000000000000000000000000000000000000000..ab177fa38d232356127187b77cb95a161d122ed6 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product074.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product075.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product075.png new file mode 100644 index 0000000000000000000000000000000000000000..7d6b31f1fde94ffb9d519bdbbaee26758a5c1606 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product075.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product076.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product076.png new file mode 100644 index 0000000000000000000000000000000000000000..a1312a7a8dd7bafa42294bb447901f9b87b168ce Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product076.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product077.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product077.png new file mode 100644 index 0000000000000000000000000000000000000000..c609ffa091d855a7cdce1cff3e98a51b7f6275b7 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product077.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product078.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product078.png new file mode 100644 index 0000000000000000000000000000000000000000..d3051e228bc7be3df44f1e1adbd1adf9f8d0bc4a Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product078.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product079.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product079.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product079.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product080.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product080.png new file mode 100644 index 0000000000000000000000000000000000000000..314780f3e17383f53da325c00207294965d952f9 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product080.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product081.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product081.png new file mode 100644 index 0000000000000000000000000000000000000000..9ed4fbcbb8d77582afb2b6101180c97b08f21c31 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product081.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product082.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product082.png new file mode 100644 index 0000000000000000000000000000000000000000..9c7d458ae1d7661c0106779ade03a22ec2679218 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product082.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product083.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product083.png new file mode 100644 index 0000000000000000000000000000000000000000..e76eb74da07e5de1bd0282d60431c32546164605 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product083.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product084.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product084.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf33cc27eca2adb471fefe5a7dfde782cf87b75 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product084.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product085.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product085.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf33cc27eca2adb471fefe5a7dfde782cf87b75 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product085.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product086.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product086.png new file mode 100644 index 0000000000000000000000000000000000000000..705d9184884e52bf7a371e89f4f61e573ce138de Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product086.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product087.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product087.png new file mode 100644 index 0000000000000000000000000000000000000000..9bc3f632a780248915639ece2c87dc160ee26809 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product087.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product088.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product088.png new file mode 100644 index 0000000000000000000000000000000000000000..9ed4fbcbb8d77582afb2b6101180c97b08f21c31 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product088.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product089.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product089.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product089.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product090.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product090.png new file mode 100644 index 0000000000000000000000000000000000000000..b4cbfcc43e07c9cf0558b40cd76ea9ee00319a83 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product090.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product091.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product091.png new file mode 100644 index 0000000000000000000000000000000000000000..c14053233a161826197f2b1bb5ba26f4af1fe33c Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product091.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product092.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product092.png new file mode 100644 index 0000000000000000000000000000000000000000..c14053233a161826197f2b1bb5ba26f4af1fe33c Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product092.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product093.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product093.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product093.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product094.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product094.png new file mode 100644 index 0000000000000000000000000000000000000000..0b66e62736610bfbc76457a8ccbe2b8e58dec6f3 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product094.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product095.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product095.png new file mode 100644 index 0000000000000000000000000000000000000000..44253af669791059a8f8e27fb307968b90a846a6 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product095.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product096.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product096.png new file mode 100644 index 0000000000000000000000000000000000000000..44253af669791059a8f8e27fb307968b90a846a6 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product096.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product097.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product097.png new file mode 100644 index 0000000000000000000000000000000000000000..9adb757c7cfd693c267929bea166c01cd4bea9cb Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product097.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product098.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product098.png new file mode 100644 index 0000000000000000000000000000000000000000..45bf20d16a268649345bc964b68948d1b262d626 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product098.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product099.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product099.png new file mode 100644 index 0000000000000000000000000000000000000000..d0566734f2ce1888ca3dcb3adef7692ff68c58f9 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product099.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product100.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product100.png new file mode 100644 index 0000000000000000000000000000000000000000..49ad8f50dc013e5b4eceabb40f5ff321986655b5 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product100.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product101.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product101.png new file mode 100644 index 0000000000000000000000000000000000000000..938824bd09b5e76ecbd4fe92ddead80a872d8d55 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product101.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product102.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product102.png new file mode 100644 index 0000000000000000000000000000000000000000..4837ad597be0512798307a03cde3c6438ccad3d9 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product102.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product103.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product103.png new file mode 100644 index 0000000000000000000000000000000000000000..88a8462f9002b73131dcb072cf6af309a71640cf Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product103.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product104.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product104.png new file mode 100644 index 0000000000000000000000000000000000000000..417a04a54bbf47fe383073c7e90b77630b50bbb7 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product104.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product105.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product105.png new file mode 100644 index 0000000000000000000000000000000000000000..b4cbfcc43e07c9cf0558b40cd76ea9ee00319a83 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product105.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product106.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product106.png new file mode 100644 index 0000000000000000000000000000000000000000..1f1acc8c5ebc9c7a16904a6d56c4412c62a52285 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product106.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product107.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product107.png new file mode 100644 index 0000000000000000000000000000000000000000..5f78782102faf9de1732a0e48a881f59475cd8ca Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product107.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product108.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product108.png new file mode 100644 index 0000000000000000000000000000000000000000..f217ad4e94a8d363f9cb54d9da70d12685277a21 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product108.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product109.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product109.png new file mode 100644 index 0000000000000000000000000000000000000000..7f04ac0ba5eafeb72999a119bd55f6c9142ac0db Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product109.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product110.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product110.png new file mode 100644 index 0000000000000000000000000000000000000000..d3051e228bc7be3df44f1e1adbd1adf9f8d0bc4a Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product110.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product111.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product111.png new file mode 100644 index 0000000000000000000000000000000000000000..c10dbdbc3fc4ac34c2e2b72d08dfc788608b1bb1 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product111.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product112.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product112.png new file mode 100644 index 0000000000000000000000000000000000000000..21ece0bb0091227a207d5c8b90d58d290586474f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product112.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product113.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product113.png new file mode 100644 index 0000000000000000000000000000000000000000..9ed4fbcbb8d77582afb2b6101180c97b08f21c31 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product113.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product114.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product114.png new file mode 100644 index 0000000000000000000000000000000000000000..9de0d85f2417e17ba73144820853110fc25ac6ce Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product114.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product115.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product115.png new file mode 100644 index 0000000000000000000000000000000000000000..f7c8f95862bb029a50b856401269ee03c933b407 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product115.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product116.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product116.png new file mode 100644 index 0000000000000000000000000000000000000000..f7c8f95862bb029a50b856401269ee03c933b407 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product116.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product117.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product117.png new file mode 100644 index 0000000000000000000000000000000000000000..c14053233a161826197f2b1bb5ba26f4af1fe33c Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product117.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product118.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product118.png new file mode 100644 index 0000000000000000000000000000000000000000..458f09ea0fa25b83dd61bca7f14a14dab572e78e Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product118.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product119.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product119.png new file mode 100644 index 0000000000000000000000000000000000000000..4d2f5c932b1375f8bec7357d83ee494a3914fdf1 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product119.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product120.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product120.png new file mode 100644 index 0000000000000000000000000000000000000000..978c55a0d8d562a38571cc2fae91b2dc49ed3a48 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product120.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product121.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product121.png new file mode 100644 index 0000000000000000000000000000000000000000..6f31d0e62d52f2984e3860560f8bfbdb99e06709 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product121.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product122.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product122.png new file mode 100644 index 0000000000000000000000000000000000000000..921bae5ad26b43270f2bb3ea0cadabcd46788d81 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product122.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product123.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product123.png new file mode 100644 index 0000000000000000000000000000000000000000..6f31d0e62d52f2984e3860560f8bfbdb99e06709 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product123.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product124.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product124.png new file mode 100644 index 0000000000000000000000000000000000000000..6f31d0e62d52f2984e3860560f8bfbdb99e06709 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product124.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product125.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product125.png new file mode 100644 index 0000000000000000000000000000000000000000..1215a3de7f36eb3e27f4ae314caa5724824d2d7b Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product125.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product126.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product126.png new file mode 100644 index 0000000000000000000000000000000000000000..1215a3de7f36eb3e27f4ae314caa5724824d2d7b Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product126.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product127.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product127.png new file mode 100644 index 0000000000000000000000000000000000000000..1215a3de7f36eb3e27f4ae314caa5724824d2d7b Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product127.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product128.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product128.png new file mode 100644 index 0000000000000000000000000000000000000000..c14053233a161826197f2b1bb5ba26f4af1fe33c Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product128.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product129.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product129.png new file mode 100644 index 0000000000000000000000000000000000000000..c14053233a161826197f2b1bb5ba26f4af1fe33c Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product129.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product130.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product130.png new file mode 100644 index 0000000000000000000000000000000000000000..ee1711697bb2963449b827f9a5945b87d72cde4f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product130.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product131.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product131.png new file mode 100644 index 0000000000000000000000000000000000000000..e61848828914add9583aabc341ecbc61127a636e Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product131.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product132.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product132.png new file mode 100644 index 0000000000000000000000000000000000000000..0db84811a60bbc7e21c25c36648ce49d53a50d71 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product132.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product133.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product133.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf33cc27eca2adb471fefe5a7dfde782cf87b75 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product133.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product134.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product134.png new file mode 100644 index 0000000000000000000000000000000000000000..ab177fa38d232356127187b77cb95a161d122ed6 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product134.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product135.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product135.png new file mode 100644 index 0000000000000000000000000000000000000000..7d6b31f1fde94ffb9d519bdbbaee26758a5c1606 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product135.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product136.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product136.png new file mode 100644 index 0000000000000000000000000000000000000000..a1312a7a8dd7bafa42294bb447901f9b87b168ce Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product136.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product137.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product137.png new file mode 100644 index 0000000000000000000000000000000000000000..c609ffa091d855a7cdce1cff3e98a51b7f6275b7 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product137.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product138.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product138.png new file mode 100644 index 0000000000000000000000000000000000000000..d3051e228bc7be3df44f1e1adbd1adf9f8d0bc4a Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product138.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product139.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product139.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product139.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product140.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product140.png new file mode 100644 index 0000000000000000000000000000000000000000..314780f3e17383f53da325c00207294965d952f9 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/productImg/product140.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend1.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend1.png new file mode 100644 index 0000000000000000000000000000000000000000..a1312a7a8dd7bafa42294bb447901f9b87b168ce Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend1.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend10.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend10.png new file mode 100644 index 0000000000000000000000000000000000000000..81d8de682ce8c4acb55360de61d844c8869a978b Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend10.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend11.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend11.png new file mode 100644 index 0000000000000000000000000000000000000000..9c7d458ae1d7661c0106779ade03a22ec2679218 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend11.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend12.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend12.png new file mode 100644 index 0000000000000000000000000000000000000000..1f1acc8c5ebc9c7a16904a6d56c4412c62a52285 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend12.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend13.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend13.png new file mode 100644 index 0000000000000000000000000000000000000000..0dca9293ae7549c384c59d53503928d8f217d64c Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend13.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend2.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend2.png new file mode 100644 index 0000000000000000000000000000000000000000..bc3041360680644bb7789e0797eb6c63dfa98af0 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend2.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend3.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend3.png new file mode 100644 index 0000000000000000000000000000000000000000..102b21a98f43faca22017332cfa97450d4d49c7e Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend3.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend4.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend4.png new file mode 100644 index 0000000000000000000000000000000000000000..1d19af4cbc8c63ae51c7b6a3ce4ab3ee83514e5d Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend4.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend5.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend5.png new file mode 100644 index 0000000000000000000000000000000000000000..6839e9b059c8dfaca3811ff0987d6375dee3523d Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend5.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend6.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend6.png new file mode 100644 index 0000000000000000000000000000000000000000..b3878bb7f481e9ed940bdd13872b34f94e2478a8 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend6.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend7.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend7.png new file mode 100644 index 0000000000000000000000000000000000000000..d0e563aa07f1f847bc8e00bdf9e8a942c14c58cd Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend7.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend9.png b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend9.png new file mode 100644 index 0000000000000000000000000000000000000000..08e1dcd0b045d71e86fffbfb2077ff5e3edfbc9f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/homeImg/recommendImg/recommend9.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/indexData.js b/JSUI/JsShopping/entry/src/main/js/default/common/indexData.js new file mode 100644 index 0000000000000000000000000000000000000000..0c43bb4110eda852d47e03046a29c135dc03ae5a --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/common/indexData.js @@ -0,0 +1,63 @@ +/* + * 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. + */ +var tabbarData = [ + { + i: 0, + title: '首页', + color:'#515151', + selectedColor:'#EEB174', + img: '/common/Icon/home.png', + selectedImg: '/common/Icon/selected_home.png', + show: true, + }, + { + i: 1, + title: '分类', + color:'#515151', + selectedColor:'#EEB174', + img: '/common/Icon/classification.png', + selectedImg: '/common/Icon/selecteds.png', + show: false, + }, + { + i: 1, + title: '发现', + color:'#515151', + selectedColor:'#EEB174', + img: '/common/Icon/find.png', + selectedImg: '/common/Icon/selected_find.png', + show: false, + }, + { + i: 2, + title: '购物车', + color:'#515151', + selectedColor:'#EEB174', + img: '/common/Icon/cart.png', + selectedImg: '/common/Icon/selected_cart.png', + show: false, + }, + { + i: 3, + title: '我的', + color:'#515151', + selectedColor:'#EEB174', + img: '/common/Icon/user.png', + selectedImg: '/common/Icon/selected_user.png', + show: false, + } +] + +export default tabbarData; \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/microAmoyData.js b/JSUI/JsShopping/entry/src/main/js/default/common/microAmoyData.js new file mode 100644 index 0000000000000000000000000000000000000000..32bd39044c0cdc3db0b2d2a82953427b0b210b5c --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/common/microAmoyData.js @@ -0,0 +1,258 @@ +/* + * 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. + */ +var amoyData = [ + { + topdata: { + img1: '/common/homeImg/microImg/micro_logo1.png', + text1: 'XX旗舰店', + text2: '优选品牌 1小时前', + imgright1: '/common/homeImg/microImg/micro_other1.png', + imgright2: '/common/homeImg/microImg/micro_other2.png', + imgright3: '/common/Icon/twoarrow.png', + imgcenter1: '/common/homeImg/microImg/micro_title1.png', + textcenter: '#XX智慧屏 XX P40 Pro+ 5G 全网通 8GB+256GB (陶瓷黑)市', + }, + imgcenter: [ + { + icon: '/common/homeImg/microImg/micro1.png', + }, + { + icon: '/common/homeImg/microImg/micro2.png', + }, + { + icon: '/common/homeImg/microImg/micro3.png', + }, + { + icon: '/common/homeImg/microImg/micro4.png', + }, + { + icon: '/common/homeImg/microImg/micro5.png', + }, + { + icon: '/common/homeImg/microImg/micro6.png', + }, + { + icon: '/common/homeImg/microImg/micro7.png', + }, + { + icon: '/common/homeImg/microImg/micro8.png', + }, + { + icon: '/common/homeImg/microImg/micro9.png', + }, + ], + imgbottom: { + text1: '3万人购买', + imgbottom1: '/common/Icon/like.png', + text2: '28000', + imgbottom2: '/common/Icon/comment.png', + text3: '1298' + } + }, + { + topdata: { + img1: '/common/homeImg/microImg/micro_logo2.png', + text1: 'XX旗舰店', + text2: '官方品牌 2小时前', + imgright1: '/common/homeImg/microImg/micro_other1.png', + imgright2: '/common/homeImg/microImg/micro_other2.png', + imgright3: '/common/Icon/twoarrow.png', + imgcenter1: '/common/homeImg/microImg/micro_title2.png', + textcenter: 'XX旗舰店推出的最新XX手机,内存大,耗电少,高速上网', + }, + imgcenter: [ + { + icon: '/common/homeImg/microImg/micro1.png', + }, + { + icon: '/common/homeImg/microImg/micro2.png', + }, + { + icon: '/common/homeImg/microImg/micro3.png', + }, + { + icon: '/common/homeImg/microImg/micro4.png', + }, + { + icon: '/common/homeImg/microImg/micro5.png', + }, + { + icon: '/common/homeImg/microImg/micro6.png', + }, + { + icon: '/common/homeImg/microImg/micro7.png', + }, + { + icon: '/common/homeImg/microImg/micro8.png', + }, + { + icon: '/common/homeImg/microImg/micro9.png', + }, + ], + imgbottom: { + text1: '3万人购买', + imgbottom1: '/common/Icon/like.png', + text2: '28000', + imgbottom2: '/common/Icon/comment.png', + text3: '1562' + } + }, + { + topdata: { + img1: '/common/homeImg/microImg/micro_logo3.png', + text1: 'XX旗舰店', + text2: '优选好店 3小时前', + imgright1: '/common/homeImg/microImg/micro_other1.png', + imgright2: '/common/homeImg/microImg/micro_other2.png', + imgright3: '/common/Icon/twoarrow.png', + imgcenter1: '/common/homeImg/microImg/micro_title3.png', + textcenter: 'XX手机,高效智能,支持语音模式', + }, + imgcenter: [ + { + icon: '/common/homeImg/microImg/micro1.png', + }, + { + icon: '/common/homeImg/microImg/micro2.png', + }, + { + icon: '/common/homeImg/microImg/micro3.png', + }, + { + icon: '/common/homeImg/microImg/micro4.png', + }, + { + icon: '/common/homeImg/microImg/micro5.png', + }, + { + icon: '/common/homeImg/microImg/micro6.png', + }, + { + icon: '/common/homeImg/microImg/micro7.png', + }, + { + icon: '/common/homeImg/microImg/micro8.png', + }, + { + icon: '/common/homeImg/microImg/micro9.png', + }, + ], + imgbottom: { + text1: '3万人购买', + imgbottom1: '/common/Icon/like.png', + text2: '28000', + imgbottom2: '/common/Icon/comment.png', + text3: '4212' + } + }, + { + topdata: { + img1: '/common/homeImg/microImg/micro_logo4.png', + text1: 'XX旗舰店', + text2: '优选品牌 5小时前', + imgright1: '/common/homeImg/microImg/micro_other1.png', + imgright2: '/common/homeImg/microImg/micro_other2.png', + imgright3: '/common/Icon/twoarrow.png', + imgcenter1: '/common/homeImg/microImg/micro_title4.png', + textcenter: 'XX Mate 40 5G 全网通 8GB+128GB (亮黑色)', + }, + imgcenter: [ + { + icon: '/common/homeImg/microImg/micro1.png', + }, + { + icon: '/common/homeImg/microImg/micro2.png', + }, + { + icon: '/common/homeImg/microImg/micro3.png', + }, + { + icon: '/common/homeImg/microImg/micro4.png', + }, + { + icon: '/common/homeImg/microImg/micro5.png', + }, + { + icon: '/common/homeImg/microImg/micro6.png', + }, + { + icon: '/common/homeImg/microImg/micro7.png', + }, + { + icon: '/common/homeImg/microImg/micro8.png', + }, + { + icon: '/common/homeImg/microImg/micro9.png', + }, + ], + imgbottom: { + text1: '3万人购买', + imgbottom1: '/common/Icon/like.png', + text2: '28000', + imgbottom2: '/common/Icon/comment.png', + text3: '2412' + } + }, + { + topdata: { + img1: '/common/homeImg/microImg/micro_logo5.png', + text1: 'XX旗舰店', + text2: '优选品牌 8小时前', + imgright1: '/common/homeImg/microImg/micro_other1.png', + imgright2: '/common/homeImg/microImg/micro_other2.png', + imgright3: '/common/Icon/twoarrow.png', + imgcenter1: '/common/homeImg/microImg/micro_title5.png', + textcenter: '#XX智慧屏 XX P40 Pro+ 5G 全网通 8GB+256GB (陶瓷黑)', + }, + imgcenter: [ + { + icon: '/common/homeImg/microImg/micro1.png', + }, + { + icon: '/common/homeImg/microImg/micro2.png', + }, + { + icon: '/common/homeImg/microImg/micro3.png', + }, + { + icon: '/common/homeImg/microImg/micro4.png', + }, + { + icon: '/common/homeImg/microImg/micro5.png', + }, + { + icon: '/common/homeImg/microImg/micro6.png', + }, + { + icon: '/common/homeImg/microImg/micro7.png', + }, + { + icon: '/common/homeImg/microImg/micro8.png', + }, + { + icon: '/common/homeImg/microImg/micro9.png', + }, + ], + imgbottom: { + text1: '3万人购买', + imgbottom1: '/common/Icon/like.png', + text2: '28000', + imgbottom2: '/common/Icon/comment.png', + text3: '32·12' + } + }, +] + +export default amoyData; \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/pageHomeData.js b/JSUI/JsShopping/entry/src/main/js/default/common/pageHomeData.js new file mode 100644 index 0000000000000000000000000000000000000000..2829d85f7044f651ed908bade645db580f4f25ee --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/common/pageHomeData.js @@ -0,0 +1,227 @@ +/* + * 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. + */ +var homedata = { + searchbarIcon: [ + { + url: '/common/images/img1/arrow.png' + }, + { + url: '/common/Icon/search.png' + }, + { + url: '/common/Icon/photo.png' + }, + { + url: '/common/Icon/scan.png' + }, + { + url: '/common/Icon/barcode.png' + }, + { + url: '/common/Icon/nav_classification.png' + } + ], + navbarData: [ + { + i: 0, + color: '#FF7500', + show: true, + title: '首页' + }, + { + i: 1, + color: '#878787', + show: false, + title: '推荐' + }, + { + i: 2, + color: '#878787', + show: false, + title: 'XX专区' + }, + { + i: 3, + color: '#878787', + show: false, + title: '莫塞尔专区' + }, + { + i: 4, + color: '#878787', + show: false, + title: '新品频道' + }, + { + i: 5, + color: '#878787', + show: false, + title: '智能家居' + }, + { + i: 6, + color: '#878787', + show: false, + title: 'P40系列' + }, + { + i: 7, + color: '#878787', + show: false, + title: '拼团' + }, + { + i: 8, + color: '#878787', + show: false, + title: '企业购' + }, + ], + bannerData: [ + { + uri: '/common/homeImg/bannerImg/banner1.jpg', + }, + { + uri: '/common/homeImg/bannerImg/banner2.jpg', + }, + { + uri: '/common/homeImg/bannerImg/banner3.jpg', + }, + { + uri: '/common/homeImg/bannerImg/banner4.jpg', + }, + { + uri: '/common/homeImg/bannerImg/banner4.jpg', + } + ], + coreData: [ + { + uri: '/common/homeImg/coreImg/core1.png', + title: '火爆热款' + }, + { + uri: '/common/homeImg/coreImg/core2.png', + title: '商品分类' + }, + { + uri: '/common/homeImg/coreImg/core3.png', + title: '充值中心' + }, + { + uri: '/common/homeImg/coreImg/core4.png', + title: '活动专区' + }, + { + uri: '/common/homeImg/coreImg/core5.png', + title: '积分商城' + }, + { + uri: '/common/homeImg/coreImg/core6.png', + title: '精选热卖' + }, + { + uri: '/common/homeImg/coreImg/core7.png', + title: '酒店订购' + }, + { + uri: '/common/homeImg/coreImg/core8.png', + title: '好物众测' + }, + { + uri: '/common/homeImg/coreImg/core9.png', + title: '精品手机' + }, + { + uri: '/common/homeImg/coreImg/core10.png', + title: '数码电器' + }, + { + uri: '/common/homeImg/coreImg/core11.png', + title: '数码配件' + }, + { + uri: '/common/homeImg/coreImg/core12.png', + title: '以旧换新' + }, + { + uri: '/common/homeImg/coreImg/core13.png', + title: '限时抢购' + }, + { + uri: '/common/homeImg/coreImg/core14.png', + title: '新品推荐' + }, + { + uri: '/common/homeImg/coreImg/core15.png', + title: '邀请有礼' + }, + { + uri: '/common/homeImg/coreImg/core16.png', + title: '优惠专区' + }, + { + uri: '/common/homeImg/coreImg/core17.png', + title: '正在直播' + }, + { + uri: '/common/homeImg/coreImg/core18.png', + title: '智慧生活' + }, + { + uri: '/common/homeImg/coreImg/core19.png', + title: '会员中心' + } + ], + recommendedData: [ + { + text1: 'XX phone', + text2: '最高优惠200元', + url1: '/common/homeImg/recommendImg/recommend1.png', + url2: '/common/homeImg/recommendImg/recommend2.png', + }, + { + text1: 'XX watch', + text2: '500元起', + url1: '/common/homeImg/recommendImg/recommend3.png', + url2: '/common/homeImg/recommendImg/recommend4.png' + }, + { + text1: 'phone & watch', + text2: '8折起购', + url1: '/common/homeImg/recommendImg/recommend5.png', + url2: '/common/homeImg/recommendImg/recommend6.png' + }, + { + text1: 'XX配件', + text2: '500元起', + url1: '/common/homeImg/recommendImg/recommend7.png', + url2: '/common/homeImg/recommendImg/recommend13.png' + }, + { + text1: 'XX笔记本', + text2: '5000元起', + url1: '/common/homeImg/recommendImg/recommend9.png', + url2: '/common/homeImg/recommendImg/recommend10.png', + }, + { + text1: 'XX笔记本', + text2: '4000元起', + url1: '/common/homeImg/recommendImg/recommend11.png', + url2: '/common/homeImg/recommendImg/recommend12.png' + } + ], +} + +export default homedata; \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/performanceData.js b/JSUI/JsShopping/entry/src/main/js/default/common/performanceData.js new file mode 100644 index 0000000000000000000000000000000000000000..b6ffe6e6cdaaf72a184cc478a077deb4b918ab32 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/common/performanceData.js @@ -0,0 +1,168 @@ +/* + * 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. + */ +var comments = [ + { + comment1: [ + { + avator: '/common/performanceImg/micro_logo1.png', + evaluation: '/common/Icon/vip.png', + name: 'L**8', + size: '5G 全网通 8G+128G', + texts: '质量好,网速快,内存大', + }, + { + avator: '/common/performanceImg/micro_logo2.png', + evaluation: '/common/Icon/masonry.png', + name: 'B**1', + size: '5G 全网通 双卡 亮黑色', + texts: '质量好,握着舒适,点赞', + }, + { + avator: '/common/performanceImg/micro_logo3.png', + evaluation: '/common/Icon/love.png', + name: 'r**s', + size: 'Mate40 Pro+ 全网通 8+256', + texts: '手机轻,超级薄,强烈推荐', + }, + { + avator: '/common/performanceImg/micro_logo4.png', + evaluation: '/common/Icon/star.png', + name: 'g**d', + size: 'XX nova 8系列', + texts: '运行速度快,内存容量大', + } + ], + comment2: { + avator: '/common/performanceImg/micro_logo5.png', + evaluation: '/common/Icon/suns.png', + name: '3**e', + size: '5G 全网通 双卡 亮黑色', + texts: '款式优美,双卡双待,值得拥有', + images: [ + { + url: '/common/performanceImg/micro1.png' + }, + { + url: '/common/performanceImg/micro2.png' + }, + { + url: '/common/performanceImg/micro3.png' + }, + ], + }, + }, + { + comment1: [ + { + avator: '/common/performanceImg/micro_logo1.png', + evaluation: '/common/Icon/vip.png', + name: 'L**8', + size: '5G 全网通 8G+128G', + texts: '质量好,网速快,内存大', + }, + { + avator: '/common/performanceImg/micro_logo2.png', + evaluation: '/common/Icon/masonry.png', + name: 'B**1', + size: '5G 全网通 双卡 亮黑色', + texts: '质量好,握着舒适,点赞', + }, + { + avator: '/common/performanceImg/micro_logo3.png', + evaluation: '/common/Icon/love.png', + name: 'r**s', + size: 'Mate40 Pro+ 全网通 8+256', + texts: '手机轻,超级薄,强烈推荐', + }, + { + avator: '/common/performanceImg/micro_logo4.png', + evaluation: '/common/Icon/star.png', + name: 'g**d', + size: 'XX nova 8系列', + texts: '运行速度快,内存容量大', + } + ], + comment2: { + avator: '/common/performanceImg/micro_logo5.png', + evaluation: '/common/Icon/suns.png', + name: '3**e', + size: '5G 全网通 双卡 亮黑色', + texts: '款式优美,双卡双待,值得拥有', + images: [ + { + url: '/common/performanceImg/micro4.png' + }, + { + url: '/common/performanceImg/micro5.png' + }, + { + url: '/common/performanceImg/micro6.png' + }, + ], + }, + }, + { + comment1: [ + { + avator: '/common/performanceImg/micro_logo1.png', + evaluation: '/common/Icon/vip.png', + name: 'L**8', + size: '5G 全网通 8G+128G', + texts: '质量好,网速快,内存大', + }, + { + avator: '/common/performanceImg/micro_logo2.png', + evaluation: '/common/Icon/masonry.png', + name: 'B**1', + size: '5G 全网通 双卡 亮黑色', + texts: '质量好,握着舒适,点赞', + }, + { + avator: '/common/performanceImg/micro_logo3.png', + evaluation: '/common/Icon/love.png', + name: 'r**s', + size: 'Mate40 Pro+ 全网通 8+256', + texts: '非常适合我,庆幸抢先购到手', + }, + { + avator: '/common/performanceImg/micro_logo4.png', + evaluation: '/common/Icon/star.png', + name: 'g**d', + size: 'Mate 40 5G 全网通 6G+128G', + texts: '运行速度快,内存容量大', + } + ], + comment2: { + avator: '/common/performanceImg/micro_logo5.png', + evaluation: '/common/Icon/suns.png', + name: '3**e', + size: '5G 全网通 双卡 亮黑色', + texts: '款式优美,双卡双待,值得拥有', + images: [ + { + url: '/common/performanceImg/micro7.png' + }, + { + url: '/common/performanceImg/micro8.png' + }, + { + url: '/common/performanceImg/micro9.png' + }, + ], + }, + }, +] + +export default comments; \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro1.png b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro1.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf33cc27eca2adb471fefe5a7dfde782cf87b75 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro1.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro2.png b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro2.png new file mode 100644 index 0000000000000000000000000000000000000000..f7c8f95862bb029a50b856401269ee03c933b407 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro2.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro3.png b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro3.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro3.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro4.png b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro4.png new file mode 100644 index 0000000000000000000000000000000000000000..d3051e228bc7be3df44f1e1adbd1adf9f8d0bc4a Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro4.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro5.png b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro5.png new file mode 100644 index 0000000000000000000000000000000000000000..86bfb4697be2e0a445ec892281f52803694b9657 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro5.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro6.png b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro6.png new file mode 100644 index 0000000000000000000000000000000000000000..bdf33cc27eca2adb471fefe5a7dfde782cf87b75 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro6.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro7.png b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro7.png new file mode 100644 index 0000000000000000000000000000000000000000..b4cbfcc43e07c9cf0558b40cd76ea9ee00319a83 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro7.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro8.png b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro8.png new file mode 100644 index 0000000000000000000000000000000000000000..705d9184884e52bf7a371e89f4f61e573ce138de Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro8.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro9.png b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro9.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a637c844a516b8a8e0e2522a7fbb2968b8759f Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro9.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro_logo1.png b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro_logo1.png new file mode 100644 index 0000000000000000000000000000000000000000..fc78ba4b07b2600aeccf86e2cdebcc89dccebd77 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro_logo1.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro_logo2.png b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro_logo2.png new file mode 100644 index 0000000000000000000000000000000000000000..901ec370b14ad64b06729870114a7533bef55c94 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro_logo2.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro_logo3.png b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro_logo3.png new file mode 100644 index 0000000000000000000000000000000000000000..ee1b054e9db485d0da1e4f219e25b36fd7aa6c04 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro_logo3.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro_logo4.png b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro_logo4.png new file mode 100644 index 0000000000000000000000000000000000000000..574508fb71a2c3bd66ad6ff63e0a7984811c0130 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro_logo4.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro_logo5.png b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro_logo5.png new file mode 100644 index 0000000000000000000000000000000000000000..583a0bfaf3a55ac37468be6bb4b3c1e2f09b5e66 Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/js/default/common/performanceImg/micro_logo5.png differ diff --git a/JSUI/JsShopping/entry/src/main/js/default/common/productListData.js b/JSUI/JsShopping/entry/src/main/js/default/common/productListData.js new file mode 100644 index 0000000000000000000000000000000000000000..63066a42fbf8179308f28432d842835ad3536259 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/common/productListData.js @@ -0,0 +1,998 @@ +/* + * 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. + */ +var productsData = [ + { + uri: '/common/homeImg/productImg/product001.png', + title: '【XX设备】优惠直购', + labels: '尊享', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product002.png', + title: '送给亲人!快速购买', + labels: '纯色', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product003.png', + title: '高质量产品', + labels: '净含量:350g', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product004.png', + title: 'XXpro手机', + labels: '材质:玻璃/金属/塑料', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product005.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product006.png', + title: '【XX设备】优惠直购', + labels: '尊享', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product007.png', + title: '送给亲人!快速购买', + labels: '纯色', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product008.png', + title: '高质量产品', + labels: '净含量:350g', + price: '¥4122.0', + index: '', + }, + { + uri: '/common/homeImg/productImg/product009.png', + title: 'XXpro手机', + labels: '材质:玻璃/金属/塑料', + price: '¥4122.0', + index: '', + }, + { + uri: '/common/homeImg/productImg/product010.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '', + }, + { + uri: '/common/homeImg/productImg/product011.png', + title: '【XX设备】优惠直购', + labels: '尊享', + price: '¥4122.0', + index: '', + }, + { + uri: '/common/homeImg/productImg/product012.png', + title: '送给亲人!快速购买', + labels: '纯色', + price: '¥4122.0', + index: '', + }, + { + uri: '/common/homeImg/productImg/product013.png', + title: '高质量产品', + labels: '净含量:350g', + price: '¥4122.0', + index: '', + }, + { + uri: '/common/homeImg/productImg/product014.png', + title: 'XXpro手机', + labels: '材质:玻璃/金属/塑料', + price: '¥4122.0', + index: '', + }, + { + uri: '/common/homeImg/productImg/product015.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '', + }, + { + uri: '/common/homeImg/productImg/product016.png', + title: '【XX设备】优惠直购', + labels: '尊享', + price: '¥4122.0', + index: '', + }, + { + uri: '/common/homeImg/productImg/product017.png', + title: '送给亲人!快速购买', + labels: '纯色', + price: '¥4122.0', + index: '', + }, + { + uri: '/common/homeImg/productImg/product018.png', + title: '高质量产品', + labels: '净含量:350g', + price: '¥4122.0', + index: '', + }, + { + uri: '/common/homeImg/productImg/product019.png', + title: 'XXpro手机', + labels: '材质:玻璃/金属/塑料', + price: '¥4122.0', + index: '', + }, + { + uri: '/common/homeImg/productImg/product020.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '', + }, + { + uri: '/common/homeImg/productImg/product021.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '', + }, + { + uri: '/common/homeImg/productImg/product022.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '', + }, + { + uri: '/common/homeImg/productImg/product023.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '', + }, + { + uri: '/common/homeImg/productImg/product024.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '', + }, + { + uri: '/common/homeImg/productImg/product025.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '', + }, + { + uri: '/common/homeImg/productImg/product026.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '', + }, + { + uri: '/common/homeImg/productImg/product027.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product028.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product029.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product030.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product031.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product032.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product033.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product034.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product035.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product036.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product037.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product038.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product039.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product040.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product041.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product042.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product043.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product044.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product045.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product046.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product047.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product048.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product049.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product050.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product051.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product052.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product053.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product054.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product055.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product056.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product057.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product058.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product059.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product060.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product061.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product062.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product063.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product064.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product065.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product066.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product067.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product068.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product069.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product070.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product071.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product072.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product073.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product074.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product075.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product076.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product077.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product078.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product079.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product080.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product081.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product082.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product083.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product084.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product085.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product086.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product087.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product088.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product089.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product090.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product091.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product092.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product093.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product094.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product095.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product096.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product097.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product098.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product099.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product100.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product101.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product102.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product103.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product104.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product105.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product106.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product107.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product108.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product109.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product110.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product111.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product112.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product113.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product114.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product115.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product116.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product117.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product118.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product119.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product120.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product121.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product122.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product123.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product124.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product125.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product126.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product127.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product128.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product129.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product130.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product131.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product132.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product133.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product134.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product135.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product136.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product137.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product138.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product139.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + }, + { + uri: '/common/homeImg/productImg/product140.png', + title: 'XX手机 限时特惠', + labels: '购买免运费 | 跨店', + price: '¥4122.0', + index: '' + } +] + +export default productsData; \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/i18n/en-US.json b/JSUI/JsShopping/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/i18n/zh-CN.json b/JSUI/JsShopping/entry/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/bannerSwiper/bannerSwiper.css b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/bannerSwiper/bannerSwiper.css new file mode 100644 index 0000000000000000000000000000000000000000..18aa33cd5ee0bfa32378e07aa0e328e60537e079 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/bannerSwiper/bannerSwiper.css @@ -0,0 +1,29 @@ +/* + * 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 { + flex-direction: column; +} +.swiper { + width: 100%; + height: 650px; +} +.swiperImg { + object-fit: contain; +} +.limitedImg { + width: 100%; + height: 100px; + object-fit: contain; +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/bannerSwiper/bannerSwiper.hml b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/bannerSwiper/bannerSwiper.hml new file mode 100644 index 0000000000000000000000000000000000000000..b69077aeb30343d2e8af125737c1b22444e699fe --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/bannerSwiper/bannerSwiper.hml @@ -0,0 +1,23 @@ + +
+ + + + + + +
\ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/bannerSwiper/bannerSwiper.js b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/bannerSwiper/bannerSwiper.js new file mode 100644 index 0000000000000000000000000000000000000000..1131c0144d771da28dd081c20f3a077904742a50 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/bannerSwiper/bannerSwiper.js @@ -0,0 +1,54 @@ +/* + * 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 { + props: ['bannerdata'], + data() { + return { + bannerData: this.bannerdata, + currIndex: 0, + currentTime: 0, + } + }, + changeTabIndex(e) { + this.currIndex = e.index; + if (this.currIndex != 0) { + this.$element('video').pause(); + } else { + this.$element('video').start(); + } + }, + onInit() { + this.$on('smallVideoTime', this.getPassValue); + this.$on('videoTime', this.setVideoTime) + }, + getBigVideoTime(e) { + this.currentTime = e.currenttime; + }, + getPassValue() { + this.$element('video').pause(); + this.$dispatch('receive', { + params: this.currentTime + }) + }, + setVideoTime(e) { + this.$element('video').setCurrentTime({ + currenttime: e.detail.params, + }); + this.$element('video').start(); + }, + playComplete() { + this.$element('video').start(); + } +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/deliveryInfo/deliveryInfo.css b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/deliveryInfo/deliveryInfo.css new file mode 100644 index 0000000000000000000000000000000000000000..426474832be651ff103b818558e279ffcb0f7f9f --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/deliveryInfo/deliveryInfo.css @@ -0,0 +1,360 @@ +/* + * 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 { + flex-direction: column; + width: 100%; + align-items: center; +} +.containone { + flex-direction: column; + width: 100%; + height: 150px; +} +.containone-texts1 { + height: 70px; + margin-top: 10px; +} +.containone-text1 { + color: #D2691E; +} +.containone-texts { + justify-content: space-between; +} +.containone-text2 { + background-color: #800000; + color: white; + padding: 0px 5px; + font-size: 25px; + margin-right: 20px; +} +.containone-text3 { + color: #D2691E; + font-size: 25px; + margin-right: 20px; +} +.containone-text4 { + color: #D2691E; + font-size: 25px; +} +.containone-img { + align-items: center; + justify-content: center; +} +.containone-img1 { + width: 25px; + height: 20px; + object-fit: contain; +} +.containtwo { + width: 100%; + flex-direction: column; +} +.containtwo-one { + width: 100%; + justify-content: space-between; +} +.containtwo-one-1 { + width: 85%; +} +.containtwo-one-intro { + max-lines: 2; + width: 80%; + text-overflow: ellipsis; +} +.containtwo-one-2 { + width: 15%; + align-items: center; + justify-content: center; +} + +.like { + width: 40px; + height: 40px; + object-fit: contain; +} +.icon { + width: 80px; + height: 40px; + object-fit: contain; +} +.share { + width: 25px; + height: 20px; + object-fit: contain; +} +.containtwo-two { + justify-content: space-around; + width: 100%; + margin-top: 10px; +} +.containtwo-two>div { + align-items: center;; +} +.containthree { + flex-direction: column; + width: 100%; + margin-top: 20px; +} +.containthree-one { + height: 100px; + background-color: rgba(250, 240, 230, 0.5); + align-items: center; +} +.containthree-one-img { + width: 80px; + height: 40px; + margin-right: 30px; + object-fit: contain; +} +.containthree-one-text { + flex: 1; + color: #C71585; +} +.containthree-two { + height: 100px; + align-items: center; + margin-top: 10px; +} +.containthree-text { + width: 15%; + text-align: left; +} +.containthree-three-div { + width: 100%; + align-items: center; + justify-content: space-between; +} +.containthree-right-img { + align-items: center; +} +.containthree-right { + width: 85%; + justify-content: space-between; + align-items: center; +} +.containthree-right>text { + width: 60%; + max-lines: 1; + text-overflow: ellipsis; +} +.containthree-rights { + justify-content: space-between; + align-items: center; + width: 85%; +} +.containthree-right1-left { + align-items: center; +} +.containthree-two-img { + width: 30px; + height: 40px; + margin-right: 20px; +} +.containthree-two-1 { + margin-right: 50px; +} +.containthree-three { + width: 100%; + flex-direction: column; +} +.containthree-three-img1 { + width: 150px; + height: 60px; + object-fit: contain; + margin-right: 10px; +} +.containthree-three-rights { + height: 150px; + flex-direction: column; +} +.containthree-three-comimg { + width: 25px; + height: 20px; + object-fit: contain; +} +.containthree-four { + margin: 5px 0; + height: 80px; + align-items: center; +} +.containthree-five { + flex-direction: column; + width: 100%; + margin: 10px 0px; + align-items: center; +} +.containthree-five-text { + justify-content: space-between; + align-items: center; + width: 85%; +} +.text-ell { + width: 80%; + max-lines: 1; + text-overflow: ellipsis; +} +.containthree-five-choose { + height: 70px; + align-items: center; +} +.containthree-six { + margin: 5px 0px; + height: 70px; + align-items: center; +} +.containthree-right-bottom { + align-items: center; +} +.phonetypes { + margin-left: 100px; + width: 45%; + justify-content: space-between; +} +.containthree-right-type { + width: 70px; + height: 80px; + object-fit: contain; + margin: 10px 0px; +} +.containthree-right-text { + margin-left: 50px; + background-color: rgba(250, 240, 230, 0.5); + border-radius: 30px; + font-size: 25px; + padding: 5px 10px; +} +.dialog-div { + flex-direction: column; + height: 1200px; +} +.dialog-head { + width: 100%; + height: 25%; + justify-content: space-between; + align-items: center; + flex-direction: row; +} +.dialog-head-img { + width: 25%; + object-fit: contain; +} +.dialog-head-div { + width: 72%; + justify-content: center; + flex-direction: column; +} +.dialog-head-text1 { + color: #FF0000; + font-size: 40px; +} +.dialog-head-text2 { + color: #808080; + font-size: 20px; +} +.dialog-head-text3 { + font-size: 30px; + max-lines: 1; + text-overflow: ellipsis; +} +.list { + width: 100%; +} +.list-title { + font-weight: bold; + font-size: 35px; + margin-bottom: 25px; +} +.list-common { + border-top: 1px solid #808080; + flex-direction: column; + padding-top: 25px; + padding-bottom: 25px; + padding-left: 30px; +} +.good-num { + justify-content: space-around; +} +.shopnum { + padding-left: 30px; + align-items: center; +} +.goodnum { + width: 50px; + height: 50px; + margin: 0px 5px; + text-align: center; + background-color: #30808080; +} +.list-content { + justify-content: space-between; +} +.location { + width: 40px; + height: 40px; + margin-right: 10px; + object-fit: contain; +} +.dialog-more { + width: 30px; + height: 30px; + object-fit: contain; +} +.capacity { + margin-right: 100px; +} +.phone-colors { + width: 70%; + flex-wrap: wrap; +} +.phone-color { + width: 33%; + height: 60px; + align-items: center; + margin: 10px 0px; + object-fit: contain; +} +.text-border { + color: #FF0000; + border: 1px solid #FF0000; + padding: 15px 20px; + border-radius: 20px; + margin-top: 20px; +} +.list-common-div { + flex-direction: column; +} +.cart { + width: 100%; + height: 100px; + margin-bottom: 15px; +} +.shopcat { + width: 50%; + height: 100%; + text-align: center; + background-color: #FFB700; + padding: 0px 30px; + border-top-left-radius: 50px; + border-bottom-left-radius: 50px; +} +.buynow { + width: 50%; + height: 100%; + text-align: center; + background-color: #FF7500; + padding: 0px 30px; + border-top-right-radius: 50px; + border-bottom-right-radius: 50px; +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/deliveryInfo/deliveryInfo.hml b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/deliveryInfo/deliveryInfo.hml new file mode 100644 index 0000000000000000000000000000000000000000..1449ba12336b3108cd815bed2cad43f25ffa658c --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/deliveryInfo/deliveryInfo.hml @@ -0,0 +1,302 @@ + +
+
+
+ + 该商品最高可享12期分期免息 + +
+
+
+ + 下单立减50元起 + + + 满5899减50 + + + 购买的积分 + +
+
+ + 查看 + + +
+
+
+
+
+
+ + {{deliveryInfo.texts.intro}} + +
+
+ + + 分享 + +
+
+
+
+ + + 1.3万 + +
+
+ + + 送礼 + +
+
+ + + 帮我选 + +
+
+
+
+
+ + + 此商品3月5日开卖,请火速加购 + +
+
+ + 发货 + +
+
+ + + 北京海淀 + + + 快递:0.00 + +
+ + 月销5.0万+ + +
+
+
+
+ + 活动 + +
+
+ + + 旧机回收,以旧换新 + +
+ +
+
+
+ +
+
+ + + 下单立送50元红包购买券 + +
+ +
+
+
+
+ + 保障 + +
+ + 假一赔十·免运费退换货·全国联保·极速退款 + + +
+
+
+
+ + 选择 + +
+ + 配送至:昌平区,选择 存储量,机身颜色,网络 + + +
+
+
+
+ +
+
+ + 共6种机身颜色可选 + +
+
+
+
+ + 参数 + +
+ + 网络类型 XX型号种类 + + +
+
+
+ +
+
+ +
+ + ¥ 5399-5899 + + + 库存1930件 + + + 配送至:昌平区,选择 存储量,机身颜色 + +
+
+ + + + 配送区域 + +
+
+ + + 北京海淀 + +
+ +
+
+ + + 存储容量 + +
+ + 8+128GB + + + 8+256GB + +
+
+ + + 机身颜色 + +
+
+ + {{$item.color-choose}} + +
+
+
+ + + 网络类型 + +
+ + SA/NSA双模(5G) + +
+
+ + + 套餐类型 + +
+ + 官方标配 + +
+
+ +
+
+ + 购买数量 + + + (限购2件) + +
+
+ + - + + + {{buyNumber}} + + + + + +
+
+
+ + + 特殊服务 + +
+
+ + 特殊服务 + + + 全国联保 【商家赠送】 + +
+
+
+
+
+ + 加入购物车 + + + 马上抢 + +
+
+
+
\ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/deliveryInfo/deliveryInfo.js b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/deliveryInfo/deliveryInfo.js new file mode 100644 index 0000000000000000000000000000000000000000..d84073b886a7bf373304f8284365b5e28983cb27 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/deliveryInfo/deliveryInfo.js @@ -0,0 +1,48 @@ +/* + * 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. + */ +import router from '@system.router'; + +export default { + props: [ + 'deliveryinfo', + 'commonimg' + ], + data() { + return { + deliveryInfo: this.deliveryinfo, + commonImg: this.commonimg, + buyNumber: 1, + } + }, + openOptions() { + this.$element('dialogs').show(); + }, + closeOptions() { + this.$element('dialogs').close(); + }, + redirect() { + router.push({ + uri: 'pages/performance/performance', + }); + }, + cutNumber() { + if (this.buyNumber > 1) { + this.buyNumber = this.buyNumber - 1; + } + }, + addNumber() { + this.buyNumber = this.buyNumber + 1; + }, +}; \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/detail/detail.css b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/detail/detail.css new file mode 100644 index 0000000000000000000000000000000000000000..375603d4ca9902e5ef478ed6bbfaa0de5043d87e --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/detail/detail.css @@ -0,0 +1,164 @@ +/* + * 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 { + flex-direction: column; + background-color: #FFFFFF; + transition-enter: enter; + transition-duration: 0ms; +} +.topshopcarts { + justify-content: space-between; + height: 65px; + width: 100%; + align-items: center; + background-color: rgba(250, 240, 230, 0.5); +} +.topshopcart { + margin: 5px 15px; + width:70px; +} +.topshopcartimg1 { + width: 100px; + object-fit: contain; +} +.topshopcartimg2 { + height: 40px; + object-fit: contain; +} +.list-swiper { + flex-direction: column; + align-items: center; +} +.list-swiper>button { + width: 90%; + height: 70px; +} +.content { + width: 100%; + flex-direction: row; + flex-wrap: wrap; +} +.recommend-box { + width: 50%; + height: 500px; + flex-direction: column; +} +.recommend-img { + width: 100%; + height: 70%; + object-fit: contain; +} +.recommend-good-name { + font-size: 27.1px; + color: #1A1A1A; + height: 80px; + max-lines: 1; + text-overflow: ellipsis; +} +.recommend-price { + height: 50px; + font-size: 30px; + color: #1A1A1A; +} +.malldetail-buy { + flex-direction: row; + height: 100px; + width: 100%; + position: fixed; + bottom: 0px; + justify-content: space-between; + background-color: white; +} +.shop-img { + width: 35%; + justify-content: space-between; +} +.malldetail-buy-com { + width: 35%; + height: 100%; + flex-direction: column; + align-items: center; + justify-content: center; +} +.malldetail-shopcart-img { + width: 45px; + height: 45px; +} +.malldetail-star-img { + width: 45px; + height: 45px; +} +.cart { + width: 60%; + align-items: center; +} +.malldetail-shopcart-add { + text-align: center; + width: 50%; + height: 70%; + background-color: #FFB700; + color: #FFFFFF; + font-size: 25px; + border-top-left-radius: 50px; + border-bottom-left-radius: 50px; +} +.malldetail-now-buy { + text-align: center; + width: 50%; + height: 70%; + background-color: #FF7500; + color: #FFFFFF; + font-size: 25px; + border-top-right-radius: 50px; + border-bottom-right-radius: 50px; +} +.smallVideos { + flex-direction: column; + width: 300px; + height: 250px; + border: 1px solid #808080; + position: fixed; + top: 300px; + right: 10px; +} +.smallVideos video { + width: 300px; + height: 200px; + object-fit: cover; +} +.smallVideos-text { + text-align: right; +} +.loadmores { + height: 1200px; +} +.displays { + width: 100%; + height: 100px; + align-items: center; + justify-content: center; +} +.displays text { + width: 100px; + text-align: center; +} +@keyframes enter { + from { + opacity: 1; + } + to { + opacity: 1; + } +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/detail/detail.hml b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/detail/detail.hml new file mode 100644 index 0000000000000000000000000000000000000000..77f24efac237ec78474090c306d3391461cf96c5 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/detail/detail.hml @@ -0,0 +1,108 @@ + + + + + +
+
+
+ +
+
+
+ +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + +
+
+ + {{$item.title}} + + {{$item.price}} + +
+
+
+
+
+
+
+ + + 店铺 + +
+
+ + + 客服 + +
+
+ + + + 收藏 + +
+
+
+ + 加入购物车 + + + 立即购买 + +
+
+
+
+ + X关闭 + + +
+
+
diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/detail/detail.js b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/detail/detail.js new file mode 100644 index 0000000000000000000000000000000000000000..1357d6d10d560fa960af08cd07c54257ce26c1af --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/detail/detail.js @@ -0,0 +1,133 @@ +/* + * 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. + */ +import prompt from '@system.prompt'; +import router from '@system.router'; +import detailData from '../../../common/detailData.js' + +let timer; + +export default { + data: { + listData: [], + tempList: [], + beginIndex: 0, + endIndex: 0, + display: false, + playBar: false, + smallVideoTime: 0, + bigVideoTime: 0, + passValue: 0, + flag: true, + isCollect: false, + commonimg:detailData.commonimg, + goodsimgs:detailData.goodsimgs, + specficlist:detailData.specficlist, + comment:detailData.comment, + recommendgood:detailData.recommendgood, + goodintroduced:detailData.goodintroduced, + }, + onInit() { + }, + back() { + router.back(); + }, + stickyPage(e) { + if (e.state === true) { + this.showVideo(); + } else { + this.hideVideo(); + } + }, + playComplete() { + this.$element('smallVideo').start(); + }, + closeVideo() { + this.show = false; + this.$element('smallVideo').pause(); + }, + showVideo() { + this.show = true; + this.$broadcast('smallVideoTime', { + params: '额外参数' + }); + }, + receiveBigVideoTime(e) { + this.smallVideoTime = e.detail.params; + this.settime(); + }, + settime() { + this.$element('smallVideo').setCurrentTime({ + currenttime: this.smallVideoTime + }); + this.$element('smallVideo').start(); + }, + getSmallVideoTime(e) { + this.passValue = e.currenttime; + }, + hideVideo() { + this.bigVideoTime = this.passValue; + this.show = false; + this.$element('smallVideo').pause(); + this.$broadcast('videoTime', { + params: this.bigVideoTime + }); + }, + collectItem(type) { + if (type === 'true') { + prompt.showToast({ + message: '收藏成功' + }); + this.isCollect = true; + } else { + prompt.showToast({ + message: '取消收藏成功' + }); + this.isCollect = false; + } + }, + addCart() { + prompt.showToast({ + message: '成功加入购物车' + }); + }, + redirect() { + router.push({ + uri: 'pages/performance/performance', + }); + }, + buildItem(param) { + if (this.goodintroduced.length == 0) { + return; + } + this.beginIndex = param.begin; + this.endIndex = param.end; + let tempArray = []; + for (let index = this.beginIndex;index < this.endIndex; ++index) { + let tempIndex = index % this.goodintroduced.length; + let tempValue = JSON.parse(JSON.stringify(this.goodintroduced[tempIndex])); + tempValue.index = index + 1; + tempArray.push(tempValue); + } + this.tempList = tempArray; + }, + showPlayBar() { + clearTimeout(timer); + this.playBar = true; + timer = setTimeout(()=>{ + this.playBar = false; + clearTimeout(timer); + },3000); + }, +}; \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/evaluation/evaluation.css b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/evaluation/evaluation.css new file mode 100644 index 0000000000000000000000000000000000000000..ca51b8f8fc54e5a9970782c80baf2dc8455d9885 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/evaluation/evaluation.css @@ -0,0 +1,163 @@ +/* + * 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 { + flex-direction: column; + flex: 1; +} +.comments-content { + flex-direction: column; + width: 100%; +} +.more-img { + align-items: center; +} +.comments-header-image { + width: 25px; + height: 20px; + object-fit: contain; +} + +.comments-header { + padding: 10px 0px; + align-items: center; + justify-content: space-between; +} + +.comments-title { + font-size: 31.3px; + color: #1A1A1A; +} + +.comments-more { + font-size: 27.1px; + color: #D2691E; + margin-right: 10px; +} + +.comments-person-title { + justify-content: flex-start; + color: #1A1A1A; + font-size: 27.1px; + margin-top: 5px; +} +.comments-detail-box { + flex-direction: column; + border-radius: 8.3px; +} + +.comments-detail-person { + align-items: center; + margin: 36px 0px 18px 33.3px; +} + +.comments-person-img { + width: 50px; + height: 50px; + border-radius: 50px; +} +.comments-name { + margin: 0px 0px 0px 16.7px; + color: #1A1A1A; + font-size: 31.3px; +} + +.comments-detail-wrap { + margin: 0px 33.3px 33.3px 33.3px; +} + +.comments-detail { + flex: 1; + margin-right: 16.7px; + color: #1A1A1A; + font-size: 27.1px; +} +.comments-buyersShow { + justify-content: center; + width: 100%; + height: 350px; +} +.buyersShow { + width: 25%; + justify-content: center; + align-items: center; +} +.buyersShow-img { + width: 90%; + height: 70%; + object-fit: cover; +} +.comments-ask { + flex-direction: column; +} +.comments-ask1-left { + align-items: center; +} +.comments-ask1 { + justify-content: space-between; + margin: 10px 0px; +} +.asking { + width: 30px; + height: 30px; + object-fit: contain; +} +.comments-content4-top { + width: 100%; + align-items: center; + justify-content: space-between; + flex-direction: row; +} +.top1 { + width: 45%; + align-items: center; +} +.icon { + width: 80px; + height: 80px; + object-fit: contain; +} +.flagship { + flex-direction: column; + margin-left: 20px; +} +.flagship-img1 { + width: 50px; + object-fit: contain; +} +.flagship-img2 { + width: 160px; + object-fit: contain; +} +.top2 { + width: 45%; + justify-content: space-between; +} +.top2-img { + width: 50%; + margin: 0px 5px; + object-fit: contain; +} +.comments-content4-bottom { + margin-top: 10px; + justify-content: space-between; + align-items: center; +} +.bottoms { + margin: 0px 8px; +} +.bottoms-text { + font-size: 25px; + margin: 0px 5px; +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/evaluation/evaluation.hml b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/evaluation/evaluation.hml new file mode 100644 index 0000000000000000000000000000000000000000..5cf67945f3042e6f8542d6be380b18a1aff9c16e --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/evaluation/evaluation.hml @@ -0,0 +1,153 @@ + +
+
+
+ + 宝贝评价(48088) + +
+ + 查看全部 + + +
+
+ + 购买过该商品的用户评价 + +
+
+ + {{evaluation.detail.userName}} + +
+
+ {{evaluation.detail.commentsText}} + +
+
+
+
+
+ + XX手机买家秀(91) + +
+ + 查看全部 + + +
+
+
+
+ +
+
+
+
+
+ + 购机回访(1643) + +
+ + 查看全部 + + +
+
+
+
+
+ + + 5G手机是双卡吗,5G手机可以用一张... + +
+ + 3个回答 + +
+
+
+ + + 有没有用5G套餐的 一个月最低... + +
+ + 1个回答 + +
+
+
+
+
+
+ +
+ + XX官方旗舰店 + +
+ + +
+
+
+
+ + +
+
+
+
+ + 产品描述 + + + 4.8 + + + 高 + +
+
+ + 卖家描述 + + + 4.8 + + + 高 + +
+
+ + 物流描述 + + + 4.8 + + + 高 + +
+
+
+
\ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/evaluation/evaluation.js b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/evaluation/evaluation.js new file mode 100644 index 0000000000000000000000000000000000000000..1fa6dbe70976e8d51b39a17af82794b43ee46068 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/evaluation/evaluation.js @@ -0,0 +1,33 @@ +/* + * 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. + */ +import router from '@system.router'; + +export default { + props: [ + 'evaluation', + 'commonimg' + ], + data() { + return { + evaluation: this.evaluation, + commonImg: this.commonimg, + } + }, + redirect() { + router.push({ + uri: 'pages/three/three', + }); + } +}; \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/recommend/recommend.css b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/recommend/recommend.css new file mode 100644 index 0000000000000000000000000000000000000000..1eb44551c913478d3ae6f1f2e73b1e3e56e88380 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/recommend/recommend.css @@ -0,0 +1,75 @@ +/* + * 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 { + width: 100%; + flex-direction: column; + align-items: center; + justify-content: center; +} +.comments-header { + padding: 10px 0px; + align-items: center; + justify-content: space-between; +} +.comments-title { + font-size: 31.3px; + color: #1A1A1A; + height: 70px; +} +.more-img { + align-items: center; +} +.comments-more { + font-size: 27.1px; + color: #D2691E; +} +.comments-header-image { + height: 25px; + width: 20px; + object-fit: contain; +} +.recommend-title { + font-size: 31.3px; + color: #1A1A1A; +} +.recommend-box { + flex-direction: row; + flex-wrap: wrap; + width: 100%; + justify-content: space-between; +} +.recommend-box-alone { + flex-direction: column; + width: 33%; + height: 350px; + justify-content: center; + align-items: center; +} +.recommend-img { + width: 100%; + height: 70%; + object-fit: contain; + border-radius: 8.3px; +} +.recommend-good-name { + font-size: 27.1px; + color: #1A1A1A; + max-lines: 2; + text-overflow: ellipsis; +} +.recommend-price { + font-size: 30px; + color: #FA2A2D; +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/recommend/recommend.hml b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/recommend/recommend.hml new file mode 100644 index 0000000000000000000000000000000000000000..ef7c9c033926d34d3432ea03116cb24fb504086d --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/recommend/recommend.hml @@ -0,0 +1,36 @@ + +
+
+ + 旗舰店(48088) + +
+ + 查看全部 + + +
+
+
+
+ + {{$item.title}} + + {{$item.price}} + +
+
+
\ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/recommend/recommend.js b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/recommend/recommend.js new file mode 100644 index 0000000000000000000000000000000000000000..a88b5d9a4be70be37f53b29bb716746d2ad6db3d --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/detailPage/recommend/recommend.js @@ -0,0 +1,27 @@ +/* + * 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 { + props: [ + 'recommenddata', + 'commonimg' + ], + data() { + return { + recommendData: this.recommenddata, + commonImg: this.commonimg, + } + }, +}; \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/banner/banner.css b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/banner/banner.css new file mode 100644 index 0000000000000000000000000000000000000000..53a685714e3eece0ef2efa410c7fad177c1d01e9 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/banner/banner.css @@ -0,0 +1,31 @@ +/* + * 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 { + flex-direction: column; + align-items: center; + justify-content: center; + width: 100%; + margin-top: 10px; +} +.swipers { + width: 95%; + border-radius: 30px; + indicator-bottom: 2%; +} +.banner-image { + border-radius: 20px; + width: 100%; + object-fit: contain; +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/banner/banner.hml b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/banner/banner.hml new file mode 100644 index 0000000000000000000000000000000000000000..c73bdf83b350047aaa0812ffaee740ecfa001eae --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/banner/banner.hml @@ -0,0 +1,19 @@ + +
+ + + +
\ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/banner/banner.js b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/banner/banner.js new file mode 100644 index 0000000000000000000000000000000000000000..ad68b4a3fda8e0659a6a77bf14e871e06e47f662 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/banner/banner.js @@ -0,0 +1,29 @@ +/* + * 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. + */ +import router from '@system.router' + +export default { + props: ['bannerdata'], + data(){ + return{ + bannerData:this.bannerdata, + } + }, + redirect() { + router.push({ + uri: 'pages/detailPage/detail/detail', + }); + }, +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/commoditys/commoditys.css b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/commoditys/commoditys.css new file mode 100644 index 0000000000000000000000000000000000000000..4d731a13daf3c6e0f1b78bed2d9a38e727e3fa8b --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/commoditys/commoditys.css @@ -0,0 +1,33 @@ +/* + * 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 { + flex-direction: column; + width: 95%; + height: 100%; + justify-content: center; + align-items: center; +} +.tabs { + width: 100%; +} +.tab-bar { + width: 100%; +} +.tab-text { + color: #000000; + width: 120px; + text-align: center; + padding-bottom: 10px; +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/commoditys/commoditys.hml b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/commoditys/commoditys.hml new file mode 100644 index 0000000000000000000000000000000000000000..997ade6736cd6bdf2ec21bdea17ac3878d330b3e --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/commoditys/commoditys.hml @@ -0,0 +1,47 @@ + + +
+ + + + 全部 + + + 推荐 + + + 优惠 + + + 直播 + + + +
+ +
+
+ +
+
+ +
+
+ +
+
+
+
\ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/commoditys/commoditys.js b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/commoditys/commoditys.js new file mode 100644 index 0000000000000000000000000000000000000000..fa1934f32477cab60d1b823a0855b543937d973c --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/commoditys/commoditys.js @@ -0,0 +1,17 @@ +/* + * 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 { + data: {} +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/coreModule/coreModule.css b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/coreModule/coreModule.css new file mode 100644 index 0000000000000000000000000000000000000000..e35fbe446765104a5a33f6126112da72545e7d23 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/coreModule/coreModule.css @@ -0,0 +1,42 @@ +/* + * 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 { + margin-top: 10px; + width: 95%; + height: 400px; + justify-content: center; + flex-direction: column; +} +.swiper-list { + width: 100%; + height: 100%; + item-extent: 20%; + flex-direction: row; + columns: 2; +} +.swiper-list-item { + flex-direction: column; + align-items: center; + justify-content: center; +} +.alonetype-image { + object-fit: contain; + width:60%; + height:60%; +} +.typename { + color: #1A1A1A; + font-size: 25px; +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/coreModule/coreModule.hml b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/coreModule/coreModule.hml new file mode 100644 index 0000000000000000000000000000000000000000..8e777aa322c72cc1eab7da2615107ba6a0390aa1 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/coreModule/coreModule.hml @@ -0,0 +1,23 @@ + +
+ + + + {{$item.title}} + + + +
\ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/coreModule/coreModule.js b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/coreModule/coreModule.js new file mode 100644 index 0000000000000000000000000000000000000000..13b68caf26c4a2edf38a1c6165533505eee51349 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/coreModule/coreModule.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 { + props: ['coredata'], + data() { + return { + coreData: this.coredata, + } + }, +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/mainContent/mainContent.css b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/mainContent/mainContent.css new file mode 100644 index 0000000000000000000000000000000000000000..1325b03907a856f7578a24004de43cba45fd98ba --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/mainContent/mainContent.css @@ -0,0 +1,26 @@ +/* + * 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 { + flex-direction: column; + align-items: center; + justify-content:center; +} +.list{ + flex-direction:column; +} +.list-good{ + flex-direction: column; + align-items: center; +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/mainContent/mainContent.hml b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/mainContent/mainContent.hml new file mode 100644 index 0000000000000000000000000000000000000000..fc2e60eed287aafad634aa9121be8975cff4a3a7 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/mainContent/mainContent.hml @@ -0,0 +1,38 @@ + + + + + + +
+ + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/mainContent/mainContent.js b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/mainContent/mainContent.js new file mode 100644 index 0000000000000000000000000000000000000000..127126149ccabcf4540545be24184583066e1b73 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/mainContent/mainContent.js @@ -0,0 +1,22 @@ +/* + * 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 { + props: ['home'], + data() { + return { + Home: this.home, + } + } +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/microAmoy/microAmoy.css b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/microAmoy/microAmoy.css new file mode 100644 index 0000000000000000000000000000000000000000..e35c3d7668361eecab0d38c6b65c2a4764afef5f --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/microAmoy/microAmoy.css @@ -0,0 +1,139 @@ +/* + * 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 { + flex-direction: column; + justify-content: center; + align-items: center; + width: 100%; +} +.list { + width: 96%; + flex-direction: column; +} +.listitem-title { + height: 100px; +} +.top-listitem { + flex-direction: row; + justify-content: space-between; + width: 100%; +} +.top-text { + font-weight: bolder; +} +.top-image { + width: 50px; + height: 50px; + margin-left: 20px; + object-fit: contain; +} +.listitem-ceil { + flex-direction: row; + background-color: white; +} +.tab-bar-text { + width: 100px; + height: 70px; + text-align: center; + margin: 0px 20px; +} +.listitem { + margin: 10px 0px; +} +.content { + flex-direction: column; + width: 100%; + border: 1px solid #C0C0C0; + border-radius: 10px; + padding: 10px; +} +.list-top { + flex-direction: row; + justify-content: space-between; + height: 100px; + width: 100%; +} +.list-top-left { + flex-direction: row; + align-items: center; + width: 50%; +} +.list-top-left-image { + width: 60px; + height: 60px; + object-fit: contain; +} +.list-top-left-div { + flex-direction: column; + align-items: flex-start; + justify-content: center; + margin-left: 15px; +} +.list-top-text1 { + color: #000000; + font-weight: bolder; + text-align: left; +} +.list-top-text2 { + color: gray; + font-size: 25px; + text-align: left; +} +.list-top-right { + width: 50%; + flex-direction: row; + justify-content: space-around; + align-items: center; +} +.list-top-right-image1 { + width: 40%; + height: 40px; + object-fit: contain; +} +.list-top-right-image2 { + width: 40px; + height: 40px; + object-fit: contain; +} +.list-center1-image { + width: 60px; + height: 30px; + object-fit: contain; +} +.list-center2 { + width: 100%; + height: 720px; + flex-wrap: wrap; +} +.list-center2-img { + width: 33%; + height: 32%; + object-fit: contain; + margin: 1px; +} +.list-bottom { + flex-direction: row; + justify-content: space-between; +} +.list-bottom-div { + flex-direction: row; + justify-content: center; + align-items: center; +} +.list-bottom-img { + width: 40px; + height: 40px; + object-fit: contain; +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/microAmoy/microAmoy.hml b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/microAmoy/microAmoy.hml new file mode 100644 index 0000000000000000000000000000000000000000..010d09bc3aee2bf526432c1e1ba9e920b1b0ff4b --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/microAmoy/microAmoy.hml @@ -0,0 +1,64 @@ + +
+ + +
+ 商城 +
+ + +
+
+
+ + {{$item}} + + +
+
+
+ +
+ {{$item.topdata.text1}} + {{$item.topdata.text2}} +
+
+
+ + + +
+
+
+ + {{$item.topdata.textcenter}} +
+
+ +
+
+ {{$item.imgbottom.text1}} +
+ + {{$item.imgbottom.text2}} + + {{$item.imgbottom.text3}} +
+
+
+
+
+
\ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/microAmoy/microAmoy.js b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/microAmoy/microAmoy.js new file mode 100644 index 0000000000000000000000000000000000000000..48bf435ec62c540ffc804c70c2cf95f0dbe6346e --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/microAmoy/microAmoy.js @@ -0,0 +1,42 @@ +/* + * 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. + */ +import amoyData from '../../../common/microAmoyData.js' + +export default { + data: { + navbarData: ['关注', '推荐', '直播', '畅享', '福利', '视频'], + tempList: [], + beginIndex: 0, + endIndex: 0, + amoyData:amoyData, + }, + onInit() { + }, + buildItem(param) { + if (this.amoyData.length == 0) { + return; + } + this.beginIndex = param.begin; + this.endIndex = param.end; + let tempArray = []; + for (let index = this.beginIndex;index < this.endIndex; ++index) { + let tempIndex = index % this.amoyData.length; + let tempValue = JSON.parse(JSON.stringify(this.amoyData[tempIndex])); + tempValue.index = index + 1; + tempArray.push(tempValue); + } + this.tempList = tempArray; + } +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/navbar/navbar.css b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/navbar/navbar.css new file mode 100644 index 0000000000000000000000000000000000000000..47ad5804b894e756c874ac32359a0507f07143e4 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/navbar/navbar.css @@ -0,0 +1,56 @@ +/* + * 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 { + width: 95%; + justify-content: center; + flex-direction: column; +} +.stack { + width: 100%; + flex-direction: row; + justify-content: flex-end; + align-items: flex-start; +} +.containnav { + width: 100%; + margin-right: 100px; +} +.tab-bar { + height: 80px; + line-height: 80px; +} +.tab-item-text { + margin-bottom: 3px; + font-size: 31.3px; +} +.classification { + height: 70px; + border: 1px solid #FFFFFF; + background-color: #FFFFFF; + border-radius: 50px; + width: 18%; + align-items: center; + justify-content: center; + margin-top: 5px; +} +.classification>text { + font-size: 25px; +} +.classification-image { + margin-left: 10px; + width: 40px; + height: 40px; + object-fit: contain; +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/navbar/navbar.hml b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/navbar/navbar.hml new file mode 100644 index 0000000000000000000000000000000000000000..ff64e890dbae2f97e349cf92be576a4bcb66c456 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/navbar/navbar.hml @@ -0,0 +1,30 @@ + +
+ + + + {{$item.title}} + + + +
+ + + 分类 + +
+
+
\ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/navbar/navbar.js b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/navbar/navbar.js new file mode 100644 index 0000000000000000000000000000000000000000..df7870c2c34c7eef294fe2aa82c5adb177114728 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/navbar/navbar.js @@ -0,0 +1,26 @@ +/* + * 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 { + props: [ + 'navbardata', + 'icon' + ], + data() { + return { + navbarData: this.navbardata, + icon: this.icon, + } + }, +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/pageHome/pageHome.css b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/pageHome/pageHome.css new file mode 100644 index 0000000000000000000000000000000000000000..cf33731b19dfbd398ae537870b5118e6057bd461 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/pageHome/pageHome.css @@ -0,0 +1,27 @@ +/* + * 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 { + flex-direction: column; + align-content: center; +} +.searchbar { + width: 100%; + align-items: center; + justify-content: center; +} +.mainContainer { + justify-content: center; + width: 100%; +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/pageHome/pageHome.hml b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/pageHome/pageHome.hml new file mode 100644 index 0000000000000000000000000000000000000000..e1e3487dd2212c89e2761be4d67b3e102d9ad3b8 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/pageHome/pageHome.hml @@ -0,0 +1,24 @@ + + + +
+ +
+ +
+
\ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/pageHome/pageHome.js b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/pageHome/pageHome.js new file mode 100644 index 0000000000000000000000000000000000000000..7428f4440ab4b300f7bd1a7e26e5bba5660bb5e4 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/pageHome/pageHome.js @@ -0,0 +1,33 @@ +/* + * 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. + */ +import homedata from '../../../common/pageHomeData.js' + +export default { + data: { + placeholder: [ + { + title: '防晒霜' + }, + { + title: '精品好衣' + }, + { + title: '节日大优惠' + } + ], + currIndex: 0, + homeData: homedata + }, +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/productList/productList.css b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/productList/productList.css new file mode 100644 index 0000000000000000000000000000000000000000..1f56dc65eb201c04ef063f52472cee094c023e94 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/productList/productList.css @@ -0,0 +1,59 @@ +/* + * 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 { + width: 100%; + flex-direction: column; + align-items: center; + justify-content: center; +} +.listDatas { + columns: 2; + width: 100%; +} +.content-item { + width: 50%; + height: 580px; + justify-content: center; + border: 1px solid #000000; + border-radius: 10px; + padding: 0px 10px; + margin-bottom: 15px; + flex-direction: column; +} +.content-item>div text { + color: #000000; + font-size: 20px; + align-items: center; +} +.img { + width: 100%; + height: 70%; + object-fit: contain; +} +.labels { + color: #2F4F4F; + font-size: 25px; + border: 1px solid #000000; + border-radius: 3px; + padding: 2px 5px; +} +.imgnum{ + color: #2F4F4F; + font-size: 25px; + padding: 5px 5px; +} +.price { + color: red; +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/productList/productList.hml b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/productList/productList.hml new file mode 100644 index 0000000000000000000000000000000000000000..a14d62e8c2078475a03b622ae7ac0189bd8673af --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/productList/productList.hml @@ -0,0 +1,36 @@ + +
+ + + + {{$item.title}} + +
+ + + 第{{$item.index}}张 + +
+ + ¥{{$item.index}} + +
+
+
\ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/productList/productList.js b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/productList/productList.js new file mode 100644 index 0000000000000000000000000000000000000000..e08a914a5ebdac7907d7264b9815824a5117d6c7 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/productList/productList.js @@ -0,0 +1,43 @@ +/* + * 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. + */ +import productsData from '../../../common/productListData.js' + +export default { + data: { + productList: [], + hasMoreData: true, + tempList: [], + beginIndex: 0, + endIndex: 0, + products:productsData, + }, + onInit() { + }, + buildItem(param) { + if (this.products.length == 0) { + return; + } + this.beginIndex = param.begin; + this.endIndex = param.end; + let tempArray = []; + for (let index = this.beginIndex;index < this.endIndex; ++index) { + let tempIndex = index % this.products.length; + let tempValue = JSON.parse(JSON.stringify(this.products[tempIndex])); + tempValue.index = index + 1; + tempArray.push(tempValue); + } + this.tempList = tempArray; + }, +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/recommended/recommended.css b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/recommended/recommended.css new file mode 100644 index 0000000000000000000000000000000000000000..b6bb896a2105fd407928f38ba48bef74e12629d2 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/recommended/recommended.css @@ -0,0 +1,48 @@ +/* + * 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. + */ +.containers { + width: 95%; + margin-top: 10px; + align-items: center; + flex-wrap: wrap; +} +button { + width: 100%; + height: 70px; + margin: 10px 0px; +} +.recommended { + width: 50%; + flex-direction: column; +} +.texts { + flex-direction: column; + margin-left: 20px; + margin-bottom: 10px; +} +.text1 { + font-weight: bolder; +} +.text2 { + margin-left: 30px; +} +.images { + width: 100%; +} +image { + width: 45%; + height: 250px; + object-fit: contain; +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/recommended/recommended.hml b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/recommended/recommended.hml new file mode 100644 index 0000000000000000000000000000000000000000..03e7745f476d221cde1415143c2df009ccfb3c21 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/recommended/recommended.hml @@ -0,0 +1,28 @@ + +
+ +
\ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/recommended/recommended.js b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/recommended/recommended.js new file mode 100644 index 0000000000000000000000000000000000000000..703a2a17b149dc05e3f0d0a5b748762f68d65346 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/recommended/recommended.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 { + props: ['boutiquedata'], + data() { + return { + boutiqueData: this.boutiquedata, + } + }, +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/searchbar/searchbar.css b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/searchbar/searchbar.css new file mode 100644 index 0000000000000000000000000000000000000000..52fac4363f16a0e8db1259037a24f29b3807097a --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/searchbar/searchbar.css @@ -0,0 +1,55 @@ +/* + * 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 { + width: 90%; + height: 100px; + flex-direction: row; + justify-content: space-between; +} +.div-search { + background-color: #F2F2F2; + border-radius: 8px; + margin: 5px 5px; + align-items: center; + width: 70%; +} +.code { + flex-direction: column; + align-content: center; + margin: 5px 5px; +} +.image1 { + width: 60px; + height: 60px; + object-fit: contain; +} +.text1 { + font-size: 20px; + align-content: center; +} +.image-search { + width: 50px; + height: 50px; + margin: 17px; +} +.place-holder { + font-size: 27px; + color: #1A1A1A; +} +.findswiper { + width: 65%; + height: 40px; + color: #1A1A1A; +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/searchbar/searchbar.hml b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/searchbar/searchbar.hml new file mode 100644 index 0000000000000000000000000000000000000000..30501bc58df6e0a1ec9196744b6138dec46729c5 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/searchbar/searchbar.hml @@ -0,0 +1,36 @@ + +
+
+ + + 扫一扫 + +
+ +
+ + + 会员码 + +
+
\ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/searchbar/searchbar.js b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/searchbar/searchbar.js new file mode 100644 index 0000000000000000000000000000000000000000..9a64dbb1d370ca17bb5cab2251bb14ca6d615182 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/homePage/searchbar/searchbar.js @@ -0,0 +1,38 @@ +/* + * 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. + */ +import router from '@system.router'; + +export default { + props: [ + 'placeholder', + 'searchbardata' + ], + data() { + return { + placeholder: this.placeholder, + searchbarData: this.searchbardata, + } + }, + onInit() { + if (this.placeholder === '' || this.placeholder === undefined) { + this.placeholder = '搜索栏组件默认字符'; + } + }, + redirect() { + router.push({ + url: 'pages/four/four' + }); + }, +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/index/index.css b/JSUI/JsShopping/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..58350c03a2a350dfcacde31fb6c819649fb5881c --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,35 @@ +/* + * 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 { + flex-direction: column; + align-items: center; +} +.tab-bar { + justify-content: space-between; + height: 6%; +} +.tab-item { + width: 100%; + height: 100px; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.tab-item-image { + width: 80%; + height: 60%; + object-fit: contain; +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/index/index.hml b/JSUI/JsShopping/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..0a68e438d64ef8888eff8c899ecca37c6ddbe4e3 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,34 @@ + + + +
+ + +
+ +
+
+ +
+
+ +
+ + {{$item.title}} +
+
+
+
\ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/index/index.js b/JSUI/JsShopping/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..77db55e464db2c9e859f6dd9434a01b08e5a5ef8 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +import tabbarData from '../../common/indexData.js' + +export default { + data() { + return { + tabbardata:tabbarData + } + }, + onInit() { + }, + changeTabIndex(e) { + for (let i = 0; i < this.tabbardata.length; i++) { + let element = this.tabbardata[i]; + element.show = false; + if (i === e.index) { + element.show = true; + } + } + } +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/performance/performance.css b/JSUI/JsShopping/entry/src/main/js/default/pages/performance/performance.css new file mode 100644 index 0000000000000000000000000000000000000000..c3f9f7c42e8cc67f500c22d5454570c65a1e30ac --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/performance/performance.css @@ -0,0 +1,183 @@ +/* + * 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{ + width:100%; + flex-direction:column; +} +text{ + font-size:25px; +} +.text1{ + margin:0 2px; + text-align:center; + border:1px solid #808080; + border-radius:50px; + padding:3px 10px; +} +.text2{ + text-align:center; + border:1px solid #FF6100; + color:#DB7093; + padding:5px 5px; + background-color:#808080; + border-color:#4169E1; +} +.listdivs{ + flex-direction:column; +} +.div1{ + margin:5px 0; + justify-content:flex-start; +} +.div2{ + margin:5px 0; + justify-content:flex-end; +} +.div3{ + margin:5px 0; + justify-content:space-between; +} +.div4{ + margin:5px 0; + justify-content:space-around; +} +.div5{ + margin:5px 0; + justify-content:center; +} +.span1{ + color:greenyellow; +} +.span2{ + color:yellowgreen; +} +.span3{ + color:red; +} +.span4{ + font-style:italic; +} +.span5{ + font-weight:bolder; +} +.span6{ + text-decoration:underline; +} +.span7{ + text-decoration:line-through; +} + +.list{ + width:100%; + columns: 1; +} +.listitems{ + margin-top:20px; + width:100%; +} +.comment{ + flex-direction:column; +} +.comment-alone{ + flex-direction:column; + width:100%; +} +.userinfo{ + flex-direction:row; + width:100%; + height:80px; +} +.userinfo-div{ + flex-direction:column; +} +.userinfo-text1{ + font-weight:bolder; + color:black; +} +.userinfo-text2{ + font-style:italic; + color:gray; +} +.userinfo-text3{ + margin-left:5px; +} + +.images{ + border-radius:50px; + width:100px; + height:100px; + object-fit:contain; + margin-right:10px; + margin-left:20px; +} +.image{ + width:30px; + height:30px; + object-fit:contain; + margin:5px; +} +.commenttip{ + width:100%; + padding:20px 0; +} +.commenttips{ + width:100%; + flex-direction:column; +} +.commenttips-images{ + flex-direction:row; + justify-content:space-around; +} +.commenttips-image{ + width:30%; + object-fit:contain; +} +.commenttip-text{ + margin-left:30px; + flex-direction:row; + flex-wrap:wrap; +} +.userinfo-image1{ + width:150px; + height:30px; + object-fit:contain; +} +.comment-great{ + height:80px; + width:100%; + justify-content:space-between; + flex-direction:row; + margin:5px 20px; +} +.browse{ + align-items:center; + flex:1; +} +.comment-specific{ + width:60%; + height:80px; + justify-content: space-around; + align-items:center; + flex-direction:row; + margin-left:60px; +} +.comment-specific-text{ + margin-right:15px; + margin-left:20px; +} +.listitems{ + flex-direction:column; + width:100%; +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/performance/performance.hml b/JSUI/JsShopping/entry/src/main/js/default/pages/performance/performance.hml new file mode 100644 index 0000000000000000000000000000000000000000..82ddd23ad0c324731d5216aa079d46799f843373 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/performance/performance.hml @@ -0,0 +1,110 @@ + +
+ + +
+
+
+ +
+
+
+ {{$item.name}} + + +
+
+ {{$item.size}} + + + 1小时以前 + +
+
+
+
+ {{$item.texts}} + +
+
+
+ + 浏览0次 + +
+
+ + + 评论 + + + + 有用 + + +
+
+
+
+
+
+ +
+
+
+ {{$item.comment2.name}} + + +
+
+ {{$item.comment2.size}} + + + 1小时以前 + +
+
+
+
+ {{$item.comment2.texts}} + +
+ +
+
+
+
+ + 浏览0次 + +
+
+ + + 评论 + + + + 有用 + + +
+
+
+
+
+
\ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/js/default/pages/performance/performance.js b/JSUI/JsShopping/entry/src/main/js/default/pages/performance/performance.js new file mode 100644 index 0000000000000000000000000000000000000000..25082b4777f52aaac485d5e076e6654bdcb5975c --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/js/default/pages/performance/performance.js @@ -0,0 +1,44 @@ +/* + * 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. + */ +import comments from '../../common/performanceData.js' + +export default { + data: { + commentlist: [], + tempList: [], + beginIndex: 0, + endIndex: 0, + productListLengthLimit: 100, + comments:comments, + commentlist1: [], + }, + onInit() { + }, + buildItem(param) { + if (this.comments.length == 0) { + return; + } + this.beginIndex = param.begin; + this.endIndex = param.end; + let tempArray = []; + for (let index = this.beginIndex;index < this.endIndex; ++index) { + let tempIndex = index % this.comments.length; + let tempValue = JSON.parse(JSON.stringify(this.comments[tempIndex])); + tempValue.index = index + 1; + tempArray.push(tempValue); + } + this.tempList = tempArray; + } +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/resources/base/element/string.json b/JSUI/JsShopping/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..2094457be234a4a31c4c772f4843c82d864905b8 --- /dev/null +++ b/JSUI/JsShopping/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "shopping" + }, + { + "name": "mainability_description", + "value": "Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/JSUI/JsShopping/entry/src/main/resources/base/media/icon.png b/JSUI/JsShopping/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/JSUI/JsShopping/entry/src/main/resources/base/media/icon.png differ diff --git a/JSUI/JsShopping/screenshots/device/shopping_detail.png b/JSUI/JsShopping/screenshots/device/shopping_detail.png new file mode 100644 index 0000000000000000000000000000000000000000..1bd294b645e6401b7e3d8ab8351037cd34cc9661 Binary files /dev/null and b/JSUI/JsShopping/screenshots/device/shopping_detail.png differ diff --git a/JSUI/JsShopping/screenshots/device/shopping_home.png b/JSUI/JsShopping/screenshots/device/shopping_home.png new file mode 100644 index 0000000000000000000000000000000000000000..0037f00e9a069a8aa81601d05cb8eeddad239c88 Binary files /dev/null and b/JSUI/JsShopping/screenshots/device/shopping_home.png differ diff --git a/JSUI/JsShopping/screenshots/device/shopping_list.png b/JSUI/JsShopping/screenshots/device/shopping_list.png new file mode 100644 index 0000000000000000000000000000000000000000..9fd6e5d42da54af2c21588d3bfd8ccf299867b79 Binary files /dev/null and b/JSUI/JsShopping/screenshots/device/shopping_list.png differ diff --git a/JSUI/JsShopping/screenshots/device/shopping_other.png b/JSUI/JsShopping/screenshots/device/shopping_other.png new file mode 100644 index 0000000000000000000000000000000000000000..8282e0d65a4c3ca207eb1260853bedb13858acc9 Binary files /dev/null and b/JSUI/JsShopping/screenshots/device/shopping_other.png differ diff --git a/JSUI/JsShopping/settings.gradle b/JSUI/JsShopping/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..7dc3285c045cc590e49d231a4280ef52ba646d91 --- /dev/null +++ b/JSUI/JsShopping/settings.gradle @@ -0,0 +1,15 @@ +/* + * 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. + */ +include ':entry' diff --git a/JSUI/JsStartMode/README_zh.md b/JSUI/JsStartMode/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..54f274d3705dae8744bd780c92739e874eddf2e4 --- /dev/null +++ b/JSUI/JsStartMode/README_zh.md @@ -0,0 +1,7 @@ +# JS 启动模态配置 + +- 本示例主要演示 JS UI 框架提供半模态和弹窗模态的启动方式。 + + 使用半模态 FA 或者弹窗模态 FA 时,对应的 ability 在 config.json 中配置相关透明主题并通过设置相应的 window\_modal 参数来使能相应的启动模态。 + + window\_modal 参数可以通过调用在 startAbility 时在 intent 对象中进行设置,也可以在应用本身的 ability 类的 onStart 方法中进行设置。 diff --git a/JSUI/JsStartMode/build.gradle b/JSUI/JsStartMode/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..4e8a6aadbd114fd91535e3347c8a293ad0fab769 --- /dev/null +++ b/JSUI/JsStartMode/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' + +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } +} + +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.2' + } +} + +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + jcenter() + } +} + diff --git a/JSUI/JsStartMode/entry/build.gradle b/JSUI/JsStartMode/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..83f59debbd68242b503a22270f4378d7843ca204 --- /dev/null +++ b/JSUI/JsStartMode/entry/build.gradle @@ -0,0 +1,19 @@ +apply plugin: 'com.huawei.ohos.hap' +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) +} \ No newline at end of file diff --git a/JSUI/JsStartMode/entry/src/main/config.json b/JSUI/JsStartMode/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..1a293bf94fff410c1dee1a05b009d2af714e3863 --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/config.json @@ -0,0 +1,118 @@ +{ + "app": { + "bundleName": "ohos.samples.jstransparent", + "version": { + "code": 2000000, + "name": "2.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.samples.jstransparent", + "name": ".MainAbility", + "reqCapabilities": [ + "video_support" + ], + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "formsEnabled": false, + "visible": true, + "name": ".MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + }, + { + "name": ".ModalNormalAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "type": "page", + "launchType": "standard" + }, + { + "name": ".ModalSemimodeAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "type": "page", + "launchType": "standard" + }, + { + "name": ".ModalHalfAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "type": "page", + "launchType": "standard" + }, + { + "name": ".ModalPopupAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/modalsemimode" + ], + "name": "modalsemimode", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/modalhalf" + ], + "name": "modalhalf", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/modalpopup" + ], + "name": "modalpopup", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/JSUI/JsStartMode/entry/src/main/java/ohos/samples/jstransparent/MainAbility.java b/JSUI/JsStartMode/entry/src/main/java/ohos/samples/jstransparent/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..9b3156ca95ba2bfece12abcef07cd087b60c6800 --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/java/ohos/samples/jstransparent/MainAbility.java @@ -0,0 +1,82 @@ +/* + * 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. + */ + +package ohos.samples.jstransparent; + + +import ohos.aafwk.ability.Ability; +import ohos.aafwk.content.Intent; +import ohos.aafwk.content.Operation; +import ohos.agp.components.Component; + + +/** + * Displays the button for entering the mode. + */ +public class MainAbility extends Ability { + private Component modalNormal; + + private Component modalSemimode; + + private Component modalHalf; + + private Component modalPopup; + + @Override + public void onStart(Intent intent) { + intent.setParam("window_modal", 1); + super.onStart(intent); + super.setUIContent(ResourceTable.Layout_main_layout); + } + + @Override + protected void onActive() { + super.onActive(); + initView(); + initClickEvents(); + } + + private void initView() { + modalNormal = findComponentById(ResourceTable.Id_modalnormal); + modalSemimode = findComponentById(ResourceTable.Id_modalsemimode); + modalHalf = findComponentById(ResourceTable.Id_modalhalf); + modalPopup = findComponentById(ResourceTable.Id_modalpopup); + } + + private void initClickEvents() { + modalNormal.setClickedListener( + component -> startModalAbility(getBundleName(), ModalNormalAbility.class.getName(), 0)); + modalSemimode.setClickedListener(component -> { + startModalAbility(getBundleName(), ModalSemimodeAbility.class.getName(), 1); + terminateAbility(); + }); + modalHalf.setClickedListener( + component -> startModalAbility(getBundleName(), ModalHalfAbility.class.getName(), 2)); + modalPopup.setClickedListener(component -> { + startModalAbility(getBundleName(), ModalPopupAbility.class.getName(), 3); + terminateAbility(); + }); + } + + private void startModalAbility(String bundleName, String abilityName, int modal) { + Intent intent = new Intent(); + Operation operation = new Intent.OperationBuilder().withBundleName(bundleName) + .withAbilityName(abilityName) + .build(); + intent.setOperation(operation); + intent.setParam("window_modal", modal); + startAbility(intent); + } +} diff --git a/JSUI/JsStartMode/entry/src/main/java/ohos/samples/jstransparent/ModalHalfAbility.java b/JSUI/JsStartMode/entry/src/main/java/ohos/samples/jstransparent/ModalHalfAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..f0cd491eba32cdf81d2c80b5304fdbcbd05a0c95 --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/java/ohos/samples/jstransparent/ModalHalfAbility.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package ohos.samples.jstransparent; + +import ohos.aafwk.content.Intent; +import ohos.ace.ability.AceAbility; + +/** + * enter the window_modal=2 + */ +public class ModalHalfAbility extends AceAbility { + @Override + public void onStart(Intent intent) { + setInstanceName("modalhalf"); + super.onStart(intent); + } +} diff --git a/JSUI/JsStartMode/entry/src/main/java/ohos/samples/jstransparent/ModalNormalAbility.java b/JSUI/JsStartMode/entry/src/main/java/ohos/samples/jstransparent/ModalNormalAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..2ebd87bb95629e736320329412877dad3b4627f4 --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/java/ohos/samples/jstransparent/ModalNormalAbility.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package ohos.samples.jstransparent; + +import ohos.aafwk.content.Intent; +import ohos.ace.ability.AceAbility; + +/** + * enter the window_modal=0 + */ +public class ModalNormalAbility extends AceAbility { + @Override + public void onStart(Intent intent) { + setInstanceName("default"); + super.onStart(intent); + } +} diff --git a/JSUI/JsStartMode/entry/src/main/java/ohos/samples/jstransparent/ModalPopupAbility.java b/JSUI/JsStartMode/entry/src/main/java/ohos/samples/jstransparent/ModalPopupAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..c432a4413f372600bdda0081bf40fb7e2d903723 --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/java/ohos/samples/jstransparent/ModalPopupAbility.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package ohos.samples.jstransparent; + +import ohos.aafwk.content.Intent; +import ohos.ace.ability.AceAbility; + +/** + * enter the window_modal=3 + */ +public class ModalPopupAbility extends AceAbility { + @Override + public void onStart(Intent intent) { + setInstanceName("modalpopup"); + super.onStart(intent); + } +} diff --git a/JSUI/JsStartMode/entry/src/main/java/ohos/samples/jstransparent/ModalSemimodeAbility.java b/JSUI/JsStartMode/entry/src/main/java/ohos/samples/jstransparent/ModalSemimodeAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..e9ac2b2c651b629016cfce05a2a4a77f345fbfbe --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/java/ohos/samples/jstransparent/ModalSemimodeAbility.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package ohos.samples.jstransparent; + +import ohos.aafwk.content.Intent; +import ohos.ace.ability.AceAbility; + +/** + * enter the window_modal=1 + */ +public class ModalSemimodeAbility extends AceAbility { + @Override + public void onStart(Intent intent) { + setInstanceName("modalsemimode"); + super.onStart(intent); + } +} diff --git a/JSUI/JsStartMode/entry/src/main/js/default/app.js b/JSUI/JsStartMode/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..50007322f38c5c4328aa0e7386255727629eb48d --- /dev/null +++ b/JSUI/JsStartMode/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/JSUI/JsStartMode/entry/src/main/js/default/common/img/logo.png b/JSUI/JsStartMode/entry/src/main/js/default/common/img/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..8ff99801a568aba384af790d7af48f83d9cf1603 Binary files /dev/null and b/JSUI/JsStartMode/entry/src/main/js/default/common/img/logo.png differ diff --git a/JSUI/JsStartMode/entry/src/main/js/default/i18n/en-US.json b/JSUI/JsStartMode/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..37d04cca044e30ad2cc1bd035026ffcc45232b01 --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,13 @@ +{ + "strings":{ + "more": "more", + "start": "start", + "air_clean": "air_clean", + "good": "good", + "switch": "switch", + "auto": "auto", + "sleep": "sleep" + }, + "Files":{ + } +} \ No newline at end of file diff --git a/JSUI/JsStartMode/entry/src/main/js/default/pages/index/index.css b/JSUI/JsStartMode/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..3abcf0baf7ffe61b1702a9b251848e96a0108117 --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,84 @@ +/* + * 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 { + background-color: #F7F7F7; + flex-direction: column; + align-items: center; +} + +.download { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.logo { + width: 200px; + height: 200px; + margin: 40px; +} + +.downText { + font-size: 35px; + padding: 10px; + margin-bottom: 20px; +} + +.list1 { + height: 120px; +} + +.list-item1{ + background-color: white; + border-radius: 15px; + height: 100px; + margin-left: 30px; + margin-right: 30px; + margin-top: 20px; +} +.col { + display: flex; + justify-content: center; + align-items: center; +} + +.list-item3{ + background-color: white; + border-radius: 15px; + height: 100px; + display: flex; + justify-content: center; + align-items: center; + margin-left: 30px; + margin-right: 30px; + margin-top: 20px; +} + +text { + text-align: center; + font-size: 30px; + align-items: center; +} + +.good { + color: #289428; + font-size: 32px; +} + +.more{ + color: #067DC9; + margin-top: 40px; +} diff --git a/JSUI/JsStartMode/entry/src/main/js/default/pages/index/index.hml b/JSUI/JsStartMode/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..ae86b7f9aa74da0576f79d0419ea5353a49e1f16 --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,42 @@ + + +
+
+ + {{$t('strings.air_clean')}} +
+ + +
{{$t('strings.start')}}
+
{{$t('strings.good')}}
+
{{$t('strings.switch')}}
+
+
+ + +
{{$t('strings.start')}}
+
{{$t('strings.good')}}
+
{{$t('strings.switch')}}
+
+
+ + +
{{$t('strings.auto')}}
+
{{$t('strings.sleep')}}
+
+
+ {{$t('strings.more')}} +
diff --git a/JSUI/JsStartMode/entry/src/main/js/default/pages/index/index.js b/JSUI/JsStartMode/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c48a9b5a52ecdbab33bdbf77697d4d136d75555f --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,21 @@ +/* + * 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 { + data: { + }, + onInit (){ + } +} diff --git a/JSUI/JsStartMode/entry/src/main/js/modalhalf/app.js b/JSUI/JsStartMode/entry/src/main/js/modalhalf/app.js new file mode 100644 index 0000000000000000000000000000000000000000..50007322f38c5c4328aa0e7386255727629eb48d --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/js/modalhalf/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/JSUI/JsStartMode/entry/src/main/js/modalhalf/common/img/logo.png b/JSUI/JsStartMode/entry/src/main/js/modalhalf/common/img/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..8ff99801a568aba384af790d7af48f83d9cf1603 Binary files /dev/null and b/JSUI/JsStartMode/entry/src/main/js/modalhalf/common/img/logo.png differ diff --git a/JSUI/JsStartMode/entry/src/main/js/modalhalf/i18n/en-US.json b/JSUI/JsStartMode/entry/src/main/js/modalhalf/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..0c73814099f2cd1aef0925db9b5dbfaa3e5d0e06 --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/js/modalhalf/i18n/en-US.json @@ -0,0 +1,13 @@ +{ + "strings":{ + "air_clean": "air_clean", + "start": "start", + "good": "good", + "switch": "switch", + "auto": "auto", + "sleep": "sleep", + "more": "more" + }, + "Files":{ + } +} \ No newline at end of file diff --git a/JSUI/JsStartMode/entry/src/main/js/modalhalf/pages/index/modalhalf.css b/JSUI/JsStartMode/entry/src/main/js/modalhalf/pages/index/modalhalf.css new file mode 100644 index 0000000000000000000000000000000000000000..3abcf0baf7ffe61b1702a9b251848e96a0108117 --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/js/modalhalf/pages/index/modalhalf.css @@ -0,0 +1,84 @@ +/* + * 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 { + background-color: #F7F7F7; + flex-direction: column; + align-items: center; +} + +.download { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.logo { + width: 200px; + height: 200px; + margin: 40px; +} + +.downText { + font-size: 35px; + padding: 10px; + margin-bottom: 20px; +} + +.list1 { + height: 120px; +} + +.list-item1{ + background-color: white; + border-radius: 15px; + height: 100px; + margin-left: 30px; + margin-right: 30px; + margin-top: 20px; +} +.col { + display: flex; + justify-content: center; + align-items: center; +} + +.list-item3{ + background-color: white; + border-radius: 15px; + height: 100px; + display: flex; + justify-content: center; + align-items: center; + margin-left: 30px; + margin-right: 30px; + margin-top: 20px; +} + +text { + text-align: center; + font-size: 30px; + align-items: center; +} + +.good { + color: #289428; + font-size: 32px; +} + +.more{ + color: #067DC9; + margin-top: 40px; +} diff --git a/JSUI/JsStartMode/entry/src/main/js/modalhalf/pages/index/modalhalf.hml b/JSUI/JsStartMode/entry/src/main/js/modalhalf/pages/index/modalhalf.hml new file mode 100644 index 0000000000000000000000000000000000000000..ae86b7f9aa74da0576f79d0419ea5353a49e1f16 --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/js/modalhalf/pages/index/modalhalf.hml @@ -0,0 +1,42 @@ + + +
+
+ + {{$t('strings.air_clean')}} +
+ + +
{{$t('strings.start')}}
+
{{$t('strings.good')}}
+
{{$t('strings.switch')}}
+
+
+ + +
{{$t('strings.start')}}
+
{{$t('strings.good')}}
+
{{$t('strings.switch')}}
+
+
+ + +
{{$t('strings.auto')}}
+
{{$t('strings.sleep')}}
+
+
+ {{$t('strings.more')}} +
diff --git a/JSUI/JsStartMode/entry/src/main/js/modalhalf/pages/index/modalhalf.js b/JSUI/JsStartMode/entry/src/main/js/modalhalf/pages/index/modalhalf.js new file mode 100644 index 0000000000000000000000000000000000000000..48390962f595a5780efcf0fe71f0b0c9549bf3a0 --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/js/modalhalf/pages/index/modalhalf.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 { + data: { + title: "" + }, + onInit (){ + this.title = this.$t('strings.world'); + } +} diff --git a/JSUI/JsStartMode/entry/src/main/js/modalpopup/app.js b/JSUI/JsStartMode/entry/src/main/js/modalpopup/app.js new file mode 100644 index 0000000000000000000000000000000000000000..50007322f38c5c4328aa0e7386255727629eb48d --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/js/modalpopup/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/JSUI/JsStartMode/entry/src/main/js/modalpopup/common/img/logo.png b/JSUI/JsStartMode/entry/src/main/js/modalpopup/common/img/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..8ff99801a568aba384af790d7af48f83d9cf1603 Binary files /dev/null and b/JSUI/JsStartMode/entry/src/main/js/modalpopup/common/img/logo.png differ diff --git a/JSUI/JsStartMode/entry/src/main/js/modalpopup/i18n/en-US.json b/JSUI/JsStartMode/entry/src/main/js/modalpopup/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..85518df88655457f8f9140478708de64a57254b3 --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/js/modalpopup/i18n/en-US.json @@ -0,0 +1,10 @@ +{ + "strings":{ + "air_clean": "air_clean", + "continue_use": "please authorize your mobile number to log in", + "exit": "exit", + "HWlogin": "HWlogin" + }, + "Files":{ + } +} \ No newline at end of file diff --git a/JSUI/JsStartMode/entry/src/main/js/modalpopup/pages/index/modalpopup.css b/JSUI/JsStartMode/entry/src/main/js/modalpopup/pages/index/modalpopup.css new file mode 100644 index 0000000000000000000000000000000000000000..3b5c1867ecd47d2936c6215c552dc7b34a74ac41 --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/js/modalpopup/pages/index/modalpopup.css @@ -0,0 +1,69 @@ +/* + * 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 { + background-color: #F7F7F7; + flex-direction: column; + align-items: center; + height: 450px; +} + +.download { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.logo { + margin: 20px; + width: 200px; + height: 200px; +} + +.downText { + font-size: 35px; + padding: 10px; +} + +.list1 { + height: 120px; +} + +.list-item3{ + background-color: white; + border-radius: 15px; + height: 80px; + display: flex; + justify-content: center; + align-items: center; + margin-left: 30px; + margin-right: 30px; + margin-top: 10px; + margin-bottom: 10px; +} + +.btn { + color: #067DC9; +} + +text { + text-align: center; + font-size: 30px; + align-items: center; +} + +.continue_use{ + padding: 10px; +} diff --git a/JSUI/JsStartMode/entry/src/main/js/modalpopup/pages/index/modalpopup.hml b/JSUI/JsStartMode/entry/src/main/js/modalpopup/pages/index/modalpopup.hml new file mode 100644 index 0000000000000000000000000000000000000000..3fca2c448988001c8fefd517380d815e120796c2 --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/js/modalpopup/pages/index/modalpopup.hml @@ -0,0 +1,28 @@ + + +
+
+ + {{$t('strings.air_clean')}} +
+ {{$t('strings.continue_use')}} + + +
{{$t('strings.exit')}}
+
{{$t('strings.HWlogin')}}
+
+
+
diff --git a/JSUI/JsStartMode/entry/src/main/js/modalpopup/pages/index/modalpopup.js b/JSUI/JsStartMode/entry/src/main/js/modalpopup/pages/index/modalpopup.js new file mode 100644 index 0000000000000000000000000000000000000000..c48a9b5a52ecdbab33bdbf77697d4d136d75555f --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/js/modalpopup/pages/index/modalpopup.js @@ -0,0 +1,21 @@ +/* + * 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 { + data: { + }, + onInit (){ + } +} diff --git a/JSUI/JsStartMode/entry/src/main/js/modalsemimode/app.js b/JSUI/JsStartMode/entry/src/main/js/modalsemimode/app.js new file mode 100644 index 0000000000000000000000000000000000000000..50007322f38c5c4328aa0e7386255727629eb48d --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/js/modalsemimode/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/JSUI/JsStartMode/entry/src/main/js/modalsemimode/common/img/logo.png b/JSUI/JsStartMode/entry/src/main/js/modalsemimode/common/img/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..8ff99801a568aba384af790d7af48f83d9cf1603 Binary files /dev/null and b/JSUI/JsStartMode/entry/src/main/js/modalsemimode/common/img/logo.png differ diff --git a/JSUI/JsStartMode/entry/src/main/js/modalsemimode/i18n/en-US.json b/JSUI/JsStartMode/entry/src/main/js/modalsemimode/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..02460dbbf964f1fb215bbe5d370b8cdfb5d63ab8 --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/js/modalsemimode/i18n/en-US.json @@ -0,0 +1,11 @@ +{ + "strings":{ + "air_clean": "air_clean", + "start": "start", + "good": "good", + "switch": "switch", + "more": "more" + }, + "Files":{ + } +} \ No newline at end of file diff --git a/JSUI/JsStartMode/entry/src/main/js/modalsemimode/pages/index/modalsemimode.css b/JSUI/JsStartMode/entry/src/main/js/modalsemimode/pages/index/modalsemimode.css new file mode 100644 index 0000000000000000000000000000000000000000..f2d280812a9b9a78c0ea8333fead2a91a40d2ce8 --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/js/modalsemimode/pages/index/modalsemimode.css @@ -0,0 +1,67 @@ +/* + * 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 { + background-color: #F7F7F7; + flex-direction: column; + align-items: center; +} + +.download { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.logo { + width: 200px; + height: 200px; + margin: 40px; +} + +.downText { + font-size: 35px; + padding: 10px; + margin-bottom: 20px; +} + +.list1 { + height: 120px; +} + +.list-item1{ + background-color: white; + border-radius: 15px; + height: 100px; + margin-left: 30px; + margin-right: 30px; + margin-top: 20px; +} +.col { + display: flex; + justify-content: center; + align-items: center; +} + +text { + text-align: center; + font-size: 30px; + align-items: center; +} + +.good { + color: #289428; + font-size: 32px; +} \ No newline at end of file diff --git a/JSUI/JsStartMode/entry/src/main/js/modalsemimode/pages/index/modalsemimode.hml b/JSUI/JsStartMode/entry/src/main/js/modalsemimode/pages/index/modalsemimode.hml new file mode 100644 index 0000000000000000000000000000000000000000..1ff6e8714cc9a3d7a47da8ae10861338ee794f01 --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/js/modalsemimode/pages/index/modalsemimode.hml @@ -0,0 +1,35 @@ + + +
+
+ + {{$t('strings.air_clean')}} +
+ + +
{{$t('strings.start')}}
+
{{$t('strings.good')}}
+
{{$t('strings.switch')}}
+
+
+ + +
{{$t('strings.start')}}
+
{{$t('strings.good')}}
+
{{$t('strings.switch')}}
+
+
+
diff --git a/JSUI/JsStartMode/entry/src/main/js/modalsemimode/pages/index/modalsemimode.js b/JSUI/JsStartMode/entry/src/main/js/modalsemimode/pages/index/modalsemimode.js new file mode 100644 index 0000000000000000000000000000000000000000..c48a9b5a52ecdbab33bdbf77697d4d136d75555f --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/js/modalsemimode/pages/index/modalsemimode.js @@ -0,0 +1,21 @@ +/* + * 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 { + data: { + }, + onInit (){ + } +} diff --git a/JSUI/JsStartMode/entry/src/main/resources/base/element/string.json b/JSUI/JsStartMode/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..d2707c8ec17be6218b4955e3f479a46b90fe9f43 --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "app_name", + "value": "JsTransparent" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + }, + { + "name": "button_tips", + "value": "Tip: Select the following modal types:" + }, + { + "name": "modal_default", + "value": "Normal Full-screen Mode" + }, + { + "name": "modal_second", + "value": "Half Mode Full Screen" + }, + { + "name": "modal_third", + "value": "Popup Window Mode" + }, + { + "name": "modal_first", + "value": "Semi-mode Popup Window" + } + ] +} \ No newline at end of file diff --git a/JSUI/JsStartMode/entry/src/main/resources/base/layout/main_layout.xml b/JSUI/JsStartMode/entry/src/main/resources/base/layout/main_layout.xml new file mode 100644 index 0000000000000000000000000000000000000000..7b378a6aad61638013ccc71f3a1e04a2e3c6c35d --- /dev/null +++ b/JSUI/JsStartMode/entry/src/main/resources/base/layout/main_layout.xml @@ -0,0 +1,69 @@ + + + + + + + + + {{$t('Strings.batterySubscribeEvent')}} + +
+ +
+ {{$t('Strings.batteryUnSubscribeEvent')}} + +
+ +
+ + + + \ No newline at end of file diff --git a/JSUI/UiComponents/entry/src/main/js/default/pages/index/index.js b/JSUI/UiComponents/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f4a7a3f1e7e7442aed6e500e1512dd8f676352e0 --- /dev/null +++ b/JSUI/UiComponents/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,127 @@ +/* + * 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. + */ + +import prompt from '@system.prompt' + +export default { + data: { + ii18n: {}, + list_data: [{ + name: "ABY", + address: "Mumbai" + }, + { + name: "Tom", + address: "Dehli" + }, + { + name: "Harry", + address: "Chennai" + }], + sliderValue: 1500, + textAreaContent: "" + }, + onInit() { + this.ii18n = this.$t('Strings'); + }, + showPrompt: function () { + this.showToast(this.ii18n.buttonClicked); + }, + setSliderValue: function (e) { + this.sliderValue = e.progress; + }, + showRating: function (e) { + var rating = JSON.stringify(e.rating); + this.showToast(rating + " Star Rating"); + }, + onSwitchChange: function (e) { + var isOn = JSON.stringify(e.checked); + this.showToast("Status enabled : " + isOn); + }, + onSelectChanged: function (e) { + this.showToast(e.newValue); + }, + showMessageFromTextArea: function () { + var text = this.textAreaContent; + if (!text || 0 === text.length) { + text = "Text Area is empty" + } + this.showToast(text); + }, + onTextAreaChange: function (e) { + this.textAreaContent = e.value; + }, + batteryLevel: function () { + this.getBatteryLevel(); + }, + batterySubscribe: function () { + this.batteryLevelSubscribe(); + }, + batteryUnSubscribe: function () { + this.batteryLevelUnSubscribe(); + }, + initAction: function (code) { + var actionData = {}; + var action = {}; + action.bundleName = "ohos.samples.uicomponents"; + action.abilityName = "BatteryInternalAbility"; + action.messageCode = code; + action.data = actionData; + action.abilityType = 1; + action.syncOption = 0; + return action; + }, + getBatteryLevel: async function () { + try { + var action = this.initAction(1001); + var result = await FeatureAbility.callAbility(action); + console.info(" result = " + result); + this.showToast(result); + } catch (pluginError) { + console.error("getBatteryLevel : Plugin Error = " + pluginError); + } + }, + batteryLevelSubscribe: async function () { + try { + var action = this.initAction(1002); + var that = this; + var result = await FeatureAbility.subscribeAbilityEvent(action,function (batteryLevel) { + console.info(" batteryLevel info is: " + batteryLevel); + var batteryData = JSON.parse(batteryLevel).data; + that.showToast(" batteryState change: " + batteryData.msg); + }); + this.showToast(" subscribe result " + result); + console.info(" subscribeCommonEvent result = " + result); + } catch (pluginError) { + console.error("subscribeCommonEvent error : result= " + result + JSON.stringify(pluginError)); + } + }, + batteryLevelUnSubscribe: async function () { + try { + var action = this.initAction(1003); + var result = await FeatureAbility.unsubscribeAbilityEvent(action); + FeatureAbility.callAbility(action); + this.showToast("unsubscribe result " + result); + } catch (pluginError) { + console.error("batteryLevelUnSubscribe error : " + JSON.stringify(pluginError)); + this.showToast("batteryLevelUnSubscribe error : " + JSON.stringify(pluginError)); + } + }, + showToast: function (msg) { + prompt.showToast({ + message: msg + }); + } +} diff --git a/JSUI/UiComponents/entry/src/main/resources/base/element/string.json b/JSUI/UiComponents/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..cb678974e0b8c5c355b990e95649effda033cac2 --- /dev/null +++ b/JSUI/UiComponents/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "UiComponents" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/JSUI/UiComponents/entry/src/main/resources/base/media/icon.png b/JSUI/UiComponents/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/JSUI/UiComponents/entry/src/main/resources/base/media/icon.png differ diff --git a/JSUI/UiComponents/screenshots/phone/LabelTextareaInput.png b/JSUI/UiComponents/screenshots/phone/LabelTextareaInput.png new file mode 100644 index 0000000000000000000000000000000000000000..48a1cc0d35d827f56d47d04b616b5043a59779a6 Binary files /dev/null and b/JSUI/UiComponents/screenshots/phone/LabelTextareaInput.png differ diff --git a/JSUI/UiComponents/screenshots/phone/RatingProgress.png b/JSUI/UiComponents/screenshots/phone/RatingProgress.png new file mode 100644 index 0000000000000000000000000000000000000000..38ca41308539e320bd8fd6c48664e1dd2f83f230 Binary files /dev/null and b/JSUI/UiComponents/screenshots/phone/RatingProgress.png differ diff --git a/JSUI/UiComponents/screenshots/phone/SelectOption.png b/JSUI/UiComponents/screenshots/phone/SelectOption.png new file mode 100644 index 0000000000000000000000000000000000000000..4ff3542f52fda4e4c6e83222473d82a882df1c38 Binary files /dev/null and b/JSUI/UiComponents/screenshots/phone/SelectOption.png differ diff --git a/JSUI/UiComponents/screenshots/phone/StackList.png b/JSUI/UiComponents/screenshots/phone/StackList.png new file mode 100644 index 0000000000000000000000000000000000000000..8087deca225080facc0b174fce4e5e5bca28e6a1 Binary files /dev/null and b/JSUI/UiComponents/screenshots/phone/StackList.png differ diff --git a/JSUI/UiComponents/screenshots/phone/SwiperSlider.png b/JSUI/UiComponents/screenshots/phone/SwiperSlider.png new file mode 100644 index 0000000000000000000000000000000000000000..b87a2aee00ce7c3bbaa7e03e88d6134dcad0be0e Binary files /dev/null and b/JSUI/UiComponents/screenshots/phone/SwiperSlider.png differ diff --git a/JSUI/UiComponents/screenshots/phone/Switch.png b/JSUI/UiComponents/screenshots/phone/Switch.png new file mode 100644 index 0000000000000000000000000000000000000000..b68005902927cf6399a6ebb07a1b839ab074bff7 Binary files /dev/null and b/JSUI/UiComponents/screenshots/phone/Switch.png differ diff --git a/JSUI/UiComponents/screenshots/phone/TextMarqueeSpan.png b/JSUI/UiComponents/screenshots/phone/TextMarqueeSpan.png new file mode 100644 index 0000000000000000000000000000000000000000..30ef881637eb2f4f244cf4a77e2571dee9152756 Binary files /dev/null and b/JSUI/UiComponents/screenshots/phone/TextMarqueeSpan.png differ diff --git a/JSUI/UiComponents/screenshots/phone/batteryinfo.png b/JSUI/UiComponents/screenshots/phone/batteryinfo.png new file mode 100644 index 0000000000000000000000000000000000000000..805b9a2a8eb458f50f8276f69497418441beb532 Binary files /dev/null and b/JSUI/UiComponents/screenshots/phone/batteryinfo.png differ diff --git a/JSUI/UiComponents/settings.gradle b/JSUI/UiComponents/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..7dc3285c045cc590e49d231a4280ef52ba646d91 --- /dev/null +++ b/JSUI/UiComponents/settings.gradle @@ -0,0 +1,15 @@ +/* + * 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. + */ +include ':entry' diff --git a/JSUI/UserRegistration/README_zh.md b/JSUI/UserRegistration/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..7763d870527d25363ec759457d7d621dacc732ad --- /dev/null +++ b/JSUI/UserRegistration/README_zh.md @@ -0,0 +1,3 @@ +# 用户注册(JS) + +- 本示例通过用户注册案例来展示 JS FA 应用基本控件的使用,包括文本输入框,日期选择控件,单选按钮,下拉菜单和普通按钮等。 diff --git a/JSUI/UserRegistration/build.gradle b/JSUI/UserRegistration/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..4e8a6aadbd114fd91535e3347c8a293ad0fab769 --- /dev/null +++ b/JSUI/UserRegistration/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' + +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } +} + +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.2' + } +} + +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + jcenter() + } +} + diff --git a/JSUI/UserRegistration/entry/build.gradle b/JSUI/UserRegistration/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..83f59debbd68242b503a22270f4378d7843ca204 --- /dev/null +++ b/JSUI/UserRegistration/entry/build.gradle @@ -0,0 +1,19 @@ +apply plugin: 'com.huawei.ohos.hap' +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) +} \ No newline at end of file diff --git a/JSUI/UserRegistration/entry/src/main/config.json b/JSUI/UserRegistration/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..6cd7aaeabd69c92c1ad15cdb18e05fd2c9b598e2 --- /dev/null +++ b/JSUI/UserRegistration/entry/src/main/config.json @@ -0,0 +1,61 @@ +{ + "app": { + "bundleName": "ohos.samples.userregistration", + "version": { + "code": 2000000, + "name": "2.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.samples.userregistration", + "name": ".MainAbility", + "reqCapabilities": [ + "video_support" + ], + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "formsEnabled": false, + "name": ".MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index", + "pages/success/success" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/JSUI/UserRegistration/entry/src/main/java/ohos/samples/userregistration/MainAbility.java b/JSUI/UserRegistration/entry/src/main/java/ohos/samples/userregistration/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..eff4e98e68b3326e8b4e8cd3f603b0a533197661 --- /dev/null +++ b/JSUI/UserRegistration/entry/src/main/java/ohos/samples/userregistration/MainAbility.java @@ -0,0 +1,29 @@ +/* + * 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. + */ + +package ohos.samples.userregistration; + +import ohos.aafwk.content.Intent; +import ohos.ace.ability.AceAbility; + +/** + * MainAbility AceAbility. + */ +public class MainAbility extends AceAbility { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + } +} diff --git a/JSUI/UserRegistration/entry/src/main/js/default/app.js b/JSUI/UserRegistration/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..ab248c2e380876301294e2e67ac1d0521dbd32d3 --- /dev/null +++ b/JSUI/UserRegistration/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/JSUI/UserRegistration/entry/src/main/js/default/common/css/common.css b/JSUI/UserRegistration/entry/src/main/js/default/common/css/common.css new file mode 100644 index 0000000000000000000000000000000000000000..c3b72b107dc31483a5bf472ed5a98211589a3521 --- /dev/null +++ b/JSUI/UserRegistration/entry/src/main/js/default/common/css/common.css @@ -0,0 +1,49 @@ +/* + * 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{ + flex: 1; + flex-direction: column; +} + +.page-title-wrap { + padding-top: 50px; + padding-bottom: 80px; + justify-content: center; +} + +.page-title{ + padding-top: 30px; + padding-bottom: 30px; + padding-left: 40px; + padding-right: 40px; + border-color: #bbbbbb; + color: #bbbbbb; + border-bottom-width: 2px; +} + +.btn { + width: 300px; + height: 130px; + text-align: center; + border-radius: 5px; + margin-right: 60px; + margin-left: 60px; + margin-top: 30px; + margin-bottom: 30px; + color: #ffffff; + font-size: 30px; + background-color: #0faeff; +} \ No newline at end of file diff --git a/JSUI/UserRegistration/entry/src/main/js/default/common/logo.png b/JSUI/UserRegistration/entry/src/main/js/default/common/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..8ff99801a568aba384af790d7af48f83d9cf1603 Binary files /dev/null and b/JSUI/UserRegistration/entry/src/main/js/default/common/logo.png differ diff --git a/JSUI/UserRegistration/entry/src/main/js/default/i18n/en-US.json b/JSUI/UserRegistration/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e16da6c26e8861a17afd1579cfd1504a3a4c9b95 --- /dev/null +++ b/JSUI/UserRegistration/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,29 @@ +{ + "Strings": { + "componentName": "User Registration", + "gender": "gender", + "male": "male", + "female": "female", + "secret": "secret", + "userName": "user name", + "userNamePrompt": "6 or more letters and arrays", + "date": "date", + "education": "education", + "graduated": "graduated", + "bachelor": "bachelor", + "master": "master", + "doctor": "doctor", + "register": "register", + + "name_null": "user name is null", + "name_short": "length of user name less than 6", + "gender_null": "gender is null", + "date_null": "date is null", + "education_null": "education is null", + + "back": "back", + "success": "success" + }, + "Files": { + } +} \ No newline at end of file diff --git a/JSUI/UserRegistration/entry/src/main/js/default/pages/index/index.css b/JSUI/UserRegistration/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..7b791b58d41a606c804b898dd9bcf30a75691511 --- /dev/null +++ b/JSUI/UserRegistration/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,55 @@ +/* + * 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. + */ + +@import "../../common/css/common.css"; + +.item-container { + margin-top: 50px; + margin-bottom: 50px; +} + +.item-title { + width: 30%; + padding-left: 30px; + padding-right: 30px; + color: #aaaaaa; + text-align: left; +} + +.item-content { + justify-content: center; + text-align: left; +} + +.input-text { + width: 450px; +} + +.select{ +/* justify-content: center;*/ + text-align: right; +} + +.button-container{ + width: 100%; + height: 150px; +} +.btn{ + width: 100%; + height: 130px; + padding: 10px; + text-align: center; +} + diff --git a/JSUI/UserRegistration/entry/src/main/js/default/pages/index/index.hml b/JSUI/UserRegistration/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..fa10156d29c3fb64feaecb082ea42e8e1c5e5441 --- /dev/null +++ b/JSUI/UserRegistration/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,63 @@ + + +
+
+ {{ $t('Strings.componentName') }} + +
+ + +
+ {{ $t('Strings.userName') }} +
+ +
+
+ + +
+ {{ $t('Strings.date') }} +
+ +
+
+ + +
+ {{ $t('Strings.gender') }} +
+ + + + +
+
+ + +
+ {{ $t('Strings.education') }} + +
+ +
+ +
+
diff --git a/JSUI/UserRegistration/entry/src/main/js/default/pages/index/index.js b/JSUI/UserRegistration/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..62766d8cfe0bdad6ac9716661d40197e78883a26 --- /dev/null +++ b/JSUI/UserRegistration/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,90 @@ +/* + * 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. + */ + +import prompt from '@system.prompt' +import router from '@system.router' + +export default { + data: { + name: '', + date: '1990-01-01', + gender: 'Strings.male', + education: 'Strings.graduated', + }, + onInit() { + }, + getName(e) { + this.name = e.value; + console.info("name=" + this.name) + }, + getDate(e) { + this.date = e.year + '-' + (e.month + 1) + '-' + e.day; + console.info("date=" + this.date) + }, + getFemaleGender(e) { + if (e.checked) { + this.gender = 'Strings.female' + console.info("gender =" + this.gender) + } + }, + getMaleGender(e) { + if (e.checked) { + this.gender = 'Strings.male' + console.info("gender =" + this.gender) + } + }, + getEducation(e) { + this.education = e.newValue; + console.info("education=" + this.education) + }, + onRegiste() { + if (this.name.length == 0) { + prompt.showToast({ + message: this.$t('Strings.name_null') + }) + return; + } + if (this.name.length < 6) { + prompt.showToast({ + message: this.$t('Strings.name_short') + }) + return; + } + if (this.date.length == 0) { + prompt.showToast({ + message: this.$t('Strings.date_null') + }) + return; + } + + if (this.gender.length == 0) { + prompt.showToast({ + message: this.$t('Strings.gender_null') + }) + return; + } + + if (this.education.length == 0) { + prompt.showToast({ + message: this.$t('Strings.education_null') + }) + return; + } + + router.push({ + uri: 'pages/success/success' + }) + } +} diff --git a/JSUI/UserRegistration/entry/src/main/js/default/pages/success/success.css b/JSUI/UserRegistration/entry/src/main/js/default/pages/success/success.css new file mode 100644 index 0000000000000000000000000000000000000000..1fb6a7026f3065ca10ec8d76447ac0a78e2aa876 --- /dev/null +++ b/JSUI/UserRegistration/entry/src/main/js/default/pages/success/success.css @@ -0,0 +1,47 @@ +/* + * 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. + */ + +@import "../../common/css/common.css"; + +.item-container { + width: 100%; + flex: 1; + flex-direction: column; +} + +.txt { + margin-top: 100px; + margin-bottom: 100px; + font-size: 50px; + text-align: center; + color: #bbbbbb; +} + +.item-content { + width: 100%; + justify-content: center; + padding-left: 30px; + padding-right: 30px; +} +.button-container { + width: 100%; + height: 150px; +} +.btn { + width: 100%; + height: 130px; + padding: 10px; + text-align: center; +} \ No newline at end of file diff --git a/JSUI/UserRegistration/entry/src/main/js/default/pages/success/success.hml b/JSUI/UserRegistration/entry/src/main/js/default/pages/success/success.hml new file mode 100644 index 0000000000000000000000000000000000000000..fe68a2e671cbe76714651cd69dc8805210a74001 --- /dev/null +++ b/JSUI/UserRegistration/entry/src/main/js/default/pages/success/success.hml @@ -0,0 +1,21 @@ + + +
+
+ {{ $t('Strings.success') }} + +
+
diff --git a/JSUI/UserRegistration/entry/src/main/js/default/pages/success/success.js b/JSUI/UserRegistration/entry/src/main/js/default/pages/success/success.js new file mode 100644 index 0000000000000000000000000000000000000000..92057e7dfcca309a9529838ac39449e331994a93 --- /dev/null +++ b/JSUI/UserRegistration/entry/src/main/js/default/pages/success/success.js @@ -0,0 +1,28 @@ +/* + * 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. + */ + +import router from '@system.router' + +export default { + data: { + }, + + onBack() { + router.push({ + uri:'pages/index/index' + }) + } + +} diff --git a/JSUI/UserRegistration/entry/src/main/resources/base/element/string.json b/JSUI/UserRegistration/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..684413e4cb540adafabb6846a9a7cf0cccb16e3a --- /dev/null +++ b/JSUI/UserRegistration/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "UserRegistration" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/JSUI/UserRegistration/entry/src/main/resources/base/media/icon.png b/JSUI/UserRegistration/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/JSUI/UserRegistration/entry/src/main/resources/base/media/icon.png differ diff --git a/JSUI/UserRegistration/screenshots/device/Register_Success.png b/JSUI/UserRegistration/screenshots/device/Register_Success.png new file mode 100644 index 0000000000000000000000000000000000000000..35c847dd605e17709c454736ade1d91f2e3617ee Binary files /dev/null and b/JSUI/UserRegistration/screenshots/device/Register_Success.png differ diff --git a/JSUI/UserRegistration/screenshots/device/User_Register.png b/JSUI/UserRegistration/screenshots/device/User_Register.png new file mode 100644 index 0000000000000000000000000000000000000000..900b4fc02b0c5cd4f6a3b56a4c74ac6662a88837 Binary files /dev/null and b/JSUI/UserRegistration/screenshots/device/User_Register.png differ diff --git a/JSUI/UserRegistration/settings.gradle b/JSUI/UserRegistration/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..7dc3285c045cc590e49d231a4280ef52ba646d91 --- /dev/null +++ b/JSUI/UserRegistration/settings.gradle @@ -0,0 +1,15 @@ +/* + * 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. + */ +include ':entry' diff --git a/ability/AbilityConnection/README_zh.md b/ability/AbilityConnection/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..4d62f2824b7cfa036405d047a6c4dd6b8d277710 --- /dev/null +++ b/ability/AbilityConnection/README_zh.md @@ -0,0 +1,27 @@ +# Ability连接 + +### 简介 + +API 提供了 Ability 间的连接能力,如: FA connectAbility PA,本示例主要通过 Ability 连接能力来实现后台下载功能。 + +### 使用说明 + +1.点击Launch Another Ability按钮,跳转页面。 + +​ a.点击Connect Service按钮,连接服务; + +​ b.点击Cancel Task按钮,取消任务; + +​ c.点击Stop Service按钮,停止服务。 + +2.点击Start Service按钮,启动服务 。 + +3.点击Start Task按钮,开始任务。 + +4.点击Cancel Task按钮,取消任务。 + +5.点击Stop Service按钮,停止服务。 + +### 约束与限制 + +本示例支持在大型系统上运行。 diff --git a/ability/AbilityConnection/build.gradle b/ability/AbilityConnection/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..4e8a6aadbd114fd91535e3347c8a293ad0fab769 --- /dev/null +++ b/ability/AbilityConnection/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' + +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } +} + +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.2' + } +} + +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + jcenter() + } +} + diff --git a/ability/AbilityConnection/entry/build.gradle b/ability/AbilityConnection/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..83f59debbd68242b503a22270f4378d7843ca204 --- /dev/null +++ b/ability/AbilityConnection/entry/build.gradle @@ -0,0 +1,19 @@ +apply plugin: 'com.huawei.ohos.hap' +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) +} \ No newline at end of file diff --git a/ability/AbilityConnection/entry/src/main/config.json b/ability/AbilityConnection/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..c984fee8c99efce4673f6d9d635633b0b8dea478 --- /dev/null +++ b/ability/AbilityConnection/entry/src/main/config.json @@ -0,0 +1,73 @@ +{ + "app": { + "bundleName": "ohos.samples.backgrounddownload", + "version": { + "code": 1000000, + "name": "1.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.samples.backgrounddownload", + "name": ".MainAbility", + "reqCapabilities": [ + "video_support" + ], + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "portrait", + "visible": true, + "formsEnabled": false, + "name": ".MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + }, + { + "name": ".DownloadServiceAbility", + "type": "service", + "visible": true, + "backgroundModes": [ + "dataTransfer", + "location" + ] + }, + { + "orientation": "portrait", + "visible": true, + "formsEnabled": false, + "name": ".AnotherAbility", + "icon": "$media:icon", + "description": "$string:anotherAbility_description", + "type": "page", + "launchType": "standard" + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.INTERNET" + } + ] + } +} \ No newline at end of file diff --git a/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/AnotherAbility.java b/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/AnotherAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..e27d86f073cc038bfcd887ae853334eba1105f76 --- /dev/null +++ b/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/AnotherAbility.java @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package ohos.samples.backgrounddownload; + +import ohos.samples.backgrounddownload.slice.AnotherAbilitySlice; + +import ohos.aafwk.ability.Ability; +import ohos.aafwk.content.Intent; + +/** + * AnotherAbility + */ +public class AnotherAbility extends Ability { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + super.setMainRoute(AnotherAbilitySlice.class.getName()); + } +} diff --git a/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/DownloadServiceAbility.java b/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/DownloadServiceAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..5eada0d3f808956930d92ac994bf51ae73e90389 --- /dev/null +++ b/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/DownloadServiceAbility.java @@ -0,0 +1,146 @@ +/* + * 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. + */ + +package ohos.samples.backgrounddownload; + +import static ohos.samples.backgrounddownload.utils.DownloadServiceConnection.getEventHandler; + +import ohos.samples.backgrounddownload.utils.Const; +import ohos.samples.backgrounddownload.utils.LogUtil; + +import ohos.aafwk.ability.Ability; +import ohos.aafwk.content.Intent; +import ohos.eventhandler.InnerEvent; +import ohos.miscservices.download.DownloadConfig; +import ohos.miscservices.download.DownloadSession; +import ohos.miscservices.download.IDownloadListener; +import ohos.rpc.IRemoteObject; +import ohos.rpc.MessageOption; +import ohos.rpc.MessageParcel; +import ohos.rpc.RemoteObject; +import ohos.utils.net.Uri; + +import java.util.ArrayList; +import java.util.List; + +/** + * DownloadServiceAbility + */ +public class DownloadServiceAbility extends Ability implements IDownloadListener { + private static final String TAG = DownloadServiceAbility.class.getSimpleName(); + + private final List downloadSessionList = new ArrayList<>(); + + private class DownloadRemoteObject extends RemoteObject { + private DownloadRemoteObject() { + super("Remote"); + } + + @Override + public boolean onRemoteRequest(int code, MessageParcel data, MessageParcel reply, MessageOption option) { + switch (code) { + case Const.REMOTE_REQUEST_CODE_NEW_TASK: { + startDownload(data.readString()); + reply.writeInt(Const.SEND_REQUEST_SUCCESS); + break; + } + case Const.REMOTE_REQUEST_CODE_CANCEL_TASK: { + cancelDownload(); + reply.writeInt(Const.SEND_REQUEST_SUCCESS); + break; + } + default: + break; + } + return true; + } + } + + @Override + protected void onStart(Intent intent) { + super.onStart(intent); + } + + @Override + protected IRemoteObject onConnect(Intent intent) { + return new DownloadRemoteObject(); + } + + @Override + protected void onStop() { + LogUtil.info(TAG, "service on stop"); + for (DownloadSession downloadSession : downloadSessionList) { + downloadSession.remove(); + downloadSession.removeListener(this); + } + super.onStop(); + } + + private void startDownload(String url) { + Uri uri = Uri.parse(url); + DownloadConfig config = new DownloadConfig.Builder(this, uri).setPath(null, "BackgroundDownload") + .setTitle(url) + .setDescription("This is a download session") + .setNetworkRestriction(DownloadConfig.NETWORK_WIFI | DownloadConfig.NETWORK_MOBILE) + .build(); + DownloadSession downloadSession = new DownloadSession(this, config); + downloadSession.start(); + downloadSession.addListener(this); + downloadSessionList.add(downloadSession); + sendMessage("start download"); + LogUtil.info(TAG, "start download: " + url); + } + + private void cancelDownload() { + LogUtil.info(TAG, "cancel download: --"); + int index = downloadSessionList.size() - 1; + if (index < 0) { + return; + } + downloadSessionList.get(index).remove(); + downloadSessionList.get(index).removeListener(this); + downloadSessionList.remove(index); + LogUtil.info(TAG, "cancel download: " + index); + } + + private void sendMessage(String message) { + InnerEvent innerEvent = InnerEvent.get(Const.HANDLER_EVENT_ID, Const.HANDLER_EVENT_PARAM, message); + getEventHandler().sendEvent(innerEvent); + } + + @Override + public void onRemoved() { + LogUtil.info(TAG, "session on removed"); + sendMessage("session removed"); + } + + @Override + public void onCompleted() { + LogUtil.info(TAG, "onCompleted"); + sendMessage("session complete"); + } + + @Override + public void onFailed(int errorCode) { + LogUtil.info(TAG, "onFailed: " + errorCode); + sendMessage("session fail"); + } + + @Override + public void onProgress(long receivedSize, long totalSize) { + LogUtil.info(TAG, "progress: " + receivedSize + " / " + totalSize); + sendMessage(receivedSize + " / " + totalSize); + } +} \ No newline at end of file diff --git a/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/MainAbility.java b/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..45c966001f3faebc5153ec185b8df33e7eb4fbed --- /dev/null +++ b/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/MainAbility.java @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package ohos.samples.backgrounddownload; + +import ohos.samples.backgrounddownload.slice.MainAbilitySlice; + +import ohos.aafwk.ability.Ability; +import ohos.aafwk.content.Intent; + +/** + * MainAbility + */ +public class MainAbility extends Ability { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + super.setMainRoute(MainAbilitySlice.class.getName()); + } +} diff --git a/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/slice/AnotherAbilitySlice.java b/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/slice/AnotherAbilitySlice.java new file mode 100644 index 0000000000000000000000000000000000000000..644cc18b72da304d9d481e0f755a1393ae14a3b9 --- /dev/null +++ b/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/slice/AnotherAbilitySlice.java @@ -0,0 +1,60 @@ +/* + * 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. + */ + +package ohos.samples.backgrounddownload.slice; + +import ohos.samples.backgrounddownload.ResourceTable; +import ohos.samples.backgrounddownload.utils.DownloadServiceConnection; + +import ohos.aafwk.ability.AbilitySlice; +import ohos.aafwk.content.Intent; +import ohos.agp.components.Text; + +/** + * AnotherAbilitySlice + */ +public class AnotherAbilitySlice extends AbilitySlice implements DownloadServiceConnection.DownloadStateChangeListener { + private DownloadServiceConnection downloadServiceConnection; + + private Text stateText; + + @Override + public void onStart(Intent intent) { + super.onStart(intent); + super.setUIContent(ResourceTable.Layout_another_ability_slice); + initComponents(); + initData(); + } + + private void initComponents() { + stateText = (Text) findComponentById(ResourceTable.Id_state_text); + findComponentById(ResourceTable.Id_start_button).setClickedListener( + component -> downloadServiceConnection.startService()); + findComponentById(ResourceTable.Id_stop_button).setClickedListener( + component -> downloadServiceConnection.stopService()); + findComponentById(ResourceTable.Id_cancel_task_button).setClickedListener( + component -> downloadServiceConnection.cancelTask()); + } + + private void initData() { + downloadServiceConnection = new DownloadServiceConnection(this); + downloadServiceConnection.setDownLoadStateChangeListener(this); + } + + @Override + public void onDownloadStateChange(String message) { + stateText.setText(message); + } +} diff --git a/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/slice/MainAbilitySlice.java b/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/slice/MainAbilitySlice.java new file mode 100644 index 0000000000000000000000000000000000000000..51f5fe3c9b214bcff5091a79ca680eaadae795c5 --- /dev/null +++ b/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/slice/MainAbilitySlice.java @@ -0,0 +1,80 @@ +/* + * 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. + */ + +package ohos.samples.backgrounddownload.slice; + +import ohos.samples.backgrounddownload.ResourceTable; +import ohos.samples.backgrounddownload.utils.Const; +import ohos.samples.backgrounddownload.utils.DownloadServiceConnection; + +import ohos.aafwk.ability.AbilitySlice; +import ohos.aafwk.content.Intent; +import ohos.aafwk.content.Operation; +import ohos.agp.components.Text; + +/** + * MainAbilitySlice + */ +public class MainAbilitySlice extends AbilitySlice implements DownloadServiceConnection.DownloadStateChangeListener { + private DownloadServiceConnection abilityConnection; + + private Text stateText; + + @Override + public void onStart(Intent intent) { + super.onStart(intent); + super.setUIContent(ResourceTable.Layout_main_ability_slice); + initComponents(); + initData(); + } + + private void initComponents() { + findComponentById(ResourceTable.Id_launch_button).setClickedListener(component -> startAnotherAbility()); + findComponentById(ResourceTable.Id_start_button).setClickedListener( + component -> abilityConnection.startService()); + findComponentById(ResourceTable.Id_new_task_button).setClickedListener( + component -> abilityConnection.startTask(Const.DOWNLOAD_FILE_URL)); + findComponentById(ResourceTable.Id_cancel_task_button).setClickedListener( + component -> abilityConnection.cancelTask()); + findComponentById(ResourceTable.Id_stop_button).setClickedListener( + component -> abilityConnection.stopService()); + stateText = (Text) findComponentById(ResourceTable.Id_state_text); + } + + private void initData() { + abilityConnection = new DownloadServiceConnection(this); + } + + @Override + public void onActive() { + super.onActive(); + abilityConnection.setDownLoadStateChangeListener(this); + } + + private void startAnotherAbility() { + Intent intent = new Intent(); + Operation operation = new Intent.OperationBuilder().withDeviceId("") + .withBundleName("ohos.samples.backgrounddownload") + .withAbilityName("ohos.samples.backgrounddownload.AnotherAbility") + .build(); + intent.setOperation(operation); + startAbility(intent); + } + + @Override + public void onDownloadStateChange(String message) { + stateText.setText(message); + } +} diff --git a/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/utils/Const.java b/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/utils/Const.java new file mode 100644 index 0000000000000000000000000000000000000000..b92d1421e07aec8e8f36c0427ec25fa1c7ebd1d3 --- /dev/null +++ b/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/utils/Const.java @@ -0,0 +1,53 @@ +/* + * 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. + */ + +package ohos.samples.backgrounddownload.utils; + + +/** + * const + */ +public class Const { + /** + * Test file download link + */ + public static final String DOWNLOAD_FILE_URL + = "https://gitee.com/openharmony"; + + /** + * code for start a new task + */ + public static final int REMOTE_REQUEST_CODE_NEW_TASK = 0x0000002; + + /** + * code for cancel a new task + */ + public static final int REMOTE_REQUEST_CODE_CANCEL_TASK = 0x0000003; + + /** + * EventHandler eventId + */ + public static final int HANDLER_EVENT_ID = 0x0000004; + + /** + * EventHandler event param + */ + public static final int HANDLER_EVENT_PARAM = 0x0000005; + + /** + * deploy request success + */ + public static final int SEND_REQUEST_SUCCESS = 0x0000006; +} diff --git a/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/utils/DownloadServiceConnection.java b/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/utils/DownloadServiceConnection.java new file mode 100644 index 0000000000000000000000000000000000000000..ef191e7812f8faeece5255fb677d31d89fe2cc76 --- /dev/null +++ b/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/utils/DownloadServiceConnection.java @@ -0,0 +1,217 @@ +/* + * 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. + */ + +package ohos.samples.backgrounddownload.utils; + +import ohos.aafwk.ability.IAbilityConnection; +import ohos.aafwk.content.Intent; +import ohos.aafwk.content.Operation; +import ohos.app.Context; +import ohos.bundle.ElementName; +import ohos.eventhandler.EventHandler; +import ohos.eventhandler.EventRunner; +import ohos.eventhandler.InnerEvent; +import ohos.rpc.IRemoteBroker; +import ohos.rpc.IRemoteObject; +import ohos.rpc.MessageOption; +import ohos.rpc.MessageParcel; +import ohos.rpc.RemoteException; + +/** + * DownloadServiceConnection + */ +public class DownloadServiceConnection implements IAbilityConnection { + private static final String TAG = DownloadServiceConnection.class.getSimpleName(); + + private static DownloadStateChangeListener downloadStateChangeListener; + + /** + * handle message from service to ability slice + */ + private static final EventHandler handler = new EventHandler(EventRunner.current()) { + @Override + protected void processEvent(InnerEvent event) { + if (event.eventId == Const.HANDLER_EVENT_ID && event.object instanceof String) { + String message = (String) event.object; + downloadStateChangeListener.onDownloadStateChange(message); + } + } + }; + + private final Context context; + + private DownloadServiceProxy downloadServiceProxy; + + /** + * DownloadServiceConnection + * + * @param abilityContext Context + */ + public DownloadServiceConnection(Context abilityContext) { + context = abilityContext; + } + + @Override + public void onAbilityConnectDone(ElementName elementName, IRemoteObject iRemoteObject, int resultCode) { + LogUtil.info(TAG, "on Ability Connect Done"); + sendHandlerMessage("service connect done"); + downloadServiceProxy = new DownloadServiceProxy(iRemoteObject); + } + + @Override + public void onAbilityDisconnectDone(ElementName elementName, int resultCode) { + LogUtil.info(TAG, "on Ability Disconnect Done"); + downloadServiceProxy = null; + sendHandlerMessage("service disconnect done"); + } + + /** + * start service + */ + public void startService() { + if (downloadServiceProxy != null) { + sendHandlerMessage("service connected"); + return; + } + context.connectAbility(getIntent(), this); + } + + /** + * stop service + */ + public void stopService() { + if (downloadServiceProxy == null) { + sendHandlerMessage("no service running"); + return; + } + context.disconnectAbility(this); + context.stopAbility(getIntent()); + downloadServiceProxy = null; + } + + /** + * start task + * + * @param url String + */ + public void startTask(String url) { + if (downloadServiceProxy == null) { + sendHandlerMessage("no service running"); + return; + } + downloadServiceProxy.startTask(url); + } + + /** + * cancel task + */ + public void cancelTask() { + if (downloadServiceProxy == null) { + sendHandlerMessage("no service running"); + return; + } + downloadServiceProxy.cancelTask(); + } + + private Intent getIntent() { + Intent intent = new Intent(); + Operation operation = new Intent.OperationBuilder().withDeviceId("") + .withBundleName("ohos.samples.backgrounddownload") + .withAbilityName("ohos.samples.backgrounddownload.DownloadServiceAbility") + .build(); + intent.setOperation(operation); + return intent; + } + + /** + * getEventHandler + * + * @return EventHandler + */ + public static EventHandler getEventHandler() { + return handler; + } + + /** + * setDownLoadStateChangeListener + * + * @param stateChangeListener DownLoadStateChangeListener + */ + public void setDownLoadStateChangeListener(DownloadStateChangeListener stateChangeListener) { + downloadStateChangeListener = stateChangeListener; + } + + private class DownloadServiceProxy implements IRemoteBroker { + private final IRemoteObject remoteObject; + + DownloadServiceProxy(IRemoteObject iRemoteObject) { + remoteObject = iRemoteObject; + } + + @Override + public IRemoteObject asObject() { + return remoteObject; + } + + private void startTask(String url) { + MessageParcel messageParcel = MessageParcel.obtain(); + messageParcel.writeString(url); + MessageParcel messageParcel1 = MessageParcel.obtain(); + MessageOption messageOption = new MessageOption(); + try { + remoteObject.sendRequest(Const.REMOTE_REQUEST_CODE_NEW_TASK, messageParcel, messageParcel1, + messageOption); + if (messageParcel1.readInt() == Const.SEND_REQUEST_SUCCESS) { + sendHandlerMessage("start task"); + } + } catch (RemoteException exception) { + LogUtil.error(TAG, "remote exception"); + } finally { + messageParcel.reclaim(); + messageParcel1.reclaim(); + } + } + + private void cancelTask() { + MessageParcel messageParcel = MessageParcel.obtain(); + MessageParcel messageParcel1 = MessageParcel.obtain(); + MessageOption messageOption = new MessageOption(); + try { + remoteObject.sendRequest(Const.REMOTE_REQUEST_CODE_CANCEL_TASK, messageParcel, messageParcel1, + messageOption); + if (messageParcel1.readInt() == Const.SEND_REQUEST_SUCCESS) { + sendHandlerMessage("cancel task"); + } + } catch (RemoteException exception) { + LogUtil.error(TAG, "remote exception"); + } finally { + messageParcel.reclaim(); + messageParcel1.reclaim(); + } + } + } + + /** + * interface for DownLoad State Change + */ + public interface DownloadStateChangeListener { + void onDownloadStateChange(String message); + } + + private void sendHandlerMessage(String message) { + InnerEvent innerEvent = InnerEvent.get(Const.HANDLER_EVENT_ID, Const.HANDLER_EVENT_PARAM, message); + handler.sendEvent(innerEvent); + } +} diff --git a/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/utils/LogUtil.java b/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/utils/LogUtil.java new file mode 100644 index 0000000000000000000000000000000000000000..240f7c2f02df8423b317f11ef1a16985e5dc7fcc --- /dev/null +++ b/ability/AbilityConnection/entry/src/main/java/ohos/samples/backgrounddownload/utils/LogUtil.java @@ -0,0 +1,45 @@ +/* + * 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. + */ + +package ohos.samples.backgrounddownload.utils; + +import ohos.hiviewdfx.HiLog; +import ohos.hiviewdfx.HiLogLabel; + +/** + * Log utils + */ +public class LogUtil { + private static final String TAG_LOG = "BackgroundDownload"; + + private static final int DOMAIN_ID = 0xD000F00; + + private static final HiLogLabel LABEL_LOG = new HiLogLabel(3, DOMAIN_ID, LogUtil.TAG_LOG); + + private static final String LOG_FORMAT = "%{public}s: %{public}s"; + + private LogUtil() { + } + + + public static void info(String tag, String msg) { + HiLog.info(LABEL_LOG, LOG_FORMAT, tag, msg); + } + + + public static void error(String tag, String msg) { + HiLog.error(LABEL_LOG, LOG_FORMAT, tag, msg); + } +} diff --git a/ability/AbilityConnection/entry/src/main/resources/base/element/string.json b/ability/AbilityConnection/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..d25e979cb4207fc181d639afb0cf13188c0d0c70 --- /dev/null +++ b/ability/AbilityConnection/entry/src/main/resources/base/element/string.json @@ -0,0 +1,44 @@ +{ + "string": [ + { + "name": "app_name", + "value": "AbilityConnection" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + }, + { + "name": "anotherAbility_description", + "value": "hap sample empty page" + }, + { + "name": "launch_button", + "value": "Launch Another Ability" + }, + { + "name": "start_button", + "value": "Start Service" + }, + { + "name": "stop_button", + "value": "Stop Service" + }, + { + "name": "new_task_button", + "value": "Start Task" + }, + { + "name": "cancel_task_button", + "value": "Cancel Task" + }, + { + "name": "state_text", + "value": "--" + }, + { + "name": "connect_service", + "value": "Connect Service" + } + ] +} \ No newline at end of file diff --git a/ability/AbilityConnection/entry/src/main/resources/base/graphic/button_background.xml b/ability/AbilityConnection/entry/src/main/resources/base/graphic/button_background.xml new file mode 100644 index 0000000000000000000000000000000000000000..0f8281e2bcc21fedac56e461c109431d41b09ca0 --- /dev/null +++ b/ability/AbilityConnection/entry/src/main/resources/base/graphic/button_background.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/ability/AbilityConnection/entry/src/main/resources/base/layout/another_ability_slice.xml b/ability/AbilityConnection/entry/src/main/resources/base/layout/another_ability_slice.xml new file mode 100644 index 0000000000000000000000000000000000000000..7946efcc638f934cd9b310b087a39877f455fd35 --- /dev/null +++ b/ability/AbilityConnection/entry/src/main/resources/base/layout/another_ability_slice.xml @@ -0,0 +1,69 @@ + + + + + + +
+ +
+
+ +
+
+ +
+
+ +
+
+ {{textFromNotification}} + +
+ \ No newline at end of file diff --git a/ability/CustomNotification/entry/src/main/js/default/pages/index/index.js b/ability/CustomNotification/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9761f48baabcd4c5054fc29cf3409288a8121126 --- /dev/null +++ b/ability/CustomNotification/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,111 @@ +/* + * 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. + */ + +import prompt from "@system.prompt"; +import router from "@system.router"; + +const injectRef = Object.getPrototypeOf(global) || global; + +injectRef.regeneratorRuntime = require('@babel/runtime/regenerator'); + +export default { + onInit() { + }, + data: { + textFromNotification: "", + }, + clickStartInputNotification: function () { + console.info("AutoReplyNotificationSample, clickStartNotification button clicked in JS"); + this.startNotification(1001); + }, + clickStartButtonNotification: function () { + console.info("AutoReplyNotificationSample, clickStartButtonNotification button clicked in JS"); + this.startNotification(1002); + }, + clickCancelNotification: function () { + console.info("AutoReplyNotificationSample, clickCancelNotification button clicked in JS"); + this.cancelNotification(1003); + }, + clickSubscribeCommonEvent: async function() { + console.info("AutoReplyNotificationSample, clickSubscribeCommonEvent button clicked in JS"); + this.subscribeCommonEvent(1004); + }, + clickUnsubscribeCommonEvent: function () { + console.info("AutoReplyNotificationSample, clickUnsubscribeCommonEvent button clicked in JS"); + this.unsubscribeCommonEvent(1005); + }, + initAction: function (code) { + var actionData = {}; + actionData.notify = "this actionData form JS "; + var action = {}; + action.bundleName = "ohos.samples.autoreplynotificationsample"; + action.abilityName = "NotificationAbility"; + action.messageCode = code; + action.data = actionData; + action.abilityType = 1; + action.syncOption = 0; + return action; + }, + startNotification: async function(code) { + try { + var action = this.initAction(code); + var result = await FeatureAbility.callAbility(action); + console.info(" result = " + result); + this.showToast(result); + } catch (pluginError) { + console.error("startNotification : Plugin Error = " + pluginError); + } + }, + cancelNotification: async function(code) { + try { + var action = this.initAction(code); + var result = await FeatureAbility.callAbility(action); + this.showToast(result); + } catch (pluginError) { + console.error("Plugin error : " + JSON.stringify(pluginError)); + } + }, + subscribeCommonEvent: async function(code) { + try { + var action = this.initAction(code); + var that = this; + var result = await FeatureAbility.subscribeAbilityEvent(action,function (notificationInfo) { + var notificationInfoJson = JSON.parse(notificationInfo); + console.info(" notification info is: " + notificationInfoJson.data); + that.textFromNotification = notificationInfoJson.data; + }); + this.showToast(" subscribe result " + result); + console.info(" subscribeCommonEvent result = " + result); + } catch (pluginError) { + console.error("subscribeCommonEvent error : result= " + result + JSON.stringify(pluginError)); + } + }, + unsubscribeCommonEvent: async function(code) { + try { + var action = this.initAction(code); + var result = await FeatureAbility.unsubscribeAbilityEvent(action); + FeatureAbility.callAbility(action); + this.showToast("unsubscribe result " + result); + } catch (pluginError) { + console.error("Plugin error : " + JSON.stringify(pluginError)); + } + }, + showToast: function (msg) { + prompt.showToast({ + message: msg, + duration: 2000 + }); + } +} diff --git a/ability/CustomNotification/entry/src/main/resources/base/element/string.json b/ability/CustomNotification/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..e310c65c2abbbe6495be5f54cf75422b89ad0a45 --- /dev/null +++ b/ability/CustomNotification/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "CustomNotification" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/ability/CustomNotification/entry/src/main/resources/base/media/icon.png b/ability/CustomNotification/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ability/CustomNotification/entry/src/main/resources/base/media/icon.png differ diff --git a/ability/CustomNotification/entry/src/main/resources/rawfile/icon.png b/ability/CustomNotification/entry/src/main/resources/rawfile/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ability/CustomNotification/entry/src/main/resources/rawfile/icon.png differ diff --git a/ability/CustomNotification/screenshots/device/mainability.png b/ability/CustomNotification/screenshots/device/mainability.png new file mode 100644 index 0000000000000000000000000000000000000000..327439acce166c900d0b9f7b03ee1ff78e81ca04 Binary files /dev/null and b/ability/CustomNotification/screenshots/device/mainability.png differ diff --git a/ability/CustomNotification/settings.gradle b/ability/CustomNotification/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..7dc3285c045cc590e49d231a4280ef52ba646d91 --- /dev/null +++ b/ability/CustomNotification/settings.gradle @@ -0,0 +1,15 @@ +/* + * 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. + */ +include ':entry' diff --git a/ability/DataAbility/README_zh.md b/ability/DataAbility/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..a735af71b8817c9fa8261ab51ca69a0d15a14e43 --- /dev/null +++ b/ability/DataAbility/README_zh.md @@ -0,0 +1,25 @@ +# DataAbility + +### 简介 + +使用 Data 模板的 Ability(以下简称“Data”)有助于应用管理其自身和其他应用存储数据的访问,并提供与其他应用共享数据的方法。Data 既可用于同设备不同应用的数据共享,也支持跨设备不同应用的数据共享。数据的存放形式多样,可以是数据库,也可以是磁盘上的文件。Data 对外提供对数据的增、删、改、查,以及打开文件等接口,这些接口的具体实现由开发者提供。 + +### 使用说明 + +1.点击Insert按钮,添加数据到数据库,并在文本框中显示。 + +2.点击Update按钮,修改数据。 + +3.点击Delete按钮,删除数据。 + +4.点击Query按钮,查询数据。 + +5.点击Batch Insert按钮,批量添加数据。 + +6.点击Batch Execute按钮,批量处理数据。 + +7.点击Read Text File按钮,读取文本内容,并显示。 + +### 约束与限制 + +本示例仅支持大型系统运行。 diff --git a/ability/DataAbility/build.gradle b/ability/DataAbility/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..4e8a6aadbd114fd91535e3347c8a293ad0fab769 --- /dev/null +++ b/ability/DataAbility/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' + +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } +} + +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.2' + } +} + +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + jcenter() + } +} + diff --git a/ability/DataAbility/entry/build.gradle b/ability/DataAbility/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..83f59debbd68242b503a22270f4378d7843ca204 --- /dev/null +++ b/ability/DataAbility/entry/build.gradle @@ -0,0 +1,19 @@ +apply plugin: 'com.huawei.ohos.hap' +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) +} \ No newline at end of file diff --git a/ability/DataAbility/entry/src/main/config.json b/ability/DataAbility/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..a75ccf0245cc687cfaf019adba3cf21b11798ecc --- /dev/null +++ b/ability/DataAbility/entry/src/main/config.json @@ -0,0 +1,69 @@ +{ + "app": { + "bundleName": "ohos.samples.dataability", + "version": { + "code": 2000000, + "name": "2.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.samples.dataability", + "name": ".UserDataAbility", + "reqCapabilities": [ + "video_support" + ], + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "formsEnabled": false, + "name": ".MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + }, + { + "name": ".UserDataAbility", + "type": "data", + "visible": true, + "uri": "dataability://ohos.samples.userdata", + "permissions": [ + "ohos.dataability.CustomPermission" + ] + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.WRITE_USER_STORAGE" + }, + { + "name": "ohos.permission.READ_USER_STORAGE" + }, + { + "name": "ohos.dataability.CustomPermission" + } + ] + } +} \ No newline at end of file diff --git a/ability/DataAbility/entry/src/main/java/ohos/samples/dataability/MainAbility.java b/ability/DataAbility/entry/src/main/java/ohos/samples/dataability/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..0d83540737f7b432a5ef04af564245b7bf0a4014 --- /dev/null +++ b/ability/DataAbility/entry/src/main/java/ohos/samples/dataability/MainAbility.java @@ -0,0 +1,88 @@ +/* + * 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. + */ + +package ohos.samples.dataability; + +import ohos.samples.dataability.slice.MainAbilitySlice; + +import ohos.aafwk.ability.Ability; +import ohos.aafwk.content.Intent; +import ohos.bundle.IBundleManager; +import ohos.global.resource.RawFileEntry; +import ohos.global.resource.Resource; +import ohos.hiviewdfx.HiLog; +import ohos.hiviewdfx.HiLogLabel; +import ohos.security.SystemPermission; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; + +/** + * MainAbility + */ +public class MainAbility extends Ability { + private static final String TAG = MainAbility.class.getSimpleName(); + + private static final HiLogLabel LABEL_LOG = new HiLogLabel(3, 0xD000F00, TAG); + + @Override + public void onStart(Intent intent) { + super.onStart(intent); + super.setMainRoute(MainAbilitySlice.class.getName()); + requestPermissions(); + } + + private void requestPermissions() { + if (verifySelfPermission(SystemPermission.WRITE_USER_STORAGE) != IBundleManager.PERMISSION_GRANTED) { + requestPermissionsFromUser(new String[] {SystemPermission.WRITE_USER_STORAGE}, 0); + } + } + + @Override + public void onRequestPermissionsFromUserResult(int requestCode, String[] permissions, int[] grantResults) { + if (permissions == null || permissions.length == 0 || grantResults == null || grantResults.length == 0) { + return; + } + if (requestCode == 0) { + if (grantResults[0] == IBundleManager.PERMISSION_GRANTED) { + writeToDisk(); + } + } + } + + private void writeToDisk() { + String rawFilePath = "entry/resources/rawfile/userdataability.txt"; + String externalFilePath = getFilesDir() + "/userdataability.txt"; + File file = new File(externalFilePath); + if (file.exists()) { + return; + } + RawFileEntry rawFileEntry = getResourceManager().getRawFileEntry(rawFilePath); + HiLog.info(LABEL_LOG, "%{public}s", externalFilePath); + try (FileOutputStream outputStream = new FileOutputStream(new File(externalFilePath))) { + Resource resource = rawFileEntry.openRawFile(); + // cache length + byte[] cache = new byte[1024]; + int len = resource.read(cache); + while (len != -1) { + outputStream.write(cache, 0, len); + len = resource.read(cache); + } + } catch (IOException exception) { + HiLog.error(LABEL_LOG, "%{public}s", "writeToDisk: IOException"); + } + } +} diff --git a/ability/DataAbility/entry/src/main/java/ohos/samples/dataability/UserDataAbility.java b/ability/DataAbility/entry/src/main/java/ohos/samples/dataability/UserDataAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..431be4f70734945ee57c343933cc6d40c47a27af --- /dev/null +++ b/ability/DataAbility/entry/src/main/java/ohos/samples/dataability/UserDataAbility.java @@ -0,0 +1,132 @@ +/* + * 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. + */ + +package ohos.samples.dataability; + +import ohos.samples.dataability.utils.Const; + +import ohos.aafwk.ability.Ability; +import ohos.aafwk.ability.DataAbilityHelper; +import ohos.aafwk.content.Intent; +import ohos.data.DatabaseHelper; +import ohos.data.dataability.DataAbilityPredicates; +import ohos.data.dataability.DataAbilityUtils; +import ohos.data.rdb.RdbOpenCallback; +import ohos.data.rdb.RdbPredicates; +import ohos.data.rdb.RdbStore; +import ohos.data.rdb.StoreConfig; +import ohos.data.rdb.ValuesBucket; +import ohos.data.resultset.ResultSet; +import ohos.hiviewdfx.HiLog; +import ohos.hiviewdfx.HiLogLabel; +import ohos.rpc.MessageParcel; +import ohos.utils.net.Uri; + +import java.io.File; +import java.io.FileDescriptor; +import java.io.FileInputStream; +import java.io.IOException; + +/** + * FileDataAbility + */ +public class UserDataAbility extends Ability { + private static final String TAG = UserDataAbility.class.getSimpleName(); + + private static final HiLogLabel LABEL_LOG = new HiLogLabel(3, 0xD000F00, TAG); + + private final StoreConfig config = StoreConfig.newDefaultConfig(Const.DB_NAME); + + private RdbStore rdbStore; + + private final RdbOpenCallback rdbOpenCallback = new RdbOpenCallback() { + @Override + public void onCreate(RdbStore store) { + store.executeSql( + "create table if not exists " + Const.DB_TAB_NAME + " (userId integer primary key autoincrement, " + + Const.DB_COLUMN_NAME + " text not null, " + Const.DB_COLUMN_AGE + " integer)"); + HiLog.info(LABEL_LOG, "%{public}s", "create a new database"); + } + + @Override + public void onUpgrade(RdbStore store, int oldVersion, int newVersion) { + HiLog.info(LABEL_LOG, "%{public}s", "DataBase upgrade"); + } + }; + + @Override + public void onStart(Intent intent) { + super.onStart(intent); + DatabaseHelper databaseHelper = new DatabaseHelper(this); + rdbStore = databaseHelper.getRdbStore(config, 1, rdbOpenCallback, null); + } + + @Override + public int insert(Uri uri, ValuesBucket value) { + String path = uri.getLastPath(); + if (!"person".equals(path)) { + HiLog.info(LABEL_LOG, "%{public}s", "DataAbility insert path is not matched"); + return -1; + } + + ValuesBucket values = new ValuesBucket(); + values.putString(Const.DB_COLUMN_NAME, value.getString(Const.DB_COLUMN_NAME)); + values.putInteger(Const.DB_COLUMN_AGE, value.getInteger(Const.DB_COLUMN_AGE)); + int index = (int) rdbStore.insert(Const.DB_TAB_NAME, values); + DataAbilityHelper.creator(this).notifyChange(uri); + return index; + } + + @Override + public int delete(Uri uri, DataAbilityPredicates predicates) { + RdbPredicates rdbPredicates = DataAbilityUtils.createRdbPredicates(predicates, Const.DB_TAB_NAME); + int index = rdbStore.delete(rdbPredicates); + HiLog.info(LABEL_LOG, "%{public}s", "delete"); + DataAbilityHelper.creator(this).notifyChange(uri); + return index; + } + + @Override + public int update(Uri uri, ValuesBucket value, DataAbilityPredicates predicates) { + RdbPredicates rdbPredicates = DataAbilityUtils.createRdbPredicates(predicates, Const.DB_TAB_NAME); + int index = rdbStore.update(value, rdbPredicates); + HiLog.info(LABEL_LOG, "%{public}s", "update"); + DataAbilityHelper.creator(this).notifyChange(uri); + return index; + } + + @Override + public ResultSet query(Uri uri, String[] columns, DataAbilityPredicates predicates) { + RdbPredicates rdbPredicates = DataAbilityUtils.createRdbPredicates(predicates, Const.DB_TAB_NAME); + return rdbStore.query(rdbPredicates, columns); + } + + @Override + public FileDescriptor openFile(Uri uri, String mode) { + File file = new File(getFilesDir(), uri.getDecodedQuery()); + if (!"rw".equals(mode)) { + boolean result = file.setReadOnly(); + HiLog.info(LABEL_LOG, "%{public}s", "setReadOnly result: " + result); + } + FileDescriptor fileDescriptor = null; + try (FileInputStream fileInputStream = new FileInputStream(file)) { + fileDescriptor = fileInputStream.getFD(); + return MessageParcel.dupFileDescriptor(fileDescriptor); + } catch (IOException ioException) { + HiLog.error(LABEL_LOG, "%{public}s", "openFile: ioException"); + } + return fileDescriptor; + } +} diff --git a/ability/DataAbility/entry/src/main/java/ohos/samples/dataability/slice/MainAbilitySlice.java b/ability/DataAbility/entry/src/main/java/ohos/samples/dataability/slice/MainAbilitySlice.java new file mode 100644 index 0000000000000000000000000000000000000000..ed0135ebcb45d38a12de57215714643a2a136d04 --- /dev/null +++ b/ability/DataAbility/entry/src/main/java/ohos/samples/dataability/slice/MainAbilitySlice.java @@ -0,0 +1,259 @@ +/* + * 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. + */ + +package ohos.samples.dataability.slice; + +import ohos.app.dispatcher.task.TaskPriority; +import ohos.samples.dataability.ResourceTable; +import ohos.samples.dataability.utils.Const; + +import ohos.aafwk.ability.AbilitySlice; +import ohos.aafwk.ability.DataAbilityHelper; +import ohos.aafwk.ability.DataAbilityOperation; +import ohos.aafwk.ability.DataAbilityRemoteException; +import ohos.aafwk.ability.IDataAbilityObserver; +import ohos.aafwk.ability.OperationExecuteException; +import ohos.aafwk.content.Intent; +import ohos.agp.components.Component; +import ohos.agp.components.Text; +import ohos.agp.window.dialog.ToastDialog; +import ohos.data.dataability.DataAbilityPredicates; +import ohos.data.rdb.ValuesBucket; +import ohos.data.resultset.ResultSet; +import ohos.hiviewdfx.HiLog; +import ohos.hiviewdfx.HiLogLabel; +import ohos.utils.net.Uri; + +import java.io.BufferedReader; +import java.io.FileDescriptor; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStreamReader; +import java.security.SecureRandom; +import java.util.ArrayList; + +/** + * MainAbilitySlice + */ +public class MainAbilitySlice extends AbilitySlice { + private static final String TAG = MainAbilitySlice.class.getSimpleName(); + + private static final HiLogLabel LABEL_LOG = new HiLogLabel(3, 0xD000F00, TAG); + + private Text logText; + + private DataAbilityHelper databaseHelper; + + private final IDataAbilityObserver dataAbilityObserver = () -> { + HiLog.info(LABEL_LOG, "%{public}s", "database change"); + query(true); + }; + + @Override + public void onStart(Intent intent) { + super.onStart(intent); + super.setUIContent(ResourceTable.Layout_main_ability_slice); + initComponents(); + initDatabaseHelper(); + } + + private void initComponents() { + Component insertButton = findComponentById(ResourceTable.Id_insert_button); + insertButton.setClickedListener(this::insert); + Component deleteButton = findComponentById(ResourceTable.Id_delete_button); + deleteButton.setClickedListener(this::delete); + Component updateButton = findComponentById(ResourceTable.Id_update_button); + updateButton.setClickedListener(this::update); + Component queryButton = findComponentById(ResourceTable.Id_query_button); + queryButton.setClickedListener(component -> query(false)); + Component batchInsertButton = findComponentById(ResourceTable.Id_batch_insert_button); + batchInsertButton.setClickedListener(this::batchInsert); + Component batchExecuteButton = findComponentById(ResourceTable.Id_batch_execute_button); + batchExecuteButton.setClickedListener(this::batchExecute); + Component readFileButton = findComponentById(ResourceTable.Id_read_file_button); + readFileButton.setClickedListener(this::readTextFile); + logText = (Text) findComponentById(ResourceTable.Id_log_text); + } + + private void initDatabaseHelper() { + databaseHelper = DataAbilityHelper.creator(this); + databaseHelper.registerObserver(Uri.parse(Const.BASE_URI), dataAbilityObserver); + } + + private void batchExecute(Component component) { + DataAbilityPredicates predicates = new DataAbilityPredicates(); + // test data + predicates.between(Const.DB_COLUMN_USER_ID, 1, 3); + DataAbilityOperation deleteOperation = DataAbilityOperation.newDeleteBuilder( + Uri.parse(Const.BASE_URI + Const.DATA_PATH)).withPredicates(predicates).build(); + + ValuesBucket valuesBucket = new ValuesBucket(); + valuesBucket.putString(Const.DB_COLUMN_NAME, getRandomName()); + valuesBucket.putInteger(Const.DB_COLUMN_AGE, getRandomAge()); + DataAbilityOperation insertOperation = DataAbilityOperation.newInsertBuilder( + Uri.parse(Const.BASE_URI + Const.DATA_PATH)).withValuesBucket(valuesBucket).build(); + + ArrayList operations = new ArrayList<>(); + operations.add(deleteOperation); + operations.add(insertOperation); + try { + databaseHelper.executeBatch(Uri.parse(Const.BASE_URI + Const.DATA_PATH), operations); + query(true); + } catch (DataAbilityRemoteException | OperationExecuteException e) { + HiLog.error(LABEL_LOG, "%{public}s", "batchExecute: dataAbilityRemoteException|operationExecuteException"); + } + } + + private void delete(Component component) { + DataAbilityPredicates predicates = new DataAbilityPredicates(); + // test data + predicates.between(Const.DB_COLUMN_USER_ID, 1, 2); + try { + databaseHelper.delete(Uri.parse(Const.BASE_URI + Const.DATA_PATH), predicates); + } catch (DataAbilityRemoteException | IllegalStateException exception) { + HiLog.error(LABEL_LOG, "%{public}s", "delete: dataRemote exception|illegalStateException"); + } + } + + private void insert(Component component) { + String name = getRandomName(); + int age = getRandomAge(); + + ValuesBucket valuesBucket = new ValuesBucket(); + valuesBucket.putString(Const.DB_COLUMN_NAME, name); + valuesBucket.putInteger(Const.DB_COLUMN_AGE, age); + try { + databaseHelper.insert(Uri.parse(Const.BASE_URI + Const.DATA_PATH), valuesBucket); + } catch (DataAbilityRemoteException | IllegalStateException exception) { + HiLog.error(LABEL_LOG, "%{public}s", "insert: dataRemote exception|illegalStateException"); + } + } + + private void query(boolean queryAll) { + getGlobalTaskDispatcher(TaskPriority.DEFAULT).asyncDispatch(() -> { + String[] columns = new String[]{Const.DB_COLUMN_NAME, Const.DB_COLUMN_AGE, Const.DB_COLUMN_USER_ID}; + DataAbilityPredicates predicates = new DataAbilityPredicates(); + if (!queryAll) { + // test data + predicates.between(Const.DB_COLUMN_USER_ID, 2, 4); + } + try { + ResultSet resultSet = databaseHelper.query(Uri.parse(Const.BASE_URI + Const.DATA_PATH), columns, + predicates); + appendText(resultSet); + } catch (DataAbilityRemoteException | IllegalStateException exception) { + HiLog.error(LABEL_LOG, "%{public}s", "query: dataRemote exception|illegalStateException"); + } + }); + } + + private void appendText(ResultSet resultSet) { + if (!resultSet.goToFirstRow()) { + HiLog.info(LABEL_LOG, "%{public}s", "query:No result found"); + return; + } + int queryCount = 0; + int allowQueryMaxCount = 100; + StringBuilder appendStr = new StringBuilder(); + int nameIndex = resultSet.getColumnIndexForName(Const.DB_COLUMN_NAME); + int ageIndex = resultSet.getColumnIndexForName(Const.DB_COLUMN_AGE); + int userIndex = resultSet.getColumnIndexForName(Const.DB_COLUMN_USER_ID); + do { + queryCount++; + String name = resultSet.getString(nameIndex); + int age = resultSet.getInt(ageIndex); + int userId = resultSet.getInt(userIndex); + appendStr.append(userId).append(" ").append(name).append(" ").append(age).append(System.lineSeparator()); + } while (resultSet.goToNextRow() && queryCount < allowQueryMaxCount); + resultSet.close(); + HiLog.info(LABEL_LOG, " queryCount : " + queryCount); + HiLog.info(LABEL_LOG, " appendStr : " + appendStr.toString()); + getUITaskDispatcher().asyncDispatch(() -> { + logText.setText(""); + logText.setText(appendStr.toString()); + }); + } + + private void update(Component component) { + DataAbilityPredicates predicates = new DataAbilityPredicates(); + predicates.equalTo(Const.DB_COLUMN_USER_ID, 1); + + ValuesBucket valuesBucket = new ValuesBucket(); + valuesBucket.putString(Const.DB_COLUMN_NAME, "Tom_update"); + valuesBucket.putInteger(Const.DB_COLUMN_AGE, 0); + try { + databaseHelper.update(Uri.parse(Const.BASE_URI + Const.DATA_PATH), valuesBucket, predicates); + } catch (DataAbilityRemoteException | IllegalStateException exception) { + HiLog.error(LABEL_LOG, "%{public}s", "update: dataRemote exception|illegalStateException"); + } + } + + private void batchInsert(Component component) { + ValuesBucket[] values = new ValuesBucket[2]; + values[0] = new ValuesBucket(); + values[0].putString(Const.DB_COLUMN_NAME, getRandomName()); + values[0].putInteger(Const.DB_COLUMN_AGE, getRandomAge()); + values[1] = new ValuesBucket(); + values[1].putString(Const.DB_COLUMN_NAME, getRandomName()); + values[1].putInteger(Const.DB_COLUMN_AGE, getRandomAge()); + try { + databaseHelper.batchInsert(Uri.parse(Const.BASE_URI + Const.DATA_PATH), values); + } catch (DataAbilityRemoteException | IllegalStateException | NullPointerException exception) { + HiLog.error(LABEL_LOG, "%{public}s", + "query: dataRemote exception|illegalStateException|nullPointerException"); + } + } + + private void readTextFile(Component component) { + try { + FileDescriptor fileDescriptor = databaseHelper.openFile( + Uri.parse("dataability:///ohos.samples.userdata/document?userdataability.txt"), "r"); + if (fileDescriptor == null) { + new ToastDialog(this).setText("No such file").show(); + return; + } + showText(fileDescriptor); + } catch (DataAbilityRemoteException | FileNotFoundException exception) { + HiLog.error(LABEL_LOG, "%{public}s", "readTextFile: dataAbilityRemoteException|fileNotFoundException"); + } + } + + private void showText(FileDescriptor fileDescriptor) { + try (FileInputStream fileInputStream = new FileInputStream(fileDescriptor); + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(fileInputStream))) { + String line; + StringBuilder stringBuilder = new StringBuilder(); + while ((line = bufferedReader.readLine()) != null) { + stringBuilder.append(line); + } + logText.setText(stringBuilder.toString()); + } catch (IOException ioException) { + HiLog.error(LABEL_LOG, "%{public}s", "showText: ioException"); + } + } + + // test data + private int getRandomAge() { + return new SecureRandom().nextInt(20); + } + + // test data + private String getRandomName() { + String[] names = {"Tom", "Jerry", "Bob", "Coco", "Sum", "Marry"}; + int index = new SecureRandom().nextInt(names.length); + return names[index]; + } +} diff --git a/ability/DataAbility/entry/src/main/java/ohos/samples/dataability/utils/Const.java b/ability/DataAbility/entry/src/main/java/ohos/samples/dataability/utils/Const.java new file mode 100644 index 0000000000000000000000000000000000000000..3b4f8a73e81c5d5ee631c149524044905b0b9b19 --- /dev/null +++ b/ability/DataAbility/entry/src/main/java/ohos/samples/dataability/utils/Const.java @@ -0,0 +1,56 @@ +/* + * 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. + */ + +package ohos.samples.dataability.utils; + +/** + * Const + */ +public class Const { + /** + * DataAbility base uri + */ + public static final String BASE_URI = "dataability:///ohos.samples.userdata"; + + /** + * Database name + */ + public static final String DB_NAME = "dataability.db"; + + /** + * Database table name + */ + public static final String DB_TAB_NAME = "person"; + + /** + * Database column name:name + */ + public static final String DB_COLUMN_NAME = "name"; + + /** + * Database column name:age + */ + public static final String DB_COLUMN_AGE = "age"; + + /** + * Database column name:userId + */ + public static final String DB_COLUMN_USER_ID = "userId"; + + /** + * Database data path + */ + public static final String DATA_PATH = "/person"; +} diff --git a/ability/DataAbility/entry/src/main/resources/base/element/string.json b/ability/DataAbility/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..62441eee784125b10c5e8fb2c04b1b306d7705d3 --- /dev/null +++ b/ability/DataAbility/entry/src/main/resources/base/element/string.json @@ -0,0 +1,40 @@ +{ + "string": [ + { + "name": "app_name", + "value": "DataAbility" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + }, + { + "name": "insert_button", + "value": "Insert" + }, + { + "name": "delete_button", + "value": "Delete" + }, + { + "name": "update_button", + "value": "Update" + }, + { + "name": "query_button", + "value": "Query" + }, + { + "name": "batch_insert_button", + "value": "Batch Insert" + }, + { + "name": "batch_execute_button", + "value": "Batch Execute" + }, + { + "name": "read_file_button", + "value": "Read Text File" + } + ] +} \ No newline at end of file diff --git a/ability/DataAbility/entry/src/main/resources/base/graphic/button_background.xml b/ability/DataAbility/entry/src/main/resources/base/graphic/button_background.xml new file mode 100644 index 0000000000000000000000000000000000000000..f4a98035344fc8f1a3211c66ec8098eb24fdaf66 --- /dev/null +++ b/ability/DataAbility/entry/src/main/resources/base/graphic/button_background.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/ability/DataAbility/entry/src/main/resources/base/graphic/text_background.xml b/ability/DataAbility/entry/src/main/resources/base/graphic/text_background.xml new file mode 100644 index 0000000000000000000000000000000000000000..a2be5eced130b381ed52752e75424e110c727972 --- /dev/null +++ b/ability/DataAbility/entry/src/main/resources/base/graphic/text_background.xml @@ -0,0 +1,25 @@ + + + + + + + \ No newline at end of file diff --git a/ability/DataAbility/entry/src/main/resources/base/layout/main_ability_slice.xml b/ability/DataAbility/entry/src/main/resources/base/layout/main_ability_slice.xml new file mode 100644 index 0000000000000000000000000000000000000000..1bf839f8ee9801b4cd405ef5a3be25a90083587c --- /dev/null +++ b/ability/DataAbility/entry/src/main/resources/base/layout/main_ability_slice.xml @@ -0,0 +1,141 @@ + + + + + + + + + + + + + diff --git a/ability/JsDistributedMusicPlayer/entry/src/main/js/default/pages/index/index.js b/ability/JsDistributedMusicPlayer/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..13c6e8481b89e7653dd4d14a09b6e38f4801b77c --- /dev/null +++ b/ability/JsDistributedMusicPlayer/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,369 @@ +/* + * 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. + */ + +import featureAbility from '@ohos.ability.featureAbility'; +import RemoteDeviceModel from '../../../model/RemoteDeviceModel.js'; +import PlayerModel from '../../../model/PlayerModel.js'; +import KvStoreModel from '../../../model/KvStoreModel.js'; +import display from '@ohos.display'; + +function getShownTimer(ms) { + var seconds = Math.floor(ms / 1000); + var sec = seconds % 60; + var min = (seconds - sec) / 60; + if (sec < 10) { + sec = '0' + sec; + } + if (min < 10) { + min = '0' + min; + } + return min + ':' + sec; +} + +const REMOTE_ABILITY_STARTED = 'remoteAbilityStarted'; +var DEVICE_LIST_LOCALHOST; +const SYSTEM_UI_HEIGHT = 134; +const DESIGN_WIDTH = 720.0; +const DESIGN_RATIO = 16 / 9; + +export default { + data: { + title: '', + currentTimeText: '', + totalTimeText: '', + totalMs: 0, + currentProgress: 0, + deviceList: [], + btnPlaySrc: '/common/media/ic_play.svg', + albumSrc: '/common/media/album.png', + remoteDeviceModel: new RemoteDeviceModel(), + playerModel: new PlayerModel(), + kvStoreModel: new KvStoreModel(), + isDialogShowing: false, + isSwitching: false, + riscale: 1, // ratio independent scale ratio + risw: 720, // ratio independent screen width + rish: 1280, // ratio independent screen height + hasInitialized: false, + }, + onInit() { + console.info('MusicPlayer[IndexPage] onInit begin'); + console.info("MusicPlayer[IndexPage] getDefaultDisplay begin"); + display.getDefaultDisplay().then(dis => { + console.info("MusicPlayer[IndexPage] getDefaultDisplay dis=" + JSON.stringify(dis)); + var proportion = DESIGN_WIDTH / dis.width; + var screenWidth = DESIGN_WIDTH; + var screenHeight = (dis.height - SYSTEM_UI_HEIGHT) * proportion; + self.riscale = (screenHeight / screenWidth) / DESIGN_RATIO; + if (self.riscale < 1) { + // The screen ratio is shorter than design ratio + self.risw = screenWidth * self.riscale; + self.rish = screenHeight; + } else { + // The screen ratio is longer than design ratio + self.risw = screenWidth; + self.rish = screenHeight / self.riscale; + } + self.hasInitialized = true; + console.info("MusicPlayer[IndexPage] proportion=" + proportion + ", screenWidth=" + + screenWidth + ", screenHeight=" + screenHeight + ", riscale=" + self.riscale + + ", risw=" + self.risw + ", rish=" + self.rish); + }); + console.info("MusicPlayer[IndexPage] getDefaultDisplay end"); + DEVICE_LIST_LOCALHOST = { + name: this.$t('strings.localhost'), + id: 'localhost', + }; + this.deviceList = [DEVICE_LIST_LOCALHOST]; + let self = this; + self.currentTimeText = getShownTimer(0); + this.playerModel.setOnStatusChangedListener((isPlaying) => { + console.info('MusicPlayer[IndexPage] on player status changed, isPlaying=' + isPlaying + ', refresh ui'); + self.playerModel.setOnPlayingProgressListener((currentTimeMs) => { + self.currentTimeText = getShownTimer(currentTimeMs); + self.currentProgress = Math.floor(currentTimeMs / self.totalMs * 100); + }); + if (isPlaying) { + self.btnPlaySrc = '/common/media/ic_pause.svg'; + } else { + self.btnPlaySrc = '/common/media/ic_play.svg'; + } + }); + this.playerModel.getPlaylist(() => { + console.info('MusicPlayer[IndexPage] on playlist generated, refresh ui'); + self.restoreFromWant(); + }); + console.info('MusicPlayer[IndexPage] onInit end'); + }, + restoreFromWant() { + let self = this; + featureAbility.getWant((error, want) => { + console.info('MusicPlayer[IndexPage] featureAbility.getWant=' + JSON.stringify(want)); + var status = want.parameters; + if (status != null && status.uri != null) { + self.kvStoreModel.broadcastMessage(REMOTE_ABILITY_STARTED); + console.info('MusicPlayer[IndexPage] restorePlayingStatus'); + self.playerModel.restorePlayingStatus(status, (index) => { + console.info('MusicPlayer[IndexPage] restorePlayingStatus finished, index=' + index); + if (index >= 0) { + self.refreshSongInfo(index); + } else { + self.playerModel.preLoad(0, () => { + self.refreshSongInfo(0); + }); + } + }); + } else { + self.playerModel.preLoad(0, () => { + self.refreshSongInfo(0); + }); + } + }); + }, + onNewRequest() { + console.info('MusicPlayer[IndexPage] onNewRequest'); + this.playerModel.pause(); + this.playerModel.seek(0); + this.restoreFromWant(); + }, + onBackPress() { + console.info('MusicPlayer[IndexPage] onBackPress isDialogShowing=' + this.isDialogShowing); + if (this.isDialogShowing === true) { + this.dismissDialog(); + return true; + } + return false; + }, + onDestroy() { + console.info('MusicPlayer[IndexPage] onDestroy begin'); + this.playerModel.release(); + this.remoteDeviceModel.unregisterDeviceListCallback(); + console.info('MusicPlayer[IndexPage] onDestroy end'); + }, + refreshSongInfo(index) { + console.info('MusicPlayer[IndexPage] refreshSongInfo ' + index + '/' + + this.playerModel.playlist.audioFiles.length); + if (index >= this.playerModel.playlist.audioFiles.length) { + console.warn('MusicPlayer[IndexPage] refreshSongInfo ignored'); + return; + } + // update song title + this.title = this.playerModel.playlist.audioFiles[index].name; + this.albumSrc = (index % 2 === 0) ? '/common/media/album.png' : '/common/media/album2.png'; + + // update duration + this.totalMs = this.playerModel.getDuration(); + this.totalTimeText = getShownTimer(this.totalMs); + this.currentTimeText = getShownTimer(this.playerModel.getCurrentMs()); + this.currentProgress = Math.floor(this.playerModel.getCurrentMs() / this.totalMs * 100); + + console.info('MusicPlayer[IndexPage] refreshSongInfo this.title=' + this.title + ' this.totalMs=' + + this.totalMs + ' this.totalTimeText=' + this.totalTimeText + ' this.currentTimeText=' + this.currentTimeText); + }, + setProgress(e) { + console.info('MusicPlayer[IndexPage] setProgress ' + e.mode + ', ' + e.value); + this.currentProgress = e.value; + if (isNaN(this.totalMs)) { + this.currentProgress = 0; + console.info('MusicPlayer[IndexPage] setProgress ignored, totalMs=' + this.totalMs); + return; + } + var currentMs = this.currentProgress / 100 * this.totalMs; + this.currentTimeText = getShownTimer(currentMs); + if (e.mode === 'end' || e.mode === 'click') { + console.info('MusicPlayer[IndexPage] player.seek ' + currentMs); + this.playerModel.seek(currentMs); + } + }, + onPreviousClick() { + if (this.isSwitching) { + console.info('MusicPlayer[IndexPage] onPreviousClick ignored, isSwitching'); + return; + } + console.info('MusicPlayer[IndexPage] onPreviousClick'); + this.playerModel.index--; + if (this.playerModel.index < 0 && this.playerModel.playlist.audioFiles.length >= 1) { + this.playerModel.index = this.playerModel.playlist.audioFiles.length - 1; + } + this.currentProgress = 0; + this.isSwitching = true; + let self = this; + this.playerModel.preLoad(this.playerModel.index, () => { + self.refreshSongInfo(self.playerModel.index); + self.playerModel.play(0, true); + self.isSwitching = false; + }); + }, + onNextClick() { + if (this.isSwitching) { + console.info('MusicPlayer[IndexPage] onNextClick ignored, isSwitching'); + return; + } + console.info('MusicPlayer[IndexPage] onNextClick'); + this.playerModel.index++; + if (this.playerModel.index >= this.playerModel.playlist.audioFiles.length) { + this.playerModel.index = 0; + } + this.currentProgress = 0; + this.isSwitching = true; + let self = this; + this.playerModel.preLoad(this.playerModel.index, () => { + self.refreshSongInfo(self.playerModel.index); + self.playerModel.play(0, true); + self.isSwitching = false; + }); + }, + onPlayClick() { + if (this.isSwitching) { + console.info('MusicPlayer[IndexPage] onPlayClick ignored, isSwitching'); + return; + } + console.info('MusicPlayer[IndexPage] onPlayClick, isPlaying=' + this.playerModel.isPlaying); + if (this.playerModel.isPlaying) { + this.playerModel.pause(); + } else { + this.playerModel.preLoad(this.playerModel.index, () => { + this.playerModel.play(-1, true); + }); + } + }, + onContinueAbilityClick() { + console.info('MusicPlayer[IndexPage] onContinueAbilityClick begin'); + let self = this; + this.remoteDeviceModel.registerDeviceListCallback(() => { + console.info('MusicPlayer[IndexPage] registerDeviceListCallback, callback entered'); + var list = []; + list[0] = DEVICE_LIST_LOCALHOST; + var deviceList; + if (self.remoteDeviceModel.discoverList.length > 0) { + deviceList = self.remoteDeviceModel.discoverList; + } else { + deviceList = self.remoteDeviceModel.deviceList; + } + console.info('MusicPlayer[IndexPage] on remote device updated, count=' + deviceList.length); + for (var i = 0; i < deviceList.length; i++) { + console.info('MusicPlayer[IndexPage] device ' + i + '/' + deviceList.length + ' deviceId=' + + deviceList[i].deviceId + ' deviceName=' + deviceList[i].deviceName + ' deviceType=' + + deviceList[i].deviceType); + list[i + 1] = { + name: deviceList[i].deviceName, + id: deviceList[i].deviceId, + }; + } + self.deviceList = list; + }); + this.$element('continueAbilityDialog').show(); + this.isDialogShowing = true; + console.info('MusicPlayer[IndexPage] onContinueAbilityClick end'); + }, + startAbilityContinuation(deviceId, deviceName) { + this.$element('continueAbilityDialog').close(); + var params; + if (this.playerModel.index >= 0 && this.playerModel.index <= this.playerModel.playlist.audioFiles.length) { + params = { + uri: this.playerModel.playlist.audioFiles[this.playerModel.index].fileUri, + seekTo: this.playerModel.getCurrentMs(), + isPlaying: this.playerModel.isPlaying + }; + } else { + params = { + uri: '', + seekTo: 0, + isPlaying: false + }; + } + console.info('MusicPlayer[IndexPage] featureAbility.startAbility deviceId=' + deviceId + + ' deviceName=' + deviceName); + var wantValue = { + bundleName: 'com.ohos.distributedmusicplayer', + abilityName: 'com.ohos.distributedmusicplayer.MainAbility', + deviceId: deviceId, + parameters: params + }; + var timerId = setTimeout(() => { + console.info('MusicPlayer[IndexPage] onMessageReceiveTimeout, terminateSelf'); + featureAbility.terminateSelf((error) => { + console.info('MusicPlayer[IndexPage] terminateSelf finished, error=' + error); + }); + }, 3000); + this.kvStoreModel.setOnMessageReceivedListener(REMOTE_ABILITY_STARTED, () => { + console.info('MusicPlayer[IndexPage] OnMessageReceived, terminateSelf'); + clearTimeout(timerId); + featureAbility.terminateSelf((error) => { + console.info('MusicPlayer[IndexPage] terminateSelf finished, error=' + error); + }); + }); + featureAbility.startAbility({ + want: wantValue + }).then((data) => { + console.info('MusicPlayer[IndexPage] featureAbility.startAbility finished, ' + JSON.stringify(data)); + }); + console.info('MusicPlayer[IndexPage] featureAbility.startAbility want=' + JSON.stringify(wantValue)); + console.info('MusicPlayer[IndexPage] featureAbility.startAbility end'); + }, + onRadioChange(inputValue, e) { + console.info('MusicPlayer[IndexPage] onRadioChange ' + inputValue + ', ' + e.value); + if (inputValue === e.value) { + if (e.value === 'localhost') { + this.$element('continueAbilityDialog').close(); + return; + } + if (this.remoteDeviceModel.discoverList.length > 0) { + console.info('MusicPlayer[IndexPage] continue to unauthed device'); + var name = null; + for (var i = 0; i < this.remoteDeviceModel.discoverList.length; i++) { + if (this.remoteDeviceModel.discoverList[i].deviceId === e.value) { + name = this.remoteDeviceModel.discoverList[i].deviceName; + break; + } + } + if (name == null) { + console.error('MusicPlayer[IndexPage] onRadioChange failed, can not get name from discoverList'); + return; + } + console.info('MusicPlayer[IndexPage] onRadioChange name=' + name); + + let self = this; + this.remoteDeviceModel.authDevice(e.value, () => { + console.info('MusicPlayer[IndexPage] auth and online finished'); + for (i = 0; i < self.remoteDeviceModel.deviceList.length; i++) { + if (self.remoteDeviceModel.deviceList[i].deviceName === name) { + this.startAbilityContinuation(self.remoteDeviceModel.deviceList[i].deviceId, self.remoteDeviceModel.deviceList[i].deviceName); + } + } + }); + } else { + console.info('MusicPlayer[IndexPage] continue to authed device'); + for (i = 0; i < this.remoteDeviceModel.deviceList.length; i++) { + if (this.remoteDeviceModel.deviceList[i].deviceId === e.value) { + this.startAbilityContinuation(this.remoteDeviceModel.deviceList[i].deviceId, this.remoteDeviceModel.deviceList[i].deviceName); + } + } + } + } + }, + cancelDialog(e) { + this.remoteDeviceModel.unregisterDeviceListCallback(); + this.isDialogShowing = false; + }, + onDismissDialogClicked(e) { + this.dismissDialog(); + }, + dismissDialog() { + this.$element('continueAbilityDialog').close(); + this.remoteDeviceModel.unregisterDeviceListCallback(); + this.isDialogShowing = false; + } +}; diff --git a/ability/JsDistributedMusicPlayer/entry/src/main/js/model/KvStoreModel.js b/ability/JsDistributedMusicPlayer/entry/src/main/js/model/KvStoreModel.js new file mode 100644 index 0000000000000000000000000000000000000000..53875c47cdff3b1a4055d5617119971575653b28 --- /dev/null +++ b/ability/JsDistributedMusicPlayer/entry/src/main/js/model/KvStoreModel.js @@ -0,0 +1,114 @@ +/* + * 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. + */ + +import distributedData from '@ohos.data.distributeddata'; + +const STORE_ID = 'musicplayer_kvstore'; + +export default class KvStoreModel { + kvManager; + kvStore; + + constructor() { + } + + createKvStore(callback) { + if (typeof (this.kvStore) === 'undefined') { + var config = { + bundleName: 'com.ohos.distributedmusicplayer', + userInfo: { + userId: '0', + userType: 0 + } + }; + let self = this; + console.info('MusicPlayer[KvStoreModel] createKVManager begin'); + distributedData.createKVManager(config).then((manager) => { + console.info('MusicPlayer[KvStoreModel] createKVManager success, kvManager=' + JSON.stringify(manager)); + self.kvManager = manager; + var options = { + createIfMissing: true, + encrypt: false, + backup: false, + autoSync: true, + kvStoreType: 1, + schema: '', + securityLevel: 3, + }; + console.info('MusicPlayer[KvStoreModel] kvManager.getKVStore begin'); + self.kvManager.getKVStore(STORE_ID, options).then((store) => { + console.info('MusicPlayer[KvStoreModel] getKVStore success, kvStore=' + store); + self.kvStore = store; + callback(); + }); + console.info('MusicPlayer[KvStoreModel] kvManager.getKVStore end'); + }); + console.info('MusicPlayer[KvStoreModel] createKVManager end'); + } else { + callback(); + } + } + + broadcastMessage(msg) { + console.info('MusicPlayer[KvStoreModel] broadcastMessage ' + msg); + var num = Math.random(); + let self = this; + this.createKvStore(() => { + self.put(msg, num); + }); + } + + put(key, value) { + console.info('MusicPlayer[KvStoreModel] kvStore.put ' + key + '=' + value); + this.kvStore.put(key, value).then((data) => { + this.kvStore.get(key).then((data) => { + console.info('MusicPlayer[KvStoreModel] kvStore.get ' + key + '=' + JSON.stringify(data)); + }); + console.info('MusicPlayer[KvStoreModel] kvStore.put ' + key + ' finished, data=' + JSON.stringify(data)); + }).catch((err) => { + console.error('MusicPlayer[KvStoreModel] kvStore.put ' + key + ' failed, ' + JSON.stringify(err)); + }); + } + + setOnMessageReceivedListener(msg, callback) { + console.info('MusicPlayer[KvStoreModel] setOnMessageReceivedListener ' + msg); + let self = this; + this.createKvStore(() => { + console.info('MusicPlayer[KvStoreModel] kvStore.on(dataChange) begin'); + self.kvStore.on('dataChange', 1, (data) => { + console.info('MusicPlayer[KvStoreModel] dataChange, ' + JSON.stringify(data)); + console.info('MusicPlayer[KvStoreModel] dataChange, insert ' + data.insertEntries.length + ' udpate ' + + data.updateEntries.length); + for (var i = 0; i < data.insertEntries.length; i++) { + if (data.insertEntries[i].key === msg) { + console.info('MusicPlayer[KvStoreModel] insertEntries receive ' + msg + '=' + + JSON.stringify(data.insertEntries[i].value)); + callback(); + return; + } + } + for (i = 0; i < data.updateEntries.length; i++) { + if (data.updateEntries[i].key === msg) { + console.info('MusicPlayer[KvStoreModel] updateEntries receive ' + msg + '=' + + JSON.stringify(data.updateEntries[i].value)); + callback(); + return; + } + } + }); + console.info('MusicPlayer[KvStoreModel] kvStore.on(dataChange) end'); + }); + } +} \ No newline at end of file diff --git a/ability/JsDistributedMusicPlayer/entry/src/main/js/model/PlayerModel.js b/ability/JsDistributedMusicPlayer/entry/src/main/js/model/PlayerModel.js new file mode 100644 index 0000000000000000000000000000000000000000..f13fc67868a40e7212d83a5350fbd851cb66ad39 --- /dev/null +++ b/ability/JsDistributedMusicPlayer/entry/src/main/js/model/PlayerModel.js @@ -0,0 +1,301 @@ +/* + * 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. + */ + +import media from '@ohos.multimedia.media'; +import mediaLibrary from '@ohos.multimedia.medialibrary'; + +export + +class Playlist { + constructor() { + } + + audioFiles = []; +} +export + +class Song { + constructor(name, fileUri, duration) { + this.name = name; + this.fileUri = fileUri; + this.duration = duration; + } +} +export default class PlayerModel { + isPlaying = false; + playlist = new Playlist; + index; + #player; + #statusChangedListener; + #playingProgressListener; + #intervalID; + #currentTimeMs = 0; + + constructor() { + this.#player = media.createAudioPlayer(); + console.info('MusicPlayer[PlayerModel] createAudioPlayer=' + this.#player); + } + + initAudioPlayer() { + console.info('MusicPlayer[PlayerModel] initAudioPlayer begin'); + this.#player.on('error', (err, action) => { + console.error(`MusicPlayer[PlayerModel] player error: ${err.code}`); + }); + let self = this; + this.#player.on('finish', (err, action) => { + if (err) { + console.error(`MusicPlayer[PlayerModel] error returned in finish() callback`); + return; + } + console.log('MusicPlayer[PlayerModel] finish() callback is called'); + self.notifyPlayingStatus(false); + }); + this.#player.on('timeUpdate', (err, action) => { + if (err) { + console.error(`MusicPlayer[PlayerModel] error returned in timeUpdate() callback`); + return; + } + console.log('MusicPlayer[PlayerModel] timeUpdate() callback is called, ' + JSON.stringify(action)) + }); + console.info('MusicPlayer[PlayerModel] initAudioPlayer end'); + } + + release() { + if (typeof (this.#player) != 'undefined') { + console.info('MusicPlayer[PlayerModel] player.release begin'); + this.#player.release(); + console.info('MusicPlayer[PlayerModel] player.release end'); + this.#player = undefined; + } + } + + restorePlayingStatus(status, callback) { + console.info('MusicPlayer[PlayerModel] restorePlayingStatus ' + JSON.stringify(status)); + for (var i = 0; i < this.playlist.audioFiles.length; i++) { + if (this.playlist.audioFiles[i].fileUri === status.uri) { + console.info('MusicPlayer[PlayerModel] restore to index ' + i); + this.preLoad(i, () => { + this.play(status.seekTo, status.isPlaying); + console.info('MusicPlayer[PlayerModel] restore play status'); + callback(i); + }); + return; + } + } + console.warn('MusicPlayer[PlayerModel] restorePlayingStatus failed'); + callback(-1); + } + + getPlaylist(callback) { + // generate play list + console.info('MusicPlayer[PlayerModel] generatePlayList'); + var helper = mediaLibrary.getMediaLibraryHelper(); + const args = { + selections: 'audio', + selectionArgs: ['audioalbum'], + }; + let self = this; + console.info('MusicPlayer[PlayerModel] getAudioAssets begin'); + self.playlist = new Playlist(); + self.playlist.audioFiles = []; + self.playlist.audioFiles[0] = new Song('dynamic.wav', 'file://system/etc/dynamic.wav', 0); + self.playlist.audioFiles[1] = new Song('demo.wav', 'file://system/etc/demo.wav', 0); + helper.getAudioAssets(args, (error, value) => { + console.info('MusicPlayer[PlayerModel] getAudioAssets callback entered'); + if (error) { + console.info('MusicPlayer[PlayerModel] getAudioAssets returned an error' + error.message); + } + if (value == undefined) { + console.info('MusicPlayer[PlayerModel] getAudioAssets, There are no images in ' + args.selections + ' folder'); + } else if (value != undefined) { + console.info('MusicPlayer[PlayerModel] getAudioAssets result.length = ' + value.length); + var beginIndex = self.playlist.audioFiles.length; + for (var i = 0; i < value.length; i++) { + var index = beginIndex + i; + self.playlist.audioFiles[index] = new Song(); + self.playlist.audioFiles[index].name = value[i].name; + self.playlist.audioFiles[index].fileUri = 'file:/' + value[i].URI; + self.playlist.audioFiles[index].duration = 0; + console.info('MusicPlayer[PlayerModel] getAudioAssets result ' + i + ', name=' + + self.playlist.audioFiles[index].name + ',URI=' + self.playlist.audioFiles[index].fileUri); + } + } + callback(); + }); + console.info('MusicPlayer[PlayerModel] getAudioAssets end'); + } + + setOnStatusChangedListener(callback) { + this.#statusChangedListener = callback; + } + + setOnPlayingProgressListener(callback) { + this.#playingProgressListener = callback; + } + + notifyPlayingStatus(isPlaying) { + this.isPlaying = isPlaying; + this.#statusChangedListener(this.isPlaying); + console.log('MusicPlayer[PlayerModel] notifyPlayingStatus isPlaying=' + isPlaying + ' intervalId=' + this.#intervalID); + if (isPlaying) { + if (typeof (this.#intervalID) === 'undefined') { + let self = this; + this.#intervalID = setInterval(() => { + if (typeof (self.#playingProgressListener) != "undefined" && self.#playingProgressListener != null) { + var timeMs = self.#player.currentTime; + this.#currentTimeMs = timeMs; + if (typeof (timeMs) === 'undefined') { + timeMs = 0; + } + console.log('MusicPlayer[PlayerModel] player.currentTime=' + timeMs); + self.#playingProgressListener(timeMs); + } + }, 500); + console.log('MusicPlayer[PlayerModel] set update interval ' + this.#intervalID); + } + } else { + this.cancelTimer(); + } + } + + cancelTimer() { + if (typeof (this.#intervalID) != 'undefined') { + console.log('MusicPlayer[PlayerModel] clear update interval ' + this.#intervalID); + clearInterval(this.#intervalID); + this.#intervalID = undefined; + } + } + + preLoad(index, callback) { + console.info('MusicPlayer[PlayerModel] preLoad ' + index + "/" + this.playlist.audioFiles.length); + if (index < 0 || index >= this.playlist.audioFiles.length) { + console.error('MusicPlayer[PlayerModel] preLoad ignored'); + return 0; + } + this.index = index; + var source = this.playlist.audioFiles[index].fileUri; + if (typeof (source) === 'undefined') { + console.error('MusicPlayer[PlayerModel] preLoad ignored, source=' + source); + return; + } + console.info('MusicPlayer[PlayerModel] preLoad ' + source + ' begin'); + console.info('MusicPlayer[PlayerModel] state=' + this.#player.state); + let self = this; + if (source === this.#player.src && this.#player.state != 'idle') { + console.info('MusicPlayer[PlayerModel] preLoad finished. src not changed'); + callback(); + } else if (this.#player.state === 'idle') { + this.#player.on('dataLoad', () => { + console.info('MusicPlayer[PlayerModel] dataLoad callback, state=' + self.#player.state); + callback(); + }); + console.info('MusicPlayer[PlayerModel] player.src=' + source); + this.#player.src = source; + } else { + this.notifyPlayingStatus(false); + this.cancelTimer(); + console.info('MusicPlayer[PlayerModel] player.reset'); + self.#player.reset(); + console.info('MusicPlayer[PlayerModel] player.reset done, state=' + self.#player.state); + self.#player.on('dataLoad', () => { + console.info('MusicPlayer[PlayerModel] dataLoad callback, state=' + self.#player.state); + callback(); + }); + console.info('MusicPlayer[PlayerModel] player.src=' + source); + self.#player.src = source; + } + console.info('MusicPlayer[PlayerModel] preLoad ' + source + ' end'); + } + + getDuration() { + console.info('MusicPlayer[PlayerModel] getDuration index=' + this.index); + if (this.playlist.audioFiles[this.index].duration > 0) { + return this.playlist.audioFiles[this.index].duration; + } + console.info('MusicPlayer[PlayerModel] getDuration state=' + this.#player.state); + if (this.#player.state === 'idle') { + console.warn('MusicPlayer[PlayerModel] getDuration ignored, player.state=' + this.#player.state); + return 0; + } + this.playlist.audioFiles[this.index].duration = Math.min(this.#player.duration, 97615); + console.info('MusicPlayer[PlayerModel] getDuration player.src=' + this.#player.src + ", player.duration=" + this.playlist.audioFiles[this.index].duration); + return this.playlist.audioFiles[this.index].duration; + } + + getCurrentMs() { + return this.#currentTimeMs; + } + + play(seekTo, startPlay) { + console.info('MusicPlayer[PlayerModel] play seekTo=' + seekTo + ', startPlay=' + startPlay); + this.notifyPlayingStatus(startPlay); + if (startPlay) { + if (seekTo < 0 && this.#currentTimeMs > 0) { + console.info('MusicPlayer[PlayerModel] pop seekTo=' + this.#currentTimeMs); + seekTo = this.#currentTimeMs; + } + let self = this; + this.#player.on('play', (err, action) => { + if (err) { + console.error(`MusicPlayer[PlayerModel] error returned in play() callback`); + return; + } + console.log('MusicPlayer[PlayerModel] play() callback entered, player.state=' + self.#player.state); + if (seekTo > 0) { + self.seek(seekTo); + } + }); + console.info('MusicPlayer[PlayerModel] call player.play'); + this.#player.play(); + console.info('MusicPlayer[PlayerModel] player.play called player.state=' + this.#player.state); + } else if (seekTo > 0) { + this.#playingProgressListener(seekTo); + this.#currentTimeMs = seekTo; + console.info('MusicPlayer[PlayerModel] stash seekTo=' + this.#currentTimeMs); + } + } + + pause() { + if (!this.isPlaying) { + console.info('MusicPlayer[PlayerModel] pause ignored, isPlaying=' + this.isPlaying); + return; + } + this.notifyPlayingStatus(false); + console.info('MusicPlayer[PlayerModel] call player.pause'); + this.#player.pause(); + console.info('MusicPlayer[PlayerModel] player.pause called, player.state=' + this.#player.state); + } + + seek(ms) { + this.#currentTimeMs = ms; + if (this.isPlaying) { + console.log('MusicPlayer[PlayerModel] player.seek ' + ms); + this.#player.seek(ms); + } else { + console.log('MusicPlayer[PlayerModel] stash seekTo=' + ms); + } + } + + stop() { + if (!this.isPlaying) { + console.info('MusicPlayer[PlayerModel] stop ignored, isPlaying=' + this.isPlaying); + return; + } + this.notifyPlayingStatus(false); + console.info('MusicPlayer[PlayerModel] call player.stop'); + this.#player.stop(); + console.info('MusicPlayer[PlayerModel] player.stop called, player.state=' + this.#player.state); + } +} \ No newline at end of file diff --git a/ability/JsDistributedMusicPlayer/entry/src/main/js/model/RemoteDeviceModel.js b/ability/JsDistributedMusicPlayer/entry/src/main/js/model/RemoteDeviceModel.js new file mode 100644 index 0000000000000000000000000000000000000000..6e91a1a1e68e38ca7b909546aae92b3c78361b37 --- /dev/null +++ b/ability/JsDistributedMusicPlayer/entry/src/main/js/model/RemoteDeviceModel.js @@ -0,0 +1,184 @@ +/* + * 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. + */ + +import deviceManager from '@ohos.distributedHardware.deviceManager'; + +var SUBSCRIBE_ID = 100; + +export default class RemoteDeviceModel { + deviceList = []; + discoverList = []; + callback; + authCallback = null; + #deviceManager; + + constructor() { + } + + registerDeviceListCallback(callback) { + if (typeof (this.#deviceManager) === 'undefined') { + console.log('MusicPlayer[RemoteDeviceModel] deviceManager.createDeviceManager begin'); + let self = this; + deviceManager.createDeviceManager('com.ohos.distributedmusicplayer', (error, value) => { + if (error) { + console.error('createDeviceManager failed.'); + return; + } + self.#deviceManager = value; + self.registerDeviceListCallback_(callback); + console.log('MusicPlayer[RemoteDeviceModel] createDeviceManager callback returned, error=' + error + ' value=' + value); + }); + console.log('MusicPlayer[RemoteDeviceModel] deviceManager.createDeviceManager end'); + } else { + this.registerDeviceListCallback_(callback); + } + } + + registerDeviceListCallback_(callback) { + console.info('MusicPlayer[RemoteDeviceModel] registerDeviceListCallback'); + this.callback = callback; + if (this.#deviceManager == undefined) { + console.error('MusicPlayer[RemoteDeviceModel] deviceManager has not initialized'); + this.callback(); + return; + } + + console.info('MusicPlayer[RemoteDeviceModel] getTrustedDeviceListSync begin'); + var list = this.#deviceManager.getTrustedDeviceListSync(); + console.info('MusicPlayer[RemoteDeviceModel] getTrustedDeviceListSync end, deviceList=' + JSON.stringify(list)); + if (typeof (list) != 'undefined' && typeof (list.length) != 'undefined') { + this.deviceList = list; + } + this.callback(); + console.info('MusicPlayer[RemoteDeviceModel] callback finished'); + + let self = this; + this.#deviceManager.on('deviceStateChange', (data) => { + console.info('MusicPlayer[RemoteDeviceModel] deviceStateChange data=' + JSON.stringify(data)); + switch (data.action) { + case 0: + self.deviceList[self.deviceList.length] = data.device; + console.info('MusicPlayer[RemoteDeviceModel] online, updated device list=' + JSON.stringify(self.deviceList)); + self.callback(); + if (self.authCallback != null) { + self.authCallback(); + self.authCallback = null; + } + break; + case 2: + if (self.deviceList.length > 0) { + for (var i = 0; i < self.deviceList.length; i++) { + if (self.deviceList[i].deviceId === data.device.deviceId) { + self.deviceList[i] = data.device; + break; + } + } + } + console.info('MusicPlayer[RemoteDeviceModel] change, updated device list=' + JSON.stringify(self.deviceList)); + self.callback(); + break; + case 1: + if (self.deviceList.length > 0) { + var list = []; + for (var i = 0; i < self.deviceList.length; i++) { + if (self.deviceList[i].deviceId != data.device.deviceId) { + list[i] = data.device; + } + } + self.deviceList = list; + } + console.info('MusicPlayer[RemoteDeviceModel] offline, updated device list=' + JSON.stringify(data.device)); + self.callback(); + break; + default: + break; + } + }); + this.#deviceManager.on('deviceFound', (data) => { + console.info('MusicPlayer[RemoteDeviceModel] deviceFound data=' + JSON.stringify(data)); + console.info('MusicPlayer[RemoteDeviceModel] deviceFound self.deviceList=' + self.deviceList); + console.info('MusicPlayer[RemoteDeviceModel] deviceFound self.deviceList.length=' + self.deviceList.length); + for (var i = 0; i < self.discoverList.length; i++) { + if (self.discoverList[i].deviceId === data.device.deviceId) { + console.info('MusicPlayer[RemoteDeviceModel] device founded, ignored'); + return; + } + } + self.discoverList[self.discoverList.length] = data.device; + self.callback(); + }); + this.#deviceManager.on('discoverFail', (data) => { + console.info('MusicPlayer[RemoteDeviceModel] discoverFail data=' + JSON.stringify(data)); + }); + this.#deviceManager.on('serviceDie', () => { + console.error('MusicPlayer[RemoteDeviceModel] serviceDie'); + }); + + SUBSCRIBE_ID = Math.floor(65536 * Math.random()); + var info = { + subscribeId: SUBSCRIBE_ID, + mode: 0xAA, + medium: 2, + freq: 2, + isSameAccount: false, + isWakeRemote: true, + capability: 0 + }; + console.info('MusicPlayer[RemoteDeviceModel] startDeviceDiscovery ' + SUBSCRIBE_ID); + this.#deviceManager.startDeviceDiscovery(info); + } + + authDevice(deviceId, callback) { + console.info('MusicPlayer[RemoteDeviceModel] authDevice ' + deviceId); + for (var i = 0; i < this.discoverList.length; i++) { + if (this.discoverList[i].deviceId === deviceId) { + console.info('MusicPlayer[RemoteDeviceModel] device founded, ignored'); + let extraInfo = { + "targetPkgName": 'com.ohos.distributedmusicplayer', + "appName": 'Music', + "appDescription": 'Music player application', + "business": '0' + }; + let authParam = { + "authType": 1, + "appIcon": '', + "appThumbnail": '', + "extraInfo": extraInfo + }; + console.info('MusicPlayer[RemoteDeviceModel] authenticateDevice ' + JSON.stringify(this.discoverList[i])); + let self = this; + this.#deviceManager.authenticateDevice(this.discoverList[i], authParam, (err, data) => { + if (err) { + console.info('MusicPlayer[RemoteDeviceModel] authenticateDevice failed, err=' + JSON.stringify(err)); + self.authCallback = null; + } else { + console.info('MusicPlayer[RemoteDeviceModel] authenticateDevice succeed, data=' + JSON.stringify(data)); + self.authCallback = callback; + } + }); + } + } + } + + unregisterDeviceListCallback() { + console.info('MusicPlayer[RemoteDeviceModel] stopDeviceDiscovery ' + SUBSCRIBE_ID); + this.#deviceManager.stopDeviceDiscovery(SUBSCRIBE_ID); + this.#deviceManager.off('deviceStateChange'); + this.#deviceManager.off('deviceFound'); + this.#deviceManager.off('discoverFail'); + this.#deviceManager.off('serviceDie'); + this.deviceList = []; + } +} \ No newline at end of file diff --git a/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/album.png b/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/album.png new file mode 100644 index 0000000000000000000000000000000000000000..f11d87e33c69edfd3dc18ce52764a0325f7b3e39 Binary files /dev/null and b/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/album.png differ diff --git a/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/album2.png b/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/album2.png new file mode 100644 index 0000000000000000000000000000000000000000..31e86725e0b367603dda942d1e2c744c2d0c5b78 Binary files /dev/null and b/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/album2.png differ diff --git a/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/bg_blurry.png b/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/bg_blurry.png new file mode 100644 index 0000000000000000000000000000000000000000..4fcb62599bbab2b4992baa98f5d9d7e429fd7c4f Binary files /dev/null and b/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/bg_blurry.png differ diff --git a/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/ic_hop.svg b/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/ic_hop.svg new file mode 100644 index 0000000000000000000000000000000000000000..a3c9baade44146810d8b91691934ab4b7bf98adf --- /dev/null +++ b/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/ic_hop.svg @@ -0,0 +1,8 @@ + + + icon_hop + + + + + \ No newline at end of file diff --git a/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/ic_pause.svg b/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/ic_pause.svg new file mode 100644 index 0000000000000000000000000000000000000000..8f71f032115891474fff08377d907503dffe0231 --- /dev/null +++ b/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/ic_pause.svg @@ -0,0 +1,12 @@ + + + icon_pause + + + + + + + + + \ No newline at end of file diff --git a/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/ic_play.svg b/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/ic_play.svg new file mode 100644 index 0000000000000000000000000000000000000000..f701fa61f2893958b798e1d32fae9b06ee6503d7 --- /dev/null +++ b/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/ic_play.svg @@ -0,0 +1,12 @@ + + + icon_play + + + + + + + + + \ No newline at end of file diff --git a/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/ic_play_next.svg b/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/ic_play_next.svg new file mode 100644 index 0000000000000000000000000000000000000000..627e85cfa153f07a3c07e7aecccab76df2b96015 --- /dev/null +++ b/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/ic_play_next.svg @@ -0,0 +1,12 @@ + + + icon_play_next + + + + + + + + + \ No newline at end of file diff --git a/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/ic_play_previous.svg b/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/ic_play_previous.svg new file mode 100644 index 0000000000000000000000000000000000000000..c0a738f5cf0ede3ea70d0d69c097d8ab9215b25d --- /dev/null +++ b/ability/JsDistributedMusicPlayer/entry/src/main/js/share/common/media/ic_play_previous.svg @@ -0,0 +1,12 @@ + + + icon_play_last + + + + + + + + + \ No newline at end of file diff --git a/ability/JsDistributedMusicPlayer/entry/src/main/resources/base/element/string.json b/ability/JsDistributedMusicPlayer/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..4688f64b6aff9aee32e10479f3408a6bf5425e03 --- /dev/null +++ b/ability/JsDistributedMusicPlayer/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "音乐" + }, + { + "name": "mainability_description", + "value": "Music player main page" + } + ] +} \ No newline at end of file diff --git a/ability/JsDistributedMusicPlayer/entry/src/main/resources/base/media/icon.png b/ability/JsDistributedMusicPlayer/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..95c923a7a989aaad7d5a58daee4ff76d6b8c6bfd Binary files /dev/null and b/ability/JsDistributedMusicPlayer/entry/src/main/resources/base/media/icon.png differ diff --git a/ability/JsDistributedMusicPlayer/screenshots/device/distributed.gif b/ability/JsDistributedMusicPlayer/screenshots/device/distributed.gif new file mode 100644 index 0000000000000000000000000000000000000000..baa392fcf56c3f54ca44b5a43becc01ce2482ebc Binary files /dev/null and b/ability/JsDistributedMusicPlayer/screenshots/device/distributed.gif differ diff --git a/ability/JsDistributedMusicPlayer/screenshots/device/main.png b/ability/JsDistributedMusicPlayer/screenshots/device/main.png new file mode 100644 index 0000000000000000000000000000000000000000..2a02979099da9d46bb7ffbe253ab83aaff117378 Binary files /dev/null and b/ability/JsDistributedMusicPlayer/screenshots/device/main.png differ diff --git a/ability/JsDistributedMusicPlayer/settings.gradle b/ability/JsDistributedMusicPlayer/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..7dc3285c045cc590e49d231a4280ef52ba646d91 --- /dev/null +++ b/ability/JsDistributedMusicPlayer/settings.gradle @@ -0,0 +1,15 @@ +/* + * 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. + */ +include ':entry' diff --git a/ability/Notification/README_zh.md b/ability/Notification/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..ca968646856bc4e6036d6bc8237d9656d96b630e --- /dev/null +++ b/ability/Notification/README_zh.md @@ -0,0 +1,28 @@ +# 通知 + +### 简介 + +通知,即在一个应用的UI界面之外显示的消息,主要用来提醒用户有来自该应用中的信息。 + +当应用向系统发出通知时,它将先以图标的形式显示在通知栏中,用户可以下拉通知栏查看通知的详细信息。常见的使用场景: + +1、显示接收到短消息、即时消息等。 + +2、显示应用的推送消息,如广告、版本更新等。 + +3、显示当前正在进行的事件,如播放音乐、导航、下载等。 + +### 使用说明 + +1.点击“Publish Notification”按钮,发送通知,并在通知栏中显示。 + +2.点击“Publish Text Notification”按钮,发送自定义通知,在通知栏显示自定义通知的名字及内容。 + +3.点击“Cancel Notification”按钮,从通知栏删除当前通知。 + +4.点击“Cancel All Notification”按钮,从通知栏删除所有通知。 + +### 约束与限制 + +本示例仅支持在大型系统上运行。 + diff --git a/ability/Notification/build.gradle b/ability/Notification/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..4e8a6aadbd114fd91535e3347c8a293ad0fab769 --- /dev/null +++ b/ability/Notification/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' + +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } +} + +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.2' + } +} + +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + jcenter() + } +} + diff --git a/ability/Notification/entry/build.gradle b/ability/Notification/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..83f59debbd68242b503a22270f4378d7843ca204 --- /dev/null +++ b/ability/Notification/entry/build.gradle @@ -0,0 +1,19 @@ +apply plugin: 'com.huawei.ohos.hap' +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 4 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) +} \ No newline at end of file diff --git a/ability/Notification/entry/src/main/config.json b/ability/Notification/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..cd96a4c71e308412375de314f35d5e1dd3bd21c6 --- /dev/null +++ b/ability/Notification/entry/src/main/config.json @@ -0,0 +1,49 @@ +{ + "app": { + "bundleName": "ohos.samples.notification", + "version": { + "code": 2000000, + "name": "2.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.samples.notification", + "name": ".MainAbility", + "reqCapabilities": [ + "video_support" + ], + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "formsEnabled": false, + "name": ".MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + } + ] + } +} \ No newline at end of file diff --git a/ability/Notification/entry/src/main/java/ohos/samples/notification/MainAbility.java b/ability/Notification/entry/src/main/java/ohos/samples/notification/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..9b0198ccc6062c505bd19c02a70b99a0eddd5a1a --- /dev/null +++ b/ability/Notification/entry/src/main/java/ohos/samples/notification/MainAbility.java @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package ohos.samples.notification; + +import ohos.samples.notification.slice.MainAbilitySlice; + +import ohos.aafwk.ability.Ability; +import ohos.aafwk.content.Intent; + +/** + * MainAbility + */ +public class MainAbility extends Ability { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + super.setMainRoute(MainAbilitySlice.class.getName()); + } +} diff --git a/ability/Notification/entry/src/main/java/ohos/samples/notification/slice/MainAbilitySlice.java b/ability/Notification/entry/src/main/java/ohos/samples/notification/slice/MainAbilitySlice.java new file mode 100644 index 0000000000000000000000000000000000000000..04b5b4c6fcb78bc7eb26905bb0f3fd9e391e18cd --- /dev/null +++ b/ability/Notification/entry/src/main/java/ohos/samples/notification/slice/MainAbilitySlice.java @@ -0,0 +1,235 @@ +/* + * 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. + */ + +package ohos.samples.notification.slice; + +import ohos.aafwk.content.Operation; +import ohos.agp.components.Text; +import ohos.event.commonevent.CommonEventData; +import ohos.event.commonevent.CommonEventSubscriber; +import ohos.samples.notification.MainAbility; +import ohos.samples.notification.ResourceTable; +import ohos.samples.notification.utils.Const; + +import ohos.aafwk.ability.AbilitySlice; +import ohos.aafwk.content.Intent; +import ohos.aafwk.content.IntentParams; +import ohos.agp.components.Component; +import ohos.bundle.ElementName; +import ohos.event.commonevent.CommonEventManager; +import ohos.event.commonevent.CommonEventSubscribeInfo; +import ohos.event.commonevent.MatchingSkills; +import ohos.event.intentagent.IntentAgent; +import ohos.event.intentagent.IntentAgentConstant; +import ohos.event.intentagent.IntentAgentHelper; +import ohos.event.intentagent.IntentAgentInfo; +import ohos.event.notification.NotificationActionButton; +import ohos.event.notification.NotificationConstant; +import ohos.event.notification.NotificationHelper; +import ohos.event.notification.NotificationRequest; +import ohos.event.notification.NotificationSlot; +import ohos.event.notification.NotificationUserInput; +import ohos.hiviewdfx.HiLog; +import ohos.hiviewdfx.HiLogLabel; +import ohos.rpc.RemoteException; +import ohos.utils.PacMap; +import ohos.utils.net.Uri; + +import java.util.ArrayList; +import java.util.List; + +/** + * MainAbilitySlice + */ +public class MainAbilitySlice extends AbilitySlice { + private static final String TAG = MainAbility.class.getSimpleName(); + + private static final HiLogLabel LABEL_LOG = new HiLogLabel(3, 0xD000F00, TAG); + + private NotificationEventSubscriber eventSubscriber; + + private int notificationId; + + @Override + public void onStart(Intent intent) { + super.onStart(intent); + super.setUIContent(ResourceTable.Layout_main_ability_slice); + subscribeCommonEvent(); + defineNotificationSlot(); + initComponents(); + } + + private void initComponents() { + Component publishButton = findComponentById(ResourceTable.Id_publish_button); + Component publishTextButton = findComponentById(ResourceTable.Id_publish_text_button); + publishButton.setClickedListener( + component -> publishNotification()); + publishTextButton.setClickedListener( + component -> publishNotificationWithAction()); + Component cancelButton = findComponentById(ResourceTable.Id_cancel_button); + Component cancelAllButton = findComponentById(ResourceTable.Id_cancel_all_button); + cancelButton.setClickedListener(component -> cancel()); + cancelAllButton.setClickedListener(component -> cancelAll()); + } + + private void defineNotificationSlot() { + NotificationSlot notificationSlot = new NotificationSlot(Const.SLOT_ID, Const.SLOT_NAME, NotificationSlot.LEVEL_HIGH); + notificationSlot.setEnableVibration(true); + notificationSlot.setLockscreenVisibleness(NotificationRequest.VISIBLENESS_TYPE_PUBLIC); + Uri uri = Uri.parse(Const.SOUND_URI); + notificationSlot.setSound(uri); + try { + NotificationHelper.addNotificationSlot(notificationSlot); + } catch (RemoteException ex) { + HiLog.error(LABEL_LOG, "%{public}s", "defineNotificationSlot remoteException."); + } + } + + private void publishNotification() { + notificationId = 0x1000001; + NotificationRequest request = new NotificationRequest(notificationId).setSlotId(Const.SLOT_ID) + .setTapDismissed(true); + request.setContent(createNotificationContent(Const.NOTIFICATION_TITLE, Const.NOTIFICATION_CONTENT)); + IntentAgent intentAgent = createIntentAgent(MainAbility.class.getName(), + IntentAgentConstant.OperationType.START_ABILITY); + request.setIntentAgent(intentAgent); + try { + NotificationHelper.publishNotification(request); + } catch (RemoteException ex) { + HiLog.error(LABEL_LOG, "%{public}s", "publishNotification remoteException."); + } + } + + private void publishNotificationWithAction() { + notificationId = 0x1000002; + NotificationRequest request = new NotificationRequest(notificationId).setSlotId(Const.SLOT_ID) + .setTapDismissed(true); + request.setContent(createNotificationContent(Const.NOTIFICATION_TITLE2, Const.NOTIFICATION_CONTENT2)); + IntentAgent intentAgent = createIntentAgent(MainAbility.class.getName(), + IntentAgentConstant.OperationType.SEND_COMMON_EVENT); + request.setIntentAgent(intentAgent); + NotificationUserInput input = new NotificationUserInput.Builder(Const.NOTIFICATION_INPUT_KEY).setTag( + Const.NOTIFICATION_OPER_TITLE).build(); + NotificationActionButton actionButton = new NotificationActionButton.Builder(null, + Const.NOTIFICATION_OPER_TITLE, intentAgent).addNotificationUserInput(input) + .setSemanticActionButton(NotificationConstant.SemanticActionButton.ARCHIVE_ACTION_BUTTON) + .setAutoCreatedReplies(false) + .build(); + request.addActionButton(actionButton); + try { + NotificationHelper.publishNotification(request); + } catch (RemoteException ex) { + HiLog.error(LABEL_LOG, "%{public}s", "publishNotificationWithAction remoteException."); + } + } + + private NotificationRequest.NotificationContent createNotificationContent(String title, String text) { + NotificationRequest.NotificationNormalContent content + = new NotificationRequest.NotificationNormalContent().setTitle(title).setText(text); + return new NotificationRequest.NotificationContent(content); + } + + private IntentAgent createIntentAgent(String ability, IntentAgentConstant.OperationType operationType) { + Intent intent = new Intent(); + Operation operation = new Intent.OperationBuilder().withAction(Const.NOTIFICATION_ACTION).build(); + intent.setOperation(operation); + if (operationType != IntentAgentConstant.OperationType.SEND_COMMON_EVENT) { + intent.setElement(new ElementName("", Const.BUNDLE_NAME, ability)); + } + List intents = new ArrayList<>(); + intents.add(intent); + IntentAgentInfo agentInfo = new IntentAgentInfo(Const.REQUEST_CODE, operationType, + IntentAgentConstant.Flags.UPDATE_PRESENT_FLAG, intents, new IntentParams()); + return IntentAgentHelper.getIntentAgent(getContext(), agentInfo); + } + + private void cancel() { + try { + NotificationHelper.cancelNotification(notificationId); + } catch (RemoteException ex) { + HiLog.error(LABEL_LOG, "%{public}s", "cancel remoteException."); + } + } + + private void cancelAll() { + try { + NotificationHelper.cancelAllNotifications(); + } catch (RemoteException ex) { + HiLog.error(LABEL_LOG, "%{public}s", "cancelAll remoteException."); + } + } + + @Override + protected void onStop() { + super.onStop(); + unSubscribeCommonEvent(); + } + + private void subscribeCommonEvent() { + MatchingSkills skills = new MatchingSkills(); + skills.addEvent(Const.NOTIFICATION_ACTION); + CommonEventSubscribeInfo subscribeInfo = new CommonEventSubscribeInfo(skills); + subscribeInfo.setThreadMode(CommonEventSubscribeInfo.ThreadMode.HANDLER); + eventSubscriber = new NotificationEventSubscriber(subscribeInfo, this); + try { + CommonEventManager.subscribeCommonEvent(eventSubscriber); + } catch (RemoteException e) { + HiLog.error(LABEL_LOG, "%{public}s", "subscribeCommonEvent remoteException."); + } + } + + private void unSubscribeCommonEvent() { + try { + CommonEventManager.unsubscribeCommonEvent(eventSubscriber); + } catch (RemoteException e) { + HiLog.error(LABEL_LOG, "%{public}s", "unSubscribeCommonEvent remoteException."); + } + } + + static class NotificationEventSubscriber extends CommonEventSubscriber { + private final AbilitySlice slice; + + /** + * Constructor + * + * @param subscribeInfo subscribe information + * @param slice slice who own the subscriber + */ + public NotificationEventSubscriber(CommonEventSubscribeInfo subscribeInfo, AbilitySlice slice) { + super(subscribeInfo); + this.slice = slice; + } + + @Override + public void onReceiveEvent(CommonEventData commonEventData) { + Intent intent = commonEventData.getIntent(); + if (intent == null) { + return; + } + if (Const.NOTIFICATION_ACTION.equals(intent.getAction())) { + PacMap pacMap = NotificationUserInput.getInputsFromIntent(intent); + if (pacMap == null) { + return; + } + String inputText = pacMap.getString(Const.NOTIFICATION_INPUT_KEY); + slice.getUITaskDispatcher().asyncDispatch(() -> { + Text replyText = (Text) slice.findComponentById(ResourceTable.Id_notify2_reply); + replyText.setText(inputText); + }); + } + } + } + +} diff --git a/ability/Notification/entry/src/main/java/ohos/samples/notification/utils/Const.java b/ability/Notification/entry/src/main/java/ohos/samples/notification/utils/Const.java new file mode 100644 index 0000000000000000000000000000000000000000..0c64427a788cbac686ffc458058cc0ea09bc51ab --- /dev/null +++ b/ability/Notification/entry/src/main/java/ohos/samples/notification/utils/Const.java @@ -0,0 +1,85 @@ +/* + * 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. + */ + +package ohos.samples.notification.utils; + +/** + * Notification Const + */ +public class Const { + /** + * bundle name + */ + public static final String BUNDLE_NAME = "ohos.samples.notification"; + + /** + * notification slot id + */ + public static final String SLOT_ID = "high"; + + /** + * notification slot name + */ + public static final String SLOT_NAME = "Order notification"; + + /** + * notification request code + */ + public static final int REQUEST_CODE = 1000; + + /** + * notification title + */ + public static final String NOTIFICATION_TITLE = "Normal Notification"; + + /** + * notification content + */ + public static final String NOTIFICATION_CONTENT = "There is a normal notification content."; + + /** + * sound uri + */ + public static final String SOUND_URI = "ohos.resource://ohos.samples.notification/rawfile/bell2"; + + /** + * notification title + */ + public static final String NOTIFICATION_TITLE2 = "Custom Notification"; + + /** + * notification content + */ + public static final String NOTIFICATION_CONTENT2 = "You can enter custom text."; + + /** + * notification action + */ + public static final String NOTIFICATION_ACTION = "REPLY_ACTION"; + + /** + * notification action input key + */ + public static final String NOTIFICATION_INPUT_KEY = "REPLY_KEY"; + + /** + * notification action button title + */ + public static final String NOTIFICATION_OPER_TITLE = "Reply"; + + private Const() { + /* Do nothing */ + } +} diff --git a/ability/Notification/entry/src/main/resources/base/element/string.json b/ability/Notification/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f6cb5ac70efd15f1fd4466a1b8e1c54c927ec245 --- /dev/null +++ b/ability/Notification/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "app_name", + "value": "Notification" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + }, + { + "name": "publish_button", + "value": "Publish Notification" + }, + { + "name": "publish_text_button", + "value": "Publish Text Notification" + }, + { + "name": "cancel_button", + "value": "Cancel Notification" + }, + { + "name": "cancel_all_button", + "value": "Cancel All Notifications" + }, + { + "name": "notify2_reply", + "value": "Notification input text would change me" + } + ] +} \ No newline at end of file diff --git a/ability/Notification/entry/src/main/resources/base/graphic/button_background.xml b/ability/Notification/entry/src/main/resources/base/graphic/button_background.xml new file mode 100644 index 0000000000000000000000000000000000000000..6501645111d9237119d38999c7d9889d11905434 --- /dev/null +++ b/ability/Notification/entry/src/main/resources/base/graphic/button_background.xml @@ -0,0 +1,23 @@ + + + + + + + \ No newline at end of file diff --git a/ability/Notification/entry/src/main/resources/base/layout/main_ability_slice.xml b/ability/Notification/entry/src/main/resources/base/layout/main_ability_slice.xml new file mode 100644 index 0000000000000000000000000000000000000000..671c793856378a13843f135b9e1bf6ec1b37f053 --- /dev/null +++ b/ability/Notification/entry/src/main/resources/base/layout/main_ability_slice.xml @@ -0,0 +1,87 @@ + + + + + + + \ No newline at end of file diff --git a/data/Preferences/entry/src/main/js/default/pages/login/login.js b/data/Preferences/entry/src/main/js/default/pages/login/login.js new file mode 100644 index 0000000000000000000000000000000000000000..a735acc3a72413e4393ac72caf74b8bc8746cf1d --- /dev/null +++ b/data/Preferences/entry/src/main/js/default/pages/login/login.js @@ -0,0 +1,87 @@ +/* + * 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. + */ + +import prompt from "@system.prompt"; +import router from "@system.router"; + +export default { + data: { + userID: "", + password: "" + }, + updateUserID: function (e) { + var that = this; + that.userID = e.value; + }, + updatePassword: function (e) { + var that = this; + that.password = e.value; + }, + login: function () { + var that = this; + if (that.userID && that.password) { + that.saveLoginStatus(); + } else { + console.info("Login : Invalid userID and Password"); + that.showToast("Please enter a valid userID and Password"); + } + }, + showToast: function (msg) { + prompt.showToast({ + message: msg, + duration: "3000" + }); + }, + +/** + * save the login status in preference + */ + saveLoginStatus: async function() { + try { + var that = this; + var actionData = {}; + actionData.userId = that.userID; + actionData.password = that.password; + actionData.loginState = 1; + + var action = {}; + action.bundleName = "ohos.samples.preferences"; + action.abilityName = "PreferencesInternalAbility"; + action.messageCode = 1004; + action.data = actionData; + action.abilityType = 1; + action.syncOption = 0; + var result = await FeatureAbility.callAbility(action); + console.info("Login : result for login : " + result); + var resultJson = JSON.parse(result); + if (resultJson.code == 0) { + that.gotoMain(); + } else { + console.error("Login : error while login"); + that.showToast( + "Something went wrong. Please try again." + ); + } + } catch (pluginError) { + console.error("Login : Plugin Error : " + pluginError); + } + }, + gotoMain: function () { + var that = this; + router.replace({ + uri: that.$t("Strings.main_screen_uri") + }); + } +}; diff --git a/data/Preferences/entry/src/main/js/default/pages/main/main.css b/data/Preferences/entry/src/main/js/default/pages/main/main.css new file mode 100644 index 0000000000000000000000000000000000000000..7b8b2313350179d70ed11c5013853634c2f3f089 --- /dev/null +++ b/data/Preferences/entry/src/main/js/default/pages/main/main.css @@ -0,0 +1,58 @@ +/* + * 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 { + align-content: center; + align-items: center; + flex-direction: column; +} + +.list-container { + height: 45%; +} + +.list { + margin-top: 30px; +} + +.list-item { + align-items: center; + margin-top: 16px; + margin-bottom: 16px; + margin-left: 50px; + margin-right: 50px; + padding: 20px; + flex-direction: column; + background-color: #ffffff; + border-radius: 40px; + border: 1px solid; + border-color: black; +} + +.btn { + color: white; + font-size: 30px; + text-align: center; +} + +.btn-container { + background-color: #0000ff; + margin-top: 16px; + margin-bottom: 16px; + height: 80px; + width: 80%; + border-radius: 40px; + justify-content: center; +} \ No newline at end of file diff --git a/data/Preferences/entry/src/main/js/default/pages/main/main.hml b/data/Preferences/entry/src/main/js/default/pages/main/main.hml new file mode 100644 index 0000000000000000000000000000000000000000..d76f039cc94c6a51ad219ddd2c041e5fae8d186c --- /dev/null +++ b/data/Preferences/entry/src/main/js/default/pages/main/main.hml @@ -0,0 +1,34 @@ + + +
+ +
+ + + {{ $item.colorName }} + + +
+ +
+ {{ $t('Strings.apply_background_color') }} +
+
+ {{ $t('Strings.clear_preferences') }} +
+ +
diff --git a/data/Preferences/entry/src/main/js/default/pages/main/main.js b/data/Preferences/entry/src/main/js/default/pages/main/main.js new file mode 100644 index 0000000000000000000000000000000000000000..e5c12b319e90368ac813156465dbb4b2e86da8bc --- /dev/null +++ b/data/Preferences/entry/src/main/js/default/pages/main/main.js @@ -0,0 +1,144 @@ +/* + * 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. + */ + +import prompt from "@system.prompt"; + +export default { + data: { + lastSelectedColor:null, + selectedColor: "#ffffff", + appliedColor: "#ffffff", + tempVar: true, + colorsList: [ + { + colorName: "", + backgroundcolor: "#ff6666", + textColor: "#ff0000" + }, + { + colorName: "", + backgroundcolor: "#c1ff80", + textColor: "#336600" + }, + { + colorName: "", + backgroundcolor: "#9999ff", + textColor: "#1a1aff" + }, + { + colorName: "", + backgroundcolor: "#ff99ff", + textColor: "#e600e6" + }, + { + colorName: "", + backgroundcolor: "#ffcc80", + textColor: "#ff9900" + } + ] + }, + onInit() { + var that = this; + var arr = [that.$t('Strings.red'), that.$t('Strings.green'), that.$t('Strings.blue'), that.$t('Strings.pink'), that.$t('Strings.orange')]; + for (var k = 0; k < this.colorsList.length; k++) { + this.colorsList[k].colorName = arr[k]; + } + if (that.lastSelectedColor) { + that.appliedColor = that.lastSelectedColor; + console.info("Main : onInit : backgroundColor updated to " + that.lastSelectedColor); + } + }, + +/** + * save the selected backckground color + * @param e : selected color code + */ + selectColor: function (e) { + var that = this; + that.selectedColor = e; + that.appliedColor = that.selectedColor; + }, + showToast: function (msg) { + prompt.showToast({ + message: msg, + duration: "3000" + }); + }, + +/** + * apply the selected backckground color + * and save in Preference + * @param e : selected color code + */ + applyBackgroundColor: async function() { + try { + var that = this; + var actionData = {}; + actionData.appliedColor = that.selectedColor; + + var action = {}; + action.bundleName = "ohos.samples.preferences"; + action.abilityName = "PreferencesInternalAbility"; + action.messageCode = 1005; + action.data = actionData; + action.abilityType = 1; + action.syncOption = 0; + var result = await FeatureAbility.callAbility(action); + console.info("Main : applyBackgroundColor : result for applyBackgroundColor : " + + result); + var resultJson = JSON.parse(result); + if (resultJson.code == 0) { + that.showToast("Apply Background Color Success"); + } else { + console.error("Main : Error while applying color"); + that.showToast("Error while applying the background color. Please try again."); + } + } catch (pluginError) { + console.error("Main : applyBackgroundColor : Plugin Error : " + pluginError); + } + }, + +/** + * clear preferences + * @param e : selected color code + */ + clearPreferences: async function() { + try { + var that = this; + var actionData = {}; + + var action = {}; + action.bundleName = "ohos.samples.preferences"; + action.abilityName = "PreferencesInternalAbility"; + action.messageCode = 1006; + action.data = actionData; + action.abilityType = 1; + action.syncOption = 0; + var result = await FeatureAbility.callAbility(action); + console.info("Main : result for clearPreferences : " + + result); + var resultJson = JSON.parse(result); + if (resultJson.code == 0) { + that.appliedColor = resultJson.data; + that.showToast("Clear Preferences Success"); + } else { + console.error("Main : Clear Preferences Error "); + that.showToast("Error while Clear Preferences. Please try again."); + } + } catch (pluginError) { + console.error("Main : clearPreferences : Plugin Error : " + pluginError); + } + } +}; diff --git a/data/Preferences/entry/src/main/js/default/pages/splash/splash.css b/data/Preferences/entry/src/main/js/default/pages/splash/splash.css new file mode 100644 index 0000000000000000000000000000000000000000..7e844da33995f5db35e22f000134420771a0341b --- /dev/null +++ b/data/Preferences/entry/src/main/js/default/pages/splash/splash.css @@ -0,0 +1,43 @@ +/* + * 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. + */ + +.img { + height: 200px; + width: 200px; +} + +.container { + height: 100%; + width: 100%; + flex-direction: column; +} + +.container_check { + height: 7%; + width: 100%; +} + +.container_img { + width: 100%; + height: 93%; + justify-content: center; + align-content: center; + align-items: center; +} + +.checkbox { + width: 90px; + height: 100px; +} \ No newline at end of file diff --git a/data/Preferences/entry/src/main/js/default/pages/splash/splash.hml b/data/Preferences/entry/src/main/js/default/pages/splash/splash.hml new file mode 100644 index 0000000000000000000000000000000000000000..87551b416e54b353983c6097e52680fb96b2adcd --- /dev/null +++ b/data/Preferences/entry/src/main/js/default/pages/splash/splash.hml @@ -0,0 +1,24 @@ + + +
+
+ +
+
+ + {{ $t('Strings.no_show_again') }} +
+
\ No newline at end of file diff --git a/data/Preferences/entry/src/main/js/default/pages/splash/splash.js b/data/Preferences/entry/src/main/js/default/pages/splash/splash.js new file mode 100644 index 0000000000000000000000000000000000000000..f0b1fea04f9f758c167d6a88c46b17a9d401e7c3 --- /dev/null +++ b/data/Preferences/entry/src/main/js/default/pages/splash/splash.js @@ -0,0 +1,191 @@ +/* + * 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. + */ + +import router from "@system.router"; + +export default { + data: { + loginStatus: false, + lastSelectedColor: "", + isChecked: false + }, + onInit() { + var that = this; + that.getBackgroundColor(); + that.checkLoginStatus(); + }, +/** + * Fetch the previously selected background color + * from Preference + */ + getBackgroundColor: async function() { + try { + var that = this; + var action = that.setAction(1003); + var result = await FeatureAbility.callAbility(action); + console.info("Splash : result for getBackgroundColor : " + result); + var resultJson = JSON.parse(result); + if (resultJson.code == 0) { + that.lastSelectedColor = resultJson.data; + that.checkShowSplash(); + } else { + console.error("Splash : Error while fetching backgroundColor"); + } + } catch (pluginError) { + console.error("Splash : getBackgroundColor : Plugin Error : " + pluginError); + } + }, + +/** + * check if the user has logged in before + * using Preference + */ + checkLoginStatus: async function() { + try { + var that = this; + var action = that.setAction(1001); + var result = await FeatureAbility.callAbility(action); + console.info("Splash : result for login : " + result); + var resultJson = JSON.parse(result); + if (resultJson.code == 0) { + that.loginStatus = resultJson.data == 1; + } else { + console.error("Splash : error while getting login status"); + } + } catch (pluginError) { + console.error("Splash : checkLoginStatus Plugin Error" + pluginError); + } + }, + +/** + * Timer to show the splash screen for the duration of 1.5s + * to fetch the user login status and previosuly selected + * background color + */ + startTimer: async function() { + var that = this; + try { + console.info("Splash : Timer started"); + var action = that.setAction(1002); + var result = await FeatureAbility.subscribeAbilityEvent(action, function (timerResult) { + console.info("Splash : Timer completed timerResult = " + timerResult); + this.eventData = JSON.stringify(timerResult.data); + }); + var cbResultJson = JSON.parse(result); + + if (cbResultJson.code == 0) { + that.gotoNextScreen(); + } else { + that.gotoLoginScreen(); + } + console.info("Splash : Timer completed " + result); + } catch (pluginError) { + console.error("Splash : startTimer Plugin Error" + pluginError); + } + }, + +/** + * set action + */ + setAction: function (value) { + var actionData = {}; + var action = {}; + action.bundleName = "ohos.samples.preferences"; + action.abilityName = "PreferencesInternalAbility"; + action.messageCode = value; + action.data = actionData; + action.abilityType = 1; + action.syncOption = 0; + return action; + }, + +/** + * If the user has logged In before, show the main scren + * else show the login screen + */ + gotoNextScreen: function () { + var that = this; + if (that.loginStatus) { + that.gotoMain(); + } else { + console.info("Splash : Login required"); + that.gotoLoginScreen(); + } + }, + gotoLoginScreen: function () { + var that = this; + console.info("Splash : Login Screen invoked"); + router.replace({ + uri: that.$t("Strings.login_screen_uri") + }); + }, + gotoMain: function () { + var that = this; + console.info("Splash : gotoMain that.lastSelectedColor = " + that.lastSelectedColor); + router.replace({ + uri: that.$t("Strings.main_screen_uri"), + params: { + lastSelectedColor: that.lastSelectedColor + } + }); + }, + checkShowSplash: async function() { + try { + var that = this; + var action = that.setAction(1007); + var result = await FeatureAbility.callAbility(action); + console.info("Splash :checkShowSplash : " + result); + var resultJson = JSON.parse(result); + if (resultJson.code == 0) { + that.isChecked = resultJson.data == 1; + if (that.isChecked) { + that.gotoNextScreen(); + } else { + setTimeout(function () { + //your codes + that.startTimer(); + }, 3000); + } + } else { + console.error("Splash : error while getting login status"); + } + } catch (pluginError) { + console.error("Splash : checkShowSplash Plugin Error" + pluginError); + } + }, + onChanged: async function (checked) { + try { + var actionData = {}; + actionData.checkState = checked ? 1 : 0; + var action = {}; + action.bundleName = "ohos.samples.preferences"; + action.abilityName = "PreferencesInternalAbility"; + action.messageCode = 1008; + action.data = actionData; + action.abilityType = 1; + action.syncOption = 0; + var result = await FeatureAbility.callAbility(action); + console.info("Splash : onChanged result = " + result); + var resultJson = JSON.parse(result); + if (resultJson.code == 0) { + console.error("Splash : success while save check status"); + } else { + console.error("Splash : error while save check status"); + } + } catch (pluginError) { + console.error("Splash : onChanged Plugin Error" + pluginError); + } + } +}; diff --git a/data/Preferences/entry/src/main/resources/base/element/string.json b/data/Preferences/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..b9cd237361cb138ee18a5f63ef780ca98ca61e83 --- /dev/null +++ b/data/Preferences/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "Preferences" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/data/Preferences/entry/src/main/resources/base/media/icon.png b/data/Preferences/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/data/Preferences/entry/src/main/resources/base/media/icon.png differ diff --git a/data/Preferences/screenshots/device/apply_background_color.png b/data/Preferences/screenshots/device/apply_background_color.png new file mode 100644 index 0000000000000000000000000000000000000000..55c7a44c333151807b2838e4d3a7e29f31743da8 Binary files /dev/null and b/data/Preferences/screenshots/device/apply_background_color.png differ diff --git a/data/Preferences/screenshots/device/login.png b/data/Preferences/screenshots/device/login.png new file mode 100644 index 0000000000000000000000000000000000000000..b707d10528803fba7d2cff3b235dfc591efacec0 Binary files /dev/null and b/data/Preferences/screenshots/device/login.png differ diff --git a/data/Preferences/screenshots/device/main.png b/data/Preferences/screenshots/device/main.png new file mode 100644 index 0000000000000000000000000000000000000000..4022eb02e75cb54379d6c21a23fe50bbb152205f Binary files /dev/null and b/data/Preferences/screenshots/device/main.png differ diff --git a/data/Preferences/screenshots/device/splash.png b/data/Preferences/screenshots/device/splash.png new file mode 100644 index 0000000000000000000000000000000000000000..e02d8793c4b15261a3566b28604a7bb7601b2a99 Binary files /dev/null and b/data/Preferences/screenshots/device/splash.png differ diff --git a/data/Preferences/settings.gradle b/data/Preferences/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..7dc3285c045cc590e49d231a4280ef52ba646d91 --- /dev/null +++ b/data/Preferences/settings.gradle @@ -0,0 +1,15 @@ +/* + * 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. + */ +include ':entry' diff --git a/data/Search/README.md b/data/Search/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a1d4bdd6c09dbcecb17dc5213a6ca7f8ad2bb667 --- /dev/null +++ b/data/Search/README.md @@ -0,0 +1,26 @@ +# Search Service + +### Introduction + +The search service provides developers with the same full-text search capabilities as a search engine. This sample demonstrates how to use common search APIs to create location index forms and insert, update, delete, and search location index data. + +### Usage + +1. Connect to the search service when starting an app. + +2. Touch **build location indexForm** and create a location index form. After a success message is returned, touch **read indexForm**. The location information index, including **title**, **tag**, **bucket\_id**, **latitude**, **longitude** and **device\_id**, is displayed. + +3. Touch **insert location indexData** and insert 10 pieces of location data. A success message is returned. + +4. Touch **update location indexData** to update location information. + +5. Touch **get search hint count**. For example, search for "location" in the **title** and **tag** fields. The search criteria are as follows: **bucket\_id** and **CommonItem.IDENTIFIER** are from **0** to **5**. An index is hit if "location" is found in **tag** or **CommonItem.TITLE**. The latitude is **\[-80.0f, 80.0f\]**, and the longitude is **\[-90.0, 90.0\]**. Sort the search results in ascending order based on **CommonItem.CATEGORY**, and in descending order based on **tag** if the values of **CommonItem.CATEGORY** are the same. The number of location index data records that meet the search criteria is returned. + +6. Touch **search by group** **search by page** to query the location index data. The search criteria are the same as those in step 5. The data meeting the search criteria is returned. + +7. Touch **delete indexData by query** or **delete indexData** to delete location index data. + +### Constraints + +This sample can only be run on large-system devices. + diff --git a/data/Search/README_zh.md b/data/Search/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..42af47739a1022337c2267150f1b4354574eb908 --- /dev/null +++ b/data/Search/README_zh.md @@ -0,0 +1,26 @@ +# 融合搜索 + +### 简介 + +融合搜索为开发者提供搜索引擎级的全文搜索能力,本示例为用户演示融合搜索的索引构造、索引数据插入、更新、删除和搜索等常用接口的使用。 + +### 使用说明 + +1、启动应用时连接融合搜索服务。 + +2、点击“构造定位索引”构造定位信息索引,返回成功后点击“读取索引”,返回构造的定位信息的索引,包括title,tag,bucket\_id,latitude,longitude,device\_id。 + +3、点击“插入定位数据”插入10条定位信息,返回成功。 + +4、点击“更新定位数据”来更新位置信息。 + +5、点击“获取查询索引条数”,假设用户输入是“定位”,要在"title", "tag"这两个域上发起搜索,搜索在bucket\_id和CommonItem.IDENTIFIER在0-5之间,在"tag"或者CommonItem.TITLE上命中"位置",纬度必须在\[-80.0f, 80.0f\],经度必须在\[-90.0, 90.0\]进行搜索,先在CommonItem.CATEGORY字段上升序排序,只有在CommonItem.CATEGORY上相同时,才会继续在"tag"上降序排序。此处返回满足查询条件的索引数据的条数。 + +6、点击“分组搜索”和“分页搜索”分别进行定位索引数据的查询,查询条件同上,这里返回查询到的数据。 + +7、操作完成可以点击“删除索引数据”或“通过查询语句删除索引数据”来完成删除索引数据。 + +### 约束与限制 + +本示例支持在大型设备上运行。 + diff --git a/data/Search/build.gradle b/data/Search/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..c9499304b51dd3090343af95ffd321db4e833d17 --- /dev/null +++ b/data/Search/build.gradle @@ -0,0 +1,35 @@ +// 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#section1112183053510 +ohos { + compileSdkVersion 6 + defaultConfig { + compatibleSdkVersion 4 + } +} + +buildscript { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + } + dependencies { + classpath 'com.huawei.ohos:hap:2.4.5.0' + } +} + +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + } +} diff --git a/data/Search/entry/build.gradle b/data/Search/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..b1b882781763d89e6ecfc352a0b382a7efb80354 --- /dev/null +++ b/data/Search/entry/build.gradle @@ -0,0 +1,20 @@ +apply plugin: 'com.huawei.ohos.hap' +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + compileSdkVersion 6 + defaultConfig { + compatibleSdkVersion 4 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) +} diff --git a/data/Search/entry/src/main/config.json b/data/Search/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..c8437170c397af749b221b909a52c778b9bcc5e4 --- /dev/null +++ b/data/Search/entry/src/main/config.json @@ -0,0 +1,51 @@ +{ + "app": { + "bundleName": "ohos.samples.search", + "vendor": "samples", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.samples.search", + "name": ".MyApplication", + "mainAbility": "ohos.samples.search.MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "name": ".MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.ACCESS_SEARCH_SERVICE" + } + ] + } +} \ No newline at end of file diff --git a/data/Search/entry/src/main/java/ohos/samples/search/MainAbility.java b/data/Search/entry/src/main/java/ohos/samples/search/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..dcb676223d0977d1ac356b8591e56c5e16af6bfb --- /dev/null +++ b/data/Search/entry/src/main/java/ohos/samples/search/MainAbility.java @@ -0,0 +1,33 @@ +/* + * 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. + */ + +package ohos.samples.search; + +import ohos.samples.search.slice.MainAbilitySlice; +import ohos.aafwk.ability.Ability; +import ohos.aafwk.content.Intent; + +/** + * MainAbility + * + * @since 2021-07-23 + */ +public class MainAbility extends Ability { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + super.setMainRoute(MainAbilitySlice.class.getName()); + } +} diff --git a/data/Search/entry/src/main/java/ohos/samples/search/MyApplication.java b/data/Search/entry/src/main/java/ohos/samples/search/MyApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..bcca90f3bac22cccc6b777180ebfc362e4e2c893 --- /dev/null +++ b/data/Search/entry/src/main/java/ohos/samples/search/MyApplication.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package ohos.samples.search; + +import ohos.aafwk.ability.AbilityPackage; + +/** + * MyApplication + * + * @since 2021-07-23 + */ +public class MyApplication extends AbilityPackage { + @Override + public void onInitialize() { + super.onInitialize(); + } +} diff --git a/data/Search/entry/src/main/java/ohos/samples/search/slice/MainAbilitySlice.java b/data/Search/entry/src/main/java/ohos/samples/search/slice/MainAbilitySlice.java new file mode 100644 index 0000000000000000000000000000000000000000..2d5fca3162546e17ed1bd33dcbfa73f31987cc99 --- /dev/null +++ b/data/Search/entry/src/main/java/ohos/samples/search/slice/MainAbilitySlice.java @@ -0,0 +1,193 @@ +/* + * 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. + */ + +package ohos.samples.search.slice; + +import ohos.agp.components.Component; +import ohos.agp.components.Text; +import ohos.app.dispatcher.TaskDispatcher; +import ohos.app.dispatcher.task.TaskPriority; +import ohos.data.search.SearchAbility; +import ohos.data.search.connect.ServiceConnectCallback; +import ohos.samples.search.ResourceTable; +import ohos.aafwk.ability.AbilitySlice; +import ohos.aafwk.content.Intent; +import ohos.samples.search.utils.LogUtils; +import ohos.samples.search.utils.SearchUtils; + +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +/** + * MainAbilitySlice + * + * @since 2021-07-23 + */ +public class MainAbilitySlice extends AbilitySlice { + private static final String TAG = MainAbilitySlice.class.getSimpleName(); + + private SearchAbility searchAbility; + + private SearchUtils searUtils; + + private Text searchResult; + + @Override + public void onStart(Intent intent) { + super.onStart(intent); + super.setUIContent(ResourceTable.Layout_ability_main); + initComponents(); + connectService(); + } + + private void connectService() { + LogUtils.info(TAG, "connect search service"); + TaskDispatcher task = getGlobalTaskDispatcher(TaskPriority.DEFAULT); + searchAbility = new SearchAbility(getContext()); + searUtils = new SearchUtils(getContext(), searchAbility); + task.asyncDispatch(() -> { + CountDownLatch lock = new CountDownLatch(1); + + // connect to SearchService + searchAbility.connect(new ServiceConnectCallback() { + @Override + public void onConnect() { + lock.countDown(); + } + + @Override + public void onDisconnect() { + } + }); + try { + lock.await(3000, TimeUnit.MILLISECONDS); + if (searchAbility.hasConnected()) { + searchResult.setText(ResourceTable.String_connect_service_succeed); + } else { + searchResult.setText(ResourceTable.String_connect_service_failed); + } + } catch (InterruptedException e) { + LogUtils.info(TAG, "connect search service failed"); + } + }); + } + + private void initComponents() { + Component btnBuildIndexForms = findComponentById(ResourceTable.Id_btnBuildIndexForms); + btnBuildIndexForms.setClickedListener(this::buildIndexForms); + Component btnReadIndexForms = findComponentById(ResourceTable.Id_btnReadIndexForms); + btnReadIndexForms.setClickedListener(this::readIndexForms); + Component btnInsertIndexData = findComponentById(ResourceTable.Id_btnInsertIndexData); + btnInsertIndexData.setClickedListener(this::insertIndexData); + Component btnUpdateIndexData = findComponentById(ResourceTable.Id_btnUpdateIndexData); + btnUpdateIndexData.setClickedListener(this::updateIndexData); + Component btnDeleteIndexData = findComponentById(ResourceTable.Id_btnDeleteIndexData); + btnDeleteIndexData.setClickedListener(this::deleteIndexData); + Component btnDeleteIndexDataByQuery = findComponentById(ResourceTable.Id_btnDeleteIndexDataByQuery); + btnDeleteIndexDataByQuery.setClickedListener(this::deleteByQuery); + Component btnGetSearchHitCount = findComponentById(ResourceTable.Id_btnGetHitCount); + btnGetSearchHitCount.setClickedListener(this::getSearchHitCount); + Component btnSearchByGroup = findComponentById(ResourceTable.Id_btnSearchByGroup); + btnSearchByGroup.setClickedListener(this::searchByGroup); + Component btnSearchByPage = findComponentById(ResourceTable.Id_btnSearchByPage); + btnSearchByPage.setClickedListener(this::searchByPage); + + Component searchComponent = findComponentById(ResourceTable.Id_searchResult); + if (searchComponent instanceof Text) { + searchResult = (Text) searchComponent; + } + } + + private void searchByPage(Component component) { + searchResult.setText(searUtils.searchByPage()); + } + + private void searchByGroup(Component component) { + searchResult.setText(searUtils.searchByGroup()); + } + + private void getSearchHitCount(Component component) { + searchResult.setText(searUtils.getSearchHitCount()); + } + + private void deleteByQuery(Component component) { + int result = searUtils.deleteIndexByQuery(); + if (result == 1) { + LogUtils.info(TAG, "updateIndexData succeed"); + searchResult.setText(ResourceTable.String_succeed); + } else { + LogUtils.error(TAG, "updateIndexData failed"); + searchResult.setText(ResourceTable.String_failed); + } + } + + private void deleteIndexData(Component component) { + int result = searUtils.deleteIndexData(); + if (result > 0) { + LogUtils.error(TAG, "updateIndexData failed num=" + result); + searchResult.setText(ResourceTable.String_failed); + } else { + LogUtils.info(TAG, "updateIndexData succeed"); + searchResult.setText(ResourceTable.String_succeed); + } + } + + private void updateIndexData(Component component) { + int result = searUtils.updateIndexData(); + if (result > 0) { + LogUtils.error(TAG, "updateIndexData failed num=" + result); + searchResult.setText(ResourceTable.String_failed); + } else { + LogUtils.info(TAG, "updateIndexData succeed"); + searchResult.setText(ResourceTable.String_succeed); + } + } + + private void insertIndexData(Component component) { + int result = searUtils.insertIndexData(); + if (result > 0) { + LogUtils.error(TAG, "insertIndexData failed num=" + result); + searchResult.setText(ResourceTable.String_failed); + } else { + LogUtils.info(TAG, "insertIndexData succeed"); + searchResult.setText(ResourceTable.String_succeed); + } + } + + private void readIndexForms(Component component) { + searchResult.setText(searUtils.readIndexForms()); + } + + private void buildIndexForms(Component component) { + int result = searUtils.buildIndexForms(); + if (result == 1) { + LogUtils.info(TAG, "buildIndexForms succeed"); + searchResult.setText(ResourceTable.String_succeed); + } else { + LogUtils.error(TAG, "buildIndexForms failed"); + searchResult.setText(ResourceTable.String_failed); + } + } + + @Override + public void onActive() { + super.onActive(); + } + + @Override + public void onForeground(Intent intent) { + super.onForeground(intent); + } +} diff --git a/data/Search/entry/src/main/java/ohos/samples/search/utils/LogUtils.java b/data/Search/entry/src/main/java/ohos/samples/search/utils/LogUtils.java new file mode 100644 index 0000000000000000000000000000000000000000..60efd17f44cbec4a0717550bb0256ef9671503b3 --- /dev/null +++ b/data/Search/entry/src/main/java/ohos/samples/search/utils/LogUtils.java @@ -0,0 +1,70 @@ +/* + * 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. + */ + +package ohos.samples.search.utils; + +import ohos.hiviewdfx.HiLog; +import ohos.hiviewdfx.HiLogLabel; + +import java.util.Objects; + +/** + * LogUtils + * + * @since 2021-07-23 + */ +public class LogUtils { + private static final String APP_NAME = "search"; + private static final HiLogLabel LABAL_LOG = new HiLogLabel(3, 0xD000f00, APP_NAME); + private static final String LOG_FORMAT = "%{public}s:%{public}s"; + + private LogUtils() { + } + + /** + * log info + * + * @param className String + * @param msg String + */ + public static void info(String className, String msg) { + HiLog.info(LABAL_LOG, LOG_FORMAT, getLogPrefix(className), msg); + } + + /** + * log error + * + * @param className String + * @param msg String + */ + public static void error(String className, String msg) { + HiLog.error(LABAL_LOG, LOG_FORMAT, getLogPrefix(className), msg); + } + + private static String getLogPrefix(String tag) { + Thread currentThread = Thread.currentThread(); + String threadName = currentThread.getName(); + StackTraceElement[] stackTraceElements = currentThread.getStackTrace(); + int lineNum = 0; + for (int index = 0; index < stackTraceElements.length; index++) { + if (Objects.equals(stackTraceElements[index].getClassName(), LogUtils.class.getName()) + && stackTraceElements.length > index + 1 + && !Objects.equals(stackTraceElements[index + 1].getClassName(), LogUtils.class.getName())) { + lineNum = stackTraceElements[index + 1].getLineNumber(); + } + } + return "[" + threadName + "]" + "(" + tag + ".java" + lineNum + ")"; + } +} diff --git a/data/Search/entry/src/main/java/ohos/samples/search/utils/SearchUtils.java b/data/Search/entry/src/main/java/ohos/samples/search/utils/SearchUtils.java new file mode 100644 index 0000000000000000000000000000000000000000..2a4c2cd092c002bf6865ce58fb05b3cd980758cd --- /dev/null +++ b/data/Search/entry/src/main/java/ohos/samples/search/utils/SearchUtils.java @@ -0,0 +1,321 @@ +/* + * 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. + */ + +package ohos.samples.search.utils; + +import ohos.app.Context; +import ohos.data.search.SearchAbility; +import ohos.data.search.SearchSession; +import ohos.data.search.model.*; +import ohos.data.search.schema.CommonItem; +import ohos.data.search.schema.IndexSchemaType; +import ohos.utils.zson.ZSONArray; +import ohos.utils.zson.ZSONObject; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +/** + * SearchUtils + * + * @since 2021-07-23 + */ +public class SearchUtils { + private final String LOCAL_DEVICE_ID = ""; + private final String FILE_PATH; + private final Context context; + private final SearchAbility searchAbility; + + public SearchUtils(Context context, SearchAbility searchAbility) { + this.context = context; + this.searchAbility = searchAbility; + FILE_PATH = context.getFilesDir().getPath(); + } + + /** + * build indexfroms + * + * @return int + */ + public int buildIndexForms() { + searchAbility.clearIndex(SearchParameter.DEFAULT_GROUP, context.getBundleName(), null); + searchAbility.clearIndexForm(context.getBundleName()); + + // constructing custom index attributes + List indexFormList = new ArrayList<>(); + indexFormList.add( // Word segmentation, while supporting sorting and grouping + new IndexForm("tag", IndexType.SORTED, false, true, false)); + indexFormList.add( // Support sorting and range query + new IndexForm("bucket_id", IndexType.INTEGER, false, true, false)); + indexFormList.add( // Support range search + new IndexForm("latitude", IndexType.FLOAT, false, true, false)); + indexFormList.add( // Support range search + new IndexForm("longitude", IndexType.FLOAT, false, true, false)); + indexFormList.add( // Support search + new IndexForm("device_id", IndexType.NO_ANALYZED, false, true, false)); + + // constructing index attributes using a generic template + return searchAbility.setIndexForm(context.getBundleName(), 1, indexFormList, IndexSchemaType.COMMON); + } + + /** + * readIndexForms + * + * @return String + */ + public String readIndexForms() { + StringBuilder result = new StringBuilder("Result:"); + List indexFormList = searchAbility.getIndexForm(context.getBundleName()); + for (IndexForm indexForm : indexFormList) { + result.append(indexForm.toString()).append(System.lineSeparator()); + } + return result.toString(); + } + + /** + * insert index data + * + * @return int + */ + public int insertIndexData() { + // Create an IndexData instance. + List indexDataList = new ArrayList<>(); + for (int i = 0; i < 10; i++) { + CommonItem commonItem = new CommonItem().setIdentifier(LOCAL_DEVICE_ID + i) + .setTitle("position") + .setSubtitle("subtitle") + .setCategory("things") + .setDescription("is description") + .setName("name") + .setAlternateName("othername") + .setDateCreate(System.currentTimeMillis()) + .setKeywords("key") + .setPotentialAction("com.sample.search.TestAbility") + .setThumbnailUrl(FILE_PATH) + .setUrl(FILE_PATH) + .setReserved1("reserved1") + .setReserved2("reserved2"); + commonItem.put("tag", "location" + i); + commonItem.put("bucket_id", i); + commonItem.put("latitude", i / 10.0 * 180); + commonItem.put("longitude", i / 10.0 * 360); + commonItem.put("device_id", "localDeviceId"); + indexDataList.add(commonItem); + } + + // Insert a list of indexes. + List failedList = searchAbility.insert(SearchParameter.DEFAULT_GROUP, + context.getBundleName(), indexDataList); + // If some indexes fail to be inserted, try again later. + return failedList.size(); + } + + /** + * update index data + * + * @return int + */ + public int updateIndexData() { + // constructing index data + List indexDataList = new ArrayList<>(); + for (int i = 0; i < 10; i++) { + CommonItem commonItem = new CommonItem().setIdentifier(LOCAL_DEVICE_ID + i).setTitle("position update"); + commonItem.put("tag", "location update" + i); + commonItem.put("bucket_id", i + 1); + commonItem.put("latitude", i / 10.0 * 100); + commonItem.put("longitude", i / 10.0 * 300); + commonItem.put("device_id", "localDeviceId"); + indexDataList.add(commonItem); + } + + List failedList = searchAbility.update(SearchParameter.DEFAULT_GROUP, + context.getBundleName(), indexDataList); + return failedList.size(); + } + + /** + * delete index data + * + * @return int + */ + public int deleteIndexData() { + // constructing index data + List indexDataList = new ArrayList<>(); + for (int i = 0; i < 5; i++) { + CommonItem commonItem = new CommonItem().setIdentifier(LOCAL_DEVICE_ID + i); + indexDataList.add(commonItem); + } + + List failedList = searchAbility.delete(SearchParameter.DEFAULT_GROUP, + context.getBundleName(), indexDataList); + return failedList.size(); + } + + /** + * deleteIndexByQuery + * + * @return int + */ + public int deleteIndexByQuery() { + return searchAbility.deleteByQuery(SearchParameter.DEFAULT_GROUP, + context.getBundleName(), buildQueryString().toString()); + } + + /** + * getSearchHitCount + * + * @return int + */ + public String getSearchHitCount() { + SearchSession session = searchAbility.beginSearch(SearchParameter.DEFAULT_GROUP, context.getBundleName()); + String result = "SearchHitCount:" + System.lineSeparator(); + if (session == null) { + return result; + } + try { + String query = buildQueryString().toString(); + return result + session.getSearchHitCount(query); + } finally { + searchAbility.endSearch(SearchParameter.DEFAULT_GROUP, context.getBundleName(), session); + } + } + + /** + * searchByGroup + * + * @return String + */ + public String searchByGroup() { + // Start a search session. + SearchSession session = searchAbility.beginSearch(SearchParameter.DEFAULT_GROUP, context.getBundleName()); + StringBuilder result = new StringBuilder("searchByGroup:" + System.lineSeparator()); + if (session == null) { + return result.toString(); + } + try { + ZSONObject query = buildQueryString(); + // SearchParameter.GROUP_FIELD_LIST indicates the field list you need to specify when calling the groupSearch method. + query.put(SearchParameter.GROUP_FIELD_LIST, new ZSONArray(Arrays.asList("tag", CommonItem.CATEGORY))); + + int limit = 10; // A maximum of 10 groups (recommendations) are returned for each field. + List recommendationList = session.groupSearch(query.toString(), limit); + + // Process recommendations. + for (Recommendation recommendation : recommendationList) { + result.append(recommendation.toString()).append(System.lineSeparator()); + } + return result.toString(); + } finally { + searchAbility.endSearch(SearchParameter.DEFAULT_GROUP, context.getBundleName(), session); + } + } + + /** + * searchByPage + * + * @return String + */ + public String searchByPage() { + // Start a search session. + SearchSession session = searchAbility.beginSearch(SearchParameter.DEFAULT_GROUP, context.getBundleName()); + StringBuilder result = new StringBuilder("searchByPage:" + System.lineSeparator()); + if (session == null) { + return result.toString(); + } + try { + String query = buildQueryString().toString(); + int count = session.getSearchHitCount(query); + int batch = 50; // A maximum of 50 results are allowed on each page. + for (int i = 0; i < count; i += batch) { + List indexDataList = session.search(query, i, batch); + for (IndexData indexData : indexDataList) { + result.append("tag:").append(indexData.get("tag")).append(", latitude:") + .append(indexData.get("latitude")).append(", longitude:") + .append(indexData.get("longitude")).append(System.lineSeparator()); + } + } + return result.toString(); + } finally { + searchAbility.endSearch(SearchParameter.DEFAULT_GROUP, context.getBundleName(), session); + } + } + + /** + * buildQueryString + * + * @return ZSONObject + */ + public ZSONObject buildQueryString() { + // Create a JSONObject. + ZSONObject zsonObject = new ZSONObject(); + + // SearchParameter.QUERY indicates the user input. It is recommended that the search fields be analyzed. + // Assume that the user inputs location and starts a search for the title and tag fields. + ZSONObject query = new ZSONObject(); + query.put("location", new ZSONArray(Arrays.asList(CommonItem.TITLE, "tag"))); + zsonObject.put(SearchParameter.QUERY, query); + + /* + * Search criteria can be added to ZSONArray of the SearchParameter.FILTER_CONDITION. + * An index in the index library is hit only if the search criteria of each ZSONObject in the ZSONArray is met. + * The search criteria of a ZSONArray is met as long as one of the conditions in the search criteria is met. + */ + ZSONArray filterCondition = new ZSONArray(); + + // For the first condition, a field may have multiple values. + ZSONObject filter1 = new ZSONObject(); + filter1.put("bucket_id", new ZSONArray(Arrays.asList(0, 1, 2, 3, 4, 5))); // An index is hit if its value is 0, 1, 2, 3, 4, or 5 for the bucket_id field. + filter1.put(CommonItem.IDENTIFIER, new ZSONArray(Arrays.asList(0, 1, 2, 3, 4, 5))); // The index is also hit if its value is 0 , 1, 2, 3, 4 or 5 for the CommonItem.IDENTIFIER field. + filterCondition.add(filter1); + ZSONObject filter2 = new ZSONObject(); + filter2.put("tag", new ZSONArray(Collections.singletonList("position"))); + filter2.put(CommonItem.TITLE, new ZSONArray(Collections.singletonList("position"))); // An index is hit if the value of the tag or CommonItem.TITLE field is position. + filterCondition.add(filter2); + zsonObject.put(SearchParameter.FILTER_CONDITION, filterCondition); // An index is hit only if both the first and second conditions are met. + + // SearchParameter.DEVICE_ID_LIST indicates the device ID list. Indexes with the specified IDs are hit. + ZSONObject deviceId = new ZSONObject(); + deviceId.put("device_id", new ZSONArray(Collections.singletonList("localDeviceId"))); // Specify the local device. + zsonObject.put(SearchParameter.DEVICE_ID_LIST, deviceId); + + // Start a search by specifying the value range of a specified index field. + // Indexes whose values fall within the value range of the specified index field are hit. + ZSONObject latitudeObject = new ZSONObject(); + latitudeObject.put(SearchParameter.LOWER, -80.0f); + latitudeObject.put(SearchParameter.UPPER, 80.0f); + zsonObject.put("latitude", latitudeObject); // The latitude must be in the range of [-80.0f, 80.0f]. + ZSONObject longitudeObject = new ZSONObject(); + longitudeObject.put(SearchParameter.LOWER, -90.0); + longitudeObject.put(SearchParameter.UPPER, 90.0); + zsonObject.put("longitude", longitudeObject); // The longitude must be in the range of [-90.0, 90.0]. + + /* + * SearchParameter.ORDER_BY indicates how the search results are sorted. + * The value can be SearchParameter.ASC or SearchParameter.DESC. + * The sequence of the fields matters. + * In the following example, indexes are first sorted in ascending order of the CommonItem.CATEGORY field. + * If they are equal on the CommonItem.CATEGORY field, they will be sorted in descending order of the tag field. + */ + ZSONObject order = new ZSONObject(); + order.put(CommonItem.CATEGORY, SearchParameter.ASC); + order.put("tag", SearchParameter.DESC); + zsonObject.put(SearchParameter.ORDER_BY, order); + + // Obtain the string for search. + return zsonObject; + } +} diff --git a/data/Search/entry/src/main/resources/base/element/float.json b/data/Search/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..2bf7c116831d70625af020dc8593e92f60c4bfdb --- /dev/null +++ b/data/Search/entry/src/main/resources/base/element/float.json @@ -0,0 +1,12 @@ +{ + "float": [ + { + "name": "layout_padding", + "value": "10vp" + }, + { + "name": "button_height", + "value": "40vp" + } + ] +} \ No newline at end of file diff --git a/data/Search/entry/src/main/resources/base/element/pattern.json b/data/Search/entry/src/main/resources/base/element/pattern.json new file mode 100644 index 0000000000000000000000000000000000000000..7f142da1745d40ad16cd648a7235e6f42b1fe715 --- /dev/null +++ b/data/Search/entry/src/main/resources/base/element/pattern.json @@ -0,0 +1,58 @@ +{ + "pattern": [ + { + "name": "button_blue", + "value": [ + { + "name": "text_size", + "value": "18fp" + }, + { + "name": "margin", + "value": "5vp" + }, + { + "name": "background_element", + "value": "$graphic:button_blue" + }, + { + "name": "text_color", + "value": "#FFFFFF" + } + ] + }, + { + "name": "content_text", + "value": [ + { + "name": "text_size", + "value": "17fp" + }, + { + "name": "text_color", + "value": "#000000" + }, + { + "name": "background_element", + "value": "#F0F0F0" + }, + { + "name": "multiple_lines", + "value": "true" + }, + { + "name": "padding", + "value": "5vp" + }, + { + "name": "margin", + "value": "5vp" + }, + { + "name": "text_alignment", + "value": "start" + } + ] + } + ] +} \ No newline at end of file diff --git a/data/Search/entry/src/main/resources/base/element/string.json b/data/Search/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..a8147d72c872dbd2cdaa3c9adcbf4e0cd78ce661 --- /dev/null +++ b/data/Search/entry/src/main/resources/base/element/string.json @@ -0,0 +1,68 @@ +{ + "string": [ + { + "name": "app_name", + "value": "search" + }, + { + "name": "mainability_description", + "value": "Search Ability" + }, + { + "name": "result", + "value": "result:" + }, + { + "name": "btn_build_index_forms", + "value": "build location indexForm" + }, + { + "name": "btn_read_index_forms", + "value": "read indexForm" + }, + { + "name": "btn_insert_index_data", + "value": "insert indexData" + }, + { + "name": "btn_update_index_data", + "value": "update indexData" + }, + { + "name": "btn_delete_indexdata", + "value": "delete indexData" + }, + { + "name": "btn_delete_indexdata_by_query", + "value": "delete indexData by query" + }, + { + "name": "btn_get_search_hint_count", + "value": "get search hint count" + }, + { + "name": "btn_search_by_group", + "value": "search by group" + }, + { + "name": "btn_search_by_page", + "value": "search by page" + }, + { + "name": "connect_service_succeed", + "value": "connect service succeed" + }, + { + "name": "connect_service_failed", + "value": "connect service failed" + }, + { + "name": "succeed", + "value": "succeed" + }, + { + "name": "failed", + "value": "failed" + } + ] +} \ No newline at end of file diff --git a/data/Search/entry/src/main/resources/base/graphic/button_blue.xml b/data/Search/entry/src/main/resources/base/graphic/button_blue.xml new file mode 100644 index 0000000000000000000000000000000000000000..c7ac8a58fa538cb49c2002099764577c5465bfe3 --- /dev/null +++ b/data/Search/entry/src/main/resources/base/graphic/button_blue.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/data/Search/entry/src/main/resources/base/graphic/button_blue_empty.xml b/data/Search/entry/src/main/resources/base/graphic/button_blue_empty.xml new file mode 100644 index 0000000000000000000000000000000000000000..e90b693d2efa580d4767d55250f0e5a2c6ab5958 --- /dev/null +++ b/data/Search/entry/src/main/resources/base/graphic/button_blue_empty.xml @@ -0,0 +1,21 @@ + + + + + + \ No newline at end of file diff --git a/data/Search/entry/src/main/resources/base/graphic/button_blue_pressed.xml b/data/Search/entry/src/main/resources/base/graphic/button_blue_pressed.xml new file mode 100644 index 0000000000000000000000000000000000000000..fe2343b5ec2010eb2435bcee605b37b0c3f29d97 --- /dev/null +++ b/data/Search/entry/src/main/resources/base/graphic/button_blue_pressed.xml @@ -0,0 +1,21 @@ + + + + + + \ No newline at end of file diff --git a/data/Search/entry/src/main/resources/base/layout/ability_main.xml b/data/Search/entry/src/main/resources/base/layout/ability_main.xml new file mode 100644 index 0000000000000000000000000000000000000000..b62d8a0c1c2d7d9766b3bc2154f2d02bd46c22ed --- /dev/null +++ b/data/Search/entry/src/main/resources/base/layout/ability_main.xml @@ -0,0 +1,84 @@ + + + +