Giter Club home page Giter Club logo

canku's Introduction

餐库

canku 是一个使用 nodejs 编写的多人订餐程序,使用了 express , mongoskin 模块。使用 mongodb 做存储。

餐库的功能:

  1. 用户登录、注册
  2. 店铺、菜单的增删改,菜单支持特定的送餐日(如:周一,周二)
  3. 菜单支持分类功能
  4. 单店的上下午区分的订餐统计,以15时,作上下午的区分
  5. 每订单有运气值功能,当日单店运气值最低的负责打电话点餐
  6. 用户可以取消订单,但是用户的运气值在当天依然生效(如果用户当天点了餐的话)。

目前还在完善中,演示地址: http://canku.willerce.com

部署请参考,Noderce AppFog 部署指南:http://willerce.com/post/noderce-deploy-to-appfog

简单的部署介绍

git clone [email protected]:willerce/canku.git

你需要在本机启动好 MongoDB 服务,如果需要测试数据,请看这里

复制一份global.default.js,保存为 复制一份global.js,根据注释,修改参数。

运行 npm install 安装依赖包

运行 node app.js

店铺管理管理地址: http://yourname.com/admin

如果注册时提示注册失败,请重试请检查mongodb是否在运行(例如:可通过命令mongo localhost/canku连接数据库)

添加店铺

添加店铺、菜单管理功能比较简陋,作一些介绍

  1. 店铺菜单分类,格式:数字编号#分类名|数字编号#分类名|。例如:1#商务套餐|2#营养套餐|3#其它

  2. 样式,支持店铺CSS,主要用于对菜单列数进行一些调整,例如这个1行2列

    .food-list li {width: 269px;} .food-list li:nth-child(even) {margin-right: 0; float:right;}

  3. 支持以图片的方式上传每家店铺的菜单,用户可以直接在图上戳戳以点餐,图片菜单中的菜不能算入价格。

##License

(The MIT License)

Copyright (c) 2013 willerce [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

canku's People

Contributors

iuhoay avatar layerssss avatar willerce avatar zs1621 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

canku's Issues

注册时出错,系统自动退出!

canku/routes/user.js:112
if (!err & user.length > 0) {
^
TypeError: Cannot read property 'length' of undefined
at exports.register (/home/michael/repos/nodejsprojects/canku/routes/user.js:112:30)
at Object.exports.error (/home/michael/repos/nodejsprojects/canku/node_modules/mongoskin/lib/mongoskin/utils.js:27:5)
at EventEmitter.exports.bindSkin.obj.(anonymous function) (/home/michael/repos/nodejsprojects/canku/node_modules/mongoskin/lib/mongoskin/utils.js:66:17)
at EventEmitter.g (events.js:192:14)
at EventEmitter.emit (events.js:99:17)
at SkinCollection.open (/home/michael/repos/nodejsprojects/canku/node_modules/mongoskin/lib/mongoskin/collection.js:114:31)
at EventEmitter.g (events.js:192:14)
at EventEmitter.emit (events.js:99:17)
at null. (/home/michael/repos/nodejsprojects/canku/node_modules/mongoskin/lib/mongoskin/db.js:99:22)
at SkinDb.open (/home/michael/repos/nodejsprojects/canku/node_modules/mongoskin/lib/mongoskin/db.js:110:11)

账户余额功能

这两天为 canku 加入账户余额功能,由于数学计算问题,把 @layerssss 开发图片点餐功能去除了。

已经推到 dev 分去上,有兴趣的童鞋下载回来看看。

@zs1621 @tooooolong

Android 客户端

开始开发 Android 客户端,WEB 上的功能都将被实现。

相比WEB,手机客户端可以加入的新特性:

  • 点餐闹钟,考虑通过 GCM 的 push 来推送提醒该点外卖了。
  • 基于 GPS 的地理定位,实现管理员修改店铺经纬店。
  • 计算店铺距离你当前位置的直线距离
  • 可以给某个外卖的拍照并上传

Support Alipay AA?

既然是集体订单当然可以AA收款啦, 解决零钱不够的问题
😄

在这个框架下,我理解的状态

1、输菜单是件麻烦事,现在有两种情况
A)菜单是纯汉字
B)菜单是图片
我的想法是,看是否是借用手机拍照的功能,将图片放到该注册用户所属组,并更新;如果是汉字,看是否利用扫描的一些插件去识别,或者,后者变为添加语音输入功能(这个比较常见,也有api接口)

2如果餐库主页面是目前的状态(针对小范围,不超过5个餐厅的选择),建议排列做成大图,类似做成如图1所示样式
Dribbble - Restaurant Widget by Ionut Zamfir
如果是超过10个的,建议带GIS圈范围或者搜索功能

添加菜单的时候报错

我部署到我的server上,但偶尔情况下,添加菜单的时候报错,报错内容如下:

POST /admin/food/add?shop_id=521c17f7f5673b0468000002 302 7ms - 152b
{ '0': '星期天',
  '1': '星期一',
  '2': '星期二',
  '3': '星期三',
  '4': '星期四',
  '5': '星期五',
  '6': '星期六',
  '-1': '全部' }
GET /admin/food/add?shop_id=521c17f7f5673b0468000002 200 26ms

events.js:71
        throw arguments[1]; // Unhandled 'error' event
                       ^
Error: socket hang up
    at createHangUpError (http.js:1360:15)
    at ServerResponse.OutgoingMessage._writeRaw (http.js:507:26)
    at ServerResponse.OutgoingMessage._send (http.js:476:15)
    at ServerResponse.OutgoingMessage.end (http.js:890:18)
    at ServerResponse.module.exports.res.end (/home/litc/test/canku/node_modules/express/node_modules/connect/lib/middleware/logger.js:148:13)
    at ServerResponse.module.exports.res.end (/home/litc/test/canku/node_modules/express/node_modules/connect/lib/middleware/compress.js:123:15)
    at res.end (/home/litc/test/canku/node_modules/express/node_modules/connect/lib/middleware/session.js:285:13)
    at /home/litc/test/canku/node_modules/express/node_modules/connect/lib/middleware/session/memory.js:73:11
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)

不知道是怎么回事,大家给看看。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.