基于Springboot vue智能美食推荐系统【协同过滤 前后端分离】全套视频教程

【全套开发工具】

Idea JDK1.8 Maven MySQL nginx vscode

技术栈: SpringBoot,SSM, MYSQL, Vue,Layui,JQUERY,HTML,CSS, JAVASCRIPT,

前后台分离,日历控件,协同过滤(余弦函数)-基于用户过滤

代码下载链接:https://pan.baidu.com/s/1EbuhtRNo9jI0sGkgRz3LbA 提取码:8888

【代码包含内容】

【视频教程包含内容】

首页访问 http://localhost:8080/vue_gxhfztjxt

管理员admin 123456

商家 seller1 123456

买家 user1 123456

本系统包含买家,卖家,后台管理员三种角色的用户

买家用户的功能包含: 登录,退出,修改密码,用户信息查看与修改,首页信息展示,轮播图,美食分类列表信息查看,网站公告列表,网站公告详情,协同过滤推荐美食,全部网站美食,猜你喜欢美食,美食详情查看,购物车,结算,付款,发货,确认收货,订单明细,收藏美食,我的收藏,意见反馈,我的意见反馈。

卖家用户的功能包含: 登录,退出,上传商品,编辑美食,删除美食,订单管理,发货,评价信息管理。

管理员的功能包含: 登录,退出,修改密码,管理员管理,提示问题信息管理,商户信息管理,网站用户信息管理,美食新闻公告信息管理,美食类型信息管理,美食信息管理,订单信息管理,用户评价信息管理,意见反馈信息管理

【项目运行截图】

【部分代码】

application.properties

#\u7AEF\u53E3\u53F7\u8BBE\u7F6E
server.port=8080 

#\u8BBF\u95EE\u8DEF\u5F84\u8BBE\u7F6E
server.servlet.context-path=/vue_gxhfztjxt
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=100MB
#\u8BBE\u7F6E\u65E5\u5FD7\u7EA7\u522B
#lv: TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF. \u9ED8\u8BA4\uFF1AINFO
logging.level.root=INFO
logging.level.org.springframework.web=INFO
logging.level.org.hibernate=INFO
logging.level.org.springframework=DEBUG
logging.level.com.dao.*=DEBUG

#\u5B57\u7B26\u96C6 -\u7528\u4E8E\u89E3\u7801URI\u7684\u5B57\u7B26\u7F16\u7801  \u672C\u8EAB\u9ED8\u8BA4UTF-8
server.tomcat.uri-encoding=UTF-8

#HTTP\u8BF7\u6C42\u548C\u54CD\u5E94\u7684\u5B57\u7B26\u96C6\u3002\u5982\u679C\u672A\u660E\u786E\u8BBE\u7F6E\uFF0C\u5219\u6DFB\u52A0\u5230\u201CContent-Type\u201D\u5934 ;\u672C\u8EAB\u9ED8\u8BA4UTF-8
#spring.http.encoding.charset=UTF-8

#springboot mybatis
#\u52A0\u8F7D mybatis\u914D\u7F6E\u6587\u4EF6
mybatis.config-location = classpath:mybatis.xml
#mybatis.type-aliases-package = com.boot.entity

#\u6570\u636E\u5E93\u8FDE\u63A5\u914D\u7F6E\u6587\u4EF6
#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#spring.datasource.url=jdbc:mysql://localhost:3307/vue_gxhfztjxt?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false&serverTimezone=UTC
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/vue_gxhfztjxt?useUnicode=true&characterEncoding=UTF-8
spring.datasource.username=root
spring.datasource.password=root

spring.servlet.multipart.maxFileSize=1000MB
spring.servlet.multipart.maxRequestSize=1000MB


前端代码

<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="utf-8">
    <title>美食商城</title>
    <link href="./themes/ecmoban_dangdang/style.css" rel="stylesheet" type="text/css" />
</head>

