Skip to content

Commit 193aa8c

Browse files
author
Joeshu
committed
v3 版本
1 parent 4c72405 commit 193aa8c

File tree

164 files changed

+16329
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+16329
-1
lines changed

.editorconfig

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[*.md]
13+
insert_final_newline = false
14+
trim_trailing_whitespace = false

.env

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
# port
3+
VITE_PORT = 2022
4+
5+
# 网站标题
6+
VITE_APP_TITLE = '首页'

.env.development

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
# 自定义环境变量
3+
VITE_APP_ENV = 'dev'
4+
5+
# 域名
6+
VITE_APP_API_HOST = 'api.it120.cc'
7+
8+

.env.production

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
# 自定义环境变量
3+
VITE_APP_ENV = 'prod'
4+
5+
# 域名
6+
VITE_APP_API_HOST = 'api.it120.cc'

.env.test

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
NODE_ENV=production
2+
3+
# 自定义环境变量
4+
VITE_APP_ENV = 'test'
5+
6+
# 域名
7+
VITE_APP_API_HOST = 'api.it120.cc'

.eslintrc.js

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// @ts-check
2+
// eslint-disable-next-line @typescript-eslint/no-require-imports
3+
const { defineConfig } = require('eslint-define-config');
4+
5+
module.exports = defineConfig({
6+
root: true,
7+
env: {
8+
browser: true,
9+
node: true,
10+
},
11+
globals: {
12+
uni: true,
13+
wx: true,
14+
},
15+
parser: 'vue-eslint-parser',
16+
parserOptions: {
17+
parser: '@typescript-eslint/parser',
18+
ecmaVersion: 2020,
19+
sourceType: 'module',
20+
jsxPragma: 'React',
21+
ecmaFeatures: {
22+
jsx: true,
23+
},
24+
},
25+
extends: ['alloy', 'alloy/typescript', 'alloy/vue'],
26+
rules: {
27+
// 自定义你的规则
28+
'no-console': 'off',
29+
// js 和 ts 的规则重合
30+
'no-undef': 'off',
31+
// vue3 和 vue2 rules 冲突
32+
'vue/no-v-model-argument': 'off',
33+
'vue/no-multiple-template-root': 'off',
34+
// 'vue/no-duplicate-attributes': 'off',
35+
// 'vue/no-v-for-template-key': 'off',
36+
},
37+
});

.gitignore

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.DS_Store
2+
node_modules
3+
/dist
4+
5+
6+
# local env files
7+
.env.local
8+
.env.*.local
9+
10+
# Log files
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
pnpm-debug.log*
15+
16+
# Editor directories and files
17+
.idea
18+
*.suo
19+
*.ntvs*
20+
*.njsproj
21+
*.sln
22+
*.sw?

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry=https://registry.npmmirror.com

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist

.prettierrc.js

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
module.exports = {
2+
// 一行最多 120 字符
3+
printWidth: 120,
4+
// 使用 2 个空格缩进
5+
tabWidth: 2,
6+
// 不使用缩进符,而使用空格
7+
useTabs: false,
8+
// 行尾需要有分号
9+
semi: true,
10+
// 使用单引号
11+
singleQuote: true,
12+
// 对象的 key 仅在必要时用引号
13+
quoteProps: 'as-needed',
14+
// jsx 不使用单引号,而使用双引号
15+
jsxSingleQuote: false,
16+
// 末尾需要有逗号
17+
trailingComma: 'all',
18+
// 大括号内的首尾需要空格
19+
bracketSpacing: true,
20+
// jsx 标签的反尖括号需要换行
21+
bracketSameLine: false,
22+
// 箭头函数,只有一个参数的时候,也需要括号
23+
arrowParens: 'always',
24+
// 每个文件格式化的范围是文件的全部内容
25+
rangeStart: 0,
26+
rangeEnd: Infinity,
27+
// 不需要写文件开头的 @prettier
28+
requirePragma: false,
29+
// 不需要自动在文件开头插入 @prettier
30+
insertPragma: false,
31+
// 使用默认的折行标准
32+
proseWrap: 'preserve',
33+
// 根据显示样式决定 html 要不要折行
34+
htmlWhitespaceSensitivity: 'css',
35+
// vue 文件中的 script 和 style 内不用缩进
36+
vueIndentScriptAndStyle: false,
37+
// 换行符使用 lf
38+
endOfLine: 'lf',
39+
// 格式化内嵌代码
40+
embeddedLanguageFormatting: 'auto',
41+
};

