Add some plugins to add contents to the frontpage.

This commit is contained in:
Catsworld
2017-01-24 10:45:03 +08:00
parent 97ed6d005e
commit 94641db52a
23 changed files with 174 additions and 9142 deletions
+4 -1
View File
@@ -13,6 +13,9 @@ class ContentController extends Controller
{
public function Mainpage()
{
return View::make('welcome');
$data = [];
$data['hotgoods'] = GoodInfo::orderby('sold_month', 'asc')->limit(5)->get();
$data['newgoods'] = GoodInfo::orderby('id', 'dsc')->limit(6)->get();
return View::make('welcome')->with($data);
}
}
+1 -1
View File
@@ -184,7 +184,7 @@ class GoodController extends Controller
$good->save();
$new_good = GoodInfo::orderby('id', 'dsc')->first();
Storage::put(
'good/titlepic/'.$new_good->id,
'good/titlepic/'.sha1($new_good->id),
file_get_contents($request->file('goodTitlePic')->getRealPath())
);
return Redirect::to('/good/add');
@@ -14,7 +14,7 @@ class CreateUsersTable extends Migration
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->integer('priviledge');
$table->integer('privilege');
$table->string('username')->unique();
$table->string('password');
$table->string('stuid');
@@ -24,6 +24,8 @@ class CreateGoodInfoTable extends Migration
$table->integer('counts');
$table->text('good_tag');
$table->integer('checked');
$table->integer('sold_total');
$table->integer('sold_month');
$table->timestamps();
});
}
+1 -1
View File
@@ -12,7 +12,7 @@ class UserSeeder extends Seeder
public function run()
{
DB::table('users')->insert([
'priviledge' => 2,
'privilege' => 2,
'username' => 'admin',
'password' => sha1('administrator'),
'nickname' => '超级管理员',
View File
+57 -16
View File
@@ -1,23 +1,22 @@
@font-face {
font-family: main;
src: url('/font/main.otf') format("opentype");
}
html {
overflow-x: hidden;
}
body {
.banner {
background-image: url('/img/pagebg.jpg');
background-size: 100%;
background-repeat: no-repeat;
font-family: Arial;
position: absolute;
top: -5px;
left: -5px;
width: 105%;
max-width: 150%;
height: 160px;
}
.button {
box-shadow: 0 -2px 0 rgba(0, 0, 0, 0.2) inset;
border: none;
border-radius: 3px;
}
.button:active {
@@ -29,7 +28,6 @@ body {
box-shadow: rgba(0, 0, 0, 0.1) 0 1px 2px;
padding-top: 0;
padding-bottom: 0;
font-family: main;
}
.top-bar .menu {
@@ -75,7 +73,7 @@ body {
width: 100%;
height: 100%;
z-index: 100;
background-color: rgba(255, 255, 255, 0.25);
background-color: rgba(255, 255, 255, 0.4);
}
.top-bar-bg {
@@ -93,10 +91,6 @@ body {
z-index: 50;
}
.banner {
font-family: main;
}
#top-bar-quick-access {
position: relative;
top: 30px;
@@ -105,5 +99,52 @@ body {
.page-content {
position: relative;
z-index: 50;
margin-top: 2.8rem;
}
margin-top: 60px;
}
#slides {
display:none;
}
#slides .slidesjs-container {
margin-bottom:10px;
}
#slides .slidesjs-previous {
margin-right: 5px;
float:left;
}
#slides .slidesjs-next {
margin-right: 5px;
float:left;
}
.slidesjs-pagination {
margin:6px 0 0;
float: right;
list-style: none;
}
.slidesjs-pagination li {
float: left;
margin: 0 1px;
}
.slidesjs-pagination li a {
display: block;
width: 13px;
height: 0;
padding-top: 13px;
background-image: url(/img/pagination.png);
background-position: 0 0;
float: left;
overflow: hidden;
}
.slidesjs-pagination li a.active, .slidesjs-pagination li a:hover.active { background-position: 0 -13px }
.slidesjs-pagination li a:hover { background-position: 0 -26px }
#slides a:link, #slides a:visited { color: #333 }
#slides a:hover, #slides a:active { color: #9e2020 }
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

+3 -5
View File
@@ -1,5 +1,3 @@
function goodList_changeCat(cat_id) {
if (cat_id == 0) window.location.href = '/good';
else window.location.href = '?cat_id=' + cat_id;
}
$(document).foundation();
$(document).ready(function() {
$(document).foundation();
});
+4
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-9069
View File
File diff suppressed because it is too large Load Diff
+16 -18
View File
@@ -1,27 +1,25 @@
# Laravel PHP Framework
[![Build Status](https://travis-ci.org/laravel/framework.svg)](https://travis-ci.org/laravel/framework)
[![Total Downloads](https://poser.pugx.org/laravel/framework/d/total.svg)](https://packagist.org/packages/laravel/framework)
[![Latest Stable Version](https://poser.pugx.org/laravel/framework/v/stable.svg)](https://packagist.org/packages/laravel/framework)
[![Latest Unstable Version](https://poser.pugx.org/laravel/framework/v/unstable.svg)](https://packagist.org/packages/laravel/framework)
[![License](https://poser.pugx.org/laravel/framework/license.svg)](https://packagist.org/packages/laravel/framework)
# NEUP-FleaMarket
====
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as authentication, routing, sessions, queueing, and caching.
### Todolist (Progress)
Laravel is accessible, yet powerful, providing tools needed for large, robust applications. A superb inversion of control container, expressive migration system, and tightly integrated unit testing support give you the tools you need to build any application with which you are tasked.
* Appearances
* [x] Header
* [ ] Homepage
## Official Documentation
* Functions of good
* [ ] GoodList (Frontend)
* [ ] Manage goods (Frontend)
* [ ] FavList (Frontend)
* [ ] Transaction
Documentation for the framework can be found on the [Laravel website](http://laravel.com/docs).
* Functions of user
* [ ] Basic user function (Frontend)
* [ ] Mail
## Contributing
* Functions of admin
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](http://laravel.com/docs/contributions).
## Security Vulnerabilities
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell at taylor@laravel.com. All security vulnerabilities will be promptly addressed.
## License
The Laravel framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).
##### Made By NEUP-Net-Depart
+1 -1
View File
@@ -14,7 +14,7 @@
{{ $good->description }}</p>
<div class="row">
<p>
<img src="/good/{{ $good->id }}/titlepic"/>
<img src="/good/{{ sha1($good->id) }}/titlepic"/>
</p>
</div>
<div class="row">
+8 -12
View File
@@ -1,31 +1,27 @@
@include('includes.head')
<title>先锋市场</title>
</head>
<body>
@include('layout.header')
<div class="page-content">
<div class="row">
<div class="small-10 small-centered columns">
<select size="1" name="D1" onChange="javascript:goodList_changeCat(this.value)">
<option value="0" @if($cat_id == 0)selected="selected"@endif>*</option>
<div class="small-0 medium-2 columns">
<ul class="menu vertical">
<li @if($cat_id == 0) class="active" @endif><a href="/good">*</li>
@foreach($cats as $cat)
<option value="{{$cat->id}}" @if($cat_id == $cat->id)selected="selected"@endif>{{$cat->cat_name}}</option>
<li @if($cat_id == $cat->id) class="active" @endif><a href="/good?cat_id={{ $cat->id }}">{{ $cat->cat_name }}</li>
@endforeach
</select>
</ul>
</div>
<div class="small-12 medium-10 columns">
<table class="hover">
@foreach($goods as $good)
<tr class="cat{{ $good->cat_id }}">
<td><a href="/good/{{$good->id}}"><img src="/good/{{ $good->id }}/titlepic" style="width:5rem;height:5rem;"/></a></td>
<td><a href="/good/{{$good->id}}"><img src="/good/{{ sha1($good->id) }}/titlepic" style="width:5rem;height:5rem;"/></a></td>
<td>{{ $good->good_name }}</td>
<td><span style="color: #FF0033"><b>¥{{ $good->pricemin }}@if($good->type == 0) - ¥{{ $good->pricemax }}@else(拍卖中)@endif</b></span></td>
<td>@if($good->counts > 0)<span style="color: #3333FF">库存:{{ $good->counts }}@else<span style="color: #FF5555">无库存QAQ @endif</span></td>
</tr>
@endforeach
</table>
<a href="/good/add" class="button">添加商品</a>
<a href="/good/my" class="button">我的商品</a>
</div>
</div>
</div>
@include('layout.footer')
@include('includes.foot')
+7 -5
View File
@@ -1,6 +1,8 @@
<script src="/js/vendor/jquery.js"></script>
<script src="/js/vendor/what-input.js"></script>
<script src="/js/vendor/foundation.js"></script>
<script src="/js/app.js"></script>
<script src="js/jquery.slides.min.js"></script>
<script src="js/vendor/what-input.min.js"></script>
<script src="js/foundation.min.js"></script>
<script>
$(document).foundation();
</script>
</body>
</html>
</html>
+6 -4
View File
@@ -1,8 +1,10 @@
<!DOCTYPE HTML>
<html>
<html class="no-js" lang="zh_cn">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/css/foundation.css">
<link rel="stylesheet" href="/css/app.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/css/foundation.css" />
<link rel="stylesheet" href="/css/app.css" />
<script src="/js/jquery.min.js"></script>
<script src="/js/vendor/jquery.min.js"></script>
+3
View File
@@ -0,0 +1,3 @@
</div>
</div>
</div>
+16 -4
View File
@@ -1,13 +1,17 @@
</head>
<body>
<div class="top-bar">
<div id="responsive-menu">
<div class="top-bar-back">
<div class="top-bar-bg"></div>
<div class="top-bar-filter"></div>
</div>
<div class="row">
<div class="medium-10 medium-offset-1 columns">
<div class="top-bar-left">
<ul class="dropdown menu" data-dropdown-menu>
<li><a class="top-bar-list" href="/">主页</a></li>
<li><a class="top-bar-list" href="/good">商品</a></li>
<li><a class="top-bar-list" href="/">首页</a></li>
<li><a class="top-bar-list" href="/good">市场</a></li>
</ul>
</div>
<div class="top-bar-right">
@@ -23,8 +27,16 @@
@endif
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="banner row">
@include('layout.search')
<div class="banner">
</div>
<div class="row">
<div class="medium-10 medium-centered columns">
@include('layout.search')
</div>
</div>
<div class="page-content row">
<div class="medium-10 medium-centered columns">
+37 -4
View File
@@ -1,9 +1,42 @@
@include('includes.head')
<title>先锋市场</title>
</head>
<body>
@include('layout.header')
<div class="page-content">
<style>
#slides {
display:none;
}
</style>
<div class="row">
<div class="small-12 medium-8 columns">
<div id="slides">
@foreach($hotgoods as $good)
<a href="/good/{{ $good->id }}"><img src="/good/{{ sha1($good->id) }}/titlepic"/></a>
@endforeach
</div>
</div>
<div class="small-12 medium-4 columns">
<div class="medium-8 medium-offset-4 columns" style="background-color:#66ccff">
公告的位置
</div>
</div>
</div>
<script>
$(function(){
$("#slides").slidesjs({
navigation: {
active: false,
},
play: {
active: false,
effect: "slide",
interval: 5000,
auto: true,
swap: true,
pauseOnHover: false,
restartDelay: 2500
}
});
});
</script>
@include('layout.footer')
@include('includes.foot')
@include('includes.foot')