首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
代写program、代做Java语言编程
项目预算:
开发周期:
发布时间:
要求地区:
CA2 - React - E-Commerce website
2025/5/8
In Progress
NEXT UP: Submit assignment
2025/3/27 to 2025/5/22
Attempt 1 Add comment
Details
1 - Introduction
A reactive website will scale and reorder elements to suit the screen size of the device being used to
access it. A dynamic website will update the elements of the page without the need for a full reload.
In this assignment you will expand upon a skeleton program in order to build a dynamic and reactive
e-commerce front end website.
2 - Learning outcomes
By the end of this assignment, you will:
Be able to implement functions using Typescript.
Be familiar with how to use React components and hooks.
Have a template website that you could expand upon for a portfolio piece.
3 - Problem description
For this task, you have been provided with a skeleton website, as well as the assets to populate it
with. At the moment the site displays the: name, picture, rating, and price of a collection of items for
sale. If you type into the search bar, it will only display items that have your search term within their
name. You must add the following functionality:
An indicator showing the number of search results or products available.
The ability to sort the items by: name, price, or rating.
The ability to show only in stock items in the search results.
Adding or removing items from the shopping basket.
Calculate the total cost of products in the shopping basket.
4 - Initial setup
Assignment-2.zip (https://liverpool.instructure.com/courses/76914/files/12343412?wrap=1)
(https://liverpool.instructure.com/courses/76914/files/12343412/download?download_frd=1)
Download the skeleton code included above, which is a basic e-commerce website similar to the one
shown in lectures. Ensure that you have Node.js installed on your computer, this should come with
Vite. Download the zip file of this code and extract it to a suitable place on your computer. If you do
not have a computer, connect to the Linux farm and transfer the files. Navigate to the folder in your
CA2 - React - E-Commerce website
1/4
terminal, and type npm install. Once this installation has completed, type in npm run dev, which
should host the website locally for you. Take the localhost address shown in the output and type it
into your browser to see the website. There are 4 JSON files included in the Assets folder, which
are random products 1, 100, 150, and 175. Each of these JSON files contains a list of products to be
shown on the website. Each product has the attributes outlined in Table 1, with the images being
generated using Adobe Firefly.
Table 1: The attributes that are stored for each product
Attribute name Note
ID This is a unique identifier for each product, and is an integer.
name The name for each product.
price The price of the product in pounds.
category This is the general category of the product.
quantity
The number of this product that is currently available in stock. This is a non?negative integer.
rating This is a real number rating of the product between 0 and 5.
image_link The file location of the promotional image.
5 - Developing the website
5.1 The results indicator
When searching for products, it is often useful to know exactly how many products the current
search has returned. This can help make the website feel more reactive. In App.tsx there is a
results?indicator paragraph tag. Add a notification about how many results or products the current
search query has returned. If the search bar is empty, then the the output should be 'n Products'
where n is the number of products. If there is only a single product then the output should be '1
Product'. If the search bar is not empty, then the output should be 'm Results' where m is the number
of products returned by the search query. If there is only a single product returned by the query,
then it should say '1 Result'. If there are no results returned by a query then the output should be
'No search results found'.
5.2 Enhance search functionality
When looking at a list of products, a useful feature is being able to sort them by some attribute such
as price or rating. Add functionality to the select tag inside of the search?bar div, so changing the
selected option will result in that form of sorting being applied to the results. By default the product
list should be sorted by name alphabetically from A to Z. Once this task has been completed, add the
following functionality to the inStock checkbox input. When this checkbox is ticked, the results
should only include products that have a quantity larger than 0. Unticking this checkbox should
reverse that behaviour. Hint: this can be accomplished by using a combination of a state and a hook.
5.3 Adding to the shopping basket
CA2 - React - E-Commerce website
2/4
Each product currently has a button underneath that says Add to basket . Update this code so that if
the quantity of available product is 0, the button instead says Out of stock and is disabled. Add a
function to
the Add to basket button that passes the information to a shopping basket variable in App.tsx. This
variable should be a list of type BasketItem. Adding multiple instances of the same product should
increase the quantity property of the relevant basket instance. Do not worry about disabling the
product s button if the quantity added to the basket is more than the quantity available. Hint: The
parent/child example given in Tutorial 4 - question 7 can give you a good starting point.
5.4 Visualising the basket
Now that the data about the basket is being collected, we should visualise it for the user. If there are
no items in the basket then the shopping ? area div should contain a paragraph text saying 'Your
basket is empty'. If the shopping basket variable contains a product, then the shopping?area div
should contain that information. Each item in the basket should be surrounded by a div with the
class 'shopping-row', and a suitable key such as the name of the item. Inside of that div there should
be another div with the class shopping-information , and a button with Remove text. The shopping?information div should contain a paragraph tag which shows the information about the product in
the format [Productname] ( [Productprice]) ? [Productquantity] eg 'Hat 4 ( 45.58) - 1'. When the
Remove button is pressed, then the quantity of that product in the basket should be reduced by 1.
If pressing that button reduces the quantity of the product to 0, then that item should be removed
from the shopping basket. Inside the shopping?area div after all of the products there should be a
paragraph tag with the total cost of the shopping basket. This should be in the form of Total:
[Totalbasketcost] eg 'Total: 45.58'. This value should be shown to 2 decimal places.
6 - Marking
Two files, App.tsx and ProductList.tsx, should be submitted through the Codegrade submission
platform. This will account for 10% of your overall module score. You may use any library that comes
with a default installation of Node.js. Your work will be submitted to an automatic
plagiarism/collusion detection system, and those exceeding a threshold will be reported to the
Academic Integrity Officer for investigation regarding adhesion to the university s policy
7 - Deadline
The deadline is 23:59 GMT Monday the 8th of May 2025. Late submissions will have the typical 5%
penalty applied for each day late, up to 5 days. Submissions after this time will not be marked.
CA2 - React - E-Commerce website
3/4
This tool needs to be loaded in a new browser window
Load CA2 - React - E-Commerce website in a new window
CA2 - React - E-Commerce website
4/4
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
cs111编程代写、c++语言程序代...
2025-04-16
metr3100代做、c/c++,java程序...
2025-04-16
cse 231代写、代做python编程设...
2025-04-16
bms5010代做、代写python/java...
2025-04-16
代做acof001 assessment task ...
2025-04-16
代写comp285/comp220 lab test...
2025-04-16
代写fundamental ai and data ...
2025-04-16
代做la906 international inve...
2025-04-16
代做mech60132 advanced manuf...
2025-04-16
代写idbqm001 quantitative me...
2025-04-16
代写econ372 2025fc assignmen...
2025-04-16
代做biology 4405b short scie...
2025-04-16
代写acfi 2070 business finan...
2025-04-16
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!