.vscode/settings.json

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
// editor
3+
"editor.formatOnSave": true,
4+
"editor.codeActionsOnSave": {
5+
"source.fixAll.eslint": true,
6+
"source.fixAll.stylelint": true
7+
},
8+
"editor.defaultFormatter": "esbenp.prettier-vscode",
9+
// eslint
10+
"eslint.validate": ["javascript", "javascriptreact", "vue", "typescript", "typescriptreact"],
11+
// typescript
12+
"typescript.tsdk": "node_modules/typescript/lib",
13+
"cSpell.words": [
14+
"avic",
15+
"browserslist",
16+
"compressorjs",
17+
"flashdeliver",
18+
"groupon",
19+
"Lazyload",
20+
"Localforage",
21+
"openid",
22+
"ordermeal",
23+
"ordermealwx",
24+
"Pinia",
25+
"pnpm",
26+
"prefetch",
27+
"scroller",
28+
"Seckill",
29+
"superdesk",
30+
"swipeable",
31+
"tabbar",
32+
"tailwindcss",
33+
"unref",
34+
"vant",
35+
"vconsole",
36+
"vite",
37+
"vitejs",
38+
"vueuse",
39+
"vuex"
40+
]
41+
}

README.md

+67-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,68 @@
11
# v-shop
2-
基于vue,使用api工厂]供的免费接口和云后台,实现一个线上商城
2+
3+
## 🌈 简介
4+
5+
v-shop 是一个前端免费开源的企业级 H5 商城,也可用于学习参考。
6+
7+
## 🔥 预览
8+
9+
- :tada: v2 [Vue 2 + Vue CLI 4.5](https://v-shop.shuzp.top/v2/)
10+
- :rocket: v3 [Vue 3 + Vite 2](https://v-shop.shuzp.top/)
11+
12+
## 🛠️ 产品
13+
14+
- 版本:v3
15+
- 前端:vueJs + Vant
16+
- 后端:[api 工厂](https://www.it120.cc/)
17+
- 运行平台:移动端 H5
18+
- 设计稿画布尺寸:375x667
19+
- 设计稿图片管理: [《v-shop UI —— 语雀》](https://www.yuque.com/vshop/)
20+
- 商品模拟数据源: [小米商城](https://m.mi.com/)
21+
- 已实现功能清单
22+
23+
```
24+
├─登录注册
25+
├─Tabbar
26+
├─个人资料
27+
├─动态主题
28+
├─优惠券
29+
├─售后
30+
├─商品
31+
├─商品分类
32+
├─异常
33+
├─收货地址
34+
├─积分
35+
├─订单
36+
├─购物车
37+
└─钱包
38+
```
39+
40+
## 🔨 使用
41+
42+
> Node.js 版本最好 `12.x` 以上,偶数版本 `14.x``16.x`
43+
44+
获取项目代码
45+
46+
```bash
47+
git clone https://github.com/JoeshuTT/v-shop.git
48+
cd v-shop
49+
```
50+
51+
安装依赖
52+
53+
```bash
54+
# 通过 pnpm 安装
55+
pnpm install
56+
```
57+
58+
本地运行
59+
60+
```bash
61+
pnpm run dev
62+
```
63+
64+
打包发布
65+
66+
```bash
67+
pnpm run build
68+
```

index.html

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<!DOCTYPE html>
2+
<html lang="zh-cmn-Hans">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
6+
<meta name="renderer" content="webkit" />
7+
<meta
8+
name="viewport"
9+
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover"
10+
/>
11+
<link rel="icon" href="/favicon.ico" />
12+
<title><%= title %></title>
13+
<style>
14+
.p-preloader {
15+
display: -webkit-box;
16+
display: -webkit-flex;
17+
display: -ms-flexbox;
18+
display: flex;
19+
-webkit-box-align: center;
20+
-webkit-align-items: center;
21+
-ms-flex-align: center;
22+
align-items: center;
23+
-webkit-box-pack: center;
24+
-webkit-justify-content: center;
25+
-ms-flex-pack: center;
26+
justify-content: center;
27+
position: absolute;
28+
top: 0;
29+
right: 0;
30+
bottom: 0;
31+
left: 0;
32+
z-index: 2;
33+
background-color: #fff;
34+
color: #c8c9cc;
35+
}
36+
37+
.p-preloader__icon {
38+
box-sizing: border-box;
39+
width: 40px;
40+
height: 40px;
41+
margin: 0 auto 10px;
42+
}
43+
44+
.p-preloader__icon svg {
45+
margin: 0 auto 10px;
46+
width: 40px;
47+
height: 40px;
48+
}
49+
50+
.p-preloader__label {
51+
font-size: 14px;
52+
text-align: center;
53+
letter-spacing: 2px;
54+
padding-left: 2px;
55+
}
56+
</style>
57+
</head>
58+
<body>
59+
<div id="app">
60+
<div class="p-preloader">
61+
<div class="p-preloader__wrap">
62+
<div class="p-preloader__icon">
63+
<svg
64+
t="1644157294581"
65+
class="icon"
66+
viewBox="0 0 1024 1024"
67+
version="1.1"
68+
xmlns="http://www.w3.org/2000/svg"
69+
p-id="2168"
70+
width="128"
71+
height="128"
72+
>
73+
<path
74+
d="M799.301818 1002.705455H222.254545a122.298182 122.298182 0 0 1-122.181818-122.181819V455.330909a29.090909 29.090909 0 0 1 58.181818 0v425.192727a64.116364 64.116364 0 0 0 64 64h577.047273a64.116364 64.116364 0 0 0 64-64V455.330909a29.090909 29.090909 0 0 1 58.181818 0v425.192727a122.298182 122.298182 0 0 1-122.181818 122.181819z"
75+
fill="currentColor"
76+
p-id="2169"
77+
></path>
78+
<path
79+
d="M976.174545 465.454545h-930.90909a29.090909 29.090909 0 0 1-27.578182-38.283636l128-384A29.090909 29.090909 0 0 1 173.265455 23.272727h674.90909a29.090909 29.090909 0 0 1 27.578182 19.898182l128 384A29.090909 29.090909 0 0 1 976.174545 465.454545zM85.643636 407.272727h850.152728L827.229091 81.454545h-633.018182z"
80+
fill="currentColor"
81+
p-id="2170"
82+
></path>
83+
<path
84+
d="M276.014545 743.447273A29.090909 29.090909 0 0 1 256 693.643636l90.996364-89.949091a29.090909 29.090909 0 1 1 40.96 41.425455l-90.996364 89.949091a28.974545 28.974545 0 0 1-20.945455 8.378182zM354.443636 829.556364A29.090909 29.090909 0 0 1 334.08 779.636364l181.992727-179.898182a29.090909 29.090909 0 0 1 40.843637 41.425454L374.923636 821.178182a28.974545 28.974545 0 0 1-20.48 8.378182z"
85+
fill="currentColor"
86+
p-id="2171"
87+
></path>
88+
</svg>
89+
</div>
90+
<div class="p-preloader__label">加载中...</div>
91+
</div>
92+
</div>
93+
</div>
94+
<script type="module" src="/src/main.ts"></script>
95+
<!-- built files will be auto injected -->
96+
</body>
97+
</html>

0 commit comments

Comments
 (0)