├── static
└── .gitkeep
├── src
├── assets
│ ├── logo.png
│ ├── img
│ │ ├── p1.png
│ │ ├── p2.png
│ │ ├── p3.png
│ │ ├── ui.png
│ │ ├── icon01.png
│ │ ├── icon02.png
│ │ ├── icon03.png
│ │ ├── icon04.png
│ │ ├── icon1.png
│ │ ├── icon2.png
│ │ ├── icon3.png
│ │ ├── icon4.png
│ │ ├── img01.png
│ │ ├── goods
│ │ │ ├── 1.jpg
│ │ │ ├── 1.png
│ │ │ ├── 2.jpg
│ │ │ ├── 2.png
│ │ │ ├── 3.jpg
│ │ │ ├── 3.png
│ │ │ ├── 4.jpg
│ │ │ ├── 4.png
│ │ │ ├── b1.jpg
│ │ │ ├── b1.png
│ │ │ ├── b2.png
│ │ │ ├── s1.jpg
│ │ │ ├── ss1.jpg
│ │ │ ├── ss2.jpg
│ │ │ ├── ss3.jpg
│ │ │ ├── ss4.jpg
│ │ │ └── ss5.jpg
│ │ ├── cart-empty.png
│ │ ├── cart-updown.jpg
│ │ ├── checkbox-bg.png
│ │ ├── global-logo.png
│ │ ├── user-avatar.png
│ │ ├── account-icon.png
│ │ ├── btn-icon-new.png
│ │ ├── cart-box-empty.png
│ │ ├── checkbox-new.png
│ │ ├── cart-updown-item.png
│ │ ├── delete-btn-icon.jpg
│ │ └── account-bottom-bar-bg.png
│ └── css
│ │ ├── reset.css
│ │ └── header.css
├── App.vue
├── main.js
├── router
│ └── index.js
├── components
│ ├── phone.vue
│ ├── head.vue
│ ├── car-panel.vue
│ ├── shop-item.vue
│ ├── home.vue
│ ├── item.vue
│ ├── address-pop.vue
│ ├── car.vue
│ └── checkout.vue
└── store
│ └── index.js
├── config
├── prod.env.js
├── dev.env.js
└── index.js
├── .editorconfig
├── .gitignore
├── .babelrc
├── .postcssrc.js
├── index.html
├── README.md
├── package.json
└── data.json
/static/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/logo.png
--------------------------------------------------------------------------------
/config/prod.env.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | module.exports = {
3 | NODE_ENV: '"production"'
4 | }
5 |
--------------------------------------------------------------------------------
/src/assets/img/p1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/p1.png
--------------------------------------------------------------------------------
/src/assets/img/p2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/p2.png
--------------------------------------------------------------------------------
/src/assets/img/p3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/p3.png
--------------------------------------------------------------------------------
/src/assets/img/ui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/ui.png
--------------------------------------------------------------------------------
/src/assets/img/icon01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/icon01.png
--------------------------------------------------------------------------------
/src/assets/img/icon02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/icon02.png
--------------------------------------------------------------------------------
/src/assets/img/icon03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/icon03.png
--------------------------------------------------------------------------------
/src/assets/img/icon04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/icon04.png
--------------------------------------------------------------------------------
/src/assets/img/icon1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/icon1.png
--------------------------------------------------------------------------------
/src/assets/img/icon2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/icon2.png
--------------------------------------------------------------------------------
/src/assets/img/icon3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/icon3.png
--------------------------------------------------------------------------------
/src/assets/img/icon4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/icon4.png
--------------------------------------------------------------------------------
/src/assets/img/img01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/img01.png
--------------------------------------------------------------------------------
/src/assets/img/goods/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/goods/1.jpg
--------------------------------------------------------------------------------
/src/assets/img/goods/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/goods/1.png
--------------------------------------------------------------------------------
/src/assets/img/goods/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/goods/2.jpg
--------------------------------------------------------------------------------
/src/assets/img/goods/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/goods/2.png
--------------------------------------------------------------------------------
/src/assets/img/goods/3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/goods/3.jpg
--------------------------------------------------------------------------------
/src/assets/img/goods/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/goods/3.png
--------------------------------------------------------------------------------
/src/assets/img/goods/4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/goods/4.jpg
--------------------------------------------------------------------------------
/src/assets/img/goods/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/goods/4.png
--------------------------------------------------------------------------------
/src/assets/img/goods/b1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/goods/b1.jpg
--------------------------------------------------------------------------------
/src/assets/img/goods/b1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/goods/b1.png
--------------------------------------------------------------------------------
/src/assets/img/goods/b2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/goods/b2.png
--------------------------------------------------------------------------------
/src/assets/img/goods/s1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/goods/s1.jpg
--------------------------------------------------------------------------------
/src/assets/img/goods/ss1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/goods/ss1.jpg
--------------------------------------------------------------------------------
/src/assets/img/goods/ss2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/goods/ss2.jpg
--------------------------------------------------------------------------------
/src/assets/img/goods/ss3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/goods/ss3.jpg
--------------------------------------------------------------------------------
/src/assets/img/goods/ss4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/goods/ss4.jpg
--------------------------------------------------------------------------------
/src/assets/img/goods/ss5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/goods/ss5.jpg
--------------------------------------------------------------------------------
/src/assets/img/cart-empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/cart-empty.png
--------------------------------------------------------------------------------
/src/assets/img/cart-updown.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/cart-updown.jpg
--------------------------------------------------------------------------------
/src/assets/img/checkbox-bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/checkbox-bg.png
--------------------------------------------------------------------------------
/src/assets/img/global-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/global-logo.png
--------------------------------------------------------------------------------
/src/assets/img/user-avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/user-avatar.png
--------------------------------------------------------------------------------
/src/assets/img/account-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/account-icon.png
--------------------------------------------------------------------------------
/src/assets/img/btn-icon-new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/btn-icon-new.png
--------------------------------------------------------------------------------
/src/assets/img/cart-box-empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/cart-box-empty.png
--------------------------------------------------------------------------------
/src/assets/img/checkbox-new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/checkbox-new.png
--------------------------------------------------------------------------------
/src/assets/img/cart-updown-item.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/cart-updown-item.png
--------------------------------------------------------------------------------
/src/assets/img/delete-btn-icon.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/delete-btn-icon.jpg
--------------------------------------------------------------------------------
/src/assets/img/account-bottom-bar-bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TJLHQ/shangcheng/HEAD/src/assets/img/account-bottom-bar-bg.png
--------------------------------------------------------------------------------
/config/dev.env.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const merge = require('webpack-merge')
3 | const prodEnv = require('./prod.env')
4 |
5 | module.exports = merge(prodEnv, {
6 | NODE_ENV: '"development"'
7 | })
8 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | /dist/
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Editor directories and files
9 | .idea
10 | .vscode
11 | *.suo
12 | *.ntvs*
13 | *.njsproj
14 | *.sln
15 |
--------------------------------------------------------------------------------
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | ["env", {
4 | "modules": false,
5 | "targets": {
6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7 | }
8 | }],
9 | "stage-2"
10 | ],
11 | "plugins": ["transform-vue-jsx", "transform-runtime"]
12 | }
13 |
--------------------------------------------------------------------------------
/.postcssrc.js:
--------------------------------------------------------------------------------
1 | // https://github.com/michael-ciniawsky/postcss-load-config
2 |
3 | module.exports = {
4 | "plugins": {
5 | "postcss-import": {},
6 | "postcss-url": {},
7 | // to edit target browsers: use "browserslist" field in package.json
8 | "autoprefixer": {}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | shangcheng
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
19 |
20 |
23 |
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | // The Vue build version to load with the `import` command
2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
3 | import Vue from 'vue'
4 | import App from './App'
5 | import router from './router'
6 | import axios from 'axios'
7 | import store from './store'
8 | import './assets/css/header.css'
9 | import './assets/css/reset.css'
10 | Vue.prototype.$http=axios
11 |
12 | Vue.config.productionTip = false
13 |
14 | /* eslint-disable no-new */
15 | new Vue({
16 | el: '#app',
17 | router,
18 | store,
19 | components: { App },
20 | template: ''
21 | })
22 |
--------------------------------------------------------------------------------
/src/router/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Router from 'vue-router'
3 | import Home from '@/components/home'
4 | import Item from '@/components/item'
5 | import Checkout from '@/components/checkout'
6 | import Cart from '@/components/car'
7 | Vue.use(Router)
8 | export default new Router({
9 | mode:'history',
10 | routes: [
11 | {
12 | path: '/',
13 | name: 'Home',
14 | component: Home,
15 | },
16 | {
17 | path: '/home',
18 | name: 'Home',
19 | component: Home,
20 | },
21 | {
22 | path: '/item',
23 | name: 'Item',
24 | component: Item
25 | },
26 | {
27 | path: '/checkout',
28 | name: 'Checkout',
29 | component: Checkout
30 | },
31 | {
32 | path: '/cart',
33 | name: 'Cart',
34 | component: Cart
35 | },
36 | ]
37 | })
38 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # shangcheng
2 |
3 | > A Vue.js project
4 |
5 | ## Build Setup
6 |
7 | ``` bash
8 | # install dependencies
9 | npm install
10 |
11 | # serve with hot reload at localhost:8080
12 | npm run dev
13 |
14 | # build for production with minification
15 | npm run build
16 |
17 | # build for production and view the bundle analyzer report
18 | npm run build --report
19 | ```
20 |
21 | For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
22 |
23 | ## 项目已部署,在线Demo
24 | 访问地址 http://sc.mmys.fun/home 用户名:小明 密码:123456
25 | ## 所用前端技术
26 | Vue 2.x
27 | Vuex
28 | Vue Router
29 | Element UI
30 | ES6
31 | webpack
32 | axios
33 | ## 所用后端技术
34 | Koa2
35 | MongoDB
36 | Koa-router
37 | jwt(token验证)
38 | ## 服务端部署技术
39 | nginx
40 | pm2
41 | ## 技术交流群(有什么不懂的地方可以加群交流)
42 | QQ交流群:600424241
43 |
44 | http://cdn.mmys.fun/qzjs.png
45 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "shangcheng",
3 | "version": "1.0.0",
4 | "description": "A Vue.js project",
5 | "author": "tianjie ",
6 | "private": true,
7 | "scripts": {
8 | "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
9 | "start": "npm run dev",
10 | "build": "node build/build.js"
11 | },
12 | "dependencies": {
13 | "axios": "^0.18.0",
14 | "vue": "^2.5.2",
15 | "vue-router": "^3.0.1",
16 | "vuex": "^3.0.1"
17 | },
18 | "devDependencies": {
19 | "autoprefixer": "^7.1.2",
20 | "babel-core": "^6.22.1",
21 | "babel-helper-vue-jsx-merge-props": "^2.0.3",
22 | "babel-loader": "^7.1.1",
23 | "babel-plugin-syntax-jsx": "^6.18.0",
24 | "babel-plugin-transform-runtime": "^6.22.0",
25 | "babel-plugin-transform-vue-jsx": "^3.5.0",
26 | "babel-preset-env": "^1.3.2",
27 | "babel-preset-stage-2": "^6.22.0",
28 | "chalk": "^2.0.1",
29 | "copy-webpack-plugin": "^4.0.1",
30 | "css-loader": "^0.28.0",
31 | "extract-text-webpack-plugin": "^3.0.0",
32 | "file-loader": "^1.1.4",
33 | "friendly-errors-webpack-plugin": "^1.6.1",
34 | "html-webpack-plugin": "^2.30.1",
35 | "node-notifier": "^5.1.2",
36 | "optimize-css-assets-webpack-plugin": "^3.2.0",
37 | "ora": "^1.2.0",
38 | "portfinder": "^1.0.13",
39 | "postcss-import": "^11.0.0",
40 | "postcss-loader": "^2.0.8",
41 | "postcss-url": "^7.2.1",
42 | "rimraf": "^2.6.0",
43 | "semver": "^5.3.0",
44 | "shelljs": "^0.7.6",
45 | "uglifyjs-webpack-plugin": "^1.1.1",
46 | "url-loader": "^0.5.8",
47 | "vue-loader": "^13.3.0",
48 | "vue-style-loader": "^3.0.1",
49 | "vue-template-compiler": "^2.5.2",
50 | "webpack": "^3.6.0",
51 | "webpack-bundle-analyzer": "^2.9.0",
52 | "webpack-dev-server": "^2.9.1",
53 | "webpack-merge": "^4.1.0"
54 | },
55 | "engines": {
56 | "node": ">= 6.0.0",
57 | "npm": ">= 3.0.0"
58 | },
59 | "browserslist": [
60 | "> 1%",
61 | "last 2 versions",
62 | "not ie <= 8"
63 | ]
64 | }
65 |
--------------------------------------------------------------------------------
/config/index.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | // Template version: 1.3.1
3 | // see http://vuejs-templates.github.io/webpack for documentation.
4 |
5 | const path = require('path')
6 |
7 | module.exports = {
8 | dev: {
9 |
10 | // Paths
11 | assetsSubDirectory: 'static',
12 | assetsPublicPath: '/',
13 | proxyTable: {},
14 |
15 | // Various Dev Server settings
16 | host: 'localhost', // can be overwritten by process.env.HOST
17 | port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
18 | autoOpenBrowser: false,
19 | errorOverlay: true,
20 | notifyOnErrors: true,
21 | poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
22 |
23 |
24 | /**
25 | * Source Maps
26 | */
27 |
28 | // https://webpack.js.org/configuration/devtool/#development
29 | devtool: 'cheap-module-eval-source-map',
30 |
31 | // If you have problems debugging vue-files in devtools,
32 | // set this to false - it *may* help
33 | // https://vue-loader.vuejs.org/en/options.html#cachebusting
34 | cacheBusting: true,
35 |
36 | cssSourceMap: true
37 | },
38 |
39 | build: {
40 | // Template for index.html
41 | index: path.resolve(__dirname, '../dist/index.html'),
42 |
43 | // Paths
44 | assetsRoot: path.resolve(__dirname, '../dist'),
45 | assetsSubDirectory: 'static',
46 | assetsPublicPath: '/',
47 |
48 | /**
49 | * Source Maps
50 | */
51 |
52 | productionSourceMap: true,
53 | // https://webpack.js.org/configuration/devtool/#production
54 | devtool: '#source-map',
55 |
56 | // Gzip off by default as many popular static hosts such as
57 | // Surge or Netlify already gzip all static assets for you.
58 | // Before setting to `true`, make sure to:
59 | // npm install --save-dev compression-webpack-plugin
60 | productionGzip: false,
61 | productionGzipExtensions: ['js', 'css'],
62 |
63 | // Run the build command with an extra argument to
64 | // View the bundle analyzer report after build finishes:
65 | // `npm run build --report`
66 | // Set to `true` or `false` to always turn it on or off
67 | bundleAnalyzerReport: process.env.npm_config_report
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/src/assets/css/reset.css:
--------------------------------------------------------------------------------
1 | @charset "utf-8";
2 | /* CSS Document */
3 | /*html,body { user-select: none; -moz-user-select: none; -webkit-user-select: none; }*/
4 | body,
5 | ul,
6 | ol,
7 | dl,
8 | dd,
9 | h1,
10 | h2,
11 | h3,
12 | h4,
13 | h5,
14 | h6,
15 | p,
16 | input,
17 | select,
18 | textarea,
19 | form {
20 | margin: 0;
21 | padding: 0;
22 | }
23 | h1,
24 | h2,
25 | h3,
26 | h4,
27 | h5,
28 | h6 {
29 | font-size: 100%;
30 | font-weight: 400;
31 | }
32 | html {
33 | height: 100%;
34 | background: #ededed;
35 | }
36 | body {
37 | font-family: "PingFang SC", "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", "Microsoft Yahei", 微软雅黑, STHeiti, 华文细黑, sans-serif;
38 | color: rgb(102, 102, 102);
39 | font-size: 14px;
40 | min-width: 1220px;
41 | }
42 | li {
43 | list-style: none;
44 | }
45 | img {
46 | border: none;
47 | display: block;
48 | }
49 | input,
50 | select,
51 | textarea,
52 | button {
53 | font-family: tahoma, arial, 'Hiragino Sans GB', '微软雅黑', sans-serif;
54 | outline: none;
55 | border: none;
56 | background-color: transparent;
57 | }
58 | em,
59 | i,
60 | dfn {
61 | font-style: normal;
62 | }
63 | textarea {
64 | resize: none;
65 | overflow: auto;
66 | outline: none;
67 | }
68 | a {
69 | text-decoration: none;
70 | color: #666;
71 | outline: none;
72 | cursor: pointer;
73 | }
74 | a:hover {
75 | outline: none;
76 | }
77 | button {
78 | cursor: pointer;
79 | }
80 | button:focus {
81 | border: none;
82 | outline: none;
83 | }
84 | pre {
85 | white-space: pre-wrap!important;
86 | word-wrap: break-word!important;
87 | *white-space:normal!important;
88 | }
89 | .fl {
90 | float: left;
91 | }
92 | .fr {
93 | float: right;
94 | }
95 | .clear:after,
96 | .clear:before {
97 | content: "";
98 | display: table;
99 | }
100 | .clear:after {
101 | clear: both;
102 | }
103 | .clear {
104 | *zoom: 1;
105 | }
106 | .store-content{
107 | width: 1220px;
108 | padding: 0 0 25px;
109 | margin: 0 auto;
110 | position: relative;
111 | }
112 | .hide{
113 | display: none!important;
114 | }
115 | .fn-left, .fn-right{
116 | display: inline;
117 | }
118 | .fn-left{
119 | float: left;
120 | }
121 | .fn-right{
122 | float: right;
123 | }
--------------------------------------------------------------------------------
/src/components/phone.vue:
--------------------------------------------------------------------------------
1 |
2 |
29 |
30 |
31 |
46 |
47 |
82 |
--------------------------------------------------------------------------------
/src/components/head.vue:
--------------------------------------------------------------------------------
1 |
2 |
61 |
62 |
90 |
91 |
--------------------------------------------------------------------------------
/src/components/car-panel.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | 购物车
4 |
5 |
6 | {{total}}
7 |
8 |
9 |
10 |
11 |
购物车为空
12 |
您还没有选购任何商品,现在前往商城选购吧!
13 |
14 |
15 |
16 |
17 | -
18 |
19 |
20 |
21 |
![]()
22 |
23 |
24 |
25 |
28 |
29 | {{item.spec_json.show_name}}
30 |
31 |
32 | ¥{{item.price}}x{{item.count}}
33 |
34 |
35 |
36 |
删除
37 |
38 |
39 |
40 |
41 |
42 |
43 |
共 {{total}} 件商品
44 |
合计:¥{{price}}
45 |
46 | 去购物车
47 |
48 |
49 |
50 |
51 |
52 |
58 |
59 |
![]()
60 |
61 |
62 |
63 |
64 |
117 |
126 |
--------------------------------------------------------------------------------
/src/components/shop-item.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
![]()
5 |
6 |
{{item.name}}
7 |
{{item.name_title}}
8 |
17 |
18 |
19 | 查看详情
20 |
21 | 加入购物车
22 |
23 |
24 | ¥{{item.price}}
25 |
26 |
false
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
57 |
58 |
214 |
--------------------------------------------------------------------------------
/src/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Vuex from 'vuex'
3 | import axios from 'axios'
4 | Vue.use(Vuex);
5 | let store= new Vuex.Store({
6 | state:{
7 | carPanelData:[],
8 | orderBy:{},
9 | goods:[],
10 | ball:{
11 | el:null,
12 | show:false,
13 | img:''
14 | },
15 | showCar:false,
16 | maxOff:false,
17 | receiveInfo: [
18 | {
19 | 'name': '王某某',
20 | 'phone': '13811111111',
21 | 'areaCode': '010',
22 | 'landLine': '64627856',
23 | 'provinceId': 110000,
24 | 'province': '北京市',
25 | 'cityId': 110100,
26 | 'city': '市辖区',
27 | 'countyId': 110106,
28 | 'county': '海淀区',
29 | 'add': '上地十街辉煌国际西6号楼319室',
30 | 'default': true,
31 | 'checked':true
32 | },
33 | {
34 | 'name': '李某某',
35 | 'phone': '13811111111',
36 | 'areaCode': '010',
37 | 'landLine': '64627856',
38 | 'provinceId': 110000,
39 | 'province': '北京市',
40 | 'cityId': 110100,
41 | 'city': '市辖区',
42 | 'countyId': 110106,
43 | 'county': '海淀区',
44 | 'add': '上地十街辉煌国际东6号楼350室',
45 | 'default': false,
46 | 'checked':false
47 | }],
48 | orderData:[],
49 | checkGoods:[]
50 | },
51 | actions:{
52 | init({commit}){
53 | axios.get('/api/itemsData').then(res=>{
54 | if(res.data.erron==0){
55 | commit('good',res.data.data)
56 | }
57 | })
58 | }
59 | },
60 | mutations:{
61 | good(state,data){
62 | state.goods=data
63 | },
64 | add(state,data){
65 | let boo=true;
66 | state.carPanelData.forEach(item=>{
67 | if(item.sku_id==data[0].sku_id){
68 | item.count+=data[1]
69 | if(item.count>item.limit_num){
70 | state.maxOff=true;
71 | item.count=item.limit_num
72 | boo=false
73 | return
74 | }
75 | state.showCar=true;
76 | state.ball.el=event.path[0];
77 | state.ball.show=true;
78 | state.ball.img=data[0].ali_image
79 | boo=false
80 | }
81 | })
82 | if(boo){
83 | let goods=data[0]
84 | Vue.set(goods,'count',data[1]);
85 | Vue.set(goods,'checked',true);
86 | state.carPanelData.push(goods)
87 | state.showCar=true;
88 | state.ball.el=event.path[0];
89 | state.ball.show=true;
90 | state.ball.img=data[0].ali_image
91 | }
92 | },
93 | dele(state,id){
94 | state.carPanelData.forEach((item,index)=>{
95 | if(item.sku_id==id){
96 | state.carPanelData.splice(index,1)
97 | }
98 | })
99 | },
100 | carShow(state){
101 | state.showCar=true
102 | },
103 | carHide(state){
104 | state.showCar=false;
105 | },
106 | orderBy(state,data){
107 | state.orderBy=data
108 | },
109 | submitReceive (state,data) {
110 | if(data[0].default){
111 | state.receiveInfo.forEach((receive,index) => {
112 | receive.default = false
113 | receive.checked = false
114 | })
115 | }
116 | if(data[1]==null){
117 | state.receiveInfo.push(data[0])
118 | }else{
119 | console.log(data[0])
120 | state.receiveInfo[data[1]] = data[0]
121 | }
122 | },
123 | submitOrder(state,data){
124 | let i=state.carPanelData.length;
125 | while(i--){
126 | state.carPanelData.forEach((item,index)=>{
127 | if(item.checked){
128 | state.carPanelData.splice(index,1)
129 | }
130 | })
131 | }
132 | state.orderData.unshift(data);
133 | state.receiveInfo.forEach((receive) => {
134 | receive.checked = receive.default
135 | })
136 | },
137 | addClick(state,id){
138 | state.carPanelData.forEach(item=>{
139 | if(item.sku_id==id){
140 | if(item.count>=item.limit_num) return
141 | item.count++
142 | }
143 | })
144 | },
145 | defauClick(state,id){
146 | state.carPanelData.forEach(item=>{
147 | if(item.sku_id==id){
148 | if(item.count==1) return
149 | item.count--
150 | }
151 | })
152 | },
153 | allCheck(state,isChecked){
154 | state.carPanelData.forEach(item=>{
155 | if(isChecked){
156 | item.checked=false
157 | }else{
158 | item.checked=true
159 | }
160 | })
161 | },
162 | onlyCheck(state,id){
163 | state.carPanelData.forEach(item=>{
164 | if(item.sku_id==id){
165 | item.checked=!item.checked
166 | }
167 | })
168 | },
169 | checkGoods(state){
170 | state.carPanelData.forEach((item,index)=>{
171 | if(item.checked){
172 | state.checkGoods.push(item)
173 | }
174 | })
175 | },
176 | allDele(state){
177 | let i=state.carPanelData.length;
178 | while(i--){
179 | if(state.carPanelData[i].checked){
180 | state.carPanelData.splice(i,1)
181 | }
182 | }
183 | }
184 | },
185 | getters:{
186 | totalCount(state){
187 | let total=0;
188 | state.carPanelData.forEach(item=>{
189 | total+=item.count
190 | })
191 | return total
192 | },
193 | checkCount(state){
194 | let count=0;
195 | state.carPanelData.forEach(item=>{
196 | if(item.checked){
197 | count+=item.count
198 | }
199 | })
200 | return count
201 | },
202 | checkPrice(state){
203 | let price=0;
204 | state.carPanelData.forEach(item=>{
205 | if(item.checked){
206 | price+=item.count*item.price
207 | }
208 | })
209 | return price
210 | },
211 | priceCount(state){
212 | let total=0;
213 | state.carPanelData.forEach(item=>{
214 | total+=item.count*item.price
215 | })
216 | return total
217 | },
218 | isChecked(state){
219 | let checked=true;
220 | state.carPanelData.forEach(item=>{
221 | if(!item.checked){
222 | checked=false
223 | }
224 | })
225 | return checked
226 | }
227 | }
228 |
229 | })
230 | export default store
231 |
--------------------------------------------------------------------------------
/src/components/home.vue:
--------------------------------------------------------------------------------
1 |
2 |
22 |
23 |
24 |
50 |
274 |
--------------------------------------------------------------------------------
/src/components/item.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | -
10 |
11 |
12 |
13 |
14 |
15 |
16 | ![]()
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | ¥{{goods.price}}
25 |
26 |
27 |
{{goods.title}}
28 | {{goods.sub_title}}
29 |
30 |
31 |
32 |
33 |
颜色
34 |
35 | -
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
数量
46 |
47 |
48 | -
49 | {{count}}
50 | +
51 |
52 |
53 |
54 |
55 |
61 |
62 |
63 |
64 |
65 |
66 |
129 |
428 |
--------------------------------------------------------------------------------
/src/assets/css/header.css:
--------------------------------------------------------------------------------
1 | .nav-global {
2 | height: 100px;
3 | background-color: #000;
4 | }
5 |
6 | .container {
7 | height: 100%;
8 | width: 1220px;
9 | margin: 0 auto;
10 | }
11 |
12 |
13 | /*logo*/
14 |
15 | .nav-logo {
16 | float: left;
17 | padding-top: 25px;
18 | }
19 |
20 | .nav-logo a {
21 | display: inline-block;
22 | width: 50px;
23 | height: 50px;
24 | background: url(../img/global-logo.png) no-repeat;
25 | background-size: cover;
26 | }
27 |
28 |
29 | /*导航*/
30 |
31 | .nav-global .nav-list {
32 | float: right;
33 | line-height: 28px;
34 | margin: 36px 23px 0 0;
35 | }
36 |
37 | .nav-global .nav-list li {
38 | float: left;
39 | }
40 |
41 | .nav-global .nav-list a {
42 | color: #c8c8c8;
43 | display: inline-block;
44 | font-size: 14px;
45 | padding: 0 25px;
46 | }
47 |
48 | .nav-global .nav-list a:hover {
49 | color: #fff;
50 | }
51 |
52 | .nav-aside {
53 | box-sizing: border-box;
54 | float: right;
55 | margin-top: 38px;
56 | border-left: 1px solid rgba(255, 255, 255, .2);
57 | }
58 |
59 | .nav-aside>li {
60 | position: relative;
61 | float: left;
62 | }
63 |
64 | .nav-aside>li>a {
65 | font-size: 0;
66 | }
67 |
68 |
69 | /*用户列表*/
70 |
71 | .nav-user {
72 | margin-left: 40px;
73 | width: 36px;
74 | }
75 |
76 | .nav-user>a:before {
77 | content: " ";
78 | position: absolute;
79 | left: 8px;
80 | width: 20px;
81 | top: 0;
82 | height: 20px;
83 | background: url(../img/account-icon.png) -155px 0;
84 | background-size: 240px 107px;
85 | transition: none;
86 | }
87 |
88 | .nav-user:hover>a:before {
89 | background-position: -5px 0;
90 | }
91 |
92 | .nav-user-wrapper {
93 | position: absolute;
94 | z-index: 30;
95 | padding-top: 18px;
96 | opacity: 0;
97 | visibility: hidden;
98 | top: -3000px;
99 | width: 168px;
100 | left: 50%;
101 | margin-left: -70px;
102 | }
103 |
104 | .nav-user:hover .nav-user-wrapper {
105 | top: 18px;
106 | visibility: visible;
107 | opacity: 1;
108 | transition: opacity .15s ease-out;
109 | }
110 |
111 | .nav-user-list {
112 | position: relative;
113 | width: 168px;
114 | padding-top: 20px;
115 | background: #fff;
116 | border: 1px solid #d6d6d6;
117 | border-color: rgba(0, 0, 0, .08);
118 | border-radius: 8px;
119 | box-shadow: 0 20px 40px rgba(0, 0, 0, .15)
120 | }
121 |
122 | .nav-user-list:before {
123 | position: absolute;
124 | content: " ";
125 | background: url(../img/account-icon.png) no-repeat -49px -43px;
126 | background-size: 240px 107px;
127 | width: 20px;
128 | height: 8px;
129 | left: 50%;
130 | top: -8px;
131 | margin-left: -25px;
132 | }
133 |
134 | .nav-user-avatar>dd {
135 | display: block;
136 | position: relative;
137 | margin: 0 auto;
138 | width: 46px;
139 | height: 46px;
140 | margin-bottom: 8px;
141 | }
142 |
143 | .nav-user-avatar>dd:before {
144 | content: "";
145 | position: absolute;
146 | left: 0;
147 | right: 0;
148 | top: 0;
149 | bottom: 0;
150 | border-radius: 50%;
151 | box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
152 | }
153 |
154 | .nav-user-avatar span {
155 | border-radius: 50%;
156 | display: block;
157 | width: 100%;
158 | height: 100%;
159 | background: url(../img/user-avatar.png) no-repeat;
160 | background-size: contain;
161 | }
162 |
163 | .nav-user-avatar dt {
164 | margin-bottom: 16px;
165 | font-size: 12px;
166 | line-height: 1.5;
167 | text-align: center;
168 | color: #757575;
169 | }
170 |
171 | .nav-user-list li a {
172 | position: relative;
173 | border-top: 1px solid #f5f5f5;
174 | display: block;
175 | padding-left: 54px;
176 | line-height: 44px;
177 | height: 44px;
178 | color: #616161;
179 | font-size: 12px;
180 | }
181 |
182 | .nav-user-list li a:hover {
183 | background-color: #fafafa;
184 | }
185 |
186 | .nav-user-list li a:before {
187 | background: url(../img/account-icon.png) no-repeat;
188 | background-size: 240px 107px;
189 | content: ' ';
190 | display: block;
191 | position: absolute;
192 | left: 22px;
193 | top: 50%;
194 | width: 20px;
195 | height: 20px;
196 | margin-top: -8px;
197 | }
198 |
199 | .nav-user-list li.order a:before {
200 | background-position: 0 -44px;
201 | }
202 |
203 | .nav-user-list li.support a:before {
204 | background-position: -20px -44px;
205 | }
206 |
207 | .nav-user-list li.coupon a:before {
208 | background-position: -20px -84px;
209 | }
210 |
211 | .nav-user-list li.information a:before {
212 | background-position: 0 -64px;
213 | }
214 |
215 | .nav-user-list li.address a:before {
216 | background-position: -20px -64px;
217 | }
218 |
219 | .nav-user-list li.logout a:before {
220 | background-position: 0 -84px;
221 | }
222 |
223 |
224 | /*购物车*/
225 |
226 | .nav-cart {
227 | margin-left: 21px;
228 | width: 61px;
229 | }
230 |
231 | .nav-cart>a {
232 | display: block;
233 | position: absolute;
234 | left: 0;
235 | right: 0;
236 | top: 0;
237 | bottom: 0;
238 | z-index: 1;
239 | }
240 |
241 | .nav-cart>a:before {
242 | content: ' ';
243 | position: absolute;
244 | left: 0;
245 | top: 0;
246 | bottom: 0;
247 | width: 30px;
248 | height: 20px;
249 | background: url(../img/account-icon.png) -150px -22px;
250 | background-size: 240px 107px;
251 | }
252 |
253 | .nav-cart:hover>a:before {
254 | background-position: 0 -22px;
255 | }
256 |
257 | .cart-empty-num {
258 | position: relative;
259 | margin-left: 31px;
260 | margin-top: -1px;
261 | min-width: 30px;
262 | text-indent: 0;
263 | line-height: 20px;
264 | }
265 |
266 | .cart-empty-num i {
267 | font-style: normal;
268 | display: inline-block;
269 | width: 20px;
270 | height: 20px;
271 | line-height: 20px;
272 | border-radius: 10px;
273 | color: #fff;
274 | font-size: 12px;
275 | text-align: center;
276 | background: #969696;
277 | background-image: linear-gradient(#A4A4A4, #909090);
278 | box-shadow: inset 0 0 1px #838383, 0 1px 2px #838383;
279 | }
280 |
281 | .cart-num i {
282 | background: #eb746b;
283 | background-image: linear-gradient(#eb746b, #e25147);
284 | box-shadow: inset 0 0 1px rgba(255, 255, 255, .15), 0 1px 2px rgba(255, 255, 255, .15);
285 | }
286 |
287 | .nav-cart-wrapper {
288 | position: absolute;
289 | right: 0;
290 | padding-top: 18px;
291 | top: 22px;
292 | z-index: 30;
293 | width: 360px;
294 | }
295 |
296 | .nav-cart-wrapper:before {
297 | position: absolute;
298 | content: ' ';
299 | background: url(../img/account-icon.png) no-repeat -49px -43px;
300 | -webkit-background-size: 240px 107px;
301 | background-size: 240px 107px;
302 | width: 20px;
303 | height: 8px;
304 | right: 34px;
305 | top: 10px;
306 | z-index: 11;
307 | }
308 |
309 | .nav-cart.active .nav-cart-wrapper {
310 | display: block;
311 | top: 18px;
312 | opacity: 1;
313 | visibility: visible;
314 | }
315 |
316 | .nav-cart-list {
317 | position: relative;
318 | z-index: 10;
319 | background: #fff;
320 | border: 0 solid rgba(255, 255, 255, .01);
321 | border-radius: 8px;
322 | box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 20px 40px rgba(0, 0, 0, .15);
323 | overflow: hidden;
324 | }
325 |
326 | .nav-cart-list .empty {
327 | overflow: hidden;
328 | height: 134px;
329 | padding-top: 180px;
330 | background: url(../img/cart-empty.png) center 90px no-repeat;
331 | background-size: auto 62px;
332 | text-align: center;
333 | }
334 |
335 | .nav-cart-list .empty h3 {
336 | font-size: 18px;
337 | color: #333;
338 | margin-bottom: 7px;
339 | }
340 |
341 | .nav-cart-list .empty p {
342 | font-size: 12px;
343 | color: #bcbcbc;
344 | }
345 |
346 | .nav-cart-list .full {
347 | border-radius: 8px;
348 | overflow: hidden;
349 | }
350 |
351 | .nav-cart-list .nav-cart-items {
352 | max-height: 665px;
353 | overflow-x: hidden;
354 | overflow-y: auto;
355 | }
356 |
357 | .nav-cart-list .cart-item {
358 | height: 120px;
359 | width: 100%;
360 | overflow: hidden;
361 | border-top: 1px solid #f0f0f0;
362 | }
363 |
364 | .nav-cart-list .cart-item:first-child {
365 | border-top: none;
366 | border-radius: 8px 8px 0 0;
367 | overflow: hidden;
368 | }
369 |
370 | .nav-cart-list .cart-item-inner {
371 | height: 80px;
372 | padding: 20px;
373 | position: relative;
374 | }
375 |
376 | .nav-cart-list .item-thumb {
377 | position: relative;
378 | float: left;
379 | width: 80px;
380 | height: 80px;
381 | border-radius: 3px;
382 | }
383 |
384 | .nav-cart-list .item-thumb:before {
385 | content: "";
386 | position: absolute;
387 | left: 0;
388 | right: 0;
389 | top: 0;
390 | bottom: 0;
391 | z-index: 2;
392 | border: 1px solid #f0f0f0;
393 | border: 0 solid transparent;
394 | box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
395 | border-radius: 3px;
396 | }
397 |
398 | .nav-cart-list .item-thumb img {
399 | display: block;
400 | width: 80px;
401 | height: 80px;
402 | border-radius: 3px;
403 | overflow: hidden;
404 | }
405 |
406 | .nav-cart-list .item-desc {
407 | margin-left: 98px;
408 | display: table;
409 | width: 205px;
410 | height: 80px;
411 | }
412 |
413 | .nav-cart-list .cart-cell {
414 | display: table-cell;
415 | vertical-align: middle;
416 | }
417 |
418 | .nav-cart-list .item-desc h4,
419 | .nav-cart-list .item-desc h4 a {
420 | color: #000;
421 | }
422 |
423 | .nav-cart-list .item-desc h4 {
424 | width: 185px;
425 | overflow: hidden;
426 | word-break: keep-all;
427 | white-space: nowrap;
428 | text-overflow: ellipsis;
429 | font-size: 14px;
430 | line-height: 16px;
431 | margin-bottom: 10px;
432 | }
433 |
434 | .nav-cart-list .item-desc .attrs {
435 | font-size: 0;
436 | }
437 |
438 | .nav-cart-list .item-desc .attrs span {
439 | position: relative;
440 | /*display: inline-block;*/
441 | margin-right: 20px;
442 | font-size: 14px;
443 | line-height: 14px;
444 | color: #999;
445 | }
446 |
447 | .nav-cart-list .item-desc .attrs span:last-child {
448 | margin-right: 0;
449 | }
450 |
451 | .nav-cart-list .item-desc h6 {
452 | color: #cacaca;
453 | font-size: 12px;
454 | line-height: 14px;
455 | margin-top: 20px;
456 | }
457 |
458 | .nav-cart-list .del-btn {
459 | cursor: pointer;
460 | display: none;
461 | overflow: hidden;
462 | width: 20px;
463 | height: 20px;
464 | position: absolute;
465 | right: 20px;
466 | top: 50%;
467 | margin-top: -11px;
468 | background: url(../img/account-icon.png) -50px -60px no-repeat;
469 | background-size: 240px 107px;
470 | text-indent: -9999em;
471 | }
472 |
473 | .nav-cart-list .cart-item:hover .del-btn {
474 | display: block;
475 | }
476 |
477 | .nav-cart-list .del-btn:hover {
478 | background-position: -75px -60px;
479 | }
480 |
481 | .nav-cart-list .nav-cart-total {
482 | position: relative;
483 | padding: 20px;
484 | height: 40px;
485 | background: #fafafa;
486 | border-top: 1px solid #f0f0f0;
487 | border-radius: 0 0 8px 8px;
488 | box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .5), 0 -3px 8px rgba(0, 0, 0, .04);
489 | background: linear-gradient(#fafafa, #f5f5f5);
490 | }
491 |
492 | .nav-cart-list .nav-cart-total p {
493 | margin-bottom: 4px;
494 | line-height: 16px;
495 | font-size: 12px;
496 | color: #c1c1c1;
497 | }
498 |
499 | .nav-cart-list .nav-cart-total h5 {
500 | line-height: 20px;
501 | font-size: 14px;
502 | color: #6f6f6f;
503 | }
504 |
505 | .nav-cart-list .nav-cart-total h5 span {
506 | font-size: 18px;
507 | color: #de4037;
508 | display: inline-block;
509 | font-weight: 700;
510 | }
511 |
512 | .nav-cart-list .nav-cart-total h5 span:first-child {
513 | font-size: 12px;
514 | margin-right: 5px;
515 | }
516 |
517 | .nav-cart-list .nav-cart-total h5 span {
518 | font-size: 18px;
519 | color: #de4037;
520 | display: inline-block;
521 | font-weight: 700;
522 | }
523 |
524 | .nav-cart-list .nav-cart-total h6 {
525 | position: absolute;
526 | right: 20px;
527 | top: 20px;
528 | width: 108px;
529 | }
530 |
531 | .nav-aside .nav-cart-btn {
532 | display: block;
533 | height: 38px;
534 | background: #688fe8;
535 | background: linear-gradient(#688fe8, #5079e1);
536 | border: 1px solid #5c81e3;
537 | border-radius: 6px;
538 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 3px rgba(0, 0, 0, .2);
539 | line-height: 38px;
540 | text-align: center;
541 | color: #FFF;
542 | text-shadow: 0 -1px 0 rgba(0, 0, 0, .15)
543 | }
544 |
545 |
546 | /*次导航*/
547 |
548 | .nav-sub {
549 | position: relative;
550 | z-index: 20;
551 | height: 90px;
552 | }
553 |
554 | .nav-sub-wrapper {
555 | padding: 31px 0;
556 | height: 28px;
557 | position: relative;
558 | }
559 |
560 | .nav-sub .nav-list {
561 | float: left;
562 | height: 28px;
563 | line-height: 28px;
564 | }
565 |
566 | .nav-sub .nav-list li {
567 | position: relative;
568 | float: left;
569 | padding-left: 2px;
570 | }
571 |
572 | .nav-sub .nav-list li:first-child {
573 | padding-left: 0;
574 | }
575 |
576 | .nav-sub .nav-list li:before {
577 | content: ' ';
578 | position: absolute;
579 | left: 0;
580 | top: 13px;
581 | width: 2px;
582 | height: 2px;
583 | background: #bdbdbd;
584 | }
585 |
586 | .nav-sub .nav-list li:first-child:before {
587 | display: none;
588 | }
589 |
590 | .nav-sub .nav-list li a {
591 | display: block;
592 | padding: 0 20px;
593 | color: #666;
594 | }
595 |
596 | .nav-sub .nav-list li:first-child a {
597 | padding-left: 10px;
598 | }
599 |
600 | .nav-sub .nav-list li.active a {
601 | font-weight: 700;
602 | }
603 |
604 | .nav-sub .nav-list li a:hover {
605 | color: #6b95ea;
606 | }
607 | .nav-global .addcart-mask{
608 | position: absolute;
609 | left: 0;
610 | top: -5px;
611 | padding: 0;
612 | width: 32px;
613 | height: 32px;
614 | pointer-events: none;
615 | z-index: 240;
616 | transform: translate3d(0,0,0);
617 | }
618 | .nav-global .addcart-mask .mask-item{
619 | pointer-events: none;
620 | width: 32px;
621 | height: 32px;
622 | box-sizing: border-box;
623 | overflow: hidden;
624 | border-radius: 50%;
625 | background: #fff;
626 | box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 3px 8px rgba(0,0,0,.1);
627 | background-size: contain;
628 | transform: translate3d(0,0,0);
629 | }
630 |
--------------------------------------------------------------------------------
/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "goodsData" :[
3 | {
4 | "id": 1000271,
5 | "name": "坚果 Pro 软胶保护套",
6 | "name_title": "TPU 环保材质、耐磨、耐油、耐久性强",
7 | "price": 49,
8 | "sku_info": [
9 | {
10 | "sku_id": 100027101,
11 | "title": "坚果 Pro 软胶保护套",
12 | "sub_title": "TPU 环保材质、耐磨、耐油、耐久性强",
13 | "ali_image": "http://image.smartisanos.cn/resource/902befd5f32a8caf4ca79b55d39ee25a.jpg",
14 | "price": 49,
15 | "limit_num": 5,
16 | "spec_json": {
17 | "image": "attr/v2/1000271/948F029DCF134EF23267994487994DA5/",
18 | "show_name": "红色"
19 | }
20 | },
21 | {
22 | "sku_id": 100027102,
23 | "title": "坚果 Pro 软胶保护套",
24 | "sub_title": "TPU 环保材质、耐磨、耐油、耐久性强",
25 | "ali_image": "http://image.smartisanos.cn/resource/554da94d8e4f84f03e0015fd1c997f46.jpg",
26 | "price": 49,
27 | "limit_num": 5,
28 | "spec_json": {
29 | "image": "attr/v2/1000271/649AD35E36A9703BACBE1555AEB6D266/",
30 | "show_name": "黑色"
31 | }
32 | },
33 | {
34 | "sku_id": 100027103,
35 | "title": "坚果 Pro 软胶保护套",
36 | "sub_title": "TPU 环保材质、耐磨、耐油、耐久性强",
37 | "ali_image": "http://image.smartisanos.cn/resource/84b58718b8f8da3c08e0931e19fdc62e.png",
38 | "price": 49,
39 | "limit_num": 5,
40 | "spec_json": {
41 | "image": "attr/v2/1000271/07BAF8C0EF046224A84B593DEEBC869E/",
42 | "show_name": "巧克力色"
43 | }
44 | },
45 | {
46 | "sku_id": 100027104,
47 | "title": "坚果 Pro 软胶保护套",
48 | "sub_title": "TPU 环保材质、耐磨、耐油、耐久性强",
49 | "ali_image": "http://image.smartisanos.cn/resource/b20055215ae3db0f2c8b7ba4db68866f.png",
50 | "price": 49,
51 | "limit_num": 5,
52 | "spec_json": {
53 | "image": "attr/v2/1000271/52317E0C067C97FC6CE9376A2432CFFF/",
54 | "show_name": "浅金色"
55 | }
56 | }]
57 | },
58 | {
59 | "id": 1000299,
60 | "name": "Smartisan 快充移动电源 10000mAh",
61 | "name_title": "10000mAh 双向快充、轻盈便携、高标准安全保护",
62 | "price": 199,
63 | "sku_info": [{
64 | "sku_id": 100029901,
65 | "title": "Smartisan 快充移动电源 10000mAh",
66 | "sub_title": "10000mAh 双向快充、轻盈便携、高标准安全保护",
67 | "ali_image": "http://image.smartisanos.cn/resource/ae40a16324658c192c7361d829f603bd.jpg",
68 | "price": 199,
69 | "limit_num": 1,
70 | "spec_json": {
71 | "image": "attr/v2/1000299/B37F37544921114CEF1EC01ED4DF44E4/",
72 | "show_name": "灰色"
73 | }
74 | }]
75 | },
76 | {
77 | "id": 1000299,
78 | "name": "Smartisan 快充移动电源 10000mAh",
79 | "name_title": "10000mAh 双向快充、轻盈便携、高标准安全保护",
80 | "price": 199,
81 | "sku_info": [{
82 | "sku_id": 100029901,
83 | "title": "Smartisan 快充移动电源 10000mAh",
84 | "sub_title": "10000mAh 双向快充、轻盈便携、高标准安全保护",
85 | "ali_image": "http://image.smartisanos.cn/resource/ae40a16324658c192c7361d829f603bd.jpg",
86 | "price": 199,
87 | "limit_num": 1,
88 | "spec_json": {
89 | "image": "attr/v2/1000299/B37F37544921114CEF1EC01ED4DF44E4/",
90 | "show_name": "灰色"
91 | }
92 | }]
93 | },
94 | {
95 | "id": 1000299,
96 | "name": "Smartisan 快充移动电源 10000mAh",
97 | "name_title": "10000mAh 双向快充、轻盈便携、高标准安全保护",
98 | "price": 199,
99 | "sku_info": [{
100 | "sku_id": 100029901,
101 | "title": "Smartisan 快充移动电源 10000mAh",
102 | "sub_title": "10000mAh 双向快充、轻盈便携、高标准安全保护",
103 | "ali_image": "http://image.smartisanos.cn/resource/ae40a16324658c192c7361d829f603bd.jpg",
104 | "price": 199,
105 | "limit_num": 1,
106 | "spec_json": {
107 | "image": "attr/v2/1000299/B37F37544921114CEF1EC01ED4DF44E4/",
108 | "show_name": "灰色"
109 | }
110 | }]
111 | },
112 | {
113 | "id": 1000299,
114 | "name": "Smartisan 快充移动电源 10000mAh",
115 | "name_title": "10000mAh 双向快充、轻盈便携、高标准安全保护",
116 | "price": 199,
117 | "sku_info": [{
118 | "sku_id": 100029901,
119 | "title": "Smartisan 快充移动电源 10000mAh",
120 | "sub_title": "10000mAh 双向快充、轻盈便携、高标准安全保护",
121 | "ali_image": "http://image.smartisanos.cn/resource/ae40a16324658c192c7361d829f603bd.jpg",
122 | "price": 199,
123 | "limit_num": 1,
124 | "spec_json": {
125 | "image": "attr/v2/1000299/B37F37544921114CEF1EC01ED4DF44E4/",
126 | "show_name": "灰色"
127 | }
128 | }]
129 | }],
130 | "itemsData" : [
131 | {
132 | "sku_id": 100027101,
133 | "title": "坚果 Pro 软胶保护套",
134 | "sub_title": "TPU 环保材质、耐磨、耐油、耐久性强",
135 | "ali_image": "http://image.smartisanos.cn/resource/902befd5f32a8caf4ca79b55d39ee25a.jpg",
136 | "price": 49,
137 | "limit_num": 5,
138 | "spec_json": {
139 | "image": "attr/v2/1000271/948F029DCF134EF23267994487994DA5/",
140 | "show_name": "红色"
141 | },
142 | "ali_images": [
143 | "http://image.smartisanos.cn/resource/902befd5f32a8caf4ca79b55d39ee25a.jpg",
144 | "http://image.smartisanos.cn/resource/ca760e50409c796a4e770c54554f92bf.jpg",
145 | "http://image.smartisanos.cn/resource/493c65d42fe83ec3daaf058d79fc1a95.jpg",
146 | "http://image.smartisanos.cn/resource/0bf30081dd17431c4fdfbd237c53743f.jpg",
147 | "http://image.smartisanos.cn/resource/cba7b4cdb2fc41d7f29fb45d94972e41.jpg"
148 | ],
149 | "sku_list": [
150 | {
151 | "id": 100027101,
152 | "image": "attr/v2/1000271/948F029DCF134EF23267994487994DA5/",
153 | "limit_num": 5,
154 | "color": "红色"
155 | },
156 | {
157 | "id": 100027102,
158 | "image": "attr/v2/1000271/649AD35E36A9703BACBE1555AEB6D266/",
159 | "limit_num": 5,
160 | "color": "黑色"
161 | },
162 | {
163 | "id": 100027103,
164 | "image": "attr/v2/1000271/07BAF8C0EF046224A84B593DEEBC869E/",
165 | "limit_num": 5,
166 | "color": "巧克力色"
167 | },
168 | {
169 | "id": 100027104,
170 | "image": "attr/v2/1000271/52317E0C067C97FC6CE9376A2432CFFF/",
171 | "limit_num": 5,
172 | "color": "浅金色"
173 | }
174 | ]
175 | },
176 | {
177 | "sku_id": 100027102,
178 | "title": "坚果 Pro 软胶保护套",
179 | "sub_title": "TPU 环保材质、耐磨、耐油、耐久性强",
180 | "ali_image": "http://image.smartisanos.cn/resource/554da94d8e4f84f03e0015fd1c997f46.jpg",
181 | "price": 49,
182 | "limit_num": 5,
183 | "spec_json": {
184 | "image": "attr/v2/1000271/649AD35E36A9703BACBE1555AEB6D266/",
185 | "show_name": "黑色"
186 | },
187 | "ali_images": [
188 | "http://image.smartisanos.cn/resource/554da94d8e4f84f03e0015fd1c997f46.jpg",
189 | "http://image.smartisanos.cn/resource/01f25111e1a2c238a0f77e84aebd0796.jpg",
190 | "http://image.smartisanos.cn/resource/2841709c21ef07616f621fd863dcf2f3.jpg",
191 | "http://image.smartisanos.cn/resource/1b6fd01e415c380947cd98f62fa44817.jpg",
192 | "http://image.smartisanos.cn/resource/9e40a858dff00faa2f139587b7085249.jpg"
193 | ],
194 | "sku_list": [{
195 | "id": 100027101,
196 | "image": "attr/v2/1000271/948F029DCF134EF23267994487994DA5/",
197 | "limit_num": 5,
198 | "color": "红色"
199 | },{
200 | "id": 100027102,
201 | "image": "attr/v2/1000271/649AD35E36A9703BACBE1555AEB6D266/",
202 | "limit_num": 5,
203 | "color": "黑色"
204 | },{
205 | "id": 100027103,
206 | "image": "attr/v2/1000271/07BAF8C0EF046224A84B593DEEBC869E/",
207 | "limit_num": 5,
208 | "color": "巧克力色"
209 | },{
210 | "id": 100027104,
211 | "image": "attr/v2/1000271/52317E0C067C97FC6CE9376A2432CFFF/",
212 | "limit_num": 5,
213 | "color": "浅金色"
214 | }]
215 | },
216 | {
217 | "sku_id": 100027103,
218 | "title": "坚果 Pro 软胶保护套",
219 | "sub_title": "TPU 环保材质、耐磨、耐油、耐久性强",
220 | "ali_image": "http://image.smartisanos.cn/resource/84b58718b8f8da3c08e0931e19fdc62e.png",
221 | "price": 49,
222 | "limit_num": 5,
223 | "spec_json": {
224 | "image": "attr/v2/1000271/07BAF8C0EF046224A84B593DEEBC869E/",
225 | "show_name": "巧克力色"
226 | },
227 | "ali_images": [
228 | "http://image.smartisanos.cn/resource/6d39130f5ad4bfe1241c0c17211472c2.jpg",
229 | "http://image.smartisanos.cn/resource/5694eb55ad2777a87096677d9d39cc58.jpg",
230 | "http://image.smartisanos.cn/resource/bffbb5411470d97a13f2f380006c96e4.jpg",
231 | "http://image.smartisanos.cn/resource/701052c09e45bd4069d3f8280d0d1435.jpg",
232 | "http://image.smartisanos.cn/resource/4fa7c5f81b02f71be4cae051ce547433.jpg"
233 | ],
234 | "sku_list": [{
235 | "id": 100027101,
236 | "image": "attr/v2/1000271/948F029DCF134EF23267994487994DA5/",
237 | "limit_num": 5,
238 | "color": "红色"
239 | },{
240 | "id": 100027102,
241 | "image": "attr/v2/1000271/649AD35E36A9703BACBE1555AEB6D266/",
242 | "limit_num": 5,
243 | "color": "黑色"
244 | },{
245 | "id": 100027103,
246 | "image": "attr/v2/1000271/07BAF8C0EF046224A84B593DEEBC869E/",
247 | "limit_num": 5,
248 | "color": "巧克力色"
249 | },{
250 | "id": 100027104,
251 | "image": "attr/v2/1000271/52317E0C067C97FC6CE9376A2432CFFF/",
252 | "limit_num": 5,
253 | "color": "浅金色"
254 | }]
255 | },
256 | {
257 | "sku_id": 100027104,
258 | "title": "坚果 Pro 软胶保护套",
259 | "sub_title": "TPU 环保材质、耐磨、耐油、耐久性强",
260 | "ali_image": "http://image.smartisanos.cn/resource/b20055215ae3db0f2c8b7ba4db68866f.png",
261 | "price": 49,
262 | "limit_num": 5,
263 | "spec_json": {
264 | "image": "attr/v2/1000271/52317E0C067C97FC6CE9376A2432CFFF/",
265 | "show_name": "浅金色"
266 | },
267 | "ali_images": [
268 | "http://image.smartisanos.cn/resource/46d4b1cc072c7daa0c69756ac62ab46e.jpg",
269 | "http://image.smartisanos.cn/resource/e0d86a84c13b995fe87910324b3c7771.jpg",
270 | "http://image.smartisanos.cn/resource/1febef151c00c073d65eb37f68b75faf.jpg",
271 | "http://image.smartisanos.cn/resource/520666f8a84d92963320cf94bd74c05c.jpg",
272 | "http://image.smartisanos.cn/resource/7087d8239dec31662978c4c44c8501ba.jpg"
273 | ],
274 | "sku_list": [{
275 | "id": 100027101,
276 | "image": "attr/v2/1000271/948F029DCF134EF23267994487994DA5/",
277 | "limit_num": 5,
278 | "color": "红色"
279 | },{
280 | "id": 100027102,
281 | "image": "attr/v2/1000271/649AD35E36A9703BACBE1555AEB6D266/",
282 | "limit_num": 5,
283 | "color": "黑色"
284 | },{
285 | "id": 100027103,
286 | "image": "attr/v2/1000271/07BAF8C0EF046224A84B593DEEBC869E/",
287 | "limit_num": 5,
288 | "color": "巧克力色"
289 | },{
290 | "id": 100027104,
291 | "image": "attr/v2/1000271/52317E0C067C97FC6CE9376A2432CFFF/",
292 | "limit_num": 5,
293 | "color": "浅金色"
294 | }]
295 | },
296 | {
297 | "sku_id": 100029901,
298 | "title": "Smartisan 快充移动电源 10000mAh",
299 | "sub_title": "10000mAh 双向快充、轻盈便携、高标准安全保护",
300 | "ali_image": "http://image.smartisanos.cn/resource/ae40a16324658c192c7361d829f603bd.jpg",
301 | "price": 199,
302 | "limit_num": 1,
303 | "spec_json": {
304 | "image": "attr/v2/1000299/B37F37544921114CEF1EC01ED4DF44E4/",
305 | "show_name": "灰色"
306 | },
307 | "ali_images": [
308 | "http://image.smartisanos.cn/resource/ae40a16324658c192c7361d829f603bd.jpg",
309 | "http://image.smartisanos.cn/resource/0540778097a009364f2dcbb8c5286451.jpg",
310 | "http://image.smartisanos.cn/resource/ed7ea75824124d7385c99d532f1d4f1d.jpg",
311 | "http://image.smartisanos.cn/resource/40b8c1b1e5d175cc8fa9e7ff96cb6016.jpg",
312 | "http://image.smartisanos.cn/resource/fb24dc3db26c6f02542e0dea9b10151b.jpg"
313 | ],
314 | "sku_list": [{
315 | "id": 100029901,
316 | "image": "attr/v2/1000299/B37F37544921114CEF1EC01ED4DF44E4/",
317 | "limit_num": 1,
318 | "color": "灰色"
319 | }]
320 | }],
321 | "provinceList" : [
322 | {
323 | "area_id": 110000,
324 | "area_name": "北京市",
325 | "city_list": [
326 | {
327 | "area_name": "市辖区",
328 | "area_id": 110100,
329 | "county_list": [
330 | {
331 | "area_name": "东城区",
332 | "area_id": 110101
333 | },
334 | {
335 | "area_name": "海淀区",
336 | "area_id": 110106
337 | }
338 | ]
339 | },
340 | {
341 | "area_name": "县",
342 | "area_id": 110200,
343 | "county_list": [{
344 | "area_name": "密云县",
345 | "area_id": 110228
346 | },
347 | {
348 | "area_name": "延庆县",
349 | "area_id": 110229
350 | }
351 | ]
352 | }]
353 | },
354 | {
355 | "area_id": 440000,
356 | "area_name": "广东省",
357 | "city_list": [{
358 | "area_id": 440300,
359 | "area_name": "深圳市",
360 | "county_list": [{
361 | "area_name": "罗湖区",
362 | "area_id": 440303
363 | }, {
364 | "area_name": "福田区",
365 | "area_id": 440304
366 | }]
367 | }, {
368 | "area_id": 440100,
369 | "area_name": "广州市",
370 | "county_list": [{
371 | "area_name": "荔湾区",
372 | "area_id": 440103
373 | }, {
374 | "area_name": "越秀区",
375 | "area_id": 440104
376 | }]
377 | }]
378 | },
379 | {
380 | "area_id": 310000,
381 | "area_name": "上海市",
382 | "city_list": [{
383 | "area_id": 310100,
384 | "area_name": "市辖区",
385 | "county_list": [{
386 | "area_id": 310113,
387 | "area_name": "宝山区"
388 | }, {
389 | "area_id": 310105,
390 | "area_name": "长宁区"
391 | }]
392 | }, {
393 | "area_id": 310200,
394 | "area_name": "县",
395 | "county_list": [{
396 | "area_name": "崇明县",
397 | "area_id": 310230
398 | }]
399 | }]
400 | }
401 | ]
402 | }
403 |
--------------------------------------------------------------------------------
/src/components/address-pop.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
管理收货地址
9 |
10 |
x
11 |
12 |
79 |
80 |
81 |
82 |
83 |
84 |
225 |
226 |
499 |
--------------------------------------------------------------------------------
/src/components/car.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
购物清单
7 |
8 |
9 |
10 |
您的购物车中还没有商品
11 | 现在选购
12 |
13 |
14 |
15 | 商品信息
16 | 操作
17 | 小计
18 | 数量
19 | 单价
20 |
21 |
22 |
23 |
24 |
25 |
26 |
29 |
30 |
![]()
31 |
32 |
33 |
41 |
44 |
¥{{item.price*item.count}} .00
45 |
46 |
47 | -
48 | {{item.count}}
49 | +
50 |
51 |
52 |
53 |
¥{{item.price}}.00
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
69 |
70 |
71 |
72 |
73 | 已选择 {{checkCount}} 件商品
74 |
75 |
76 | 共计 {{count}} 件商品
77 |
78 |
79 |
80 |
81 | 应付总额:¥{{checkPrice}}
82 |
83 |
84 | 应付总额不含运费
85 |
86 |
87 |
88 |
现在结算
89 |
90 |
91 |
92 |
93 |
94 |
95 |
143 |
595 |
--------------------------------------------------------------------------------
/src/components/checkout.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
收货信息
8 |
9 |
10 |
11 |
12 | -
13 |
14 |
{{item.name}}
15 |
{{item.phone}}
16 |
{{item.province}}{{item.city}}{{item.county}}
{{item.add}}
17 |
18 |
19 | 修改
20 | 删除
21 |
22 |
23 | -
24 |
使用新地址
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
发票信息
34 |
35 |
36 |
发票类型:电子发票
37 |
56 |
发票内容:购买商品明细
57 |
电子发票是税务局认可的有效收付款凭证,可作为售后服务凭据。电子发票打印后可以用于企业报销。
58 |
59 |
60 |
61 |
62 |
购物清单
63 |
64 |
65 |
66 | 商品名称
67 | 小计
68 | 数量
69 | 单价
70 |
71 |
72 |
73 |
74 |
75 |
![]()
76 |
77 |
82 |
83 |
¥ {{item.price*item.count}}.00
84 |
85 |
{{item.count}}
86 |
¥{{item.price}}.00
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
商品总计: ¥{{totalPrice}}.00
95 |
运费: +¥{{frident}}.00
96 |
97 |
98 |
99 |
100 |
101 |
提交订单 应付金额: ¥{{totalPrice+frident}}.00
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
203 |
204 |
684 |
--------------------------------------------------------------------------------