├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .postcssrc.js ├── README.md ├── build ├── build.js ├── check-versions.js ├── logo.png ├── utils.js ├── vue-loader.conf.js ├── webpack.base.conf.js ├── webpack.dev.conf.js ├── webpack.prod.conf.js └── webpack.test.conf.js ├── config ├── dev.env.js ├── index.js └── prod.env.js ├── index.html ├── package.json ├── server ├── .babelrc ├── app.js ├── app │ ├── common │ │ ├── session.js │ │ └── utils.js │ ├── controllers │ │ ├── admin.js │ │ ├── dataMapping.js │ │ ├── seller.js │ │ ├── testDb.js │ │ └── user.js │ └── models │ │ ├── admin.js │ │ ├── dish_comment.js │ │ ├── dish_type.js │ │ ├── menu.js │ │ ├── shop.js │ │ ├── shop_apply.js │ │ ├── shop_order.js │ │ ├── shop_type.js │ │ ├── user.js │ │ └── user_order.js ├── bin │ └── www ├── config.js ├── crawler │ ├── README.md │ ├── crawler.js │ ├── foodRate │ ├── foodRate_o │ ├── foodRate_sql │ ├── shopInfo │ ├── shopInfo_o │ ├── shopInfo_sql │ ├── shopMenu │ ├── shopMenu_o │ ├── shopMenu_sql │ ├── shopsList │ ├── shopsList_o │ └── shopsList_sql ├── db_vue │ ├── admins.json │ ├── dishcomments.json │ ├── dishtypes.json │ ├── menumodels.json │ ├── shopapplies.json │ ├── shoporders.json │ ├── shops.json │ ├── shoptypes.json │ ├── userorders.json │ └── users.json ├── package.json ├── public │ ├── index.html │ ├── javascripts │ │ ├── fooDdata.js │ │ ├── testJWT.js │ │ └── testdownload.js │ ├── static │ │ ├── css │ │ │ └── app.cb090be6950ef695079d0a063305e6ab.css │ │ ├── fonts │ │ │ └── element-icons.6f0a763.ttf │ │ ├── img │ │ │ └── 1.ab11078.jpg │ │ ├── js │ │ │ ├── 1.e0e7d8260f527f4c17bc.js │ │ │ ├── 1.e6d79ddb0ba5832d4612.js │ │ │ ├── 10.4bdc792c9616e4210300.js │ │ │ ├── 11.232d6ed27b4daa7216f1.js │ │ │ ├── 12.cb21caf22b25f4e21ab7.js │ │ │ ├── 13.bb75dde68ca1e30acc1a.js │ │ │ ├── 14.8040bbccce72271f2009.js │ │ │ ├── 15.5c40c303f7e96438dcda.js │ │ │ ├── 16.e7ff66e143a00487dfbc.js │ │ │ ├── 17.169bd59f3099a790ee66.js │ │ │ ├── 18.747739e91cde3537bb78.js │ │ │ ├── 19.9497009632d9fb439fe4.js │ │ │ ├── 2.9867b95acc1fd98af6be.js │ │ │ ├── 2.eca250693d85be1f273b.js │ │ │ ├── 20.b96eaedd354247a92927.js │ │ │ ├── 21.1e2829bbbbb47f6f934a.js │ │ │ ├── 21.9d3fbc3737e892b9ebab.js │ │ │ ├── 22.3c811c1e89aa06feee79.js │ │ │ ├── 23.e07051c90e8f31c65493.js │ │ │ ├── 24.21e858a395bfb9a3f3cd.js │ │ │ ├── 24.25749dedc2138be982f8.js │ │ │ ├── 25.6fda17f0bd7282d4ee12.js │ │ │ ├── 25.c84756d83508cc2c10c4.js │ │ │ ├── 26.1fda9ceb0f20df549d6c.js │ │ │ ├── 27.36bb4559f7adf66e6c30.js │ │ │ ├── 27.7226dc9d5b0f827db870.js │ │ │ ├── 28.6356e29cd78a855f4426.js │ │ │ ├── 29.5f6e5b710481755ad4b5.js │ │ │ ├── 3.5b033e3ee1aeaa5fee27.js │ │ │ ├── 30.70e1a4a8d1e22d7bea22.js │ │ │ ├── 31.b5da52ea567d1c116bb2.js │ │ │ ├── 32.40367c84f21d5e458a42.js │ │ │ ├── 33.50b489c51332335f165b.js │ │ │ ├── 34.bd1c9f49708a42216c8c.js │ │ │ ├── 4.a5b0c492fd11e53066df.js │ │ │ ├── 5.25d90b8aa21186e49b50.js │ │ │ ├── 6.29efaab90f401f0b8c37.js │ │ │ ├── 6.6cf82f098f5c124f2e3a.js │ │ │ ├── 7.4e6843d28b51cd312750.js │ │ │ ├── 8.fccc0cd79f6c539ea81b.js │ │ │ ├── 9.27d4a35237e7c9e726e4.js │ │ │ ├── app.3d572280be9276c11550.js │ │ │ ├── app.c5153e5ca1e9b7a748e6.js │ │ │ ├── manifest.b0df8a62a07df746175b.js │ │ │ ├── manifest.cde5691c7607a91e792a.js │ │ │ ├── vendor-async.263fe98f092023284ba5.js │ │ │ └── vendor.6287184dc56e08c2d39d.js │ │ └── media │ │ │ └── song.15fd42e.mp3 │ ├── stylesheets │ │ └── style.css │ └── uploads │ │ ├── 1513227744069.jpg │ │ └── 1513267372733.jpg ├── routes │ └── index.js └── views │ ├── error.pug │ ├── index.pug │ └── layout.pug ├── src ├── App.vue ├── common │ ├── audio │ │ └── song.mp3 │ ├── images │ │ ├── 1.jpg │ │ └── 4.jpg │ ├── javascript │ │ ├── adminApi.js │ │ ├── apiList.js │ │ ├── baseApi.js │ │ ├── cache.js │ │ ├── config.js │ │ ├── geohash.js │ │ ├── index.html │ │ ├── sellerApi.js │ │ └── userApi.js │ └── style │ │ ├── base.sass │ │ ├── index.sass │ │ ├── reset.sass │ │ └── variable.sass ├── components │ ├── adminAudiDetailCard.vue │ ├── foodCard.vue │ ├── foodDetailCard.vue │ ├── rateCardItem.vue │ ├── resetPassword.vue │ ├── searchBox.vue │ ├── sellerFilter.vue │ ├── sellerFoodCard.vue │ ├── sellerOrderCard.vue │ ├── shopCard.vue │ ├── shopCartItem.vue │ ├── shopRate.vue │ ├── simpleRate.vue │ ├── userFooter.vue │ └── userHeader.vue ├── main.js ├── pages │ ├── admin │ │ ├── admin.vue │ │ ├── adminLogin.vue │ │ ├── administrator.vue │ │ ├── audit.vue │ │ ├── classification.vue │ │ ├── home.vue │ │ ├── pageNoFind.vue │ │ ├── shops.vue │ │ ├── statistics.vue │ │ └── user.vue │ ├── index.vue │ ├── login.vue │ ├── seller │ │ ├── home.vue │ │ ├── info.vue │ │ ├── menu.vue │ │ ├── new.vue │ │ ├── order.vue │ │ ├── pageNoFind.vue │ │ ├── rate.vue │ │ ├── revenue.vue │ │ ├── seller.vue │ │ ├── sellerFoodDetailCard.vue │ │ └── statistics.vue │ └── user │ │ ├── applyShop.vue │ │ ├── checkout.vue │ │ ├── home.vue │ │ ├── join.vue │ │ ├── order.vue │ │ ├── pageNoFind.vue │ │ ├── place.vue │ │ ├── profile.vue │ │ ├── rateCard.vue │ │ ├── register.vue │ │ ├── shop.vue │ │ ├── shopCart.vue │ │ ├── shopCartError.vue │ │ ├── shopCartPaying.vue │ │ ├── shopCartSuccess.vue │ │ └── userOrderCard.vue ├── router │ └── index.js └── store │ ├── admin │ ├── actions.js │ ├── getters.js │ ├── index.js │ ├── mutations-type.js │ ├── mutations.js │ └── state.js │ ├── index.js │ ├── seller │ ├── actions.js │ ├── getters.js │ ├── index.js │ ├── mutations-type.js │ ├── mutations.js │ └── state.js │ └── user │ ├── actions.js │ ├── getters.js │ ├── index.js │ ├── mutations-type.js │ ├── mutations.js │ └── state.js ├── static └── .gitkeep └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { 4 | "modules": false 5 | }], 6 | "stage-2" 7 | ], 8 | "plugins": ["transform-runtime"], 9 | "env": { 10 | "test": { 11 | "presets": ["env", "stage-2"] } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | /config/ 3 | /dist/ 4 | /*.js 5 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | // https://eslint.org/docs/user-guide/configuring 2 | 3 | module.exports = { 4 | root: true, 5 | parser: 'babel-eslint', 6 | parserOptions: { 7 | sourceType: 'module' 8 | }, 9 | env: { 10 | browser: true, 11 | }, 12 | // https://github.com/standard/standard/blob/master/docs/RULES-en.md 13 | extends: 'standard', 14 | // required to lint *.vue files 15 | plugins: [ 16 | 'html' 17 | ], 18 | // add your custom rules here 19 | 'rules': { 20 | // allow paren-less arrow functions 21 | 'arrow-parens': 0, 22 | // allow async-await 23 | 'generator-star-spacing': 0, 24 | // allow debugger during development 25 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.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 | 16 | server/config.js -------------------------------------------------------------------------------- /.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | // to edit target browsers: use "browserslist" field in package.json 6 | "postcss-import": {}, 7 | "autoprefixer": {} 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 关于项目 2 | 3 | 这是一个点餐系统,包含用户点餐、商家出餐、管理员管理三部分功能 4 | 这个项目本来是校内实训,需要用java编写,我负责一部分。但是我不太喜欢用java,且时间足够,就自己独自做了一份,用于学习。 5 | 项目的功能和需求是根据前期小组讨论出来的,也基本都是仿饿了么的 6 | 各项功能基本都实现了 7 | 线上地址:(比较慢)[47.93.254.91:3333](http://47.93.254.91:3333) 8 | 源码地址:[chihuobao](https://github.com/ooooevan/chihuobao) 9 | 10 | ```md 11 | 登录账号: 12 | 用户:12345678910 13 | 商家:11112222333 14 | 管理员:admin2 15 | 登录密码都是123456 16 | ``` 17 | 18 | ## 功能结构 19 | 20 | ![](https://ooooevan.github.io/2017/12/14/vue-koa2-mongodb%E7%82%B9%E9%A4%90%E7%B3%BB%E7%BB%9F%E6%80%BB%E7%BB%93/gongneng.png) 21 | ![](https://ooooevan.github.io/2017/12/14/vue-koa2-mongodb%E7%82%B9%E9%A4%90%E7%B3%BB%E7%BB%9F%E6%80%BB%E7%BB%93/0cengsheji.png) 22 | 23 | ## 调试运行 24 | 25 | ```node 26 | npm install 27 | npm run dev 28 | 29 | cd server #打开koa2后台,会开启3333端口 30 | npm install 31 | node bin/www 32 | ``` 33 | 34 | ```node 35 | npm run build #打包 36 | cp dist/* server/public/ #将打包好的文件放到koa2静态目录 37 | ``` 38 | 39 | ## 使用的框架、插件等 40 | 41 | * 用Vue-cli脚手架、vue-router、vuex 42 | * 用element-ui样式框架 43 | * 用axios发请求 44 | * 用koa2做后台,在node高版本直接用async、await 45 | * 用mongoose连接mongodb数据库 46 | 47 | ## 包含的功能 48 | 49 | * 手机注册,登录,重置密码 50 | * 用户点餐,该商家会收到消息提示有新订单(用轮询实现) 51 | * 用户查看自己的订单,评价、删除等 52 | * 修改自己的信息,申请成为商户等 53 | * 商家管理订单,接单等 54 | * 统计商家订单数,评分等(页面上的月销量是总销量) 55 | * 商家管理菜单、查看评论 56 | * 管理员管理用户、商铺、分类等 57 | * 搜索功能 58 | 59 | ## 页面截图 60 | 61 | ![](https://ooooevan.github.io/2017/12/14/vue-koa2-mongodb%E7%82%B9%E9%A4%90%E7%B3%BB%E7%BB%9F%E6%80%BB%E7%BB%93/place.png) 62 | ![](https://ooooevan.github.io/2017/12/14/vue-koa2-mongodb%E7%82%B9%E9%A4%90%E7%B3%BB%E7%BB%9F%E6%80%BB%E7%BB%93/order.png) 63 | ![](https://ooooevan.github.io/2017/12/14/vue-koa2-mongodb%E7%82%B9%E9%A4%90%E7%B3%BB%E7%BB%9F%E6%80%BB%E7%BB%93/seller.png) 64 | ![](https://ooooevan.github.io/2017/12/14/vue-koa2-mongodb%E7%82%B9%E9%A4%90%E7%B3%BB%E7%BB%9F%E6%80%BB%E7%BB%93/admin.png) 65 | 66 | ## 目录结构 67 | 68 | 顶层就是vue-cli的结构,主要看前端src和后台server的结构 69 | 70 | ``` md 71 | ─ src 72 | ├── common # 73 | │ ├── audio #音频 74 | │ ├── images #图片 75 | │ ├── javascript #api接口、cache、config等js文件 76 | │ ├── style #公用style 77 | ├── components #组件 78 | ├── pages #页面,处理业务,主要分为三个模块 79 | │ ├── admin 80 | │ ├── seller 81 | │ ├── user 82 | │ ├── index.vue 83 | │ ├── login.vue 84 | ├── router #路由 85 | │ ├── index.js 86 | ├── store #vuex的store,分了三个模块 87 | │ ├── admin 88 | │ ├── seller 89 | │ ├── user 90 | │ ├── index.js 91 | ├── App.vue 92 | ├── main.js 93 | ``` 94 | 95 | ```md 96 | ─ server 97 | ├── app 98 | ├── ├── common # 工具 99 | ├── ├── controllers # 业务 100 | ├── ├── models # 定义数据库模型 101 | ├── db_vue # 导出来的数据库数据 102 | ├── routes # 路由 103 | ├── app.js 104 | ├── config.js # 短信api的key相关 105 | 106 | ``` 107 | 108 | 具体可看[博客](https://ooooevan.github.io/2017/12/14/vue-koa2-mongodb%E7%82%B9%E9%A4%90%E7%B3%BB%E7%BB%9F%E6%80%BB%E7%BB%93/) 109 | 如果有错,望指正,若觉得还可以,可以点个star -------------------------------------------------------------------------------- /build/build.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | require('./check-versions')() 3 | 4 | process.env.NODE_ENV = 'production' 5 | 6 | const ora = require('ora') 7 | const rm = require('rimraf') 8 | const path = require('path') 9 | const chalk = require('chalk') 10 | const webpack = require('webpack') 11 | const config = require('../config') 12 | const webpackConfig = require('./webpack.prod.conf') 13 | 14 | const spinner = ora('building for production...') 15 | spinner.start() 16 | 17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { 18 | if (err) throw err 19 | webpack(webpackConfig, function (err, stats) { 20 | spinner.stop() 21 | if (err) throw err 22 | process.stdout.write(stats.toString({ 23 | colors: true, 24 | modules: false, 25 | children: false, 26 | chunks: false, 27 | chunkModules: false 28 | }) + '\n\n') 29 | 30 | if (stats.hasErrors()) { 31 | console.log(chalk.red(' Build failed with errors.\n')) 32 | process.exit(1) 33 | } 34 | 35 | console.log(chalk.cyan(' Build complete.\n')) 36 | console.log(chalk.yellow( 37 | ' Tip: built files are meant to be served over an HTTP server.\n' + 38 | ' Opening index.html over file:// won\'t work.\n' 39 | )) 40 | }) 41 | }) 42 | -------------------------------------------------------------------------------- /build/check-versions.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const chalk = require('chalk') 3 | const semver = require('semver') 4 | const packageConfig = require('../package.json') 5 | const shell = require('shelljs') 6 | function exec (cmd) { 7 | return require('child_process').execSync(cmd).toString().trim() 8 | } 9 | 10 | const versionRequirements = [ 11 | { 12 | name: 'node', 13 | currentVersion: semver.clean(process.version), 14 | versionRequirement: packageConfig.engines.node 15 | } 16 | ] 17 | 18 | if (shell.which('npm')) { 19 | versionRequirements.push({ 20 | name: 'npm', 21 | currentVersion: exec('npm --version'), 22 | versionRequirement: packageConfig.engines.npm 23 | }) 24 | } 25 | 26 | module.exports = function () { 27 | const warnings = [] 28 | for (let i = 0; i < versionRequirements.length; i++) { 29 | const mod = versionRequirements[i] 30 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 31 | warnings.push(mod.name + ': ' + 32 | chalk.red(mod.currentVersion) + ' should be ' + 33 | chalk.green(mod.versionRequirement) 34 | ) 35 | } 36 | } 37 | 38 | if (warnings.length) { 39 | console.log('') 40 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 41 | console.log() 42 | for (let i = 0; i < warnings.length; i++) { 43 | const warning = warnings[i] 44 | console.log(' ' + warning) 45 | } 46 | console.log() 47 | process.exit(1) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /build/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ooooevan/chihuobao/58d8678e96751b649857665b14dbeaf6a5001761/build/logo.png -------------------------------------------------------------------------------- /build/utils.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const config = require('../config') 4 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 5 | const pkg = require('../package.json') 6 | 7 | exports.assetsPath = function (_path) { 8 | const assetsSubDirectory = process.env.NODE_ENV === 'production' 9 | ? config.build.assetsSubDirectory 10 | : config.dev.assetsSubDirectory 11 | return path.posix.join(assetsSubDirectory, _path) 12 | } 13 | 14 | exports.cssLoaders = function (options) { 15 | options = options || {} 16 | 17 | const cssLoader = { 18 | loader: 'css-loader', 19 | options: { 20 | sourceMap: options.sourceMap 21 | } 22 | } 23 | 24 | var postcssLoader = { 25 | loader: 'postcss-loader', 26 | options: { 27 | sourceMap: options.sourceMap 28 | } 29 | } 30 | 31 | // generate loader string to be used with extract text plugin 32 | function generateLoaders (loader, loaderOptions) { 33 | const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] 34 | if (loader) { 35 | loaders.push({ 36 | loader: loader + '-loader', 37 | options: Object.assign({}, loaderOptions, { 38 | sourceMap: options.sourceMap 39 | }) 40 | }) 41 | } 42 | 43 | // Extract CSS when that option is specified 44 | // (which is the case during production build) 45 | if (options.extract) { 46 | return ExtractTextPlugin.extract({ 47 | use: loaders, 48 | fallback: 'vue-style-loader' 49 | }) 50 | } else { 51 | return ['vue-style-loader'].concat(loaders) 52 | } 53 | } 54 | 55 | // https://vue-loader.vuejs.org/en/configurations/extract-css.html 56 | return { 57 | css: generateLoaders(), 58 | postcss: generateLoaders(), 59 | less: generateLoaders('less'), 60 | sass: generateLoaders('sass', { indentedSyntax: true }), 61 | scss: generateLoaders('sass'), 62 | stylus: generateLoaders('stylus'), 63 | styl: generateLoaders('stylus') 64 | } 65 | } 66 | 67 | // Generate loaders for standalone style files (outside of .vue) 68 | exports.styleLoaders = function (options) { 69 | const output = [] 70 | const loaders = exports.cssLoaders(options) 71 | for (const extension in loaders) { 72 | const loader = loaders[extension] 73 | output.push({ 74 | test: new RegExp('\\.' + extension + '$'), 75 | use: loader 76 | }) 77 | } 78 | return output 79 | } 80 | 81 | exports.createNotifierCallback = function () { 82 | const notifier = require('node-notifier') 83 | 84 | return (severity, errors) => { 85 | if (severity !== 'error') { 86 | return 87 | } 88 | const error = errors[0] 89 | 90 | const filename = error.file.split('!').pop() 91 | notifier.notify({ 92 | title: pkg.name, 93 | message: severity + ': ' + error.name, 94 | subtitle: filename || '', 95 | icon: path.join(__dirname, 'logo.png') 96 | }) 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /build/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const config = require('../config') 4 | const isProduction = process.env.NODE_ENV === 'production' 5 | const sourceMapEnabled = isProduction 6 | ? config.build.productionSourceMap 7 | : config.dev.cssSourceMap 8 | 9 | 10 | module.exports = { 11 | loaders: utils.cssLoaders({ 12 | sourceMap: sourceMapEnabled, 13 | extract: isProduction 14 | }), 15 | cssSourceMap: sourceMapEnabled, 16 | transformToRequire: { 17 | video: 'src', 18 | source: 'src', 19 | img: 'src', 20 | image: 'xlink:href' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const utils = require('./utils') 4 | const config = require('../config') 5 | const vueLoaderConfig = require('./vue-loader.conf') 6 | 7 | function resolve (dir) { 8 | return path.join(__dirname, '..', dir) 9 | } 10 | 11 | module.exports = { 12 | context: path.resolve(__dirname, '../'), 13 | entry: { 14 | app: './src/main.js' 15 | }, 16 | output: { 17 | path: config.build.assetsRoot, 18 | filename: '[name].js', 19 | publicPath: process.env.NODE_ENV === 'production' 20 | ? config.build.assetsPublicPath 21 | : config.dev.assetsPublicPath 22 | }, 23 | resolve: { 24 | extensions: ['.js', '.vue', '.json'], 25 | alias: { 26 | '@': resolve('src'), 27 | 'common': resolve('src/common'), 28 | 'components': resolve('src/components'), 29 | 'pages': resolve('src/pages'), 30 | 'store': resolve('src/store'), 31 | 'router': resolve('src/router') 32 | } 33 | }, 34 | module: { 35 | rules: [ 36 | ...(config.dev.useEslint? [{ 37 | test: /\.(js|vue)$/, 38 | loader: 'eslint-loader', 39 | enforce: 'pre', 40 | include: [resolve('src'), resolve('test')], 41 | options: { 42 | formatter: require('eslint-friendly-formatter'), 43 | emitWarning: !config.dev.showEslintErrorsInOverlay 44 | } 45 | }] : []), 46 | { 47 | test: /\.vue$/, 48 | loader: 'vue-loader', 49 | options: vueLoaderConfig 50 | }, 51 | { 52 | test: /\.js$/, 53 | loader: 'babel-loader', 54 | include: [resolve('src'), resolve('test')] 55 | }, 56 | { 57 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 58 | loader: 'url-loader', 59 | options: { 60 | limit: 10000, 61 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 62 | } 63 | }, 64 | { 65 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, 66 | loader: 'url-loader', 67 | options: { 68 | limit: 10000, 69 | name: utils.assetsPath('media/[name].[hash:7].[ext]') 70 | } 71 | }, 72 | { 73 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 74 | loader: 'url-loader', 75 | options: { 76 | limit: 10000, 77 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 78 | } 79 | } 80 | ] 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const webpack = require('webpack') 4 | const config = require('../config') 5 | const merge = require('webpack-merge') 6 | const baseWebpackConfig = require('./webpack.base.conf') 7 | const HtmlWebpackPlugin = require('html-webpack-plugin') 8 | const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') 9 | const portfinder = require('portfinder') 10 | 11 | const devWebpackConfig = merge(baseWebpackConfig, { 12 | module: { 13 | rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) 14 | }, 15 | // cheap-module-eval-source-map is faster for development 16 | devtool: config.dev.devtool, 17 | 18 | // these devServer options should be customized in /config/index.js 19 | devServer: { 20 | clientLogLevel: 'warning', 21 | historyApiFallback: true, 22 | hot: true, 23 | host: process.env.HOST || config.dev.host, 24 | port: process.env.PORT || config.dev.port, 25 | open: config.dev.autoOpenBrowser, 26 | overlay: config.dev.errorOverlay ? { 27 | warnings: false, 28 | errors: true, 29 | } : false, 30 | publicPath: config.dev.assetsPublicPath, 31 | proxy: config.dev.proxyTable, 32 | quiet: true, // necessary for FriendlyErrorsPlugin 33 | watchOptions: { 34 | poll: config.dev.poll, 35 | } 36 | }, 37 | plugins: [ 38 | new webpack.DefinePlugin({ 39 | 'process.env': require('../config/dev.env') 40 | }), 41 | new webpack.HotModuleReplacementPlugin(), 42 | new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. 43 | new webpack.NoEmitOnErrorsPlugin(), 44 | // https://github.com/ampedandwired/html-webpack-plugin 45 | new HtmlWebpackPlugin({ 46 | filename: 'index.html', 47 | template: 'index.html', 48 | inject: true 49 | }), 50 | ] 51 | }) 52 | 53 | module.exports = new Promise((resolve, reject) => { 54 | portfinder.basePort = process.env.PORT || config.dev.port 55 | portfinder.getPort((err, port) => { 56 | if (err) { 57 | reject(err) 58 | } else { 59 | // publish the new Port, necessary for e2e tests 60 | process.env.PORT = port 61 | // add port to devServer config 62 | devWebpackConfig.devServer.port = port 63 | 64 | // Add FriendlyErrorsPlugin 65 | devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ 66 | compilationSuccessInfo: { 67 | messages: [`Your application is running here: http://${config.dev.host}:${port}`], 68 | }, 69 | onErrors: config.dev.notifyOnErrors 70 | ? utils.createNotifierCallback() 71 | : undefined 72 | })) 73 | 74 | resolve(devWebpackConfig) 75 | } 76 | }) 77 | }) 78 | -------------------------------------------------------------------------------- /build/webpack.test.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | // This is the webpack config used for unit tests. 3 | 4 | const utils = require('./utils') 5 | const webpack = require('webpack') 6 | const merge = require('webpack-merge') 7 | const baseWebpackConfig = require('./webpack.base.conf') 8 | 9 | const webpackConfig = merge(baseWebpackConfig, { 10 | // use inline sourcemap for karma-sourcemap-loader 11 | module: { 12 | rules: utils.styleLoaders() 13 | }, 14 | devtool: '#inline-source-map', 15 | resolveLoader: { 16 | alias: { 17 | // necessary to to make lang="scss" work in test when using vue-loader's ?inject option 18 | // see discussion at https://github.com/vuejs/vue-loader/issues/724 19 | 'scss-loader': 'sass-loader' 20 | } 21 | }, 22 | plugins: [ 23 | new webpack.DefinePlugin({ 24 | 'process.env': require('../config/test.env') 25 | }) 26 | ] 27 | }) 28 | 29 | // no need for app entry during tests 30 | delete webpackConfig.entry 31 | 32 | module.exports = webpackConfig 33 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /config/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | // Template version: 1.2.3 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.HOST, 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 | // Use Eslint Loader? 24 | // If true, your code will be linted during bundling and 25 | // linting errors and warnings will be shown in the console. 26 | useEslint: true, 27 | // If true, eslint errors and warnings will also be shown in the error overlay 28 | // in the browser. 29 | showEslintErrorsInOverlay: false, 30 | 31 | /** 32 | * Source Maps 33 | */ 34 | 35 | // https://webpack.js.org/configuration/devtool/#development 36 | devtool: 'eval-source-map', 37 | 38 | // If you have problems debugging vue-files in devtools, 39 | // set this to false - it *may* help 40 | // https://vue-loader.vuejs.org/en/options.html#cachebusting 41 | cacheBusting: true, 42 | 43 | // CSS Sourcemaps off by default because relative paths are "buggy" 44 | // with this option, according to the CSS-Loader README 45 | // (https://github.com/webpack/css-loader#sourcemaps) 46 | // In our experience, they generally work as expected, 47 | // just be aware of this issue when enabling this option. 48 | cssSourceMap: false, 49 | }, 50 | 51 | build: { 52 | // Template for index.html 53 | index: path.resolve(__dirname, '../dist/index.html'), 54 | 55 | // Paths 56 | assetsRoot: path.resolve(__dirname, '../dist'), 57 | assetsSubDirectory: 'static', 58 | assetsPublicPath: '/', 59 | 60 | /** 61 | * Source Maps 62 | */ 63 | 64 | productionSourceMap: false, 65 | // https://webpack.js.org/configuration/devtool/#production 66 | devtool: '#source-map', 67 | 68 | // Gzip off by default as many popular static hosts such as 69 | // Surge or Netlify already gzip all static assets for you. 70 | // Before setting to `true`, make sure to: 71 | // npm install --save-dev compression-webpack-plugin 72 | productionGzip: false, 73 | productionGzipExtensions: ['js', 'css'], 74 | 75 | // Run the build command with an extra argument to 76 | // View the bundle analyzer report after build finishes: 77 | // `npm run build --report` 78 | // Set to `true` or `false` to always turn it on or off 79 | bundleAnalyzerReport: process.env.npm_config_report 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /config/prod.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = { 3 | NODE_ENV: '"production"' 4 | } 5 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 吃货宝 6 | 7 | 8 |
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chihuobao", 3 | "version": "1.0.0", 4 | "description": "A Vue.js project", 5 | "author": "ooooevan <635638508@qq.com>", 6 | "private": true, 7 | "scripts": { 8 | "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", 9 | "dev1": "node build/dev-server.js", 10 | "start": "npm run dev", 11 | "lint": "eslint --ext .js,.vue src", 12 | "build": "node build/build.js" 13 | }, 14 | "dependencies": { 15 | "axios": "^0.17.1", 16 | "babel-polyfill": "^6.26.0", 17 | "bcryptjs": "^2.4.3", 18 | "element-ui": "^2.0.5", 19 | "good-storage": "^1.0.1", 20 | "jsonp": "^0.2.1", 21 | "moment": "^2.19.4", 22 | "sass-loader": "^6.0.6", 23 | "vue": "^2.5.2", 24 | "vue-router": "^3.0.1", 25 | "vuex": "^3.0.1" 26 | }, 27 | "devDependencies": { 28 | "autoprefixer": "^7.1.2", 29 | "babel-core": "^6.22.1", 30 | "babel-eslint": "^7.1.1", 31 | "babel-loader": "^7.1.1", 32 | "babel-plugin-transform-runtime": "^6.22.0", 33 | "babel-preset-env": "^1.3.2", 34 | "babel-preset-stage-2": "^6.22.0", 35 | "babel-register": "^6.22.0", 36 | "chalk": "^2.0.1", 37 | "copy-webpack-plugin": "^4.0.1", 38 | "css-loader": "^0.28.0", 39 | "eslint": "^3.19.0", 40 | "eslint-config-standard": "^10.2.1", 41 | "eslint-friendly-formatter": "^3.0.0", 42 | "eslint-loader": "^1.7.1", 43 | "eslint-plugin-html": "^3.0.0", 44 | "eslint-plugin-import": "^2.7.0", 45 | "eslint-plugin-node": "^5.2.0", 46 | "eslint-plugin-promise": "^3.4.0", 47 | "eslint-plugin-standard": "^3.0.1", 48 | "eventsource-polyfill": "^0.9.6", 49 | "extract-text-webpack-plugin": "^3.0.0", 50 | "file-loader": "^1.1.4", 51 | "friendly-errors-webpack-plugin": "^1.6.1", 52 | "html-webpack-plugin": "^2.30.1", 53 | "node-notifier": "^5.1.2", 54 | "node-sass": "^4.6.1", 55 | "optimize-css-assets-webpack-plugin": "^3.2.0", 56 | "ora": "^1.2.0", 57 | "portfinder": "^1.0.13", 58 | "postcss-import": "^11.0.0", 59 | "postcss-loader": "^2.0.8", 60 | "rimraf": "^2.6.0", 61 | "semver": "^5.3.0", 62 | "shelljs": "^0.7.6", 63 | "url-loader": "^0.5.8", 64 | "vue-loader": "^13.3.0", 65 | "vue-style-loader": "^3.0.1", 66 | "vue-template-compiler": "^2.5.2", 67 | "webpack": "^3.6.0", 68 | "webpack-bundle-analyzer": "^2.9.0", 69 | "webpack-dev-server": "^2.9.1", 70 | "webpack-merge": "^4.1.0" 71 | }, 72 | "engines": { 73 | "node": ">= 4.0.0", 74 | "npm": ">= 3.0.0" 75 | }, 76 | "browserslist": [ 77 | "> 1%", 78 | "last 2 versions", 79 | "not ie <= 8" 80 | ] 81 | } 82 | -------------------------------------------------------------------------------- /server/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["latest"] 3 | } -------------------------------------------------------------------------------- /server/app/common/session.js: -------------------------------------------------------------------------------- 1 | class User { 2 | constructor (user, code) { 3 | this.db = user 4 | this.code = code 5 | } 6 | } 7 | module.exports = User 8 | -------------------------------------------------------------------------------- /server/app/common/utils.js: -------------------------------------------------------------------------------- 1 | exports.registerName = () => { 2 | return new Date().getTime().toString(32) 3 | } 4 | -------------------------------------------------------------------------------- /server/app/controllers/dataMapping.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | codeToMessage: { 3 | 0: 'error', 4 | 1: 'no error', 5 | 603: 'the number has registered', 6 | 3: 'identifying code error', 7 | 4: 'Incorrect username or password', 8 | 5: 'Verification code error' 9 | }, 10 | is_merchant: { 11 | 0: '普通用户', 12 | 1: '商户' // 由普通用户升级为商户,即普通用户申请开店 13 | }, 14 | order_is_comment: { // 在订单标记是否已评论 15 | 0: '未评论', 16 | 1: '已评论' 17 | }, 18 | orderStatus: { 19 | 1: '未支付', 20 | 3: '商家未接单', 21 | 4: '商家已接单', 22 | 2: '已完成', 23 | 5: '已取消', 24 | 6: '已删除', 25 | 7: '不接单' 26 | }, 27 | shopApplyStatus: { 28 | 0: '未审核', 29 | 1: '审核通过', 30 | 2: '审核不通过' 31 | }, 32 | shopStatus: { 33 | 0: '营业', 34 | 1: '被冻结', 35 | 2: '休息' 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /server/app/models/admin.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose') 2 | const bcrypt = require('bcrypt') 3 | 4 | const SALT_WORK_FACTOR = 10 5 | 6 | const Admin = new mongoose.Schema({ 7 | admin_name: String, 8 | admin_pwd: String, 9 | merchant_mp: { 10 | type: Number, 11 | default: 0 12 | }, 13 | shop_type_mp: { 14 | type: Number, 15 | default: 0 16 | }, 17 | shop_mp: { 18 | type: Number, 19 | default: 0 20 | }, 21 | food_type_mp: { 22 | type: Number, 23 | default: 0 24 | }, 25 | is_super: { 26 | type: Number, 27 | default: 0 28 | }, 29 | create_at: { 30 | type: Date, 31 | default: Date.now() 32 | } 33 | }) 34 | 35 | Admin.pre('save', function (next) { 36 | const admin = this 37 | this.create_at = Date.now() 38 | bcrypt.genSalt(SALT_WORK_FACTOR, function (err, salt) { 39 | if (err) return next(err) 40 | bcrypt.hash(admin.admin_pwd, salt, function (err, hash) { 41 | if (err) return next(err) 42 | admin.admin_pwd = hash 43 | next() 44 | }) 45 | }) 46 | }) 47 | 48 | Admin.methods = { 49 | // 第一个参数是传入的(未加密的),第二个是数据库中的(是已经加密的) 50 | comparePassword: function (_pass, pass) { 51 | return new Promise((resolve, reject) => { 52 | bcrypt.compare(_pass, pass, (err, isMatch) => { 53 | if (!err) { 54 | resolve(isMatch) 55 | } else { 56 | reject(err) 57 | } 58 | }) 59 | }) 60 | } 61 | } 62 | 63 | module.exports = mongoose.model('Admin', Admin) 64 | -------------------------------------------------------------------------------- /server/app/models/dish_comment.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose') 2 | 3 | const Schema = mongoose.Schema 4 | const ObjectId = Schema.Types.ObjectId 5 | 6 | const DishComment = new mongoose.Schema({ 7 | dish_id: { 8 | type: ObjectId, 9 | ref: 'MenuModel' 10 | }, 11 | shop_id: { 12 | type: ObjectId, 13 | ref: 'Shop' 14 | }, 15 | order_id: { 16 | type: ObjectId, 17 | ref: 'UserOrder' 18 | }, 19 | user_id: { 20 | type: ObjectId, 21 | ref: 'User' 22 | }, 23 | level: { 24 | type: Number, 25 | default: 0 26 | }, 27 | comment: String, 28 | comment_date: { 29 | type: Date, 30 | default: Date.now() 31 | } 32 | }) 33 | 34 | module.exports = mongoose.model('DishComment', DishComment) 35 | -------------------------------------------------------------------------------- /server/app/models/dish_type.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose') 2 | 3 | const DishType = new mongoose.Schema({ 4 | type: String, 5 | create_time: { 6 | type: Date, 7 | default: Date.now() 8 | } 9 | }) 10 | 11 | module.exports = mongoose.model('DishType', DishType) 12 | -------------------------------------------------------------------------------- /server/app/models/menu.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose') 2 | const Schema = mongoose.Schema 3 | const ObjectId = Schema.Types.ObjectId 4 | 5 | const Menu = new mongoose.Schema({ 6 | shop_id: { 7 | type: ObjectId, 8 | ref: 'Shop' 9 | }, 10 | dish_name: String, 11 | dish_introduction: String, 12 | dish_price: Number, 13 | dish_pics: String, 14 | level: Number, // 商品平均评价,实际存的是累加评价,请求数据时会计算 15 | comment_sales: { // 评价了的数量,用于计算平均分数 16 | type: Number, 17 | default: 0 18 | }, 19 | dish_type: { 20 | type: ObjectId, 21 | ref: 'DishType' 22 | }, 23 | create_time: { 24 | type: Date, 25 | default: Date.now() 26 | }, 27 | monthly_sales: { // 这是累加量,不按月,一直加 28 | type: Number, 29 | default: 0 30 | } 31 | }) 32 | module.exports = mongoose.model('MenuModel', Menu) 33 | -------------------------------------------------------------------------------- /server/app/models/shop.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose') 2 | const Schema = mongoose.Schema 3 | const ObjectId = Schema.Types.ObjectId 4 | 5 | const Shop = new mongoose.Schema({ 6 | user_id: { 7 | type: ObjectId, 8 | ref: 'User' 9 | }, 10 | shop_name: String, 11 | shop_logo: String, 12 | shop_type: String, 13 | shop_abstract: String, 14 | shop_location: String, 15 | shop_announcement: String, 16 | shop_status: { 17 | type: Number, 18 | default: 0 19 | }, 20 | shop_phone: Number, 21 | shop_work_time: String, 22 | shop_delivery_cost: Number, 23 | shop_delivery_time: Number, 24 | shop_start_delivery: String, 25 | shop_stores_images: String, 26 | shop_detail_images: String, 27 | shop_longitude: Number, 28 | shop_latitude: Number, 29 | level: { // 保存的是累加评分,请求时再做平均计算 30 | type: Number, 31 | default: 0 32 | }, 33 | total_time: Number, // 累计的配送时间,用来算平均配送时间 34 | monthly_sales: { 35 | type: Number, 36 | default: 0 37 | }, 38 | comment_sales: { // 被评价的菜的数量,用于计算商铺平均分 39 | type: Number, 40 | default: 0 41 | }, 42 | create_time: { 43 | type: Date, 44 | default: new Date() 45 | } 46 | }) 47 | 48 | module.exports = mongoose.model('Shop', Shop) 49 | -------------------------------------------------------------------------------- /server/app/models/shop_apply.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose') 2 | const Schema = mongoose.Schema 3 | const ObjectId = Schema.Types.ObjectId 4 | 5 | const Apply = new mongoose.Schema({ 6 | user_id: { 7 | type: ObjectId, 8 | ref: 'User' 9 | }, 10 | identification_num: String, // 身份证号码 11 | identification_pic: String, // 身份证照片 12 | shop_name: String, 13 | shop_logo: String, 14 | shop_abstract: String, 15 | shop_location: String, 16 | shop_auth_images: String, // 门面照 17 | shop_type: String, 18 | shop_longitude: Number, 19 | shop_latitude: Number, 20 | create_time: { 21 | type: Date, 22 | default: Date.now() 23 | }, 24 | status: { 25 | type: Number, 26 | default: 0 27 | } 28 | }) 29 | 30 | module.exports = mongoose.model('ShopApply', Apply) 31 | -------------------------------------------------------------------------------- /server/app/models/shop_order.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose') 2 | 3 | const Schema = mongoose.Schema 4 | const ObjectId = Schema.Types.ObjectId 5 | 6 | const ShopOrder = new mongoose.Schema({ 7 | _id: { 8 | type: ObjectId, 9 | ref: 'UserOrder' 10 | }, 11 | user_id: { 12 | type: ObjectId, 13 | ref: 'User' 14 | }, 15 | shop_id: { 16 | type: ObjectId, 17 | ref: 'Shop' 18 | }, 19 | food_list: String, 20 | order_amount: Number, 21 | order_status: { 22 | type: Number, 23 | default: 1 24 | }, 25 | is_comment: { 26 | type: Number, 27 | default: 0 28 | }, 29 | order_update_time: { 30 | type: Date, 31 | default: Date.now() 32 | }, 33 | order_create_time: { 34 | type: Date, 35 | default: Date.now() 36 | }, 37 | total_time: { // 累计配送的分钟数,用于求平均送达时间 38 | type: Number, 39 | default: 0 40 | }, 41 | order_remarks: String, 42 | accept_address: String 43 | }) 44 | ShopOrder.pre('save', function (next) { 45 | this.order_update_time = Date.now() 46 | next() 47 | }) 48 | module.exports = mongoose.model('ShopOrder', ShopOrder) 49 | -------------------------------------------------------------------------------- /server/app/models/shop_type.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose') 2 | 3 | const ShopType = new mongoose.Schema({ 4 | type: String, 5 | create_time: { 6 | type: Date, 7 | default: Date.now() 8 | } 9 | }) 10 | 11 | module.exports = mongoose.model('ShopType', ShopType) 12 | -------------------------------------------------------------------------------- /server/app/models/user.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose') 2 | const bcrypt = require('bcrypt') 3 | const SALT_WORK_FACTOR = 10 4 | 5 | const UserSchema = new mongoose.Schema({ 6 | user_name: { 7 | type: String 8 | }, 9 | user_pwd: String, 10 | phone_num: { 11 | type: Number, 12 | unique: true 13 | }, 14 | avator: String, 15 | gender: { 16 | type: Number, 17 | default: 1 18 | }, 19 | accept_address: String, 20 | introduction: String, 21 | is_merchant: { // 是否商户 22 | type: Number, 23 | default: 0 24 | }, 25 | create_at: { 26 | type: Date, 27 | default: Date.now() 28 | }, 29 | update_at: { 30 | type: Date, 31 | default: Date.now() 32 | } 33 | }) 34 | 35 | UserSchema.pre('save', function (next) { 36 | const user = this 37 | if (this.isNew) { 38 | this.create_at = this.update_at = Date.now() 39 | } else { 40 | this.update_at = Date.now() 41 | } 42 | if (this.modify === 'modify') { 43 | next() 44 | } else { 45 | bcrypt.genSalt(SALT_WORK_FACTOR, function (err, salt) { 46 | if (err) return next(err) 47 | bcrypt.hash(user.user_pwd, salt, function (err, hash) { 48 | if (err) return next(err) 49 | user.user_pwd = hash 50 | next() 51 | }) 52 | }) 53 | } 54 | }) 55 | UserSchema.statics = { 56 | fetch: function (cb) { 57 | return this 58 | .find({}) 59 | .sort('update_at') 60 | .exec(cb) 61 | }, 62 | findById: function (id, cb) { 63 | return this 64 | .findOne({ _id: id }) 65 | .exec(cb) 66 | } 67 | } 68 | UserSchema.methods = { 69 | // 第一个参数是传入的(未加密的),第二个是数据库中的(是已经加密的) 70 | comparePassword: function (_pass, pass) { 71 | return new Promise(function (resolve, reject) { 72 | bcrypt.compare(_pass, pass, function (err, isMatch) { 73 | if (!err) { 74 | resolve(isMatch) 75 | } else { 76 | reject(err) 77 | } 78 | }) 79 | }) 80 | } 81 | } 82 | 83 | module.exports = mongoose.model('User', UserSchema) 84 | -------------------------------------------------------------------------------- /server/app/models/user_order.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose') 2 | 3 | const Schema = mongoose.Schema 4 | const ObjectId = Schema.Types.ObjectId 5 | 6 | const Order = new mongoose.Schema({ 7 | user_id: { 8 | type: ObjectId, 9 | ref: 'User' 10 | }, 11 | shop_id: { 12 | type: ObjectId, 13 | ref: 'Shop' 14 | }, 15 | food_list: String, 16 | order_amount: Number, 17 | is_comment: { 18 | type: Number, 19 | default: 0 20 | }, 21 | order_status: { 22 | type: Number, 23 | default: 1 24 | }, 25 | order_update_time: { 26 | type: Date, 27 | default: Date.now() 28 | }, 29 | order_create_time: { 30 | type: Date, 31 | default: Date.now() 32 | }, 33 | total_time: { // 累计配送的分钟数,用于求平均送达时间 34 | type: Number, 35 | default: 0 36 | }, 37 | order_remarks: String, 38 | accept_address: String 39 | }) 40 | Order.pre('save', function (next) { 41 | this.order_update_time = Date.now() 42 | next() 43 | }) 44 | module.exports = mongoose.model('UserOrder', Order) 45 | -------------------------------------------------------------------------------- /server/bin/www: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /** 4 | * Module dependencies. 5 | */ 6 | 7 | var app = require('../app') 8 | var debug = require('debug')('demo:server') 9 | var http = require('http') 10 | 11 | /** 12 | * Get port from environment and store in Express. 13 | */ 14 | 15 | var port = normalizePort(process.env.PORT || '3333') 16 | // app.set('port', port); 17 | 18 | /** 19 | * Create HTTP server. 20 | */ 21 | 22 | var server = http.createServer(app.callback()) 23 | 24 | /** 25 | * Listen on provided port, on all network interfaces. 26 | */ 27 | 28 | server.listen(port) 29 | server.on('error', onError) 30 | server.on('listening', onListening) 31 | 32 | /** 33 | * Normalize a port into a number, string, or false. 34 | */ 35 | 36 | function normalizePort (val) { 37 | var port = parseInt(val, 10) 38 | 39 | if (isNaN(port)) { 40 | // named pipe 41 | return val 42 | } 43 | 44 | if (port >= 0) { 45 | // port number 46 | return port 47 | } 48 | 49 | return false 50 | } 51 | 52 | /** 53 | * Event listener for HTTP server "error" event. 54 | */ 55 | 56 | function onError (error) { 57 | if (error.syscall !== 'listen') { 58 | throw error 59 | } 60 | 61 | var bind = typeof port === 'string' 62 | ? 'Pipe ' + port 63 | : 'Port ' + port 64 | 65 | // handle specific listen errors with friendly messages 66 | switch (error.code) { 67 | case 'EACCES': 68 | console.error(bind + ' requires elevated privileges') 69 | process.exit(1) 70 | break 71 | case 'EADDRINUSE': 72 | console.error(bind + ' is already in use') 73 | process.exit(1) 74 | break 75 | default: 76 | throw error 77 | } 78 | } 79 | 80 | /** 81 | * Event listener for HTTP server "listening" event. 82 | */ 83 | 84 | function onListening () { 85 | var addr = server.address() 86 | var bind = typeof addr === 'string' 87 | ? 'pipe ' + addr 88 | : 'port ' + addr.port 89 | debug('Listening on ' + bind) 90 | } 91 | -------------------------------------------------------------------------------- /server/config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | key: ``, // 短信api 3 | uri: ``, // 短信url 4 | tpl_id: ``, 5 | tplPre: ``, 6 | domain: `http://localhost:3333` 7 | } 8 | -------------------------------------------------------------------------------- /server/crawler/README.md: -------------------------------------------------------------------------------- 1 | ## 这是爬取饿了么商家数据与商品数据的目录 -------------------------------------------------------------------------------- /server/crawler/crawler.js: -------------------------------------------------------------------------------- 1 | const request = require('request') 2 | const fs = require('fs') 3 | 4 | // 这是商家列表接口 5 | // 输入参数为经纬度和geohash 6 | // 输出为附近的商家列表 7 | const shopsList = `https://www.ele.me/restapi/shopping/restaurants?extras[]=activities&geohash=w7y2mfr4g2x&latitude=21.15053&limit=24&longitude=110.30151&offset=0&terminal=web` 8 | 9 | // 这是商家信息接口 10 | // 输入参数为商家id,位置经纬度 11 | // 输出为该商家基本信息 12 | const shopInfo = `https://www.ele.me/restapi/shopping/restaurant/1423546?extras[]=activities&extras[]=license&extras[]=identification&extras[]=albums&extras[]=flavors&latitude=21.15053&longitude=110.30151` 13 | 14 | // 这是商家菜单接口 15 | // 输入为商家id 16 | // 输出为商家的菜单列表 17 | const shopMenu = `https://www.ele.me/restapi/shopping/v2/menu?restaurant_id=1423546` 18 | 19 | // 这是某个商品的评价 20 | // 输入为food_id 21 | // 输出为评价的数组 22 | const simpleFoodRate = `https://www.ele.me/restapi/ugc/v2/food/ratings?food_ids[]=73871143&has_text=1&limit=999&offset=0` 23 | 24 | // 这是商家评论,包含对应的菜品 25 | // 输入为商家id、limit和offset 26 | // 输出评论列表 27 | const foodRate = `https://www.ele.me/restapi/ugc/v1/restaurant/712434/ratings?limit=10&offset=0&record_type=1` 28 | function getData (url, target) { 29 | // 获取到原始数据文件, 并格式化 30 | request(url, (err, res, body) => { 31 | if (err) console.log(err) 32 | fs.writeFile(target, body, () => { 33 | fs.readFile(target, (err, data) => { 34 | if (err) console.log(err) 35 | const ddd = JSON.stringify(JSON.parse(data.toString()), null, 2) 36 | fs.writeFile(target, ddd, () => { 37 | getSomeKeys(target, `${target}_o`, () => { 38 | toTXT(`${target}_o`, `${target}_sql`) 39 | }) 40 | }) 41 | }) 42 | }) 43 | }) 44 | } 45 | 46 | // 取部分字段 47 | function getSomeKeys (origin, target, cb) { 48 | fs.readFile(origin, (err, data) => { 49 | if (err) console.log(err) 50 | data = JSON.parse(data.toString()) 51 | let ooo 52 | if (typeof data.map === 'function') { 53 | ooo = data.map(item => { 54 | return { 55 | address: item.address, 56 | description: item.description, 57 | name: item.username, 58 | status: item.status, 59 | latitude: item.latitude, 60 | longitude: item.longitude, 61 | image_path: item.image_path, 62 | rating_star: item.rating_star, 63 | foodList: item.item_rating_list, 64 | rated_at: item.rated_at 65 | } 66 | }) 67 | } else if (typeof data === 'object') { 68 | ooo = { 69 | address: data.address 70 | } 71 | } 72 | fs.writeFile(target, JSON.stringify(ooo, null, 2), cb) 73 | }) 74 | } 75 | 76 | function toTXT (origin, target) { 77 | fs.readFile(origin, (err, data) => { 78 | if (err) console.log(err) 79 | data = JSON.parse(data.toString()) 80 | let tempData = [] 81 | if (typeof data.map === 'function') { 82 | tempData = data.map(item => { 83 | let arr = [] 84 | for (let key in item) { 85 | arr.push([key, item[key]].join()) 86 | } 87 | return arr 88 | }) 89 | } else if (typeof data === 'object') { 90 | for (let key in data) { 91 | tempData.push([key, data[key]].join()) 92 | } 93 | } 94 | let tarStr = '' 95 | tempData.forEach((item, index) => { 96 | tarStr += (1 + index) + '\n' 97 | if (typeof item.forEach === 'function') { 98 | item.forEach(ite => { 99 | tarStr += ite + '\n' 100 | }) 101 | } else { 102 | tarStr += item + '\n' 103 | } 104 | }) 105 | fs.writeFile(target, tarStr) 106 | }) 107 | } 108 | 109 | // getData(foodRate, 'foodRate') 110 | 111 | // getData(shopInfo, 'shopInfo') // 这个好像是上面列表的一个 112 | 113 | // getData(shopMenu, 'shopMenu') 114 | getData(shopsList, 'shopsList') // 商家列表 115 | -------------------------------------------------------------------------------- /server/crawler/foodRate_o: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "匿**户", 4 | "rating_star": 5, 5 | "foodList": [ 6 | { 7 | "food_id": 163078811, 8 | "image_hash": "", 9 | "rate_name": "牛肉拌云吞面", 10 | "rating_star": 5, 11 | "rating_text": "" 12 | } 13 | ], 14 | "rated_at": "2017-11-23" 15 | }, 16 | { 17 | "name": "匿**户", 18 | "rating_star": 5, 19 | "foodList": [], 20 | "rated_at": "2017-11-23" 21 | }, 22 | { 23 | "name": "匿**户", 24 | "rating_star": 5, 25 | "foodList": [], 26 | "rated_at": "2017-11-23" 27 | }, 28 | { 29 | "name": "匿**户", 30 | "rating_star": 4, 31 | "foodList": [ 32 | { 33 | "food_id": 1283667962, 34 | "image_hash": "", 35 | "rate_name": "辣鸡云吞", 36 | "rating_star": 4, 37 | "rating_text": "" 38 | } 39 | ], 40 | "rated_at": "2017-11-23" 41 | }, 42 | { 43 | "name": "匿**户", 44 | "rating_star": 4, 45 | "foodList": [ 46 | { 47 | "food_id": 73871143, 48 | "image_hash": "", 49 | "rate_name": "牛肉拌面", 50 | "rating_star": 4, 51 | "rating_text": "" 52 | } 53 | ], 54 | "rated_at": "2017-11-23" 55 | }, 56 | { 57 | "name": "匿**户", 58 | "rating_star": 4, 59 | "foodList": [ 60 | { 61 | "food_id": 558354353, 62 | "image_hash": "", 63 | "rate_name": "山东大饼油盐饼", 64 | "rating_star": 4, 65 | "rating_text": "" 66 | }, 67 | { 68 | "food_id": 1283670312, 69 | "image_hash": "", 70 | "rate_name": "净云吞", 71 | "rating_star": 4, 72 | "rating_text": "" 73 | } 74 | ], 75 | "rated_at": "2017-11-23" 76 | }, 77 | { 78 | "name": "匿**户", 79 | "rating_star": 4, 80 | "foodList": [ 81 | { 82 | "food_id": 617453381, 83 | "image_hash": "", 84 | "rate_name": "瘦肉拌云吞面", 85 | "rating_star": 4, 86 | "rating_text": "" 87 | } 88 | ], 89 | "rated_at": "2017-11-23" 90 | }, 91 | { 92 | "name": "匿**户", 93 | "rating_star": 4, 94 | "foodList": [ 95 | { 96 | "food_id": 158007297, 97 | "image_hash": "", 98 | "rate_name": "水饺", 99 | "rating_star": 4, 100 | "rating_text": "" 101 | } 102 | ], 103 | "rated_at": "2017-11-23" 104 | }, 105 | { 106 | "name": "匿**户", 107 | "rating_star": 5, 108 | "foodList": [], 109 | "rated_at": "2017-11-23" 110 | }, 111 | { 112 | "name": "匿**户", 113 | "rating_star": 4, 114 | "foodList": [ 115 | { 116 | "food_id": 103225920, 117 | "image_hash": "", 118 | "rate_name": "肉丝面……不辣……细面", 119 | "rating_star": 4, 120 | "rating_text": "" 121 | }, 122 | { 123 | "food_id": 131169249, 124 | "image_hash": "", 125 | "rate_name": "卤蛋", 126 | "rating_star": 4, 127 | "rating_text": "" 128 | } 129 | ], 130 | "rated_at": "2017-11-23" 131 | } 132 | ] -------------------------------------------------------------------------------- /server/crawler/foodRate_sql: -------------------------------------------------------------------------------- 1 | 1 2 | name,匿**户 3 | rating_star,5 4 | foodList,[object Object] 5 | rated_at,2017-11-23 6 | 2 7 | name,匿**户 8 | rating_star,5 9 | foodList, 10 | rated_at,2017-11-23 11 | 3 12 | name,匿**户 13 | rating_star,5 14 | foodList, 15 | rated_at,2017-11-23 16 | 4 17 | name,匿**户 18 | rating_star,4 19 | foodList,[object Object] 20 | rated_at,2017-11-23 21 | 5 22 | name,匿**户 23 | rating_star,4 24 | foodList,[object Object] 25 | rated_at,2017-11-23 26 | 6 27 | name,匿**户 28 | rating_star,4 29 | foodList,[object Object],[object Object] 30 | rated_at,2017-11-23 31 | 7 32 | name,匿**户 33 | rating_star,4 34 | foodList,[object Object] 35 | rated_at,2017-11-23 36 | 8 37 | name,匿**户 38 | rating_star,4 39 | foodList,[object Object] 40 | rated_at,2017-11-23 41 | 9 42 | name,匿**户 43 | rating_star,5 44 | foodList, 45 | rated_at,2017-11-23 46 | 10 47 | name,匿**户 48 | rating_star,4 49 | foodList,[object Object],[object Object] 50 | rated_at,2017-11-23 51 | -------------------------------------------------------------------------------- /server/crawler/shopInfo: -------------------------------------------------------------------------------- 1 | { 2 | "activities": [ 3 | { 4 | "attribute": "6.0", 5 | "description": "新用户下单立减6元(不与其它活动同享)", 6 | "icon_color": "70bc46", 7 | "icon_name": "首", 8 | "id": 604620913, 9 | "is_exclusive_with_food_activity": true, 10 | "name": "新用户立减(不与其他活动共享)", 11 | "tips": "新用户下单立减6元(不与其它活动同享)", 12 | "type": 103 13 | } 14 | ], 15 | "address": "广东海洋大学正对面综合楼(飞宏名城)一楼15号店", 16 | "albums": [ 17 | { 18 | "count": 1, 19 | "cover_image_hash": "6c29c78a08b0a8f463642eadf3d8138ajpeg", 20 | "name": "门面", 21 | "photos": [ 22 | { 23 | "description": "门头照", 24 | "id": 3097445, 25 | "image_hash": "6c29c78a08b0a8f463642eadf3d8138ajpeg", 26 | "type": "FRONT" 27 | } 28 | ] 29 | }, 30 | { 31 | "count": 1, 32 | "cover_image_hash": "e95a2c70b64923aa3f1c16e90a47806cjpeg", 33 | "name": "大堂", 34 | "photos": [ 35 | { 36 | "description": "店内照", 37 | "id": 3097446, 38 | "image_hash": "e95a2c70b64923aa3f1c16e90a47806cjpeg", 39 | "type": "HALL" 40 | } 41 | ] 42 | } 43 | ], 44 | "authentic_id": 7371986358132846, 45 | "delivery_mode": { 46 | "border": "FFFFFF", 47 | "color": "", 48 | "id": 2, 49 | "is_solid": true, 50 | "text": "商家配送", 51 | "text_color": "FFFFFF" 52 | }, 53 | "description": "", 54 | "distance": 1056, 55 | "favored": false, 56 | "flavors": [ 57 | { 58 | "id": 241, 59 | "name": "甜品" 60 | }, 61 | { 62 | "id": 240, 63 | "name": "奶茶果汁" 64 | } 65 | ], 66 | "float_delivery_fee": 0, 67 | "float_minimum_order_amount": 10, 68 | "id": 1423546, 69 | "image_path": "7fbef04af49d56f2507523164760acc7png", 70 | "is_new": false, 71 | "is_premium": false, 72 | "is_stock_empty": 0, 73 | "is_valid": 1, 74 | "latitude": 21.143804, 75 | "longitude": 110.302505, 76 | "max_applied_quantity_per_order": 1, 77 | "name": "royaltea 皇茶", 78 | "next_business_time": "", 79 | "only_use_poi": false, 80 | "opening_hours": [ 81 | "10:50/23:55" 82 | ], 83 | "order_lead_time": 38, 84 | "phone": "13435216104 13376716479", 85 | "piecewise_agent_fee": { 86 | "description": "免配送费", 87 | "extra_fee": 0, 88 | "is_extra": false, 89 | "rules": [ 90 | { 91 | "fee": 0, 92 | "price": 10 93 | } 94 | ], 95 | "tips": "免配送费" 96 | }, 97 | "promotion_info": "本店暂时没有女配送员,女生宿舍不能送上楼请谅解!男生宿舍都送上楼的,除非门卫不给上楼", 98 | "rating": 4.5, 99 | "rating_count": 327, 100 | "recent_order_num": 1452, 101 | "recommend": { 102 | "is_ad": false, 103 | "reason": "" 104 | }, 105 | "regular_customer_count": 0, 106 | "scheme": "eleme://catering?restaurant_id=1423546", 107 | "status": 1, 108 | "supports": [], 109 | "type": 0 110 | } -------------------------------------------------------------------------------- /server/crawler/shopInfo_o: -------------------------------------------------------------------------------- 1 | { 2 | "address": "广东海洋大学正对面综合楼(飞宏名城)一楼15号店" 3 | } -------------------------------------------------------------------------------- /server/crawler/shopInfo_sql: -------------------------------------------------------------------------------- 1 | 1 2 | address,广东海洋大学正对面综合楼(飞宏名城)一楼15号店 3 | -------------------------------------------------------------------------------- /server/crawler/shopMenu_o: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description": "大家喜欢吃,才叫真好吃。", 4 | "name": "热销" 5 | }, 6 | { 7 | "description": "", 8 | "name": "公告" 9 | }, 10 | { 11 | "description": "本店新推出蛋挞,出炉时间为上午11点30,下午的15点30", 12 | "name": "超值套餐新品推出" 13 | }, 14 | { 15 | "description": "", 16 | "name": "美味披萨" 17 | }, 18 | { 19 | "description": "澳洲进口芝士制成的芝士奶盖配与现萃的茶包精华,让你体验不一样的味觉盛宴!", 20 | "name": "芝士奶盖现泡茶" 21 | }, 22 | { 23 | "description": "玫瑰盐制作成的奶盐奶盖混合现萃茶的淡淡清香,怎一个赞了得!", 24 | "name": "奶盐奶盖现泡茶" 25 | }, 26 | { 27 | "description": "", 28 | "name": "经典奶茶" 29 | }, 30 | { 31 | "description": "", 32 | "name": "宇治抹茶" 33 | }, 34 | { 35 | "description": "", 36 | "name": "庄园可可" 37 | }, 38 | { 39 | "description": "", 40 | "name": "鲜茶和水果(冷饮)" 41 | }, 42 | { 43 | "description": "", 44 | "name": "益力多优酪乳(冷饮)" 45 | }, 46 | { 47 | "description": "", 48 | "name": "柠檬看得见" 49 | }, 50 | { 51 | "description": "", 52 | "name": "薄荷系列(冷饮)" 53 | }, 54 | { 55 | "description": "", 56 | "name": "春茶系列" 57 | }, 58 | { 59 | "description": "寒冬,来一杯姜茶‘暖心一整天!", 60 | "name": "川姜系列(热饮)" 61 | }, 62 | { 63 | "description": "", 64 | "name": "桂圆红枣系列(热饮)" 65 | }, 66 | { 67 | "description": "天气原因,送货途中鸡蛋仔变冷酥脆度会下降,望客户理解!", 68 | "name": "特色小吃及甜品" 69 | }, 70 | { 71 | "description": "", 72 | "name": "油炸小吃" 73 | }, 74 | { 75 | "description": "", 76 | "name": "怀旧零食" 77 | }, 78 | { 79 | "description": "", 80 | "name": "鲜榨果汁(冷饮)" 81 | }, 82 | { 83 | "description": "", 84 | "name": "加料区" 85 | } 86 | ] -------------------------------------------------------------------------------- /server/crawler/shopMenu_sql: -------------------------------------------------------------------------------- 1 | 1 2 | description,大家喜欢吃,才叫真好吃。 3 | name,热销 4 | 2 5 | description, 6 | name,公告 7 | 3 8 | description,本店新推出蛋挞,出炉时间为上午11点30,下午的15点30 9 | name,超值套餐新品推出 10 | 4 11 | description, 12 | name,美味披萨 13 | 5 14 | description,澳洲进口芝士制成的芝士奶盖配与现萃的茶包精华,让你体验不一样的味觉盛宴! 15 | name,芝士奶盖现泡茶 16 | 6 17 | description,玫瑰盐制作成的奶盐奶盖混合现萃茶的淡淡清香,怎一个赞了得! 18 | name,奶盐奶盖现泡茶 19 | 7 20 | description, 21 | name,经典奶茶 22 | 8 23 | description, 24 | name,宇治抹茶 25 | 9 26 | description, 27 | name,庄园可可 28 | 10 29 | description, 30 | name,鲜茶和水果(冷饮) 31 | 11 32 | description, 33 | name,益力多优酪乳(冷饮) 34 | 12 35 | description, 36 | name,柠檬看得见 37 | 13 38 | description, 39 | name,薄荷系列(冷饮) 40 | 14 41 | description, 42 | name,春茶系列 43 | 15 44 | description,寒冬,来一杯姜茶‘暖心一整天! 45 | name,川姜系列(热饮) 46 | 16 47 | description, 48 | name,桂圆红枣系列(热饮) 49 | 17 50 | description,天气原因,送货途中鸡蛋仔变冷酥脆度会下降,望客户理解! 51 | name,特色小吃及甜品 52 | 18 53 | description, 54 | name,油炸小吃 55 | 19 56 | description, 57 | name,怀旧零食 58 | 20 59 | description, 60 | name,鲜榨果汁(冷饮) 61 | 21 62 | description, 63 | name,加料区 64 | -------------------------------------------------------------------------------- /server/db_vue/admins.json: -------------------------------------------------------------------------------- 1 | {"_id":{"$oid":"5a2e4c2f4c79085a4ca62dce"},"admin_name":"admin","admin_pwd":"$2a$10$wDe8ljc0phq5w7d0ofbJ.eFJbp3ClhdnNxD6kp7v5elYccHJs1xeK","create_at":{"$date":"2017-12-14T01:48:27.662Z"},"is_super":0,"food_type_mp":1,"shop_mp":0,"shop_type_mp":0,"merchant_mp":1,"__v":0} 2 | {"_id":{"$oid":"5a2e4c2f4c79085a4ca62dcf"},"admin_name":"admin2","admin_pwd":"$2a$10$t6fAmClGc1EcLd1by8Pm6e25gvOeCfYhnx.CyA1IzZWEqI1i.kiUm","create_at":{"$date":"2017-12-11T09:13:19.694Z"},"is_super":0,"food_type_mp":1,"shop_mp":1,"shop_type_mp":1,"merchant_mp":1,"__v":0} 3 | {"_id":{"$oid":"5a2e4c2f4c79085a4ca62dcd"},"admin_name":"root","admin_pwd":"$2a$10$/CQttkCYrZ9Kg1ITIYh4.OX8SVXuUbduzUUoWTrjKdhhTvE5EKkQ.","create_at":{"$date":"2017-12-11T09:13:19.693Z"},"is_super":1,"food_type_mp":1,"shop_mp":1,"shop_type_mp":1,"merchant_mp":1,"__v":0} 4 | {"_id":{"$oid":"5a2e887a99c765546c086205"},"admin_name":"admin3","admin_pwd":"$2a$10$sgNoGMo2aIA52Z00ju8iB.epYxXoHQ6IZp5aE7RKzU1l4VI5haL3i","create_at":{"$date":"2017-12-14T01:49:06.927Z"},"is_super":0,"food_type_mp":0,"shop_mp":1,"shop_type_mp":0,"merchant_mp":1,"__v":0} 5 | -------------------------------------------------------------------------------- /server/db_vue/dishtypes.json: -------------------------------------------------------------------------------- 1 | {"_id":{"$oid":"5a2bc8b6c8154e3af8ec2d80"},"type":"辛辣","code":1,"create_time":{"$date":"2017-12-09T11:27:50.502Z"},"__v":0} 2 | {"_id":{"$oid":"5a2bc8b6c8154e3af8ec2d81"},"type":"麻辣","code":2,"create_time":{"$date":"2017-12-09T11:27:50.502Z"},"__v":0} 3 | {"_id":{"$oid":"5a2bc8b6c8154e3af8ec2d82"},"type":"点心","code":3,"create_time":{"$date":"2017-12-09T11:27:50.502Z"},"__v":0} 4 | {"_id":{"$oid":"5a2bc8b6c8154e3af8ec2d83"},"type":"水果","code":4,"create_time":{"$date":"2017-12-09T11:27:50.502Z"},"__v":0} 5 | {"_id":{"$oid":"5a2bc8b6c8154e3af8ec2d84"},"type":"下午茶","code":5,"create_time":{"$date":"2017-12-09T11:27:50.502Z"},"__v":0} 6 | {"_id":{"$oid":"5a2bc8b6c8154e3af8ec2d86"},"type":"清淡","code":7,"create_time":{"$date":"2017-12-09T11:27:50.502Z"},"__v":0} 7 | {"_id":{"$oid":"5a2bc8b6c8154e3af8ec2d88"},"type":"烧烤","code":9,"create_time":{"$date":"2017-12-09T11:27:50.502Z"},"__v":0} 8 | {"_id":{"$oid":"5a2bc8b6c8154e3af8ec2d87"},"type":"面食","code":8,"create_time":{"$date":"2017-12-09T11:27:50.502Z"},"__v":0} 9 | {"_id":{"$oid":"5a2bc8b6c8154e3af8ec2d85"},"type":"饮料","code":6,"create_time":{"$date":"2017-12-09T11:27:50.502Z"},"__v":0} 10 | {"_id":{"$oid":"5a2e41978e03fd3068c24b1c"},"type":"雪碧","create_time":{"$date":"2017-12-11T08:27:53.408Z"},"__v":0} 11 | -------------------------------------------------------------------------------- /server/db_vue/menumodels.json: -------------------------------------------------------------------------------- 1 | {"_id":{"$oid":"5a2e856389e6d96418422a31"},"shop_id":{"$oid":"5a2e6babd8760360f828cde9"},"dish_name":"熊猫奶盖茶","dish_introduction":"茶底有珍珠、寒天冻,奶盖上面有奥利奥饼干碎,配料十分丰富!","dish_price":14,"dish_pics":"https://fuss10.elemecdn.com/c/93/e65a59628dfc5144a63f7e2bf2163jpeg.jpeg?imageMogr2/thumbnail/100x100/format/webp/quality/85","__v":0,"dish_type":"5a2bc8b6c8154e3af8ec2d82","monthly_sales":1,"comment_sales":1,"level":4} 2 | {"_id":{"$oid":"5a2e856389e6d96418422a32"},"shop_id":{"$oid":"5a2e6babd8760360f828cde9"},"dish_name":"布丁奶绿","dish_introduction":"布丁奶绿布丁奶绿```","dish_price":10,"dish_pics":"https://fuss10.elemecdn.com/3/fc/6d17ba6a9685d248206fbc8cd58fbjpeg.jpeg?imageMogr2/thumbnail/100x100/format/webp/quality/85","__v":0,"monthly_sales":2,"comment_sales":2,"dish_type":"5a2bc8b6c8154e3af8ec2d82","level":9} 3 | {"_id":{"$oid":"5a2e856389e6d96418422a33"},"shop_id":{"$oid":"5a2e6babd8760360f828cde9"},"dish_name":"熊猫果茶","dish_introduction":"熊猫果茶熊猫果茶```","dish_price":14,"dish_pics":"https://fuss10.elemecdn.com/3/ca/a84cb3f8cb2d6cd0cfb2d8726efa3jpeg.jpeg?imageMogr2/thumbnail/100x100/format/webp/quality/85","__v":0,"monthly_sales":0,"dish_type":"5a2bc8b6c8154e3af8ec2d82"} 4 | {"_id":{"$oid":"5a2fbf1d37de513cc42f1f8a"},"shop_id":{"$oid":"5a2e6babd8760360f828cde9"},"dish_name":"新增菜品","dish_introduction":"iiii","dish_price":12,"dish_pics":"http://localhost:3333/uploads/1512808569618.jpg","dish_type":"5a2bc8b6c8154e3af8ec2d82","__v":0,"monthly_sales":0} 5 | {"_id":{"$oid":"5a2fbfc837de513cc42f1f8b"},"shop_id":{"$oid":"5a2e6babd8760360f828cde9"},"dish_name":"宵夜","dish_introduction":"11","dish_price":11,"dish_pics":"http://localhost:3333/uploads/1512808569618.jpg","dish_type":"5a2bc8b6c8154e3af8ec2d82","__v":0,"monthly_sales":0} 6 | {"_id":{"$oid":"5a314b110e401c35805637cd"},"shop_id":{"$oid":"5a2e6babd8760360f828cde9"},"dish_name":"烧烤","dish_introduction":"这是一个烧烤","dish_price":123,"dish_pics":"\\uploads\\1513179920614.jpg","dish_type":"5a2bc8b6c8154e3af8ec2d88","__v":0,"monthly_sales":0,"level":5} 7 | -------------------------------------------------------------------------------- /server/db_vue/shopapplies.json: -------------------------------------------------------------------------------- 1 | {"_id":{"$oid":"5a2e6b5c133e4e205ca72868"},"user_id":{"$oid":"5a2bcb6395f94c4708b6d155"},"identification_num":"442541199901019321","identification_pic":"https://afp.alicdn.com/afp-creative/creative/u124884735/b84c510178cda0088b8b315b536c5773.png","shop_name":"薡御贡茶海大店","shop_logo":"https://fuss10.elemecdn.com/0/a7/45a05b6331743cfd40f686912927cpng.png?imageMogr2/thumbnail/95x95/format/webp/quality/85","shop_abstract":"这是薡御贡茶海大店","shop_location":"广东海洋大学主校区正门口对面月岭村委会综合楼一楼13号","shop_auth_images":"https://fuss10.elemecdn.com/8/b4/af28b7f1ec408a72f7043b75c0383jpeg.jpeg?imageMogr/format/webp/","shop_type":"5a2bc6365b30353b7c869d25","shop_latitude":21.144709,"shop_longitude":110.302246,"status":1,"__v":0} 2 | {"_id":{"$oid":"5a2e6b5c133e4e205ca72867"},"user_id":{"$oid":"5a2bcb6395f94c4708b6d154"},"identification_num":"442546199901019541","identification_pic":"https://afp.alicdn.com/afp-creative/creative/u124884735/b84c510178cda0088b8b315b536c5773.png","shop_name":"肯德基","shop_logo":"https://fuss10.elemecdn.com/4/ed/0c168f4f14d4107548a1d3da9b2a0jpeg.jpeg?imageMogr2/thumbnail/95x95/format/webp/quality/85","shop_abstract":"这是肯德基","shop_location":"北京朝阳区","shop_auth_images":"https://fuss10.elemecdn.com/8/b4/af28b7f1ec408a72f7043b75c0383jpeg.jpeg?imageMogr/format/webp/","shop_type":"5a2bc6365b30353b7c869d25","shop_latitude":21.150362,"shop_longitude":110.301132,"status":2,"__v":0} 3 | {"_id":{"$oid":"5a2f7b7f8c8e9e5250f2737a"},"user_id":{"$oid":"5a1ebdadb21908f9618bb79a"},"shop_abstract":"简介 商铺申请","shop_name":"名称····111","identification_num":"4323","shop_type":"5a2bc6365b30353b7c869d25","shop_location":"dididididididid","shop_logo":"http://localhost:3333/uploads/1512808569618.jpg","identification_pic":"http://localhost:3333/uploads/1512808569618.jpg","shop_auth_images":"http://localhost:3333/uploads/1512808569618.jpg","shop_longitude":110.35852024461,"shop_latitude":21.251647528961,"status":0,"__v":0} 4 | -------------------------------------------------------------------------------- /server/db_vue/shoporders.json: -------------------------------------------------------------------------------- 1 | {"_id":{"$oid":"5a3236d29425ba1534f7ca4d"},"user_id":{"$oid":"5a1ebdadb21908f9618bb79a"},"shop_id":{"$oid":"5a2e6babd8760360f828cde9"},"food_list":"[{\"dishId\":\"5a2e856389e6d96418422a32\",\"dishName\":\"布丁奶绿\",\"dishNum\":\"1\",\"dishPrice\":\"10\"}]","order_amount":13,"order_remarks":"13 3","accept_address":"广东湛江","order_create_time":{"$date":"2017-12-14T08:15:28.834Z"},"is_comment":1,"order_status":2,"__v":0} 2 | {"_id":{"$oid":"5a3237059425ba1534f7ca4e"},"user_id":{"$oid":"5a1ebdadb21908f9618bb79a"},"shop_id":{"$oid":"5a2e6babd8760360f828cde9"},"food_list":"[{\"dishId\":\"5a2e856389e6d96418422a31\",\"dishName\":\"熊猫奶盖茶\",\"dishNum\":\"1\",\"dishPrice\":\"14\"}]","order_amount":17,"order_remarks":"123123123123","accept_address":"广东湛江123123123","order_create_time":{"$date":"2017-12-14T08:15:28.834Z"},"is_comment":0,"order_status":4,"__v":0,"order_update_time":{"$date":"2017-12-15T01:16:04.706Z"}} 3 | {"_id":{"$oid":"5a323defd2032a3b74e5c0fb"},"user_id":{"$oid":"5a1ebdadb21908f9618bb79a"},"shop_id":{"$oid":"5a2e6babd8760360f828cde9"},"food_list":"[{\"dishId\":\"5a2e856389e6d96418422a32\",\"dishName\":\"布丁奶绿\",\"dishNum\":\"1\",\"dishPrice\":\"10\"}]","order_amount":13,"order_remarks":"123","accept_address":"广东湛江123","order_create_time":{"$date":"2017-12-14T09:00:05.485Z"},"is_comment":1,"order_status":2,"__v":0} 4 | {"_id":{"$oid":"5a32413365a67331989136b4"},"user_id":{"$oid":"5a1ebdadb21908f9618bb79a"},"shop_id":{"$oid":"5a2e6babd8760360f828cde9"},"food_list":"[{\"dishId\":\"5a2e856389e6d96418422a31\",\"dishName\":\"熊猫奶盖茶\",\"dishNum\":\"1\",\"dishPrice\":\"14\"}]","order_amount":17,"order_remarks":"17kuai的奶盖","accept_address":"广东湛江","order_create_time":{"$date":"2017-12-14T09:14:02.247Z"},"is_comment":1,"order_status":2,"__v":0} 5 | {"_id":{"$oid":"5a3320f36ba6982900ebf398"},"user_id":{"$oid":"5a329f99db97432a14f73c48"},"shop_id":{"$oid":"5a2e6babd8760360f828cde9"},"food_list":"[{\"dishId\":\"5a2e856389e6d96418422a32\",\"dishName\":\"布丁奶绿\",\"dishNum\":\"1\",\"dishPrice\":\"10\"}]","order_amount":13,"order_remarks":"","accept_address":"undefined","total_time":0,"order_create_time":{"$date":"2017-12-15T01:10:00.146Z"},"order_update_time":{"$date":"2017-12-15T01:10:13.544Z"},"is_comment":0,"order_status":3,"__v":0} 6 | {"_id":{"$oid":"5a33228b8dd26c0a7c208347"},"user_id":{"$oid":"5a1ebdadb21908f9618bb79a"},"shop_id":{"$oid":"5a2e6babd8760360f828cde9"},"food_list":"[{\"dishId\":\"5a2e856389e6d96418422a31\",\"dishName\":\"熊猫奶盖茶\",\"dishNum\":\"1\",\"dishPrice\":\"14\"}]","order_amount":17,"order_remarks":"","accept_address":"广东湛江fdsfds","total_time":0,"order_create_time":{"$date":"2017-12-15T01:15:09.024Z"},"order_update_time":{"$date":"2017-12-15T01:16:59.648Z"},"is_comment":0,"order_status":1,"__v":0} 7 | {"_id":{"$oid":"5a33229b8dd26c0a7c208348"},"user_id":{"$oid":"5a1ebdadb21908f9618bb79a"},"shop_id":{"$oid":"5a2e6babd8760360f828cde9"},"food_list":"[{\"dishId\":\"5a2e856389e6d96418422a31\",\"dishName\":\"熊猫奶盖茶\",\"dishNum\":\"1\",\"dishPrice\":\"14\"}]","order_amount":17,"order_remarks":"2222123","accept_address":"广东湛江fdsfds","total_time":0,"order_create_time":{"$date":"2017-12-15T01:15:09.024Z"},"order_update_time":{"$date":"2017-12-15T01:17:16.041Z"},"is_comment":0,"order_status":3,"__v":0} 8 | -------------------------------------------------------------------------------- /server/db_vue/shops.json: -------------------------------------------------------------------------------- 1 | {"_id":{"$oid":"5a2e6babd8760360f828cde9"},"user_id":{"$oid":"5a2bcb6395f94c4708b6d155"},"shop_name":"薡御贡茶海大店","shop_logo":"https://fuss10.elemecdn.com/0/a7/45a05b6331743cfd40f686912927cpng.png?imageMogr2/thumbnail/95x95/format/webp/quality/85","shop_abstract":"这是薡御贡茶海大店","shop_location":"广东海洋大学主校区正门口对面月岭村委会综合楼一楼13号","shop_stores_images":"https://fuss10.elemecdn.com/8/b4/af28b7f1ec408a72f7043b75c0383jpeg.jpeg?imageMogr/format/webp/","shop_type":3,"shop_longitude":110.302246,"shop_latitude":21.144709,"__v":0,"level":13,"comment_sales":3,"shop_announcement":"gggggggg123","shop_phone":110,"shop_start_delivery":"12","shop_status":1,"shop_work_time":"","total_time":123,"shop_delivery_cost":3,"create_time":{"$date":"2017-12-13T07:30:30.154Z"},"monthly_sales":3} 2 | -------------------------------------------------------------------------------- /server/db_vue/shoptypes.json: -------------------------------------------------------------------------------- 1 | {"_id":{"$oid":"5a2bc6365b30353b7c869d28"},"type":"午餐","code":5,"create_time":{"$date":"2017-12-09T11:17:10.400Z"},"__v":0} 2 | {"_id":{"$oid":"5a2bc6365b30353b7c869d24"},"type":"快餐","code":1,"create_time":{"$date":"2017-12-09T11:17:10.400Z"},"__v":0} 3 | {"_id":{"$oid":"5a2bc6365b30353b7c869d26"},"type":"小吃","code":3,"create_time":{"$date":"2017-12-09T11:17:10.400Z"},"__v":0} 4 | {"_id":{"$oid":"5a2bc6365b30353b7c869d25"},"type":"料理","code":2,"create_time":{"$date":"2017-12-09T11:17:10.400Z"},"__v":0} 5 | {"_id":{"$oid":"5a2bc6365b30353b7c869d27"},"type":"早餐","code":4,"create_time":{"$date":"2017-12-09T11:17:10.400Z"},"__v":0} 6 | {"_id":{"$oid":"5a2bc6365b30353b7c869d29"},"type":"宵夜","code":6,"create_time":{"$date":"2017-12-09T11:17:10.400Z"},"__v":0} 7 | {"_id":{"$oid":"5a313a2764dc83156c807b88"},"type":"水果","create_time":{"$date":"2017-12-13T14:07:44.018Z"},"__v":0} 8 | -------------------------------------------------------------------------------- /server/db_vue/userorders.json: -------------------------------------------------------------------------------- 1 | {"_id":{"$oid":"5a3236d29425ba1534f7ca4d"},"user_id":{"$oid":"5a1ebdadb21908f9618bb79a"},"shop_id":{"$oid":"5a2e6babd8760360f828cde9"},"food_list":"[{\"dishId\":\"5a2e856389e6d96418422a32\",\"dishName\":\"布丁奶绿\",\"dishNum\":\"1\",\"dishPrice\":\"10\"}]","order_amount":13,"order_remarks":"13 3","accept_address":"广东湛江","order_create_time":{"$date":"2017-12-14T08:15:28.840Z"},"order_status":2,"is_comment":1,"__v":0} 2 | {"_id":{"$oid":"5a3237059425ba1534f7ca4e"},"user_id":{"$oid":"5a1ebdadb21908f9618bb79a"},"shop_id":{"$oid":"5a2e6babd8760360f828cde9"},"food_list":"[{\"dishId\":\"5a2e856389e6d96418422a31\",\"dishName\":\"熊猫奶盖茶\",\"dishNum\":\"1\",\"dishPrice\":\"14\"}]","order_amount":17,"order_remarks":"123123123123","accept_address":"广东湛江123123123","order_create_time":{"$date":"2017-12-14T08:15:28.840Z"},"order_status":4,"is_comment":0,"__v":0,"order_update_time":{"$date":"2017-12-15T01:16:04.709Z"}} 3 | {"_id":{"$oid":"5a323defd2032a3b74e5c0fb"},"user_id":{"$oid":"5a1ebdadb21908f9618bb79a"},"shop_id":{"$oid":"5a2e6babd8760360f828cde9"},"food_list":"[{\"dishId\":\"5a2e856389e6d96418422a32\",\"dishName\":\"布丁奶绿\",\"dishNum\":\"1\",\"dishPrice\":\"10\"}]","order_amount":13,"order_remarks":"123","accept_address":"广东湛江123","order_create_time":{"$date":"2017-12-14T09:00:05.519Z"},"order_status":2,"is_comment":1,"__v":0} 4 | {"_id":{"$oid":"5a32413365a67331989136b4"},"user_id":{"$oid":"5a1ebdadb21908f9618bb79a"},"shop_id":{"$oid":"5a2e6babd8760360f828cde9"},"food_list":"[{\"dishId\":\"5a2e856389e6d96418422a31\",\"dishName\":\"熊猫奶盖茶\",\"dishNum\":\"1\",\"dishPrice\":\"14\"}]","order_amount":17,"order_remarks":"17kuai的奶盖","accept_address":"广东湛江","order_create_time":{"$date":"2017-12-14T09:14:02.254Z"},"order_status":2,"is_comment":1,"__v":0} 5 | {"_id":{"$oid":"5a3320f36ba6982900ebf398"},"user_id":{"$oid":"5a329f99db97432a14f73c48"},"shop_id":{"$oid":"5a2e6babd8760360f828cde9"},"food_list":"[{\"dishId\":\"5a2e856389e6d96418422a32\",\"dishName\":\"布丁奶绿\",\"dishNum\":\"1\",\"dishPrice\":\"10\"}]","order_amount":13,"order_remarks":"","accept_address":"undefined","total_time":0,"order_create_time":{"$date":"2017-12-15T01:10:00.151Z"},"order_update_time":{"$date":"2017-12-15T01:10:13.541Z"},"order_status":3,"is_comment":0,"__v":0} 6 | {"_id":{"$oid":"5a33228b8dd26c0a7c208347"},"user_id":{"$oid":"5a1ebdadb21908f9618bb79a"},"shop_id":{"$oid":"5a2e6babd8760360f828cde9"},"food_list":"[{\"dishId\":\"5a2e856389e6d96418422a31\",\"dishName\":\"熊猫奶盖茶\",\"dishNum\":\"1\",\"dishPrice\":\"14\"}]","order_amount":17,"order_remarks":"","accept_address":"广东湛江fdsfds","total_time":0,"order_create_time":{"$date":"2017-12-15T01:15:09.030Z"},"order_update_time":{"$date":"2017-12-15T01:16:59.642Z"},"order_status":1,"is_comment":0,"__v":0} 7 | {"_id":{"$oid":"5a33229b8dd26c0a7c208348"},"user_id":{"$oid":"5a1ebdadb21908f9618bb79a"},"shop_id":{"$oid":"5a2e6babd8760360f828cde9"},"food_list":"[{\"dishId\":\"5a2e856389e6d96418422a31\",\"dishName\":\"熊猫奶盖茶\",\"dishNum\":\"1\",\"dishPrice\":\"14\"}]","order_amount":17,"order_remarks":"2222123","accept_address":"广东湛江fdsfds","total_time":0,"order_create_time":{"$date":"2017-12-15T01:15:09.030Z"},"order_update_time":{"$date":"2017-12-15T01:17:16.040Z"},"order_status":3,"is_comment":0,"__v":0} 8 | -------------------------------------------------------------------------------- /server/db_vue/users.json: -------------------------------------------------------------------------------- 1 | {"_id":{"$oid":"5a1ebdadb21908f9618bb79a"},"user_name":"1c0419rrb","user_pwd":"$2a$10$Pt6wOirBZoqTwiTXfTe2EuhY6i8gbB5ZCJ8sFYgPbTC4YZ0L97tR2","_pass":"$2a$10$UXXwKFA1hNusrprsOhl.kOgqMWSNGzIE9GA6Tv2l6WtWXByEEzpRW","phone_num":1.234567891e+10,"updateAt":{"$date":"2017-11-29T14:01:17.941Z"},"createAt":{"$date":"2017-11-29T14:01:17.941Z"},"is_merchant":0,"__v":0,"accept_address":"广东湛江fdsfds","avator":"\\uploads\\1513227744069.jpg","create_at":{"$date":"2017-12-12T06:29:03.129Z"},"introduction":"woshi`````","update_at":{"$date":"2017-12-15T01:16:47.857Z"},"gender":1} 2 | {"_id":{"$oid":"5a2bcb6395f94c4708b6d154"},"user_name":"test1","user_pwd":"$2a$10$ZPN2fmwEmguX20WEeka.6ecLCer2u2/9qvkcicGOhv5JQB5ZlCXFO","phone_num":1.1111122332e+10,"avator":"https://fuss10.elemecdn.com/a/07/b14a3c916e62d27163ced7a1c9c7fpng.png?imageMogr2/thumbnail/70x70","gender":1,"acceptAddress":"","introduction":"hhh","updateAt":{"$date":"2017-12-09T11:39:15.195Z"},"createAt":{"$date":"2017-12-09T11:39:15.195Z"},"is_merchant":0,"__v":0} 3 | {"_id":{"$oid":"5a2bcb6395f94c4708b6d155"},"user_name":"test2","user_pwd":"$2a$10$huSvKfv6PHabDmniDUGGIORENGHevgEkZjWqpV15sUUZqkhh.ql2u","phone_num":1.1112222333e+10,"avator":"\\uploads\\1513267372733.jpg","gender":1,"acceptAddress":"","introduction":"hhh","updateAt":{"$date":"2017-12-09T11:39:15.195Z"},"createAt":{"$date":"2017-12-09T11:39:15.195Z"},"is_merchant":0,"__v":0,"accept_address":"广东广州gg","create_at":{"$date":"2017-12-14T15:58:16.781Z"},"update_at":{"$date":"2017-12-15T01:15:10.587Z"}} 4 | {"_id":{"$oid":"5a2bcb6395f94c4708b6d153"},"user_name":"eee","user_pwd":"$2a$10$BKd6WwhJrQ3XvcCzH/iaseHUrSeaoDYpalDXUhITFnzRlAx0t38Fm","phone_num":1.1111122331e+10,"avator":"https://fuss10.elemecdn.com/a/07/b14a3c916e62d27163ced7a1c9c7fpng.png?imageMogr2/thumbnail/70x70","gender":1,"acceptAddress":"","introduction":"hhh","updateAt":{"$date":"2017-12-09T11:39:15.195Z"},"createAt":{"$date":"2017-12-09T11:39:15.195Z"},"is_merchant":0,"__v":0} 5 | {"_id":{"$oid":"5a2bcb6395f94c4708b6d156"},"user_name":"test3","user_pwd":"$2a$10$KEJYYkSiJ7Ow2C5QkPJhieBTsZwtE6dTlLMZKtvxSLnLmUTUfn4IW","phone_num":1.1111122334e+10,"avator":"https://fuss10.elemecdn.com/a/07/b14a3c916e62d27163ced7a1c9c7fpng.png?imageMogr2/thumbnail/70x70","gender":0,"acceptAddress":"","introduction":"hhh","updateAt":{"$date":"2017-12-09T11:39:15.195Z"},"createAt":{"$date":"2017-12-09T11:39:15.195Z"},"is_merchant":0,"__v":0} 6 | {"_id":{"$oid":"5a2cc0bf9ad6a42758d9d764"},"user_name":"user","user_pwd":"$2a$10$fRKx/mZi341I5MZK1CksjesWdAQXGJsy9WX308SzuqtdUSGVP23/K","phone_num":1.2345678911e+10,"avator":"https://fuss10.elemecdn.com/a/07/b14a3c916e62d27163ced7a1c9c7fpng.png?imageMogr2/thumbnail/70x70","gender":1,"acceptAddress":"","introduction":"hhh","updateAt":{"$date":"2017-12-10T05:06:08.022Z"},"createAt":{"$date":"2017-12-10T05:06:08.022Z"},"is_merchant":0,"__v":0} 7 | {"_id":{"$oid":"5a329f99db97432a14f73c48"},"user_pwd":"$2a$10$xg0QIcfCPv7mYT5xQISoKe182uxsDw5HIvMZOW1r6lRX13jTw2DY.","user_name":"far4e3r233","phone_num":1.3432841079e+10,"update_at":{"$date":"2017-12-14T15:58:17.339Z"},"create_at":{"$date":"2017-12-14T15:58:17.339Z"},"is_merchant":0,"gender":1,"__v":0} 8 | -------------------------------------------------------------------------------- /server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "node bin/www", 7 | "_start": "node --experimental-modules --loader ./custom-loader.mjs bin/www", 8 | "dev": "./node_modules/.bin/nodemon bin/www", 9 | "prd": "pm2 start bin/www", 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "dependencies": { 13 | "bcrypt": "^1.0.3", 14 | "debug": "^2.6.3", 15 | "jsonwebtoken": "^8.1.0", 16 | "koa": "^2.2.0", 17 | "koa-bodyparser": "^3.2.0", 18 | "koa-compress": "^2.0.0", 19 | "koa-convert": "^1.2.0", 20 | "koa-generic-session": "^2.0.0", 21 | "koa-json": "^2.0.2", 22 | "koa-jwt": "^3.2.2", 23 | "koa-logger": "^2.0.1", 24 | "koa-multer": "^1.0.2", 25 | "koa-onerror": "^1.2.1", 26 | "koa-router": "^7.1.1", 27 | "koa-session-mongoose": "^1.0.0", 28 | "koa-session-store": "^2.0.0", 29 | "koa-session2": "^2.2.5", 30 | "koa-static": "^3.0.0", 31 | "koa-static-cache": "^5.1.1", 32 | "koa-views": "^5.2.1", 33 | "moment": "^2.19.2", 34 | "mongoose": "^4.13.5", 35 | "phantom": "^4.0.9", 36 | "pug": "^2.0.0-rc.1", 37 | "request": "^2.83.0" 38 | }, 39 | "devDependencies": { 40 | "nodemon": "^1.8.1" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /server/public/index.html: -------------------------------------------------------------------------------- 1 | 吃货宝
-------------------------------------------------------------------------------- /server/public/javascripts/testJWT.js: -------------------------------------------------------------------------------- 1 | const Koa = require('koa') 2 | const Router = require('koa-router') 3 | const bodyParser = require('koa-bodyparser') 4 | const jwt = require('jsonwebtoken') 5 | const jwtKoa = require('koa-jwt') 6 | const secret = 'jwt demo' 7 | const app = new Koa() 8 | const router = new Router() 9 | app.use(bodyParser()) 10 | app 11 | .use(jwtKoa({ secret }).unless({ 12 | path: [/^\/api\/login/] // 数组中的路径不需要通过jwt验证 13 | })) 14 | router 15 | .post('/api/login', async (ctx, next) => { 16 | const user = ctx.request.body 17 | if (user && user.name) { 18 | let userToken = { 19 | name: user.name 20 | } 21 | const token = jwt.sign(userToken, secret, { expiresIn: '1h' }) // token签名 有效期为1小时 22 | ctx.body = { 23 | message: '获取token成功', 24 | code: 1, 25 | token 26 | } 27 | } else { 28 | ctx.body = { 29 | message: '参数错误', 30 | code: -1 31 | } 32 | } 33 | }) 34 | .get('/api/userInfo', async (ctx) => { 35 | const token = ctx.header.authorization // 获取jwt 36 | let payload 37 | if (token) { 38 | payload = await jwt.verify(token.split(' ')[1], secret) // // 解密,获取payload 39 | ctx.body = { 40 | payload 41 | } 42 | } else { 43 | ctx.body = { 44 | message: 'token 错误', 45 | code: -1 46 | } 47 | } 48 | }) 49 | app 50 | .use(router.routes()) 51 | .use(router.allowedMethods()) 52 | app.listen(3000, () => { 53 | console.log('app listening 3000...') 54 | }) 55 | -------------------------------------------------------------------------------- /server/public/javascripts/testdownload.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | const request = require('request') 3 | 4 | request({ 5 | url: 'http://f.wanfangdata.com.cn/Fulltext.ashx?fileId=Periodical_zhyxjy200202010&type=download&transaction=%7b%22ExtraData%22%3a%5b%5d%2c%22IsCache%22%3afalse%2c%22Transaction%22%3a%7b%22DateTime%22%3a%22%5c%2fDate(1512213259597%2b0800)%5c%2f%22%2c%22Id%22%3a%22e1fc302c-fd77-43c6-a772-a83d013d0b99%22%2c%22Memo%22%3anull%2c%22ProductDetail%22%3a%22Periodical_zhyxjy200202010%22%2c%22SessionId%22%3a%22f0efc45b-e77c-4f18-866a-0f12cbb3a866%22%2c%22Signature%22%3a%22kwU433%2b14fRgZPNwuThZgJCGXiCTLfUwooyNW%5c%2fYefNwAaqX5dSWVpg08SvyDcOZP%22%2c%22TransferIn%22%3a%7b%22AccountType%22%3a%22Income%22%2c%22Key%22%3a%22PeriodicalFulltext%22%7d%2c%22TransferOut%22%3a%7b%22AccountType%22%3a%22GTimeLimit%22%2c%22Key%22%3a%22gdhydx%22%7d%2c%22Turnover%22%3a3.00000%2c%22User%22%3anull%2c%22UserIP%22%3a%22125.90.48.97%22%7d%2c%22TransferOutAccountsStatus%22%3a%5b%5d%7d', 6 | method: 'GET', 7 | headers: { 8 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36', 9 | 'Host': 'docdownload.cnki.net', 10 | 'Referer': 'http://kns.cnki.net/KCMS/detail/detail.aspx?dbcode=CJFQ&dbname=CJFD2013&filename=JYKQ201303016&uid=WEEvREcwSlJHSldRa1FhdXNXYXFuU2lNQk96MFhZSUUxc2hYS0MzUVE0cz0=$9A4hF_YAuvQ5obgVAqNKPCYcEjKensW4IQMovwHtwkF4VYPoHbKxJw!!&v=MjIyMDJUQWY3RzRIOUxNckk5RVlvUjhlWDFMdXhZUzdEaDFUM3FUcldNMUZyQ1VSTDJlWmVadEZ5RG1VTHpNTHo=', 11 | 'Upgrade-Insecure-Requests': 1, 12 | 'Cookie': 'ecp_uid5=5d54bba29c313af502e9001f56d24342; Ecp_notFirstLogin=m0Sqm6; Ecp_ClientId=3171114111802389971; RsPerPage=20; cnkiUserKey=60acc755-3ba6-d796-06bc-c115641a5ceb; ASP.NET_SessionId=rnze00bbirp1mhhyaazyst3e; SID_kns=123115; SID_klogin=125141; SID_crrs=125133; SID_krsnew=125133; SID_kcms=124120; SID_knsdelivery=125121; DisplaySave=1; Ecp_session=1; c_m_LinID=LinID=WEEvREcwSlJHSldRa1FhdXNXYXFuU2lNQk96MFhZSUUxc2hYS0MzUVE0cz0=$9A4hF_YAuvQ5obgVAqNKPCYcEjKensW4IQMovwHtwkF4VYPoHbKxJw!!&ot=12/02/2017 19:43:45; LID=WEEvREcwSlJHSldRa1FhdXNXYXFuU2lNQk96MFhZSUUxc2hYS0MzUVE0cz0=$9A4hF_YAuvQ5obgVAqNKPCYcEjKensW4IQMovwHtwkF4VYPoHbKxJw!!; c_m_expire=2017-12-02 19:43:45; Ecp_LoginStuts=%7B%22IsAutoLogin%22%3Afalse%2C%22UserName%22%3A%22GDZJHY%22%2C%22ShowName%22%3A%22%25E5%25B9%25BF%25E4%25B8%259C%25E6%25B5%25B7%25E6%25B4%258B%25E5%25A4%25A7%25E5%25AD%25A6%22%2C%22UserType%22%3A%22bk%22%2C%22r%22%3A%22m0Sqm6%22%7D' 13 | } 14 | }).pipe(fs.createWriteStream('lunwen.pdf')) 15 | -------------------------------------------------------------------------------- /server/public/static/fonts/element-icons.6f0a763.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ooooevan/chihuobao/58d8678e96751b649857665b14dbeaf6a5001761/server/public/static/fonts/element-icons.6f0a763.ttf -------------------------------------------------------------------------------- /server/public/static/img/1.ab11078.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ooooevan/chihuobao/58d8678e96751b649857665b14dbeaf6a5001761/server/public/static/img/1.ab11078.jpg -------------------------------------------------------------------------------- /server/public/static/js/12.cb21caf22b25f4e21ab7.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([12],{"1cHd":function(e,t,n){var s=n("zeKi");"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);n("rjj0")("10adc450",s,!0)},ODxn:function(e,t,n){e.exports=n.p+"static/img/1.ab11078.jpg"},oBjx:function(e,t,n){"use strict";function s(e){n("1cHd")}Object.defineProperty(t,"__esModule",{value:!0});var a=n("d7EF"),i=n.n(a),o=n("Dd8w"),c=n.n(o),r=n("NYxO"),l=n("pN2o"),d={data:function(){return{location:"请选择",isSelect:!1,input:"",locationCascader:[]}},created:function(){this.initCity()},mounted:function(){var e=this.$refs.input.$el.getElementsByClassName("el-input-group__prepend")[0];e.style.padding=0,e.style.border=0},computed:c()({},Object(r.c)("user",["cityOptions","suggestionsList"])),watch:{suggestionsList:function(e){this.cb&&this.cb(e)},locationCascader:function(e){this._selectLocation([e[0],e[1]||e[0]]),this.isSelect=!0,console.log("选择了:"+e.join(""))}},methods:c()({search:function(){this.$refs.input.$el.getElementsByClassName("el-input__inner")[1].focus()},querySearchAsync:function(e,t){if(""===e.trim())return void t([]);this.getSuggestion(e.trim()),this.cb=t},handleSelect:function(e){this.saveExactAddress(e),this.$router.push("/place")},_selectLocation:function(e){var t=i()(e,2),n=t[0],s=t[1];this.setInexactAddress([n,s]),this.clearSuggestionsList()},initCity:function(){var e=this;Object(l.l)().then(function(t){e.isSelect||(console.log("定位到:"+t.address_detail.province+t.address_detail.city),e.setInexactAddress([t.address_detail.province,t.address_detail.city]),e.location=t.address_detail.city)})}},Object(r.b)("user",["getSuggestion","saveExactAddress"]),Object(r.d)({setInexactAddress:"user/SET_INEXACT_CITY",setCoordinate:"user/SET_COORDINATE",clearSuggestionsList:"user/CLEAR_SUGGESTIONS_LIST"}))},u=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"home"},[n("div",{staticClass:"searchBox"},[n("el-autocomplete",{ref:"input",staticClass:"input-with-cascader",attrs:{placeholder:"请输入内容",valueKey:"name","popper-class":"popper-class",debounce:300,"fetch-suggestions":e.querySearchAsync,"trigger-on-focus":!0},on:{select:e.handleSelect},model:{value:e.input,callback:function(t){e.input=t},expression:"input"}},[n("el-cascader",{ref:"el-cascader",attrs:{slot:"prepend",options:e.cityOptions,"show-all-levels":!1,placeholder:e.location},slot:"prepend",model:{value:e.locationCascader,callback:function(t){e.locationCascader=t},expression:"locationCascader"}}),e._v(" "),n("el-button",{staticClass:"search",attrs:{slot:"append"},on:{click:e.search},slot:"append"},[e._v("搜索")])],1)],1),e._v(" "),n("div",{staticClass:"div"},[e._v("当前城市:"+e._s(e.locationCascader&&e.locationCascader.length>0&&e.locationCascader||e.location))])])},p=[],h={render:u,staticRenderFns:p},f=h,g=n("VU/8"),_=s,v=g(d,f,!1,_,null,null);t.default=v.exports},zeKi:function(e,t,n){t=e.exports=n("FZ+f")(!1),t.push([e.i,'\n.home {\n min-height: 600px;\n position: relative;\n}\n.home:after {\n content: "";\n background: url('+n("ODxn")+");\n background-size: cover;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.input-with-cascader {\n width: 550px;\n}\n.el-cascader {\n width: 100px;\n}\n.searchBox {\n width: 550px;\n padding-top: 230px;\n margin: 0 auto;\n position: relative;\n z-index: 10;\n}\n.searchBox .el-autocomplete.input-with-cascader {\n -webkit-transform: scale(1.1, 1.1);\n transform: scale(1.1, 1.1);\n}\n.searchBox .el-autocomplete.input-with-cascader .el-input-group__append {\n background: #ff3838;\n border-color: #ff3838;\n}\n.searchBox .el-autocomplete.input-with-cascader .el-input-group__append .search {\n background: #ff3838;\n color: #fff;\n border-color: #ff3838;\n}\n",""])}}); -------------------------------------------------------------------------------- /server/public/static/js/13.bb75dde68ca1e30acc1a.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([13],{"9D8o":function(n,t,e){t=n.exports=e("FZ+f")(!1),t.push([n.i,"\n\n\n\n\n\n\n\n",""])},"9KCJ":function(n,t,e){"use strict";function s(n){e("kmsZ")}Object.defineProperty(t,"__esModule",{value:!0});var i=e("OA01"),o=e.n(i),r=function(){var n=this,t=n.$createElement;return(n._self._c||t)("div",{staticClass:"div"},[n._v("statistics")])},c=[],a={render:r,staticRenderFns:c},l=a,u=e("VU/8"),f=s,d=u(o.a,l,!1,f,null,null);t.default=d.exports},OA01:function(n,t){},kmsZ:function(n,t,e){var s=e("9D8o");"string"==typeof s&&(s=[[n.i,s,""]]),s.locals&&(n.exports=s.locals);e("rjj0")("dd628a9e",s,!0)}}); -------------------------------------------------------------------------------- /server/public/static/js/14.8040bbccce72271f2009.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([14],{"G8h+":function(e,t,n){var r=n("Waph");"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n("rjj0")("1ff36e1c",r,!0)},M92b:function(e,t,n){"use strict";function r(e){n("G8h+")}Object.defineProperty(t,"__esModule",{value:!0});var a=n("Dd8w"),o=n.n(a),i=n("JZJf"),s=n("pN2o"),d=n("NYxO"),l={data:function(){return{defaultActive:"",timer:null,routes:[{route:"order",label:"订单"},{route:"menu",label:"菜单"},{route:"new",label:"上传新品"},{route:"rate",label:"菜品评论"},{route:"info",label:"商铺信息"}]}},computed:o()({},Object(d.c)("seller",["newOrderNum","sellerInfo","shopTypeList","foodTypeList"])),created:function(){var e=this,t=this.$router.currentRoute.path,n=t.split("/")[2];this.defaultActive=this.routes.findIndex(function(e){return e.route===n})+1+"",this.getShopType(),this.getFoodType(),this.isNewOrder(),this.timer=setInterval(function(){e.isNewOrder()},1e4)},beforeDestroy:function(){clearInterval(this.timer)},methods:o()({getShopType:function(){var e=this;Object(s.h)().then(function(t){e.setShopType(t.data)})},getFoodType:function(){var e=this,t=this.sellerInfo.shopId;Object(i.d)(t).then(function(t){e.setFoodType(t.data.list)})},isNewOrder:function(){var e=this,t=this.sellerInfo.shopId;Object(i.i)(t).then(function(t){1===t.code&&t.data>0&&(e.setNewOrderNum(t.data),e.$refs.audio.play())})}},Object(d.d)({setNewOrderNum:"seller/SET_NEW_ORDER_NUM",setShopType:"seller/SET_SHOPTYPE",setFoodType:"seller/SET_FOODTYPE"}))},c=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{attrs:{id:"app"}},[r("el-header",[e._v("吃货宝·商家版")]),e._v(" "),r("el-container",[r("el-aside",[r("el-menu",{staticClass:"el-menu-vertical-demo",attrs:{"default-active":e.defaultActive,"background-color":"#545c64","text-color":"#fff",router:!0}},[e._l(e.routes,function(t,n){return r("el-menu-item",{key:n,attrs:{index:n+1+"",route:t.route}},[r("i",{staticClass:"el-icon-location"}),e._v(" "),r("span",[e._v(e._s(t.label))]),"order"===t.route&&e.newOrderNum>0?r("span",{staticClass:"badge"},[e._v(e._s(e.newOrderNum))]):e._e()])}),e._v(" "),r("audio",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"}],ref:"audio",attrs:{controls:"controls"}},[r("source",{attrs:{src:n("kcsv"),type:"audio/ogg"}})])],2)],1),e._v(" "),r("el-main",[r("router-view")],1)],1)],1)},u=[],p={render:c,staticRenderFns:u},f=p,h=n("VU/8"),v=r,m=h(l,f,!1,v,"data-v-91a8d2e2",null);t.default=m.exports},Waph:function(e,t,n){t=e.exports=n("FZ+f")(!1),t.push([e.i,"\n#app[data-v-91a8d2e2] {\n height: 100%;\n}\n.el-header[data-v-91a8d2e2] {\n height: 50px !important;\n line-height: 50px;\n background: #409eff;\n color: #fff;\n}\n.el-container[data-v-91a8d2e2] {\n height: calc(100% - 50px);\n}\n.el-aside[data-v-91a8d2e2] {\n background: #545c64;\n width: 230px !important;\n}\n.el-aside .el-menu[data-v-91a8d2e2] {\n border-right: none;\n}\n.el-main[data-v-91a8d2e2] {\n background: #fff;\n padding: 0;\n}\n.badge[data-v-91a8d2e2] {\n display: inline-block;\n color: #fff;\n height: 20px;\n width: 20px;\n border-radius: 10px;\n background: red;\n margin-left: 10px;\n border: 1px solid #FFF;\n line-height: 20px;\n text-align: center;\n}\n",""])},kcsv:function(e,t,n){e.exports=n.p+"static/media/song.15fd42e.mp3"}}); -------------------------------------------------------------------------------- /server/public/static/js/15.5c40c303f7e96438dcda.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([15],{"1H2k":function(n,e){},SnPj:function(n,e,t){"use strict";function s(n){t("sojP")}Object.defineProperty(e,"__esModule",{value:!0});var r=t("1H2k"),o=t.n(r),i=function(){var n=this,e=n.$createElement;return(n._self._c||e)("div",{staticClass:"div"},[n._v("revenue")])},c=[],u={render:i,staticRenderFns:c},a=u,l=t("VU/8"),f=s,p=l(o.a,a,!1,f,null,null);e.default=p.exports},bTIz:function(n,e,t){e=n.exports=t("FZ+f")(!1),e.push([n.i,"\n\n\n\n\n\n\n\n",""])},sojP:function(n,e,t){var s=t("bTIz");"string"==typeof s&&(s=[[n.i,s,""]]),s.locals&&(n.exports=s.locals);t("rjj0")("07770b3a",s,!0)}}); -------------------------------------------------------------------------------- /server/public/static/js/16.e7ff66e143a00487dfbc.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([16],{GIle:function(n,e,t){"use strict";function s(n){t("MPEk")}Object.defineProperty(e,"__esModule",{value:!0});var r=t("u+YN"),c=t.n(r),i=function(){var n=this,e=n.$createElement;return(n._self._c||e)("div",{staticClass:"div"},[n._v("home")])},o=[],u={render:i,staticRenderFns:o},l=u,a=t("VU/8"),f=s,d=a(c.a,l,!1,f,null,null);e.default=d.exports},MPEk:function(n,e,t){var s=t("PPyg");"string"==typeof s&&(s=[[n.i,s,""]]),s.locals&&(n.exports=s.locals);t("rjj0")("20dd16c6",s,!0)},PPyg:function(n,e,t){e=n.exports=t("FZ+f")(!1),e.push([n.i,"\n\n\n\n\n\n\n\n",""])},"u+YN":function(n,e){}}); -------------------------------------------------------------------------------- /server/public/static/js/17.169bd59f3099a790ee66.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([17],{"/piY":function(n,t){},"9v4E":function(n,t,e){t=n.exports=e("FZ+f")(!1),t.push([n.i,"\n\n\n\n\n\n\n\n",""])},ncSK:function(n,t,e){"use strict";function s(n){e("nxAs")}Object.defineProperty(t,"__esModule",{value:!0});var i=e("/piY"),c=e.n(i),r=function(){var n=this,t=n.$createElement;return(n._self._c||t)("div",{staticClass:"div"},[n._v("statistics")])},a=[],o={render:r,staticRenderFns:a},l=o,u=e("VU/8"),f=s,p=u(c.a,l,!1,f,null,null);t.default=p.exports},nxAs:function(n,t,e){var s=e("9v4E");"string"==typeof s&&(s=[[n.i,s,""]]),s.locals&&(n.exports=s.locals);e("rjj0")("dd628a9e",s,!0)}}); -------------------------------------------------------------------------------- /server/public/static/js/18.747739e91cde3537bb78.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([18],{"37HB":function(t,e,n){e=t.exports=n("FZ+f")(!1),e.push([t.i,"\n.success[data-v-44d236f7] {\n height: 550px;\n text-align: center;\n padding-top: 200px;\n}\n",""])},"p/9T":function(t,e,n){var s=n("37HB");"string"==typeof s&&(s=[[t.i,s,""]]),s.locals&&(t.exports=s.locals);n("rjj0")("75df7dde",s,!0)},qLfc:function(t,e,n){"use strict";function s(t){n("p/9T")}Object.defineProperty(e,"__esModule",{value:!0});var i=n("Dd8w"),c=n.n(i),r=n("NYxO"),o={data:function(){return{second:5,timer:0}},created:function(){this.mins(),this.clearCartList()},beforeDestroy:function(){clearTimeout(this.timer)},methods:c()({},Object(r.b)("user",["clearCartList"]),{mins:function(){var t=this;this.timer=setTimeout(function(){1===t.second?t.$router.push("/place"):(t.second--,t.mins())},1e3)}})},a=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"success"},[t._v("支付成功, "+t._s(t.second)+" 秒后返回首页...")])},u=[],d={render:a,staticRenderFns:u},f=d,l=n("VU/8"),p=s,h=l(o,f,!1,p,"data-v-44d236f7",null);e.default=h.exports}}); -------------------------------------------------------------------------------- /server/public/static/js/19.9497009632d9fb439fe4.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([19],{"4VzV":function(n,e,t){e=n.exports=t("FZ+f")(!1),e.push([n.i,"\n.success[data-v-356ce002] {\n height: 550px;\n text-align: center;\n padding-top: 200px;\n}\n",""])},UXiX:function(n,e,t){"use strict";function s(n){t("qRvq")}Object.defineProperty(e,"__esModule",{value:!0});var c={data:function(){return{second:5}},created:function(){this.mins()},methods:{mins:function(){var n=this;setTimeout(function(){1===n.second?window.close():(n.second--,n.mins())},1e3)}}},i=function(){var n=this,e=n.$createElement;return(n._self._c||e)("div",{staticClass:"success"},[n._v("假装正在支付.. "+n._s(n.second)+" 秒后关闭页面...多次点击已支付即可下一步")])},o=[],a={render:i,staticRenderFns:o},r=a,d=t("VU/8"),u=s,f=d(c,r,!1,u,"data-v-356ce002",null);e.default=f.exports},qRvq:function(n,e,t){var s=t("4VzV");"string"==typeof s&&(s=[[n.i,s,""]]),s.locals&&(n.exports=s.locals);t("rjj0")("3db8d89a",s,!0)}}); -------------------------------------------------------------------------------- /server/public/static/js/20.b96eaedd354247a92927.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([20],{RrUZ:function(n,t,c){"use strict";function s(n){c("k23U")}Object.defineProperty(t,"__esModule",{value:!0});var e={data:function(){return{second:5}},created:function(){this.mins()},methods:{mins:function(){var n=this;setTimeout(function(){1===n.second?n.$router.push("/place"):(n.second--,n.mins())},1e3)},click:function(){this.$router.push("/shopCart/checkout")}}},i=function(){var n=this,t=n.$createElement,c=n._self._c||t;return c("div",{staticClass:"success"},[n._v("支付失败, "+n._s(n.second)+" 秒后返回首页... "),c("span",{staticClass:"click",on:{click:n.click}},[n._v("重新查看")])])},a=[],o={render:i,staticRenderFns:a},r=o,u=c("VU/8"),d=s,l=u(e,r,!1,d,"data-v-2a5cfa34",null);t.default=l.exports},k23U:function(n,t,c){var s=c("psW4");"string"==typeof s&&(s=[[n.i,s,""]]),s.locals&&(n.exports=s.locals);c("rjj0")("bd4d747c",s,!0)},psW4:function(n,t,c){t=n.exports=c("FZ+f")(!1),t.push([n.i,"\n.success[data-v-2a5cfa34] {\n height: 550px;\n text-align: center;\n padding-top: 200px;\n}\n.success .click[data-v-2a5cfa34] {\n color: red;\n cursor: pointer;\n}\n",""])}}); -------------------------------------------------------------------------------- /server/public/static/js/22.3c811c1e89aa06feee79.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([22],{"8dWY":function(n,e,t){var r=t("D/Ht");"string"==typeof r&&(r=[[n.i,r,""]]),r.locals&&(n.exports=r.locals);t("rjj0")("d01138d0",r,!0)},"D/Ht":function(n,e,t){e=n.exports=t("FZ+f")(!1),e.push([n.i,"\n\n\n\n\n\n\n\n\n\n\n\n\n",""])},i0IY:function(n,e,t){"use strict";function r(n){t("8dWY")}Object.defineProperty(e,"__esModule",{value:!0});var c={},s=function(){var n=this,e=n.$createElement;n._self._c;return n._m(0,!1,!1)},i=[function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("div",[t("h1",[n._v("这是商家入驻页面")])])}],a={render:s,staticRenderFns:i},o=a,u=t("VU/8"),f=r,l=u(c,o,!1,f,"data-v-cf4a6592",null);e.default=l.exports}}); -------------------------------------------------------------------------------- /server/public/static/js/23.e07051c90e8f31c65493.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([23],{Skvz:function(t,e,a){e=t.exports=a("FZ+f")(!1),e.push([t.i,"\n.checkout[data-v-121f8242] {\n background: #fff;\n padding-bottom: 20px;\n}\n.checkout .title[data-v-121f8242] {\n text-align: center;\n padding: 20px;\n font-size: 25px;\n}\n.total[data-v-121f8242] {\n width: 50%;\n margin: 20px auto;\n text-align: right;\n color: red;\n}\n.total .money[data-v-121f8242] {\n font-size: 30px;\n}\n.el-form[data-v-121f8242] {\n width: 50%;\n margin: 0 auto;\n}\n.payLocation[data-v-121f8242] {\n cursor: pointer;\n color: red;\n}\n.payLocation[data-v-121f8242]:hover {\n text-decoration: underline;\n}\n",""])},chvr:function(t,e,a){"use strict";function o(t){a("lwrE")}Object.defineProperty(e,"__esModule",{value:!0});var n=a("Dd8w"),r=a.n(n),i=a("NYxO"),s=a("cD3F"),c=a("pN2o"),l={data:function(){return{dialogVisible:!1,payLocation:"",orderCode:0}},computed:r()({},Object(i.c)("user",["cartList","userInfo"]),{form:function(){return{remarks:"",acceptAddress:this.userInfo.acceptAddress}},totalMoney:function(){var t=s.a.accMul,e=s.a.accAdd,a=0;return this.cartList.forEach(function(o){a=e(a,t(o.num,o.dishPrice))}),a}}),methods:{onSubmit:function(){var t=this,e=this.userInfo.userId,a=void 0,o=void 0,n=this.cartList.filter(function(t){return t.dishType}).map(function(t){return a=t.shopId,o=t.shopName,{dishId:t.dishId,dishName:t.dishName,dishNum:t.num,dishPrice:t.dishPrice}}),r=this.totalMoney,i=this.form,s=i.remarks,l=i.acceptAddress;if(!a||!e)return this.$message({type:"error",message:"操作失败"}),!1;Object(c.q)(a,o,e,n,r,s,l).then(function(e){1===e.code&&(t.orderCode=e.data,Object(c.r)(e.data).then(function(e){t.dialogVisible=!0,t.payLocation=e.data,window.open(e.data)}))})},handleClick:function(){var t=this,e=this.orderCode;Object(c.k)(e).then(function(e){1===e.code?t.$router.push("/shopCart/success"):t.$message({type:"error",message:"未检测到支付,请稍后"})})},handleClose:function(){var t=this;this.$confirm("确认取消支付?").then(function(e){t.$router.push("/order")}).catch(function(t){})}}},d=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"checkout"},[a("div",{staticClass:"title"},[t._v("确认订单")]),t._v(" "),a("el-table",{staticStyle:{width:"50%",margin:"0 auto"},attrs:{data:t.cartList}},[a("el-table-column",{attrs:{prop:"dishName",label:"商品",width:"180"}}),t._v(" "),a("el-table-column",{attrs:{prop:"num",label:"数量",width:"180"}}),t._v(" "),a("el-table-column",{attrs:{prop:"dishPrice",label:"单价"}})],1),t._v(" "),a("div",{staticClass:"total"},[t._v("\n 总计: "),a("span",{staticClass:"money"},[t._v(t._s(t.totalMoney))]),t._v("元   \n ")]),t._v(" "),a("el-form",{ref:"form",attrs:{model:t.form,"label-width":"80px","label-position":"left"}},[a("el-form-item",{attrs:{label:"备注"}},[a("el-input",{model:{value:t.form.remarks,callback:function(e){t.$set(t.form,"remarks",e)},expression:"form.remarks"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"地址"}},[a("el-input",{model:{value:t.form.acceptAddress,callback:function(e){t.$set(t.form,"acceptAddress",e)},expression:"form.acceptAddress"}})],1),t._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:t.onSubmit}},[t._v("立即支付")])],1)],1),t._v(" "),a("el-dialog",{attrs:{title:"提示",visible:t.dialogVisible,width:"30%","before-close":t.handleClose},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("span",[t._v("请支付完后点击我已支付,若已支付请点击‘我已支付’")]),t._v(" "),a("a",{staticClass:"payLocation",attrs:{href:t.payLocation,target:"_blank"}},[t._v("若未正常跳转可点击手动跳转")]),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:t.handleClose}},[t._v("取消支付")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:t.handleClick}},[t._v("我已支付")])],1)])],1)},u=[],f={render:d,staticRenderFns:u},p=f,h=a("VU/8"),m=o,v=h(l,p,!1,m,"data-v-121f8242",null);e.default=v.exports},lwrE:function(t,e,a){var o=a("Skvz");"string"==typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);a("rjj0")("3481432f",o,!0)}}); -------------------------------------------------------------------------------- /server/public/static/js/25.6fda17f0bd7282d4ee12.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([25],{IVi9:function(t,e,a){"use strict";function n(t){a("ey3E")}Object.defineProperty(e,"__esModule",{value:!0});var i=a("Dd8w"),s=a.n(i),l=a("JZJf"),r=a("NYxO"),o={data:function(){return{pageNum:1,totalPage:1,pageSize:9,loading:!1,rateList:[]}},computed:s()({},Object(r.c)("seller",["sellerInfo"])),created:function(){this.getList()},methods:{getList:function(){var t=this;this.loading=!0;var e=this.pageNum,a=this.sellerInfo.shopId;Object(l.e)(a,e).then(function(e){t.pageNum=e.data.pageNum,t.totalPage=e.data.totalPage,setTimeout(function(){t.loading=!1},1e3),t.rateList=e.data.dishComment})},changePage:function(t){this.pageNum=t,this.getList()}}},d=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{ref:"rate",staticClass:"rate"},[a("ul",t._l(t.rateList,function(e){return a("li",{key:e.commentId},[a("div",{staticClass:"name",attrs:{title:e.username}},[t._v(t._s(e.username.slice(0,2)+"**"+e.username.substr(-2)))]),t._v(" "),a("div",{staticClass:"comment"},[a("div",{staticClass:"clearfix"},[a("p",{staticClass:"fl dishName"},[t._v(t._s(e.dishName))]),t._v(" "),a("p",{staticClass:"fr date"},[t._v(t._s(t.$moment(e.commentDate).format("YYYY-MM-DD HH:mm:ss")))]),t._v(" "),a("el-rate",{ref:"el-rate",refInFor:!0,staticClass:"el-rate",attrs:{disabled:"","show-text":"","text-color":"#ff9900"},model:{value:e.level,callback:function(a){t.$set(e,"level",a)},expression:"item.level"}})],1),t._v(" "),a("p",{staticClass:"content"},[t._v(t._s(e.comment))])])])})),t._v(" "),a("el-pagination",{attrs:{layout:"prev, pager, next","page-size":t.pageSize,"page-count":t.totalPage},on:{"current-change":t.changePage}})],1)},c=[],m={render:d,staticRenderFns:c},u=m,p=a("VU/8"),f=n,v=p(o,u,!1,f,"data-v-74e03d12",null);e.default=v.exports},ey3E:function(t,e,a){var n=a("utCZ");"string"==typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);a("rjj0")("530508be",n,!0)},utCZ:function(t,e,a){e=t.exports=a("FZ+f")(!1),e.push([t.i,"\n.rate[data-v-74e03d12] {\n background: #fff;\n min-height: 100%;\n}\n.rate ul li[data-v-74e03d12] {\n padding: 25px 28px;\n}\n.rate ul li .name[data-v-74e03d12], .rate ul li .comment[data-v-74e03d12] {\n display: inline-block;\n}\n.rate ul li .name[data-v-74e03d12] {\n vertical-align: top;\n width: 10%;\n}\n.rate ul li .comment[data-v-74e03d12] {\n width: 50%;\n padding-left: 20px;\n}\n.rate ul li .comment .dishName[data-v-74e03d12] {\n margin-right: 10px;\n}\n.rate ul li .comment .content[data-v-74e03d12] {\n margin-top: 5px;\n color: #969696;\n}\n.rate ul li .comment .date[data-v-74e03d12] {\n font-size: 15px;\n}\n.rate ul .el-rate[data-v-74e03d12] {\n -webkit-transform: translateY(-3px);\n transform: translateY(-3px);\n}\n",""])}}); -------------------------------------------------------------------------------- /server/public/static/js/25.c84756d83508cc2c10c4.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([25],{IVi9:function(t,e,a){"use strict";function n(t){a("ZV9H")}Object.defineProperty(e,"__esModule",{value:!0});var i=a("Dd8w"),s=a.n(i),l=a("JZJf"),r=a("NYxO"),o={data:function(){return{pageNum:1,totalPage:1,pageSize:9,loading:!1,rateList:[]}},computed:s()({},Object(r.c)("seller",["sellerInfo"])),created:function(){this.getList()},methods:{getList:function(){var t=this;this.loading=!0;var e=this.pageNum,a=this.sellerInfo.shopId;Object(l.e)(a,e).then(function(e){t.pageNum=e.data.pageNum,t.totalPage=e.data.totalPage,setTimeout(function(){t.loading=!1},1e3),t.rateList=e.data.dishComment})},changePage:function(t){this.pageNum=t,this.getList()}}},c=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{ref:"rate",staticClass:"rate"},[a("ul",t._l(t.rateList,function(e){return a("li",{key:e.commentId},[a("div",{staticClass:"name",attrs:{title:e.userName}},[t._v(t._s(e.userName.slice(0,2)+"**"+e.userName.substr(-2)))]),t._v(" "),a("div",{staticClass:"comment"},[a("div",{staticClass:"clearfix"},[a("p",{staticClass:"fl dishName"},[t._v(t._s(e.dishName))]),t._v(" "),a("p",{staticClass:"fr date"},[t._v(t._s(t.$moment(e.commentDate).format("YYYY-MM-DD HH:mm:ss")))]),t._v(" "),a("el-rate",{ref:"el-rate",refInFor:!0,staticClass:"el-rate",attrs:{disabled:"","show-text":"","text-color":"#ff9900"},model:{value:e.level,callback:function(a){t.$set(e,"level",a)},expression:"item.level"}})],1),t._v(" "),a("p",{staticClass:"content"},[t._v(t._s(e.comment))])])])})),t._v(" "),a("el-pagination",{attrs:{layout:"prev, pager, next","page-size":t.pageSize,"page-count":t.totalPage},on:{"current-change":t.changePage}})],1)},d=[],m={render:c,staticRenderFns:d},f=m,u=a("VU/8"),p=n,v=u(o,f,!1,p,"data-v-70eaf552",null);e.default=v.exports},ZV9H:function(t,e,a){var n=a("qTkk");"string"==typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);a("rjj0")("87bc1670",n,!0)},qTkk:function(t,e,a){e=t.exports=a("FZ+f")(!1),e.push([t.i,"\n.rate[data-v-70eaf552] {\n background: #fff;\n min-height: 100%;\n}\n.rate ul li[data-v-70eaf552] {\n padding: 25px 28px;\n}\n.rate ul li .name[data-v-70eaf552], .rate ul li .comment[data-v-70eaf552] {\n display: inline-block;\n}\n.rate ul li .name[data-v-70eaf552] {\n vertical-align: top;\n width: 10%;\n}\n.rate ul li .comment[data-v-70eaf552] {\n width: 50%;\n padding-left: 20px;\n}\n.rate ul li .comment .dishName[data-v-70eaf552] {\n margin-right: 10px;\n}\n.rate ul li .comment .content[data-v-70eaf552] {\n margin-top: 5px;\n color: #969696;\n}\n.rate ul li .comment .date[data-v-70eaf552] {\n font-size: 15px;\n}\n.rate ul .el-rate[data-v-70eaf552] {\n -webkit-transform: translateY(-3px);\n transform: translateY(-3px);\n}\n",""])}}); -------------------------------------------------------------------------------- /server/public/static/js/26.1fda9ceb0f20df549d6c.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([26],{JLrb:function(t,e,n){e=t.exports=n("FZ+f")(!1),e.push([t.i,"\n.div[data-v-3637ced0] {\n padding: 20px;\n}\n.click[data-v-3637ced0] {\n cursor: pointer;\n}\n",""])},VXIr:function(t,e,n){var c=n("JLrb");"string"==typeof c&&(c=[[t.i,c,""]]),c.locals&&(t.exports=c.locals);n("rjj0")("3611dbd3",c,!0)},qzyW:function(t,e,n){"use strict";function c(t){n("VXIr")}Object.defineProperty(e,"__esModule",{value:!0});var r={methods:{click:function(){this.$router.push("/seller")}}},s=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"div"},[t._v("页面已经被吃掉了... "),n("span",{staticClass:"click",on:{click:t.click}},[t._v(">>")])])},i=[],a={render:s,staticRenderFns:i},l=a,o=n("VU/8"),d=c,u=o(r,l,!1,d,"data-v-3637ced0",null);e.default=u.exports}}); -------------------------------------------------------------------------------- /server/public/static/js/27.36bb4559f7adf66e6c30.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([27],{TZm7:function(e,a,t){var r=t("kFIh");"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);t("rjj0")("199ee306",r,!0)},kFIh:function(e,a,t){a=e.exports=t("FZ+f")(!1),a.push([e.i,"\n._new {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n padding: 20px;\n min-height: 500px;\n background: #fff;\n}\n._new .el-form {\n margin: 30px auto 0;\n width: 60%;\n}\n._new .avatar-uploader .el-upload {\n border: 1px dashed #d9d9d9;\n border-radius: 6px;\n cursor: pointer;\n position: relative;\n overflow: hidden;\n}\n._new .avatar-uploader .el-upload:hover {\n border-color: #409EFF;\n}\n._new .avatar-uploader-icon {\n font-size: 28px;\n color: #8c939d;\n width: 178px;\n height: 178px;\n line-height: 178px;\n text-align: center;\n}\n._new .avatar {\n width: 178px;\n height: 178px;\n display: block;\n}\n",""])},n2sk:function(e,a,t){"use strict";function r(e){t("TZm7")}Object.defineProperty(a,"__esModule",{value:!0});var l=t("Dd8w"),o=t.n(l),n=t("JZJf"),s=t("NYxO"),i=t("OOMk"),p=i.a.seller.upload,c={data:function(){return{imageUrl:"",uploadUrl:p,validateForm:{price:"",abstract:"",name:"",type:""}}},computed:o()({},Object(s.c)("seller",["sellerInfo"]),Object(s.c)("seller",["foodTypeList"]),{types:function(){return this.foodTypeList.map(function(e){return{label:e.typeDes,value:e.foodTypeId}})}}),methods:{add:function(){},submitForm:function(e){var a=this;this.$refs[e].validate(function(e){if(!e)return console.log("error submit!!"),!1;if(!a.imageUrl)return a.$message({type:"error",message:"请上传图片"}),!1;var t=a.imageUrl,r=a.sellerInfo.shopId,l=a.validateForm,o=l.name,s=l.price,i=l.abstract,p=l.type;Object(n.a)(r,o,s,p,i,t).then(function(e){1===e.code?(a.$message({type:"success",message:"添加成功!"}),a.$router.push("/seller/menu")):a.$message({type:"error",message:"添加失败!"})})})},handleAvatarSuccess:function(e,a){this.imageUrl=e.data.imageUrl},beforeAvatarUpload:function(e){var a="image/jpeg"===e.type||"image/png"||"image/gif",t=e.size/1024/1024<5;return a||this.$message.error("上传头像图片只能是 JPG 格式!"),t||this.$message.error("上传头像图片大小不能超过 5MB!"),a&&t}}},m=function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("div",{staticClass:"_new"},[t("el-form",{ref:"validateForm",staticClass:"demo-ruleForm",attrs:{model:e.validateForm,"label-width":"100px"}},[t("el-form-item",{attrs:{label:"名称",prop:"name",rules:[{required:!0,message:"名称不能为空"}]}},[t("el-input",{attrs:{type:"name","auto-complete":"off"},model:{value:e.validateForm.name,callback:function(a){e.$set(e.validateForm,"name",e._n(a))},expression:"validateForm.name"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"价格",prop:"price",rules:[{required:!0,message:"价格不能为空"}]}},[t("el-input",{attrs:{type:"price","auto-complete":"off"},model:{value:e.validateForm.price,callback:function(a){e.$set(e.validateForm,"price",e._n(a))},expression:"validateForm.price"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"类型",prop:"type",rules:[{required:!0,message:"类型不能为空"}]}},[t("el-select",{attrs:{placeholder:"请选择菜品类型"},model:{value:e.validateForm.type,callback:function(a){e.$set(e.validateForm,"type",a)},expression:"validateForm.type"}},e._l(e.types,function(e){return t("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))],1),e._v(" "),t("el-form-item",{attrs:{label:"描述",prop:"abstract",rules:[{required:!0,message:"描述不能为空"}]}},[t("el-input",{attrs:{type:"abstract","auto-complete":"off"},model:{value:e.validateForm.abstract,callback:function(a){e.$set(e.validateForm,"abstract",e._n(a))},expression:"validateForm.abstract"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"图片",prop:"imageUrl"}},[t("el-upload",{staticClass:"avatar-uploader",attrs:{action:e.uploadUrl,name:"image","with-credentials":!0,"show-file-list":!1,drag:!0,"on-success":e.handleAvatarSuccess,"before-upload":e.beforeAvatarUpload}},[e.imageUrl?t("img",{staticClass:"avatar",attrs:{src:e.imageUrl}}):t("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1),e._v(" "),t("el-form-item",[t("el-button",{attrs:{type:"primary"},on:{click:function(a){e.submitForm("validateForm")}}},[e._v("提交")])],1)],1)],1)},d=[],u={render:m,staticRenderFns:d},f=u,v=t("VU/8"),b=r,g=v(c,f,!1,b,null,null);a.default=g.exports}}); -------------------------------------------------------------------------------- /server/public/static/js/27.7226dc9d5b0f827db870.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([27],{"/o82":function(e,a,t){a=e.exports=t("FZ+f")(!1),a.push([e.i,"\n._new {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n padding: 20px;\n min-height: 500px;\n background: #fff;\n}\n._new .el-form {\n margin: 30px auto 0;\n width: 60%;\n}\n._new .avatar-uploader .el-upload {\n border: 1px dashed #d9d9d9;\n border-radius: 6px;\n cursor: pointer;\n position: relative;\n overflow: hidden;\n}\n._new .avatar-uploader .el-upload:hover {\n border-color: #409EFF;\n}\n._new .avatar-uploader-icon {\n font-size: 28px;\n color: #8c939d;\n width: 178px;\n height: 178px;\n line-height: 178px;\n text-align: center;\n}\n._new .avatar {\n width: 178px;\n height: 178px;\n display: block;\n}\n",""])},n2sk:function(e,a,t){"use strict";function r(e){t("pCs3")}Object.defineProperty(a,"__esModule",{value:!0});var l=t("Dd8w"),o=t.n(l),n=t("JZJf"),s=t("NYxO"),i=t("OOMk"),p=i.a.seller.upload,c={data:function(){return{imageUrl:"",uploadUrl:p,validateForm:{price:"",abstract:"",name:"",type:""}}},computed:o()({},Object(s.c)("seller",["sellerInfo"]),Object(s.c)("seller",["foodTypeList"]),{types:function(){return this.foodTypeList.map(function(e){return{label:e.typeDes,value:e.foodTypeId}})}}),methods:{add:function(){},submitForm:function(e){var a=this;this.$refs[e].validate(function(e){if(!e)return console.log("error submit!!"),!1;if(!a.imageUrl)return a.$message({type:"error",message:"请上传图片"}),!1;var t=a.imageUrl,r=a.sellerInfo.shopId,l=a.validateForm,o=l.name,s=l.price,i=l.abstract,p=l.type;Object(n.a)(r,o,s,p,i,t).then(function(e){1===e.code?(a.$message({type:"success",message:"添加成功!"}),a.$router.push("/seller/menu")):a.$message({type:"error",message:"添加失败!"})})})},handleAvatarSuccess:function(e,a){this.imageUrl=e.data.imageUrl},beforeAvatarUpload:function(e){var a="image/jpeg"===e.type||"image/png"||"image/gif",t=e.size/1024/1024<5;return a||this.$message.error("上传头像图片只能是 JPG 格式!"),t||this.$message.error("上传头像图片大小不能超过 5MB!"),a&&t}}},d=function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("div",{staticClass:"_new"},[t("el-form",{ref:"validateForm",staticClass:"demo-ruleForm",attrs:{model:e.validateForm,"label-width":"100px"}},[t("el-form-item",{attrs:{label:"名称",prop:"name",rules:[{required:!0,message:"名称不能为空"}]}},[t("el-input",{attrs:{type:"name","auto-complete":"off"},model:{value:e.validateForm.name,callback:function(a){e.$set(e.validateForm,"name",e._n(a))},expression:"validateForm.name"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"价格",prop:"price",rules:[{required:!0,message:"价格不能为空"}]}},[t("el-input",{attrs:{type:"price","auto-complete":"off"},model:{value:e.validateForm.price,callback:function(a){e.$set(e.validateForm,"price",e._n(a))},expression:"validateForm.price"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"类型",prop:"type",rules:[{required:!0,message:"类型不能为空"}]}},[t("el-select",{attrs:{placeholder:"请选择菜品类型"},model:{value:e.validateForm.type,callback:function(a){e.$set(e.validateForm,"type",a)},expression:"validateForm.type"}},e._l(e.types,function(e){return t("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))],1),e._v(" "),t("el-form-item",{attrs:{label:"描述",prop:"abstract",rules:[{required:!0,message:"描述不能为空"}]}},[t("el-input",{attrs:{type:"abstract","auto-complete":"off"},model:{value:e.validateForm.abstract,callback:function(a){e.$set(e.validateForm,"abstract",e._n(a))},expression:"validateForm.abstract"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"图片",prop:"imageUrl"}},[t("el-upload",{staticClass:"avatar-uploader",attrs:{action:e.uploadUrl,name:"image","with-credentials":!0,"show-file-list":!1,drag:!0,"on-success":e.handleAvatarSuccess,"before-upload":e.beforeAvatarUpload}},[e.imageUrl?t("img",{staticClass:"avatar",attrs:{src:e.imageUrl}}):t("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1),e._v(" "),t("el-form-item",[t("el-button",{attrs:{type:"primary"},on:{click:function(a){e.submitForm("validateForm")}}},[e._v("提交")])],1)],1)],1)},m=[],u={render:d,staticRenderFns:m},f=u,v=t("VU/8"),b=r,g=v(c,f,!1,b,null,null);a.default=g.exports},pCs3:function(e,a,t){var r=t("/o82");"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);t("rjj0")("07c6d117",r,!0)}}); -------------------------------------------------------------------------------- /server/public/static/js/29.5f6e5b710481755ad4b5.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([29],{Llm3:function(e,t,a){"use strict";function n(e){a("Y4LC")}Object.defineProperty(t,"__esModule",{value:!0});var l=a("CjlA"),s=a("wEuf"),r={components:{searchBox:l.a},created:function(){this.getUserList()},data:function(){return{property:"",pageNum:1,pages:1,keyword:"",options:[{label:"用户id",value:"userId"},{label:"用户名",value:"userName"},{label:"手机号",value:"phone"}],infoData:[]}},methods:{getUserList:function(){var e=this,t=this.pageNum,a=this.keyword,n=this.property;Object(s.q)(t,a,n).then(function(t){e.infoData=t.data.list,e.pages=t.data.pages,e.pageNum=t.data.pageNum})},changePage:function(e){this.pageNum=e,this.getUserList()},search:function(e){this.keyword=e,this.pageNum=1,this.getUserList()}}},o=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"user"},[a("div",{staticClass:"header"},[a("el-select",{attrs:{placeholder:"筛选"},model:{value:e.property,callback:function(t){e.property=t},expression:"property"}},e._l(e.options,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),e._v(" "),a("search-box",{staticClass:"searchBox",on:{search:e.search}})],1),e._v(" "),a("div",{staticClass:"content"},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.infoData}},[a("el-table-column",{attrs:{prop:"userId",label:"用户id",width:"230"}}),e._v(" "),a("el-table-column",{attrs:{prop:"userName",label:"用户名",width:"200"}}),e._v(" "),a("el-table-column",{attrs:{prop:"phone",label:"手机号",width:"180"}}),e._v(" "),a("el-table-column",{attrs:{prop:"introduction",label:"简介",width:"180"}}),e._v(" "),a("el-table-column",{attrs:{prop:"gender",label:"性别",width:"180"}}),e._v(" "),a("el-table-column",{attrs:{prop:"address",label:"地址"}})],1)],1),e._v(" "),a("el-pagination",{attrs:{layout:"prev, pager, next","page-count":e.pages},on:{"current-change":e.changePage}})],1)},i=[],p={render:o,staticRenderFns:i},u=p,c=a("VU/8"),d=n,h=c(r,u,!1,d,null,null);t.default=h.exports},Qblv:function(e,t,a){t=e.exports=a("FZ+f")(!1),t.push([e.i,"\n.user {\n background: #fff;\n height: 100%;\n padding: 20px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n.user .searchBox {\n display: inline-block;\n}\n.user .el-select {\n width: 100px;\n vertical-align: top;\n}\n.user .el-select .el-input input {\n height: 37px;\n}\n.user .content {\n margin: 30px auto;\n}\n",""])},Y4LC:function(e,t,a){var n=a("Qblv");"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);a("rjj0")("38330c28",n,!0)}}); -------------------------------------------------------------------------------- /server/public/static/js/31.b5da52ea567d1c116bb2.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([31],{GzyT:function(n,t,e){var c=e("VDw4");"string"==typeof c&&(c=[[n.i,c,""]]),c.locals&&(n.exports=c.locals);e("rjj0")("146865a6",c,!0)},"R9e/":function(n,t,e){"use strict";function c(n){e("GzyT")}Object.defineProperty(t,"__esModule",{value:!0});var i={methods:{click:function(){this.$router.push("/admin")}}},s=function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("div",{staticClass:"div"},[n._v("页面已经被吃掉了... "),e("span",{staticClass:"click",on:{click:n.click}},[n._v(">>")])])},a=[],r={render:s,staticRenderFns:a},o=r,l=e("VU/8"),u=c,d=l(i,o,!1,u,"data-v-6f3ec9b2",null);t.default=d.exports},VDw4:function(n,t,e){t=n.exports=e("FZ+f")(!1),t.push([n.i,"\n.div[data-v-6f3ec9b2] {\n padding: 20px;\n}\n.click[data-v-6f3ec9b2] {\n cursor: pointer;\n}\n",""])}}); -------------------------------------------------------------------------------- /server/public/static/js/34.bd1c9f49708a42216c8c.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([34],{Ov26:function(e,t,i){t=e.exports=i("FZ+f")(!1),t.push([e.i,"\n.el-header[data-v-0d22cd47] {\n height: 50px !important;\n line-height: 50px;\n background: #404040;\n}\n.el-container[data-v-0d22cd47] {\n height: 100%;\n}\n.el-aside[data-v-0d22cd47] {\n background: #404040;\n width: 230px !important;\n}\n.el-aside .el-menu[data-v-0d22cd47] {\n border-right: none;\n}\n.el-submenu .el-menu-item[data-v-0d22cd47] {\n text-indent: 14px;\n}\n.el-main[data-v-0d22cd47] {\n background: #eee;\n padding: 0;\n}\n.container[data-v-0d22cd47] {\n width: 100%;\n height: 100%;\n}\n",""])},YUTp:function(e,t,i){var a=i("Ov26");"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);i("rjj0")("75639aa6",a,!0)},xGHU:function(e,t,i){"use strict";function a(e){i("YUTp")}Object.defineProperty(t,"__esModule",{value:!0});var n=i("Dd8w"),s=i.n(n),c=i("pN2o"),d=i("NYxO"),o={data:function(){return{defaultActive:"2"}},computed:s()({},Object(d.c)("admin",["adminInfo","reLogin"])),watch:{reLogin:function(e){e&&(this.$router.push("/admin"),this.setReLogin(!1))}},created:function(){switch(this.$router.currentRoute.path.split("/")[2]){case"home":this.defaultActive="1";break;case"user":this.defaultActive="2";break;case"audit":this.defaultActive="3-1";break;case"shops":this.defaultActive="3-2";break;case"classification":this.defaultActive="4";break;case"shopsClassification":this.defaultActive="4-1";break;case"goodsClassification":this.defaultActive="4-2";break;case"statistics":this.defaultActive="5";break;case"administrator":this.defaultActive="6";break;default:this.defaultActive="2"}},methods:s()({},Object(d.d)({setShopType:"admin/SET_SHOPTYPE",setReLogin:"admin/SET_RE_LOGIN"}),{getShopType:function(){var e=this;Object(c.h)().then(function(t){e.setShopType(t.data)})},close:function(){this.loginVisible=!1}})},r=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-container",[i("el-aside",[i("el-menu",{staticClass:"el-menu-vertical-demo",attrs:{"default-active":e.defaultActive,"background-color":"#404040","active-text-color":"#108ee9","text-color":"#fff",router:!0}},[i("el-menu-item",{attrs:{index:"2",route:"user"}},[i("i",{staticClass:"el-icon-menu"}),e._v(" "),i("span",[e._v("用户管理")])]),e._v(" "),i("el-submenu",{attrs:{index:"3"}},[i("template",{slot:"title"},[i("i",{staticClass:"el-icon-setting"}),e._v(" "),i("span",[e._v("商铺管理")])]),e._v(" "),i("el-menu-item",{attrs:{index:"3-1",route:"audit"}},[e._v("商铺审核")]),e._v(" "),i("el-menu-item",{attrs:{index:"3-2",route:"shops"}},[e._v("全部商铺")])],2),e._v(" "),i("el-menu-item",{attrs:{index:"4",route:"classification"}},[i("i",{staticClass:"el-icon-setting"}),e._v(" "),i("span",[e._v("分类管理")])]),e._v(" "),1===e.adminInfo.flagSuper?i("el-menu-item",{attrs:{index:"6",route:"administrator"}},[i("i",{staticClass:"el-icon-setting"}),e._v(" "),i("span",[e._v("管理员")])]):e._e()],1)],1),e._v(" "),i("el-main",[i("router-view")],1)],1)},l=[],u={render:r,staticRenderFns:l},v=u,h=i("VU/8"),f=a,p=h(o,v,!1,f,"data-v-0d22cd47",null);t.default=p.exports}}); -------------------------------------------------------------------------------- /server/public/static/js/9.27d4a35237e7c9e726e4.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([9],{"5rnv":function(n,e,t){var o=t("JvD6");"string"==typeof o&&(o=[[n.i,o,""]]),o.locals&&(n.exports=o.locals);t("rjj0")("45288fc8",o,!0)},"6aNh":function(n,e,t){"use strict";function o(n){t("X1w3")}function r(n){t("5rnv")}Object.defineProperty(e,"__esModule",{value:!0});var s=t("Dd8w"),i=t.n(s),l=t("wEuf"),a=t("NYxO"),u={data:function(){var n=function(n,e,t){if(!e)return t(new Error("账号不能为空"));t()};return{ruleForm:{pass:"",phone:""},rules:{pass:[{validator:function(n,e,t){""===e?t(new Error("请输入密码")):t()}}],phone:[{validator:n}]}}},props:{visible:{type:Boolean,default:!1}},methods:i()({},Object(a.b)("admin",["saveAdminInfo"]),{submitForm:function(n){var e=this;this.$refs[n].validate(function(n){if(!n)return console.log("error submit!!"),!1;var t=e.ruleForm,o=t.pass,r=t.phone;Object(l.r)(r,o).then(function(n){1===n.code?(e.saveAdminInfo(n.data),e.$emit("close"),e.$router.push("/admin/user")):e.$message({showClose:!0,message:"登录失败",type:"error"})})})},close:function(){this.$emit("close")}})},c=function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("el-dialog",{attrs:{visible:n.visible,"before-close":n.close},on:{"update:visible":function(e){n.visible=e}}},[t("p",[n._v("管理员登录")]),n._v(" "),t("el-form",{ref:"ruleForm",staticClass:"ruleForm",attrs:{model:n.ruleForm,"status-icon":"",rules:n.rules,size:"small"}},[t("el-form-item",{attrs:{prop:"phone"}},[t("el-input",{attrs:{placeholder:"账号"},model:{value:n.ruleForm.phone,callback:function(e){n.$set(n.ruleForm,"phone",n._n(e))},expression:"ruleForm.phone"}})],1),n._v(" "),t("el-form-item",{attrs:{prop:"pass"}},[t("el-input",{attrs:{placeholder:"密码",type:"password","auto-complete":"off"},model:{value:n.ruleForm.pass,callback:function(e){n.$set(n.ruleForm,"pass",e)},expression:"ruleForm.pass"}})],1),n._v(" "),t("el-form-item",[t("el-button",{staticClass:"submit",attrs:{type:"primary"},on:{click:function(e){n.submitForm("ruleForm")}}},[n._v("登录")])],1)],1)],1)},p=[],m={render:c,staticRenderFns:p},f=m,d=t("VU/8"),v=o,h=d(u,f,!1,v,null,null),b=h.exports,F=this,g={components:{adminLogin:b},data:function(){return{loginVisible:!0}},computed:i()({},Object(a.c)("admin",["adminInfo"])),beforeRouteEnter:function(n,e,t){F.adminInfo&&F.adminInfo.adminName?(F.loginVisible=!1,F.$router.push("/admin/shops")):t()},methods:{close:function(){}}},x=function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("div",{staticClass:"div"},[n._v("请登录\n "),t("admin-login",{attrs:{visible:n.loginVisible},on:{close:n.close}})],1)},_=[],w={render:x,staticRenderFns:_},$=w,j=t("VU/8"),y=r,E=j(g,$,!1,y,null,null);e.default=E.exports},JvD6:function(n,e,t){e=n.exports=t("FZ+f")(!1),e.push([n.i,"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",""])},Qd6S:function(n,e,t){e=n.exports=t("FZ+f")(!1),e.push([n.i,"\n.el-dialog {\n width: 30%;\n text-align: center;\n}\n.el-dialog p {\n font-size: 20px;\n font-weight: 600;\n text-align: center;\n margin: 0 auto 20px;\n}\n",""])},X1w3:function(n,e,t){var o=t("Qd6S");"string"==typeof o&&(o=[[n.i,o,""]]),o.locals&&(n.exports=o.locals);t("rjj0")("159221b0",o,!0)}}); -------------------------------------------------------------------------------- /server/public/static/js/manifest.b0df8a62a07df746175b.js: -------------------------------------------------------------------------------- 1 | !function(e){function c(a){if(n[a])return n[a].exports;var r=n[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,c),r.l=!0,r.exports}var a=window.webpackJsonp;window.webpackJsonp=function(n,t,f){for(var d,o,b,i=0,u=[];i 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 17 | -------------------------------------------------------------------------------- /src/common/audio/song.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ooooevan/chihuobao/58d8678e96751b649857665b14dbeaf6a5001761/src/common/audio/song.mp3 -------------------------------------------------------------------------------- /src/common/images/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ooooevan/chihuobao/58d8678e96751b649857665b14dbeaf6a5001761/src/common/images/1.jpg -------------------------------------------------------------------------------- /src/common/images/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ooooevan/chihuobao/58d8678e96751b649857665b14dbeaf6a5001761/src/common/images/4.jpg -------------------------------------------------------------------------------- /src/common/javascript/adminApi.js: -------------------------------------------------------------------------------- 1 | import { basePOST1, baseGET, baseGET2 } from './baseApi' 2 | // import config from './config' 3 | import ALLAPI from './apiList' 4 | const API = ALLAPI.admin 5 | 6 | export function _login (adminName, adminPwd) { 7 | return basePOST1(API.login, { adminName, adminPwd }) 8 | } 9 | 10 | export function _addAdmin (adminName, adminPwd) { 11 | return basePOST1(API.addAdmin, { adminName, adminPwd }) 12 | } 13 | 14 | export function _getAdminList () { 15 | return baseGET(API.getAdminList) 16 | } 17 | 18 | export function _delAdmin (adminName) { 19 | return basePOST1(API.delAdmin, { adminName }) 20 | } 21 | 22 | export function _adminConfig (adminName, foodTypeMp, shopMp, shopTypeMp) { 23 | return basePOST1(API.adminConfig, { adminName, foodTypeMp, shopMp, shopTypeMp }) 24 | } 25 | 26 | export function _getShopsList (pageNum, property, keyword) { 27 | return baseGET(API.getShopsList, { pageNum, property, keyword }) 28 | } 29 | 30 | export function _getShopInfoById (shopId) { 31 | return baseGET2(API.getShopInfoById, shopId) 32 | } 33 | 34 | export function _freeze (shopId, type) { 35 | return basePOST1(API.freeze, { shopId, type }) 36 | } 37 | 38 | export function _getApplyList (pageNum) { 39 | return baseGET(API.getApplyList, { pageNum }) 40 | } 41 | 42 | export function _getApplyInfoById (shopApplyId) { 43 | return baseGET2(API.getApplyInfoById, shopApplyId) 44 | } 45 | 46 | export function _auditApply (shopApplyId, result) { 47 | return basePOST1(API.auditApply, {shopApplyId, result}) 48 | } 49 | 50 | export function _getShopTypeList () { 51 | return baseGET(API.getShopTypeList) 52 | } 53 | 54 | export function _getFoodTypeList () { 55 | return baseGET(API.getFoodTypeList) 56 | } 57 | 58 | export function _delShopTags (shopTypeId) { 59 | return basePOST1(API.delShopType, { shopTypeId }) 60 | } 61 | 62 | export function _delFoodTags (foodTypeId) { 63 | return basePOST1(API.delFoodType, { foodTypeId }) 64 | } 65 | 66 | export function _addShopType (typeDes) { 67 | return basePOST1(API.addShopType, { typeDes }) 68 | } 69 | 70 | export function _addFoodType (typeDes) { 71 | return basePOST1(API.addFoodType, { typeDes }) 72 | } 73 | 74 | export function _getUserList (pageNum, keyword, property) { 75 | return baseGET(API.getUserList, { pageNum, keyword, property }) 76 | } 77 | -------------------------------------------------------------------------------- /src/common/javascript/apiList.js: -------------------------------------------------------------------------------- 1 | const domain = `http://localhost:3333` 2 | // const domain = `http://localhost:8080` 3 | const baseUrl = `${domain}/api` 4 | export default { 5 | user: { 6 | elemeSuggestions: `${baseUrl}/elemeSuggestions`, 7 | login: `${baseUrl}/login`, 8 | sendCode: `${baseUrl}/code`, 9 | register: `${baseUrl}/regist`, 10 | reset: `${baseUrl}/reset`, 11 | logOut: `${baseUrl}/info/logout`, 12 | initInfo: `${baseUrl}/info/check`, 13 | modifyInfo: `${baseUrl}/info/modify`, 14 | getShopList: `${baseUrl}/shop/findByRange`, 15 | getInfoByShopId: `${baseUrl}/shop/findById`, 16 | getCommentByDishId: `${baseUrl}/shop/dish`, 17 | applyShop: `${baseUrl}/info/apply`, 18 | deleteOrder: `${baseUrl}/order/delete`, 19 | cancelOrder: `${baseUrl}/order/cancel`, 20 | getShopPhone: `${baseUrl}/order/getPhone`, 21 | getUserOrder: `${baseUrl}/order/find`, 22 | finishOrder: `${baseUrl}/order/finish`, 23 | rateOrder: `${baseUrl}/comment/user`, 24 | upload: `${baseUrl}/upload`, 25 | getShopType: `${baseUrl}/types`, 26 | newOrder: `${baseUrl}/order/new`, 27 | payOrder: `${baseUrl}/order/pay`, 28 | handleIsPay: `${baseUrl}/order/handleIsPay`, 29 | getApplyStatus: `${baseUrl}/info/want2OpenShop` 30 | }, 31 | seller: { 32 | initInfo: `${baseUrl}/shop/shopMsg`, 33 | getSellerOrder: `${baseUrl}/shopOrder`, 34 | handleOrder: `${baseUrl}/shopOrder/handle`, 35 | getAllDish: `${baseUrl}/shop/getAllDish`, 36 | modifyDish: `${baseUrl}/shop/modifDish`, 37 | deleteDish: `${baseUrl}/shop/delDish`, 38 | addDish: `${baseUrl}/shop/addDish`, 39 | modifyShopInfo: `${baseUrl}/shop/updateShop`, 40 | getRateList: `${baseUrl}/comment/dish`, 41 | isNewOrder: `${baseUrl}/shopOrder/getNewOrder`, 42 | upload: `${baseUrl}/image/shop`, 43 | getFoodType: `${baseUrl}/foodType/management/all` 44 | }, 45 | admin: { 46 | login: `${baseUrl}/admin/login`, 47 | addAdmin: `${baseUrl}/admin/addition`, 48 | getAdminList: `${baseUrl}/admin/all`, 49 | delAdmin: `${baseUrl}/admin/deletion`, 50 | adminConfig: `${baseUrl}/admin/configuration`, 51 | getShopsList: `${baseUrl}/shop/management/all`, 52 | getShopInfoById: `${baseUrl}/shop/management`, 53 | freeze: `${baseUrl}/shop/management/freeze`, 54 | getApplyList: `${baseUrl}/shopApply/management/all`, 55 | getApplyInfoById: `${baseUrl}/shopApply/management`, 56 | auditApply: `${baseUrl}/shopApply/management/examination`, 57 | getShopTypeList: `${baseUrl}/shopType/management/all`, 58 | getFoodTypeList: `${baseUrl}/foodType/management/all`, 59 | delShopType: `${baseUrl}/shopType/management/deletion`, 60 | delFoodType: `${baseUrl}/foodType/management/deletion`, 61 | addShopType: `${baseUrl}/shopType/management/addition`, 62 | addFoodType: `${baseUrl}/foodType/management/addition`, 63 | getUserList: `${baseUrl}/user/management/all` 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/common/javascript/baseApi.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import _jsonp from 'jsonp' 3 | import config from './config' 4 | import store from '../../store' 5 | axios.defaults.withCredentials = true 6 | 7 | export function jsonp (url) { 8 | return new Promise((resolve, reject) => { 9 | _jsonp(url, (err, res) => { 10 | if (!err) { 11 | resolve(res) 12 | } else { 13 | reject(err) 14 | } 15 | }) 16 | }) 17 | } 18 | 19 | export function baseGET (api, params) { 20 | return axios({ 21 | method: 'get', 22 | url: api, 23 | params: { 24 | ...params 25 | } 26 | }).then(res => res.data) 27 | } 28 | 29 | export function baseGET2 (api, param) { 30 | return axios({ 31 | method: 'get', 32 | url: `${api}/${param}` 33 | }).then(res => res.data) 34 | } 35 | 36 | export function basePOST (api, params) { 37 | return axios({ 38 | method: 'post', 39 | url: api, 40 | headers: { 41 | 'content-Type': 'application/x-www-form-urlencoded' 42 | }, 43 | data: config.toFormData({ 44 | ...params 45 | }) 46 | }).then(res => { 47 | return res.data 48 | }).catch(() => { 49 | store.dispatch('user/reLogin') 50 | }) 51 | } 52 | export function basePOST1 (api, params) { 53 | return axios({ 54 | method: 'post', 55 | url: api, 56 | headers: { 57 | 'content-Type': 'application/x-www-form-urlencoded' 58 | }, 59 | data: config.toFormData({ 60 | ...params 61 | }) 62 | }).then(res => { 63 | return res.data 64 | }).catch(() => { 65 | store.dispatch('admin/reLogin') 66 | }) 67 | } 68 | -------------------------------------------------------------------------------- /src/common/javascript/cache.js: -------------------------------------------------------------------------------- 1 | import storage from 'good-storage' 2 | 3 | const addressKey = '__exactAddress__' 4 | const userKey = '__user__' 5 | const sellerKey = '__seller__' 6 | const cartKey = '__cartList__' 7 | const shopTypeKey = '__shopType__' 8 | const adminKey = '__admin__' 9 | 10 | // 定位信息 11 | export function _saveExactAddress (item) { 12 | storage.set(addressKey, item) 13 | return item 14 | } 15 | export function _clearExactAddress () { 16 | storage.remove(addressKey) 17 | return null 18 | } 19 | export function _hashExactAddress () { 20 | return storage.has(addressKey) 21 | } 22 | export function _getExactAddress () { 23 | return storage.get(addressKey) 24 | } 25 | // 用户信息 26 | export function _saveUserInfo (info) { 27 | storage.set(userKey, info) 28 | return info 29 | } 30 | export function _clearUserInfo () { 31 | storage.remove(userKey) 32 | return null 33 | } 34 | export function _hasUserInfo () { 35 | return storage.has(userKey) 36 | } 37 | export function _getUserInfo () { 38 | return storage.get(userKey) 39 | } 40 | 41 | // 商家信息 42 | export function _saveSellerInfo (info) { 43 | storage.session.set(sellerKey, info) 44 | return info 45 | } 46 | export function _clearSellerInfo () { 47 | storage.session.remove(sellerKey) 48 | return null 49 | } 50 | export function _hasSellerInfo () { 51 | return storage.session.has(sellerKey) 52 | } 53 | export function _getSellerInfo () { 54 | return storage.session.get(sellerKey) 55 | } 56 | 57 | // 购物车信息 58 | export function _clearCartList () { 59 | storage.session.remove(cartKey) 60 | return [] 61 | } 62 | export function _hashCartList () { 63 | return storage.session.has(cartKey) 64 | } 65 | export function _getCartList () { 66 | return storage.session.get(cartKey) || [] 67 | } 68 | export function _addCartNum (item) { 69 | let list = _getCartList() 70 | if (list[0] && list[0].shopId !== item.shopId) { 71 | // 不是一个商家,清空上一家的购物车 72 | list = _clearCartList() 73 | } 74 | 75 | let temp = list.find(ite => (ite.dishId === item.dishId)) 76 | if (item.dishName === '配送费' && temp) { 77 | // 同一家多次点击支付,防止生成多个配送费。 78 | temp.num = 1 79 | } else if (temp) { 80 | temp.num++ 81 | } else { 82 | item.num = 1 83 | list.push(item) 84 | } 85 | storage.session.set(cartKey, list) 86 | return list 87 | } 88 | export function _subCartNum (item) { 89 | let list = _getCartList() 90 | let temp = list.find(ite => (ite.dishId === item.dishId)) 91 | if (temp.num === 1) { 92 | let index = list.findIndex(ite => (ite === temp)) 93 | list.splice(index, 1) 94 | } else { 95 | temp.num-- 96 | } 97 | storage.session.set(cartKey, list) 98 | return list 99 | } 100 | export function _getShopTypeList () { 101 | return storage.get(shopTypeKey) 102 | } 103 | export function _setShopTypeList (list) { 104 | storage.set(shopTypeKey, list) 105 | return list 106 | } 107 | 108 | // 管理员 109 | export function _saveAdminInfo (info) { 110 | storage.session.set(adminKey, info) 111 | return info 112 | } 113 | export function _clearAdminInfo () { 114 | storage.session.remove(adminKey) 115 | return {} 116 | } 117 | export function _hasAdminInfo () { 118 | return storage.session.has(adminKey) 119 | } 120 | export function _getAdminInfo () { 121 | return storage.session.get(adminKey) || {} 122 | } 123 | -------------------------------------------------------------------------------- /src/common/javascript/geohash.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | 3 | // https://github.com/davetroy/geohash-js 4 | let BITS = [16, 8, 4, 2, 1]; 5 | 6 | let BASE32 = "0123456789bcdefghjkmnpqrstuvwxyz"; 7 | let NEIGHBORS = { right : { even : "bc01fg45238967deuvhjyznpkmstqrwx" }, 8 | left : { even : "238967debc01fg45kmstqrwxuvhjyznp" }, 9 | top : { even : "p0r21436x8zb9dcf5h7kjnmqesgutwvy" }, 10 | bottom : { even : "14365h7k9dcfesgujnmqp0r2twvyx8zb" } }; 11 | let BORDERS = { right : { even : "bcfguvyz" }, 12 | left : { even : "0145hjnp" }, 13 | top : { even : "prxz" }, 14 | bottom : { even : "028b" } }; 15 | 16 | NEIGHBORS.bottom.odd = NEIGHBORS.left.even; 17 | NEIGHBORS.top.odd = NEIGHBORS.right.even; 18 | NEIGHBORS.left.odd = NEIGHBORS.bottom.even; 19 | NEIGHBORS.right.odd = NEIGHBORS.top.even; 20 | 21 | BORDERS.bottom.odd = BORDERS.left.even; 22 | BORDERS.top.odd = BORDERS.right.even; 23 | BORDERS.left.odd = BORDERS.bottom.even; 24 | BORDERS.right.odd = BORDERS.top.even; 25 | 26 | export function refine_interval(interval, cd, mask) { 27 | if (cd&mask) 28 | interval[0] = (interval[0] + interval[1])/2; 29 | else 30 | interval[1] = (interval[0] + interval[1])/2; 31 | } 32 | 33 | export function calculateAdjacent(srcHash, dir) { 34 | srcHash = srcHash.toLowerCase(); 35 | var lastChr = srcHash.charAt(srcHash.length-1); 36 | var type = (srcHash.length % 2) ? 'odd' : 'even'; 37 | var base = srcHash.substring(0,srcHash.length-1); 38 | if (BORDERS[dir][type].indexOf(lastChr)!=-1) 39 | base = calculateAdjacent(base, dir); 40 | return base + BASE32[NEIGHBORS[dir][type].indexOf(lastChr)]; 41 | } 42 | 43 | export function decodeGeoHash(geohash) { 44 | var is_even = 1; 45 | var lat = []; var lon = []; 46 | lat[0] = -90.0; lat[1] = 90.0; 47 | lon[0] = -180.0; lon[1] = 180.0; 48 | lat_err = 90.0; lon_err = 180.0; 49 | 50 | for (i=0; i mid) { 87 | ch |= BITS[bit]; 88 | lon[0] = mid; 89 | } else 90 | lon[1] = mid; 91 | } else { 92 | mid = (lat[0] + lat[1]) / 2; 93 | if (latitude > mid) { 94 | ch |= BITS[bit]; 95 | lat[0] = mid; 96 | } else 97 | lat[1] = mid; 98 | } 99 | 100 | is_even = !is_even; 101 | if (bit < 4) 102 | bit++; 103 | else { 104 | geohash += BASE32[ch]; 105 | bit = 0; 106 | ch = 0; 107 | } 108 | } 109 | return geohash; 110 | } -------------------------------------------------------------------------------- /src/common/javascript/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

点击这个按钮,获得您的坐标:

5 | 6 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/common/javascript/sellerApi.js: -------------------------------------------------------------------------------- 1 | import { baseGET, basePOST } from './baseApi' 2 | // import config from './config' 3 | import ALLAPI from './apiList' 4 | const API = ALLAPI.seller 5 | 6 | export function _getSellerOrder (shopId, pageNum, type) { 7 | return baseGET(API.getSellerOrder, { shopId, pageNum, type }) 8 | } 9 | 10 | export function _handleOrder (shopId, shopOrderId, type) { 11 | return basePOST(API.handleOrder, { shopId, shopOrderId, type }) 12 | } 13 | 14 | export function _initInfo (shopId) { 15 | return baseGET(API.initInfo, { shopId }) 16 | } 17 | 18 | export function _getAllDish (shopId) { 19 | return baseGET(API.getAllDish, { shopId }) 20 | } 21 | 22 | export function _modifyDish (shopId, dishId, dishPrice, dishAbstract, dishType) { 23 | return basePOST(API.modifyDish, { shopId, dishId, dishPrice, dishAbstract, dishType }) 24 | } 25 | 26 | export function _deleteDish (shopId, dishId) { 27 | return basePOST(API.deleteDish, { shopId, dishId }) 28 | } 29 | 30 | export function _addDish (shopId, dishName, dishPrice, dishType, dishAbstract, dishImage) { 31 | return basePOST(API.addDish, { shopId, dishName, dishPrice, dishType, dishAbstract, dishImage }) 32 | } 33 | // 修改商铺信息,字段较多 34 | export function _modifyShopInfo (info) { 35 | const { shopId, shopName, shopLogo, shopAbstract, shopLocation, shopAnnouncement, shopPhone, shopWorkTime, shopDeliveryCost, shopStartDelivery } = info 36 | return basePOST(API.modifyShopInfo, { shopId, shopName, shopLogo, shopAbstract, shopLocation, shopAnnouncement, shopPhone, shopWorkTime, shopDeliveryCost, shopStartDelivery }) 37 | } 38 | 39 | export function _getRateList (shopId, pageNum) { 40 | return baseGET(API.getRateList, { shopId, pageNum }) 41 | } 42 | 43 | export function _isNewOrder (shopId) { 44 | return baseGET(API.isNewOrder, { shopId }) 45 | } 46 | 47 | export function _getFoodType (shopId) { 48 | return baseGET(API.getFoodType, { shopId }) 49 | } 50 | -------------------------------------------------------------------------------- /src/common/style/base.sass: -------------------------------------------------------------------------------- 1 | @import "variable.sass" 2 | 3 | body, html 4 | height: 100% 5 | line-height: 1 6 | font-family: 'PingFang SC', 'STHeitiSC-Light', 'Helvetica-Light', arial, sans-serif, 'Droid Sans Fallback' 7 | -webkit-tap-highlight-color: transparent 8 | background: $color-background 9 | color: $color-text 10 | .fl 11 | float: left 12 | .clearfix 13 | &:after 14 | content: "" 15 | display: block 16 | height: 0 17 | clear: both 18 | height: 0 19 | font-size: 0 20 | .fr 21 | float: right 22 | a 23 | text-decoration: none 24 | .container 25 | width: 80% 26 | margin: 0 auto 27 | .padding15 28 | padding: 15px 29 | -------------------------------------------------------------------------------- /src/common/style/index.sass: -------------------------------------------------------------------------------- 1 | @import './base.sass' 2 | @import './variable.sass' 3 | @import './reset.sass' -------------------------------------------------------------------------------- /src/common/style/reset.sass: -------------------------------------------------------------------------------- 1 | html, body, div, span, applet, object, iframe, 2 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 3 | a, abbr, acronym, address, big, cite, code, 4 | del, dfn, em, img, ins, kbd, q, s, samp, 5 | small, strike, strong, sub, sup, tt, var, 6 | b, u, i, center, 7 | dl, dt, dd, ol, ul, li, 8 | fieldset, form, label, legend, 9 | table, caption, tbody, tfoot, thead, tr, th, td, 10 | article, aside, canvas, details, embed, 11 | figure, figcaption, footer, header, 12 | menu, nav, output, ruby, section, summary, 13 | time, mark, audio, video, input 14 | margin: 0 15 | padding: 0 16 | border: 0 17 | font-size: 100% 18 | font-weight: normal 19 | vertical-align: baseline 20 | 21 | /* HTML5 display-role reset for older browsers */ 22 | article, aside, details, figcaption, figure, 23 | footer, header, menu, nav, section 24 | display: block 25 | 26 | body 27 | line-height: 1 28 | 29 | blockquote, q 30 | quotes: none 31 | 32 | blockquote:before, blockquote:after, 33 | q:before, q:after 34 | content: none 35 | 36 | table 37 | border-collapse: collapse 38 | border-spacing: 0 39 | 40 | /* custom */ 41 | 42 | a 43 | color: #7e8c8d 44 | -webkit-backface-visibility: hidden 45 | text-decoration: none 46 | 47 | li 48 | list-style: none 49 | 50 | body 51 | -webkit-text-size-adjust: none 52 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0) 53 | -------------------------------------------------------------------------------- /src/common/style/variable.sass: -------------------------------------------------------------------------------- 1 | // 颜色定义规范 2 | $color-background : #f7f7f7 3 | $color-background-d : rgba(0, 0, 0, 0.3) 4 | $color-highlight-background : #333 5 | $color-dialog-background : #666 6 | $color-theme : #ffcd32 7 | $color-theme-d : rgba(255, 205, 49, 0.5) 8 | $color-sub-theme : #d93f30 9 | $color-text : #5a5a5a 10 | // $color-text-d : rgba(255, 255, 255, 0.3) 11 | // $color-text-l : rgba(255, 255, 255, 0.5) 12 | // $color-text-ll : rgba(255, 255, 255, 0.8) 13 | 14 | //字体定义规范 15 | $font-size-small-s : 10px 16 | $font-size-small : 12px 17 | $font-size-medium : 14px 18 | $font-size-medium-x : 16px 19 | $font-size-large : 18px 20 | $font-size-large-x : 22px -------------------------------------------------------------------------------- /src/components/adminAudiDetailCard.vue: -------------------------------------------------------------------------------- 1 | 40 | 66 | 78 | -------------------------------------------------------------------------------- /src/components/foodCard.vue: -------------------------------------------------------------------------------- 1 | 23 | 63 | 117 | -------------------------------------------------------------------------------- /src/components/foodDetailCard.vue: -------------------------------------------------------------------------------- 1 | 17 | 55 | 88 | -------------------------------------------------------------------------------- /src/components/rateCardItem.vue: -------------------------------------------------------------------------------- 1 | 11 | 37 | 53 | -------------------------------------------------------------------------------- /src/components/searchBox.vue: -------------------------------------------------------------------------------- 1 | 6 | 22 | 40 | -------------------------------------------------------------------------------- /src/components/sellerFilter.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 35 | 59 | -------------------------------------------------------------------------------- /src/components/sellerFoodCard.vue: -------------------------------------------------------------------------------- 1 | 17 | 37 | 47 | -------------------------------------------------------------------------------- /src/components/shopCard.vue: -------------------------------------------------------------------------------- 1 | 18 | 38 | 70 | -------------------------------------------------------------------------------- /src/components/shopCartItem.vue: -------------------------------------------------------------------------------- 1 | 8 | 32 | 33 | 49 | -------------------------------------------------------------------------------- /src/components/shopRate.vue: -------------------------------------------------------------------------------- 1 | 25 | 35 | 53 | -------------------------------------------------------------------------------- /src/components/simpleRate.vue: -------------------------------------------------------------------------------- 1 | 25 | 52 | 66 | -------------------------------------------------------------------------------- /src/components/userFooter.vue: -------------------------------------------------------------------------------- 1 | 8 | 11 | 22 | -------------------------------------------------------------------------------- /src/components/userHeader.vue: -------------------------------------------------------------------------------- 1 | 28 | 61 | 121 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import 'babel-polyfill' 2 | import Vue from 'vue' 3 | import ElementUI from 'element-ui' 4 | import 'element-ui/lib/theme-chalk/index.css' 5 | import App from './App' 6 | import router from './router' 7 | import store from './store' 8 | import moment from 'moment' 9 | Vue.use(ElementUI) 10 | Vue.config.productionTip = false 11 | Object.defineProperty(Vue.prototype, '$moment', {value: moment}) 12 | 13 | /* eslint-disable */ 14 | // _ooOoo_ 15 | // o8888888o 16 | // 88" . "88 17 | // (| -_- |) 18 | // O\ = /O 19 | // ____/`---'\____ 20 | // . ' \\| |// `. 21 | // / \\||| : |||// \ 22 | // / _||||| -:- |||||- \ 23 | // | | \\\ - /// | | 24 | // | \_| ''\---/'' | | 25 | // \ .-\__ `-` ___/-. / 26 | // ___`. .' /--.--\ `. . __ 27 | // ."" '< `.___\_<|>_/___.' >'"". 28 | // | | : `- \`.;`\ _ /`;.`/ - ` : | | 29 | // \ \ `-. \_ __\ /__ _/ .-` / / 30 | // ======`-.____`-.___\_____/___.-`____.-'====== 31 | // `=---=' 32 | // 33 | 34 | // ............................................. 35 | /* eslint-disable no-new */ 36 | new Vue({ 37 | el: '#app', 38 | router, 39 | store, 40 | render: h => h(App) 41 | }) 42 | -------------------------------------------------------------------------------- /src/pages/admin/adminLogin.vue: -------------------------------------------------------------------------------- 1 | 17 | 92 | 102 | -------------------------------------------------------------------------------- /src/pages/admin/home.vue: -------------------------------------------------------------------------------- 1 | 6 | 40 | 43 | -------------------------------------------------------------------------------- /src/pages/admin/pageNoFind.vue: -------------------------------------------------------------------------------- 1 | 4 | 13 | 19 | -------------------------------------------------------------------------------- /src/pages/admin/statistics.vue: -------------------------------------------------------------------------------- 1 | 4 | 7 | 10 | -------------------------------------------------------------------------------- /src/pages/admin/user.vue: -------------------------------------------------------------------------------- 1 | 56 | 110 | 126 | -------------------------------------------------------------------------------- /src/pages/index.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 94 | 95 | 103 | -------------------------------------------------------------------------------- /src/pages/seller/home.vue: -------------------------------------------------------------------------------- 1 | 4 | 7 | 10 | -------------------------------------------------------------------------------- /src/pages/seller/menu.vue: -------------------------------------------------------------------------------- 1 | 19 | 117 | 130 | -------------------------------------------------------------------------------- /src/pages/seller/pageNoFind.vue: -------------------------------------------------------------------------------- 1 | 4 | 13 | 19 | -------------------------------------------------------------------------------- /src/pages/seller/rate.vue: -------------------------------------------------------------------------------- 1 | 31 | 76 | 102 | -------------------------------------------------------------------------------- /src/pages/seller/revenue.vue: -------------------------------------------------------------------------------- 1 | 4 | 7 | 10 | -------------------------------------------------------------------------------- /src/pages/seller/sellerFoodDetailCard.vue: -------------------------------------------------------------------------------- 1 | 17 | 86 | 114 | -------------------------------------------------------------------------------- /src/pages/seller/statistics.vue: -------------------------------------------------------------------------------- 1 | 4 | 7 | 10 | -------------------------------------------------------------------------------- /src/pages/user/join.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 15 | -------------------------------------------------------------------------------- /src/pages/user/pageNoFind.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 73 | 74 | 85 | -------------------------------------------------------------------------------- /src/pages/user/rateCard.vue: -------------------------------------------------------------------------------- 1 | 10 | 64 | 75 | -------------------------------------------------------------------------------- /src/pages/user/shopCart.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 75 | 76 | 114 | -------------------------------------------------------------------------------- /src/pages/user/shopCartError.vue: -------------------------------------------------------------------------------- 1 | 4 | 31 | 32 | 41 | -------------------------------------------------------------------------------- /src/pages/user/shopCartPaying.vue: -------------------------------------------------------------------------------- 1 | 4 | 28 | 29 | 35 | -------------------------------------------------------------------------------- /src/pages/user/shopCartSuccess.vue: -------------------------------------------------------------------------------- 1 | 4 | 39 | 40 | 46 | -------------------------------------------------------------------------------- /src/store/admin/actions.js: -------------------------------------------------------------------------------- 1 | import * as types from './mutations-type' 2 | // import { getSuggestionApi, _logOutApi } from 'common/javascript/userApi' 3 | import { _saveAdminInfo, _clearAdminInfo } from 'common/javascript/cache' 4 | // import { _clearUserInfo } from '../../common/javascript/cache' 5 | 6 | export function saveAdminInfo ({commit, state}, info) { 7 | commit(types.SET_ADMIN_INFO, _saveAdminInfo(info)) 8 | } 9 | 10 | export function clearSAdminInfo ({commit, state}, info) { 11 | commit(types.SET_ADMIN_INFO, _clearAdminInfo(info)) 12 | } 13 | export function reLogin ({commit, state}) { 14 | _clearAdminInfo() 15 | commit(types.SET_RE_LOGIN, true) 16 | } 17 | -------------------------------------------------------------------------------- /src/store/admin/getters.js: -------------------------------------------------------------------------------- 1 | export const adminInfo = state => state.adminInfo 2 | 3 | export const shopTypeList = state => state.shopTypeList 4 | 5 | export const reLogin = state => state.reLogin 6 | -------------------------------------------------------------------------------- /src/store/admin/index.js: -------------------------------------------------------------------------------- 1 | import * as actions from './actions' 2 | import * as getters from './getters' 3 | import mutations from './mutations' 4 | import state from './state' 5 | 6 | const module = { 7 | namespaced: true, 8 | actions, 9 | getters, 10 | state, 11 | mutations 12 | } 13 | 14 | export default module 15 | -------------------------------------------------------------------------------- /src/store/admin/mutations-type.js: -------------------------------------------------------------------------------- 1 | export const SET_ADMIN_INFO = 'SET_ADMIN_INFO' 2 | 3 | export const SET_SHOPTYPE = 'SET_SHOPTYPE' 4 | 5 | export const SET_RE_LOGIN = 'SET_RE_LOGIN' 6 | -------------------------------------------------------------------------------- /src/store/admin/mutations.js: -------------------------------------------------------------------------------- 1 | import * as types from './mutations-type' 2 | 3 | const mutations = { 4 | [types.SET_ADMIN_INFO] (state, info) { 5 | state.adminInfo = info || {} 6 | }, 7 | [types.SET_SHOPTYPE] (state, list) { 8 | state.shopTypeList = list 9 | }, 10 | [types.SET_RE_LOGIN] (state, bool) { 11 | state.reLogin = bool 12 | } 13 | } 14 | 15 | export default mutations 16 | -------------------------------------------------------------------------------- /src/store/admin/state.js: -------------------------------------------------------------------------------- 1 | // import config from 'common/javascript/config' 2 | import { _getAdminInfo, _getShopTypeList } from 'common/javascript/cache' 3 | 4 | const state = { 5 | adminInfo: _getAdminInfo() || {}, // 管理员信息 6 | shopTypeList: _getShopTypeList() || [], // 商家类型数据 7 | reLogin: false // 401时重新登录 8 | } 9 | 10 | export default state 11 | -------------------------------------------------------------------------------- /src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | import user from './user' 4 | import seller from './seller' 5 | import admin from './admin' 6 | // import createLogger from 'vuex/dist/logger' 7 | 8 | Vue.use(Vuex) 9 | // const debug = process.env_NODE_ENV !== 'production' 10 | 11 | export default new Vuex.Store({ 12 | modules: { 13 | user, 14 | seller, 15 | admin 16 | } 17 | // strict: debug, 18 | // plugins: debug ? [createLogger()] : [] 19 | }) 20 | -------------------------------------------------------------------------------- /src/store/seller/actions.js: -------------------------------------------------------------------------------- 1 | import * as types from './mutations-type' 2 | // import { getSuggestionApi, _logOutApi } from 'common/javascript/userApi' 3 | import { _saveSellerInfo, _clearSellerInfo } from 'common/javascript/cache' 4 | // import { _clearUserInfo } from '../../common/javascript/cache' 5 | 6 | export function saveSellerInfo ({commit, state}, info) { 7 | commit(types.SET_SELLER_INFO, _saveSellerInfo(info)) 8 | } 9 | 10 | export function clearSellerInfo ({commit, state}, info) { 11 | commit(types.SET_SELLER_INFO, _clearSellerInfo(info)) 12 | } 13 | -------------------------------------------------------------------------------- /src/store/seller/getters.js: -------------------------------------------------------------------------------- 1 | export const newOrderNum = state => state.newOrderNum 2 | 3 | export const sellerInfo = state => state.sellerInfo 4 | 5 | export const shopTypeList = state => state.shopTypeList 6 | 7 | export const foodTypeList = state => state.foodTypeList 8 | -------------------------------------------------------------------------------- /src/store/seller/index.js: -------------------------------------------------------------------------------- 1 | import * as actions from './actions' 2 | import * as getters from './getters' 3 | import mutations from './mutations' 4 | import state from './state' 5 | 6 | const module = { 7 | namespaced: true, 8 | actions, 9 | getters, 10 | state, 11 | mutations 12 | } 13 | 14 | export default module 15 | -------------------------------------------------------------------------------- /src/store/seller/mutations-type.js: -------------------------------------------------------------------------------- 1 | export const SET_NEW_ORDER_NUM = 'SET_NEW_ORDER_NUM' 2 | 3 | export const CLEAR_NEW_ORDER_NUM = 'CLEAR_NEW_ORDER_NUM' 4 | 5 | export const SET_SELLER_INFO = 'SET_SELLER_INFO' 6 | 7 | export const SET_SHOPTYPE = 'SET_SHOPTYPE' 8 | 9 | export const SET_FOODTYPE = 'SET_FOODTYPE' 10 | -------------------------------------------------------------------------------- /src/store/seller/mutations.js: -------------------------------------------------------------------------------- 1 | import * as types from './mutations-type' 2 | 3 | const mutations = { 4 | [types.SET_NEW_ORDER_NUM] (state, num) { 5 | state.newOrderNum = num 6 | }, 7 | [types.CLEAR_NEW_ORDER_NUM] (state) { 8 | state.newOrderNum = 0 9 | }, 10 | [types.SET_SELLER_INFO] (state, info) { 11 | state.sellerInfo = info || {} 12 | }, 13 | [types.SET_SHOPTYPE] (state, list) { 14 | state.shopTypeList = list 15 | }, 16 | [types.SET_FOODTYPE] (state, list) { 17 | state.foodTypeList = list 18 | } 19 | } 20 | 21 | export default mutations 22 | -------------------------------------------------------------------------------- /src/store/seller/state.js: -------------------------------------------------------------------------------- 1 | // import config from 'common/javascript/config' 2 | import { _getSellerInfo, _getShopTypeList } from 'common/javascript/cache' 3 | 4 | const state = { 5 | newOrderNum: 0, // 新订单数 6 | sellerInfo: _getSellerInfo() || {}, // 商家基本信息 7 | shopTypeList: _getShopTypeList(), // 商家类型数据 8 | foodTypeList: [] // 商品类型数据 9 | } 10 | 11 | export default state 12 | -------------------------------------------------------------------------------- /src/store/user/actions.js: -------------------------------------------------------------------------------- 1 | import * as types from './mutations-type' 2 | import { getSuggestionApi, _logOutApi } from 'common/javascript/userApi' 3 | import { _clearUserInfo, _saveExactAddress, _clearExactAddress, _saveUserInfo, _clearCartList, _addCartNum, _subCartNum, _setShopTypeList } from 'common/javascript/cache' 4 | 5 | export function getSuggestion ({commit, state}, str) { 6 | const address = state.inexactAddress[1] // 选择城市 7 | getSuggestionApi({address, str}).then(result => { 8 | commit(types.SET_SUGGESTIONS_LIST, result) 9 | }) 10 | } 11 | 12 | export function saveExactAddress ({commit, state}, item) { 13 | commit(types.SAVE_EXACT_ADDRESS, _saveExactAddress(item)) 14 | } 15 | 16 | export function clearExactAddress ({commit, state}) { 17 | commit(types.SAVE_EXACT_ADDRESS, _clearExactAddress()) 18 | } 19 | 20 | export function saveUserInfo ({commit, state}, info) { 21 | commit(types.SET_USER_INFO, _saveUserInfo(info)) 22 | } 23 | 24 | export function reLogin ({commit, state}) { 25 | _clearUserInfo() 26 | commit(types.SET_RE_LOGIN, true) 27 | } 28 | 29 | export function logOut ({commit, state}, userId) { 30 | _logOutApi(userId) 31 | commit(types.SET_USER_INFO, _clearUserInfo()) 32 | } 33 | 34 | export function clearCartList ({commit, state}) { 35 | commit(types.CLEAR_CART_LIST, _clearCartList()) 36 | } 37 | 38 | export function addCartNum ({commit, state}, item) { 39 | commit(types.SET_CART_LIST, _addCartNum(item)) 40 | } 41 | 42 | export function subCartNum ({commit, state}, item) { 43 | commit(types.SET_CART_LIST, _subCartNum(item)) 44 | } 45 | 46 | export function setShopType ({commit, state}, list) { 47 | commit(types.SET_SHOPTYPE, _setShopTypeList(list)) 48 | } 49 | -------------------------------------------------------------------------------- /src/store/user/getters.js: -------------------------------------------------------------------------------- 1 | export const cityOptions = state => state.cityOptions 2 | 3 | export const suggestionsList = state => state.suggestionsList 4 | 5 | export const inexactAddress = state => state.inexactAddress 6 | 7 | export const exactAddress = state => state.exactAddress 8 | 9 | export const userInfo = state => state.userInfo 10 | 11 | export const noteKaidian = state => state.noteKaidian 12 | 13 | export const shopList = state => state.shopList 14 | 15 | export const shopDishs = state => state.shopDishs 16 | 17 | export const shopDetail = state => state.shopDetail 18 | 19 | export const cartList = state => state.cartList 20 | 21 | export const shopTypeList = state => state.shopTypeList 22 | 23 | export const reLogin = state => state.reLogin 24 | -------------------------------------------------------------------------------- /src/store/user/index.js: -------------------------------------------------------------------------------- 1 | import * as actions from './actions' 2 | import * as getters from './getters' 3 | import mutations from './mutations' 4 | import state from './state' 5 | 6 | const module = { 7 | namespaced: true, 8 | actions, 9 | getters, 10 | state, 11 | mutations 12 | } 13 | 14 | export default module 15 | -------------------------------------------------------------------------------- /src/store/user/mutations-type.js: -------------------------------------------------------------------------------- 1 | 2 | export const SET_SUGGESTIONS_LIST = 'SET_SUGGESTIONS_LIST' 3 | 4 | export const SET_COORDINATE = 'SET_COORDINATE' 5 | 6 | export const SAVE_EXACT_ADDRESS = 'SAVE_EXACT_ADDRESS' 7 | 8 | export const CLEAR_SUGGESTIONS_LIST = 'CLEAR_SUGGESTIONS_LIST' 9 | 10 | export const SET_INEXACT_CITY = 'SET_INEXACT_CITY' 11 | 12 | export const SET_USER_INFO = 'SET_USER_INFO' 13 | 14 | export const CLEAR_USER_INFO = 'CLEAR_USER_INFO' 15 | 16 | export const CLEAR_KAIDIAN_NOTE = 'CLEAR_KAIDIAN_NOTE' 17 | 18 | export const NOTE_KAIDIAN = 'NOTE_KAIDIAN' 19 | 20 | export const SET_SHOP_LIST = 'SET_SHOP_LIST' 21 | 22 | export const CLEAR_SHOP_LIST = 'CLEAR_SHOP_LIST' 23 | 24 | export const SET_SHOP_DETAIL = 'SET_SHOP_DETAIL' 25 | 26 | export const SET_SHOP_DISHS = 'SET_SHOP_DISHS' 27 | 28 | export const CLEAR_CART_LIST = 'CLEAR_CART_LIST' 29 | 30 | export const SET_CART_LIST = 'SET_CART_LIST' 31 | 32 | export const SET_SHOPTYPE = 'SET_SHOPTYPE' 33 | 34 | export const SET_RE_LOGIN = 'SET_RE_LOGIN' 35 | -------------------------------------------------------------------------------- /src/store/user/mutations.js: -------------------------------------------------------------------------------- 1 | import * as types from './mutations-type' 2 | 3 | const mutations = { 4 | [types.SET_SUGGESTIONS_LIST] (state, list) { 5 | state.suggestionsList = list 6 | }, 7 | [types.SET_COORDINATE] (state, [lon, lat]) { 8 | state.coordinate = [lon, lat] 9 | }, 10 | [types.SAVE_EXACT_ADDRESS] (state, item) { 11 | state.exactAddress = item 12 | }, 13 | [types.CLEAR_SUGGESTIONS_LIST] (state) { 14 | state.suggestionsList = [] 15 | }, 16 | [types.SET_INEXACT_CITY] (state, address) { 17 | state.inexactAddress = address 18 | }, 19 | [types.SET_USER_INFO] (state, info) { 20 | state.userInfo = info || {} 21 | }, 22 | [types.NOTE_KAIDIAN] (state) { 23 | state.noteKaidian = true 24 | }, 25 | [types.CLEAR_KAIDIAN_NOTE] (state) { 26 | state.noteKaidian = false 27 | }, 28 | [types.SET_SHOP_LIST] (state, list) { 29 | state.shopList = list 30 | }, 31 | [types.CLEAR_SHOP_LIST] (state) { 32 | state.shopList = [] 33 | }, 34 | [types.SET_SHOP_DISHS] (state, list) { 35 | state.shopDishs = list 36 | }, 37 | [types.SET_SHOP_DETAIL] (state, detail) { 38 | state.shopDetail = detail 39 | }, 40 | [types.SET_CART_LIST] (state, list) { 41 | state.cartList = list 42 | }, 43 | [types.CLEAR_CART_LIST] (state) { 44 | state.cartList = [] 45 | }, 46 | [types.SET_SHOPTYPE] (state, list) { 47 | state.shopTypeList = list 48 | }, 49 | [types.SET_RE_LOGIN] (state, bool) { 50 | state.reLogin = bool 51 | } 52 | } 53 | 54 | export default mutations 55 | -------------------------------------------------------------------------------- /src/store/user/state.js: -------------------------------------------------------------------------------- 1 | import config from 'common/javascript/config' 2 | import { _getExactAddress, _getUserInfo, _getCartList, _getShopTypeList } from 'common/javascript/cache' 3 | 4 | const state = { 5 | cityOptions: config.cityOptions, // 省市数据 6 | suggestionsList: [], // 首页输入后的推荐 7 | exactAddress: _getExactAddress(), // 选择的精确地址信息 8 | inexactAddress: [], // 只包含省市的地址 9 | userInfo: _getUserInfo() || {}, // 用户信息 10 | shopList: [], // 用户查看到的商家列表 11 | shopDetail: {}, // 商铺信息 12 | shopDishs: [], // 商铺的菜单 13 | cartList: _getCartList() || [], // 用户购物车列表 14 | shopTypeList: _getShopTypeList() || [], // 商铺类型 15 | reLogin: false // 判断是否重新登录,401的时候重新登录 16 | } 17 | 18 | export default state 19 | -------------------------------------------------------------------------------- /static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ooooevan/chihuobao/58d8678e96751b649857665b14dbeaf6a5001761/static/.gitkeep --------------------------------------------------------------------------------