From 9995c93f536b47f2206fcd948cf50704161778c7 Mon Sep 17 00:00:00 2001 From: wusongqing Date: Tue, 26 Oct 2021 15:20:36 +0800 Subject: [PATCH 1/2] Added English readme and updated docs Signed-off-by: wusongqing --- .../DistributedShoppingCart/README.md | 42 +++++++ .../DistributedShoppingCart/README_zh.md | 14 +-- .../src/main/resources/en/element/string.json | 112 +++++++----------- 3 files changed, 87 insertions(+), 81 deletions(-) create mode 100644 CompleteApps/DistributedShoppingCart/README.md diff --git a/CompleteApps/DistributedShoppingCart/README.md b/CompleteApps/DistributedShoppingCart/README.md new file mode 100644 index 00000000..a73600d6 --- /dev/null +++ b/CompleteApps/DistributedShoppingCart/README.md @@ -0,0 +1,42 @@ +# Distributed Shopping Cart + +##### Introduction + +This sample is developed using Java. It simulates the scenario where a user shares the shopping cart on their phone with another user through near-field communication during online shopping. It also simulates the scenario where two users merge their respective shopping carts to reach a certain amount of money (CNY 5,000 in the sample app), so that each of them can enjoy a preferential price. + +##### Usage + +###### 1. Browsing Offerings + +Open the sample app. The home screen shows the offerings, as well as their respective basic information and price. + +###### 2. Adding Offerings to the Shopping Cart + +Touch an offering. On the details page displayed, touch **Add to Cart" in the lower right corner. If this is the first offering added to the shopping cart, a number badge is added. Otherwise, the number badge is automatically incremented. + +###### 3. Sharing a Shopping Cart + +On the home screen, touch the shopping cart button on the toolbar to go to the **My Shopping Cart** page. Touch the share button (the second icon on the right) in the upper right corner. The devices with which the shopping cart can be shared are displayed. Touch a device. The shopping cart on your phone is shared to that device, and the user of that device can view your shopping cart. + +###### 4. Merging the Shopping Carts + +On the home screen, touch the shopping cart button on the toolbar to go to the **My Shopping Cart** page. Touch the merge button (the first icon on the right) in the upper right corner. The devices with which the shopping cart can be merged are displayed. Touch a device. The shopping cart on your phone is merged with the shopping cart on that device. If the items in the merged shopping cart can reach the amount of money specified by the merchant, both parties enjoy a preferential price. + +###### 5. Settlements + +On the **My Shopping Cart** page, you can select some or all offerings and touch the checkout button in the lower right corner for checkout. (You can select **All** on the toolbar to select all offerings.) + +##### Constraints + +1. Compilation Constraints + + Set up the DevEco Studio development environment. + + + For details, see [Building the Development Environment](https://developer.harmonyos.com/en/docs/documentation/doc-guides/installation_process-0000001071425528). + +2. Usage Constraints + + This sample is used to simulate online shopping. All offering data is read from files. Therefore, you need to prepare an offering list file (**product_datas.json**) and add the file under **resource/rawfile/**. + + diff --git a/CompleteApps/DistributedShoppingCart/README_zh.md b/CompleteApps/DistributedShoppingCart/README_zh.md index 6144ac2c..41c0f094 100644 --- a/CompleteApps/DistributedShoppingCart/README_zh.md +++ b/CompleteApps/DistributedShoppingCart/README_zh.md @@ -29,18 +29,10 @@ ##### 约束与限制 1. 编译约束 - 已实名认证的开发者联盟账号 ,具体[参考](https://developer.huawei.com/consumer/cn/ ) - 开发工具:DevEcoStudio 下载地址 [HUAWEI DevEco Studio - HarmonyOS应用开发官网](https://developer.harmonyos.com/cn/develop/deveco-studio#download) + 设置DevEco Studio开发环境。 + - •安装DevEco Studio - - 设置DevEco Studio开发环境,DevEco Studio开发环境需要连接到网络,以确保该正常使用。 - 可以根据以下两种情况配置开发环境: - 1).如果您可以直接访问Internet,则只需下载HarmonyOS SDK - 2).如果网络无法直接访问Internet,则可以通过代理服务器进行访问 • 生成密钥并申请证书 - - 具体环境搭建请[参考:](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/installation_process-0000001071425528) - 更多资料请登录HarmonyOS应用开发[官网:](https://developer.harmonyos.com/cn/) + 具体环境搭建请[参考](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/installation_process-0000001071425528) 。 2. 使用限制 •本sample是一个模拟网上购物的应用,商品数据都是从文件中读取,所以需要在resource下准备一个商品清单文档(product_datas.json,具体路径:resource/rawfile/)。用户可以根据自己的喜爱添加商品信息。 diff --git a/CompleteApps/DistributedShoppingCart/entry/src/main/resources/en/element/string.json b/CompleteApps/DistributedShoppingCart/entry/src/main/resources/en/element/string.json index a0b4085d..a001235a 100644 --- a/CompleteApps/DistributedShoppingCart/entry/src/main/resources/en/element/string.json +++ b/CompleteApps/DistributedShoppingCart/entry/src/main/resources/en/element/string.json @@ -14,11 +14,11 @@ }, { "name": "add_succ_label", - "value": "Added successfully" + "value": "Item added." }, { "name": "device_select_label", - "value": "Select device" + "value": "Select Device" }, { "name": "amount_details", @@ -26,19 +26,19 @@ }, { "name": "amount_notice_info", - "value": "*Please refer to the following sheet for the actual preferential amount" + "value": "*The exact coupon amount is subject to that displayed on the order page." }, { "name": "goods_prices_label", - "value": "Total price of goods" + "value": "Price" }, { "name": "discount_label", - "value": "Preferential amount" + "value": "Coupon" }, { "name": "discount_0label", - "value": "Discount 0 yuan discount details" + "value": "0.00 CNY coupon used; details" }, { "name": "total_label", @@ -46,23 +46,23 @@ }, { "name": "total_0_label", - "value": "Total:0.00" + "value": "Total: 0.00" }, { "name": "my_label", - "value": "me" + "value": "Me" }, { "name": "my_0_label", - "value": "me:¥0.00" + "value": "Me: ¥0.00" }, { "name": "xiaowang_label", - "value": "xiaowang" + "value": "Friend A" }, { "name": "xiaowang_0_label", - "value": "xiaowang:¥0.00" + "value": "Friend A: ¥0.00" }, { "name": "original_price_label", @@ -70,27 +70,27 @@ }, { "name": "original_price_0_label", - "value": "Original price:¥0.00" + "value": "Original price: ¥0.00" }, { "name": "select_all_label", - "value": "Select all" + "value": "All" }, { "name": "settle_accounts_label", - "value": "Settlement" + "value": "Checkout" }, { "name": "settle_accounts_0_label", - "value": "Settlement(0)" + "value": "Checkout (0)" }, { "name": "shopping_cart_slice", - "value": "My shopping cart" + "value": "My Shopping Cart" }, { "name": "xiaowang_shopping_cart", - "value": "Xiaowang's shopping cart" + "value": "Friend A's Shopping Cart" }, { "name": "cashier_label", @@ -98,19 +98,19 @@ }, { "name": "cloud_pay_label", - "value": "Cloud flash payment" + "value": "Yunshanfu" }, { "name": "bank_card_pay_label", - "value": "Bank card payment" + "value": "Bank card" }, { "name": "confirm_payment_label", - "value": "Confirm payment" + "value": "Pay" }, { "name": "pay_success_label", - "value": "Order payment succeeded" + "value": "Payment succeeded." }, { "name": "finish_label", @@ -122,23 +122,23 @@ }, { "name": "discount", - "value": "Discount" + "value": "Coupon" }, { "name": "activity_label", - "value": "Activity" + "value": "Event" }, { "name": "activity_618_label", - "value": "618 love Carnival" + "value": "618 Shopping Festival" }, { "name": "add_cart_label", - "value": "Add to cart" + "value": "Add to Cart" }, { "name": "meger_cart_request_info", - "value": "Your friend * * * shared shopping carts with you. Do you want to merge shopping carts?" + "value": "Your friend * * * shares their shopping cart with you. Do you want to merge the shopping carts?" }, { "name": "agree_label", @@ -146,15 +146,15 @@ }, { "name": "cancel_label", - "value": "Cancel" + "value": "Disagree" }, { "name": "cart_empty_info", - "value": "Shopping cart is empty!!!" + "value": "Your shopping cart is empty." }, { "name": "submit_order_label", - "value": "Submit order" + "value": "Payment" }, { "name": "default_label", @@ -166,19 +166,19 @@ }, { "name": "phone_info", - "value": "Mr**:186****6666" + "value": "Mr **:186****6666" }, { "name": "commodity_amount_label", - "value": "Commodity amount" + "value": "Purchase amount" }, { "name": "freight_label", - "value": "Freight" + "value": "Shipping cost" }, { "name": "subtraction_label", - "value": "Co subtraction" + "value": "Total coupon" }, { "name": "coupon_label", @@ -186,67 +186,39 @@ }, { "name": "no_available_info", - "value": "No available" + "value": "Unavailable" }, { "name": "share_success_info", - "value": "Share success" + "value": "Shopping cart shared." }, { "name": "discount_details", - "value": "RMB discount details" + "value": " CNY coupon used. Details" }, { "name": "meger_success_info", - "value": "Merge succeeded" + "value": "Shopping carts merged." }, { "name": "meger_cart_label", - "value": "Merge shopping cart" + "value": "Merge Shopping Carts" }, { "name": "friends_info", - "value": "your friend" + "value": "Your friend " }, { "name": "meger_cart_request", - "value": "Request to merge his shopping cart with you. Do you want to merge?" + "value": "requests to merge their shopping cart with yours. Do you want to merge the shopping carts?" }, { "name": "shared_cart_request", - "value": "Share his shopping cart with you. Do you accept it?" + "value": "shares their shopping cart with you. Do you want to accept it?" }, { "name": "shared_cart_label", - "value": "Shared shopping cart" - }, - { - "name": "RMB01", - "value": "¥0.00" - }, - { - "name": "RMB02", - "value": "-¥0.00" - }, - { - "name": "num1", - "value": "1" - }, - { - "name": "price2349", - "value": "¥2439.00" - }, - { - "name": "HUAWEI_Card", - "value": "HUAWEI Card" - }, - { - "name": "price2756", - "value": "¥2756.00" - }, - { - "name": "price317", - "value": "-¥317.00" + "value": "Share Shopping Cart" } ] } -- Gitee From b61f7b1b46d541439c756c74c7146d7f97b5fdd3 Mon Sep 17 00:00:00 2001 From: wusongqing Date: Tue, 26 Oct 2021 15:22:34 +0800 Subject: [PATCH 2/2] updated docs Signed-off-by: wusongqing --- CompleteApps/DistributedShoppingCart/README_zh.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CompleteApps/DistributedShoppingCart/README_zh.md b/CompleteApps/DistributedShoppingCart/README_zh.md index 41c0f094..c035104b 100644 --- a/CompleteApps/DistributedShoppingCart/README_zh.md +++ b/CompleteApps/DistributedShoppingCart/README_zh.md @@ -35,6 +35,6 @@ 具体环境搭建请[参考](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/installation_process-0000001071425528) 。 2. 使用限制 - •本sample是一个模拟网上购物的应用,商品数据都是从文件中读取,所以需要在resource下准备一个商品清单文档(product_datas.json,具体路径:resource/rawfile/)。用户可以根据自己的喜爱添加商品信息。 + 本sample是一个模拟网上购物的应用,商品数据都是从文件中读取,所以需要在resource下准备一个商品清单文档(product_datas.json,具体路径:resource/rawfile/)。 \ No newline at end of file -- Gitee