├── static
└── .gitkeep
├── .eslintignore
├── test
└── unit
│ ├── setup.js
│ ├── .eslintrc
│ ├── specs
│ └── HelloWorld.spec.js
│ └── jest.conf.js
├── config
├── prod.env.js
├── test.env.js
├── dev.env.js
└── index.js
├── screenshot
├── 1.png
├── 2.png
├── 3.png
└── 4.png
├── src
├── assets
│ ├── logo.png
│ ├── images
│ │ ├── logo.png
│ │ └── 404_error.png
│ └── menus.json
├── views
│ ├── dashboard.vue
│ ├── layout
│ │ ├── index.js
│ │ ├── footer.vue
│ │ ├── subMenu.vue
│ │ ├── layout.vue
│ │ ├── sideMenu.vue
│ │ └── header.vue
│ ├── couriers
│ │ ├── add.vue
│ │ ├── edit.vue
│ │ └── index.vue
│ ├── employees
│ │ ├── add.vue
│ │ ├── index.vue
│ │ └── edit.vue
│ ├── invoices
│ │ ├── edit.vue
│ │ └── index.vue
│ ├── customers
│ │ ├── add.vue
│ │ ├── edit.vue
│ │ └── index.vue
│ ├── topics
│ │ └── index.vue
│ ├── coupons
│ │ ├── index.vue
│ │ ├── add.vue
│ │ └── edit.vue
│ ├── orders
│ │ └── index.vue
│ ├── addresses
│ │ ├── index.vue
│ │ ├── add.vue
│ │ └── edit.vue
│ ├── brands
│ │ ├── index.vue
│ │ ├── add.vue
│ │ └── edit.vue
│ ├── products
│ │ └── index.vue
│ ├── attributes
│ │ └── index.vue
│ ├── ads
│ │ ├── add.vue
│ │ ├── edit.vue
│ │ └── index.vue
│ └── login
│ │ └── index.vue
├── filters
│ └── index.js
├── styles
│ ├── font-awesome.scss
│ └── style.scss
├── App.vue
├── router
│ ├── index.js
│ └── routes.js
├── main.js
├── components
│ ├── 404.vue
│ ├── HelloWorld.vue
│ ├── crudPanel.vue
│ ├── treeter.js
│ └── panel.vue
├── api
│ └── index.js
├── request
│ └── index.js
├── utils
│ └── index.js
└── store
│ └── index.js
├── .gitignore
├── .editorconfig
├── .postcssrc.js
├── index.html
├── .babelrc
├── README.md
├── .eslintrc.js
├── .travis.yml
└── package.json
/static/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | /build/
2 | /config/
3 | /dist/
4 | /*.js
5 | /test/unit/coverage/
6 |
--------------------------------------------------------------------------------
/test/unit/setup.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 |
3 | Vue.config.productionTip = false
4 |
--------------------------------------------------------------------------------
/config/prod.env.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | module.exports = {
3 | NODE_ENV: '"production"'
4 | }
5 |
--------------------------------------------------------------------------------
/screenshot/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saonian/nideshop_admin_full/HEAD/screenshot/1.png
--------------------------------------------------------------------------------
/screenshot/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saonian/nideshop_admin_full/HEAD/screenshot/2.png
--------------------------------------------------------------------------------
/screenshot/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saonian/nideshop_admin_full/HEAD/screenshot/3.png
--------------------------------------------------------------------------------
/screenshot/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saonian/nideshop_admin_full/HEAD/screenshot/4.png
--------------------------------------------------------------------------------
/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saonian/nideshop_admin_full/HEAD/src/assets/logo.png
--------------------------------------------------------------------------------
/test/unit/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "jest": true
4 | },
5 | "globals": {
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/assets/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saonian/nideshop_admin_full/HEAD/src/assets/images/logo.png
--------------------------------------------------------------------------------
/src/assets/images/404_error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/saonian/nideshop_admin_full/HEAD/src/assets/images/404_error.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | dist/
3 | build/*
4 | !build/icons
5 | node_modules/
6 | npm-debug.log
7 | npm-debug.log.*
8 | thumbs.db
9 | !.gitkeep
10 | .idea/*
11 |
--------------------------------------------------------------------------------
/config/test.env.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const merge = require('webpack-merge')
3 | const devEnv = require('./dev.env')
4 |
5 | module.exports = merge(devEnv, {
6 | NODE_ENV: '"testing"'
7 | })
8 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/src/views/dashboard.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | 首页
4 |
5 |
6 |
7 |
10 |
11 |
14 |
--------------------------------------------------------------------------------
/src/views/layout/index.js:
--------------------------------------------------------------------------------
1 | import footer from './footer.vue'
2 | import header from './header.vue'
3 | import sideMenu from './sideMenu.vue'
4 |
5 | export {
6 | footer,
7 | header,
8 | sideMenu
9 | }
10 |
--------------------------------------------------------------------------------
/.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 | 官网后台
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/test/unit/specs/HelloWorld.spec.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import HelloWorld from '@/components/HelloWorld'
3 |
4 | describe('HelloWorld.vue', () => {
5 | it('should render correct contents', () => {
6 | const Constructor = Vue.extend(HelloWorld)
7 | const vm = new Constructor().$mount()
8 | expect(vm.$el.querySelector('.hello h1').textContent)
9 | .toEqual('Welcome to Your Vue.js App')
10 | })
11 | })
12 |
--------------------------------------------------------------------------------
/src/filters/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 去除首尾空格
3 | * @param {[string]} string [字符串]
4 | * @return {[string]} [返回处理后数据]
5 | */
6 | const trim = (string) => {
7 | return string.toString().replace()
8 | }
9 |
10 | const subString = (value, length = 10) => {
11 | if (value && value != null && value.length > length) {
12 | return value.substring(0, length)
13 | }
14 | return value
15 | }
16 |
17 | export default {
18 | trim, subString
19 | }
20 |
--------------------------------------------------------------------------------
/.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 | "env": {
13 | "test": {
14 | "presets": ["env", "stage-2"],
15 | "plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"]
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/styles/font-awesome.scss:
--------------------------------------------------------------------------------
1 | [class^="el-icon-fa"], [class*=" el-icon-fa"] {
2 | display: inline-block;
3 | font: normal normal normal 14px/1 FontAwesome!important;
4 | font-size: inherit;
5 | text-rendering: auto;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | };
9 |
10 | $fa-font-path: "../../node_modules/font-awesome/fonts";
11 | $fa-css-prefix: "el-icon-fa";
12 |
13 | @import "../../node_modules/font-awesome/scss/font-awesome.scss";
14 | /* elementui 的样式必须放在这里才会显示图标 */
15 | @import "../../node_modules/element-ui/lib/theme-chalk/index.css";
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 本项目为[nideshop_server_full](https://github.com/saonian/nideshop_server_full)的管理界面,采用VUE+Element UI开发,目前大部分功能都开发完毕。
2 |
3 | 免费共享,后续不再更新。
4 |
5 | ## 使用方法
6 |
7 | 1. 根据[nideshop_server_full](https://github.com/saonian/nideshop_server_full)的说明搭建好后端
8 |
9 | 2. 修改`config/index.js`下的proxyTable配置为后端接口API地址
10 |
11 | 3. 修改`src/api/index.js`里的七牛域名配置
12 |
13 | 4. 运行`npm install`安装依赖
14 |
15 | 5. 运行`npm run dev`启动项目
16 |
17 | 6. 使用`admin/jiafeimao`登录项目
18 |
19 |
20 | ## 部分截图
21 |
22 | 
23 |
24 | 
25 |
26 | 
27 |
28 | 
--------------------------------------------------------------------------------
/src/views/layout/footer.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
9 |
10 |
23 |
--------------------------------------------------------------------------------
/test/unit/jest.conf.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 |
3 | module.exports = {
4 | rootDir: path.resolve(__dirname, '../../'),
5 | moduleFileExtensions: [
6 | 'js',
7 | 'json',
8 | 'vue'
9 | ],
10 | moduleNameMapper: {
11 | '^@/(.*)$': '/src/$1'
12 | },
13 | transform: {
14 | '^.+\\.js$': '/node_modules/babel-jest',
15 | '.*\\.(vue)$': '/node_modules/vue-jest'
16 | },
17 | snapshotSerializers: ['/node_modules/jest-serializer-vue'],
18 | setupFiles: ['/test/unit/setup'],
19 | mapCoverage: true,
20 | coverageDirectory: '/test/unit/coverage',
21 | collectCoverageFrom: [
22 | 'src/**/*.{js,vue}',
23 | '!src/main.js',
24 | '!src/router/index.js',
25 | '!**/node_modules/**'
26 | ]
27 | }
28 |
--------------------------------------------------------------------------------
/src/styles/style.scss:
--------------------------------------------------------------------------------
1 | // 缩小表格行高
2 | .el-table td, .el-table th {
3 | padding: 5px 0;
4 | }
5 |
6 | // 缩小表单元素间距
7 | .el-form-item {
8 | margin-bottom: 15px;
9 | }
10 |
11 | // 上传控件样式
12 | .cover-uploader .el-upload {
13 | border: 1px dashed #d9d9d9;
14 | border-radius: 6px;
15 | cursor: pointer;
16 | position: relative;
17 | overflow: hidden;
18 | }
19 | .cover-uploader .el-upload:hover {
20 | border-color: #409EFF;
21 | }
22 | .cover-uploader-icon {
23 | font-size: 28px;
24 | color: #8c939d;
25 | width: 146px;
26 | height: 146px;
27 | line-height: 146px;
28 | text-align: center;
29 | }
30 | .cover {
31 | width: 178px;
32 | height: 178px;
33 | display: block;
34 | }
35 |
36 | // 修复表单项的行高导致vue-croppa, quill样式错乱的问题
37 | .el-form-item.no-line-height .el-form-item__content {
38 | line-height: unset;
39 | }
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
14 |
15 |
39 |
--------------------------------------------------------------------------------
/src/router/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import VueRouter from 'vue-router'
3 | import NProgress from 'nprogress'
4 | import 'nprogress/nprogress.css'
5 | import routes from './routes'
6 | import store from '../store'
7 |
8 | Vue.use(NProgress)
9 | Vue.use(VueRouter)
10 |
11 | const router = new VueRouter({
12 | routes: routes
13 | })
14 |
15 | const {state} = store
16 |
17 | router.beforeEach((route, redirect, next) => {
18 | NProgress.start()
19 | if (state.device.isMobile && state.sidebar.opened) {
20 | store.commit('TOGGLE_SIDEBAR', false)
21 | }
22 | if (!store.state.token && route.path !== '/login') {
23 | next({
24 | path: '/login',
25 | query: {redirect: route.fullPath}
26 | })
27 | } else {
28 | next()
29 | }
30 | })
31 |
32 | router.afterEach((route, redirect, next) => {
33 | NProgress.done()
34 | store.dispatch('changeCurrentMenu', route)
35 | })
36 |
37 | export default router
38 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | // https://eslint.org/docs/user-guide/configuring
2 |
3 | module.exports = {
4 | root: true,
5 | parserOptions: {
6 | parser: 'babel-eslint'
7 | },
8 | env: {
9 | browser: true,
10 | },
11 | extends: [
12 | // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
13 | // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
14 | 'plugin:vue/essential',
15 | // https://github.com/standard/standard/blob/master/docs/RULES-en.md
16 | 'standard'
17 | ],
18 | // required to lint *.vue files
19 | plugins: [
20 | 'vue'
21 | ],
22 | // add your custom rules here
23 | rules: {
24 | // allow async-await
25 | 'generator-star-spacing': 'off',
26 | // allow debugger during development
27 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
28 | 'vue/valid-v-for': 'off'
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | osx_image: xcode8.3
2 | sudo: required
3 | dist: trusty
4 | language: c
5 | matrix:
6 | include:
7 | - os: osx
8 | - os: linux
9 | env: CC=clang CXX=clang++ npm_config_clang=1
10 | compiler: clang
11 | cache:
12 | directories:
13 | - node_modules
14 | - "$HOME/.electron"
15 | - "$HOME/.cache"
16 | addons:
17 | apt:
18 | packages:
19 | - libgnome-keyring-dev
20 | - icnsutils
21 | before_install:
22 | - mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v1.2.1/git-lfs-$([
23 | "$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-1.2.1.tar.gz
24 | | tar -xz -C /tmp/git-lfs --strip-components 1 && /tmp/git-lfs/git-lfs pull
25 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install --no-install-recommends -y icnsutils graphicsmagick xz-utils; fi
26 | install:
27 | - nvm install 7
28 | - curl -o- -L https://yarnpkg.com/install.sh | bash
29 | - source ~/.bashrc
30 | - npm install -g xvfb-maybe
31 | - yarn
32 | script:
33 | - yarn run build
34 | branches:
35 | only:
36 | - master
37 |
--------------------------------------------------------------------------------
/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 Element from 'element-ui'
6 | import './styles/font-awesome.scss'
7 | import './styles/style.scss'
8 | import request from './request'
9 | import router from './router'
10 | import store from './store'
11 | import {sync} from 'vuex-router-sync'
12 | import 'font-awesome/css/font-awesome.css'
13 | import 'animate.css'
14 | import panel from './components/panel.vue'
15 | import crudPanel from './components/crudPanel.vue'
16 | import croppa from 'vue-croppa'
17 | import 'vue-croppa/dist/vue-croppa.css'
18 |
19 | Vue.component('main-panel', panel)
20 | Vue.component('crud-panel', crudPanel)
21 | Vue.config.productionTip = false
22 | Vue.prototype.$http = request
23 |
24 | Vue.use(Element)
25 | Vue.use(croppa)
26 | sync(store, router)
27 |
28 | /* eslint-disable no-new */
29 | export default new Vue({
30 | el: '#app',
31 | store,
32 | router,
33 | components: { App },
34 | template: ''
35 | })
36 |
--------------------------------------------------------------------------------
/src/views/layout/subMenu.vue:
--------------------------------------------------------------------------------
1 |
2 |
9 |
12 |
13 |
14 |
28 |
29 |
34 |
--------------------------------------------------------------------------------
/src/components/404.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |

6 |
7 |
PAGE NOT FOUND
8 |
WE COULDN'T FIND THIS PAGE
9 |
返回首页
10 |
11 |
12 |
13 |
14 |
17 |
18 |
59 |
--------------------------------------------------------------------------------
/src/api/index.js:
--------------------------------------------------------------------------------
1 | export const CONTEXT = '/api/admin'
2 |
3 | // 七牛域名,结尾带斜杠
4 | export const QiniuDomain = 'http://domain/'
5 | // 上传到七牛的商品评论图片名前缀,结尾带斜杠
6 | export const GoodsCommentImgPrefix = 'comments/goods/'
7 | // 上传到七牛的主题评论图片名前缀,结尾带斜杠
8 | export const TopicCommentImgPrefix = 'comments/topic/'
9 | // 上传到七牛的品牌图片名前缀,结尾带斜杠
10 | export const BrandImgPrefix = 'brands/banner/'
11 | // 上传到七牛的商品图片名前缀,结尾带斜杠
12 | export const GoodsImgPrefix = 'goods/gallery/'
13 | // 上传到七牛的商品描述图片名前缀,结尾带斜杠
14 | export const GoodsDescPrefix = 'goods/desc/'
15 | // 上传到七牛的分类图片名前缀,结尾带斜杠
16 | export const CategoryIconPrefix = 'categories/icon/'
17 | // 上传到七牛的分类Banner名前缀,结尾带斜杠
18 | export const CategoryBannerPrefix = 'categories/banner/'
19 | // 上传到七牛的广告图片名前缀,结尾带斜杠
20 | export const AdImgPrefix = 'ads/'
21 | // 上传到七牛的专题图片名前缀,结尾带斜杠
22 | export const TopicImgPrefix = 'topic/'
23 |
24 | export const LOGIN = CONTEXT + '/auth/login'
25 | export const LOGIN_USER = CONTEXT + '/login/user'
26 | export const LOGOUT = CONTEXT + '/auth/logout'
27 | export const UP_TOKEN = CONTEXT + '/index/uptoken'
28 | export const GOODS = CONTEXT + '/goods'
29 | export const SPECIFICATION = CONTEXT + '/specification'
30 | export const CATEGORY = CONTEXT + '/category'
31 | export const BRAND = CONTEXT + '/brand'
32 | export const CUSTOMER = CONTEXT + '/user'
33 | export const INVOICE = CONTEXT + '/invoice'
34 | export const ADDRESS = CONTEXT + '/address'
35 | export const REGION = CONTEXT + '/region'
36 | export const ORDER = CONTEXT + '/order'
37 | export const COURIER = CONTEXT + '/shipper'
38 | export const COUPON = CONTEXT + '/coupon'
39 | export const TOPIC = CONTEXT + '/topic'
40 | export const ADVERTISEMENT = CONTEXT + '/advertisement'
41 | export const EMPLOYEE = CONTEXT + '/admin'
42 |
--------------------------------------------------------------------------------
/src/request/index.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios'
2 | // import qs from 'qs'
3 | import router from '../router'
4 | import store from '../store'
5 | import {Message} from 'element-ui'
6 |
7 | axios.defaults.timeout = 15000
8 |
9 | axios.interceptors.request.use(function (config) {
10 | // if (config.method === 'post' && config.data.constructor !== FormData) {
11 | // config.data = qs.stringify(config.data)
12 | // }
13 | if (store.getters.token) {
14 | config.headers['token'] = store.getters.token
15 | }
16 | return config
17 | }, function (error) {
18 | return Promise.reject(error)
19 | })
20 |
21 | axios.interceptors.response.use(
22 | response => {
23 | if (response.data && response.data.errno === 401) {
24 | router.replace({
25 | path: '/login',
26 | query: {redirect: router.currentRoute.fullPath}
27 | })
28 | Message.error('登录过期,请重新登录')
29 | return
30 | }
31 | if (response.data && response.status === 200 && response.data.errno === 0) {
32 | return response.data
33 | } else {
34 | Message.error(response.data.errmsg)
35 | return response.data
36 | }
37 | },
38 | error => {
39 | if (error.response) {
40 | if (error.response.status === 401) {
41 | router.replace({
42 | path: '/login',
43 | query: {redirect: router.currentRoute.fullPath}
44 | })
45 | Message.error('登录过期,请重新登录')
46 | } else if (error.response.status === 500) {
47 | Message.error('服务端错误:' + error.response.data.message)
48 | } else if (error.response.status === 422) {
49 | Message.error(error.response.data.message)
50 | } else {
51 | Message.error(error.response.data.message)
52 | }
53 | }
54 | return Promise.reject(error.response.data)
55 | }
56 | )
57 |
58 | export default axios
59 |
--------------------------------------------------------------------------------
/src/views/couriers/add.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 |
74 |
75 |
78 |
--------------------------------------------------------------------------------
/src/components/HelloWorld.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
{{ msg }}
4 |
Essential Links
5 |
48 |
Ecosystem
49 |
83 |
84 |
85 |
86 |
96 |
97 |
98 |
114 |
--------------------------------------------------------------------------------
/src/views/couriers/edit.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 |
83 |
84 |
87 |
--------------------------------------------------------------------------------
/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 | // Paths
10 | assetsSubDirectory: 'static',
11 | assetsPublicPath: '/',
12 | proxyTable: {
13 | '/api': {
14 | target: 'http://www.nideshop.me',
15 | changeOrigin: true,
16 | pathRewrite: {
17 | '^/api': ''
18 | }
19 | }
20 | },
21 |
22 | // Various Dev Server settings
23 | host: 'localhost', // can be overwritten by process.env.HOST
24 | port: 10000, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
25 | autoOpenBrowser: false,
26 | errorOverlay: true,
27 | notifyOnErrors: true,
28 | poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
29 |
30 | // Use Eslint Loader?
31 | // If true, your code will be linted during bundling and
32 | // linting errors and warnings will be shown in the console.
33 | useEslint: true,
34 | // If true, eslint errors and warnings will also be shown in the error overlay
35 | // in the browser.
36 | showEslintErrorsInOverlay: false,
37 |
38 | /**
39 | * Source Maps
40 | */
41 |
42 | // https://webpack.js.org/configuration/devtool/#development
43 | devtool: 'cheap-module-eval-source-map',
44 |
45 | // If you have problems debugging vue-files in devtools,
46 | // set this to false - it *may* help
47 | // https://vue-loader.vuejs.org/en/options.html#cachebusting
48 | cacheBusting: true,
49 |
50 | cssSourceMap: true
51 | },
52 |
53 | build: {
54 | // Template for index.html
55 | index: path.resolve(__dirname, '../dist/index.html'),
56 |
57 | // Paths
58 | assetsRoot: path.resolve(__dirname, '../dist'),
59 | assetsSubDirectory: 'static',
60 | assetsPublicPath: '/',
61 |
62 | /**
63 | * Source Maps
64 | */
65 |
66 | productionSourceMap: true,
67 | // https://webpack.js.org/configuration/devtool/#production
68 | devtool: '#source-map',
69 |
70 | // Gzip off by default as many popular static hosts such as
71 | // Surge or Netlify already gzip all static assets for you.
72 | // Before setting to `true`, make sure to:
73 | // npm install --save-dev compression-webpack-plugin
74 | productionGzip: false,
75 | productionGzipExtensions: ['js', 'css'],
76 |
77 | // Run the build command with an extra argument to
78 | // View the bundle analyzer report after build finishes:
79 | // `npm run build --report`
80 | // Set to `true` or `false` to always turn it on or off
81 | bundleAnalyzerReport: process.env.npm_config_report
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/src/views/employees/add.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 |
90 |
91 |
94 |
--------------------------------------------------------------------------------
/src/views/invoices/edit.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{ form.customer }}
7 |
8 |
9 |
10 | 单位
11 | 个人
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | 保存
22 |
23 | 取消
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
94 |
95 |
98 |
--------------------------------------------------------------------------------
/src/views/employees/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 新增
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | 编辑
18 |
19 | 删除
20 |
21 |
22 |
23 |
32 |
33 |
34 |
35 |
36 |
85 |
86 |
89 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "shop-admin",
3 | "version": "1.0.0",
4 | "description": "A Vue.js project",
5 | "author": "Kay ",
6 | "private": true,
7 | "scripts": {
8 | "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
9 | "start": "npm run dev",
10 | "unit": "jest --config test/unit/jest.conf.js --coverage",
11 | "test": "npm run unit",
12 | "lint": "eslint --ext .js,.vue src test/unit",
13 | "build": "node build/build.js",
14 | "fix": "eslint --fix src"
15 | },
16 | "dependencies": {
17 | "animate.css": "^3.6.1",
18 | "axios": "^0.18.0",
19 | "element-ui": "^2.3.2",
20 | "font-awesome": "^4.7.0",
21 | "nprogress": "^0.2.0",
22 | "qiniu-js": "^2.5.1",
23 | "vue": "^2.5.2",
24 | "vue-croppa": "^1.3.2",
25 | "vue-quill-editor": "^3.0.5",
26 | "vue-router": "^3.0.1",
27 | "vuex": "^3.0.1",
28 | "vuex-router-sync": "^5.0.0"
29 | },
30 | "devDependencies": {
31 | "autoprefixer": "^7.1.2",
32 | "babel-core": "^6.22.1",
33 | "babel-eslint": "^8.2.1",
34 | "babel-helper-vue-jsx-merge-props": "^2.0.3",
35 | "babel-jest": "^21.0.2",
36 | "babel-loader": "^7.1.1",
37 | "babel-plugin-dynamic-import-node": "^1.2.0",
38 | "babel-plugin-syntax-jsx": "^6.18.0",
39 | "babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
40 | "babel-plugin-transform-runtime": "^6.22.0",
41 | "babel-plugin-transform-vue-jsx": "^3.5.0",
42 | "babel-preset-env": "^1.3.2",
43 | "babel-preset-stage-2": "^6.22.0",
44 | "chalk": "^2.0.1",
45 | "copy-webpack-plugin": "^4.0.1",
46 | "css-loader": "^0.28.0",
47 | "eslint": "^4.15.0",
48 | "eslint-config-standard": "^10.2.1",
49 | "eslint-friendly-formatter": "^3.0.0",
50 | "eslint-loader": "^1.7.1",
51 | "eslint-plugin-import": "^2.7.0",
52 | "eslint-plugin-node": "^5.2.0",
53 | "eslint-plugin-promise": "^3.4.0",
54 | "eslint-plugin-standard": "^3.0.1",
55 | "eslint-plugin-vue": "^4.4.0",
56 | "extract-text-webpack-plugin": "^3.0.0",
57 | "file-loader": "^1.1.4",
58 | "friendly-errors-webpack-plugin": "^1.6.1",
59 | "html-webpack-plugin": "^2.30.1",
60 | "jest": "^22.0.4",
61 | "jest-serializer-vue": "^0.3.0",
62 | "node-notifier": "^5.1.2",
63 | "node-sass": "^4.8.3",
64 | "optimize-css-assets-webpack-plugin": "^3.2.0",
65 | "ora": "^1.2.0",
66 | "portfinder": "^1.0.13",
67 | "postcss-import": "^11.0.0",
68 | "postcss-loader": "^2.0.8",
69 | "postcss-url": "^7.2.1",
70 | "quill-image-drop-module": "^1.0.3",
71 | "quill-image-extend-module": "^1.1.2",
72 | "quill-image-resize-module": "^3.0.0",
73 | "rimraf": "^2.6.0",
74 | "sass-loader": "^6.0.7",
75 | "semver": "^5.3.0",
76 | "shelljs": "^0.7.6",
77 | "uglifyjs-webpack-plugin": "^1.1.1",
78 | "url-loader": "^0.5.8",
79 | "vue-jest": "^1.0.2",
80 | "vue-loader": "^13.3.0",
81 | "vue-style-loader": "^3.0.1",
82 | "vue-template-compiler": "^2.5.2",
83 | "webpack": "^3.6.0",
84 | "webpack-bundle-analyzer": "^2.9.0",
85 | "webpack-dev-server": "^2.9.1",
86 | "webpack-merge": "^4.1.0"
87 | },
88 | "engines": {
89 | "node": ">= 6.0.0",
90 | "npm": ">= 3.0.0"
91 | },
92 | "browserslist": [
93 | "> 1%",
94 | "last 2 versions",
95 | "not ie <= 8"
96 | ]
97 | }
98 |
--------------------------------------------------------------------------------
/src/views/employees/edit.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 |
96 |
97 |
100 |
--------------------------------------------------------------------------------
/src/views/invoices/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 查询
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | 编辑
17 |
18 | 删除
19 |
20 |
21 |
22 |
31 |
32 |
33 |
34 |
35 |
88 |
89 |
92 |
--------------------------------------------------------------------------------
/src/views/couriers/index.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 |
33 |
34 |
35 |
36 |
37 |
91 |
92 |
95 |
--------------------------------------------------------------------------------
/src/views/customers/add.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
26 |
27 |
28 |
29 | 保存
30 |
31 | 取消
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
106 |
107 |
110 |
--------------------------------------------------------------------------------
/src/components/crudPanel.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
11 |
12 |
13 |
14 | 暂无内容显示
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
44 |
137 |
--------------------------------------------------------------------------------
/src/components/treeter.js:
--------------------------------------------------------------------------------
1 | const findFromTree = (treeArray, id, idPropName = 'id', childrenPropName = 'children') => {
2 | if (!treeArray || treeArray == null || treeArray.length <= 0) return null
3 | for (var i = 0; i < treeArray.length; i++) {
4 | if (treeArray[i][idPropName] === id) {
5 | return treeArray[i]
6 | } else {
7 | let result = findFromTree(treeArray[i][childrenPropName], id, idPropName, childrenPropName)
8 | if (result != null) {
9 | return result
10 | }
11 | }
12 | }
13 | return null
14 | }
15 |
16 | const appendTreeNode = (treeArray, item, idPropName = 'id', parentPropName = 'parentId', childrenPropName = 'children') => {
17 | if (treeArray == null || treeArray.length <= 0) return
18 | if (!item[parentPropName] || item[parentPropName] == null) {
19 | let i = treeArray.findIndex(p => p.sort > item.sort)
20 | if (i === -1) {
21 | i = treeArray.length
22 | }
23 | treeArray.splice(i, 0, item)
24 | return
25 | }
26 | for (var j = 0; j < treeArray.length; j++) {
27 | var value = treeArray[j]
28 | if (item[parentPropName] === value[idPropName]) {
29 | if (value[childrenPropName] && value[childrenPropName].length > 0) {
30 | let i = value[childrenPropName].findIndex(p => p.sort > item.sort)
31 | if (i === -1) {
32 | i = value[childrenPropName].length
33 | }
34 | value[childrenPropName].splice(i, 0, item)
35 | } else {
36 | value[childrenPropName] = []
37 | value[childrenPropName].push(item)
38 | }
39 | } else {
40 | appendTreeNode(value[childrenPropName], item, idPropName, parentPropName, childrenPropName)
41 | }
42 | }
43 | }
44 |
45 | const deleteFromTree = (list, id, idPropName = 'id', childrenPropName = 'children') => {
46 | if (!list || list == null || list.length <= 0) return true
47 | for (var i = 0; i < list.length; i++) {
48 | if (list[i][idPropName] === id) {
49 | list.splice(i, 1)
50 | return true
51 | } else {
52 | let result = deleteFromTree(list[i][childrenPropName], id, idPropName, childrenPropName)
53 | if (result) {
54 | return result
55 | }
56 | }
57 | }
58 | return false
59 | }
60 |
61 | const batchDeleteFromTree = (list, ids, idPropName = 'id', childrenPropName = 'children') => {
62 | if (!list || list == null || list.length <= 0) return
63 | if (!ids || ids == null || ids.length <= 0) return
64 | for (var i = 0; i < list.length; i++) {
65 | if (ids.findIndex(x => x === list[i][idPropName]) > -1) {
66 | list.splice(i, 1)
67 | i--
68 | continue
69 | } else {
70 | batchDeleteFromTree(list[i][childrenPropName], ids, idPropName, childrenPropName)
71 | }
72 | }
73 | }
74 |
75 | const updateTreeNode = (list, item, idPropName = 'id', childrenPropName = 'children') => {
76 | if (!list || list == null || list.length <= 0) return false
77 | for (var i = 0; i < list.length; i++) {
78 | if (list[i][idPropName] === item[idPropName]) {
79 | console.log(list[i][idPropName], item[idPropName])
80 | list.splice(i, 1, item)
81 | return true
82 | } else {
83 | let result = updateTreeNode(list[i][childrenPropName], item, idPropName, childrenPropName)
84 | if (result) {
85 | return result
86 | }
87 | }
88 | }
89 | return false
90 | }
91 |
92 | export default {
93 | methods: {
94 | findFromTree,
95 | appendTreeNode,
96 | deleteFromTree,
97 | updateTreeNode,
98 | batchDeleteFromTree
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/src/utils/index.js:
--------------------------------------------------------------------------------
1 | import pathToRegexp from 'path-to-regexp'
2 | import * as qiniu from 'qiniu-js'
3 | import http from '../request'
4 | import * as api from '../api'
5 | import {Message} from 'element-ui'
6 |
7 | export const qupload = (file, prefix = '') => {
8 | let options = {
9 | quality: 0.92,
10 | noCompressIfLarger: true
11 | // maxWidth: 1000,
12 | // maxHeight: 618
13 | }
14 |
15 | return new Promise((resolve, reject) => {
16 | let observer = {
17 | next (res) {
18 | // 接收上传进度信息
19 | },
20 | error (err) {
21 | // 上传错误后触发
22 | Message.error(err.message)
23 | reject(err)
24 | },
25 | complete (res) {
26 | // 接收上传完成后的后端返回信息
27 | resolve(res)
28 | }
29 | }
30 |
31 | http.get(api.UP_TOKEN).then(res => {
32 | if (file.name) {
33 | qiniu.compressImage(file, options).then(data => {
34 | let ext = file.name.split('.').pop()
35 | var observable = qiniu.upload(data.dist, prefix + (new Date()).getTime() + '.' + ext, res.uptoken, {}, {})
36 | observable.subscribe(observer) // 上传开始
37 | })
38 | } else {
39 | var observable = qiniu.upload(file, prefix + (new Date()).getTime() + '.jpg', res.uptoken, {}, {})
40 | observable.subscribe(observer) // 上传开始
41 | }
42 | }).catch(err => {
43 | reject(err)
44 | })
45 | })
46 | }
47 |
48 | export const getBaseUrl = (url) => {
49 | var reg = /^((\w+):\/\/([^/:]*)(?::(\d+))?)(.*)/
50 | reg.exec(url)
51 | return RegExp.$1
52 | }
53 |
54 | export const imgUrl = path => {
55 | // return `${process.env.WEBSITE}/storage/${path}`
56 | return `/storage/${path}`
57 | }
58 |
59 | export const keyMirror = (obj) => {
60 | let key
61 | let mirrored = {}
62 | if (obj && typeof obj === 'object') {
63 | for (key in obj) {
64 | if ({}.hasOwnProperty.call(obj, key)) {
65 | mirrored[ key ] = key
66 | }
67 | }
68 | }
69 | return mirrored
70 | }
71 |
72 | /**
73 | * 数组格式转树状结构
74 | * @param {array} array
75 | * @param {String} id
76 | * @param {String} pid
77 | * @param {String} children
78 | * @return {Array}
79 | */
80 | export const arrayToTree = (array, id = 'id', pid = 'pid', children = 'children') => {
81 | let data = array.map(item => ({ ...item }))
82 | let result = []
83 | let hash = {}
84 | data.forEach((item, index) => {
85 | hash[ data[ index ][ id ] ] = data[ index ]
86 | })
87 |
88 | data.forEach((item) => {
89 | let hashVP = hash[ item[ pid ] ]
90 | if (hashVP) {
91 | !hashVP[ children ] && (hashVP[ children ] = [])
92 | hashVP[ children ].push(item)
93 | } else {
94 | result.push(item)
95 | }
96 | })
97 | return result
98 | }
99 |
100 | export function getCurrentMenu (location, arrayMenu) {
101 | if (arrayMenu) {
102 | let current = []
103 | for (let i = 0; i < arrayMenu.length; i++) {
104 | const e = arrayMenu[i]
105 | const child = getCurrentMenu(location, e.children)
106 | if (child && child.length > 0) {
107 | child.push({ ...e, children: null })
108 | return child
109 | }
110 | if (e.href && pathToRegexp(e.href).exec(location)) {
111 | current.push({ ...e, children: null })
112 | return current
113 | }
114 | }
115 | return current
116 | }
117 | return null
118 | }
119 |
120 | export function randomStr () {
121 | return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15)
122 | }
123 |
--------------------------------------------------------------------------------
/src/components/panel.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
11 | 暂无内容显示
12 |
13 |
14 |
15 |
16 |
18 |
19 |
20 |
43 |
138 |
--------------------------------------------------------------------------------
/src/views/layout/layout.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
13 |
14 |
15 |
16 |
17 |
18 |
83 |
84 |
131 |
--------------------------------------------------------------------------------
/src/views/topics/index.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 |
27 | 删除
28 |
29 |
30 |
31 |
40 |
41 |
42 |
43 |
44 |
93 |
94 |
97 |
--------------------------------------------------------------------------------
/src/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Vuex from 'vuex'
3 | import * as api from 'api'
4 | import {getCurrentMenu} from '../utils'
5 | import http from '../request'
6 | import menus from '../assets/menus'
7 | // import {Message} from 'element-ui'
8 |
9 | Vue.use(Vuex)
10 |
11 | const store = new Vuex.Store({
12 | strict: true,
13 |
14 | state: {
15 | loading: false,
16 | menuList: {},
17 | sidebar: {
18 | collapsed: sessionStorage.getItem('state.sidebar.collapsed') === 'true',
19 | show: sessionStorage.getItem('state.sidebar.show') === 'true'
20 | },
21 | device: {
22 | isMobile: false
23 | },
24 | userInfo: localStorage.getItem('state.user.info') ? JSON.parse(localStorage.getItem('state.user.info')) : {name: '佚名'},
25 | currentMenus: [],
26 | token: localStorage.getItem('token')
27 | },
28 |
29 | getters: {
30 | loading: state => state.loading,
31 | menuList: state => state.menuList,
32 | sidebar: state => state.sidebar,
33 | userInfo: state => state.userInfo,
34 | device: state => state.device,
35 | currentMenus: state => state.currentMenus,
36 | token: state => state.token
37 | },
38 |
39 | mutations: {
40 | TOGGLE_DEVICE (state, isMobile) {
41 | state.device.isMobile = isMobile
42 | },
43 | TOGGLE_LOADING (state) {
44 | state.loading = !state.loading
45 | },
46 | LOAD_MENU (state, menu) {
47 | state.menuList = menu
48 | },
49 | LOAD_CURRENT_MENU (state, menu) {
50 | state.currentMenus = menu
51 | },
52 | SET_USER_INFO (state, info) {
53 | if (info) {
54 | state.userInfo = info
55 | localStorage.setItem('state.user.info', JSON.stringify(info))
56 | } else {
57 | state.userInfo = {name: '佚名'}
58 | localStorage.removeItem('state.user.info')
59 | }
60 | },
61 | TOGGLE_SIDEBAR (state, collapsed) {
62 | if (collapsed == null) {
63 | collapsed = !state.sidebar.collapsed
64 | }
65 | state.sidebar.collapsed = collapsed
66 | sessionStorage.setItem('state.sidebar.collapsed', collapsed)
67 | },
68 | TOGGLE_SIDEBAR_SHOW (state, show) {
69 | if (show == null) {
70 | state.sidebar.show = !state.sidebar.show
71 | } else {
72 | state.sidebar.show = show
73 | }
74 | sessionStorage.setItem('state.sidebar.show', state.sidebar.show)
75 | },
76 | SET_TOKEN: (state, token) => {
77 | if (token) {
78 | state.token = token
79 | localStorage.setItem('token', token)
80 | } else {
81 | state.token = null
82 | localStorage.removeItem('token')
83 | }
84 | }
85 | },
86 |
87 | actions: {
88 | toggleLoading: ({ commit }) => commit('TOGGLE_LOADING'),
89 | loadMenuList: ({ state, commit }) => {
90 | return new Promise((resolve, reject) => {
91 | commit('LOAD_MENU', menus)
92 | })
93 | },
94 | changeCurrentMenu: ({ state, commit }, { path, matched, fullPath }) => {
95 | const current = getCurrentMenu(path, menus)
96 | commit('LOAD_CURRENT_MENU', current.reverse())
97 | },
98 | login: ({ state, commit, dispatch }, params) => {
99 | return new Promise((resolve, reject) => {
100 | http.post(api.LOGIN, params).then(data => {
101 | commit('SET_TOKEN', data.data.token)
102 | commit('SET_USER_INFO', data.data.userInfo)
103 | resolve()
104 | }).catch(err => {
105 | reject(err)
106 | })
107 | })
108 | },
109 | logout: ({ state, commit, dispatch }) => {
110 | return new Promise((resolve, reject) => {
111 | commit('SET_TOKEN', null)
112 | commit('SET_USER_INFO', null)
113 | resolve()
114 | })
115 | }
116 | }
117 | })
118 |
119 | export default store
120 |
--------------------------------------------------------------------------------
/src/views/customers/edit.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
26 |
27 |
28 |
29 | 保存
30 |
31 | 取消
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
116 |
117 |
120 |
--------------------------------------------------------------------------------
/src/views/coupons/index.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 |
27 |
28 | 编辑
29 |
30 | 删除
31 |
32 |
33 |
34 |
43 |
44 |
45 |
46 |
47 |
99 |
100 |
103 |
--------------------------------------------------------------------------------
/src/views/orders/index.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 | 待评价
27 |
28 |
29 |
30 |
31 |
32 |
33 | 详情
34 |
35 |
36 |
37 |
38 |
47 |
48 |
49 |
50 |
51 |
97 |
98 |
101 |
--------------------------------------------------------------------------------
/src/views/addresses/index.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 |
27 |
28 | 编辑
29 |
30 | 删除
31 |
32 |
33 |
34 |
43 |
44 |
45 |
46 |
47 |
102 |
103 |
106 |
--------------------------------------------------------------------------------
/src/views/brands/index.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 |
27 |
28 |
29 |
30 |
31 | 编辑
32 |
33 | 删除
34 |
35 |
36 |
37 |
46 |
47 |
48 |
49 |
50 |
113 |
114 |
117 |
--------------------------------------------------------------------------------
/src/views/coupons/add.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
14 |
15 |
16 |
17 | 自动生成
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
32 |
33 |
34 |
35 |
41 |
42 |
43 |
44 |
52 |
53 |
54 |
55 | 保存
56 |
57 | 取消
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
141 |
142 |
145 |
--------------------------------------------------------------------------------
/src/views/products/index.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 | 否
27 |
28 |
29 |
30 |
31 | 是
32 | 否
33 |
34 |
35 |
36 |
37 |
38 |
39 | 编辑
40 |
41 | 删除
42 |
43 |
44 |
45 |
54 |
55 |
56 |
57 |
58 |
115 |
116 |
119 |
--------------------------------------------------------------------------------
/src/views/layout/sideMenu.vue:
--------------------------------------------------------------------------------
1 |
2 |
22 |
23 |
94 |
183 |
--------------------------------------------------------------------------------
/src/views/attributes/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 查询
6 | 新增
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | 编辑
15 | 删除
16 |
17 |
18 |
19 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
42 |
43 |
44 |
45 |
46 |
135 |
136 |
139 |
--------------------------------------------------------------------------------
/src/router/routes.js:
--------------------------------------------------------------------------------
1 | import dashboard from '../views/dashboard.vue'
2 | import notfound from '../components/404.vue'
3 | import login from '../views/login'
4 | import layout from '../views/layout/layout.vue'
5 | import products from '../views/products'
6 | import productAdd from '../views/products/add'
7 | import productEdit from '../views/products/edit'
8 | import categories from '../views/categories'
9 | import customers from '../views/customers'
10 | import customerAdd from '../views/customers/add'
11 | import customerEdit from '../views/customers/edit'
12 | import addresses from '../views/addresses'
13 | import addressAdd from '../views/addresses/add'
14 | import addressEdit from '../views/addresses/edit'
15 | import orders from '../views/orders'
16 | import ordersDeail from '../views/orders/detail'
17 | import couriers from '../views/couriers'
18 | import courierAdd from '../views/couriers/add'
19 | import courierEdit from '../views/couriers/edit'
20 | import topics from '../views/topics'
21 | import topicAdd from '../views/topics/add'
22 | import topicEdit from '../views/topics/edit'
23 | import employees from '../views/employees'
24 | import employeeAdd from '../views/employees/add'
25 | import employeeEdit from '../views/employees/edit'
26 | import attributes from '../views/attributes'
27 | import invoices from '../views/invoices'
28 | import invoiceEdit from '../views/invoices/edit'
29 | import coupons from '../views/coupons'
30 | import couponAdd from '../views/coupons/add'
31 | import couponEdit from '../views/coupons/edit'
32 | import brands from '../views/brands'
33 | import brandAdd from '../views/brands/add'
34 | import brandEdit from '../views/brands/edit'
35 | import ads from '../views/ads'
36 | import adAdd from '../views/ads/add'
37 | import adEdit from '../views/ads/edit'
38 |
39 | const routes = [
40 | {path: '/login', component: login},
41 | {
42 | path: '/',
43 | component: layout,
44 | redirect: '/home',
45 | children: [{
46 | path: 'home',
47 | component: dashboard
48 | }]
49 | },
50 | {
51 | path: '/products',
52 | component: layout,
53 | children: [{
54 | path: '',
55 | component: products
56 | }, {
57 | path: 'add',
58 | component: productAdd
59 | }, {
60 | path: 'edit/:id',
61 | component: productEdit
62 | }, {
63 | path: 'attributes',
64 | component: attributes
65 | }]
66 | },
67 | {
68 | path: '/categories',
69 | component: layout,
70 | children: [{
71 | path: '',
72 | component: categories
73 | }]
74 | },
75 | {
76 | path: '/customers',
77 | component: layout,
78 | children: [{
79 | path: '',
80 | component: customers
81 | }, {
82 | path: 'add',
83 | component: customerAdd
84 | }, {
85 | path: 'edit/:id',
86 | component: customerEdit
87 | }]
88 | },
89 | {
90 | path: '/addresses',
91 | component: layout,
92 | children: [{
93 | path: '',
94 | component: addresses
95 | }, {
96 | path: 'add',
97 | component: addressAdd
98 | }, {
99 | path: 'edit/:id',
100 | component: addressEdit
101 | }]
102 | },
103 | {
104 | path: '/orders',
105 | component: layout,
106 | children: [{
107 | path: '',
108 | component: orders
109 | }, {
110 | path: 'detail/:id',
111 | component: ordersDeail
112 | }]
113 | },
114 | {
115 | path: '/couriers',
116 | component: layout,
117 | children: [{
118 | path: '',
119 | component: couriers
120 | }, {
121 | path: 'add',
122 | component: courierAdd
123 | }, {
124 | path: 'edit/:id',
125 | component: courierEdit
126 | }]
127 | },
128 | {
129 | path: '/topics',
130 | component: layout,
131 | children: [{
132 | path: '',
133 | component: topics
134 | }, {
135 | path: 'add',
136 | component: topicAdd
137 | }, {
138 | path: 'edit/:id',
139 | component: topicEdit
140 | }]
141 | },
142 | {
143 | path: '/employees',
144 | component: layout,
145 | children: [{
146 | path: '',
147 | component: employees
148 | }, {
149 | path: 'add',
150 | component: employeeAdd
151 | }, {
152 | path: 'edit/:id',
153 | component: employeeEdit
154 | }]
155 | },
156 | {
157 | path: '/invoices',
158 | component: layout,
159 | children: [{
160 | path: '',
161 | component: invoices
162 | }, {
163 | path: 'edit/:id',
164 | component: invoiceEdit
165 | }]
166 | },
167 | {
168 | path: '/coupons',
169 | component: layout,
170 | children: [{
171 | path: '',
172 | component: coupons
173 | }, {
174 | path: 'add',
175 | component: couponAdd
176 | }, {
177 | path: 'edit/:id',
178 | component: couponEdit
179 | }]
180 | },
181 | {
182 | path: '/brands',
183 | component: layout,
184 | children: [{
185 | path: '',
186 | component: brands
187 | }, {
188 | path: 'add',
189 | component: brandAdd
190 | }, {
191 | path: 'edit/:id',
192 | component: brandEdit
193 | }]
194 | },
195 | {
196 | path: '/ads',
197 | component: layout,
198 | children: [{
199 | path: '',
200 | component: ads
201 | }, {
202 | path: 'add',
203 | component: adAdd
204 | }, {
205 | path: 'edit/:id',
206 | component: adEdit
207 | }]
208 | },
209 | {path: '*', component: notfound}
210 | ]
211 |
212 | export default routes
213 |
--------------------------------------------------------------------------------
/src/views/coupons/edit.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
33 |
34 |
40 |
41 |
42 |
43 |
51 |
52 |
53 |
54 | 保存
55 |
56 | 取消
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
159 |
160 |
163 |
--------------------------------------------------------------------------------
/src/views/ads/add.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
41 |
42 |
43 |
44 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
64 |
65 |
66 |
67 | 保存
68 |
69 | 取消
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
174 |
175 |
178 |
--------------------------------------------------------------------------------
/src/views/addresses/add.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
31 |
32 |
33 |
34 |
35 |
36 |
41 |
42 |
43 |
44 |
45 |
46 |
51 |
52 |
53 |
54 |
55 |
63 |
64 |
65 |
66 | 保存
67 |
68 | 取消
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
178 |
179 |
182 |
--------------------------------------------------------------------------------
/src/assets/menus.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "id": 1,
4 | "parentId": null,
5 | "sort": 0,
6 | "name": "首页",
7 | "href": "/home",
8 | "icon": "fa fa-home",
9 | "children": [],
10 | "isShow": "1"
11 | },
12 | {
13 | "id": 2,
14 | "parentId": null,
15 | "sort": 1,
16 | "name": "商品管理",
17 | "href": "/products",
18 | "icon": "fa fa-shopping-bag",
19 | "isShow": "1",
20 | "children": [
21 | {
22 | "id": 3,
23 | "parentId": 2,
24 | "sort": 0,
25 | "name": "商品列表",
26 | "href": "/products",
27 | "icon": "fa fa-shopping-bag",
28 | "children": [],
29 | "isShow": "1"
30 | },
31 | {
32 | "id": 21,
33 | "parentId": 2,
34 | "sort": 1,
35 | "name": "品牌管理",
36 | "href": "/brands",
37 | "icon": "fa fa-at",
38 | "children": [],
39 | "isShow": "1"
40 | },
41 | {
42 | "id": 21,
43 | "parentId": 2,
44 | "sort": 1,
45 | "name": "商品规格",
46 | "href": "/products/attributes",
47 | "icon": "fa fa-info",
48 | "children": [],
49 | "isShow": "1"
50 | },
51 | {
52 | "id": 14,
53 | "parentId": 3,
54 | "sort": 2,
55 | "name": "添加商品",
56 | "href": "/products/add",
57 | "icon": "fa fa-plus",
58 | "children": [],
59 | "isShow": "1"
60 | }
61 | ]
62 | },
63 | {
64 | "id": 4,
65 | "parentId": null,
66 | "sort": 2,
67 | "name": "分类管理",
68 | "href": "/categories",
69 | "icon": "fa fa-folder",
70 | "isShow": "1",
71 | "children": [
72 | {
73 | "id": 5,
74 | "parentId": 4,
75 | "sort": 0,
76 | "name": "分类列表",
77 | "href": "/categories",
78 | "icon": "fa fa-folder",
79 | "children": [],
80 | "isShow": "1"
81 | }
82 | ]
83 | },
84 | {
85 | "id": 12,
86 | "parentId": null,
87 | "sort": 6,
88 | "name": "专题管理",
89 | "href": "/articles",
90 | "icon": "fa fa-coffee",
91 | "isShow": "1",
92 | "children": [
93 | {
94 | "id": 13,
95 | "parentId": 12,
96 | "sort": 0,
97 | "name": "专题列表",
98 | "href": "/articles",
99 | "icon": "fa fa-coffee",
100 | "children": [],
101 | "isShow": "1"
102 | },
103 | {
104 | "id": 18,
105 | "parentId": 12,
106 | "sort": 0,
107 | "name": "添加专题",
108 | "href": "/articles/add",
109 | "icon": "fa fa-coffee",
110 | "children": [],
111 | "isShow": "1"
112 | }
113 | ]
114 | },
115 | {
116 | "id": 6,
117 | "parentId": null,
118 | "sort": 3,
119 | "name": "客户管理",
120 | "href": "/customers",
121 | "icon": "fa fa-users",
122 | "isShow": "1",
123 | "children": [
124 | {
125 | "id": 7,
126 | "parentId": 6,
127 | "sort": 0,
128 | "name": "客户列表",
129 | "href": "/customers",
130 | "icon": "fa fa-users",
131 | "children": [],
132 | "isShow": "1"
133 | },
134 | {
135 | "id": 15,
136 | "parentId": 6,
137 | "sort": 0,
138 | "name": "收货地址",
139 | "href": "/addresses",
140 | "icon": "fa fa-map-marker",
141 | "children": [
142 | {
143 | "id": 16,
144 | "parentId": 15,
145 | "sort": 0,
146 | "name": "地址列表",
147 | "href": "/addresses",
148 | "icon": "fa fa-map-marker",
149 | "children": [],
150 | "isShow": "1"
151 | }
152 | ],
153 | "isShow": "1"
154 | }
155 | ]
156 | },
157 | {
158 | "id": 8,
159 | "parentId": null,
160 | "sort": 4,
161 | "name": "订单管理",
162 | "href": "/orders",
163 | "icon": "fa fa-money",
164 | "isShow": "1",
165 | "children": [
166 | {
167 | "id": 9,
168 | "parentId": 8,
169 | "sort": 0,
170 | "name": "订单列表",
171 | "href": "/orders",
172 | "icon": "fa fa-money",
173 | "children": [],
174 | "isShow": "1"
175 | }
176 | ]
177 | },
178 | {
179 | "id": 24,
180 | "parentId": null,
181 | "sort": 0,
182 | "name": "优惠券管理",
183 | "href": "/coupons",
184 | "icon": "fa fa-ticket",
185 | "children": [
186 | {
187 | "id": 25,
188 | "parentId": 24,
189 | "sort": 0,
190 | "name": "优惠券列表",
191 | "href": "/coupons",
192 | "icon": "fa fa-ticket",
193 | "children": [],
194 | "isShow": "1"
195 | },
196 | {
197 | "id": 26,
198 | "parentId": 6,
199 | "sort": 0,
200 | "name": "添加优惠券",
201 | "href": "/coupons/add",
202 | "icon": "fa fa-plus",
203 | "children": [],
204 | "isShow": "1"
205 | }
206 | ],
207 | "isShow": "1"
208 | },
209 | {
210 | "id": 10,
211 | "parentId": null,
212 | "sort": 5,
213 | "name": "物流管理",
214 | "href": "/couriers",
215 | "icon": "fa fa-truck",
216 | "isShow": "1",
217 | "children": [
218 | {
219 | "id": 11,
220 | "parentId": 10,
221 | "sort": 0,
222 | "name": "快递列表",
223 | "href": "/couriers",
224 | "icon": "fa fa-truck",
225 | "children": [],
226 | "isShow": "1"
227 | },
228 | {
229 | "id": 17,
230 | "parentId": 10,
231 | "sort": 0,
232 | "name": "添加快递",
233 | "href": "/couriers/add",
234 | "icon": "fa fa-plus",
235 | "children": [],
236 | "isShow": "1"
237 | }
238 | ]
239 | },
240 | {
241 | "id": 100,
242 | "parentId": null,
243 | "sort": 5,
244 | "name": "广告管理",
245 | "href": "/ads",
246 | "icon": "fa fa-adn",
247 | "isShow": "1",
248 | "children": [
249 | {
250 | "id": 111,
251 | "parentId": 10,
252 | "sort": 0,
253 | "name": "广告列表",
254 | "href": "/ads",
255 | "icon": "fa fa-adn",
256 | "children": [],
257 | "isShow": "1"
258 | },
259 | {
260 | "id": 171,
261 | "parentId": 10,
262 | "sort": 0,
263 | "name": "添加广告",
264 | "href": "/ads/add",
265 | "icon": "fa fa-plus",
266 | "children": [],
267 | "isShow": "1"
268 | }
269 | ]
270 | },
271 | {
272 | "id": 19,
273 | "parentId": null,
274 | "sort": 6,
275 | "name": "系统设置",
276 | "href": "/employees",
277 | "icon": "fa fa-cog",
278 | "isShow": "1",
279 | "children": [
280 | {
281 | "id": 20,
282 | "parentId": 19,
283 | "sort": 0,
284 | "name": "管理员",
285 | "href": "/employees",
286 | "icon": "fa fa-user",
287 | "children": [],
288 | "isShow": "1"
289 | }
290 | ]
291 | }
292 | ]
--------------------------------------------------------------------------------
/src/views/brands/add.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
31 |
32 |
33 |
34 |
50 |
51 |
52 |
53 | 是
54 | 否
55 |
56 |
57 | 是
58 | 否
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 | 保存
68 |
69 | 取消
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
176 |
177 |
180 |
--------------------------------------------------------------------------------
/src/views/addresses/edit.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
31 |
32 |
33 |
34 |
35 |
36 |
41 |
42 |
43 |
44 |
45 |
46 |
51 |
52 |
53 |
54 |
55 |
63 |
64 |
65 |
66 | 保存
67 |
68 | 取消
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
199 |
200 |
203 |
--------------------------------------------------------------------------------
/src/views/ads/edit.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
41 |
42 |
43 |
44 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
64 |
65 |
66 |
67 | 保存
68 |
69 | 取消
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
198 |
199 |
202 |
--------------------------------------------------------------------------------
/src/views/login/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 | 元气小店
9 |
10 |
11 |
12 |
13 |
14 |
16 |
17 |
18 |
20 | 登录
21 |
22 |
23 |
24 | 元气小店 © 2018
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
177 |
255 |
--------------------------------------------------------------------------------
/src/views/ads/index.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 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | 是
38 | 否
39 |
40 |
41 |
42 |
43 |
44 |
45 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
64 |
65 |
66 |
67 |
68 |
185 |
186 |
189 |
--------------------------------------------------------------------------------
/src/views/brands/edit.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
31 |
32 |
33 |
34 |
50 |
51 |
52 |
53 | 是
54 | 否
55 |
56 |
57 | 是
58 | 否
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 | 保存
68 |
69 | 取消
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
199 |
200 |
203 |
--------------------------------------------------------------------------------
/src/views/layout/header.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 官网后台
5 |
6 |
31 |
32 |
33 |
34 |
118 |
321 |
--------------------------------------------------------------------------------
/src/views/customers/index.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 | 足迹
27 | 收藏
28 |
29 |
30 |
31 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
83 |
84 |
85 |
86 |
87 |
88 |
224 |
225 |
228 |
--------------------------------------------------------------------------------