该在线商城系统可以实现以下功能:
1、实现用户登录注册;
2、通过调用我自己写的商品数据api,部署在apifox的云端Mock上
3、将商品加入购物车;
4、在购物车内实现全选,商品数量和价格进行增减操作,移除某个商品;
5、生成订单,订单页面可操作修改收货人姓名和地址,显示订单生成实时时间和随机订单号;
6、我的订单可以查看以往所有生产的订单
https://yuhaowen.gitee.io/vuemall/#/
基于Vue3在线商城(Vue3+VueCLI+VueRouter+vuex+axios+Bootstrap)
如果未进行登录系统,
点击系统页面“我的购物车”、“我的订单”、“加入购物车”功能按钮
然后会出现提示,随机跳转至注册页面
购物车页面可以进行以下操作:
1、全选商品
2、对某类商品进行数量增减进行操作,小计价格随之变化
3、移除某个商品
4、计算勾选商品的数量,总价
5、点击结算按钮后,会移除购物车内所选的商品,留下未勾选的商品
订单页面可以进行一下操作:
1、对商品收货人的姓名、地址进行修改
2、显示订单生成实时时间
3、订单号为随机生成
交易成功,3s后会自动返回首页
可以查看以往成交的所有订单数据
一开始是使用 Postman 的Mock Servers进行部署API
可是这个有每月访问次数的限制
后来就换成了 Apifox
我自己写的API接口
https://mock.apifox.cn/m1/1256591-0-default/mall/commodity
{
"comList": [
{
"boothId": 1,
"shopTitle": "手机",
"itemList": [
{
"itemId": "phone01",
"itemImg": "https://img13.360buyimg.com/n1/s450x450_jfs/t1/2205/16/19104/111306/62c5647cEcc1356f9/740e80305d62f554.jpg",
"itemHint": "【限时特惠300!到手价1799!PLUS会员赠iQOO耳机】骁龙870144Hz竞速屏Neo5SE限时至高特惠300",
"itemName": "vivo iQOO Neo5 SE 8GB+256GB 矿影蓝 骁龙870 144Hz竞速屏 55W闪充 双模5G全网通手机 iqooneo5se",
"count": 1,
"itemPrice": 2099.00
},
{
"itemId": "phone02",
"itemImg": "https://img12.360buyimg.com/n1/s450x450_jfs/t1/168588/11/25466/231678/62c3a2e8E7ef559e8/fe238f924e3ce777.jpg",
"itemHint": "【华为nova10新品上市】现在预定,付尾款优惠50元,到手价仅2649元!更享白条六期免息!速来抢购!华为手机热销爆款,限量抢购,猛戳》》》",
"itemName": "HUAWEI nova 10 【内置66W华为超级快充】 前置6000万超广角镜头 6.88mm轻薄机身 128GB 10号色 华为手机",
"count": 1,
"itemPrice": 2699.00
},
{
"itemId": "phone03",
"itemImg": "https://img13.360buyimg.com/n1/s450x450_jfs/t1/187197/21/25548/255763/62c248d0E585a44cd/e8d7b8f255b2aa86.jpg",
"itemHint": "【品质好物】骁龙870处理器,三星E4旗舰直屏,67W旗舰快充【Note11TPro火热抢购中】",
"itemName": "Redmi K40S 骁龙870 三星E4 AMOLED 120Hz直屏 OIS光学防抖 67W快充 亮黑 12GB+256GB 5G智能手机 小米红米",
"count": 1,
"itemPrice": 2199.00
},
{
"itemId": "phone04",
"itemImg": "https://img12.360buyimg.com/n1/s450x450_jfs/t1/21124/24/17522/128861/62c6d349Ead8a6381/e66983a89d7f5eeb.jpg",
"itemHint": "骁龙8处理器 | 旗舰芯2K柔性直屏 | 65W闪充",
"itemName": "【至高省1000元】realme真我GT2 Pro骁龙8移动平台旗舰芯2K柔性直屏65W闪充智能游戏手机gt2pro",
"count": 1,
"itemPrice": 3999.00
},
{
"itemId": "phone05",
"itemImg": "https://img13.360buyimg.com/n1/s450x450_jfs/t1/185889/33/26741/223738/62c6a2c7E66723d7c/a187211a30c853f8.jpg",
"itemHint": "一加Ace,长寿版150W超级闪充,会员领券再减10元,享6期免息",
"itemName": "一加 10 Pro 全新骁龙8 120Hz柔性屏 哈苏影像2.0 80W超级闪充 新一代旗舰三摄12GB+256GB破界黑 5G游戏手机",
"count": 1,
"itemPrice": 4779.00
},
{
"itemId": "phone06",
"itemImg": "https://img11.360buyimg.com/n1/s450x450_jfs/t1/83482/7/19433/110121/62a07e62Ed8aea53a/f53c84d94fc493c4.jpg",
"itemHint": "【华为MateXs】超轻薄超平整超可靠,424ppi超清原色大屏,鸿蒙全新大屏体验;",
"itemName": "华为/HUAWEI Mate Xs 2 超轻薄超平整超可靠 424ppi超清原色大屏 鸿蒙全新大屏体验12GB+512GB锦白折叠屏手机",
"count": 1,
"itemPrice": 4769.00
},
{
"itemId": "phone07",
"itemImg": "https://img11.360buyimg.com/n1/s450x450_jfs/t1/165575/15/27096/157467/62bdcb68E2e611d5e/3cee67e2ba3e585f.jpg",
"itemHint": "三星钜惠",
"itemName": "三星 SAMSUNG Galaxy S22 Ultra 超视觉夜拍系统 超耐用精工设计 大屏S Pen书写 12GB+256GB 绯影红 5G手机",
"count": 1,
"itemPrice": 9699.00
},
{
"itemId": "phone08",
"itemImg": "https://img11.360buyimg.com/n1/s450x450_jfs/t1/86383/12/30043/311425/62bd0cb7E469d7a41/35e565df034545fc.jpg",
"itemHint": "拯救者Y90电竞游戏手机全新骁龙8,霜刃散热,四肩键双压感,AMOLED电竞屏",
"itemName": "联想拯救者Y90电竞游戏手机 12GB+256GB 全新骁龙8 霜刃散热 四肩键双压感 144Hz AMOLED电竞屏 5G钛晶灰",
"count": 1,
"itemPrice": 3299.00
},
{
"itemId": "phone09",
"itemImg": "https://img11.360buyimg.com/n1/jfs/t1/77347/1/19898/314273/62c3ee81E975fdc98/dd82f95da0b91791.jpg",
"itemHint": "酷冷战神,先手制胜,腾讯ROG游戏手机6",
"itemName": "ROG游戏手机6 16GB+512GB 暗影黑 骁龙8+Gen1 矩阵式液冷散热6.0 165Hz三星电竞屏 2x3Plus肩键 5G ROG6",
"count": 1,
"itemPrice": 5999.00
},
{
"itemId": "phone10",
"itemImg": "https://img11.360buyimg.com/n1/s450x450_jfs/t1/58294/17/20204/350979/62b84a40Eca0a9c2b/f9ab1427327c1abd.jpg",
"itemHint": "OPPO Reno8 8GB+256GB 鸢尾紫 新配色上市",
"itemName": "OPPO Reno8 8GB+256GB 鸢尾紫 新配色上市 80W超级闪充 5000万水光人像三摄 3200万前置索尼镜头 5G手机",
"count": 1,
"itemPrice": 3299.00
}
]
},
{
"boothId": 2,
"shopTitle": "电脑",
"itemList": [
{
"itemId": "computer01",
"itemImg": "https://img14.360buyimg.com/n1/s450x450_jfs/t1/71915/9/18476/252032/628c56e9E4520a6ab/03ce1e4ee2cec771.jpg",
"itemHint": "联想平板小新Pad2022丨10.6英寸办公娱乐影音平板电脑,莱茵低蓝光护眼学习模式2k全面屏,可阅读模式,超大电池机身轻盈",
"itemName": "联想平板小新Pad 2022 10.6英寸 学习办公娱乐影音平板电脑 莱茵低蓝光护眼 2k全面屏 6GB+128GB WIFI 深空灰",
"count": 1,
"itemPrice": 1199.00
},
{
"itemId": "computer02",
"itemImg": "https://img13.360buyimg.com/n1/s450x450_jfs/t1/204694/17/23123/59329/628b7452Eec972513/68a0b3dfeb65c417.jpg",
"itemHint": "联想拯救者Y9000X 英特尔酷睿i7 16英寸游戏笔记本电脑",
"itemName": "联想拯救者Y9000X 英特尔酷睿i7 16英寸游戏笔记本电脑(12代 i7-12700H 16G 512G RTX3060 2.5k 165Hz高色域)",
"count": 1,
"itemPrice": 9499.00
},
{
"itemId": "computer03",
"itemImg": "https://img12.360buyimg.com/n1/s450x450_jfs/t1/60677/31/19958/76257/62bd5146Ed09bcb91/4ba0cf0b934090a9.jpg",
"itemHint": "全新12代标压16核处理器,满功耗RTX3070Ti独显,2.5K高刷全面屏,大电池,接口丰富,便携快充",
"itemName": "联想拯救者Y9000K 2022 英特尔酷睿i7 16英寸游戏笔记本电脑(12代i7-12800HX 32G 1TB RTX3070Ti 2.5k电竞屏)",
"count": 1,
"itemPrice": 19999.00
},
{
"itemId": "computer04",
"itemImg": "https://img13.360buyimg.com/n1/jfs/t1/106758/14/24128/327564/62c6f0e5E7994549f/dc349c912f8ae1d1.jpg",
"itemHint": "天选3日蚀灰,全新12代酷睿i7处理器,140W满血RTX3060,双显三模,DDR5双通道内存,165Hz全能电竞屏",
"itemName": "华硕天选3 第12代英特尔酷睿i7 高颜值高性能电竞高端游戏本笔记本电脑 日蚀灰i7-12700H RTX3060 16G内存 512G高速固态 2.5K 165Hz 100%P3色域",
"count": 1,
"itemPrice": 8999.00
},
{
"itemId": "computer05",
"itemImg": "https://img11.360buyimg.com/n1/s450x450_jfs/t1/49042/2/19847/267169/62bd62a7E519119f3/c4121b1d78d3eeea.jpg",
"itemHint": "戴尔游匣G15爆款新品,RTX3060显卡,全新升级win11",
"itemName": "戴尔(DELL) 笔记本电脑 游匣G15 15.6英寸游戏本(八核i7 16G 512G RTX3060显卡 165Hz 100%sRGB高色域)耀夜黑",
"count": 1,
"itemPrice": 6699.00
},
{
"itemId": "computer06",
"itemImg": "https://img12.360buyimg.com/n1/s450x450_jfs/t1/84072/36/19130/286540/629e0962Ecaeddb46/ced42daf77c9995f.jpg",
"itemHint": "【2022新品上市!为信仰而战!为游戏而生!】双显三模!DDR5内存!2.5K、240Hz电竞屏!新一代液金导热!",
"itemName": "ROG枪神6Plus第12代英特尔酷睿17.3英寸游戏本笔记本电脑(i9-12900H 液金导热 16G 1T RTX3070Ti 150W)",
"count": 1,
"itemPrice": 19999.00
},
{
"itemId": "computer07",
"itemImg": "https://img12.360buyimg.com/n1/s450x450_jfs/t1/42776/10/17345/131277/626bc1e3Eb2b0278a/1dc51316f3dc1898.jpg",
"itemHint": "【华为MateBookD14-2022款丨护眼全面屏,全新11代酷睿,华为分享】",
"itemName": "华为笔记本电脑MateBook D 14 2022款 14英寸 11代酷睿 i5 16G+512G 锐炬显卡 轻薄本/护眼全面屏 银",
"count": 1,
"itemPrice": 4499.00
},
{
"itemId": "computer08",
"itemImg": "https://img11.360buyimg.com/n1/s450x450_jfs/t1/176127/38/25368/163695/62a99f5fE6d6eafd1/8edf17f6806cdd52.jpg",
"itemHint": "【12代新品】12代i7高性能,17.3英寸165Hz电竞屏,16G内存,RTX3060显卡!",
"itemName": "机械革命旷世E 17.3英寸165Hz 2.5K电竞游戏笔记本电脑(12代英特尔酷睿i7-12700H 16G 512G RTX3060)",
"count": 1,
"itemPrice": 7799.00
},
{
"itemId": "computer09",
"itemImg": "https://img11.360buyimg.com/n1/s450x450_jfs/t1/124800/2/23765/111769/62ae07c3E006dfbc4/b9450b57eb2066c5.jpg",
"itemHint": "【暗影精灵8,12代i7,全力出击!】全新12代14核20线程i7处理器+新DDR5内存+144Hz高刷新高色域电竞大屏!",
"itemName": "惠普(HP)暗影精灵8 16.1英寸游戏笔记本电脑(12代酷睿i7-12700H RTX3060 6G独显 16GDDR5 512G 144Hz 高色域)",
"count": 1,
"itemPrice": 8699.00
},
{
"itemId": "computer10",
"itemImg": "https://img14.360buyimg.com/n1/s450x450_jfs/t1/185120/32/25687/203605/62be6d47E113d153f/e669b395b26be8f3.jpg",
"itemHint": "【夏日爆品!华硕好屏】标压R9-5900HX,OLED+2.8K+90Hz屏,RTX3050独显,Dialpad虚拟旋钮,",
"itemName": "华硕灵耀Pro14 标压锐龙2.8K OLED游戏性能设计轻薄笔记本电脑(R9-5900HX 16G 512 RTX3050 DCI-P3 600nit)黑",
"count": 1,
"itemPrice": 6799.00
}
]
},
{
"boothId": 3,
"shopTitle": "电脑外设",
"itemList": [
{
"itemId": "peripherals01",
"itemImg": "https://img10.360buyimg.com/n1/s450x450_jfs/t1/213112/2/15500/248872/623bcdc3Edbed88e0/5725c270ea4780b2.jpg",
"itemHint": "达尔优(dareu)EK815机械师合金版 机械键盘 有线键盘 游戏键盘",
"itemName": "达尔优(dareu)EK815机械师合金版 机械键盘 有线键盘 游戏键盘 108键单光 女生 电脑键盘 粉色 茶轴",
"count": 1,
"itemPrice": 179.00
},
{
"itemId": "peripherals02",
"itemImg": "https://img14.360buyimg.com/n1/jfs/t1/216842/19/18990/191227/62ab4aacEe71a0ec7/2ec1178caa16217c.jpg",
"itemHint": "匠心品质消费信赖 【潮流个性拼色】DIY键帽*总有一色属于你! 【亲民价格大牌品质】实力与颜值共存!",
"itemName": "飞利浦(philips) 机械键盘鼠标套装 有线键盘 游戏办公键盘台式笔记本电脑键盘104键打字键盘 白深蓝红三色经典版(茶轴)",
"count": 1,
"itemPrice": 139.00
},
{
"itemId": "peripherals03",
"itemImg": "https://img13.360buyimg.com/n1/s450x450_jfs/t1/104809/21/15652/550476/5e7321aeEce054be5/2ca8176733c5057c.jpg",
"itemHint": "罗技MX系列新品重磅来袭,黑科技带来高效率",
"itemName": "罗技(Logitech)K380 键盘 蓝牙键盘 办公键盘 女性 便携 超薄键盘 笔记本键盘 红色",
"count": 1,
"itemPrice": 179.00
},
{
"itemId": "peripherals04",
"itemImg": "https://img12.360buyimg.com/n1/s450x450_jfs/t1/66334/4/20210/312010/62c394ebE1048b293/50773a0645ca1bd9.jpg",
"itemHint": "【RNG同款】【PRO系列键鼠】",
"itemName": "罗技(G)G502 HERO主宰者有线鼠标 游戏鼠标 HERO引擎 RGB鼠标 电竞鼠标 25600DPI",
"count": 1,
"itemPrice": 309.00
},
{
"itemId": "peripherals05",
"itemImg": "https://img11.360buyimg.com/n1/s450x450_jfs/t1/126346/8/4144/287788/5ed9c58eE48f28bf3/bf855385a1dc3ee6.jpg",
"itemHint": "【雷柏新款上市】雷柏V700-8A孤勇者游戏办公机械键盘,5台设备连接快速切换,内置锂电至高可达225小时无线续航",
"itemName": "雷柏(Rapoo) MT750L 无线鼠标 蓝牙鼠标 办公鼠标 人体工程学 充电鼠标 电脑鼠标 笔记本鼠标 黑色",
"count": 1,
"itemPrice": 159.00
},
{
"itemId": "peripherals06",
"itemImg": "https://img14.360buyimg.com/n1/s450x450_jfs/t1/217023/17/19168/157110/6285f8c4E0e79f6e2/fad072c60b0338fe.jpg",
"itemHint": "27英寸,IPS显示屏,2K,Adaptive-Sync,75Hz,350尼特,100%sRGB",
"itemName": "华硕ProArt 2K 27英寸 IPS显示屏Adaptive-Sync 75Hz刷新 350尼特 100%sRGB旋转升降支架电脑显示器PA278QEV",
"count": 1,
"itemPrice": 1699.00
},
{
"itemId": "peripherals07",
"itemImg": "https://img12.360buyimg.com/n1/jfs/t1/214252/37/12855/113182/6212f6faE53e3ad49/464ed6fb82b66586.jpg",
"itemHint": "QD-OLED面板+99.3%DCI-P3色域+准4K级分辨率",
"itemName": "外星人(alienware) AW3423DW 34英寸QD-OLED曲面屏0.1ms电竞游戏曲面屏 AW3423DW 官方标配",
"count": 1,
"itemPrice": 14009.00
},
{
"itemId": "peripherals08",
"itemImg": "https://img11.360buyimg.com/n1/jfs/t1/74127/34/17900/287138/627ca8f3E053bc9ee/d6783b7163f62961.jpg",
"itemHint": "爱攻&保时捷联名定制MiniLED,4K高分HDR1400高刷新以速之名点亮新征程!",
"itemName": "AOC 爱攻&保时捷联名定制二代 31.5英寸 MiniLED 4K 144Hz 快速液晶1ms HDR1400 DTS 游戏电竞显示器 PD32M",
"count": 1,
"itemPrice": 11999.00
},
{
"itemId": "peripherals09",
"itemImg": "https://img11.360buyimg.com/n1/s450x450_jfs/t1/100225/3/30166/330410/62be6a81E03cf2a13/f8c59d8c4dae6797.jpg",
"itemHint": "FHD高清,IPS,全功能type-c",
"itemName": "雕塑家(sculptor)MF16LC 15.8英寸便携式显示器 HDR双一线通锤子TNT华为手机PS4笔记本扩展Switch",
"count": 1,
"itemPrice": 8699.00
},
{
"itemId": "peripherals10",
"itemImg": "https://img13.360buyimg.com/n1/s450x450_jfs/t1/183605/38/26518/165460/62bab0d2E05bd3114/0f5741b302cece0b.jpg",
"itemHint": "三年质保,24英寸商用显示器,可调节机身,支持竖屏!爆款34寸,2K高分",
"itemName": "三星(SAMSUNG)F24T450FQC 24英寸IPS屏75Hz升降旋转商务办公高清显示器",
"count": 1,
"itemPrice": 6799.00
}
]
},
{
"boothId": 4,
"shopTitle": "电脑配件",
"itemList": [
{
"itemId": "accessories01",
"itemImg": "https://img12.360buyimg.com/n1/s450x450_jfs/t1/18945/13/17436/425800/62be97cbE66b88e9c/786c2f27a2676370.jpg",
"itemHint": "i9-12900KS处理器",
"itemName": "英特尔(Intel)12代酷睿特别版 i9-12900KS处理器 16核24线程单核睿频至高可达5.5Ghz三级缓存30M 台式机CPU",
"count": 1,
"itemPrice": 5599.00
},
{
"itemId": "accessories02",
"itemImg": "https://img12.360buyimg.com/n1/s450x450_jfs/t1/204299/10/21185/153429/6254e41cE993750b5/d354e734681ebf18.jpg",
"itemHint": "锐龙9 5950X 处理器(r9)7nm 16核32线程",
"itemName": "AMD 锐龙9 5950X 处理器(r9)7nm 16核32线程 3.4GHz 105W AM4接口 盒装CPU",
"count": 1,
"itemPrice": 3799.00
},
{
"itemId": "accessories03",
"itemImg": "https://img11.360buyimg.com/n1/s450x450_jfs/t1/1514/12/16724/429634/626a32beE86f301df/6f8c02c1b98091ab.jpg",
"itemHint": "精益求“金”,WDGold硬盘针对繁重的应用工作负载优化,550TB/年的工作负载。",
"itemName": "西部数据(WD)金盘 1TB SATA6Gb/s 7200转128M 企业硬盘(WD1005VBYZ)",
"count": 1,
"itemPrice": 679.00
},
{
"itemId": "accessories04",
"itemImg": "https://img11.360buyimg.com/n1/s450x450_jfs/t1/202454/27/17673/125047/61ada4b9E530b2736/ba754c4a3a1601c3.jpg",
"itemHint": "兼具速度与可靠性!读速高达3500MB/s,全功率模式!",
"itemName": "三星(SAMSUNG)1TB SSD固态硬盘 M.2接口(NVMe协议) 980(MZ-V8V1T0BW)",
"count": 1,
"itemPrice": 769.00
},
{
"itemId": "accessories05",
"itemImg": "https://img14.360buyimg.com/n1/s450x450_jfs/t1/90469/1/26929/387289/6268f028Ef6233782/c407e381bbfc0f98.jpg",
"itemHint": "SN570容量1TB",
"itemName": "西部数据(Western Digital)1TB SSD固态硬盘 M.2接口(NVMe协议) WD Blue SN570 四通道PCIe 高速",
"count": 1,
"itemPrice": 679.00
},
{
"itemId": "accessories06",
"itemImg": "https://img14.360buyimg.com/n1/s450x450_jfs/t1/197063/31/15818/113228/61822be0E4f5fcdc2/0dc0c123edb33ae1.jpg",
"itemHint": "桌面精品,全景侧透。支持MATX小主板,7风扇位,290mm显卡限长",
"itemName": "长城(Great Wall)阿基米德5白色桌面电脑机箱(MATX小板/240水冷位/玻璃侧透/7风扇位/4硬盘位/背线)",
"count": 1,
"itemPrice": 129.00
},
{
"itemId": "accessories07",
"itemImg": "https://img11.360buyimg.com/n1/s450x450_jfs/t1/223628/2/10362/200373/6264cd1eEcfd679bb/620a5fbcdaaf6847.jpg",
"itemHint": "光威(Gloway)8GB DDR3 1600 台式机内存条/战将系列",
"itemName": "光威(Gloway)8GB DDR3 1600 台式机内存条/战将系列",
"count": 1,
"itemPrice": 129.00
},
{
"itemId": "accessories08",
"itemImg": "https://img10.360buyimg.com/n1/s450x450_jfs/t1/208754/23/19855/327088/622ed3fcEd570028f/4f1b1351232a5a68.jpg",
"itemHint": "ROG STRIX Z690-A GAMING WIFI吹雪主板",
"itemName": "玩家国度 ROG STRIX Z690-A GAMING WIFI吹雪主板 支持DDR5 CPU 12900K/12700K(Intel Z690/LGA 1700)",
"count": 1,
"itemPrice": 2599.00
},
{
"itemId": "accessories09",
"itemImg": "https://img13.360buyimg.com/n1/s450x450_jfs/t1/219669/12/16169/506645/62763a20Ea0015943/dedb796d123c1884.jpg",
"itemHint": "12相60A供电|加强散热",
"itemName": "微星(MSI)MAG B660M MORTAR WIFI DDR4 迫击炮电脑主板 支持CPU 12400 /12400F/12700(INTEL B660/LGA 1700)",
"count": 1,
"itemPrice": 1099.00
},
{
"itemId": "accessories10",
"itemImg": "https://img14.360buyimg.com/n1/s450x450_jfs/t1/167926/17/25891/550696/6214bde2E6db1f3b4/e859ba05aa866b06.jpg",
"itemHint": "高频三风扇/正逆转风扇/RGB灯光查看4K高刷电竞显示器",
"itemName": "技嘉魔鹰GeForce RTX 3060 Ti GAMING OC 8G LHR电竞游戏设计智能学习电脑独立显卡",
"count": 1,
"itemPrice": 3799.00
}
]
}
]
}
上学期期末的实训项目,现在都快开学了,现在才将其分享出来,
属实是太拖拉了
虽然和之前的那个javaweb商城好些了,
但事实任有一些不足之处
还需努力