麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 學院 > 開發設計 > 正文

基于springMVC+angular+bootstrap+mysql的簡易購物網站搭建

2019-11-15 01:15:37
字體:
來源:轉載
供稿:網友
基于sPRingMVC+angular+bootstrap+MySQL的簡易購物網站搭建  介紹

  前端的CSS框架用了bootstrap, 以及bootstrap的JS組件, 以及很好用的angular(angular大法好), 項目一共包含了7個靜態界面, 靜態界面的數據展示都使用了angularJS , 后端是基于java的spring, 容器為tomcat, 項目代碼分享到百度云盤, 這個項目的優勢是, 所有的顯示都是在前端完成, 數據交互也是通過Ajax完成, 沒有頻繁的頁面跳轉;先上兩張商城的主圖

  圖一:

    、  

  圖2:

  

  該頁面可以完成商品的評價, 添加商品, 商品的搜索等功能 , 界面jsp代碼:

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><!DOCTYPE html><html>  <head>    <title>detail.html</title>        <meta http-equiv="keyWords" content="keyword1,keyword2,keyword3">    <meta http-equiv="descr

數據庫的用戶表關聯的, 也就是說是管理員的時候, 才能進入后臺頁編輯商品,編輯評論等高級功能:

    

  界面代碼:

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><!DOCTYPE html><html><head>    <title>admin.html</title>    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">    <meta http-equiv="description" content="this is my page">    <meta http-equiv="content-type" content="text/html; charset=UTF-8">    <link rel="stylesheet" type="text/css" href="../css/bootstrap-3.2.0/dist/css/bootstrap.min.css"/>    <script src="http://cdn.bootcss.com/jquery/2.1.3/jquery.min.js"></script>    <script src="http://cdn.bootcss.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>    <script src="http://cdn.bootcss.com/angular.js/1.3.15/angular.min.js"></script>    <style>        .bs-example {            position: relative;            padding: 45px 15px 15px;            margin: 0 -15px 15px;            border-color: #E5E5E5 #EEE #EEE;            border-style: solid;            border-width: 1px 0;            -webkit-box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.05);            box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.05);        }    </style></head><body>    <div class="container" ng-app="app">        <div class="row">            <h2>                  <a href="../index.do">首頁</a>            </h2>        </div>        <div class="row">            <div class="bs-example bs-example-tabs" data-example-id="togglable-tabs">                <ul id="myTabs" class="nav nav-tabs" role="tablist">                    <li role="presentation" class="active">                        <a id="tab0" href="#orderform" id="home-tab" role="tab" data-toggle="tab" aria-controls="orderform" aria-expanded="true">所有訂單</a>                    </li>                    <li role="presentation">                        <a id="tab1" href="#types" id="types-tab" role="tab" data-toggle="tab" aria-controls="types" aria-expanded="true">商品類型編輯??</a>                    </li>                    <li role="presentation">                        <a id="tab2" href="#pro" role="tab" id="pro-tab" data-toggle="tab" aria-controls="pro">商品編輯??</a>                    </li>                    <li role="presentation">                        <a id="tab3" href="#about" role="tab" id="about-tab" data-toggle="tab" aria-controls="about">所有評論</a>                    </li>                </ul>                <div id="myTabContent" class="tab-content">                    <div role="tabpanel" class="tab-pane fade in active orderform" id="orderform" aria-labelledby="home-tab"   ng-controller="orderform">                        <table class="table table-hover table-bordered">                          <thead>                            <tr>                              <th>訂單id</th>                              <th>地址</th>                              <th>總金額?</th>                              <th>手機?</th>                              <th>詳細信息</th>                            </tr>                          </thead>                          <tbody>                            <tr ng-repeat="item in orderforms">                              <th scope="row">{{item.id}}</th>                              <td>{{item.address}}</td>                              <td>{{item.totalPrice}}</td>                              <td>{{item.phone}}</td>                              <th>                                  <a ng-click="showInfo(item.orderlist)" href="###">                                    查看訂單詳細信息                                  </a>                              </th>                            </tr>                            <tr>                          </tbody>                        </table>                        <div class="row">                            <ul class="list-group">                                <li  class="list-group-item" ng-repeat="com in commoditys">                                    <p>第{{$index+1}}條: 商品id為{{com.commodityId}}, 的總數是為{{com.commodityCount}}</p>                                    <div commodity-directive id="{{com.commodityId}}">                                        <p>商品名字?{{res.name}}</p>                                        <p>商品描述?{{res.depict}}</p>                                        <p>商品廠商{{res.manufacturer}}</p>                                        <p>商品價格?{{res.price}}</p>                                        <p>商品logo?<img ng-src={{res.img}}  width=50 height=50/></p>                                    </div>                                </li>                            </ul>                        </div>                    </div>                    <div role="tabpanel" class="tab-pane fade types" id="types" aria-labelledby="type-tab" ng-controller="types">                        <div class="row">                            <ul class="list-group">                                <li  class="list-group-item">類型</li>                                <li  class="list-group-item" ng-repeat="type in types">                                    <div >                                        <p>                                            {{type.name}}                                             <button class="btn btn-default pull-right" ng-click="delType( type.id )">刪除該類型</button>                                        </p>                                    </div>                                </li>                            </ul>                        </div>                        <div class="row">                            <input placeholder="新類型名字" id="new_type" ng-model="new_type">                            <button class="btn btn-default" ng-click="new_type_fn()">創建新類型??</button>                        </div>                    </div>                    <div id="pro" role="tabpanel" class="tab-pane fade" id="pro" aria-labelledby="pro-tab" ng-controller="pros">                           <br>                        <p>                            <button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">                                  創建新商品??                            </button>                        </p>                        <ul class="list-group">                            <li class="list-group-item" ng-repeat="com in coms">                                <p>商品名{{com.name}}</p>                                <p>商品描述?{{com.depict}}</p>                                <p>商品公司{{com.manufacturer}}</p>                                <p>商品價格?{{com.price}}</p>                                <p>商品logo?<img ng-src={{com.img}} width=50 height=50 /></p>                                <p>                                    <button class="btn btn-default" ng-click="removePro(com.id)">                                        刪除該商品??                                    </button>                                </p>                            </li>                        </ul>                    </div>                    <div  role="tabpanel" class="comments tab-pane fade" id="about" aria-labelledby="about-tab" ng-controller="comments">                        <ul class="list-group">                            <li class="list-group-item" ng-repeat="comment in comments">                                <p>評論列表:</p>                                <div commodity-directive id="{{comment.commodityId}}">                                    <p>商品名字{{res.name}}</p>                                    <p>商品描述?{{res.depict}}</p>                                </div>                                <div>                                    <strong>{{comment.userName}} <b>說</b></strong>                                    <span>{{comment.comment}}</span>                                </div>                            </li>                        </ul>                </div>            </div>        </div>    </div>            <!-- Modal start -->    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">      <div class="modal-dialog" role="document">        <div class="modal-content">          <div class="modal-header">            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>            <h4 class="modal-title" id="myModalLabel">創建商品</h4>          </div>          <div class="modal-body">            <form>              <div class="form-group">                <label for="name">name</label>                <input type=text class="form-control" id="name" placeholder="商品名">              </div>              <div class="form-group">                <label for="depict">depict</label>                <input type=text class="form-control" id="depict" placeholder="商品描述">              </div>              <div class="form-group">                <label for="price">price</label>                <input type=text class="form-control" id="price" placeholder="商品價格">              </div>              <div class="form-group">                <label for="amount">amount</label>                <input type="text" class="form-control" id="amount" placeholder="商品個數">              </div>              <div class="form-group">                <label for="manufacturer">manufacturer</label>                <input type="text" class="form-control" id="manufacturer"" placeholder="商品廠商">              </div>              <div class="form-group">                <label for="img">img</label>                <input type="text" class="form-control" id="img" readonly=true placeholder="圖片路徑">                <input type="file" value=上傳文件 id="upload">              </div>              <select id="select" ng-controller="select">                  <option ng-repeat="type in types" value="{{type.name}}">                      {{type.name}}                  </option>              </select>            </form>          </div>          <div class="modal-footer">            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>            <button id="submit"  type="button" class="btn btn-primary">Save changes</button>          </div>        </div>      </div>    </div>    <!-- Modal end-->        <script>        var app = angular.module("app", []);        app.directive("commodityDirective", function() {            return {                restrict : "EA",                scope : true,                link : function( $scope ,$el, $iattrs) {                    $.post("../getComById.do", {id:$iattrs.id},function( res ) {                        $scope.res = res[0];                        $scope.$apply();                    });                }            }        });                app.controller("orderform", function($scope) {                    $scope.orderforms = [];            $scope.commoditys = [];            $scope.showInfo = function( info ) {                $scope.commoditys = JSON.parse(info);            };                    });        $("#tab0").click(function() {            ajaxModule.getFormAllList(".orderform");        });                app.controller("types",function($scope) {
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 激情九九 | 久久综合给合久久狠狠狠97色69 | 日本韩国欧美一级片 | 性欧美极品xxxx欧美一区二区 | 一级一片免费 | 干少妇av | 91av在线影院 | 欧美一区2区三区4区公司二百 | 国产精品自拍av | 欧美性黄| 正在播放91视频 | 成人免费看视频 | 久久综合网址 | 免费久久久| 一级电影免费看 | 一级免费特黄视频 | 超级av在线| 精品一区二区在线观看 | 欧美日韩高清一区二区三区 | 毛片免费观看视频 | 国产成人在线一区 | 神马久久精品综合 | 欧美日韩视频第一页 | 欧美一级高潮片免费的 | 亚洲精品无码不卡在线播放he | 欧美日韩大片在线观看 | 九九热在线视频免费观看 | 少妇的肉体的满足毛片 | 午夜偷拍视频 | 一级黄色在线观看 | 曰韩黄色片 | 激情久久免费视频 | 欧美男女爱爱视频 | 久久艹一区 | 99riav国产在线观看 | 久久久精品福利 | 逼特逼视频在线观看 | 欧美成人亚洲 | 国产精品成人亚洲一区二区 | 懂色av懂色aⅴ精彩av | 精品国产一区二区三区在线观看 |