国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 學(xué)院 > 開(kāi)發(fā)設(shè)計(jì) > 正文

基于springMVC+angular+bootstrap+mysql的簡(jiǎn)易購(gòu)物網(wǎng)站搭建

2019-11-15 01:15:37
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
基于sPRingMVC+angular+bootstrap+MySQL的簡(jiǎn)易購(gòu)物網(wǎng)站搭建  介紹

  前端的CSS框架用了bootstrap, 以及bootstrap的JS組件, 以及很好用的angular(angular大法好), 項(xiàng)目一共包含了7個(gè)靜態(tài)界面, 靜態(tài)界面的數(shù)據(jù)展示都使用了angularJS , 后端是基于java的spring, 容器為tomcat, 項(xiàng)目代碼分享到百度云盤(pán), 這個(gè)項(xiàng)目的優(yōu)勢(shì)是, 所有的顯示都是在前端完成, 數(shù)據(jù)交互也是通過(guò)Ajax完成, 沒(méi)有頻繁的頁(yè)面跳轉(zhuǎn);先上兩張商城的主圖

  圖一:

    、  

  圖2:

  

  該頁(yè)面可以完成商品的評(píng)價(jià), 添加商品, 商品的搜索等功能 , 界面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

數(shù)據(jù)庫(kù)的用戶(hù)表關(guān)聯(lián)的, 也就是說(shuō)是管理員的時(shí)候, 才能進(jìn)入后臺(tái)頁(yè)編輯商品,編輯評(píng)論等高級(jí)功能:

    

  界面代碼:

<%@ 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">首頁(yè)</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">商品類(lèi)型編輯??</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">所有評(píng)論</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>手機(jī)?</th>                              <th>詳細(xì)信息</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="###">                                    查看訂單詳細(xì)信息                                  </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}}, 的總數(shù)是為{{com.commodityCount}}</p>                                    <div commodity-directive id="{{com.commodityId}}">                                        <p>商品名字?{{res.name}}</p>                                        <p>商品描述?{{res.depict}}</p>                                        <p>商品廠商{{res.manufacturer}}</p>                                        <p>商品價(jià)格?{{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">類(lèi)型</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 )">刪除該類(lèi)型</button>                                        </p>                                    </div>                                </li>                            </ul>                        </div>                        <div class="row">                            <input placeholder="新類(lèi)型名字" id="new_type" ng-model="new_type">                            <button class="btn btn-default" ng-click="new_type_fn()">創(chuàng)建新類(lèi)型??</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">                                  創(chuàng)建新商品??                            </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>商品價(jià)格?{{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íng)論列表:</p>                                <div commodity-directive id="{{comment.commodityId}}">                                    <p>商品名字{{res.name}}</p>                                    <p>商品描述?{{res.depict}}</p>                                </div>                                <div>                                    <strong>{{comment.userName}} <b>說(shuō)</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">創(chuàng)建商品</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="商品價(jià)格">              </div>              <div class="form-group">                <label for="amount">amount</label>                <input type="text" class="form-control" id="amount" placeholder="商品個(gè)數(shù)">              </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) {
發(fā)表評(píng)論 共有條評(píng)論
用戶(hù)名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 南江县| 桃江县| 北辰区| 通山县| 广昌县| 西林县| 静海县| 宽甸| 泉州市| 普兰县| 陇南市| 迭部县| 马龙县| 林周县| 清徐县| 绥阳县| 拜城县| 林州市| 七台河市| 阳春市| 象州县| 乡宁县| 连平县| 宜宾县| 盐池县| 桓仁| 望谟县| 拉孜县| 聂荣县| 恩施市| 武夷山市| 宜城市| 永州市| 邹城市| 万载县| 桃园县| 双城市| 兴国县| 安仁县| 济阳县| 杭州市|