{{item.productName}}
50 |¥{{item.salePrice}}
51 |├── .browserslistrc ├── public ├── favicon.ico └── index.html ├── src ├── assets │ ├── item.jpg │ ├── logo.png │ └── logo.svg ├── store │ └── index.js ├── main.js ├── router │ └── index.js ├── App.vue └── views │ ├── About.vue │ └── Home.vue ├── babel.config.js ├── server ├── views │ ├── index.pug │ ├── error.pug │ └── layout.pug ├── public │ └── stylesheets │ │ └── style.css ├── models │ ├── db.js │ ├── goods.js │ └── users.js ├── package.json ├── routes │ ├── goods.js │ └── users.js ├── app.js ├── bin │ └── www ├── README.md ├── resourse │ ├── goods-net.json │ └── dumall-users.json └── yarn.lock ├── .gitignore ├── .eslintrc.js ├── index.html ├── package.json ├── README.en.md ├── mongo └── readme.md └── README.md /.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-shop/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /src/assets/item.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-shop/HEAD/src/assets/item.jpg -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-shop/HEAD/src/assets/logo.png -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /server/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h1= title 5 | p Welcome to #{title} 6 | -------------------------------------------------------------------------------- /server/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h1= message 5 | h2= error.status 6 | pre #{error.stack} 7 | -------------------------------------------------------------------------------- /server/public/stylesheets/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 50px; 3 | font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; 4 | } 5 | 6 | a { 7 | color: #00B7FF; 8 | } 9 | -------------------------------------------------------------------------------- /server/views/layout.pug: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title= title 5 | link(rel='stylesheet', href='/stylesheets/style.css') 6 | body 7 | block content 8 | -------------------------------------------------------------------------------- /server/models/db.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | mongoose.connect( 'mongodb://127.0.0.1:27017/shop', {useNewUrlParser: true},(err)=>{ 3 | if(err) throw err; 4 | console.log("database连接成功") 5 | }); 6 | module.exports = mongoose; -------------------------------------------------------------------------------- /src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | 4 | Vue.use(Vuex) 5 | 6 | export default new Vuex.Store({ 7 | state: { 8 | }, 9 | mutations: { 10 | }, 11 | actions: { 12 | }, 13 | modules: { 14 | } 15 | }) 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /server/models/goods.js: -------------------------------------------------------------------------------- 1 | var mongoose = require('./db'); 2 | var GoodsSchema = new mongoose.Schema({ 3 | productId:String, 4 | productName:String, 5 | salePrice:Number, 6 | productImage:String, 7 | productUrl:String 8 | }) 9 | var Goods = mongoose.model('Goods',GoodsSchema,'goods'); 10 | module.exports = Goods; -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | 'extends': [ 7 | 'plugin:vue/essential', 8 | 'eslint:recommended' 9 | ], 10 | rules: { 11 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 12 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 13 | }, 14 | parserOptions: { 15 | parser: 'babel-eslint' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 |{{item.productName}}
18 |{{item.salePrice}}
20 |{{item.salePrice*item.productNum}}
22 |
26 |
合计:{{sum | format(2)}}
30 |{{successName}}
7 |{{item.gt}}-{{item.lt}}
43 |{{item.productName}}
50 |¥{{item.salePrice}}
51 |