<body>
    <div id="app">
        <div class="top_nav">
            <div class="block">
                <ul class="top_bav_l">
                </ul>
                <div class="header_r">
                    <font id="ECS_MEMBERZONE" v-if="islogin"> 欢迎光临美食商城! <s></s>&nbsp; <span> <a style="color: #FF6766;"
                                href="login.html">[用户登录]</a> <a style="color: #FF6766;" href="register.html">[用户注册]</a>
                            <a style="color: #FF6766;" href="slogin.html">[商户登录]</a>
                            <a style="color: #FF6766;" href="sregister.html">[商户注册]</a>
                        </span>
                    </font>
                    <font id="ECS_MEMBERZONE" v-if="!islogin"> 欢迎美食推荐系统 <b>{{ realname }}</b> <span><a style="color: #FF6766;"
                                href="cart.html">[购物车]</a><a style="color: #FF6766;" href="usercenter.html">[用户中心]</a>
                            <a style="color: #FF6766;" href="exit.html">[退出系统] </a> </span>
                    </font>
                </div>
            </div>
        </div>
        <div class="clearfix">
            <div class="block header">
                <div class="top">
                    <a href="index.html" class="logo"><img src="themes/ecmoban_dangdang/images/logo.gif" /></a>
                    <div class="head_r">
                        <div class="top_shopCart clearfix"></div>
                    </div>
                </div>
            </div>
        </div>
        <div style="clear: both"></div>
        <div class="menu_box clearfix">
            <div class="block">
                <div class="menu">
                    <a href="index.html" class="cur" rel="nofollow">网站首页</a>
                    <a href="article.html" class="cur" rel="nofollow">美食商城公告</a>
                    <span v-if="!islogin">
                        <a href="recommend.html" class="cur" rel="nofollow">智能推荐美食</a>
                    </span>
                    <a href="all.html" class="cur" rel="nofollow">全部美食</a>
                </div>
            </div>
        </div>
        <div class="block box">
            <div class="blank"></div>
            <div id="ur_here">
                当前位置: <a href="index.html">首页</a>
                <code>&gt;</code>
                <a href="all.html">全部美食</a>
                <code> &gt; </code>
                <a :href="'cate.html?id='+goods.cateid+''">{{ goods.catename }}</a>
            </div>
        </div>
        <div class="blank"></div>
        <div class="block clearfix">
            <div class="AreaL">
                <div id="category_tree" class="category_tree">
                    <div class="title">所有美食分类</div>
                    <dl class="clearfix" style="background: #fafafa; width: 216px; padding: 0;">
                        <div class="box1 cate" id="cate">
                            <h1 style="border-top: none" v-for="item in cateList" :key="item.cateid">
                                <a :href="'cate.html?id='+item.cateid+''" class="  f_l">{{ item.catename }}</a>
                            </h1>
                        </div>
                        <div style="clear: both"></div>
                    </dl>
                </div>
                <div class="blank"></div>
                <div class="box" id='history_div'>
                    <div class="box_1">
                        <h3>
                            <span>猜你喜欢</span>
                        </h3>
                        <div class="boxCenterList clearfix" id='history_list'>
                            <ul class="clearfix" v-for="item in hotList" :key="item.goodsid">
                                <li class="goodsimg">
                                    <a :href="'detail.html?id='+item.goodsid+''" target="_blank"><img
                                            :src="'http://localhost:8080/vue_gxhfztjxt/upfiles/'+item.image" alt=""
                                            class="B_blue" /> </a>
                                </li>
                                <li><a :href="'detail.html?id='+item.goodsid+''" target="_blank"
                                        title="">{{item.goodsname}}</a> <br /> 价格:
                                    <font class="f1">¥{{item.price}}元</font>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="blank5"></div>
            </div>
            <div class="AreaR">
                <div id="goodsInfo" class="clearfix">
                    <div class="imgInfo">
                        <img :src="'http://localhost:8080/vue_gxhfztjxt/upfiles/'+goods.image" alt="" width="360px;"
                            height="360px" />
                        <div class="blank5"></div>
                        <div class="blank"></div>
                    </div>
                    <div class="textInfo">
                        <form action="index/addcart.action" method="post" name="ECS_FORMBUY" id="ECS_FORMBUY">
                            <h1 class="clearfix">{{ goods.goodsname }}</h1>
                            <ul class="ul2 clearfix">
                                <li class="clearfix" style="width: 100%">
                                    <dd>
                                        <strong>价格:</strong>
                                        <font class="shop" id="ECS_SHOPPRICE">¥{{ goods.price }}元</font>
                                    </dd>
                                </li>
                                <li class="clearfix" style="width: 100%">
                                    <dd>
                                        <strong>美食类型:</strong><a
                                            :href="'cate.html?id='+goods.cateid+''">{{ goods.catename }}</a>
                                    </dd>
                                </li>
                                <li class="clearfix" style="width: 100%">
                                    <dd>
                                        <strong>加入收藏:</strong><a href="javascript:;" @click="addfav();">加入收藏</a>
                                    </dd>
                                </li>
                                <li class="clearfix" style="width: 100%">
                                    <dd>
                                        <strong>上架日期:</strong>{{ goods.addtime }}
                                    </dd>
                                </li>
                                <li class="clearfix" style="width: 100%">
                                    <dd>
                                        <strong>点击数:</strong>{{ goods.hits }}
                                    </dd>
                                </li>
                                <li class="clearfix" style="width: 100%">
                                    <dd>
                                        <strong>销量:</strong>{{ goods.sellnum }}
                                    </dd>
                                </li>
                            </ul>
                            <ul class="bnt_ul">
                                <li class="clearfix">
                                    <dd>
                                        <strong>购买数量:</strong> <input name="num" type="text" id="number"
                                            v-model="number" value="1" size="4" style="border: 1px solid #ccc;" />
                                    </dd>
                                </li>
                                <li class="padd">
                                    <a href="javascript:;" @click="addcart()"><img
                                            src="themes/ecmoban_dangdang/images/goumai2.png" /></a>
                                </li>
                            </ul>
                        </form>
                    </div>
                </div>
                <div class="blank"></div>


                <div class="box">

                    <div style="padding: 0 0px;">
                        <div id="com_b" class="history clearfix">
                            <h2>美食描述</h2>
                        </div>
                    </div>
                    <div class="box_1">
                        <div id="com_v" class="  " style="padding: 6px;"></div>
                        <div id="com_h">
                            <blockquote>{{ goods.contents }}</blockquote>
                        </div>
                    </div>
                    <div class="blank"></div>
                    <div id="ECS_COMMENT">
                        <div class="box">
                            <div class="box_1">
                                <h3>
                                    <span class="text">用户评论</span>(共
                                    <font class="f1">{{topicList.length}}</font>条评论)
                                </h3>
                                <div class="boxCenterList clearfix" style="height: 1%;">
                                    <ul class="comments">
                                        <li class="word" v-for="item in topicList" :key="item.topicid">
                                            <font class="f2">{{item.username}}</font>
                                            <font class="f3">({{item.addtime}}) </font> <br />
                                            <img :src="'themes/ecmoban_dangdang/images/stars'+ item.num + '.gif'" alt="" />
                                            <p>{{item.contents}}</p>




                                        </li>
                                    </ul>
                                    <div class="blank5"></div>
                                </div>
                            </div>
                        </div>
                        <div class="blank5"></div>
                    </div>
                </div>
                <div class="blank"></div>
            </div>
            <div id="footer">
                <div class="footer">
                    <div class="footer_nav_box">
                        <div class="footer_copyright">
                            <span> &copy; 美食商城 版权所有,并保留所有权利。<br /> <br />服务时间:09:00-23:00<br /> <br /> <a
                                    href="../admin/index.html" target="_blank">管理员入口</a>
                            </span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
