• Home
Name Date Size #Lines LOC

..--

entry/12-May-2024-1,0961,003

screenshot/device/12-May-2024-

.gitignoreD12-May-2024121 88

README-EN.mdD12-May-20241 KiB169

README.mdD12-May-20241.4 KiB2915

build-profile.json5D12-May-20241 KiB4341

hvigorfile.jsD12-May-2024174 21

package.jsonD12-May-2024374 1818

README-EN.md

1#  Lightweight Storage
2
3### Introduction
4
5Lightweight storage supports lightweight key-value (KV) operations and allows local apps to store a small amount of data. This sample shows how to add offerings to the shopping cart, remove offerings from the shopping cart, and saving the shopping cart. The shopping cart information is retained even when the app is closed. This reflects the lightweight storage feature.
6
7### Usage
8
91. Select an offering and click **Add to Cart**. When the number of offerings in the shopping cart is greater than 5, a full icon is displayed in the upper right corner and no more offering can be added to the shopping cart.
102. Touch the shopping cart icon to view the added offerings. You can delete offerings from the shopping cart or clear the shopping cart. The total price of offerings and the shopping cart icon change accordingly.
113. Exit the app and then open the shopping cart again. The offering information before exit is displayed.
12
13### Constraints
14
15This sample can only be run on standard-system devices.
16

README.md

1#  轻量级存储
2
3### 简介
4
5轻量级数据存储主要提供轻量级Key-Value操作,支持本地应用存储少量数据。本示例通过对购物车商品的添加和删除并保存退出的操作,使得再次打开应用时依然可以保留退出前的购物车信息,体现了轻量级存储在保存轻量级数据时的作用。实现效果如下:
6
7![shopcat](screenshot/device/shopcat.png)
8
9### 相关概念
10
11轻量级存储:轻量级存储为应用提供key-value键值型的文件数据处理能力,支持应用对数据进行轻量级存储及查询。数据存储形式为键值对,键的类型为字符串型,值的存储数据类型包括数字型、字符型、布尔型。
12
13### 相关权限
14
15不涉及。
16
17### 使用说明
18
191.选择商品点击加入购物车,当购物车数量大于5时,右上方购物车图标为满状态,则购物车已满不能再添加商品。
20
212.点击上方购物车图标,查看已添加的商品,并可对购物车内的商品进行删除或者清空购物车,商品总价与购物车图标也会相应的发生变化。
22
233.退出应用再重新打开购物车时,将会展示购物车在退出前的商品信息。
24
25### 约束与限制
26
271.本示例仅支持在标准系统上运行。
28
292.本示例需要使用DevEco Studio 3.0 Beta4 (Build Version: 3.0.0.992, built on July 14, 2022)才可编译运行。