结果 - 入选下一轮
开发一个简单的 React 应用程序,通过路由和动态数据获取来显示城市和产品销售信息。该应用程序应该允许用户在不同页面之间导航,并且应该跟踪访问过多少个城市和产品。数据应根据用户请求刷新。
应用概述:
主页:
API 端点:
城市详细信息页面:
产品详情页面:
刷新按钮:
带路由的单页应用程序 (SPA):
评估标准:
城市 API 响应:
描述:此 API 返回可用销售数据的城市名称列表。数据数组包含这些城市的名称。
特定城市的销售数据:
{ "status": "success", "data": { "product1": 137, "product2": 23, "product3": 77 } }
Description: This API returns sales data for a specific city. The data object contains key-value pairs where the key is the product name and the value is the number of items sold in that city.
Products List API Response:
{ "status": "success", "data": { "product1": 137, "product2": 23, "product3": 77 } }
Description: This API returns a list of all products with their total sales figures. The data object contains key-value pairs where the key is the product name and the value is the total number of items sold across all cities.
Product Detail API Response:
{ "status": "success", "data": { "product1": 137, "product2": 23, "product3": 77 } }
Description: This API returns the sales data for a specific product across different cities. The data object contains key-value pairs where the key is the city name and the value is the number of items sold for that product in that city.
Please ensure that you fully understand the requirements before starting the implementation. There’s a minor issue with the API response for the product/
You are encouraged to implement the solution and make any necessary modifications to the APIs as needed to meet the requirements. If you need more details or are interested in similar assignments, you can refer to my E-Commerce Project.
以上是React 编码挑战 - 使用 React 的城市/产品销售浏览器的详细内容。更多信息请关注PHP中文网其他相关文章!