<!--此页面业务相关的脚本-->
<script type="text/javascript">
     vue = new Vue({ // 实例化Vue对象
        el: '#app', // 绑定作用域
        data: { //定义数据 用于vue的双向绑定
            id: '',
            islogin: '',
            userid: '',
            realname: '',
            cate: '',
            number: '1',
            cateList: {}, // 用来保存商品类型对象数据
            hotList: {},
            goodsList: {}, // 用来保存前端显示数据
            page: {},
            count: 0,
            page: 1,
            limit: 12,
            goods: [],
            topicList: {},
        },
        methods: {
            getUrlParam: function () {
                var name, value;
                var str = location.href; // 取得整个地址栏
                var num = str.indexOf("?"); // 定位参数起始位置
                str = str.substr(num + 1); // 取得所有参数 
                var arr = str.split("&"); // 各个参数放到数组里
                for (var i = 0; i < arr.length; i++) 
                    if (num > 0) {
                        name = arr[i].substring(0, num);
                        value = arr[i].substr(num + 1);
                        this.id = value; // 确认主键参数
                    }
                }
            },
            loadPage: function () {
                let _this = this;
                _this.getUrlParam();
                
                axios.get('http://localhost:8080/vue_gxhfztjxt/index/front.action').then(result => {
                    _this.cateList = result.data.cateList;
                    _this.hotList = result.data.hotList;
                });
                _this.userid = sessionStorage.getItem('userid');
                _this.islogin = sessionStorage.getItem('userid') == null;
                _this.realname = sessionStorage.getItem('realname');
                if(_this.islogin){
                    axios.get('http://localhost:8080/vue_gxhfztjxt/index/detail.action?id=' + _this.id).then(
                    result => {
                        _this.goods = result.data.goods;
                        _this.topicList = result.data.topicList;
                    });
                }else{
                    axios.get('http://localhost:8080/vue_gxhfztjxt/index/userdetail.action?id=' + _this.id+'&userid='+_this.userid).then(
                    result => {
                        _this.goods = result.data.goods;
                        _this.topicList = result.data.topicList;
                    });
                }
            },
            addcart: function () {
                let _this = this;
                var data = {
                    goodsid: _this.id,
                    userid: _this.userid,
                    price: _this.goods.price,
                    num: _this.number,
                };
                axios.post('http://localhost:8080/vue_gxhfztjxt/index/addcart.action', data).then(
                result => {
                    if (result.data.code > 0) {
                        window.location.href = "cart.html";
                    } else {
                        alert(result.data.message);
                    }
                });
            },
            addfav: function () {
                let _this = this;
                var data = {
                    goodsid: _this.id,
                    userid: _this.userid,
                };
                axios.post('http://localhost:8080/vue_gxhfztjxt/index/addfav.action', data).then(result => {
                    if (result.data.code > 0) {
                        window.location.href = "myfav.html";
                    } else {
                        alert(result.data.message);
                    }
                });
            }
        },
        created() { // 生命周期相关的函数
            this.loadPage();
        },
    })
</script
</html>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值