├── mhzqx小程序
├── pages
│ ├── pay
│ │ ├── pay.json
│ │ ├── pay.wxss
│ │ ├── pay.wxml
│ │ └── pay.js
│ ├── info
│ │ ├── info.json
│ │ ├── info.wxss
│ │ ├── info.wxml
│ │ └── info.js
│ ├── login
│ │ ├── login.json
│ │ ├── login.wxml
│ │ ├── login.js
│ │ └── login.wxss
│ ├── menu
│ │ ├── menu.json
│ │ ├── menu.wxss
│ │ ├── menu.js
│ │ └── menu.wxml
│ ├── order
│ │ ├── order.json
│ │ ├── order.wxss
│ │ ├── order.js
│ │ └── order.wxml
│ ├── appraise
│ │ ├── appraise.json
│ │ ├── appraise.wxss
│ │ ├── appraise.wxml
│ │ └── appraise.js
│ ├── usermenu
│ │ ├── usermenu.json
│ │ ├── usermenu.wxml
│ │ ├── usermenu.js
│ │ └── usermenu.wxss
│ ├── severadmin
│ │ ├── severadmin.json
│ │ ├── severadmin.wxml
│ │ ├── severadmin.wxss
│ │ └── severadmin.js
│ ├── severinfo
│ │ ├── severinfo.json
│ │ ├── severinfo.wxss
│ │ ├── severinfo.js
│ │ └── severinfo.wxml
│ ├── severmenu
│ │ ├── severmenu.json
│ │ ├── severmenu.wxss
│ │ ├── severmenu.wxml
│ │ └── severmenu.js
│ ├── severaddfood
│ │ ├── severaddfood.json
│ │ ├── severaddfood.wxss
│ │ ├── severaddfood.wxml
│ │ └── severaddfood.js
│ ├── severalertfood
│ │ ├── severalertfood.json
│ │ ├── severalertfood.wxss
│ │ ├── severalertfood.wxml
│ │ └── severalertfood.js
│ ├── index
│ │ ├── index.json
│ │ ├── index.wxml
│ │ ├── index.wxss
│ │ └── index.js
│ └── img
│ │ ├── qq.png
│ │ ├── wx.png
│ │ ├── add.png
│ │ ├── jian.png
│ │ ├── logo.png
│ │ ├── send.png
│ │ ├── show.png
│ │ ├── addicon.png
│ │ ├── loading.gif
│ │ ├── wave1.gif
│ │ ├── subtract.png
│ │ ├── unloading.png
│ │ └── uservatar.png
├── images
│ ├── logo.png
│ ├── order.png
│ ├── timg.jpg
│ ├── logo_no.png
│ ├── kaochuan.jpg
│ └── shopInfo.jpg
├── style
│ ├── base
│ │ ├── fn.wxss
│ │ ├── mixin
│ │ │ ├── text.wxss
│ │ │ ├── setArrow.wxss
│ │ │ └── setOnepx.wxss
│ │ ├── variable
│ │ │ ├── color.wxss
│ │ │ ├── global.wxss
│ │ │ ├── weui-cell.wxss
│ │ │ ├── weui-grid.wxss
│ │ │ ├── weui-msg.wxss
│ │ │ ├── weui-button.wxss
│ │ │ ├── weui-dialog.wxss
│ │ │ └── weui-progress.wxss
│ │ └── reset.wxss
│ ├── widget
│ │ ├── weui-cell
│ │ │ ├── weui-switch.wxss
│ │ │ ├── weui-check.wxss
│ │ │ ├── weui-form
│ │ │ │ ├── weui-vcode.wxss
│ │ │ │ ├── weui-form_common.wxss
│ │ │ │ ├── weui-select.wxss
│ │ │ │ └── weui-form-preview.wxss
│ │ │ ├── weui-access.wxss
│ │ │ ├── weui-cell.wxss
│ │ │ ├── weui-uploader.wxss
│ │ │ └── weui-form.wxss
│ │ ├── weui-button
│ │ │ └── weui-button.wxss
│ │ ├── weui-flex
│ │ │ └── weui-flex.wxss
│ │ ├── weui-tips
│ │ │ ├── weui-badge.wxss
│ │ │ └── weui-loadmore.wxss
│ │ ├── weui-progress
│ │ │ └── weui-progress.wxss
│ │ ├── weui-page
│ │ │ ├── weui-article.wxss
│ │ │ └── weui-msg.wxss
│ │ ├── weui-agree
│ │ │ └── weui-agree.wxss
│ │ ├── weui-grid
│ │ │ └── weui-grid.wxss
│ │ ├── weui-footer
│ │ │ └── weui-footer.wxss
│ │ ├── weui-panel
│ │ │ └── weui-panel.wxss
│ │ ├── weui-tab
│ │ │ ├── weui-navbar.wxss
│ │ │ └── weui-tab.wxss
│ │ ├── weui-searchbar
│ │ │ └── weui-searchbar.wxss
│ │ ├── weui-animate
│ │ │ └── weui-animate.wxss
│ │ ├── weui-media-box
│ │ │ └── weui-media-box.wxss
│ │ └── weui-loading
│ │ │ └── weui-loading.wxss
│ └── weui.wxss
├── sitemap.json
├── app.wxss
├── utils
│ └── util.js
├── app.json
├── project.config.json
└── app.js
├── mhzqxNODE后台
├── views
│ ├── error.ejs
│ └── index.ejs
├── public
│ ├── images
│ │ ├── food1.png
│ │ ├── food2.png
│ │ ├── food3.png
│ │ ├── food4.png
│ │ ├── food5.png
│ │ ├── food6.png
│ │ ├── food7.png
│ │ ├── food8.png
│ │ ├── food9.png
│ │ ├── food10.png
│ │ └── wxc7f540d89f35da73.o6zAJs7hq-Iyd7O4lOvl11LFDr6c.eAm2jjPDykQt3f7e6451e277c5c73f6f7f3ddf66433b.jpg
│ └── stylesheets
│ │ └── style.css
├── db
│ ├── dbConfig.js
│ ├── syscusSql.js
│ ├── customerSql.js
│ ├── menuSql.js
│ ├── orderSql.js
│ └── hah.json
├── routes
│ ├── index.js
│ ├── users.js
│ ├── menu.js
│ ├── admin.js
│ ├── customer.js
│ ├── order.js
│ └── foodadmin.js
├── package.json
├── app.js
└── bin
│ └── www
├── README.md
└── mhzqx.sql
/mhzqx小程序/pages/pay/pay.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/mhzqx小程序/pages/info/info.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/mhzqx小程序/pages/login/login.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/mhzqx小程序/pages/menu/menu.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/mhzqx小程序/pages/order/order.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/mhzqx小程序/pages/appraise/appraise.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/mhzqx小程序/pages/usermenu/usermenu.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/mhzqx小程序/pages/appraise/appraise.wxss:
--------------------------------------------------------------------------------
1 | /* client/pages/appraise/appraise.wxss */
--------------------------------------------------------------------------------
/mhzqx小程序/pages/severadmin/severadmin.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/mhzqx小程序/pages/severinfo/severinfo.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/mhzqx小程序/pages/severmenu/severmenu.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/mhzqx小程序/pages/severaddfood/severaddfood.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/mhzqx小程序/pages/severalertfood/severalertfood.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/mhzqx小程序/pages/index/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/mhzqx小程序/pages/appraise/appraise.wxml:
--------------------------------------------------------------------------------
1 |
2 | 用户评价
3 |
--------------------------------------------------------------------------------
/mhzqx小程序/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqx小程序/images/logo.png
--------------------------------------------------------------------------------
/mhzqx小程序/images/order.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqx小程序/images/order.png
--------------------------------------------------------------------------------
/mhzqx小程序/images/timg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqx小程序/images/timg.jpg
--------------------------------------------------------------------------------
/mhzqx小程序/pages/img/qq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqx小程序/pages/img/qq.png
--------------------------------------------------------------------------------
/mhzqx小程序/pages/img/wx.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqx小程序/pages/img/wx.png
--------------------------------------------------------------------------------
/mhzqx小程序/images/logo_no.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqx小程序/images/logo_no.png
--------------------------------------------------------------------------------
/mhzqx小程序/pages/img/add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqx小程序/pages/img/add.png
--------------------------------------------------------------------------------
/mhzqx小程序/pages/img/jian.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqx小程序/pages/img/jian.png
--------------------------------------------------------------------------------
/mhzqx小程序/pages/img/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqx小程序/pages/img/logo.png
--------------------------------------------------------------------------------
/mhzqx小程序/pages/img/send.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqx小程序/pages/img/send.png
--------------------------------------------------------------------------------
/mhzqx小程序/pages/img/show.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqx小程序/pages/img/show.png
--------------------------------------------------------------------------------
/mhzqxNODE后台/views/error.ejs:
--------------------------------------------------------------------------------
1 |
<%= message %>
2 | <%= error.status %>
3 | <%= error.stack %>
4 |
--------------------------------------------------------------------------------
/mhzqx小程序/images/kaochuan.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqx小程序/images/kaochuan.jpg
--------------------------------------------------------------------------------
/mhzqx小程序/images/shopInfo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqx小程序/images/shopInfo.jpg
--------------------------------------------------------------------------------
/mhzqx小程序/pages/img/addicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqx小程序/pages/img/addicon.png
--------------------------------------------------------------------------------
/mhzqx小程序/pages/img/loading.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqx小程序/pages/img/loading.gif
--------------------------------------------------------------------------------
/mhzqx小程序/pages/img/wave1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqx小程序/pages/img/wave1.gif
--------------------------------------------------------------------------------
/mhzqx小程序/pages/img/subtract.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqx小程序/pages/img/subtract.png
--------------------------------------------------------------------------------
/mhzqx小程序/pages/img/unloading.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqx小程序/pages/img/unloading.png
--------------------------------------------------------------------------------
/mhzqx小程序/pages/img/uservatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqx小程序/pages/img/uservatar.png
--------------------------------------------------------------------------------
/mhzqxNODE后台/public/images/food1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqxNODE后台/public/images/food1.png
--------------------------------------------------------------------------------
/mhzqxNODE后台/public/images/food2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqxNODE后台/public/images/food2.png
--------------------------------------------------------------------------------
/mhzqxNODE后台/public/images/food3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqxNODE后台/public/images/food3.png
--------------------------------------------------------------------------------
/mhzqxNODE后台/public/images/food4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqxNODE后台/public/images/food4.png
--------------------------------------------------------------------------------
/mhzqxNODE后台/public/images/food5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqxNODE后台/public/images/food5.png
--------------------------------------------------------------------------------
/mhzqxNODE后台/public/images/food6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqxNODE后台/public/images/food6.png
--------------------------------------------------------------------------------
/mhzqxNODE后台/public/images/food7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqxNODE后台/public/images/food7.png
--------------------------------------------------------------------------------
/mhzqxNODE后台/public/images/food8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqxNODE后台/public/images/food8.png
--------------------------------------------------------------------------------
/mhzqxNODE后台/public/images/food9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqxNODE后台/public/images/food9.png
--------------------------------------------------------------------------------
/mhzqxNODE后台/public/images/food10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqxNODE后台/public/images/food10.png
--------------------------------------------------------------------------------
/mhzqx小程序/style/base/fn.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 |
--------------------------------------------------------------------------------
/mhzqxNODE后台/public/stylesheets/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding: 50px;
3 | font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
4 | }
5 |
6 | a {
7 | color: #00B7FF;
8 | }
9 |
--------------------------------------------------------------------------------
/mhzqx小程序/style/base/mixin/text.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 |
--------------------------------------------------------------------------------
/mhzqx小程序/style/base/mixin/setArrow.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 |
--------------------------------------------------------------------------------
/mhzqx小程序/style/base/mixin/setOnepx.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 |
--------------------------------------------------------------------------------
/mhzqx小程序/style/base/variable/color.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 |
--------------------------------------------------------------------------------
/mhzqx小程序/style/base/variable/global.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 |
--------------------------------------------------------------------------------
/mhzqx小程序/style/base/variable/weui-cell.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 |
--------------------------------------------------------------------------------
/mhzqx小程序/style/base/variable/weui-grid.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 |
--------------------------------------------------------------------------------
/mhzqx小程序/style/base/variable/weui-msg.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 |
--------------------------------------------------------------------------------
/mhzqx小程序/style/base/variable/weui-button.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 |
--------------------------------------------------------------------------------
/mhzqx小程序/style/base/variable/weui-dialog.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 |
--------------------------------------------------------------------------------
/mhzqx小程序/style/base/variable/weui-progress.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 |
--------------------------------------------------------------------------------
/mhzqxNODE后台/db/dbConfig.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | mysql: {
3 | host: '127.0.0.1',
4 | user: 'root',
5 | password: 'root',
6 | database: 'mhzqx',
7 | port: 3306
8 | }
9 | }
--------------------------------------------------------------------------------
/mhzqxNODE后台/db/syscusSql.js:
--------------------------------------------------------------------------------
1 | var syscusSql = {
2 | insert: 'INSERT INTO syscus(CUSID, NICKNAME, LIMITS) VALUES(?, ?, ?)',
3 | queryAll: 'SELECT * FROM syscus'
4 | }
5 | module.exports = syscusSql
--------------------------------------------------------------------------------
/mhzqx小程序/sitemap.json:
--------------------------------------------------------------------------------
1 | {
2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
3 | "rules": [{
4 | "action": "allow",
5 | "page": "*"
6 | }]
7 | }
--------------------------------------------------------------------------------
/mhzqx小程序/app.wxss:
--------------------------------------------------------------------------------
1 | /**app.wxss**/
2 | @import 'pages/style/weui.wxss';
3 |
4 | .container {
5 | display: flex;
6 | flex-direction: column;
7 | align-items: center;
8 | box-sizing: border-box;
9 | }
10 |
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-cell/weui-switch.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-cell_switch{padding-top:6px;padding-bottom:6px}
--------------------------------------------------------------------------------
/mhzqxNODE后台/db/customerSql.js:
--------------------------------------------------------------------------------
1 | var customerSql = {
2 | insert: 'INSERT INTO customer(CUSID, OPENID, NICKNAME) VALUES(?, ?, ?)',
3 | queryAll: 'SELECT * FROM customer',
4 | getCustomerByOPENID: 'SELECT * FROM customer WHERE OPENID'
5 | }
6 | module.exports = customerSql
--------------------------------------------------------------------------------
/mhzqxNODE后台/routes/index.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var router = express.Router();
3 |
4 | /* GET home page. */
5 | router.get('/', function(req, res, next) {
6 | res.render('index', { title: 'Express' });
7 | });
8 |
9 | module.exports = router;
10 |
--------------------------------------------------------------------------------
/mhzqxNODE后台/routes/users.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var router = express.Router();
3 |
4 | /* GET users listing. */
5 | router.get('/', function(req, res, next) {
6 | res.send('respond with a resource');
7 | });
8 |
9 | module.exports = router;
10 |
--------------------------------------------------------------------------------
/mhzqx小程序/style/base/reset.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | page{line-height:1.6;font-family:-apple-system-font,Helvetica Neue,sans-serif}icon{vertical-align:middle}
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-button/weui-button.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-btn{margin-top:15px}.weui-btn:first-child{margin-top:0}.weui-btn-area{margin:1.17647059em 15px .3em}
--------------------------------------------------------------------------------
/mhzqxNODE后台/public/images/wxc7f540d89f35da73.o6zAJs7hq-Iyd7O4lOvl11LFDr6c.eAm2jjPDykQt3f7e6451e277c5c73f6f7f3ddf66433b.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nopapername/mhzqx-weChatApp/HEAD/mhzqxNODE后台/public/images/wxc7f540d89f35da73.o6zAJs7hq-Iyd7O4lOvl11LFDr6c.eAm2jjPDykQt3f7e6451e277c5c73f6f7f3ddf66433b.jpg
--------------------------------------------------------------------------------
/mhzqxNODE后台/views/index.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <%= title %>
5 |
6 |
7 |
8 | <%= title %>
9 | Welcome to <%= title %>
10 |
11 |
12 |
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-flex/weui-flex.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-flex{display:-webkit-box;display:-webkit-flex;display:flex}.weui-flex__item{-webkit-box-flex:1;-webkit-flex:1;flex:1}
--------------------------------------------------------------------------------
/mhzqx小程序/pages/index/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 开发者将获取一些用户权限
5 | ·获取你的公开信息(昵称、头像等)
6 |
7 |
8 |
--------------------------------------------------------------------------------
/mhzqxNODE后台/db/menuSql.js:
--------------------------------------------------------------------------------
1 | var menuSql = {
2 | queryGoodsTypeAll: 'SELECT * FROM goodstype',
3 | queryGoodsAll: 'SELECT * FROM goods',
4 | insertGoods: 'INSERT INTO goods(GID, GTID, GNAME, GSTATE, GPRICE, GCONTENT, GIMG, GTIME, GCOUNT, GINFO) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',
5 | insertGoodsType: 'INSERT INTO goodstype(GTID, GTNAME, GTSTATE) VALUES(?, ?, ?)',
6 | }
7 | module.exports = menuSql
--------------------------------------------------------------------------------
/mhzqx小程序/pages/index/index.wxss:
--------------------------------------------------------------------------------
1 | /* pages/index/index.wxss */
2 | .content1 {
3 | display: flex;
4 | flex-direction: column;
5 | align-items: center;
6 | justify-content: space-around;
7 | }
8 | .click-btn {
9 | width: 80%;
10 | }
11 | .shows-img {
12 | width: 80%;
13 | }
14 | .gettitle{
15 | font-size: larger;
16 | }
17 | .getinfo{
18 | margin: 10px 0;
19 | font-size: small;
20 | }
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-tips/weui-badge.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-badge{display:inline-block;padding:.15em .4em;min-width:8px;border-radius:18px;background-color:#e64340;color:#fff;line-height:1.2;text-align:center;font-size:12px;vertical-align:middle}.weui-badge_dot{padding:.4em;min-width:0}
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-progress/weui-progress.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-progress{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-progress__bar{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-progress__opr{margin-left:15px;font-size:0}
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-cell/weui-check.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-icon-radio{margin-left:3.2px;margin-right:3.2px}.weui-icon-checkbox_circle,.weui-icon-checkbox_success{margin-left:4.6px;margin-right:4.6px}.weui-check__label:active{background-color:#ececec}.weui-check{position:absolute;left:-9999px}.weui-check__hd_in-checkbox{padding-right:.35em}.weui-cell__ft_in-radio{padding-left:.35em}
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-page/weui-article.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-article{padding:20px 15px;font-size:15px}.weui-article__section{margin-bottom:1.5em}.weui-article__h1{font-size:18px;font-weight:400;margin-bottom:.9em}.weui-article__h2{font-size:16px;font-weight:400;margin-bottom:.34em}.weui-article__h3{font-weight:400;font-size:15px;margin-bottom:.34em}.weui-article__p{margin:0 0 .8em}
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-cell/weui-form/weui-vcode.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-cell_vcode{padding-right:0}.weui-vcode-btn,.weui-vcode-img{margin-left:5px;height:2.58823529em;vertical-align:middle}.weui-vcode-btn{display:inline-block;padding:0 .6em 0 .7em;border-left:1px solid #e5e5e5;line-height:2.58823529em;font-size:17px;color:#3cc51f;white-space:nowrap}.weui-vcode-btn:active{color:#52a341}
--------------------------------------------------------------------------------
/mhzqxNODE后台/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mhzqx",
3 | "version": "0.0.0",
4 | "private": true,
5 | "scripts": {
6 | "start": "node ./bin/www"
7 | },
8 | "dependencies": {
9 | "cookie-parser": "~1.4.4",
10 | "debug": "~2.6.9",
11 | "ejs": "~2.6.1",
12 | "express": "~4.16.1",
13 | "formidable": "^1.2.1",
14 | "http-errors": "~1.6.3",
15 | "morgan": "~1.9.1",
16 | "mysql": "^2.17.1",
17 | "node-uuid": "^1.4.8",
18 | "path": "^0.12.7",
19 | "request": "^2.88.0"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/mhzqx小程序/pages/index/index.js:
--------------------------------------------------------------------------------
1 | // client/pages/login.js
2 | const app = getApp()
3 |
4 | Page({
5 | data: {
6 | },
7 |
8 | onLoad: function () {
9 |
10 | },
11 | onGotUserInfo: function (e) {
12 | if (e.detail.userInfo) {
13 | app.globalData.userInfo = e.detail.userInfo
14 | wx.navigateTo({
15 | url: '../login/login'
16 | })
17 | } else {
18 | wx.showToast({
19 | title: '登录信息获取失败!',
20 | icon: "none",
21 | duration: 1000,
22 | mask: true
23 | })
24 | }
25 | },
26 | })
--------------------------------------------------------------------------------
/mhzqx小程序/utils/util.js:
--------------------------------------------------------------------------------
1 | const formatTime = date => {
2 | const year = date.getFullYear()
3 | const month = date.getMonth() + 1
4 | const day = date.getDate()
5 | const hour = date.getHours()
6 | const minute = date.getMinutes()
7 | const second = date.getSeconds()
8 |
9 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
10 | }
11 |
12 | const formatNumber = n => {
13 | n = n.toString()
14 | return n[1] ? n : '0' + n
15 | }
16 |
17 | module.exports = {
18 | formatTime: formatTime
19 | }
20 |
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-agree/weui-agree.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-agree{display:block;padding:.5em 15px;font-size:13px}.weui-agree__text{color:#999}.weui-agree__link{display:inline;color:#586c94}.weui-agree__checkbox{position:absolute;left:-9999px}.weui-agree__checkbox-icon{position:relative;top:2px;display:inline-block;border:1px solid #d1d1d1;background-color:#fff;border-radius:3px;width:11px;height:11px}.weui-agree__checkbox-icon-check{position:absolute;top:1px;left:1px}
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-grid/weui-grid.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-grids{border-top:1rpx solid #d9d9d9;border-left:1rpx solid #d9d9d9;overflow:hidden}.weui-grid{position:relative;float:left;padding:20px 10px;width:33.33333333%;box-sizing:border-box;border-right:1rpx solid #d9d9d9;border-bottom:1rpx solid #d9d9d9}.weui-grid_active{background-color:#ececec}.weui-grid__icon{display:block;width:28px;height:28px;margin:0 auto}.weui-grid__label{margin-top:5px;display:block;text-align:center;color:#000;font-size:14px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-page/weui-msg.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-msg{padding-top:36px;text-align:center}.weui-msg__link{display:inline;color:#586c94}.weui-msg__icon-area{margin-bottom:30px}.weui-msg__text-area{margin-bottom:25px;padding:0 20px}.weui-msg__title{margin-bottom:5px;font-weight:400;font-size:20px}.weui-msg__desc{font-size:14px;color:#999}.weui-msg__opr-area{margin-bottom:25px}.weui-msg__extra-area{margin-bottom:15px;font-size:14px;color:#999}@media screen and (min-height:438px){.weui-msg__extra-area{position:fixed;left:0;bottom:0;width:100%;text-align:center}}
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-footer/weui-footer.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-footer{color:#999;font-size:14px;text-align:center}.weui-footer_fixed-bottom{position:fixed;bottom:.52em;left:0;right:0}.weui-footer__links{font-size:0}.weui-footer__link{display:inline-block;vertical-align:top;margin:0 .62em;position:relative;font-size:14px;color:#586c94}.weui-footer__link:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #c7c7c7;color:#c7c7c7;left:-.65em;top:.36em;bottom:.36em}.weui-footer__link:first-child:before{display:none}.weui-footer__text{padding:0 .34em;font-size:12px}
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-cell/weui-access.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-cell_access{color:inherit}.weui-cell__ft_in-access{padding-right:13px;position:relative}.weui-cell__ft_in-access:after{content:" ";display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8cd;border-style:solid;-webkit-transform:matrix(.71,.71,-.71,.71,0,0);transform:matrix(.71,.71,-.71,.71,0,0);position:relative;top:-2px;position:absolute;top:50%;margin-top:-4px;right:2px}.weui-cell_link{color:#586c94;font-size:14px}.weui-cell_link:active{background-color:#ececec}.weui-cell_link:first-child:before{display:block}
--------------------------------------------------------------------------------
/mhzqx小程序/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 | "pages/index/index",
4 | "pages/login/login",
5 | "pages/menu/menu",
6 | "pages/order/order",
7 | "pages/usermenu/usermenu",
8 | "pages/severaddfood/severaddfood",
9 | "pages/severadmin/severadmin",
10 | "pages/severmenu/severmenu",
11 | "pages/severalertfood/severalertfood",
12 | "pages/info/info",
13 | "pages/severinfo/severinfo",
14 | "pages/pay/pay",
15 | "pages/appraise/appraise"
16 | ],
17 | "window": {
18 | "backgroundTextStyle": "light",
19 | "navigationBarBackgroundColor": "#fff",
20 | "navigationBarTitleText": "满汉子全席",
21 | "navigationBarTextStyle": "black"
22 | },
23 | "sitemapLocation": "sitemap.json"
24 | }
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-panel/weui-panel.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-panel{background-color:#fff;margin-top:10px;position:relative;overflow:hidden}.weui-panel:first-child{margin-top:0}.weui-panel:before{top:0;border-top:1rpx solid #e5e5e5}.weui-panel:after,.weui-panel:before{content:" ";position:absolute;left:0;right:0;height:1px;color:#e5e5e5}.weui-panel:after{bottom:0;border-bottom:1rpx solid #e5e5e5}.weui-panel__hd{padding:14px 15px 10px;color:#999;font-size:13px;position:relative}.weui-panel__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid #e5e5e5;color:#e5e5e5;left:15px}
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-tips/weui-loadmore.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-loadmore{width:65%;margin:1.5em auto;line-height:1.6em;font-size:14px;text-align:center}.weui-loadmore__tips{display:inline-block;vertical-align:middle}.weui-loadmore_line{border-top:1px solid #e5e5e5;margin-top:2.4em}.weui-loadmore__tips_in-line{position:relative;top:-.9em;padding:0 .55em;background-color:#fff;color:#999}.weui-loadmore__tips_in-dot{position:relative;padding:0 .16em;width:4px;height:1.6em}.weui-loadmore__tips_in-dot:before{content:" ";position:absolute;top:50%;left:50%;margin-top:-1px;margin-left:-2px;width:4px;height:4px;border-radius:50%;background-color:#e5e5e5}
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-cell/weui-form/weui-form_common.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-cell_input{padding-top:0;padding-bottom:0}.weui-label{width:105px;word-wrap:break-word;word-break:break-all}.weui-input{height:2.58823529em;min-height:2.58823529em;line-height:2.58823529em}.weui-toptips{position:fixed;-webkit-transform:translateZ(0);transform:translateZ(0);top:0;left:0;right:0;padding:5px;font-size:14px;text-align:center;color:#fff;z-index:5000;word-wrap:break-word;word-break:break-all}.weui-toptips_warn{background-color:#e64340}.weui-textarea{display:block;width:100%}.weui-textarea-counter{color:#b2b2b2;text-align:right}.weui-cell_warn,.weui-textarea-counter_warn{color:#e64340}
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-cell/weui-form/weui-select.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-cell_select{padding:0}.weui-select{position:relative;padding-left:15px;padding-right:30px;height:2.58823529em;min-height:2.58823529em;line-height:2.58823529em;border-right:1rpx solid #d9d9d9}.weui-select:before{content:" ";display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8cd;border-style:solid;-webkit-transform:matrix(.71,.71,-.71,.71,0,0);transform:matrix(.71,.71,-.71,.71,0,0);position:relative;top:-2px;position:absolute;top:50%;right:15px;margin-top:-4px}.weui-select_in-select-after{padding-left:0}.weui-cell__bd_in-select-before,.weui-cell__hd_in-select-after{padding-left:15px}
--------------------------------------------------------------------------------
/mhzqxNODE后台/db/orderSql.js:
--------------------------------------------------------------------------------
1 | var orderSql = {
2 | insertCusOrder: 'INSERT INTO cusorders(ORDERID, CUSID, ORDERTIME, ORDERSTATE, ORDERTOTLEPRICE) VALUES(?, ?, ?, ?, ?)',
3 | insertOrderDetail: 'INSERT INTO orderdetail(GID, ORDERID, GNAME, GCOUNT, GPRICE, GTIME) VALUES(?, ?, ?, ?, ?, ?)',
4 | insertOverOrder: 'INSERT INTO overorder(ORDERID, CUSID, ORDERTIME, ORDERSTATE, ORDERTOTLEPRICE) VALUES(?, ?, ?, ?, ?)',
5 | queryAllCusOrder: 'SELECT * FROM cusorders',
6 | queryAllOrderDetail: 'SELECT * FROM orderdetail',
7 | queryAllOverOrder: 'SELECT * FROM overorder',
8 | selectCusOrder: 'SELECT * FROM cusorders WHERE CUSID=',
9 | selectCusOrderOrderId: 'SELECT * FROM cusorders WHERE ORDERID=',
10 | selectOrderDetail: 'SELECT * FROM orderdetail WHERE ORDERID=',
11 | deleteCusOrder: 'DELETE FROM cusorders WHERE ORDERID='
12 | }
13 |
14 | module.exports = orderSql
--------------------------------------------------------------------------------
/mhzqx小程序/pages/pay/pay.wxss:
--------------------------------------------------------------------------------
1 | /* client/pages/pay/pay.wxss */
2 |
3 | page {
4 | margin: 0;
5 | padding: 0;
6 | min-height: 100%;
7 | }
8 | .page-head-box
9 | {
10 | display: flex;
11 | flex-direction: column;
12 | justify-items: center;
13 | align-items: center;
14 | margin: 100rpx;
15 | }
16 | .mybtn
17 | {
18 | background-color: white!important;
19 | border: none!important;
20 | }
21 | .pay-img
22 | {
23 | width: 50rpx;
24 | height: 50rpx;
25 | margin: 20rpx;
26 | }
27 | .page-bottom
28 | {
29 | display: flex;
30 | flex-direction: row;
31 | position: fixed;
32 | justify-content: center;
33 | bottom: 20rpx;
34 | width: 100%;
35 | }
36 | .weui-btn
37 | {
38 | width: 90%;
39 | }
40 | /* 字体 */
41 | .myfont1
42 | {
43 | opacity: .6;
44 | font-size: small;
45 | }
46 | .myfont2
47 | {
48 | font-weight: 700;
49 | font-size: 80rpx;
50 | }
51 |
--------------------------------------------------------------------------------
/mhzqx小程序/pages/severadmin/severadmin.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{item.name}}
8 |
9 |
10 |
11 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-tab/weui-navbar.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-navbar{display:-webkit-box;display:-webkit-flex;display:flex;position:absolute;z-index:500;top:0;width:100%;border-bottom:1rpx solid #ccc}.weui-navbar__item{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:13px 0;text-align:center;font-size:0}.weui-navbar__item.weui-bar__item_on{color:#1aad19}.weui-navbar__slider{position:absolute;content:" ";left:0;bottom:0;width:6em;height:3px;background-color:#1aad19;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}.weui-navbar__title{display:inline-block;font-size:15px;max-width:8em;width:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal}
--------------------------------------------------------------------------------
/mhzqx小程序/project.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "项目配置文件",
3 | "packOptions": {
4 | "ignore": []
5 | },
6 | "setting": {
7 | "urlCheck": false,
8 | "es6": true,
9 | "postcss": true,
10 | "minified": true,
11 | "newFeature": true,
12 | "autoAudits": false,
13 | "coverView": true
14 | },
15 | "compileType": "miniprogram",
16 | "libVersion": "2.10.2",
17 | "appid": "wx8326c752c26474eb",
18 | "projectname": "mhzqx%E5%B0%8F%E7%A8%8B%E5%BA%8F",
19 | "debugOptions": {
20 | "hidedInDevtools": []
21 | },
22 | "isGameTourist": false,
23 | "simulatorType": "wechat",
24 | "simulatorPluginLibVersion": {},
25 | "condition": {
26 | "search": {
27 | "current": -1,
28 | "list": []
29 | },
30 | "conversation": {
31 | "current": -1,
32 | "list": []
33 | },
34 | "game": {
35 | "currentL": -1,
36 | "list": []
37 | },
38 | "miniprogram": {
39 | "current": -1,
40 | "list": []
41 | }
42 | }
43 | }
--------------------------------------------------------------------------------
/mhzqx小程序/pages/appraise/appraise.js:
--------------------------------------------------------------------------------
1 | // client/pages/appraise/appraise.js
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 |
9 | },
10 |
11 | /**
12 | * 生命周期函数--监听页面加载
13 | */
14 | onLoad: function (options) {
15 |
16 | },
17 |
18 | /**
19 | * 生命周期函数--监听页面初次渲染完成
20 | */
21 | onReady: function () {
22 |
23 | },
24 |
25 | /**
26 | * 生命周期函数--监听页面显示
27 | */
28 | onShow: function () {
29 |
30 | },
31 |
32 | /**
33 | * 生命周期函数--监听页面隐藏
34 | */
35 | onHide: function () {
36 |
37 | },
38 |
39 | /**
40 | * 生命周期函数--监听页面卸载
41 | */
42 | onUnload: function () {
43 |
44 | },
45 |
46 | /**
47 | * 页面相关事件处理函数--监听用户下拉动作
48 | */
49 | onPullDownRefresh: function () {
50 |
51 | },
52 |
53 | /**
54 | * 页面上拉触底事件的处理函数
55 | */
56 | onReachBottom: function () {
57 |
58 | },
59 |
60 | /**
61 | * 用户点击右上角分享
62 | */
63 | onShareAppMessage: function () {
64 |
65 | }
66 | })
--------------------------------------------------------------------------------
/mhzqx小程序/pages/severadmin/severadmin.wxss:
--------------------------------------------------------------------------------
1 | /* pages/severadmin/severadmin.wxss */
2 | .container{
3 | padding:0 50rpx;
4 | margin: 50rpx 0;
5 | display: flex;
6 | justify-content: center;
7 | }
8 | .list-box
9 | {
10 | width: 100%;
11 | }
12 | .list-item
13 | {
14 | display: flex;
15 | align-items: center;
16 | justify-content:space-between;
17 | border: 1px solid rgba(0, 0, 0, .2);
18 | border-radius: 10rpx;
19 | padding: 20rpx;
20 | margin-bottom: 40rpx;
21 | }
22 | .user-box
23 | {
24 | display: flex;
25 | align-items: center;
26 | }
27 | .item-img
28 | {
29 | width: 100rpx;
30 | height: 100rpx;
31 | }
32 | .item-text
33 | {
34 | color: rgba(0, 0, 0, .8);
35 | margin-left: 40rpx;
36 | }
37 | .item-icon
38 | {
39 | width: 40rpx;
40 | height: 40rpx;
41 | }
42 | .add-icon{
43 | position: fixed;
44 | bottom: 40rpx;
45 | width: 100rpx;
46 | height: 100rpx;
47 | }
48 | .weui-input
49 | {
50 | border: 1px solid rgba(0, 0, 0, .2);
51 | padding-left: 20rpx;
52 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # mhzqx-weChatApp
2 | 微信小程序-点餐系统(包含前端,后台及数据库表)
3 |
4 | ### 小程序预览
5 |
6 | 由于没有正式上线使用,仅作为demo使用,所以请移步csdn预览动图:https://blog.csdn.net/weixin_43388844/article/details/96728376
7 |
8 | ### 满汉子全席——点餐小程序
9 |
10 | 本小弟参加实训使用微信开发者工具写的点餐小程序项目,同时使用nodejs编写后台部分来操作数据库,和我一样初学小程序或nodejs的可以在本项目中学习了解关于小程序代码结构组织,模块化,构建等内容,入门小程序及nodejs的好选择。
11 |
12 | ### 技术栈及工具
13 |
14 | 工具:微信开发者工具 vscode mysql
15 |
16 | 前端: html + css + js + 小程序api + weui
17 |
18 | 后台: nodejs + express框架 + mysql数据库
19 |
20 | ### 起手式
21 |
22 | star and fork本项目
23 |
24 | 安装node环境
25 |
26 | git clone https://github.com/nopapername/mhzqx-weChatApp.git (本项目地址)
27 |
28 | ###### 前端小程序页面打开步骤:
29 |
30 | 使用微信开发者工具导入 mhzqx小程序文件夹中的工程
31 |
32 | 编译运行
33 |
34 | ###### 后台运行步骤:
35 |
36 | 导入mhzqx.sql表数据到你的数据库中
37 |
38 | cd mhzqxNODE后台 (进入mhzqxNODE后台 文件夹目录下)
39 |
40 | 修改db文件夹目录下的dbConfig.js文件 为你自己的数据库配置
41 |
42 | 重点:修改routes文件夹下customer.js里面的appid和secret为自己小程序号的小程序id和密钥
43 |
44 | npm install (建议使用淘宝镜像cnpm)
45 |
46 | npm start
47 |
48 | ### 交流
49 |
50 | 项目不再维护,请自行解决问题
51 |
52 | >
53 |
54 |
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-tab/weui-tab.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-navbar{display:-webkit-box;display:-webkit-flex;display:flex;position:absolute;z-index:500;top:0;width:100%;border-bottom:1rpx solid #ccc}.weui-navbar__item{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:13px 0;text-align:center;font-size:0}.weui-navbar__item.weui-bar__item_on{color:#1aad19}.weui-navbar__slider{position:absolute;content:" ";left:0;bottom:0;width:6em;height:3px;background-color:#1aad19;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}.weui-navbar__title{display:inline-block;font-size:15px;max-width:8em;width:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal}.weui-tab{position:relative;height:100%}.weui-tab__panel{box-sizing:border-box;height:100%;padding-top:50px;overflow:auto;-webkit-overflow-scrolling:touch}
--------------------------------------------------------------------------------
/mhzqx小程序/pages/severaddfood/severaddfood.wxss:
--------------------------------------------------------------------------------
1 | /* pages/severalertfood/severalertfood.wxss */
2 | .container {
3 | display: flex;
4 | flex-direction: column;
5 | align-items: center;
6 | padding: 50rpx 0;
7 | }
8 | .head-img {
9 | height: 300rpx;
10 | width: 300rpx;
11 | }
12 | form{
13 | width: 80%;
14 | }
15 | .input-box {
16 | margin: 40rpx 0;
17 | }
18 |
19 | .weui-input,.weui-textarea,radio-group {
20 | border: 2rpx solid rgba(0, 0, 0, 0.2);
21 | border-radius: 10rpx;
22 | font-size: 0.7rem;
23 | padding-left: 20rpx;
24 | }
25 |
26 | .weui-textarea{
27 | padding-top: 20rpx;
28 | }
29 | .weui-cell__bd
30 | {
31 | color: rgba(0, 0, 0, 0.6);
32 | }
33 | .weui-textarea-counter
34 | {
35 | font-size: 0.7rem;
36 | }
37 | .weui-uploader__input-box
38 | {
39 | width: 100%;
40 | }
41 | .up-img-box
42 | {
43 | display: flex;
44 | justify-content: center;
45 | }
46 | .up-img
47 | {
48 | height: 200rpx;
49 | width: 200rpx;
50 | }
51 | .up-text
52 | {
53 | font-size:.7rem;
54 | color: rgba(0, 0, 0, 0.6);
55 | }
56 | .myfont1
57 | {
58 | color: rgb(4, 146, 240);
59 | }
--------------------------------------------------------------------------------
/mhzqx小程序/pages/severalertfood/severalertfood.wxss:
--------------------------------------------------------------------------------
1 | /* pages/severalertfood/severalertfood.wxss */
2 | .container {
3 | display: flex;
4 | flex-direction: column;
5 | align-items: center;
6 | padding: 50rpx 0;
7 | }
8 | .head-img {
9 | height: 300rpx;
10 | width: 300rpx;
11 | }
12 | form{
13 | width: 80%;
14 | }
15 | .input-box {
16 | margin: 40rpx 0;
17 | }
18 |
19 | .weui-input,.weui-textarea,radio-group {
20 | border: 2rpx solid rgba(0, 0, 0, 0.2);
21 | border-radius: 10rpx;
22 | font-size: 0.7rem;
23 | padding-left: 20rpx;
24 | }
25 |
26 | .weui-textarea{
27 | padding-top: 20rpx;
28 | }
29 | .weui-cell__bd
30 | {
31 | color: rgba(0, 0, 0, 0.6);
32 | }
33 | .weui-textarea-counter
34 | {
35 | font-size: 0.7rem;
36 | }
37 | .weui-uploader__input-box
38 | {
39 | width: 100%;
40 | }
41 | .up-img-box
42 | {
43 | display: flex;
44 | justify-content: center;
45 | }
46 | .up-img
47 | {
48 | height: 200rpx;
49 | width: 200rpx;
50 | }
51 | .up-text
52 | {
53 | font-size:.7rem;
54 | color: rgba(0, 0, 0, 0.6);
55 | }
56 | .myfont1
57 | {
58 | color: rgb(4, 146, 240);
59 | }
--------------------------------------------------------------------------------
/mhzqx小程序/pages/login/login.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
26 | 管理员模式
27 |
28 | @满汉子全席餐厅
29 |
30 |
31 |
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-searchbar/weui-searchbar.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-search-bar{position:relative;padding:8px 10px;display:-webkit-box;display:-webkit-flex;display:flex;box-sizing:border-box;background-color:#efeff4;border-top:1rpx solid #d7d6dc;border-bottom:1rpx solid #d7d6dc}.weui-icon-search{margin-right:8px;font-size:inherit}.weui-icon-search_in-box{position:absolute;left:10px;top:7px}.weui-search-bar__text{display:inline-block;font-size:14px;vertical-align:middle}.weui-search-bar__form{position:relative;-webkit-box-flex:1;-webkit-flex:auto;flex:auto;border-radius:5px;background:#fff;border:1rpx solid #e6e6ea}.weui-search-bar__box{position:relative;padding-left:30px;padding-right:30px;width:100%;box-sizing:border-box;z-index:1}.weui-search-bar__input{height:28px;line-height:28px;font-size:14px}.weui-icon-clear{position:absolute;top:0;right:0;padding:7px 8px;font-size:0}.weui-search-bar__label{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;border-radius:3px;text-align:center;color:#9b9b9b;background:#fff;line-height:28px}.weui-search-bar__cancel-btn{margin-left:10px;line-height:28px;color:#09bb07;white-space:nowrap}
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-animate/weui-animate.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | @-webkit-keyframes a{0%{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes a{0%{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.weui-animate-slide-up{-webkit-animation:a ease .3s forwards;animation:a ease .3s forwards}@-webkit-keyframes b{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes b{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}.weui-animate-slide-down{-webkit-animation:b ease .3s forwards;animation:b ease .3s forwards}@-webkit-keyframes c{0%{opacity:0}to{opacity:1}}@keyframes c{0%{opacity:0}to{opacity:1}}.weui-animate-fade-in{-webkit-animation:c ease .3s forwards;animation:c ease .3s forwards}@-webkit-keyframes d{0%{opacity:1}to{opacity:0}}@keyframes d{0%{opacity:1}to{opacity:0}}.weui-animate-fade-out{-webkit-animation:d ease .3s forwards;animation:d ease .3s forwards}
--------------------------------------------------------------------------------
/mhzqx小程序/pages/pay/pay.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 支付剩余时间
4 | ¥\t{{sumprice}}
5 | 订单详情>>
6 |
7 |
8 |
9 |
10 |
11 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/mhzqx小程序/pages/severinfo/severinfo.wxss:
--------------------------------------------------------------------------------
1 | /* client/pages/info/info.wxss */
2 |
3 | page {
4 | margin: 0;
5 | padding: 0;
6 | min-height: 100%;
7 | }
8 |
9 | .container {
10 | width: 100%;
11 | display: flex;
12 | flex-direction: column;
13 | align-items: center;
14 | }
15 |
16 | .page-head {
17 | display: flex;
18 | flex-direction: column;
19 | align-items: center;
20 | border-bottom: 1rpx solid rgba(0, 0, 0, 0.3);
21 | margin: 50rpx;
22 | }
23 |
24 | .food-img {
25 | width: 200rpx;
26 | height: 200rpx;
27 | }
28 |
29 | .page-content-box {
30 | width: 90%;
31 | display: flex;
32 | flex-direction: column;
33 | }
34 |
35 | .info-box {
36 | width: 100%;
37 | }
38 |
39 | .appraise-content {
40 | display: flex;
41 | flex-direction: column;
42 | align-items: center;
43 | margin: 50rpx;
44 | width: 80%;
45 | }
46 |
47 | .appraise-item-box {
48 | display: flex;
49 | flex-direction: row;
50 | justify-content: space-between;
51 | align-items: center;
52 | width: 100%;
53 | }
54 |
55 | .weui-progress__bar-box {
56 | width: 40%;
57 | }
58 |
59 | .myfont1 {
60 | font-size: smaller;
61 | opacity: 0.7;
62 | }
63 | .cut-btn
64 | {
65 | width: 100%;
66 | margin-bottom: 20rpx;
67 | }
68 | .myfont2 {
69 | font-style: oblique;
70 | color: rgb(199, 25, 25);
71 | }
72 |
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-cell/weui-cell.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-cells{position:relative;margin-top:1.17647059em;background-color:#fff;line-height:1.41176471;font-size:17px}.weui-cells:before{top:0;border-top:1rpx solid #d9d9d9}.weui-cells:after,.weui-cells:before{content:" ";position:absolute;left:0;right:0;height:1px;color:#d9d9d9}.weui-cells:after{bottom:0;border-bottom:1rpx solid #d9d9d9}.weui-cells__title{margin-top:.77em;margin-bottom:.3em;padding-left:15px;padding-right:15px;color:#999;font-size:14px}.weui-cells_after-title{margin-top:0}.weui-cells__tips{margin-top:.3em;color:#999;padding-left:15px;padding-right:15px;font-size:14px}.weui-cell{padding:10px 15px;position:relative;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid #d9d9d9;color:#d9d9d9;left:15px}.weui-cell:first-child:before{display:none}.weui-cell_active{background-color:#ececec}.weui-cell_primary{-webkit-box-align:start;-webkit-align-items:flex-start;align-items:flex-start}.weui-cell__bd{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-cell__ft{text-align:right;color:#999}
--------------------------------------------------------------------------------
/mhzqx小程序/pages/usermenu/usermenu.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 满汉子,满30元送扎啤~
5 |
6 |
7 | 客官,这是您的菜单
8 |
9 |
10 |
11 |
12 |
25 |
26 |
27 |
28 | 总计:
29 | {{sumprice}}
30 |
31 | 去结账
32 |
33 |
--------------------------------------------------------------------------------
/mhzqx小程序/pages/severadmin/severadmin.js:
--------------------------------------------------------------------------------
1 | // pages/severadmin/severadmin.js
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 | adminlist: [{
9 | id: '1',
10 | avtar: "../img/uservatar.png",
11 | name: "张三宝"
12 | }, {
13 | id: '2',
14 | avtar: "../img/uservatar.png",
15 | name: "欧阳甩锅"
16 | }, {
17 | id: '3',
18 | avtar: "../img/uservatar.png",
19 | name: "彭于艳"
20 | }, ],
21 | addflag: false,
22 | },
23 |
24 | /**
25 | * 生命周期函数--监听页面加载
26 | */
27 | onLoad: function(options) {
28 |
29 | },
30 |
31 | /**
32 | * 生命周期函数--监听页面初次渲染完成
33 | */
34 | onReady: function() {
35 |
36 | },
37 |
38 | /**
39 | * 生命周期函数--监听页面显示
40 | */
41 | onShow: function() {
42 |
43 | },
44 |
45 | /**
46 | * 生命周期函数--监听页面隐藏
47 | */
48 | onHide: function() {
49 |
50 | },
51 |
52 | /**
53 | * 生命周期函数--监听页面卸载
54 | */
55 | onUnload: function() {
56 |
57 | },
58 | submitadd: function(e) {
59 | var admin = {
60 | id: '3',
61 | avtar: "../img/uservatar.png",
62 | name: ""
63 | }
64 | admin.id = e.detail.value.id;
65 | admin.name = e.detail.value.id;
66 | this.data.adminlist.push(admin);
67 | this.setData({
68 | adminlist: this.data.adminlist,
69 | addflag: false,
70 | })
71 | },
72 | subtract: function(e) {
73 | console.log(e.target.dataset.id)
74 | },
75 | add: function() {
76 | this.setData({
77 | addflag: true
78 | })
79 | },
80 | })
--------------------------------------------------------------------------------
/mhzqx小程序/pages/severinfo/severinfo.js:
--------------------------------------------------------------------------------
1 | var app = getApp()
2 | // client/pages/info/info.js
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | foodinfo: {},
10 | serveraddr: '',
11 | },
12 |
13 | /**
14 | * 生命周期函数--监听页面加载
15 | */
16 | onLoad: function(e) {
17 | this.setData({
18 | foodinfo: JSON.parse(e.foodinfo),
19 | serveraddr: app.globalData.serveraddr,
20 | })
21 | },
22 |
23 | /**
24 | * 生命周期函数--监听页面初次渲染完成
25 | */
26 | onReady: function() {
27 |
28 | },
29 |
30 | /**
31 | * 生命周期函数--监听页面显示
32 | */
33 | onShow: function() {
34 |
35 | },
36 |
37 | /**
38 | * 生命周期函数--监听页面隐藏
39 | */
40 | onHide: function() {
41 |
42 | },
43 |
44 | /**
45 | * 生命周期函数--监听页面卸载
46 | */
47 | onUnload: function() {
48 |
49 | },
50 | // 自定义函数
51 | cut: function() {
52 |
53 | console.log(this.data.foodinfo.GID)
54 | wx.request({
55 | url: app.globalData.serveraddr + '/foodadmin/uninstall',
56 | data: {
57 | foodinfo:this.data.foodinfo.GID,
58 | },
59 | success(res) {
60 | if (res.data.result.code == 200) {
61 | wx.showToast({
62 | title: '下架成功',
63 | icon: 'success',
64 | duration: 3000
65 | });
66 | wx.reLaunch({
67 | url: '../severmenu/severmenu',
68 | })
69 | } else {
70 | wx.showToast({
71 | title: '下架失败',
72 | icon: 'success',
73 | duration: 3000
74 | });
75 | }
76 | }
77 | })
78 | }
79 | })
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-media-box/weui-media-box.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-media-box{padding:15px;position:relative}.weui-media-box:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid #e5e5e5;color:#e5e5e5;left:15px}.weui-media-box:first-child:before{display:none}.weui-media-box__title{font-weight:400;font-size:17px;width:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal;word-wrap:break-word;word-break:break-all}.weui-media-box__desc{color:#999;font-size:13px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-media-box__info{margin-top:15px;padding-bottom:5px;font-size:13px;color:#cecece;line-height:1em;list-style:none;overflow:hidden}.weui-media-box__info__meta{float:left;padding-right:1em}.weui-media-box__info__meta_extra{padding-left:1em;border-left:1px solid #cecece}.weui-media-box__title_in-text{margin-bottom:8px}.weui-media-box_appmsg{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-media-box__thumb{width:100%;height:100%;vertical-align:top}.weui-media-box__hd_in-appmsg{margin-right:.8em;width:60px;height:60px;line-height:60px;text-align:center}.weui-media-box__bd_in-appmsg{-webkit-box-flex:1;-webkit-flex:1;flex:1;min-width:0}.weui-media-box_small-appmsg{padding:0}.weui-cells_in-small-appmsg{margin-top:0}.weui-cells_in-small-appmsg:before{display:none}
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-cell/weui-uploader.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-uploader__hd{display:-webkit-box;display:-webkit-flex;display:flex;padding-bottom:10px;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-uploader__title{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-uploader__info{color:#b2b2b2}.weui-uploader__bd{margin-bottom:-4px;margin-right:-9px;overflow:hidden}.weui-uploader__file{float:left;margin-right:9px;margin-bottom:9px}.weui-uploader__img{display:block;width:79px;height:79px}.weui-uploader__file_status{position:relative}.weui-uploader__file_status:before{content:" ";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,.5)}.weui-uploader__file-content{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#fff}.weui-uploader__input-box{float:left;position:relative;margin-right:9px;margin-bottom:9px;width:77px;height:77px;border:1px solid #d9d9d9}.weui-uploader__input-box:after,.weui-uploader__input-box:before{content:" ";position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);background-color:#d9d9d9}.weui-uploader__input-box:before{width:2px;height:39.5px}.weui-uploader__input-box:after{width:39.5px;height:2px}.weui-uploader__input-box:active{border-color:#999}.weui-uploader__input-box:active:after,.weui-uploader__input-box:active:before{background-color:#999}.weui-uploader__input{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;opacity:0}
--------------------------------------------------------------------------------
/mhzqx小程序/pages/info/info.wxss:
--------------------------------------------------------------------------------
1 | /* client/pages/info/info.wxss */
2 |
3 | page {
4 | margin: 0;
5 | padding: 0;
6 | min-height: 100%;
7 | }
8 |
9 | .container {
10 | width: 100%;
11 | display: flex;
12 | flex-direction: column;
13 | align-items: center;
14 | }
15 |
16 | .page-head {
17 | display: flex;
18 | flex-direction: column;
19 | align-items: center;
20 | border-bottom: 1rpx solid rgba(0, 0, 0, 0.3);
21 | margin: 50rpx;
22 | }
23 |
24 | .food-img {
25 | width: 200rpx;
26 | height: 200rpx;
27 | }
28 |
29 | .page-content-box {
30 | width: 90%;
31 | display: flex;
32 | flex-direction: column;
33 | }
34 |
35 | /* 轮播 */
36 | .swiper-container{
37 | width: 100%;
38 | height: 100%;
39 | }
40 | swiper {
41 | height: 200rpx;
42 | width: 100%;
43 | }
44 | swiper-item {
45 | width: 100%;
46 | height: 100%;
47 | display: flex;
48 | flex-direction: row;
49 | justify-content: center;
50 | }
51 | .img
52 | {
53 | height:100rpx;
54 | width: 100rpx;
55 | }
56 | .swiper-container .swiper{
57 | height: 150rpx;
58 | }
59 |
60 | .info-box {
61 | width: 100%;
62 | }
63 |
64 | .appraise-content {
65 | display: flex;
66 | flex-direction: column;
67 | align-items: center;
68 | margin: 50rpx;
69 | width: 80%;
70 | }
71 |
72 | .appraise-item-box {
73 | display: flex;
74 | flex-direction: row;
75 | justify-content: space-between;
76 | align-items: center;
77 | width: 100%;
78 | }
79 |
80 | .weui-progress__bar-box {
81 | width: 40%;
82 | }
83 |
84 | .myfont1 {
85 | font-size: smaller;
86 | opacity: 0.7;
87 | }
88 |
89 | .myfont2 {
90 | font-style: oblique;
91 | color: rgb(199, 25, 25);
92 | }
93 |
--------------------------------------------------------------------------------
/mhzqxNODE后台/app.js:
--------------------------------------------------------------------------------
1 | var createError = require('http-errors');
2 | var express = require('express');
3 | var path = require('path');
4 | var cookieParser = require('cookie-parser');
5 | var logger = require('morgan');
6 |
7 | var indexRouter = require('./routes/index');
8 | var usersRouter = require('./routes/users');
9 | var customerRouter = require('./routes/customer')
10 | var menuRouter = require('./routes/menu')
11 | var orderRouter = require('./routes/order')
12 | var adminRouter = require('./routes/admin')
13 | var foodadminRouter = require('./routes/foodadmin')
14 |
15 | var app = express();
16 |
17 | // view engine setup
18 | app.set('views', path.join(__dirname, 'views'));
19 | app.set('view engine', 'ejs');
20 |
21 | app.use(logger('dev'));
22 | app.use(express.json());
23 | app.use(express.urlencoded({ extended: false }));
24 | app.use(cookieParser());
25 | app.use(express.static(path.join(__dirname, 'public')));
26 | app.use(express.static('addGoodsImg'))
27 |
28 | app.use('/', indexRouter);
29 | app.use('/users', usersRouter);
30 | app.use('/customer', customerRouter);
31 | app.use('/menu', menuRouter);
32 | app.use('/order', orderRouter);
33 | app.use('/admin', adminRouter);
34 | app.use('/foodadmin', foodadminRouter);
35 |
36 | // catch 404 and forward to error handler
37 | app.use(function(req, res, next) {
38 | next(createError(404));
39 | });
40 |
41 | // error handler
42 | app.use(function(err, req, res, next) {
43 | // set locals, only providing error in development
44 | res.locals.message = err.message;
45 | res.locals.error = req.app.get('env') === 'development' ? err : {};
46 |
47 | // render the error page
48 | res.status(err.status || 500);
49 | res.render('error');
50 | });
51 |
52 | module.exports = app;
53 |
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-cell/weui-form/weui-form-preview.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-form-preview{position:relative;background-color:#fff}.weui-form-preview:before{top:0;border-top:1rpx solid #d9d9d9}.weui-form-preview:after,.weui-form-preview:before{content:" ";position:absolute;left:0;right:0;height:1px;color:#d9d9d9}.weui-form-preview:after{bottom:0;border-bottom:1rpx solid #d9d9d9}.weui-form-preview__value{font-size:14px}.weui-form-preview__value_in-hd{font-size:26px}.weui-form-preview__hd{position:relative;padding:10px 15px;text-align:right;line-height:2.5em}.weui-form-preview__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid #d9d9d9;color:#d9d9d9;left:15px}.weui-form-preview__bd{padding:10px 15px;font-size:.9em;text-align:right;color:#999;line-height:2}.weui-form-preview__ft{position:relative;line-height:50px;display:-webkit-box;display:-webkit-flex;display:flex}.weui-form-preview__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid #d5d5d6;color:#d5d5d6}.weui-form-preview__item{overflow:hidden}.weui-form-preview__label{float:left;margin-right:1em;min-width:4em;color:#999;text-align:justify;text-align-last:justify}.weui-form-preview__value{display:block;overflow:hidden;word-break:normal;word-wrap:break-word}.weui-form-preview__btn{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#3cc51f;text-align:center}.weui-form-preview__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #d5d5d6;color:#d5d5d6}.weui-form-preview__btn:first-child:after{display:none}.weui-form-preview__btn_active{background-color:#eee}.weui-form-preview__btn_default{color:#999}.weui-form-preview__btn_primary{color:#0bb20c}
--------------------------------------------------------------------------------
/mhzqx小程序/pages/usermenu/usermenu.js:
--------------------------------------------------------------------------------
1 | // client/pages/pay/pay.js
2 | var app = getApp()
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | myfoodsList: [],
10 | sumprice: 0,
11 | serveraddr: app.globalData.serveraddr
12 | },
13 |
14 | /**
15 | * 生命周期函数--监听页面加载
16 | */
17 | onLoad: function(e) {
18 | this.setData({
19 | myfoodsList: JSON.parse(e.foodslist),
20 | })
21 | },
22 |
23 | /**
24 | * 生命周期函数--监听页面初次渲染完成
25 | */
26 | onReady: function() {
27 | var sum = 0;
28 | for (var i = 0; i < this.data.myfoodsList.length; i++) {
29 | sum = sum + this.data.myfoodsList[i].gcount * this.data.myfoodsList[i].gprice;
30 | }
31 | console.log(this.data.myfoodsList.length);
32 | this.setData({
33 | sumprice: sum,
34 | })
35 | },
36 |
37 | /**
38 | * 生命周期函数--监听页面显示
39 | */
40 | onShow: function() {
41 |
42 | },
43 |
44 | /**
45 | * 生命周期函数--监听页面隐藏
46 | */
47 | onHide: function() {
48 |
49 | },
50 |
51 | /**
52 | * 生命周期函数--监听页面卸载
53 | */
54 | onUnload: function() {
55 |
56 | },
57 |
58 | /**
59 | * 页面相关事件处理函数--监听用户下拉动作
60 | */
61 | onPullDownRefresh: function() {
62 |
63 | },
64 |
65 | /**
66 | * 页面上拉触底事件的处理函数
67 | */
68 | onReachBottom: function() {
69 |
70 | },
71 |
72 | /**
73 | * 用户点击右上角分享
74 | */
75 | onShareAppMessage: function() {
76 |
77 | },
78 | goinfo: function(e) {
79 | var list = this.data.myfoodsList;
80 | for (var i = 0; i < list.length; i++) {
81 | if (list[i].gid == e.currentTarget.dataset.gid) {
82 | wx.navigateTo({
83 | url: '../info/info?foodinfo=' + JSON.stringify(list[i])
84 | })
85 | }
86 | }
87 | },
88 | gopay: function() {
89 | wx.redirectTo({
90 | url: '../pay/pay?sumprice=' + this.data.sumprice + '&foodlist=' + JSON.stringify(this.data.myfoodsList),
91 | })
92 | }
93 | })
--------------------------------------------------------------------------------
/mhzqx小程序/pages/order/order.wxss:
--------------------------------------------------------------------------------
1 | /* pages/order/order.wxss */
2 |
3 | .contioner {
4 | margin: 0;
5 | display: flex;
6 | flex-direction: column;
7 | justify-content: space-between;
8 | background-color: #f6f6f6;
9 | }
10 |
11 | .img-box {
12 | width: 100%;
13 | background-color: white;
14 | margin-bottom: 20rpx;
15 | display: flex;
16 | justify-content: center;
17 | }
18 |
19 | .head-img {
20 | height: 200rpx;
21 | width: 200rpx;
22 | margin: 0 auto;
23 | }
24 |
25 | .page-head-box {
26 | padding: 30rpx 40rpx;
27 | background-color: white;
28 | }
29 |
30 | .page-info-down {
31 | display: flex;
32 | flex-direction: row;
33 | justify-content: flex-end;
34 | }
35 |
36 | .order-list-box {
37 | margin: 50rpx 0;
38 | background-color: white;
39 | padding: 0 50rpx;
40 | }
41 |
42 | .order-head-box {
43 | display: flex;
44 | justify-content: space-between;
45 | border-bottom: 1px solid rgba(0, 0, 0, 0.2);
46 | padding: 40rpx 0;
47 | }
48 |
49 | .order-body-box {
50 | border-bottom: 1px solid rgba(0, 0, 0, 0.2);
51 | }
52 |
53 | .body-item-box {
54 | display: flex;
55 | justify-content: space-between;
56 | margin: 50rpx 0;
57 | }
58 |
59 | .body-r {
60 | width: 70%;
61 | }
62 | .item-food-box
63 | {
64 | display: flex;
65 | }
66 | .order-bottom-box {
67 | padding: 40rpx 0;
68 | border-bottom: 1px solid rgba(0, 0, 0, 0.2);
69 | }
70 |
71 | .bottom-text {
72 | text-align: center;
73 | }
74 |
75 | /* 字体 */
76 |
77 | .myfont1 {
78 | /* font-size: smaller; */
79 | opacity: 0.7;
80 | }
81 |
82 | .myfont3 {
83 | font-size: smaller;
84 | opacity: 0.7;
85 | }
86 |
87 | .myfont4 {
88 | font-size: 0.7rem;
89 | opacity: 0.7;
90 | }
91 |
92 | .myfont5 {
93 | font-size: 0.8rem;
94 | color: #71d381;
95 | }
96 |
97 | .myfont2 {
98 | font-style: oblique;
99 | color: rgb(199, 25, 25);
100 | }
101 |
--------------------------------------------------------------------------------
/mhzqx小程序/pages/severinfo/severinfo.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{foodinfo.GNAME}}
6 | {{foodinfo.GPRICE}}
7 | ¥/份儿
8 |
9 |
10 |
11 |
12 | 详细信息:
13 |
14 | 菜品描述
15 | {{foodinfo.GINFO}}
16 |
17 |
18 |
19 |
20 | 用户评价
21 | 233条评论
22 |
23 |
24 |
25 | 本月热度
26 |
27 |
28 |
29 |
30 |
31 | 90份
32 |
33 |
34 | 好评率
35 |
36 |
37 |
38 |
39 |
40 | 70%
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/mhzqxNODE后台/bin/www:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /**
4 | * Module dependencies.
5 | */
6 |
7 | var app = require('../app');
8 | var debug = require('debug')('mhzqx: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 || '3000');
16 | app.set('port', port);
17 |
18 | /**
19 | * Create HTTP server.
20 | */
21 |
22 | var server = http.createServer(app);
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 |
--------------------------------------------------------------------------------
/mhzqx小程序/pages/login/login.js:
--------------------------------------------------------------------------------
1 | // client/pages/login.js
2 | const app = getApp()
3 |
4 | Page({
5 | data: {
6 | userInfo: {},
7 | hasUserInfo: false,
8 | canIUse: wx.canIUse('button.open-type.getUserInfo'),
9 | isAdmin: false
10 | },
11 |
12 | onLoad: function () {
13 | getApp().watch((value) => {
14 | this.setData({
15 | isAdmin: value
16 | })
17 | })
18 | var that = this
19 | app.getOpenId().then(function (res) {
20 | if (app.globalData.userInfo) {
21 | that.setData({
22 | userInfo: res.userInfo,
23 | hasUserInfo: true
24 | })
25 | } else if (this.data.canIUse) {
26 | // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
27 | // 所以此处加入 callback 以防止这种情况
28 | app.userInfoReadyCallback = res => {
29 | that.setData({
30 | userInfo: res.userInfo,
31 | hasUserInfo: true
32 | })
33 | }
34 | } else {
35 | // 在没有 open-type=getUserInfo 版本的兼容处理
36 | wx.getUserInfo({
37 | success: res => {
38 | app.globalData.userInfo = res.userInfo
39 | that.setData({
40 | userInfo: res.userInfo,
41 | hasUserInfo: true
42 | })
43 | }
44 | })
45 | }
46 | })
47 | },
48 | joinPage: function (e) {
49 | if (app.globalData.isLogin) {
50 | //成功,后续逻辑:判断用户是否有正在处理的订单,如果有,那么跳转到订单页面;如果没有跳转到菜单页面。
51 | if (app.globalData.isHaveOrder) {
52 | wx.navigateTo({
53 | url: '../order/order'
54 | })
55 | } else {
56 | wx.navigateTo({
57 | url: '../menu/menu'
58 | })
59 | }
60 | }
61 | // } else {
62 | // //失败
63 | // wx.showToast({
64 | // title: '登录信息获取失败!',
65 | // icon: "none",
66 | // duration: 1000,
67 | // mask: true
68 | // })
69 | // }
70 | },
71 | openadmin: function () {
72 | wx.navigateTo({
73 | url: '../severmenu/severmenu'
74 | })
75 | },
76 | })
--------------------------------------------------------------------------------
/mhzqxNODE后台/routes/menu.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var router = express.Router();
3 | var mysql = require('mysql')
4 | var dbConfig = require('../db/dbConfig')
5 | var uuid = require('node-uuid')
6 | var menuSql = require('../db/menuSql')
7 |
8 | var pool = mysql.createPool(dbConfig.mysql)
9 | var responseJSON = function (res, ret) {
10 | if (typeof ret === 'undefined') {
11 | res.json({
12 | code: '-200',
13 | msg: '操作失败'
14 | })
15 | } else {
16 | res.json(ret)
17 | }
18 | }
19 |
20 | router.get('/', function (req, res) {
21 | pool.getConnection(function (err, connection) {
22 | var gtList = []
23 | var _res = res
24 | var data = {}
25 | connection.query(menuSql.queryGoodsTypeAll, function(err, resp) {
26 | if (resp) {
27 | resp.forEach(element => {
28 | var menuNav = {
29 | gt: {},
30 | goodslist: []
31 | }
32 | menuNav.gt.gtid = element.GTID
33 | menuNav.gt.gtname = element.GTNAME
34 | menuNav.gt.gtstate = element.GTSTATE
35 |
36 | gtList.push(menuNav)
37 | })
38 | connection.query(menuSql.queryGoodsAll, function (err, respon) {
39 | if (respon) {
40 | respon.forEach(element => {
41 | for (let i = 0; i < gtList.length; i++) {
42 | if (gtList[i].gt.gtid == element.GTID) {
43 | var goods = {}
44 | goods.gid = element.GID
45 | goods.gtid = element.GTID
46 | goods.gname = element.GNAME
47 | goods.gprice = element.GPRICE
48 | goods.gstate = element.GSTATE
49 | goods.gcontent = element.GCONTENT
50 | goods.gimg = element.GIMG
51 | goods.gtime = element.GTIME
52 | goods.gcount = element.GCOUNT
53 |
54 | gtList[i].goodslist.push(goods)
55 | }
56 | }
57 | })
58 | data.gtlist = gtList
59 | responseJSON(_res, data)
60 | connection.release()
61 | }
62 | })
63 | }
64 | })
65 | })
66 | })
67 |
68 | module.exports = router;
--------------------------------------------------------------------------------
/mhzqx小程序/pages/order/order.js:
--------------------------------------------------------------------------------
1 | // pages/order/order.js
2 | var app = getApp()
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | foodlist: [],
10 | overlist: []
11 | },
12 |
13 | /**
14 | * 生命周期函数--监听页面加载
15 | */
16 | onLoad: function() {
17 | wx.request({
18 | url: app.globalData.serveraddr + '/order/getOrders',
19 | data: {
20 | cusid: app.globalData.cusid
21 | },
22 | success: res => {
23 | this.setData({
24 | overlist: res.data.overOrder.reverse()
25 | })
26 | console.log(this.data.overlist)
27 | var foodlist = []
28 | var orderlist = []
29 | for (let i = 0; i < res.data.order.length; i++) {
30 | var order = {
31 | orderid: '',
32 | orderPrice: 0,
33 | foods: []
34 | }
35 | order.orderid = res.data.order[i].ORDERID
36 | order.orderPrice = res.data.order[i].ORDERTOTLEPRICE
37 | order.orderTime = res.data.order[i].ORDERTIME
38 | order.orderNum = res.data.order[i].ORDERNUM
39 | order.orderState = res.data.order[i].ORDERSTATE
40 | order.orderSort = res.data.order[i].orderSort
41 | for (let k = 0; k < res.data.orderDetailAll.length; k++) {
42 | for (let j = 0; j < res.data.orderDetailAll[k].length; j++) {
43 | if (order.orderid == res.data.orderDetailAll[k][j].ORDERID) {
44 | order.foods.push(res.data.orderDetailAll[k][j].GNAME + '*' + res.data.orderDetailAll[k][j].GCOUNT)
45 | }
46 | }
47 | }
48 | foodlist.push(order)
49 | }
50 | for (let i = 0; i < foodlist.length; i++) {
51 | if (foodlist[i].orderState == 1) {
52 | orderlist.push(foodlist[i])
53 | }
54 | }
55 | this.setData({
56 | foodlist: orderlist.reverse()
57 | })
58 | }
59 | })
60 | },
61 |
62 | /**
63 | * 生命周期函数--监听页面初次渲染完成
64 | */
65 | onReady: function() {
66 |
67 | },
68 |
69 | /**
70 | * 生命周期函数--监听页面显示
71 | */
72 | onShow: function() {
73 |
74 | },
75 |
76 | /**
77 | * 生命周期函数--监听页面隐藏
78 | */
79 | onHide: function() {
80 |
81 | },
82 |
83 | /**
84 | * 生命周期函数--监听页面卸载
85 | */
86 | onUnload: function() {
87 |
88 | },
89 | agin: function() {
90 | wx.redirectTo({
91 | url: '../menu/menu',
92 | })
93 | }
94 | })
--------------------------------------------------------------------------------
/mhzqx小程序/pages/usermenu/usermenu.wxss:
--------------------------------------------------------------------------------
1 | /* client/pages/pay/pay.wxss */
2 |
3 | page {
4 | margin: 0;
5 | padding: 0;
6 | min-height: 100%;
7 | }
8 |
9 | .contioner {
10 | margin: 0 50rpx;
11 | }
12 |
13 | .page-head-box {
14 | display: flex;
15 | flex-direction: row;
16 | justify-content: center;
17 | align-items: center;
18 | background-color: #f6f6f6;
19 | }
20 |
21 | .head-img {
22 | width: 100rpx;
23 | height: 100rpx;
24 | }
25 |
26 | .wel-title {
27 | font-weight: 700;
28 | font-size: 30rpx;
29 | }
30 |
31 | .page-info-down {
32 | display: flex;
33 | flex-direction: row;
34 | justify-content: flex-start;
35 | margin: 30rpx 0;
36 | padding: 10rpx;
37 | }
38 |
39 | /* item */
40 | .menu-box
41 | {
42 | margin-bottom:100rpx;
43 | }
44 | .list-box {
45 | box-sizing: border-box;
46 | width: 100%;
47 | padding: 20rpx;
48 | border-bottom: 1px solid rgba(177, 175, 175, 0.3);
49 | }
50 |
51 | .list-item-box {
52 | display: flex;
53 | flex-direction: row;
54 | justify-content: space-between;
55 | align-items: center;
56 | }
57 |
58 | .item-img {
59 | width: 100rpx;
60 | height: 100rpx;
61 | margin: 30rpx;
62 | }
63 |
64 | .item-info-box {
65 | display: flex;
66 | flex-direction: column;
67 | align-items: flex-start;
68 | width: 40%;
69 | }
70 |
71 | .item-name {
72 | font-weight: 700;
73 | }
74 |
75 | .item-type {
76 | opacity: 0.5;
77 | font-size: 25rpx;
78 | color: black;
79 | font-style: normal;
80 | }
81 |
82 | .item-price {
83 | font-style: oblique;
84 | color: rgb(199, 25, 25);
85 | }
86 |
87 | .gtime-tex {
88 | opacity: 0.8;
89 | }
90 |
91 | /* 底部 */
92 |
93 | .page-bottom {
94 | display: flex;
95 | flex-direction: column;
96 | margin: 0;
97 | position: fixed;
98 | bottom: 20rpx;
99 | width: 90%;
100 | background-color: white;
101 | }
102 |
103 | .container-bottom-box {
104 | display: flex;
105 | flex-direction: row;
106 | text-align: center;
107 | box-shadow: 5rpx 5rpx rgb(141, 140, 140);
108 | border-radius: 50rpx;
109 | overflow: hidden;
110 | z-index: 2;
111 | }
112 | .container-bottom-l {
113 | width: 60%;
114 | padding: 20rpx 0;
115 | }
116 | .container-bottom-r {
117 | width: 40%;
118 | padding: 20rpx;
119 | font-weight: 700;
120 | opacity: 0.8;
121 | }
122 |
123 | /* 字体 */
124 |
125 | .myfont1 {
126 | /* font-size: smaller; */
127 | opacity: 0.7;
128 | }
129 |
130 | .myfont2 {
131 | font-style: oblique;
132 | color: rgb(199, 25, 25);
133 | }
134 |
--------------------------------------------------------------------------------
/mhzqx小程序/pages/severalertfood/severalertfood.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
58 |
--------------------------------------------------------------------------------
/mhzqx小程序/pages/severaddfood/severaddfood.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
60 |
61 | {{warning}}
--------------------------------------------------------------------------------
/mhzqx小程序/pages/pay/pay.js:
--------------------------------------------------------------------------------
1 | // client/pages/pay/pay.js
2 | var app = getApp()
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | radioItems: [{
10 | name: "微信支付",
11 | value: 'wx',
12 | img: 'wx.png',
13 | checked: 'true'
14 | },
15 | {
16 | name: "QQ支付",
17 | value: 'qq',
18 | img: 'qq.png'
19 | },
20 | ],
21 | sumprice: 0,
22 | foodlist: [],
23 | isPay: false
24 | },
25 |
26 | /**
27 | * 生命周期函数--监听页面加载
28 | */
29 | onLoad: function(e) {
30 |
31 | this.setData({
32 | sumprice: e.sumprice,
33 | foodlist: JSON.parse(e.foodlist),
34 | })
35 | },
36 |
37 | /**
38 | * 生命周期函数--监听页面初次渲染完成
39 | */
40 | onReady: function() {
41 |
42 | },
43 |
44 | /**
45 | * 生命周期函数--监听页面显示
46 | */
47 | onShow: function() {
48 |
49 | },
50 |
51 | /**
52 | * 生命周期函数--监听页面隐藏
53 | */
54 | onHide: function() {
55 |
56 | },
57 |
58 | /**
59 | * 生命周期函数--监听页面卸载
60 | */
61 | onUnload: function() {
62 |
63 | },
64 |
65 | /**
66 | * 页面相关事件处理函数--监听用户下拉动作
67 | */
68 | onPullDownRefresh: function() {
69 |
70 | },
71 |
72 | /**
73 | * 页面上拉触底事件的处理函数
74 | */
75 | onReachBottom: function() {
76 |
77 | },
78 |
79 | /**
80 | * 用户点击右上角分享
81 | */
82 | onShareAppMessage: function() {
83 |
84 | },
85 | openToast: function() {
86 | if (!this.data.isPay) {
87 | wx.showToast({
88 | title: '支付成功',
89 | icon: 'success',
90 | duration: 3000
91 | });
92 | this.setData({
93 | isPay: true
94 | })
95 | wx.request({
96 | url: app.globalData.serveraddr + '/order',
97 | data: {
98 | foodlist: JSON.stringify(this.data.foodlist),
99 | cusid: app.globalData.cusid
100 | },
101 | method: 'POST',
102 | header: {
103 | "Content-Type": "application/x-www-form-urlencoded"
104 | },
105 | success: res => {
106 | console.log(res)
107 | }
108 | })
109 | }
110 | },
111 | radioChange: function(e) {
112 |
113 | var radioItems = this.data.radioItems;
114 | for (var i = 0, len = radioItems.length; i < len; ++i) {
115 | radioItems[i].checked = radioItems[i].value == e.detail.value;
116 | }
117 |
118 | this.setData({
119 | radioItems: radioItems
120 | });
121 | },
122 | goorder: function() {
123 | if (this.data.isPay) {
124 | wx.redirectTo({
125 | url: '../order/order'
126 | })
127 | } else {
128 | wx.showToast({
129 | title: '请支付后查看订单',
130 | icon: 'none',
131 | duration: 2000
132 | });
133 | }
134 | }
135 | })
--------------------------------------------------------------------------------
/mhzqx小程序/pages/order/order.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 进行中订单:
8 |
9 |
10 | 当前此订单排到了
11 | {{item.orderSort}} 位
12 | 预计需要
13 | {{item.orderTime}} 分钟
14 |
15 |
16 |
17 | 付款金额
18 | ¥{{item.orderPrice}}
19 |
20 |
21 |
22 | 商 品
23 |
24 |
25 | {{item}}
26 |
27 |
28 |
29 |
30 | 收获地址
31 | 四川师范大学成龙校区东苑三栋
32 |
33 |
34 | 收款方
35 | 满汉子全席餐厅
36 |
37 |
38 |
39 | 再来一单
40 |
41 |
42 |
43 |
44 |
45 | 已完成订单:
46 |
47 |
48 |
49 | 付款金额
50 | ¥{{item.ORDERTOTLEPRICE}}
51 |
52 |
53 |
54 | 商品订单编号
55 |
56 | {{item.ORDERID}}
57 |
58 |
59 |
60 | 收获地址
61 | 四川师范大学成龙校区东苑三栋
62 |
63 |
64 | 收款方
65 | 满汉子全席餐厅
66 |
67 |
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/mhzqx小程序/pages/severmenu/severmenu.wxss:
--------------------------------------------------------------------------------
1 | /* client/pages/menu/menu.wxss */
2 |
3 | /* 卡片二css */
4 |
5 | page, .page, .page__bd {
6 | height: 100%;
7 | padding: 0;
8 | margin: 0;
9 | font-size: 30rpx;
10 | }
11 |
12 | .weui-navbar {
13 | background-color: white !important;
14 | }
15 |
16 | .container {
17 | margin-bottom: 100rpx;
18 | }
19 |
20 | .page__bd {
21 | padding-bottom: 0;
22 | width: 100%;
23 | }
24 | .head-img
25 | {
26 | width:150rpx;
27 | height: 150rpx;
28 | }
29 | .dingdanbianhao {
30 | text-overflow: ellipsis;
31 | overflow: hidden;
32 | white-space: nowrap;
33 | width: 200rpx;
34 | }
35 | .page-head-box {
36 | position: fixed;
37 | width: 100%;
38 | text-align: center;
39 | display: flex;
40 | justify-content: center;
41 | bottom: 50rpx;
42 | }
43 |
44 | .add-img {
45 | height: 100rpx;
46 | width: 100rpx;
47 | margin: 20rpx 0;
48 | }
49 |
50 | .title-text {
51 | font-size: 35rpx;
52 | margin: 20rpx 0 30rpx 0;
53 | text-align: center;
54 | }
55 |
56 | .list-box {
57 | box-sizing: border-box;
58 | width: 100%;
59 | padding: 20rpx;
60 | border-bottom: 1px solid rgba(177, 175, 175, 0.3);
61 | }
62 |
63 | .list-item-box {
64 | display: flex;
65 | flex-direction: row;
66 | justify-content: space-between;
67 | }
68 |
69 | .item-img {
70 | width: 150rpx;
71 | height: 150rpx;
72 | margin: 30rpx;
73 | }
74 |
75 | .item-info-box {
76 | display: flex;
77 | flex-direction: column;
78 | align-items: flex-start;
79 | width: 40%;
80 | }
81 |
82 | .item-name {
83 | font-weight: 700;
84 | }
85 |
86 | .item-type {
87 | opacity: 0.5;
88 | font-size: 25rpx;
89 | color: black;
90 | font-style: normal;
91 | }
92 |
93 | .item-price {
94 | font-style: oblique;
95 | color: rgb(199, 25, 25);
96 | }
97 |
98 | .gtime-tex {
99 | opacity: 0.8;
100 | }
101 |
102 | .item-icon-box {
103 | display: flex;
104 | flex-direction: row;
105 | align-items: center;
106 | }
107 |
108 | /* 卡片三css */
109 |
110 | .list-box {
111 | width: 100%;
112 | }
113 |
114 | .list-item {
115 | display: flex;
116 | align-items: center;
117 | justify-content: space-between;
118 | border: 1px solid rgba(0, 0, 0, 0.2);
119 | border-radius: 10rpx;
120 | padding-right: 20rpx;
121 | margin-bottom: 40rpx;
122 | }
123 |
124 | .user-box {
125 | display: flex;
126 | align-items: center;
127 | }
128 |
129 | .item-img {
130 | width: 100rpx;
131 | height: 100rpx;
132 | }
133 | .item-icon {
134 | width: 40rpx;
135 | height: 40rpx;
136 | }
137 |
138 | .weui-input {
139 | border: 1px solid rgba(0, 0, 0, 0.2);
140 | padding-left: 20rpx;
141 | }
142 |
143 | .no {
144 | font-size: 1rem;
145 | text-align: center;
146 | margin-top: 50rpx;
147 | }
148 |
149 | /* 卡片一订单 */
150 |
151 | .button-box {
152 | display: flex;
153 | align-items: center;
154 | }
155 | .over-btn {
156 | margin: 20rpx;
157 | }
158 | .myfont1 {
159 | font-style: oblique;
160 | color: rgb(199, 25, 25);
161 | }
162 | .myfont2 {
163 | font-size: smaller;
164 | opacity: 0.7;
165 | }
166 |
--------------------------------------------------------------------------------
/mhzqxNODE后台/routes/admin.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var router = express.Router();
3 | var mysql = require('mysql');
4 | var syscusSql = require('../db/syscusSql')
5 | var menuSql=require("../db/menuSql")
6 | var dbConfig = require('../db/dbConfig')
7 |
8 | var pool = mysql.createPool(dbConfig.mysql)
9 | var responseJSON = function (res, ret) {
10 | if (typeof ret === 'undefined') {
11 | res.json({
12 | code: '-200',
13 | msg: '操作失败'
14 | })
15 | } else {
16 | res.json(ret)
17 | }
18 | }
19 |
20 | /* GET home page. */
21 |
22 | router.get('/', function (req, res, next) {
23 | pool.getConnection(function (err, connection) {
24 | var data = {}
25 | connection.query(syscusSql.queryAll, function (err, e) {
26 | if (e) {
27 | data.res = e
28 | }
29 | // 发送数据
30 | responseJSON(res, data)
31 | })
32 | // 断开数据库
33 | connection.release()
34 | })
35 | });
36 | router.get('/add', function (req, res, next) {
37 | var params = req.query || req.params
38 | var limit='false';
39 | var addSqlParams =[JSON.parse(params.admin).cusid,JSON.parse(params.admin).name,limit]
40 | console.error(JSON.parse(params.admin));
41 | pool.getConnection(function (err, connection) {
42 | var data = {}
43 | connection.query(syscusSql.insert,addSqlParams,function (err, e) {
44 | if (err) {
45 | console.log('[INSERT ERROR] - ', err.message);
46 | return;
47 | }
48 | })
49 | connection.query(syscusSql.queryAll, function (err, e) {
50 | if (e) {
51 | data.res = e
52 | }
53 | // 发送数据
54 | responseJSON(res, data)
55 | })
56 | // 断开数据库
57 | connection.release()
58 | })
59 | });
60 | router.get('/subtract', function (req, res, next) {
61 | var params = req.query || req.params
62 | var cusid = params.cusid
63 | pool.getConnection(function (err, connection) {
64 | var data = {}
65 |
66 | connection.query(`DELETE FROM syscus where CUSID='${cusid}'`, function (err, e) {
67 | if (err) {
68 | console.log('[DELETE ERROR] - ', err.message);
69 | return;
70 | }
71 | });
72 | var data = {}
73 | connection.query(syscusSql.queryAll, function (err, e) {
74 | if (e) {
75 | data.res = e
76 | }
77 | // 发送数据
78 | responseJSON(res, data)
79 | })
80 | // 断开数据库
81 | connection.release()
82 | })
83 | });
84 |
85 | router.get('/foodlist', function (req, res, next) {
86 | pool.getConnection(function (err, connection) {
87 | var data = []
88 | connection.query(menuSql.queryGoodsTypeAll, function (err, e) {
89 | if (e) {
90 | // console.log(e)
91 | }
92 | // 发送数据
93 | responseJSON(res, data)
94 | })
95 | // 断开数据库
96 | connection.release()
97 | })
98 | });
99 | module.exports = router;
--------------------------------------------------------------------------------
/mhzqx小程序/pages/login/login.wxss:
--------------------------------------------------------------------------------
1 | /* client/pages/login.wxss */
2 |
3 | page {
4 | min-height: 100%;
5 | display: flex;
6 | flex-direction: column;
7 | justify-content: center;
8 | padding: 0;
9 | margin: 0;
10 | }
11 |
12 | .loading-box {
13 | display: flex;
14 | flex-direction: column;
15 | justify-content: center;
16 | align-items: center;
17 | }
18 |
19 | .loading-img {
20 | /* height: 100%; */
21 | }
22 |
23 | .container {
24 | display: flex;
25 | flex-direction: column;
26 | justify-content: stretch;
27 | align-items: center;
28 | overflow: hidden;
29 | }
30 |
31 | .logo-img {
32 | width: 200rpx;
33 | height: 200rpx;
34 | }
35 |
36 | .content {
37 | display: flex;
38 | flex-direction: column;
39 | justify-content: stretch;
40 | align-items: center;
41 | transform: translate3d(0, 100%, 0);
42 | animation: rise 3s cubic-bezier(0.19, 1, 0.22, 1) 0.25s forwards;
43 | /* padding: 100rpx 0; */
44 | opacity: 0;
45 | }
46 |
47 | @keyframes rise {
48 | 0% {
49 | opacity: 0;
50 | transform: translate3d(0, 100%, 0);
51 | }
52 |
53 | 50% {
54 | opacity: 1;
55 | }
56 |
57 | 100% {
58 | opacity: 1;
59 | transform: translate3d(0, 0rpx, 0);
60 | }
61 | }
62 | .show-img {
63 | width: 400rpx;
64 | height: 400rpx;
65 | }
66 | .avatar {
67 | width: 125rpx;
68 | height: 125rpx;
69 | border-radius: 50%;
70 | border: 1rpx solid #fff;
71 | box-shadow: 3rpx 3rpx 10rpx rgba(0, 0, 0, 0.2);
72 | overflow: hidden;
73 | margin-bottom: 50rpx;
74 | z-index: 2;
75 | animation: sway 10s ease-in-out infinite;
76 | }
77 |
78 | @keyframes sway {
79 | 0% {
80 | transform: translate3d(0, 20rpx, 0) rotate(-15deg);
81 | }
82 |
83 | 17% {
84 | transform: translate3d(0, 0rpx, 0) rotate(25deg);
85 | }
86 |
87 | 34% {
88 | transform: translate3d(0, -20rpx, 0) rotate(-20deg);
89 | }
90 |
91 | 50% {
92 | transform: translate3d(0, -10rpx, 0) rotate(15deg);
93 | }
94 |
95 | 67% {
96 | transform: translate3d(0, 10rpx, 0) rotate(-25deg);
97 | }
98 |
99 | 84% {
100 | transform: translate3d(0, 15rpx, 0) rotate(15deg);
101 | }
102 |
103 | 100% {
104 | transform: translate3d(0, 20rpx, 0) rotate(-15deg);
105 | }
106 | }
107 |
108 | .wave-img {
109 | height: 400rpx;
110 | width: 500rpx;
111 | margin-top: -100rpx;
112 | border-radius: 20%;
113 | box-shadow: 5rpx 5rpx slategrey;
114 | margin-bottom:100rpx;
115 |
116 | }
117 |
118 |
119 | /* .offline-img{
120 | opacity: 0.8;
121 | width: 30rpx;
122 | height: 30rpx;
123 | }
124 | .offline-text
125 | {
126 | font-size: 35rpx;
127 | color:#FFBE79 ;
128 | } */
129 | .click-btn{
130 | font-size:35rpx;
131 | text-align: center;
132 | opacity: 0.8;
133 | width: 400rpx;
134 | height: 80rpx;
135 | }
136 |
137 | .click-btn:active {
138 | opacity: 0.5;
139 | }
140 |
141 | .copyright {
142 | margin-top: 60rpx;
143 | font-size: 25rpx;
144 | opacity: 0.8;
145 | }
146 | .weui-btn-area
147 | {
148 | margin:0;
149 | z-index: 2;
150 | }
151 | .admim-text
152 | {
153 | font-size: 25rpx;
154 | color: red;
155 | margin-top: 10rpx;
156 | }
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-cell/weui-form.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-cell_input{padding-top:0;padding-bottom:0}.weui-label{width:105px;word-wrap:break-word;word-break:break-all}.weui-input{height:2.58823529em;min-height:2.58823529em;line-height:2.58823529em}.weui-toptips{position:fixed;-webkit-transform:translateZ(0);transform:translateZ(0);top:0;left:0;right:0;padding:5px;font-size:14px;text-align:center;color:#fff;z-index:5000;word-wrap:break-word;word-break:break-all}.weui-toptips_warn{background-color:#e64340}.weui-textarea{display:block;width:100%}.weui-textarea-counter{color:#b2b2b2;text-align:right}.weui-cell_warn,.weui-textarea-counter_warn{color:#e64340}.weui-form-preview{position:relative;background-color:#fff}.weui-form-preview:before{top:0;border-top:1rpx solid #d9d9d9}.weui-form-preview:after,.weui-form-preview:before{content:" ";position:absolute;left:0;right:0;height:1px;color:#d9d9d9}.weui-form-preview:after{bottom:0;border-bottom:1rpx solid #d9d9d9}.weui-form-preview__value{font-size:14px}.weui-form-preview__value_in-hd{font-size:26px}.weui-form-preview__hd{position:relative;padding:10px 15px;text-align:right;line-height:2.5em}.weui-form-preview__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid #d9d9d9;color:#d9d9d9;left:15px}.weui-form-preview__bd{padding:10px 15px;font-size:.9em;text-align:right;color:#999;line-height:2}.weui-form-preview__ft{position:relative;line-height:50px;display:-webkit-box;display:-webkit-flex;display:flex}.weui-form-preview__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid #d5d5d6;color:#d5d5d6}.weui-form-preview__item{overflow:hidden}.weui-form-preview__label{float:left;margin-right:1em;min-width:4em;color:#999;text-align:justify;text-align-last:justify}.weui-form-preview__value{display:block;overflow:hidden;word-break:normal;word-wrap:break-word}.weui-form-preview__btn{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#3cc51f;text-align:center}.weui-form-preview__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #d5d5d6;color:#d5d5d6}.weui-form-preview__btn:first-child:after{display:none}.weui-form-preview__btn_active{background-color:#eee}.weui-form-preview__btn_default{color:#999}.weui-form-preview__btn_primary{color:#0bb20c}.weui-cell_select{padding:0}.weui-select{position:relative;padding-left:15px;padding-right:30px;height:2.58823529em;min-height:2.58823529em;line-height:2.58823529em;border-right:1rpx solid #d9d9d9}.weui-select:before{content:" ";display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8cd;border-style:solid;-webkit-transform:matrix(.71,.71,-.71,.71,0,0);transform:matrix(.71,.71,-.71,.71,0,0);position:relative;top:-2px;position:absolute;top:50%;right:15px;margin-top:-4px}.weui-select_in-select-after{padding-left:0}.weui-cell__bd_in-select-before,.weui-cell__hd_in-select-after{padding-left:15px}.weui-cell_vcode{padding-right:0}.weui-vcode-btn,.weui-vcode-img{margin-left:5px;height:2.58823529em;vertical-align:middle}.weui-vcode-btn{display:inline-block;padding:0 .6em 0 .7em;border-left:1px solid #e5e5e5;line-height:2.58823529em;font-size:17px;color:#3cc51f;white-space:nowrap}.weui-vcode-btn:active{color:#52a341}
--------------------------------------------------------------------------------
/mhzqx小程序/pages/info/info.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{foodinfo.gname}}
6 | {{foodinfo.gprice}}¥/份儿
7 |
8 | 相关推荐
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | 详细信息:
23 |
24 |
25 | 食材主要成分
26 | {{foodinfo.ginfo.component}}
27 |
28 |
29 | 食材提供
30 | {{foodinfo.ginfo.supplier}}
31 |
32 |
33 | 菜品描述
34 | {{foodinfo.ginfo.describe}}
35 |
36 |
37 |
38 |
39 |
40 | 用户评价
41 | {{foodinfo.gremark}}条评论
42 |
43 |
44 |
45 | 图片真实度
46 |
47 |
48 |
49 |
50 |
51 | 90%
52 |
53 |
54 | 分量满意度
55 |
56 |
57 |
58 |
59 |
60 | 70%
61 |
62 |
63 | 食材新鲜度
64 |
65 |
66 |
67 |
68 |
69 | 100%
70 |
71 |
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/mhzqx小程序/app.js:
--------------------------------------------------------------------------------
1 | //app.js
2 | App({
3 | onLaunch: function () {
4 | var that = this
5 | // 展示本地存储能力
6 | var logs = wx.getStorageSync('logs') || []
7 | logs.unshift(Date.now())
8 | wx.setStorageSync('logs', logs)
9 | var accountInfo = wx.getAccountInfoSync();
10 | this.globalData.appid = accountInfo.miniProgram.appId
11 | wx.getSetting({
12 | success (res){
13 | if (res.authSetting['scope.userInfo']) {
14 | // 已经授权,可以直接调用 getUserInfo 获取头像昵称
15 | wx.getUserInfo({
16 | success: function(res) {
17 | that.globalData.userInfo = res.userInfo
18 | }
19 | })
20 | wx.navigateTo({
21 | url: '../login/login'
22 | })
23 | }
24 | }
25 | })
26 | },
27 | getOpenId: function () {
28 | var that = this
29 | return new Promise(function(resolve, reject) {
30 | wx.login({
31 | success: res => {
32 | wx.request({
33 | url: that.globalData.serveraddr + '/customer/getopenid',
34 | data: {
35 | code: res.code,
36 | appid: that.globalData.appid
37 | },
38 | success: res => {
39 | if (res.statusCode == 200) {
40 | that.globalData.openid = res.data.openid
41 | }else {
42 | console.log('获取用户登录态失败!' + res.errMsg)
43 | }
44 | if (that.globalData.openid) {
45 | wx.request({
46 | url: that.globalData.serveraddr + '/customer/login',
47 | //data是需要传递到后端的两个参数,参数名称需要和Customer类中的属性名一致
48 | data: "nickname=" + that.globalData.userInfo.nickName + "&openid=" + that.globalData.openid,
49 | method: "POST",
50 | header: {
51 | "Content-Type": "application/x-www-form-urlencoded"
52 | },
53 | success: r => {
54 | //如果r.data>0,那么说明登录注册成功,那么需要跳转到菜单页面。否则说明登录注册失败,那么应该给客户一个提示
55 | if (r.data.result.code == 200) {
56 | //成功,后续逻辑:判断用户是否有正在处理的订单,如果有,那么跳转到订单页面;如果没有跳转到菜单页面。
57 | that.globalData.limit = r.data.result.limit;
58 | that.globalData.cusid = r.data.result.cusid
59 | that.globalData.isHaveOrder = r.data.result.isHaveOrder
60 | that.globalData.isLogin = true
61 | if (r.data.result.isAdmin) {
62 | that.globalData.isAdmin = true
63 | }
64 | resolve(that.globalData)
65 | }else {
66 | //失败
67 | wx.showModal({
68 | title: '提示',
69 | content: '用戶获取失败'
70 | })
71 | reject('error')
72 | }
73 | }
74 | })
75 | }
76 | }
77 | })
78 | }
79 | })
80 | })
81 | },
82 | // 其他界面监听app.globalData,而不是在app.js中监听,而且这个监听方法,需要一个回调方法。
83 | watch: function (method) {
84 | var obj = this.globalData;
85 | Object.defineProperty(obj, "isAdmin", {
86 | configurable: true,
87 | enumerable: true,
88 | set: function (value) {
89 | this._isAdmin = value;
90 | method(value);
91 | },
92 | get: function () {
93 | // 可以在这里打印一些东西,然后在其他界面调用getApp().globalData.isAdmin的时候,这里就会执行。
94 | return this._isAdmin
95 | }
96 | })
97 | },
98 | globalData: {
99 | userInfo: {},
100 | openid: null,
101 | isLogin: false,
102 | isAdmin: false,
103 | serveraddr: "http://127.0.0.1:3000",
104 | cusid: null,
105 | isHaveOrder: false,
106 | limit: false,
107 | appid: null
108 | }
109 | })
--------------------------------------------------------------------------------
/mhzqx小程序/style/widget/weui-loading/weui-loading.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .weui-loading{margin:0 5px;width:20px;height:20px;display:inline-block;vertical-align:middle;-webkit-animation:a 1s steps(12) infinite;animation:a 1s steps(12) infinite;background:transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;background-size:100%}.weui-loading.weui-loading_transparent{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect xmlns='http://www.w3.org/2000/svg' width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.56)' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.5)' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.43)' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.38)' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.32)' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.28)' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.25)' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.2)' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.17)' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.14)' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.1)' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.03)' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E")}@-webkit-keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}
--------------------------------------------------------------------------------
/mhzqxNODE后台/routes/customer.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var router = express.Router();
3 | var request = require('request')
4 | var mysql = require('mysql')
5 | var dbConfig = require('../db/dbConfig')
6 | var uuid = require('node-uuid')
7 | var customerSql = require('../db/customerSql')
8 | var syscusSql = require('../db/syscusSql')
9 | var orderSql = require('../db/orderSql')
10 |
11 | var pool = mysql.createPool(dbConfig.mysql)
12 | var responseJSON = function (res, ret) {
13 | if (typeof ret === 'undefined') {
14 | res.json({
15 | code: '-200',
16 | msg: '操作失败'
17 | })
18 | } else {
19 | res.json(ret)
20 | }
21 | }
22 |
23 | /* 获取openid //请修改下面的
24 | * appid=wxc449411fab1b45b8(我的微信小程序的id,已设置成自动获取不需要改)
25 | * secret=645cc9ba8cf29fc5fa683047e3ed859(每个人的密钥,需要到微信小程序平台中去获取,然后在下方标注处改一下)
26 | * js_code:小程序传递过来的code属性
27 | */
28 | router.get('/getopenid', function(req, res, next) {
29 | var param = req.query || req.params
30 | var code = param.code
31 | var appid = param.appid
32 | var secret = 'ac315c60023c6e7eab97d49b55f831b8' //请自主修改自己的小程序secret ,使用的是测试号去https://developers.weixin.qq.com/miniprogram/dev/devtools/sandbox.html登陆查询
33 | var wx_url = 'https://api.weixin.qq.com/sns/jscode2session?appid='+ appid +'&secret=' + secret + '&js_code='
34 | + code + '&grant_type=authorization_code'
35 | request(wx_url, function (error, response, body) {
36 | var data = {}
37 | if (!error && response.statusCode === 200) {
38 | var reqData = JSON.parse(body)
39 | data.openid = reqData.openid
40 | data.result = {
41 | code: 200,
42 | msg: '授权成功'
43 | }
44 | } else {
45 | data.result = {
46 | code: -1,
47 | msg: '授权失败'
48 | }
49 | }
50 | responseJSON(res, data)
51 | })
52 | });
53 |
54 | router.post('/login', function (req, res) {
55 | pool.getConnection(function (err, connection) {
56 | var param = req.body
57 | console.log(param)
58 | var nickname = param.nickname
59 | var openid = param.openid
60 | var _res = res
61 | var syscusid = ''
62 | var myCusid = ''
63 | var limit = false
64 | connection.query(customerSql.queryAll, function (err, res) {
65 | var data = {}
66 | var isAdmin = false
67 | var isHaveOrder = false
68 | if (res) {
69 | var isHave = false
70 | for (let i = 0; i < res.length; i++) {
71 | if (res[i].OPENID == openid) {
72 | isHave = true
73 | syscusid = res[i].CUSID
74 | myCusid = res[i].CUSID
75 | }
76 | }
77 | if (!isHave) {
78 | var cusid = uuid.v4()
79 | myCusid = cusid
80 | connection.query(customerSql.insert, [cusid, openid, nickname], function (err, result) {
81 | if (result) {
82 | data.result = {
83 | code: 200,
84 | msg: '成功注册',
85 | isAdmin: isAdmin
86 | }
87 | } else {
88 | data.result = {
89 | code: -1,
90 | msg: '数据库注册失败'
91 | }
92 | }
93 | })
94 | } else {
95 | connection.query(orderSql.selectCusOrder + `'${myCusid}'`, function (err, res) {
96 | if (res) {
97 | if (res.length > 0) {
98 | isHaveOrder = true
99 | }
100 | }
101 | })
102 | connection.query(syscusSql.queryAll, function (err, res) {
103 | if (res) {
104 | for (let i = 0; i < res.length; i++) {
105 | if (res[i].CUSID == syscusid) {
106 | isAdmin = true
107 | limit = res[i].LIMITS
108 | }
109 | }
110 | }
111 | })
112 | setTimeout(() => {
113 | data.result = {
114 | code: 200,
115 | msg: '已注冊',
116 | isAdmin: isAdmin,
117 | cusid: myCusid,
118 | isHaveOrder: isHaveOrder,
119 | limit: limit
120 | }
121 | }, 300)
122 | }
123 | }
124 | if (err) {
125 | data.err = err
126 | }
127 | // 以JSON格式返回操作结果给前台
128 | setTimeout(() => {
129 | responseJSON(_res, data)
130 | }, 300)
131 | connection.release()
132 | })
133 | })
134 | })
135 |
136 | module.exports = router;
--------------------------------------------------------------------------------
/mhzqxNODE后台/db/hah.json:
--------------------------------------------------------------------------------
1 | {
2 | "gtlist": [
3 | {
4 | "gt": {
5 | "gtid": "1",
6 | "gtname": "鲁菜",
7 | "gtstate": 1
8 | },
9 | "goodslist": [
10 | {
11 | "gid": "16ab609e-9bcf-4877-ab4e-f312716a0daa",
12 | "gtid": "1",
13 | "gname": "爆炒牛肉干",
14 | "gprice": 60,
15 | "gstate": 1,
16 | "gimg": "hc2.png",
17 | "gtime": 30,
18 | "gcontent": "小炒",
19 | "gcount": 0
20 | },
21 | {
22 | "gid": "2055204c-ed46-4ba1-890a-fd69f10353d8",
23 | "gtid": "1",
24 | "gname": "清蒸鲈鱼",
25 | "gprice": 50,
26 | "gstate": 1,
27 | "gimg": "ec3.png",
28 | "gtime": 40,
29 | "gcontent": "小炒",
30 | "gcount": 0
31 | },
32 | {
33 | "gid": "28d9150f-bf28-4580-a3f6-86d9bb7d691a",
34 | "gtid": "1",
35 | "gname": "糖醋鲤鱼",
36 | "gprice": 36,
37 | "gstate": 1,
38 | "gimg": "lc1.png",
39 | "gtime": 20,
40 | "gcontent": "小炒",
41 | "gcount": 0
42 | },
43 | {
44 | "gid": "29b516a9-184c-4978-a89c-7bec2de3b3fb",
45 | "gtid": "1",
46 | "gname": "九转大肠",
47 | "gprice": 40,
48 | "gstate": 1,
49 | "gimg": "lc2.png",
50 | "gtime": 30,
51 | "gcontent": "小炒",
52 | "gcount": 0
53 | },
54 | ]
55 | },
56 | {
57 | "gt": {
58 | "gtid": "2",
59 | "gtname": "川菜",
60 | "gtstate": 1
61 | },
62 | "goodslist": [
63 | {
64 | "gid": "41b7eb5d-aa61-4559-8865-2ce7907f785f",
65 | "gtid": "2",
66 | "gname": "东坡肉",
67 | "gprice": 35,
68 | "gstate": 1,
69 | "gimg": "cc3.png",
70 | "gtime": 30,
71 | "gcontent": "清蒸\r\n周六供应",
72 | "gcount": 0
73 | },
74 | {
75 | "gid": "72374eee-c5a5-4b54-b007-7ce5e7ffbb0e",
76 | "gtid": "2",
77 | "gname": "肝腰合炒",
78 | "gprice": 30,
79 | "gstate": 1,
80 | "gimg": "cc1.png",
81 | "gtime": 20,
82 | "gcontent": "小炒\r\n周日供应",
83 | "gcount": 0
84 | },
85 | {
86 | "gid": "89e8ec77-8820-48c1-9d4e-f001f093ff93",
87 | "gtid": "2",
88 | "gname": "糖醋排骨",
89 | "gprice": 30,
90 | "gstate": 1,
91 | "gimg": "cc2.png",
92 | "gtime": 30,
93 | "gcontent": "小炒\r\n周一至周六",
94 | "gcount": 0
95 | }
96 | ]
97 | },
98 | {
99 | "gt": {
100 | "gtid": "3",
101 | "gtname": "粤菜",
102 | "gtstate": 1
103 | },
104 | "goodslist": [
105 | {
106 | "gid": "4b9363b7-a4f8-4329-8024-b53386cf4ddc",
107 | "gtid": "3",
108 | "gname": "白灼基围虾",
109 | "gprice": 50,
110 | "gstate": 1,
111 | "gimg": "ec1.png",
112 | "gtime": 30,
113 | "gcontent": "小炒",
114 | "gcount": 0
115 | },
116 | {
117 | "gid": "b5abfe9e-4bfb-427f-ba86-594662b2216b",
118 | "gtid": "3",
119 | "gname": "白切鸡",
120 | "gprice": 28,
121 | "gstate": 1,
122 | "gimg": "ec2.png",
123 | "gtime": 30,
124 | "gcontent": "小炒",
125 | "gcount": 0
126 | },
127 | {
128 | "gid": "d5646197-83c5-459e-85f9-f69e4207e52a",
129 | "gtid": "3",
130 | "gname": "糖醋里脊",
131 | "gprice": 38,
132 | "gstate": 1,
133 | "gimg": "lc3.png",
134 | "gtime": 20,
135 | "gcontent": "小炒\r\n周一至周六供应",
136 | "gcount": 0
137 | }
138 | ]
139 | },
140 | {
141 | "gt": {
142 | "gtid": "4",
143 | "gtname": "徽菜",
144 | "gtstate": 1
145 | },
146 | "goodslist": [
147 | {
148 | "gid": "58d9a28f-8746-492b-9f25-bcbe440ed636",
149 | "gtid": "4",
150 | "gname": "蛋黄豆腐",
151 | "gprice": 20,
152 | "gstate": 1,
153 | "gimg": "hc1.png",
154 | "gtime": 20,
155 | "gcontent": "小炒",
156 | "gcount": 0
157 | },
158 | {
159 | "gid": "c0202b2c-fd97-47b3-83af-57f0db868939",
160 | "gtid": "4",
161 | "gname": "拔丝芋头",
162 | "gprice": 19,
163 | "gstate": 1,
164 | "gimg": "hc3.png",
165 | "gtime": 15,
166 | "gcontent": "小炒",
167 | "gcount": 0
168 | }
169 | ]
170 | }
171 | ]
172 | }
--------------------------------------------------------------------------------
/mhzqx小程序/pages/menu/menu.wxss:
--------------------------------------------------------------------------------
1 | /* client/pages/menu/menu.wxss */
2 |
3 | page, .page, .page__bd {
4 | height: 100%;
5 | padding: 0;
6 | margin: 0;
7 | font-size: 30rpx;
8 | animation: fade 0.5s cubic-bezier(0.19, 1, 0.22, 1) 0.25s forwards;
9 | opacity: 0;
10 | }
11 |
12 | @keyframes fade {
13 | 0% {
14 | opacity: 0;
15 | }
16 |
17 | 50% {
18 | opacity: 0.4;
19 | }
20 |
21 | 100% {
22 | opacity: 1;
23 | }
24 | }
25 |
26 | .container {
27 | margin-bottom: 200rpx;
28 | }
29 |
30 | .page__bd {
31 | padding-bottom: 0;
32 | width: 100%;
33 | }
34 |
35 | .page-head-box {
36 | position: fixed;
37 | top: 100rpx;
38 | display: flex;
39 | flex-direction: row;
40 | justify-items: center;
41 | align-items: center;
42 | }
43 |
44 | .weui-navbar {
45 | position: fixed;
46 | top: 0;
47 | z-index: 2;
48 | background-color: white;
49 | }
50 |
51 | .head-img {
52 | height: 300rpx;
53 | width: 300rpx;
54 | }
55 |
56 | .wel-title {
57 | text-align: center;
58 | margin-top: 10rpx;
59 | }
60 |
61 | .weui-tab__content {
62 | margin-top: 300rpx;
63 | background-color: rgb(255, 251, 245);
64 | transform: translate3d(0, 100%, 0);
65 | animation: rise 1s cubic-bezier(0.19, 1, 0.22, 1) 0.25s forwards;
66 | opacity: 0;
67 | box-shadow: -5rpx -5rpx 3rpx 3rpx rgb(243, 240, 240);
68 | }
69 |
70 | @keyframes rise {
71 | 0% {
72 | opacity: 0;
73 | transform: translate3d(0, 100%, 0);
74 | }
75 |
76 | 50% {
77 | opacity: 1;
78 | }
79 |
80 | 100% {
81 | opacity: 1;
82 | transform: translate3d(0, 0rpx, 0);
83 | }
84 | }
85 |
86 | .weui-tab__content {
87 | text-align: center;
88 | }
89 |
90 | .list-box {
91 | box-sizing: border-box;
92 | width: 100%;
93 | padding: 20rpx;
94 | border-bottom: 1px solid rgba(177, 175, 175, 0.3);
95 | }
96 |
97 | .list-item-box {
98 | display: flex;
99 | flex-direction: row;
100 | justify-content: space-between;
101 | }
102 |
103 | .item-img {
104 | width: 150rpx;
105 | height: 150rpx;
106 | margin: 30rpx;
107 | }
108 |
109 | .item-info-box {
110 | display: flex;
111 | flex-direction: column;
112 | align-items: flex-start;
113 | width: 40%;
114 | }
115 |
116 | .item-name {
117 | font-weight: 700;
118 | }
119 |
120 | .item-type {
121 | opacity: 0.5;
122 | font-size: 25rpx;
123 | color: black;
124 | font-style: normal;
125 | }
126 |
127 | .item-price {
128 | font-style: oblique;
129 | color: rgb(199, 25, 25);
130 | }
131 |
132 | .gtime-tex {
133 | opacity: 0.8;
134 | }
135 |
136 | .item-choise-box {
137 | display: flex;
138 | flex-direction: row;
139 | justify-content: flex-end;
140 | align-items: flex-end;
141 | }
142 |
143 | .item-icon-box {
144 | display: flex;
145 | flex-direction: row;
146 | align-items: center;
147 | }
148 |
149 | .choise-icon-subtract {
150 | height: 35rpx;
151 | width: 35rpx;
152 | padding: 10rpx;
153 | border-radius: 50%;
154 | background-color: rgba(177, 175, 175, 0.3);
155 | }
156 |
157 | .choise-icon-add {
158 | height: 35rpx;
159 | width: 35rpx;
160 | padding: 10rpx;
161 | border-radius: 50%;
162 | background-color: rgb(255, 238, 0);
163 | }
164 |
165 | .choise-icon :active {
166 | opacity: 0.8;
167 | }
168 |
169 | .chosie-num {
170 | margin: 0 10rpx;
171 | }
172 |
173 | /* 底部 */
174 |
175 | .page-bottom {
176 | display: flex;
177 | flex-direction: column;
178 | margin: 0;
179 | position: fixed;
180 | bottom: 20rpx;
181 | width: 90%;
182 | }
183 |
184 | .bottom-img-box {
185 | display: flex;
186 | flex-direction: row;
187 | justify-content: start;
188 | align-items: stretch;
189 | }
190 |
191 | .bottom-img {
192 | margin-bottom: -30rpx;
193 | }
194 |
195 | .bottom-badge {
196 | margin-left: -40rpx;
197 | height: 40rpx;
198 | width: 40rpx;
199 | background-color: red;
200 | border-radius: 50%;
201 | color: white;
202 | font-weight: 700;
203 | font-size: 30rpx;
204 | text-align: center;
205 | z-index: 2;
206 | }
207 |
208 | .container-bottom-box {
209 | display: flex;
210 | flex-direction: row;
211 | text-align: center;
212 | box-shadow: 5rpx 5rpx rgb(141, 140, 140);
213 | border-radius: 50rpx;
214 | overflow: hidden;
215 | z-index: 2;
216 | }
217 |
218 | .container-bottom-l {
219 | width: 60%;
220 | color: white;
221 | padding: 20rpx 0;
222 | background-color: rgb(68, 66, 66);
223 | }
224 |
225 | .container-bottom-r {
226 | width: 40%;
227 | background-color: rgb(255, 238, 0);
228 | padding: 20rpx;
229 | font-weight: 700;
230 | opacity: 0.8;
231 | }
232 |
233 | .bottom-text {
234 | font-size: small;
235 | }
236 |
237 | .bottom-img {
238 | bottom: 20rpx;
239 | left: 25rpx;
240 | width: 150rpx;
241 | height: 150rpx;
242 | z-index: 2;
243 | }
244 |
--------------------------------------------------------------------------------
/mhzqx小程序/pages/severmenu/severmenu.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{item}}
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | 编号:{{item.orderid}}
21 |
22 |
23 | ¥{{item.orderTotlePrice}}
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | {{datalist[dataindex].gt.GTNAME}}
39 |
40 |
41 |
42 |
43 | {{item.GNAME}}
44 | {{item.GCONTENT}}
45 | {{item.GPRICE}}
46 | /1份
47 |
48 | 原价:
49 | {{item.GPRICE}}
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 | {{item.NICKNAME}}
68 |
69 |
70 |
71 |
72 | 新管理员账号 :
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 | 您没有权限
83 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/mhzqx小程序/pages/info/info.js:
--------------------------------------------------------------------------------
1 | // client/pages/info/info.js
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 | foodinfo: {
9 | "gid": "89e8ec77-8820-48c1-9d4e-f001f093ff93",
10 | "gtid": "1",
11 | "gname": "饭团",
12 | "gprice": 30,
13 | "gstate": 1,
14 | "gimg": "food6.png",
15 | "gtime": 30,
16 | "gcontent": "周一至周六\n\n",
17 | "gcount": 0,
18 | "gremark": 233,
19 | "ginfo": {
20 | component: "优质大米",
21 | supplier: "买买提超级市场大米直销",
22 | describe: "这是一份儿非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常香的米饭,嗯,真香。"
23 | }
24 | },
25 | swiperCurrent: 0,
26 | indicatorDots: true,
27 | autoplay: true,
28 | interval: 3000,
29 | duration: 800,
30 | circular: true,
31 |
32 | contactList: [{
33 | // 菜品id
34 | "gid": "72374eee-c5a5-4b54-b007-7ce5e7ffbb0e",
35 | // 菜品种类
36 | "gtid": "1",
37 | // 菜品名
38 | "gname": "烤串儿",
39 | // 价格
40 | "gprice": 30,
41 | // "gstate": 1,
42 | // 图片
43 | "gimg": "food4.png",
44 | // 原价
45 | "gtime": 20,
46 | // 描述
47 | "gcontent": "周日供应\n\n",
48 | // 菜品数量
49 | "gcount": 0,
50 | // 评论数
51 | "gremark": 233,
52 | // 详细信息
53 | "ginfo": {
54 | // 原材料
55 | component: "优质羊肉",
56 | // 供应商
57 | supplier: "买买提超级市场羊肉直销",
58 | // 详细描述
59 | describe: "这是一份儿非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常香的烤串,嗯,真香。"
60 | },
61 | }, {
62 | "gid": "89e8ec77-8820-48c1-9d4e-f001f093ff93",
63 | "gtid": "1",
64 | "gname": "饭团",
65 | "gprice": 30,
66 | "gstate": 1,
67 | "gimg": "food6.png",
68 | "gtime": 30,
69 | "gcontent": "周一至周六\n\n",
70 | "gcount": 0,
71 | "gremark": 233,
72 | "ginfo": {
73 | component: "优质大米",
74 | supplier: "买买提超级市场大米直销",
75 | describe: "这是一份儿非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常香的米饭,嗯,真香。"
76 | }
77 | },
78 | {
79 | "gid": "2055204c-ed46-4ba1-890a-fd69f10353d8",
80 | "gtid": "1",
81 | "gname": "面条",
82 | "gprice": 50,
83 | "gstate": 1,
84 | "gimg": "food7.png",
85 | "gtime": 40,
86 | "gcontent": "周一至周六\n\n",
87 | "gcount": 0,
88 | "gremark": 233,
89 | "ginfo": {
90 | component: "优质面粉",
91 | supplier: "买买提超级市场面粉直销",
92 | describe: "这是一份儿非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常香的面条,嗯,真香。"
93 | }
94 | },
95 | {
96 | "gid": "4b9363b7-a4f8-4329-8024-b53386cf4ddc",
97 | "gtid": "3",
98 | "gname": "咖啡",
99 | "gprice": 50,
100 | "gstate": 1,
101 | "gimg": "food3.png",
102 | "gtime": 30,
103 | "gcontent": "周三到周五供应\n\n",
104 | "gcount": 0,
105 | "gremark": 233,
106 | "ginfo": {
107 | component: "优质咖啡豆",
108 | supplier: "买买提超级市场咖啡直销",
109 | describe: "这是一份儿非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常香的咖啡,嗯,真香。"
110 | }
111 | }
112 | ]
113 | },
114 |
115 | /**
116 | * 生命周期函数--监听页面加载
117 | */
118 | onLoad: function(e) {
119 | this.setData({
120 | foodinfo: JSON.parse(e.foodinfo)
121 | })
122 | },
123 |
124 | /**
125 | * 生命周期函数--监听页面初次渲染完成
126 | */
127 | onReady: function() {
128 |
129 | },
130 |
131 | /**
132 | * 生命周期函数--监听页面显示
133 | */
134 | onShow: function() {
135 |
136 | },
137 |
138 | /**
139 | * 生命周期函数--监听页面隐藏
140 | */
141 | onHide: function() {
142 |
143 | },
144 |
145 | /**
146 | * 生命周期函数--监听页面卸载
147 | */
148 | onUnload: function() {
149 |
150 | },
151 |
152 | /**
153 | * 页面相关事件处理函数--监听用户下拉动作
154 | */
155 | onPullDownRefresh: function() {
156 |
157 | },
158 |
159 | /**
160 | * 页面上拉触底事件的处理函数
161 | */
162 | onReachBottom: function() {
163 |
164 | },
165 |
166 | /**
167 | * 用户点击右上角分享
168 | */
169 | onShareAppMessage: function() {
170 |
171 | },
172 | //轮播图的切换事件
173 |
174 | swiperChange: function(e) {
175 | this.setData({
176 | swiperCurrent: e.detail.current
177 |
178 | })
179 |
180 | },
181 | goinfo: function(e) {
182 | var contact = this.data.contactList;
183 | for (var i = 0; i < contact.length;i++)
184 | {
185 | if (e.currentTarget.dataset.gid == contact[i].gid)
186 | {
187 | var food = contact[i];
188 | contact.splice(i,1,this.data.foodinfo);
189 | this.setData({
190 | foodinfo: food,
191 | contactList:contact
192 | })
193 | }
194 | console.log(this.data.contactList);
195 | }
196 | },
197 | //点击指示点切换
198 | chuangEvent: function(e) {
199 | this.setData({
200 | swiperCurrent: e.currentTarget.id
201 | })
202 | },
203 | })
--------------------------------------------------------------------------------
/mhzqx小程序/pages/menu/menu.js:
--------------------------------------------------------------------------------
1 | // client/pages/menu/menu.js
2 | var app = getApp();
3 | var sliderWidth = 96; // 需要设置slider的宽度,用于计算中间位置
4 | var foodList = [];
5 | // var myData=[{id:1,name:"菜"},{id:2,name:"肉"}];
6 | Page({
7 |
8 | /**
9 | * 页面的初始数据
10 | */
11 | data: {
12 | tabs: [],
13 | activeIndex: 0,
14 | sliderOffset: 0,
15 | sliderLeft: 0,
16 | foodNum: 0,
17 | sumprice: 0,
18 | psumprice: 0,
19 | mydata: [],
20 | myfoodList: [],
21 | // user: {
22 | // sumPrice: sumprice,
23 | // foodName: [],
24 | // },
25 | serveraddr: app.globalData.serveraddr
26 | },
27 |
28 | /**
29 | * 生命周期函数--监听页面加载
30 | */
31 | onLoad: function() {
32 | var that = this;
33 | // console.log(foodList);
34 | wx.request({
35 | url: app.globalData.serveraddr + '/menu',
36 | success: res => {
37 | // console.log(res.data)
38 | var gtList = []
39 | // 取数据
40 | for (var i = 0; i < res.data.gtlist.length; i++) {
41 | gtList.push(res.data.gtlist[i].gt);
42 | }
43 | this.setData({
44 | tabs: gtList,
45 | mydata: res.data.gtlist
46 | })
47 | wx.getSystemInfo({
48 | success: function (res) {
49 | that.setData({
50 | sliderLeft: (res.windowWidth / that.data.tabs.length - sliderWidth) / 2,
51 | sliderOffset: res.windowWidth / that.data.tabs.length * that.data.activeIndex
52 | });
53 | }
54 | });
55 | }
56 | })
57 | },
58 | tabClick: function(e) {
59 | this.setData({
60 | sliderOffset: e.currentTarget.offsetLeft,
61 | activeIndex: e.currentTarget.id
62 | });
63 | },
64 |
65 | /**
66 | * 生命周期函数--监听页面初次渲染完成
67 | */
68 | onReady: function() {
69 |
70 | },
71 |
72 | /**
73 | * 生命周期函数--监听页面显示
74 | */
75 | onShow: function() {
76 |
77 | },
78 |
79 | /**
80 | * 生命周期函数--监听页面隐藏
81 | */
82 | onHide: function() {
83 |
84 | },
85 |
86 | /**
87 | * 生命周期函数--监听页面卸载
88 | */
89 | onUnload: function() {
90 |
91 | },
92 |
93 | /**
94 | * 页面相关事件处理函数--监听用户下拉动作
95 | */
96 | onPullDownRefresh: function() {
97 |
98 | },
99 |
100 | /**
101 | * 页面上拉触底事件的处理函数
102 | */
103 | onReachBottom: function() {
104 |
105 | },
106 |
107 | /**
108 | * 用户点击右上角分享
109 | */
110 | onShareAppMessage: function() {
111 |
112 | },
113 |
114 | // 自定义函数
115 |
116 | // 购物出加
117 | add: function(e) {
118 | var list = this.data.mydata;
119 | for (var i = 0; i < list.length; i++) {
120 | if (list[i].gt.gtid == e.currentTarget.dataset.gtid) {
121 | var glist = list[i].goodslist
122 | for (var j = 0; j < glist.length; j++) {
123 | if (glist[j].gid == e.currentTarget.dataset.gid) {
124 | glist[j].gcount += 1;
125 | var sumnum = this.data.foodNum + 1;
126 | var sum = this.data.sumprice + e.currentTarget.dataset.gprice;
127 | var psum = this.data.psumprice + e.currentTarget.dataset.gtime;
128 | this.setData({
129 | mydata: list,
130 | foodNum: sumnum,
131 | sumprice: sum,
132 | psumprice: sum,
133 | })
134 | }
135 | }
136 | }
137 | }
138 | },
139 | subtract: function(e) {
140 | var list = this.data.mydata;
141 | for (var i = 0; i < list.length; i++) {
142 | if (list[i].gt.gtid == e.currentTarget.dataset.gtid) {
143 | var glist = list[i].goodslist
144 | for (var j = 0; j < glist.length; j++) {
145 | if (glist[j].gid == e.currentTarget.dataset.gid) {
146 | if (glist[j].gcount > 0) {
147 | glist[j].gcount -= 1;
148 | var sumnum = this.data.foodNum - 1;
149 | var sum = this.data.sumprice - e.currentTarget.dataset.gprice;
150 | var psum = this.data.psumprice - e.currentTarget.dataset.gtime;
151 | this.setData({
152 | mydata: list,
153 | foodNum: sumnum,
154 | sumprice: sum,
155 | psumprice: psum,
156 | })
157 | }
158 | }
159 | }
160 | }
161 | }
162 | },
163 | goinfo: function(e) {
164 |
165 | var list = this.data.mydata;
166 | for (var i = 0; i < list.length; i++) {
167 | if (list[i].gt.gtid == e.currentTarget.dataset.gtid) {
168 | var glist = list[i].goodslist
169 | for (var j = 0; j < glist.length; j++) {
170 | if (glist[j].gid == e.currentTarget.dataset.gid) {
171 | wx.navigateTo({
172 | url: '../info/info?foodinfo=' + JSON.stringify(glist[j])
173 | })
174 | }
175 | }
176 | }
177 | }
178 | },
179 | pay: function() {
180 | var foodlist = new Array();
181 | for (var i = 0; i < this.data.mydata.length; i++) {
182 | for (var j = 0; j < this.data.mydata[i].goodslist.length; j++) {
183 | if (this.data.mydata[i].goodslist[j].gcount > 0) {
184 | foodlist.push(this.data.mydata[i].goodslist[j])
185 | }
186 | }
187 | }
188 | this.setData({
189 | myfoodList: foodlist
190 | })
191 | console.log(this.data.myfoodList)
192 | wx.navigateTo({
193 | url: '../usermenu/usermenu?foodslist=' + JSON.stringify(this.data.myfoodList)
194 | })
195 | },
196 | })
--------------------------------------------------------------------------------
/mhzqx小程序/pages/severalertfood/severalertfood.js:
--------------------------------------------------------------------------------
1 | // pages/severalertfood/severalertfood.js
2 | var app = getApp();
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | foodinfo: {},
10 | typeinfo: {
11 | "gtid": "1",
12 | "gtname": "主食",
13 | checked: false,
14 | },
15 | radioItems: [{
16 | name: '主食',
17 | value: '0',
18 | checked: false,
19 | },
20 | {
21 | name: '水果',
22 | value: '1',
23 | checked: false,
24 | },
25 | {
26 | name: '甜点',
27 | value: '2',
28 | checked: false,
29 | }
30 | ],
31 | files: [],
32 | newtypename: null,
33 | moreflag: false,
34 | },
35 |
36 | /**
37 | * 生命周期函数--监听页面加载
38 | */
39 | onLoad: function (e) {
40 | console.log(e.foodinfo)
41 | this.setData({
42 | foodinfo: JSON.parse(e.foodinfo)
43 | })
44 | this.setData({
45 | files: `${app.globalData.serveraddr}/images/${this.data.foodinfo.GIMG}`
46 | })
47 | console.log(this.data.files)
48 | this.data.radioItems[this.data.foodinfo.GTID - 1].checked = true;
49 | this.setData({
50 | radioItems: this.data.radioItems
51 | })
52 | var radioItems = []
53 | wx.request({
54 | url: app.globalData.serveraddr + '/foodadmin/getGoodType',
55 | success: res => {
56 | for (let i = 0; i < res.data.goodstypes.length; i++) {
57 | var items = {}
58 | items.name = res.data.goodstypes[i].GTNAME
59 | items.value = res.data.goodstypes[i].GTID - 1
60 | if (res.data.goodstypes[i].GTID == 1) {
61 | items.checked = true
62 | } else {
63 | items.checked = false
64 | }
65 | radioItems.push(items)
66 | }
67 | this.setData({
68 | radioItems: radioItems
69 | })
70 | }
71 | })
72 | },
73 |
74 | /**
75 | * 生命周期函数--监听页面初次渲染完成
76 | */
77 | onReady: function () {
78 |
79 | },
80 |
81 | /**
82 | * 生命周期函数--监听页面显示
83 | */
84 | onShow: function () {
85 |
86 | },
87 |
88 | /**
89 | * 生命周期函数--监听页面隐藏
90 | */
91 | onHide: function () {
92 |
93 | },
94 |
95 | /**
96 | * 生命周期函数--监听页面卸载
97 | */
98 | onUnload: function () {
99 |
100 | },
101 | // 自定义函数
102 | radioChange: function (e) {
103 | var radioItems = this.data.radioItems;
104 | for (var i = 0, len = radioItems.length; i < len; ++i) {
105 | radioItems[i].checked = radioItems[i].value == e.detail.value;
106 | }
107 | this.setData({
108 | radioItems: radioItems
109 | });
110 | },
111 | addmore: function () {
112 | this.setData({
113 | moreflag: true
114 | });
115 | },
116 | submitmore: function (e) {
117 | this.setData({
118 | newtypename: e.detail.value.typename
119 | });
120 | var newtype = {
121 | name: "",
122 | value: '',
123 | checked: true
124 | };
125 |
126 | wx.request({
127 | url: app.globalData.serveraddr + '/foodadmin/addGoodType',
128 | data: {
129 | newtypename: e.detail.value.typename,
130 | gtid: this.data.radioItems.length + 1
131 | },
132 | success: res => {
133 | console.log(res)
134 | }
135 | })
136 |
137 | newtype.value = this.data.radioItems.length.toString();
138 | this.data.typeinfo.gtid = this.data.radioItems.length.toString();
139 | newtype.name = this.data.newtypename;
140 | this.data.typeinfo.gtname = this.data.newtypename;
141 | for (var i = 0; i < this.data.radioItems.length; i++) {
142 | this.data.radioItems[i].checked = false;
143 | }
144 | this.data.radioItems.push(newtype);
145 | this.setData({
146 | radioItems: this.data.radioItems,
147 | moreflag: false,
148 | typeinfo: this.data.typeinfo,
149 | });
150 | console.log(newtype, this.data.radioItems);
151 | },
152 | chooseImage: function (e) {
153 | var that = this;
154 | console.log(this.data.files);
155 | this.setData({
156 | files: [],
157 | });
158 | wx.chooseImage({
159 | sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
160 | sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
161 | success: function (res) {
162 | // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
163 | that.setData({
164 | files: that.data.files.concat(res.tempFilePaths)
165 | });
166 | },
167 | });
168 | },
169 | submit: function (e) {
170 | if (e.detail.value.foodname != '')
171 | this.data.foodinfo.GNAME = e.detail.value.foodname;
172 | if (e.detail.value.foodprice != '') {
173 | this.data.foodinfo.GPRICE = e.detail.value.foodprice;
174 | }
175 | if (e.detail.value.foodtime != '')
176 | this.data.foodinfo.GCONTENT = e.detail.value.foodtime;
177 | if (e.detail.value.fooddiscribe != '')
178 | this.data.foodinfo.GINFO = e.detail.value.fooddiscribe;
179 | // this.data.foodinfo.GIMG = this.data.files;
180 | for (var i = 0; i < this.data.radioItems.length; i++) {
181 | if (this.data.radioItems[i].checked == true)
182 | this.data.foodinfo.GTID = i + 1;
183 | }
184 | this.setData({
185 | foodinfo: this.data.foodinfo,
186 | });
187 |
188 | wx.request({
189 | url: app.globalData.serveraddr + '/foodadmin/alert',
190 | data: {
191 | foodinfo: this.data.foodinfo,
192 | },
193 | success: res => {
194 | console.log(res)
195 | if (res.data.result.code == 200) {
196 | wx.showToast({
197 | title: '提交成功',
198 | icon: 'success',
199 | duration: 1000
200 | });
201 | wx.reLaunch({
202 | url: '../severmenu/severmenu'
203 | })
204 | } else {
205 | wx.showToast({
206 | title: '提交失败',
207 | icon: 'none',
208 | duration: 1000
209 | });
210 | }
211 | }
212 | })
213 | // wx.showToast({
214 | // title: '上传中',
215 | // icon: 'loading',
216 | // duration: 3000
217 | // });
218 | }
219 | })
--------------------------------------------------------------------------------
/mhzqx小程序/pages/menu/menu.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | {{item.gt.gtname}}
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | 满汉子,满30元送扎啤~
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | {{item.gname}}
28 | {{item.gcontent}}
29 | {{item.gprice}}
30 | /1份
31 |
32 | 原价:
33 | {{item.gprice}}
34 |
35 |
36 |
37 |
38 |
39 | {{item.gcount}}
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | {{item.gname}}
53 | {{item.gcontent}}
54 | {{item.gprice}}
55 | /1份
56 |
57 | 原价:
58 | {{item.gprice}}
59 |
60 |
61 |
62 |
63 |
64 | {{item.gcount}}
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | {{item.gname}}
77 | {{item.gcontent}}
78 | {{item.gprice}}
79 | /1份
80 |
81 | 原价:
82 | {{item.gprice}}
83 |
84 |
85 |
86 |
87 |
88 | {{item.gcount}}
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 | {{foodNum}}
102 |
103 |
104 | 总计:{{sumprice}} 原价:
105 | {{psumprice}}
106 | 未点单
107 | 点好了
108 |
109 |
110 |
111 |
--------------------------------------------------------------------------------
/mhzqxNODE后台/routes/order.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var router = express.Router();
3 | var dbConfig = require('../db/dbConfig')
4 | var uuid = require('node-uuid')
5 | var orderSql = require('../db/orderSql')
6 | var mysql = require('mysql')
7 |
8 | var pool = mysql.createPool(dbConfig.mysql)
9 | var responseJSON = function (res, ret) {
10 | if (typeof ret === 'undefined') {
11 | res.json({
12 | code: '-200',
13 | msg: '操作失败'
14 | })
15 | } else {
16 | res.json(ret)
17 | }
18 | }
19 | var insertOrderDetail = function (i, connection, data, orderid, foodlist) {
20 | connection.query(orderSql.insertOrderDetail, [foodlist[i].gid, orderid, foodlist[i].gname, foodlist[i].gcount, foodlist[i].gprice, foodlist[i].gtime], function (err, result) {
21 | if (result) {
22 | data.result = {
23 | goodscode: 200,
24 | goodsmsg: '订单商品添加成功'
25 | }
26 | } else {
27 | data.result = {
28 | goodscode: -1,
29 | goodsmsg: '订单商品添加失败'
30 | }
31 | }
32 | if (err) {
33 | console.log(err)
34 | }
35 | })
36 | }
37 |
38 | var allGoods = []
39 |
40 | var queryOrderDetail = function (connection, orderid) {
41 | var orderDetail = []
42 | connection.query(orderSql.selectOrderDetail + `'${orderid}'`, function (err, res) {
43 | if (res) {
44 | for (let i = 0; i < res.length; i++) {
45 | orderDetail.push(res[i])
46 | }
47 | }
48 | allGoods.push(orderDetail)
49 | })
50 | }
51 |
52 | /* GET home page. */
53 | router.post('/', function(req, res) {
54 | pool.getConnection((err, connection) => {
55 | var params = req.body
56 | var foodlist = JSON.parse(params.foodlist)
57 | var mycusid = params.cusid
58 | var orderid = uuid.v1()
59 | var cusorders = {}
60 | var totlePrice = 0
61 | var orderTotleTime = 0
62 | var data = {}
63 | var _res = res
64 | for (let i = 0; i < foodlist.length; i++) {
65 | totlePrice += foodlist[i].gprice*foodlist[i].gcount
66 | orderTotleTime += foodlist[i].gtime*foodlist[i].gcount
67 | insertOrderDetail(i, connection, data, orderid, foodlist)
68 | }
69 | cusorders.ORDERID = orderid
70 | cusorders.CUSID = mycusid
71 | cusorders.ORDERTIME = orderTotleTime
72 | cusorders.ORDERSTATE = 1
73 | cusorders.ORDERTOTLEPRICE = totlePrice
74 |
75 | connection.query(orderSql.insertCusOrder, [cusorders.ORDERID, cusorders.CUSID, cusorders.ORDERTIME, cusorders.ORDERSTATE, cusorders.ORDERTOTLEPRICE], function (err, result) {
76 | if (result) {
77 | data.result = {
78 | code: 200,
79 | msg: '订单添加成功'
80 | }
81 | } else {
82 | data.result = {
83 | code: -1,
84 | msg: '订单添加失败'
85 | }
86 | }
87 | responseJSON(_res, data)
88 | connection.release()
89 | })
90 | })
91 | });
92 |
93 | router.get('/getOrders', function(req, res) {
94 | pool.getConnection((err, connection) => {
95 | var params = req.query || req.params
96 | var cusid = params.cusid
97 | var data = {}
98 | var timeTotle = 0
99 | var order = []
100 | var overOrder = []
101 | var _res = res
102 | connection.query(orderSql.queryAllOverOrder, function (err, res) {
103 | if (res) {
104 | for (let i = 0; i < res.length; i++) {
105 | if (cusid = res[i].CUSID) {
106 | overOrder.push(res[i])
107 | }
108 | }
109 | data.overOrder = overOrder
110 | }
111 | })
112 | connection.query(orderSql.queryAllCusOrder, function (err, res) {
113 | if (res) {
114 | for (let i = 0; i < res.length; i++) {
115 | timeTotle += res[i].ORDERTIME
116 | res[i].ORDERTIME = timeTotle
117 | }
118 | for (let i = 0; i < res.length; i++) {
119 | if (cusid = res[i].CUSID) {
120 | res[i].orderSort = i + 1
121 | order.push(res[i])
122 | queryOrderDetail(connection, res[i].ORDERID)
123 | }
124 | }
125 | data.order = order
126 | setTimeout(() => {
127 | data.orderDetailAll = allGoods
128 | allGoods = []
129 | }, 300)
130 | }
131 | setTimeout(() => {
132 | responseJSON(_res, data)
133 | }, 300)
134 | connection.release()
135 | })
136 | })
137 | });
138 |
139 | router.get('/getOrderAdmin', function(req, res) {
140 | pool.getConnection(function (err, connection) {
141 | var cusOrderArr = []
142 | var data = {}
143 | var _res = res
144 | connection.query(orderSql.queryAllCusOrder, function (err, res) {
145 | if (res) {
146 | for (let i = 0; i < res.length; i++) {
147 | var cusOrder = {}
148 | cusOrder.orderid = res[i].ORDERID
149 | cusOrder.cusid = res[i].CUSID
150 | cusOrder.orderTotlePrice = res[i].ORDERTOTLEPRICE
151 | cusOrderArr.push(cusOrder)
152 | // connection.query(orderSql.selectOrderDetail + `'${res[i].ORDERID}'`, function (params) {
153 |
154 | // })
155 | }
156 | data.cusOrderArr = cusOrderArr
157 | }
158 | responseJSON(_res, data)
159 | })
160 | })
161 | });
162 |
163 | router.get('/orderAdminCancel', function(req, res) {
164 | var params = req.query || req.params
165 | var orderid = params.orderid
166 | var data = {}
167 | var _res = res
168 | pool.getConnection(function (err, connection) {
169 | connection.query(orderSql.deleteCusOrder + `'${orderid}'`, function (err, results) {
170 | if (results) {
171 | data.result = {
172 | code: 200,
173 | msg: '订单取消成功'
174 | }
175 | }else {
176 | data.result = {
177 | code: -1,
178 | msg: '订单取消错误'
179 | }
180 | }
181 | responseJSON(_res, data)
182 | connection.release()
183 | })
184 | })
185 | });
186 |
187 | router.get('/orderAdminOver', function(req, res) {
188 | var params = req.query || req.params
189 | var orderid = params.orderid
190 | var order = {}
191 | var data = {}
192 | var _res = res
193 | pool.getConnection(function (err, connection) {
194 | connection.query(orderSql.selectCusOrderOrderId + `'${orderid}'`, function (err, res) {
195 | if (res) {
196 | order = res[0]
197 | connection.query(orderSql.insertOverOrder,[order.ORDERID, order.CUSID, order.ORDERTIME, 3, order.ORDERTOTLEPRICE],function (err, result) {
198 | if (result) {
199 | connection.query(orderSql.deleteCusOrder + `'${orderid}'`, function (err, results) {
200 | if (results) {
201 | console.log('添加成功')
202 | data.result = {
203 | code: 200,
204 | msg: '订单完成'
205 | }
206 | }else {
207 | data.result = {
208 | code: -1,
209 | msg: '订单完成错误'
210 | }
211 | }
212 | responseJSON(_res, data)
213 | connection.release()
214 | })
215 | }
216 | })
217 | }
218 | })
219 | })
220 | });
221 |
222 |
223 | module.exports = router;
224 |
--------------------------------------------------------------------------------
/mhzqx小程序/pages/severmenu/severmenu.js:
--------------------------------------------------------------------------------
1 | // client/pages/menu/menu.js
2 | var sliderWidth = 96; // 需要设置slider的宽度,用于计算中间位置
3 | var app = getApp();
4 | Page({
5 |
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | // 导航栏
11 | tabs: ["订单管理", "菜品管理", "人员管理"],
12 | activeIndex: 1,
13 | sliderOffset: 0,
14 | sliderLeft: 0,
15 | // 卡片一订单
16 | orderlist: [],
17 | // 卡片二菜单
18 | datalist: [],
19 | serveraddr: '',
20 | // 人员管理
21 | adminlist: [],
22 | addflag: false,
23 | limitflag: false,
24 | },
25 | /**
26 | * 生命周期函数--监听页面加载
27 | */
28 | onLoad: function () {
29 | var that = this;
30 | // 微信发送接收数据
31 | wx.request({
32 | url: app.globalData.serveraddr + '/admin',
33 | data: {},
34 | success: res => {
35 | that.setData({
36 | adminlist: res.data.res
37 | })
38 | }
39 | })
40 | wx.request({
41 | url: app.globalData.serveraddr + '/foodadmin',
42 | data: {},
43 | success: res => {
44 | this.setData({
45 | datalist: res.data
46 | })
47 | }
48 | })
49 | this.setData({
50 | limitflag: app.globalData.limit,
51 | serveraddr: app.globalData.serveraddr,
52 | });
53 | wx.getSystemInfo({
54 | success: function (res) {
55 | that.setData({
56 | sliderLeft: (res.windowWidth / that.data.tabs.length - sliderWidth) / 2,
57 | sliderOffset: res.windowWidth / that.data.tabs.length * that.data.activeIndex
58 | });
59 | }
60 | });
61 | wx.request({
62 | url: app.globalData.serveraddr + '/order/getOrderAdmin',
63 | success: res => {
64 | console.log(res)
65 | this.setData({
66 | orderlist: res.data.cusOrderArr
67 | })
68 | }
69 | })
70 | },
71 | /**
72 | * 生命周期函数--监听页面初次渲染完成
73 | */
74 | onReady: function () {
75 |
76 | },
77 |
78 | /**
79 | * 生命周期函数--监听页面显示
80 | */
81 | onShow: function () {
82 |
83 | },
84 |
85 | /**
86 | * 生命周期函数--监听页面隐藏
87 | */
88 | onHide: function () {
89 |
90 | },
91 |
92 | /**
93 | * 生命周期函数--监听页面卸载
94 | */
95 | onUnload: function () {
96 |
97 | },
98 |
99 | /**
100 | * 页面相关事件处理函数--监听用户下拉动作
101 | */
102 | onPullDownRefresh: function () {
103 |
104 | },
105 |
106 | /**
107 | * 页面上拉触底事件的处理函数
108 | */
109 | onReachBottom: function () {
110 |
111 | },
112 |
113 | /**
114 | * 用户点击右上角分享
115 | */
116 | onShareAppMessage: function () {
117 |
118 | },
119 |
120 | // 自定义函数
121 | // 导航栏
122 | tabClick: function (e) {
123 | this.setData({
124 | sliderOffset: e.currentTarget.offsetLeft,
125 | activeIndex: e.currentTarget.id
126 | });
127 | },
128 | // 卡片二 菜单管理
129 | gotouser: function () {
130 | wx.navigateTo({
131 | url: '../menu/menu',
132 | })
133 | },
134 | open: function () {
135 | wx.navigateTo({
136 | url: '../severaddfood/severaddfood',
137 | })
138 | },
139 | alertfood: function (e) {
140 | var list = this.data.datalist;
141 | for (var i = 0; i < list.length; i++) {
142 | if (list[i].gt.GTID == e.currentTarget.dataset.gtid) {
143 | var glist = list[i].goodslist
144 | for (var j = 0; j < glist.length; j++) {
145 | if (glist[j].GID == e.currentTarget.dataset.gid) {
146 | wx.navigateTo({
147 | url: '../severalertfood/severalertfood?foodinfo=' + JSON.stringify(glist[j])
148 | })
149 | }
150 | }
151 | }
152 | }
153 | },
154 | goinfo: function (e) {
155 | var list = this.data.datalist;
156 | for (var i = 0; i < list.length; i++) {
157 | if (list[i].gt.GTID == e.currentTarget.dataset.gtid) {
158 | var glist = list[i].goodslist
159 | for (var j = 0; j < glist.length; j++) {
160 | if (glist[j].GID == e.currentTarget.dataset.gid) {
161 | wx.navigateTo({
162 | url: '../severinfo/severinfo?foodinfo=' + JSON.stringify(glist[j])
163 | })
164 | }
165 | }
166 | }
167 | }
168 | },
169 | // 卡片三管理员
170 | submitadd: function (e) {
171 | var admin = {
172 | cusid: '',
173 | name: '',
174 | }
175 | admin.cusid = e.detail.value.id;
176 | admin.name = '位管理员:' + e.detail.value.id;
177 | wx.request({
178 | url: app.globalData.serveraddr + '/admin/add',
179 | data: {
180 | admin: admin,
181 | },
182 | success: res => {
183 | this.setData({
184 | adminlist: res.data.res,
185 | addflag: false,
186 | })
187 | console.log(res.data.res);
188 | }
189 | })
190 |
191 | },
192 | subtract: function (e) {
193 | console.log(e.target.dataset.id)
194 | wx.request({
195 | url: app.globalData.serveraddr + '/admin/subtract',
196 | data: {
197 | cusid: e.target.dataset.id,
198 | },
199 | success: res => {
200 | this.setData({
201 | adminlist: res.data.res
202 | })
203 | console.log(res.data.res);
204 | }
205 | })
206 | },
207 | add: function () {
208 | this.setData({
209 | addflag: true
210 | })
211 | },
212 | // 卡片一
213 | cancel: function (e) {
214 | console.log(e.target.dataset.id)
215 | wx.request({
216 | url: app.globalData.serveraddr + '/order/orderAdminCancel',
217 | data: {
218 | orderid: e.target.dataset.id,
219 | },
220 | success: res => {
221 | if (res.data.result.code == 200) {
222 | wx.showToast({
223 | title: '订单已取消',
224 | icon: 'success',
225 | duration: 2000
226 | })
227 | wx.request({
228 | url: app.globalData.serveraddr + '/order/getOrderAdmin',
229 | success: res => {
230 | console.log(res)
231 | this.setData({
232 | orderlist: res.data.cusOrderArr
233 | })
234 | }
235 | })
236 | } else {
237 | wx.showToast({
238 | title: '订单取消错误',
239 | icon: 'none',
240 | duration: 2000
241 | })
242 | }
243 | }
244 | })
245 | },
246 | over: function (e) {
247 | console.log(e.target.dataset.id)
248 | wx.request({
249 | url: app.globalData.serveraddr + '/order/orderAdminOver',
250 | data: {
251 | orderid: e.target.dataset.id,
252 | },
253 | success: res => {
254 | if (res.data.result.code == 200) {
255 | wx.showToast({
256 | title: '订单已完成',
257 | icon: 'success',
258 | duration: 2000
259 | })
260 | wx.request({
261 | url: app.globalData.serveraddr + '/order/getOrderAdmin',
262 | success: res => {
263 | console.log(res)
264 | this.setData({
265 | orderlist: res.data.cusOrderArr
266 | })
267 | }
268 | })
269 | } else {
270 | wx.showToast({
271 | title: '订单完成错误',
272 | icon: 'none',
273 | duration: 2000
274 | })
275 | }
276 | }
277 | })
278 | },
279 | })
--------------------------------------------------------------------------------
/mhzqxNODE后台/routes/foodadmin.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var router = express.Router();
3 | var mysql = require('mysql');
4 | var menuSql = require("../db/menuSql")
5 | var dbConfig = require('../db/dbConfig')
6 | var uuid = require('node-uuid')
7 | var formidable = require("formidable")
8 | var path = require("path")
9 | var fs = require("fs")
10 |
11 |
12 | var pool = mysql.createPool(dbConfig.mysql)
13 | var responseJSON = function (res, ret) {
14 | if (typeof ret === 'undefined') {
15 | res.json({
16 | code: '-200',
17 | msg: '操作失败'
18 | })
19 | } else {
20 | res.json(ret)
21 | }
22 | }
23 |
24 | /* GET home page. */
25 |
26 | router.get('/', function (req, res, next) {
27 | pool.getConnection(function (err, connection) {
28 | var datalist = [];
29 | var data = {};
30 | var goodslist = [];
31 | var typelist;
32 | var foodslist;
33 | connection.query(menuSql.queryGoodsTypeAll, function (err, e) {
34 | if (e) {
35 | typelist = e;
36 | }
37 | })
38 | connection.query(menuSql.queryGoodsAll, function (err, e) {
39 | if (e) {
40 | foodslist = e;
41 | }
42 | for (var i = 0; i < typelist.length; i++) {
43 | data.gt = typelist[i];
44 | // console.log(data.gt)
45 | for (var j = 0; j < foodslist.length; j++) {
46 | if (typelist[i].GTID == foodslist[j].GTID) {
47 | goodslist.push(foodslist[j]);
48 | }
49 | }
50 | data.goodslist = goodslist;
51 | goodslist = [];
52 | // console.log(data.goodslist)
53 | datalist.push(data);
54 | data = {};
55 | }
56 | // console.log(datalist[0].goodslist);
57 | // 发送数据
58 | responseJSON(res, datalist)
59 | })
60 |
61 | // 断开数据库
62 | connection.release()
63 | })
64 | });
65 | router.get('/uninstall', function (req, res, next) {
66 | var params = req.query || req.params
67 | var data = {}
68 | var _res = res
69 | pool.getConnection(function (err, connection) {
70 | connection.query(`DELETE FROM goods where GID='${params.foodinfo}'`, function (err, e) {
71 | if (e) {
72 | data.result = {
73 | code: 200,
74 | msg: '下架成功'
75 | }
76 | } else {
77 | data.result = {
78 | code: -1,
79 | msg: '下架失败'
80 | }
81 | }
82 | responseJSON(_res, data)
83 | // 断开数据库
84 | connection.release()
85 | })
86 | })
87 | });
88 | router.get('/alert', function (req, res, next) {
89 | var params = req.query || req.params
90 | var foodinfo = JSON.parse(params.foodinfo);
91 | var data = {}
92 | var _res = res
93 | pool.getConnection(function (err, connection) {
94 | var modSql = `UPDATE goods SET GTID='${foodinfo.GTID}',GNAME='${foodinfo.GNAME}',GPRICE=${foodinfo.GPRICE},GCONTENT='${foodinfo.GCONTENT}',GCOUNT=${foodinfo.GCOUNT},GINFO='${foodinfo.GINFO}' WHERE GID='${foodinfo.GID}'`
95 | console.log(modSql)
96 | connection.query(modSql, function (err, result) {
97 | if (result) {
98 | data.result = {
99 | code: 200,
100 | msg: '修改成功'
101 | }
102 | } else {
103 | data.result = {
104 | code: -1,
105 | msg: '修改失败'
106 | }
107 | }
108 | responseJSON(_res, data)
109 | });
110 | connection.release()
111 | })
112 | });
113 |
114 | router.get('/getGoodType', function (req, res, next) {
115 | var data = {}
116 | var _res = res
117 | pool.getConnection(function (err, connection) {
118 | connection.query(menuSql.queryGoodsTypeAll, function (err, res) {
119 | if (res) {
120 | data.goodstypes = res
121 | }
122 | responseJSON(_res, data)
123 | });
124 | connection.release()
125 | })
126 | });
127 |
128 | router.get('/addGoodType', function (req, res, next) {
129 | var params = req.query || req.params
130 | var gtname = params.newtypename
131 | var gtid = params.gtid
132 | var data = {}
133 | var _res = res
134 | pool.getConnection(function (err, connection) {
135 | connection.query(menuSql.insertGoodsType, [gtid, gtname, 1], function (err, result) {
136 | if (result) {
137 | data.result = {
138 | code: 200,
139 | msg: '添加成功'
140 | }
141 | } else {
142 | data.result = {
143 | code: -1,
144 | msg: '添加失败'
145 | }
146 | }
147 | responseJSON(_res, data)
148 | });
149 | connection.release()
150 | })
151 | });
152 |
153 | var imgGid = ''
154 | router.get('/addGoods', function (req, res, next) {
155 | var params = req.query || req.params
156 | var foodinfo = JSON.parse(params.foodinfo);
157 | var data = {}
158 | var _res = res
159 | var gid = uuid.v4()
160 | imgGid = gid
161 | pool.getConnection(function (err, connection) {
162 | connection.query(menuSql.insertGoods, [gid, foodinfo.gtid, foodinfo.gname, 1, parseInt(foodinfo.gprice), foodinfo.gcontent, 'food1.png', 5, 0, foodinfo.ginfo], function (err, result) {
163 | if (result) {
164 | data.result = {
165 | code: 200,
166 | msg: '添加成功'
167 | }
168 | } else {
169 | data.result = {
170 | code: -1,
171 | msg: '添加失败'
172 | }
173 | }
174 | responseJSON(_res, data)
175 | });
176 | connection.release()
177 | })
178 | });
179 |
180 | router.post('/addGoodsImg', function (req, res, next) {
181 | var params = req.query || req.params
182 | var imgName = ''
183 | var form = new formidable.IncomingForm()//既处理表单,又处理文件上传
184 |
185 | //设置文件上传文件夹/路径,__dirname是一个常量,为当前路径
186 | let uploadDir = path.join(__dirname, "../public/images")
187 | form.uploadDir = uploadDir;//本地文件夹目录路径
188 |
189 | form.parse(req, (err, fields, files) => {
190 |
191 | let oldPath = files.fileImg.path; //这里的路径是图片的本地路径
192 | //图片传过来的名字
193 | let newPath = path.join(path.dirname(oldPath), files.fileImg.name);
194 | imgName = files.fileImg.name
195 | //这里我传回一个下载此图片的Url
196 | var downUrl = "http://localhost:3000/images/" + files.fileImg.name;//这里是想传回图片的链接
197 | fs.rename(oldPath, newPath, () => {//fs.rename重命名图片名称
198 | console.log('图片成功')
199 | })
200 | pool.getConnection(function (err, connection) {
201 | var modSql = `UPDATE goods SET GIMG='${imgName}' WHERE GID='${imgGid}'`
202 | connection.query(modSql, function (err, result) {
203 | if (result) {
204 | console.log('图片名字修改成功')
205 | imgName = ''
206 | }
207 | });
208 | connection.release()
209 | })
210 | })
211 |
212 | });
213 |
214 | module.exports = router;
--------------------------------------------------------------------------------
/mhzqx小程序/pages/severaddfood/severaddfood.js:
--------------------------------------------------------------------------------
1 | // pages/severaddfood/severaddfood.js
2 | var app = getApp()
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | foodinfo: {},
10 | typeinfo: {
11 | "gtid": "1",
12 | "gtname": "主食",
13 | },
14 | radioItems: [{
15 | name: '主食',
16 | value: '0'
17 | },
18 | {
19 | name: '水果',
20 | value: '1',
21 | },
22 | {
23 | name: '甜点',
24 | value: '2',
25 | }
26 | ],
27 | files: [],
28 | newtypename: null,
29 | moreflag: false,
30 | showTopTips: false,
31 | warning: "",
32 | },
33 |
34 | /**
35 | * 生命周期函数--监听页面加载
36 | */
37 | onLoad: function (options) {
38 | var radioItems = []
39 | wx.request({
40 | url: app.globalData.serveraddr + '/foodadmin/getGoodType',
41 | success: res => {
42 | for (let i = 0; i < res.data.goodstypes.length; i++) {
43 | var items = {}
44 | items.name = res.data.goodstypes[i].GTNAME
45 | items.value = res.data.goodstypes[i].GTID - 1
46 | if (res.data.goodstypes[i].GTID == 1) {
47 | items.checked = true
48 | } else {
49 | items.checked = false
50 | }
51 | radioItems.push(items)
52 | }
53 | this.setData({
54 | radioItems: radioItems
55 | })
56 | }
57 | })
58 | },
59 |
60 | /**
61 | * 生命周期函数--监听页面初次渲染完成
62 | */
63 | onReady: function () {
64 |
65 | },
66 |
67 | /**
68 | * 生命周期函数--监听页面显示
69 | */
70 | onShow: function () {
71 |
72 | },
73 |
74 | /**
75 | * 生命周期函数--监听页面隐藏
76 | */
77 | onHide: function () {
78 |
79 | },
80 |
81 | /**
82 | * 生命周期函数--监听页面卸载
83 | */
84 | onUnload: function () {
85 |
86 | },
87 |
88 | // 自定义函数
89 | radioChange: function (e) {
90 | var radioItems = this.data.radioItems;
91 | for (var i = 0, len = radioItems.length; i < len; ++i) {
92 | radioItems[i].checked = radioItems[i].value == e.detail.value;
93 | }
94 | this.setData({
95 | radioItems: radioItems
96 | });
97 | },
98 | addmore: function () {
99 | this.setData({
100 | moreflag: true
101 | });
102 | },
103 | submitmore: function (e) {
104 | this.setData({
105 | newtypename: e.detail.value.typename
106 | });
107 | wx.request({
108 | url: app.globalData.serveraddr + '/foodadmin/addGoodType',
109 | data: {
110 | newtypename: e.detail.value.typename,
111 | gtid: this.data.radioItems.length + 1
112 | },
113 | success: res => {
114 | console.log(res)
115 | }
116 | })
117 | var newtype = {
118 | name: "",
119 | value: '',
120 | checked: true
121 | };
122 |
123 | newtype.value = this.data.radioItems.length.toString();
124 | this.data.typeinfo.gtid = this.data.radioItems.length.toString();
125 | newtype.name = this.data.newtypename;
126 | this.data.typeinfo.gtname = this.data.newtypename;
127 | for (var i = 0; i < this.data.radioItems.length; i++) {
128 | this.data.radioItems[i].checked = false;
129 | }
130 | this.data.radioItems.push(newtype);
131 | this.setData({
132 | radioItems: this.data.radioItems,
133 | moreflag: false,
134 | typeinfo: this.data.typeinfo,
135 | });
136 | console.log(newtype, this.data.radioItems);
137 | },
138 | chooseImage: function (e) {
139 | var that = this;
140 | console.log(e);
141 | this.setData({
142 | files: [],
143 | });
144 | wx.chooseImage({
145 | sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
146 | sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
147 | success: function (res) {
148 | // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
149 | that.setData({
150 | files: that.data.files.concat(res.tempFilePaths)
151 | });
152 | },
153 | });
154 | },
155 | submit: function (e) {
156 | var that = this
157 |
158 | var warningflag = false;
159 | console.log(e.detail.value.foodname);
160 | if (e.detail.value.foodname == '') {
161 | this.setData({
162 | warning: "请输入菜品名称",
163 | })
164 | warningflag = true;
165 | } else {
166 | this.data.foodinfo.gname = e.detail.value.foodname;
167 | if (e.detail.value.foodprice == '') {
168 | this.setData({
169 | warning: "请输入价格",
170 | })
171 | warningflag = true;
172 | } else {
173 | this.data.foodinfo.gprice = e.detail.value.foodprice;
174 | this.data.foodinfo.goprice = e.detail.value.foodprice;
175 | if (e.detail.value.foodtime == '') {
176 | this.setData({
177 | warning: "请输入供应时段",
178 | })
179 | warningflag = true;
180 | } else {
181 | this.data.foodinfo.gcontent = e.detail.value.foodtime;
182 | if (e.detail.value.fooddiscribe == '') {
183 | this.setData({
184 | warning: "请输入供应时段",
185 | })
186 | warningflag = true;
187 | } else {
188 | this.data.foodinfo.ginfo = e.detail.value.fooddiscribe;
189 | if (this.data.files == '') {
190 | this.setData({
191 | warning: "请添加图片",
192 | })
193 | warningflag = true;
194 |
195 | }
196 | else {
197 | this.data.foodinfo.gimg = this.data.files;
198 | for (var i = 0; i < this.data.radioItems.length; i++) {
199 | if (this.data.radioItems[i].checked == true)
200 | this.data.foodinfo.gtid = i + 1;
201 | }
202 | }
203 | }
204 | }
205 | }
206 | }
207 | if (warningflag == true) {
208 | var that = this;
209 | this.setData({
210 | showTopTips: true
211 | });
212 | setTimeout(function () {
213 | that.setData({
214 | showTopTips: false
215 | });
216 | }, 3000);
217 | } else {
218 | wx.request({
219 | url: app.globalData.serveraddr + '/foodadmin/addGoods',
220 | data: {
221 | foodinfo: this.data.foodinfo,
222 | },
223 | success: res => {
224 | console.log(res)
225 | if (res.data.result.code == 200) {
226 | wx.showToast({
227 | title: '提交成功',
228 | icon: 'success',
229 | duration: 1000
230 | });
231 | wx.reLaunch({
232 | url: '../severmenu/severmenu'
233 | })
234 | } else {
235 | wx.showToast({
236 | title: '提交失败',
237 | icon: 'none',
238 | duration: 1000
239 | });
240 | }
241 | }
242 | })
243 | this.setData({
244 | foodinfo: this.data.foodinfo,
245 | });
246 | console.log(this.data.foodinfo);
247 | if (true) {
248 | console.log(this.data.foodinfo);
249 | wx.showToast({
250 | title: '提交成功',
251 | icon: 'success',
252 | duration: 1000
253 | });
254 | wx.reLaunch({
255 | url: '../severmenu/severmenu'
256 | })
257 | } else {
258 | wx.showToast({
259 | title: '上传中',
260 | icon: 'loading',
261 | duration: 3000
262 | });
263 | }
264 | }
265 |
266 | wx.uploadFile({
267 | url: app.globalData.serveraddr + '/foodadmin/addGoodsImg', //app.ai_api.File.file
268 | filePath: that.data.files[0], //文件路径 这里是mp3文件
269 | name: 'fileImg', //随意
270 | formData: {
271 | 'user': 'test'
272 | },
273 | success(res) {
274 | const data = res.data
275 | console.log(res)
276 | //do something
277 | }
278 | })
279 | },
280 |
281 | })
--------------------------------------------------------------------------------
/mhzqx.sql:
--------------------------------------------------------------------------------
1 | -- --------------------------------------------------------
2 | -- 主机: 127.0.0.1
3 | -- 服务器版本: 5.6.26 - MySQL Community Server (GPL)
4 | -- 服务器操作系统: Win32
5 | -- HeidiSQL 版本: 9.4.0.5125
6 | -- --------------------------------------------------------
7 |
8 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
9 | /*!40101 SET NAMES utf8 */;
10 | /*!50503 SET NAMES utf8mb4 */;
11 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
12 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
13 |
14 |
15 | -- 导出 mhzqx 的数据库结构
16 | CREATE DATABASE IF NOT EXISTS `mhzqx` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin */;
17 | USE `mhzqx`;
18 |
19 | -- 导出 表 mhzqx.cusorders 结构
20 | CREATE TABLE IF NOT EXISTS `cusorders` (
21 | `ORDERID` varchar(50) COLLATE utf8_bin NOT NULL,
22 | `CUSID` varchar(50) COLLATE utf8_bin DEFAULT NULL,
23 | `ORDERTIME` int(11) DEFAULT NULL,
24 | `ORDERSTATE` int(11) DEFAULT NULL COMMENT '0--临时\r\n 1--下单\r\n 2--正在处理\r\n 3--处理完成',
25 | `ORDERTOTLEPRICE` decimal(10,2) DEFAULT NULL,
26 | `ORDERNUM` int(10) unsigned zerofill NOT NULL AUTO_INCREMENT,
27 | PRIMARY KEY (`ORDERNUM`),
28 | KEY `FK_Relationship_5` (`CUSID`),
29 | CONSTRAINT `FK_Relationship_5` FOREIGN KEY (`CUSID`) REFERENCES `customer` (`CUSID`)
30 | ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
31 |
32 | -- 正在导出表 mhzqx.cusorders 的数据:~2 rows (大约)
33 | /*!40000 ALTER TABLE `cusorders` DISABLE KEYS */;
34 | INSERT INTO `cusorders` (`ORDERID`, `CUSID`, `ORDERTIME`, `ORDERSTATE`, `ORDERTOTLEPRICE`, `ORDERNUM`) VALUES
35 | ('0ca880f0-98ab-11e9-bbf5-5be13d8682cd', 'ca1f0540-5659-4809-8708-0be47bf33f18', 26, 1, 186.00, 0000000014);
36 | /*!40000 ALTER TABLE `cusorders` ENABLE KEYS */;
37 |
38 | -- 导出 表 mhzqx.customer 结构
39 | CREATE TABLE IF NOT EXISTS `customer` (
40 | `CUSID` varchar(50) COLLATE utf8_bin NOT NULL,
41 | `OPENID` varchar(50) COLLATE utf8_bin DEFAULT NULL,
42 | `NICKNAME` varchar(200) COLLATE utf8_bin DEFAULT NULL,
43 | PRIMARY KEY (`CUSID`)
44 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
45 |
46 | -- 正在导出表 mhzqx.customer 的数据:~1 rows (大约)
47 | /*!40000 ALTER TABLE `customer` DISABLE KEYS */;
48 | INSERT INTO `customer` (`CUSID`, `OPENID`, `NICKNAME`) VALUES
49 | ('ca1f0540-5659-4809-8708-0be47bf33f18', 'otfCH5OCSsiM1k_-7Lwy4puUBuYE', '飙');
50 | /*!40000 ALTER TABLE `customer` ENABLE KEYS */;
51 |
52 | -- 导出 表 mhzqx.goods 结构
53 | CREATE TABLE IF NOT EXISTS `goods` (
54 | `GID` varchar(50) COLLATE utf8_bin NOT NULL,
55 | `GTID` varchar(50) COLLATE utf8_bin DEFAULT NULL,
56 | `GNAME` varchar(100) COLLATE utf8_bin DEFAULT NULL,
57 | `GPRICE` decimal(10,2) DEFAULT NULL,
58 | `GSTATE` int(11) DEFAULT NULL,
59 | `GCONTENT` text COLLATE utf8_bin,
60 | `GIMG` varchar(200) COLLATE utf8_bin DEFAULT NULL,
61 | `GTIME` int(11) DEFAULT NULL COMMENT '需要时间(单位:分钟)',
62 | `GCOUNT` int(3) DEFAULT '0',
63 | `GINFO` varchar(50) COLLATE utf8_bin DEFAULT NULL,
64 | PRIMARY KEY (`GID`),
65 | KEY `FK_Relationship_4` (`GTID`),
66 | CONSTRAINT `FK_Relationship_4` FOREIGN KEY (`GTID`) REFERENCES `goodstype` (`GTID`)
67 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
68 |
69 | -- 正在导出表 mhzqx.goods 的数据:~6 rows (大约)
70 | /*!40000 ALTER TABLE `goods` DISABLE KEYS */;
71 | INSERT INTO `goods` (`GID`, `GTID`, `GNAME`, `GPRICE`, `GSTATE`, `GCONTENT`, `GIMG`, `GTIME`, `GCOUNT`, `GINFO`) VALUES
72 | ('3018da52-6fa4-4ad8-8412-98333a1bc1f4', '2', '樱桃', 30.00, 1, '夏季供应', 'wxc7f540d89f35da73.o6zAJs7hq-Iyd7O4lOvl11LFDr6c.eAm2jjPDykQt3f7e6451e277c5c73f6f7f3ddf66433b.jpg', 5, 0, '好吃不贵'),
73 | ('4b9363b7-a4f8-4329-8024-b53386cf4ddc', '3', '咖啡\r\n', 50.00, 1, '周三到周五供应', 'food3.png', 4, 0, '这是一份儿非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非'),
74 | ('58d9a28f-8746-492b-9f25-bcbe440ed636', '2', '山竹', 20.00, 1, '不供应', 'food9.png', 10, 0, '这是一份儿非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非'),
75 | ('82cb2db1-fd7e-48ed-89f5-24813da9dca6', '2', '梨', 20.00, 1, '全年供应', 'food1.png', 5, 0, '这是一份儿非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常好'),
76 | ('89e8ec77-8820-48c1-9d4e-f001f093ff93', '1', '饭团', 5.00, 1, '周一至周六供应', 'food6.png', 4, 0, '这是一份儿非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非'),
77 | ('d5646197-83c5-459e-85f9-f69e4207e52a', '3', '布丁', 38.00, 1, '周一至周六供应', 'food2.png', 5, 0, '这是一份儿非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非');
78 | /*!40000 ALTER TABLE `goods` ENABLE KEYS */;
79 |
80 | -- 导出 表 mhzqx.goodstype 结构
81 | CREATE TABLE IF NOT EXISTS `goodstype` (
82 | `GTID` varchar(50) COLLATE utf8_bin NOT NULL,
83 | `GTNAME` varchar(30) COLLATE utf8_bin DEFAULT NULL,
84 | `GTSTATE` int(11) DEFAULT NULL,
85 | PRIMARY KEY (`GTID`)
86 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
87 |
88 | -- 正在导出表 mhzqx.goodstype 的数据:~4 rows (大约)
89 | /*!40000 ALTER TABLE `goodstype` DISABLE KEYS */;
90 | INSERT INTO `goodstype` (`GTID`, `GTNAME`, `GTSTATE`) VALUES
91 | ('1', '主食', 1),
92 | ('2', '水果', 1),
93 | ('3', '甜点', 1);
94 | /*!40000 ALTER TABLE `goodstype` ENABLE KEYS */;
95 |
96 | -- 导出 表 mhzqx.orderdetail 结构
97 | CREATE TABLE IF NOT EXISTS `orderdetail` (
98 | `GID` varchar(50) COLLATE utf8_bin DEFAULT NULL,
99 | `ORDERID` varchar(50) COLLATE utf8_bin DEFAULT NULL,
100 | `GNAME` varchar(50) COLLATE utf8_bin DEFAULT NULL,
101 | `GCOUNT` decimal(10,2) DEFAULT NULL,
102 | `GPRICE` varchar(50) COLLATE utf8_bin DEFAULT NULL,
103 | `GTIME` int(11) DEFAULT NULL,
104 | KEY `FK_Relationship_6` (`ORDERID`),
105 | KEY `FK_Relationship_7` (`GID`),
106 | CONSTRAINT `FK_Relationship_7` FOREIGN KEY (`GID`) REFERENCES `goods` (`GID`)
107 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
108 |
109 | -- 正在导出表 mhzqx.orderdetail 的数据:~12 rows (大约)
110 | /*!40000 ALTER TABLE `orderdetail` DISABLE KEYS */;
111 | INSERT INTO `orderdetail` (`GID`, `ORDERID`, `GNAME`, `GCOUNT`, `GPRICE`, `GTIME`) VALUES
112 | ('58d9a28f-8746-492b-9f25-bcbe440ed636', 'ef137ef0-9887-11e9-9960-e90128ae1bef', '山竹', 11.00, '20', 10),
113 | ('89e8ec77-8820-48c1-9d4e-f001f093ff93', 'f855cbd0-9887-11e9-9960-e90128ae1bef', '饭团', 2.00, '5', 4),
114 | ('58d9a28f-8746-492b-9f25-bcbe440ed636', 'f855cbd0-9887-11e9-9960-e90128ae1bef', '山竹', 4.00, '20', 10),
115 | ('4b9363b7-a4f8-4329-8024-b53386cf4ddc', 'f855cbd0-9887-11e9-9960-e90128ae1bef', '咖啡\r\n', 1.00, '50', 4),
116 | ('d5646197-83c5-459e-85f9-f69e4207e52a', 'f855cbd0-9887-11e9-9960-e90128ae1bef', '布丁', 1.00, '38', 5),
117 | ('89e8ec77-8820-48c1-9d4e-f001f093ff93', 'dee398b0-9889-11e9-afc3-1d12f18a915f', '饭团', 20.00, '5', 4),
118 | ('89e8ec77-8820-48c1-9d4e-f001f093ff93', '0894df60-98a9-11e9-acc3-f7241ce36425', '饭团', 4.00, '5', 4),
119 | ('89e8ec77-8820-48c1-9d4e-f001f093ff93', '12c6bc60-98a9-11e9-acc3-f7241ce36425', '饭团', 4.00, '5', 4),
120 | ('58d9a28f-8746-492b-9f25-bcbe440ed636', '12c6bc60-98a9-11e9-acc3-f7241ce36425', '山竹', 2.00, '20', 10),
121 | ('89e8ec77-8820-48c1-9d4e-f001f093ff93', 'ef7f8ec0-98a9-11e9-a2b1-cf87d44fe9f7', '饭团', 2.00, '5', 4),
122 | ('89e8ec77-8820-48c1-9d4e-f001f093ff93', '0ca880f0-98ab-11e9-bbf5-5be13d8682cd', '饭团', 2.00, '5', 4),
123 | ('4b9363b7-a4f8-4329-8024-b53386cf4ddc', '0ca880f0-98ab-11e9-bbf5-5be13d8682cd', '咖啡\r\n', 2.00, '50', 4),
124 | ('d5646197-83c5-459e-85f9-f69e4207e52a', '0ca880f0-98ab-11e9-bbf5-5be13d8682cd', '布丁', 2.00, '38', 5);
125 | /*!40000 ALTER TABLE `orderdetail` ENABLE KEYS */;
126 |
127 | -- 导出 表 mhzqx.overorder 结构
128 | CREATE TABLE IF NOT EXISTS `overorder` (
129 | `ORDERID` varchar(50) COLLATE utf8_bin NOT NULL,
130 | `CUSID` varchar(50) COLLATE utf8_bin DEFAULT NULL,
131 | `ORDERTIME` int(11) DEFAULT NULL,
132 | `ORDERSTATE` int(11) DEFAULT '3' COMMENT '0--临时\\\\\\\\r\\\\\\\\n 1--下单\\\\\\\\r\\\\\\\\n 2--正在处理\\\\\\\\r\\\\\\\\n 3--处理完成',
133 | `ORDERTOTLEPRICE` decimal(10,2) DEFAULT NULL,
134 | `ORDERNUM` int(10) unsigned zerofill NOT NULL AUTO_INCREMENT,
135 | PRIMARY KEY (`ORDERNUM`)
136 | ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
137 |
138 | -- 正在导出表 mhzqx.overorder 的数据:~4 rows (大约)
139 | /*!40000 ALTER TABLE `overorder` DISABLE KEYS */;
140 | INSERT INTO `overorder` (`ORDERID`, `CUSID`, `ORDERTIME`, `ORDERSTATE`, `ORDERTOTLEPRICE`, `ORDERNUM`) VALUES
141 | ('ef137ef0-9887-11e9-9960-e90128ae1bef', 'ca1f0540-5659-4809-8708-0be47bf33f18', 110, 3, 220.00, 0000000003),
142 | ('f855cbd0-9887-11e9-9960-e90128ae1bef', 'ca1f0540-5659-4809-8708-0be47bf33f18', 57, 3, 178.00, 0000000004),
143 | ('0894df60-98a9-11e9-acc3-f7241ce36425', 'ca1f0540-5659-4809-8708-0be47bf33f18', 16, 3, 20.00, 0000000005),
144 | ('12c6bc60-98a9-11e9-acc3-f7241ce36425', 'ca1f0540-5659-4809-8708-0be47bf33f18', 36, 3, 60.00, 0000000006),
145 | ('ef7f8ec0-98a9-11e9-a2b1-cf87d44fe9f7', 'ca1f0540-5659-4809-8708-0be47bf33f18', 8, 3, 10.00, 0000000007);
146 | /*!40000 ALTER TABLE `overorder` ENABLE KEYS */;
147 |
148 | -- 导出 表 mhzqx.roleright 结构
149 | CREATE TABLE IF NOT EXISTS `roleright` (
150 | `RRID` varchar(50) COLLATE utf8_bin NOT NULL,
151 | `ROLEID` varchar(50) COLLATE utf8_bin DEFAULT NULL,
152 | `FUNID` varchar(50) COLLATE utf8_bin DEFAULT NULL,
153 | PRIMARY KEY (`RRID`),
154 | KEY `FK_Relationship_1` (`ROLEID`),
155 | KEY `FK_Relationship_2` (`FUNID`),
156 | CONSTRAINT `FK_Relationship_1` FOREIGN KEY (`ROLEID`) REFERENCES `sysrole` (`ROLEID`),
157 | CONSTRAINT `FK_Relationship_2` FOREIGN KEY (`FUNID`) REFERENCES `sysfunction` (`FUNID`)
158 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
159 |
160 | -- 正在导出表 mhzqx.roleright 的数据:~0 rows (大约)
161 | /*!40000 ALTER TABLE `roleright` DISABLE KEYS */;
162 | /*!40000 ALTER TABLE `roleright` ENABLE KEYS */;
163 |
164 | -- 导出 表 mhzqx.syscus 结构
165 | CREATE TABLE IF NOT EXISTS `syscus` (
166 | `CUSID` varchar(50) COLLATE utf8_bin NOT NULL,
167 | `NICKNAME` varchar(50) COLLATE utf8_bin NOT NULL,
168 | `LIMITS` varchar(50) COLLATE utf8_bin DEFAULT NULL,
169 | PRIMARY KEY (`CUSID`)
170 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
171 |
172 | -- 正在导出表 mhzqx.syscus 的数据:~1 rows (大约)
173 | /*!40000 ALTER TABLE `syscus` DISABLE KEYS */;
174 | INSERT INTO `syscus` (`CUSID`, `NICKNAME`, `LIMITS`) VALUES
175 | ('ca1f0540-5659-4809-8708-0be47bf33f18', '飙', 'true');
176 | /*!40000 ALTER TABLE `syscus` ENABLE KEYS */;
177 |
178 | -- 导出 表 mhzqx.sysfunction 结构
179 | CREATE TABLE IF NOT EXISTS `sysfunction` (
180 | `FUNID` varchar(50) COLLATE utf8_bin NOT NULL,
181 | `FUNNAME` varchar(30) COLLATE utf8_bin DEFAULT NULL,
182 | `FUNPID` varchar(50) COLLATE utf8_bin DEFAULT NULL,
183 | `FUNURL` varchar(200) COLLATE utf8_bin DEFAULT NULL,
184 | `FUNSTATE` int(11) DEFAULT NULL,
185 | PRIMARY KEY (`FUNID`)
186 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
187 |
188 | -- 正在导出表 mhzqx.sysfunction 的数据:~0 rows (大约)
189 | /*!40000 ALTER TABLE `sysfunction` DISABLE KEYS */;
190 | /*!40000 ALTER TABLE `sysfunction` ENABLE KEYS */;
191 |
192 | -- 导出 表 mhzqx.sysrole 结构
193 | CREATE TABLE IF NOT EXISTS `sysrole` (
194 | `ROLEID` varchar(50) COLLATE utf8_bin NOT NULL,
195 | `ROLENAME` varchar(20) COLLATE utf8_bin DEFAULT NULL,
196 | `ROLESTATE` int(11) DEFAULT NULL,
197 | PRIMARY KEY (`ROLEID`)
198 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
199 |
200 | -- 正在导出表 mhzqx.sysrole 的数据:~0 rows (大约)
201 | /*!40000 ALTER TABLE `sysrole` DISABLE KEYS */;
202 | /*!40000 ALTER TABLE `sysrole` ENABLE KEYS */;
203 |
204 | -- 导出 表 mhzqx.sysuser 结构
205 | CREATE TABLE IF NOT EXISTS `sysuser` (
206 | `USERID` varchar(50) COLLATE utf8_bin NOT NULL,
207 | `ROLEID` varchar(50) COLLATE utf8_bin DEFAULT NULL,
208 | `USERNAME` varchar(30) COLLATE utf8_bin DEFAULT NULL,
209 | `USERPWD` varchar(30) COLLATE utf8_bin DEFAULT NULL,
210 | `USERSEX` char(2) COLLATE utf8_bin DEFAULT NULL,
211 | `USERTRUENAME` varchar(30) COLLATE utf8_bin DEFAULT NULL,
212 | `USERSTATE` int(11) DEFAULT NULL,
213 | PRIMARY KEY (`USERID`),
214 | KEY `FK_Relationship_3` (`ROLEID`),
215 | CONSTRAINT `FK_Relationship_3` FOREIGN KEY (`ROLEID`) REFERENCES `sysrole` (`ROLEID`)
216 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
217 |
218 | -- 正在导出表 mhzqx.sysuser 的数据:~0 rows (大约)
219 | /*!40000 ALTER TABLE `sysuser` DISABLE KEYS */;
220 | /*!40000 ALTER TABLE `sysuser` ENABLE KEYS */;
221 |
222 | /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
223 | /*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
224 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
225 |
--------------------------------------------------------------------------------
/mhzqx小程序/style/weui.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v1.1.1 (https://github.com/weui/weui-wxss)
3 | * Copyright 2017 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | page{font-family:-apple-system-font,Helvetica Neue,sans-serif}icon{vertical-align:middle}.weui-cells{position:relative;margin-top:1.17647059em;background-color:#fff;line-height:1.41176471;font-size:17px}.weui-cells:before{top:0;border-top:1rpx solid #d9d9d9}.weui-cells:after,.weui-cells:before{content:" ";position:absolute;left:0;right:0;height:1px;color:#d9d9d9}.weui-cells:after{bottom:0;border-bottom:1rpx solid #d9d9d9}.weui-cells__title{margin-top:.77em;margin-bottom:.3em;padding-left:15px;padding-right:15px;color:#999;font-size:14px}.weui-cells_after-title{margin-top:0}.weui-cells__tips{margin-top:.3em;color:#999;padding-left:15px;padding-right:15px;font-size:14px}.weui-cell{padding:10px 15px;position:relative;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid #d9d9d9;color:#d9d9d9;left:15px}.weui-cell:first-child:before{display:none}.weui-cell_active{background-color:#ececec}.weui-cell_primary{-webkit-box-align:start;-webkit-align-items:flex-start;align-items:flex-start}.weui-cell__bd{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-cell__ft{text-align:right;color:#999}.weui-cell_access{color:inherit}.weui-cell__ft_in-access{padding-right:13px;position:relative}.weui-cell__ft_in-access:after{content:" ";display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8cd;border-style:solid;-webkit-transform:matrix(.71,.71,-.71,.71,0,0);transform:matrix(.71,.71,-.71,.71,0,0);position:relative;top:-2px;position:absolute;top:50%;margin-top:-4px;right:2px}.weui-cell_link{color:#586c94;font-size:14px}.weui-cell_link:active{background-color:#ececec}.weui-cell_link:first-child:before{display:block}.weui-icon-radio{margin-left:3.2px;margin-right:3.2px}.weui-icon-checkbox_circle,.weui-icon-checkbox_success{margin-left:4.6px;margin-right:4.6px}.weui-check__label:active{background-color:#ececec}.weui-check{position:absolute;left:-9999px}.weui-check__hd_in-checkbox{padding-right:.35em}.weui-cell__ft_in-radio{padding-left:.35em}.weui-cell_input{padding-top:0;padding-bottom:0}.weui-label{width:105px;word-wrap:break-word;word-break:break-all}.weui-input{height:2.58823529em;min-height:2.58823529em;line-height:2.58823529em}.weui-toptips{position:fixed;-webkit-transform:translateZ(0);transform:translateZ(0);top:0;left:0;right:0;padding:5px;font-size:14px;text-align:center;color:#fff;z-index:5000;word-wrap:break-word;word-break:break-all}.weui-toptips_warn{background-color:#e64340}.weui-textarea{display:block;width:100%}.weui-textarea-counter{color:#b2b2b2;text-align:right}.weui-cell_warn,.weui-textarea-counter_warn{color:#e64340}.weui-form-preview{position:relative;background-color:#fff}.weui-form-preview:before{top:0;border-top:1rpx solid #d9d9d9}.weui-form-preview:after,.weui-form-preview:before{content:" ";position:absolute;left:0;right:0;height:1px;color:#d9d9d9}.weui-form-preview:after{bottom:0;border-bottom:1rpx solid #d9d9d9}.weui-form-preview__value{font-size:14px}.weui-form-preview__value_in-hd{font-size:26px}.weui-form-preview__hd{position:relative;padding:10px 15px;text-align:right;line-height:2.5em}.weui-form-preview__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid #d9d9d9;color:#d9d9d9;left:15px}.weui-form-preview__bd{padding:10px 15px;font-size:.9em;text-align:right;color:#999;line-height:2}.weui-form-preview__ft{position:relative;line-height:50px;display:-webkit-box;display:-webkit-flex;display:flex}.weui-form-preview__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid #d5d5d6;color:#d5d5d6}.weui-form-preview__item{overflow:hidden}.weui-form-preview__label{float:left;margin-right:1em;min-width:4em;color:#999;text-align:justify;text-align-last:justify}.weui-form-preview__value{display:block;overflow:hidden;word-break:normal;word-wrap:break-word}.weui-form-preview__btn{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#3cc51f;text-align:center}.weui-form-preview__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #d5d5d6;color:#d5d5d6}.weui-form-preview__btn:first-child:after{display:none}.weui-form-preview__btn_active{background-color:#eee}.weui-form-preview__btn_default{color:#999}.weui-form-preview__btn_primary{color:#0bb20c}.weui-cell_select{padding:0}.weui-select{position:relative;padding-left:15px;padding-right:30px;height:2.58823529em;min-height:2.58823529em;line-height:2.58823529em;border-right:1rpx solid #d9d9d9}.weui-select:before{content:" ";display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8cd;border-style:solid;-webkit-transform:matrix(.71,.71,-.71,.71,0,0);transform:matrix(.71,.71,-.71,.71,0,0);position:relative;top:-2px;position:absolute;top:50%;right:15px;margin-top:-4px}.weui-select_in-select-after{padding-left:0}.weui-cell__bd_in-select-before,.weui-cell__hd_in-select-after{padding-left:15px}.weui-cell_vcode{padding-right:0}.weui-vcode-btn,.weui-vcode-img{margin-left:5px;height:2.58823529em;vertical-align:middle}.weui-vcode-btn{display:inline-block;padding:0 .6em 0 .7em;border-left:1px solid #e5e5e5;line-height:2.58823529em;font-size:17px;color:#3cc51f;white-space:nowrap}.weui-vcode-btn:active{color:#52a341}.weui-cell_switch{padding-top:6px;padding-bottom:6px}.weui-uploader__hd{display:-webkit-box;display:-webkit-flex;display:flex;padding-bottom:10px;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-uploader__title{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-uploader__info{color:#b2b2b2}.weui-uploader__bd{margin-bottom:-4px;margin-right:-9px;overflow:hidden}.weui-uploader__file{float:left;margin-right:9px;margin-bottom:9px}.weui-uploader__img{display:block;width:79px;height:79px}.weui-uploader__file_status{position:relative}.weui-uploader__file_status:before{content:" ";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,.5)}.weui-uploader__file-content{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#fff}.weui-uploader__input-box{float:left;position:relative;margin-right:9px;margin-bottom:9px;width:77px;height:77px;border:1px solid #d9d9d9}.weui-uploader__input-box:after,.weui-uploader__input-box:before{content:" ";position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);background-color:#d9d9d9}.weui-uploader__input-box:before{width:2px;height:39.5px}.weui-uploader__input-box:after{width:39.5px;height:2px}.weui-uploader__input-box:active{border-color:#999}.weui-uploader__input-box:active:after,.weui-uploader__input-box:active:before{background-color:#999}.weui-uploader__input{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;opacity:0}.weui-article{padding:20px 15px;font-size:15px}.weui-article__section{margin-bottom:1.5em}.weui-article__h1{font-size:18px;font-weight:400;margin-bottom:.9em}.weui-article__h2{font-size:16px;font-weight:400;margin-bottom:.34em}.weui-article__h3{font-weight:400;font-size:15px;margin-bottom:.34em}.weui-article__p{margin:0 0 .8em}.weui-msg{padding-top:36px;text-align:center}.weui-msg__link{display:inline;color:#586c94}.weui-msg__icon-area{margin-bottom:30px}.weui-msg__text-area{margin-bottom:25px;padding:0 20px}.weui-msg__title{margin-bottom:5px;font-weight:400;font-size:20px}.weui-msg__desc{font-size:14px;color:#999}.weui-msg__opr-area{margin-bottom:25px}.weui-msg__extra-area{margin-bottom:15px;font-size:14px;color:#999}@media screen and (min-height:438px){.weui-msg__extra-area{position:fixed;left:0;bottom:0;width:100%;text-align:center}}.weui-flex{display:-webkit-box;display:-webkit-flex;display:flex}.weui-flex__item{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-btn{margin-top:15px}.weui-btn:first-child{margin-top:0}.weui-btn-area{margin:1.17647059em 15px .3em}.weui-agree{display:block;padding:.5em 15px;font-size:13px}.weui-agree__text{color:#999}.weui-agree__link{display:inline;color:#586c94}.weui-agree__checkbox{position:absolute;left:-9999px}.weui-agree__checkbox-icon{position:relative;top:2px;display:inline-block;border:1px solid #d1d1d1;background-color:#fff;border-radius:3px;width:11px;height:11px}.weui-agree__checkbox-icon-check{position:absolute;top:1px;left:1px}.weui-footer{color:#999;font-size:14px;text-align:center}.weui-footer_fixed-bottom{position:fixed;bottom:.52em;left:0;right:0}.weui-footer__links{font-size:0}.weui-footer__link{display:inline-block;vertical-align:top;margin:0 .62em;position:relative;font-size:14px;color:#586c94}.weui-footer__link:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #c7c7c7;color:#c7c7c7;left:-.65em;top:.36em;bottom:.36em}.weui-footer__link:first-child:before{display:none}.weui-footer__text{padding:0 .34em;font-size:12px}.weui-grids{border-top:1rpx solid #d9d9d9;border-left:1rpx solid #d9d9d9;overflow:hidden}.weui-grid{position:relative;float:left;padding:20px 10px;width:33.33333333%;box-sizing:border-box;border-right:1rpx solid #d9d9d9;border-bottom:1rpx solid #d9d9d9}.weui-grid_active{background-color:#ececec}.weui-grid__icon{display:block;width:28px;height:28px;margin:0 auto}.weui-grid__label{margin-top:5px;display:block;text-align:center;color:#000;font-size:14px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.weui-loading{margin:0 5px;width:20px;height:20px;display:inline-block;vertical-align:middle;-webkit-animation:a 1s steps(12) infinite;animation:a 1s steps(12) infinite;background:transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;background-size:100%}.weui-loading.weui-loading_transparent{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect xmlns='http://www.w3.org/2000/svg' width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.56)' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.5)' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.43)' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.38)' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.32)' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.28)' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.25)' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.2)' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.17)' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.14)' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.1)' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.03)' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E")}@-webkit-keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.weui-badge{display:inline-block;padding:.15em .4em;min-width:8px;border-radius:18px;background-color:#e64340;color:#fff;line-height:1.2;text-align:center;font-size:12px;vertical-align:middle}.weui-badge_dot{padding:.4em;min-width:0}.weui-loadmore{width:65%;margin:1.5em auto;line-height:1.6em;font-size:14px;text-align:center}.weui-loadmore__tips{display:inline-block;vertical-align:middle}.weui-loadmore_line{border-top:1px solid #e5e5e5;margin-top:2.4em}.weui-loadmore__tips_in-line{position:relative;top:-.9em;padding:0 .55em;background-color:#fff;color:#999}.weui-loadmore__tips_in-dot{position:relative;padding:0 .16em;width:4px;height:1.6em}.weui-loadmore__tips_in-dot:before{content:" ";position:absolute;top:50%;left:50%;margin-top:-1px;margin-left:-2px;width:4px;height:4px;border-radius:50%;background-color:#e5e5e5}.weui-panel{background-color:#fff;margin-top:10px;position:relative;overflow:hidden}.weui-panel:first-child{margin-top:0}.weui-panel:before{top:0;border-top:1rpx solid #e5e5e5}.weui-panel:after,.weui-panel:before{content:" ";position:absolute;left:0;right:0;height:1px;color:#e5e5e5}.weui-panel:after{bottom:0;border-bottom:1rpx solid #e5e5e5}.weui-panel__hd{padding:14px 15px 10px;color:#999;font-size:13px;position:relative}.weui-panel__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid #e5e5e5;color:#e5e5e5;left:15px}.weui-media-box{padding:15px;position:relative}.weui-media-box:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid #e5e5e5;color:#e5e5e5;left:15px}.weui-media-box:first-child:before{display:none}.weui-media-box__title{font-weight:400;font-size:17px;width:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal;word-wrap:break-word;word-break:break-all}.weui-media-box__desc{color:#999;font-size:13px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-media-box__info{margin-top:15px;padding-bottom:5px;font-size:13px;color:#cecece;line-height:1em;list-style:none;overflow:hidden}.weui-media-box__info__meta{float:left;padding-right:1em}.weui-media-box__info__meta_extra{padding-left:1em;border-left:1px solid #cecece}.weui-media-box__title_in-text{margin-bottom:8px}.weui-media-box_appmsg{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-media-box__thumb{width:100%;height:100%;vertical-align:top}.weui-media-box__hd_in-appmsg{margin-right:.8em;width:60px;height:60px;line-height:60px;text-align:center}.weui-media-box__bd_in-appmsg{-webkit-box-flex:1;-webkit-flex:1;flex:1;min-width:0}.weui-media-box_small-appmsg{padding:0}.weui-cells_in-small-appmsg{margin-top:0}.weui-cells_in-small-appmsg:before{display:none}.weui-progress{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-progress__bar{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-progress__opr{margin-left:15px;font-size:0}.weui-navbar{display:-webkit-box;display:-webkit-flex;display:flex;position:absolute;z-index:500;top:0;width:100%;border-bottom:1rpx solid #ccc}.weui-navbar__item{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:13px 0;text-align:center;font-size:0}.weui-navbar__item.weui-bar__item_on{color:#1aad19}.weui-navbar__slider{position:absolute;content:" ";left:0;bottom:0;width:6em;height:3px;background-color:#1aad19;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}.weui-navbar__title{display:inline-block;font-size:15px;max-width:8em;width:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal}.weui-tab{position:relative;height:100%}.weui-tab__panel{box-sizing:border-box;height:100%;padding-top:50px;overflow:auto;-webkit-overflow-scrolling:touch}.weui-search-bar{position:relative;padding:8px 10px;display:-webkit-box;display:-webkit-flex;display:flex;box-sizing:border-box;background-color:#efeff4;border-top:1rpx solid #d7d6dc;border-bottom:1rpx solid #d7d6dc}.weui-icon-search{margin-right:8px;font-size:inherit}.weui-icon-search_in-box{position:absolute;left:10px;top:7px}.weui-search-bar__text{display:inline-block;font-size:14px;vertical-align:middle}.weui-search-bar__form{position:relative;-webkit-box-flex:1;-webkit-flex:auto;flex:auto;border-radius:5px;background:#fff;border:1rpx solid #e6e6ea}.weui-search-bar__box{position:relative;padding-left:30px;padding-right:30px;width:100%;box-sizing:border-box;z-index:1}.weui-search-bar__input{height:28px;line-height:28px;font-size:14px}.weui-icon-clear{position:absolute;top:0;right:0;padding:7px 8px;font-size:0}.weui-search-bar__label{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;border-radius:3px;text-align:center;color:#9b9b9b;background:#fff;line-height:28px}.weui-search-bar__cancel-btn{margin-left:10px;line-height:28px;color:#09bb07;white-space:nowrap}
--------------------------------------------------------------------------------