个人资源与分享网站:首页-小草资源分享网站
需求背景:
微信小程序极大方便了广大用户的使用和方便,因为想开发一个微信小程序点餐系统,作为自己的毕业设计。
技术架构:
小程序端:原生微信小程序
后端:SpringBoot+mybatis+mysql+html+js+css
开发工具:
eclipse/IDEA 微信开发者工具 mysql
用户角色:
买家:搜索店铺并进行点餐
商家:处理买家提交的订单并准备菜品,通知骑手送餐
骑手:送餐
管理员:负责后台管理
涉及到的功能:
注册、登录、买家点餐、提交订单、商家接单、骑手抢单、订单信息、留言等。
后台部分功能代码:
@Controller
@RequestMapping(value = "/home")
public class HomeController {
@RequestMapping(value = "/setSession", produces = "text/plain; charset=utf-8", method = { RequestMethod.GET,
RequestMethod.POST })
@ResponseBody
public String setSession(HttpServletRequest req) {
HttpSession session = req.getSession();
String key = req.getParameter("key");
String value = req.getParameter("value");
session.setAttribute(key, value);
return null;
}
@RequestMapping(value = "/getSession", produces = "text/plain; charset=utf-8", method = { RequestMethod.GET,
RequestMethod.POST })
@ResponseBody
public String getSession(HttpServletRequest req) {
HttpSession session = req.getSession();
String key = req.getParameter("key");
String value = session.getAttribute(key)==null?null:session.getAttribute(key).toString();
return value;
}
}
<!DOCTYPE html>
<html>
<head id="Head1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>点餐</title>
<script type="text/javascript">
var themetype = localStorage['easyuitheme']||"default";
document.write('<link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/themes/'+themetype+'/easyui.css"/>')
</script>
<!--<link rel="stylesheet" type="text/css"
href="__PUBLIC__/easyui/themes/default/easyui.css"/>-->
<link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/themes/icon.css"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/themes/all.css"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/index.css"/>
<script type="text/javascript" src="__PUBLIC__/easyui/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/ideaframe.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript">
var _menus = "";
$(function (){
$.post("/home/getSession", {key:"userinfo"}, function(data) {
if (data) {
userinfo = JSON.parse(data);
$("#usernameshow").text(userinfo.username);
roletype = userinfo.roletype;
if(roletype){
if(roletype == "1"){
$("#iframepage").attr("src","user.html");
}else if(roletype == "3"){
$("#iframepage").attr("src","billshop.html");
}else if(roletype == "2"){
$("#iframepage").attr("src","xuanke.html");
}
}
}else{
window.location.href="login.html";
}
if (roletype) {
if (roletype == "1") {
_menus = {
"menus": [
{"menuid": "1", "icon": "icon-magic", "menuname": "菜品管理",
"menus": [
{"menuid": "12", "menuname": "菜品管理列表", "icon": "icon-database", "url": "good.html"}
]},
{"menuid": "1", "icon": "icon-magic", "menuname": "类别管理",
"menus": [
{"menuid": "12", "menuname": "类别列表", "icon": "icon-database", "url": "type.html"}
]},
/*{"menuid": "1", "icon": "icon-magic", "menuname": "桌号管理",
"menus": [
{"menuid": "12", "menuname": "桌号列表", "icon": "icon-database", "url": "room.html"}
]},
{"menuid": "1", "icon": "icon-magic", "menuname": "城市管理",
"menus": [
{"menuid": "12", "menuname": "城市列表", "icon": "icon-database", "url": "<%= __APP__%>/Shop!shop"}
]},*/
{"menuid": "1", "icon": "icon-magic", "menuname": "订单管理",
"menus": [
{"menuid": "12", "menuname": "订单管理", "icon": "icon-database", "url": "bill.html"}
]},
{"menuid": "1", "icon": "icon-magic", "menuname": "统计",
"menus": [
{"menuid": "12", "menuname": "统计图", "icon": "icon-database", "url": "tongji.html"}
]},
{"menuid": "1", "icon": "icon-magic", "menuname": "餐厅管理",
"menus": [
{"menuid": "12", "menuname": "餐厅列表", "icon": "icon-database", "url": "shop.html"}
]},
{"menuid": "1", "icon": "icon-magic", "menuname": "留言建议管理",
"menus": [
{"menuid": "12", "menuname": "留言建议列表", "icon": "icon-database", "url": "notice.html"}
]},
{"menuid": "56", "icon": "icon-role", "menuname": "用户管理",
"menus": [
{"menuid": "31", "menuname": "用户列表", "icon": "icon-users", "url": "user.html"}
]
}
]};
}else if(roletype == "3"){
_menus = {
"menus": [
{"menuid": "1", "icon": "icon-magic", "menuname": "菜品管理",
"menus": [
{"menuid": "12", "menuname": "菜品管理列表", "icon": "icon-database", "url": "goodshop.html"}
]},
{"menuid": "1", "icon": "icon-magic", "menuname": "优惠券管理",
"menus": [
{"menuid": "12", "menuname": "优惠券列表", "icon": "icon-database", "url": "youhuijuan.html"}
]},
{"menuid": "1", "icon": "icon-magic", "menuname": "类别管理",
"menus": [
{"menuid": "12", "menuname": "类别列表", "icon": "icon-database", "url": "type.html"}
]},
{"menuid": "1", "icon": "icon-magic", "menuname": "兼职信息管理",
"menus": [
{"menuid": "12", "menuname": "兼职信息列表", "icon": "icon-database", "url": "notice2.html"},
{"menuid": "12", "menuname": "兼职申请", "icon": "icon-database", "url": "notice3.html"}
]},
{"menuid": "1", "icon": "icon-magic", "menuname": "订单管理",
"menus": [
{"menuid": "12", "menuname": "订单管理", "icon": "icon-database", "url": "billshop.html"}
]}
]};
}else if(roletype == "2"){
}
InitLeftMenu();
tabClose();
tabCloseEven();
}
});
});
</script>
<style type="text/css">
.themeblock{
width: 10px;
height: 10px;
display: inline-block;
}
</style>
</head>
<body class="easyui-layout" style="overflow-y: hidden" scroll="no">
<noscript>
<div
style="position: absolute; z-index: 100000; height: 2046px; top: 0px; left: 0px; width: 100%; background: white; text-align: center;">
<img src="images/noscript.gif" alt='抱歉,请开启脚本支持!'/>
</div>
</noscript>
<div region="north" split="true" style="height: 100px;background-color:#025483;color: #fff;font-size: 30px;text-align: center;line-height: 100px;overflow: hidden;">
<span style="text-shadow: 0px 0px 3px #000;">点餐</span>
</div>
<div region="south" split="true"
style="height: 30px;">
<div>
<table width="100%">
<tr>
<td style="width: 20%;padding-right: 50px;" align="right">
<a href="#" οnclick="openPasswd();" id="usernameshow"></a> <a
href="login.html">退出</a>
</td>
<td style="width: 80%" align="right">
主题 :<a href="javascript:saveTheme('default');" style="color: #2571EB;">经典</a>
<!--<a href="__APP__/Index/changeThem/name/default">经典</a> -->
<!--<a href="__APP__/Index/changeThem/name/cupertino">清新蓝</a> -->
<a href="javascript:saveTheme('gray');" style="color: #585858;">灰色</a>
<a href="javascript:saveTheme('black');" style="color: #000000;">酷黑</a>
<a href="javascript:saveTheme('bootstrap');" style="color: #585858;">bootstrap</a>
<a href="javascript:saveTheme('ui-cupertino');" style="color: #008198;">清新蓝</a>
<a href="javascript:saveTheme('ui-dark-hive');" style="color: #000000;">深黑</a>
<a href="javascript:saveTheme('ui-pepper-grinder');" style="color: #ECC73B;">花布</a>
<a href="javascript:saveTheme('ui-sunny');" style="color: #BF570C;">阳光</a>
<a href="javascript:saveTheme('metro');" style="color: #585858;">metro</a>
<a href="javascript:saveTheme('metro-blue');" style="color: #00AEEF;">metroblue</a>
<a href="javascript:saveTheme('metro-gray');" style="color: #454545;">metrogray</a>
<a href="javascript:saveTheme('metro-green');" style="color: #008900;">metrogreen</a>
<a href="javascript:saveTheme('metro-orange');" style="color: #D14625;">metroorange</a>
<a href="javascript:saveTheme('metro-red');" style="color: #7A0000;">metrored</a>
</td>
<!--<td style="width: 20%" align="right">-->
<!--模式: <a href="__APP__/Index/changeModel?name=index">桌面</a> -->
<!--<a href="__APP__/Index/changeModel/name/index2">经典</a> -->
<!--</td>-->
</tr>
</table>
</div>
</div>
<div region="west" hide="true" split="true" title="导航菜单"
style="width: 180px;" id="west">
<div id="nav" class="easyui-accordion" fit="true" border="false">
<!-- 导航内容 -->
</div>
</div>
<div id="mainPanle" region="center"
style="background: #eee; overflow-y: hidden">
<div id="tabs" class="easyui-tabs" fit="true" border="false">
<div title="欢迎使用" style="padding: 0px; color: red; overflow: hidden;"
closable="true">
<iframe src="" id="iframepage" name="iframepage"
frameBorder=0 width="100%" height="100%" onLoad=""></iframe>
</div>
</div>
</div>
<div region="east" collapsed="true" id="datetool" title="日历"
split="true" style="width: 180px; overflow: hidden;">
<div class="easyui-calendar"></div>
<embed width="160" height="70" align="middle" pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" allowscriptaccess="always" name="honehoneclock" bgcolor="#ffffff"
quality="high" src="__PUBLIC__/swf/honehone_clock_wh.swf" wmode="transparent">
</embed>
</div>
<!--修改密码窗口-->
<div id="passwdDialog" class="easyui-dialog" title="修改密码" style="width:550px;height:290px;" toolbar="#dlg-toolbar"
buttons="#dlg-buttons2" resizable="true" modal="true" closed='true'>
<form id="passwdForm" name="passwdForm" method="post">
<table cellpadding="1" cellspacing="1" class="tb_custom1" style="width: 98%;">
<tr>
<th align="right"><label>密码:</label></th>
<td>
<input id="passwd" name="passwd" value="" type="password" class="easyui-validatebox" required="true" validType="length[0,32]"
style="width:90%"/>
</td>
</tr>
<tr>
<th align="right"><label> 密码重复:</label></th>
<td>
<input id="passwd2" name="passwd2" value="" type="password" class="easyui-validatebox" required="true" validType="length[0,32]"
style="width:90%"/>
</td>
</tr>
</table>
</form>
<div id="dlg-buttons2">
<a href="#" class="easyui-linkbutton" οnclick="savePasswd();">保存</a>
</div>
</div>
<div id="mm" class="easyui-menu" style="width: 150px;">
<div id="mm-tabupdate">刷新</div>
<div class="menu-sep"></div>
<div id="mm-tabclose">关闭</div>
<div id="mm-tabcloseall">全部关闭</div>
<div id="mm-tabcloseother">除此之外全部关闭</div>
<div class="menu-sep"></div>
<div id="mm-tabcloseright">当前页右侧全部关闭</div>
<div id="mm-tabcloseleft">当前页左侧全部关闭</div>
</div>
</body>
</html>
小程序演示地址:
链接:https://pan.baidu.com/s/1Ih2SZyh86nSseA7GncXPIg
提取码:8ygl
后台管理系统演示地址:
链接:https://pan.baidu.com/s/1NBX0e9aDHN-Lld033JzjWw
提取码:9oo9