20 changed files with 842 additions and 27 deletions
-
48app/Common/Helper.php
-
26app/Common/function.php
-
84app/Http/Controllers/Admin/GoodsBrandController.php
-
3app/Http/Controllers/Api/QrcodeController.php
-
82app/Http/Controllers/Api/UserMessageController.php
-
2app/Http/Controllers/Home/CommonController.php
-
16app/Http/Controllers/Weixin/IndexController.php
-
50app/Http/Controllers/Weixin/UserController.php
-
80app/Http/Model/GoodsBrand.php
-
84app/Http/Model/UserMessage.php
-
4public/css/weixin/style.css
-
108resources/views/admin/GoodsBrand/add.blade.php
-
122resources/views/admin/GoodsBrand/edit.blade.php
-
29resources/views/admin/GoodsBrand/index.blade.php
-
2resources/views/weixin/index/index.blade.php
-
4resources/views/weixin/user/index.blade.php
-
2resources/views/weixin/user/register.blade.php
-
95resources/views/weixin/user/userMessageList.blade.php
-
16resources/views/weixin/user/userinfo.blade.php
-
12routes/web.php
@ -0,0 +1,84 @@ |
|||
<?php |
|||
namespace App\Http\Controllers\Admin; |
|||
|
|||
use App\Http\Controllers\Admin\CommonController; |
|||
use DB; |
|||
|
|||
class GoodsBrandController extends CommonController |
|||
{ |
|||
public function __construct() |
|||
{ |
|||
parent::__construct(); |
|||
} |
|||
|
|||
public function index() |
|||
{ |
|||
$data['posts'] = object_to_array(DB::table("goods_brand")->select('add_time', 'title', 'litpic', 'status', 'listorder', 'cover_img', 'click')->orderBy('id', 'desc')->get()); |
|||
return view('admin.GoodsBrand.index', $data); |
|||
} |
|||
|
|||
public function doadd() |
|||
{ |
|||
$_POST['add_time'] = time();//更新时间
|
|||
$_POST['click'] = rand(200,500);//点击
|
|||
|
|||
unset($_POST["_token"]); |
|||
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);} |
|||
|
|||
if(DB::table("goods_brand")->insert($_POST)) |
|||
{ |
|||
success_jump('添加成功!'); |
|||
} |
|||
else |
|||
{ |
|||
error_jump('添加失败!请修改后重新添加'); |
|||
} |
|||
} |
|||
|
|||
public function add() |
|||
{ |
|||
return view('admin.GoodsBrand.add'); |
|||
} |
|||
|
|||
public function edit() |
|||
{ |
|||
if(!empty($_GET["id"])){$id = $_GET["id"];}else{$id="";} |
|||
if(preg_match('/[0-9]*/',$id)){}else{exit;} |
|||
|
|||
$data['id'] = $id; |
|||
$data['post'] = object_to_array(DB::table('goods_brand')->where('id', $id)->first(), 1); |
|||
|
|||
return view('admin.GoodsBrand.edit', $data); |
|||
} |
|||
|
|||
public function doedit() |
|||
{ |
|||
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else {$id="";exit;} |
|||
|
|||
unset($_POST["_token"]); |
|||
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);} |
|||
|
|||
if(DB::table('goods_brand')->where('id', $id)->update($_POST)) |
|||
{ |
|||
success_jump('修改成功!', route('admin_goodsbrand')); |
|||
} |
|||
else |
|||
{ |
|||
error_jump('修改失败!请修改后重新添加'); |
|||
} |
|||
} |
|||
|
|||
public function del() |
|||
{ |
|||
if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump("删除失败!请重新提交");} //if(preg_match('/[0-9]*/',$id)){}else{exit;}
|
|||
|
|||
if(DB::table('goods_brand')->whereIn("id", explode(',', $id))->delete()) |
|||
{ |
|||
success_jump('删除成功'); |
|||
} |
|||
else |
|||
{ |
|||
error_jump("删除失败!请重新提交"); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,82 @@ |
|||
<?php |
|||
namespace App\Http\Controllers\Api; |
|||
|
|||
use App\Http\Controllers\Api\CommonController; |
|||
use Illuminate\Http\Request; |
|||
use App\Common\ReturnData; |
|||
use App\Common\Token; |
|||
use App\Http\Model\UserMessage; |
|||
|
|||
class UserMessageController extends CommonController |
|||
{ |
|||
public function __construct() |
|||
{ |
|||
parent::__construct(); |
|||
} |
|||
|
|||
//用户消息列表
|
|||
public function userMessageList(Request $request) |
|||
{ |
|||
//参数
|
|||
$data['limit'] = $request->input('limit', 10); |
|||
$data['offset'] = $request->input('offset', 0); |
|||
if($request->input('type', '') != ''){$data['type'] = $request->input('type');} |
|||
if($request->input('status', '') != ''){$data['status'] = $request->input('status');} |
|||
$data['user_id'] = Token::$uid; |
|||
|
|||
$res = UserMessage::getList($data); |
|||
if(!$res) |
|||
{ |
|||
return ReturnData::create(ReturnData::SYSTEM_FAIL); |
|||
} |
|||
|
|||
return ReturnData::create(ReturnData::SUCCESS,$res); |
|||
} |
|||
|
|||
//添加用户消息
|
|||
public function userMessageAdd(Request $request) |
|||
{ |
|||
//参数
|
|||
$data['des'] = $request->input('des',''); |
|||
if($request->input('type', '') != ''){$data['type'] = $request->input('type');} |
|||
if($request->input('title', '') != ''){$data['title'] = $request->input('title');} |
|||
if($request->input('litpic', '') != ''){$data['litpic'] = $request->input('litpic');} |
|||
$data['add_time'] = time(); |
|||
$data['user_id'] = Token::$uid; |
|||
|
|||
if($data['des']=='') |
|||
{ |
|||
return ReturnData::create(ReturnData::PARAMS_ERROR); |
|||
} |
|||
|
|||
$res = UserMessage::add($data); |
|||
if(!$res) |
|||
{ |
|||
return ReturnData::create(ReturnData::SYSTEM_FAIL); |
|||
} |
|||
|
|||
return ReturnData::create(ReturnData::SUCCESS,$res); |
|||
} |
|||
|
|||
//修改用户消息
|
|||
public function userMessageUpdate(Request $request) |
|||
{ |
|||
//参数
|
|||
if($request->input('des', '') != ''){$data['des'] = $request->input('des');} |
|||
if($request->input('type', '') != ''){$data['type'] = $request->input('type');} |
|||
if($request->input('title', '') != ''){$data['title'] = $request->input('title');} |
|||
if($request->input('litpic', '') != ''){$data['litpic'] = $request->input('litpic');} |
|||
if($request->input('status', '') != ''){$data['status'] = $request->input('status');} |
|||
|
|||
$where['id'] = $request->input('id'); |
|||
$where['user_id'] = Token::$uid; |
|||
|
|||
$res = UserMessage::modify($where,$data); |
|||
if($res === false) |
|||
{ |
|||
return ReturnData::create(ReturnData::SYSTEM_FAIL); |
|||
} |
|||
|
|||
return ReturnData::create(ReturnData::SUCCESS,$res); |
|||
} |
|||
} |
@ -0,0 +1,80 @@ |
|||
<?php |
|||
namespace App\Http\Model; |
|||
use App\Common\ReturnData; |
|||
use DB; |
|||
|
|||
class GoodsBrand extends BaseModel |
|||
{ |
|||
//商品品牌
|
|||
|
|||
protected $table = 'goods_brand'; |
|||
public $timestamps = false; |
|||
protected $guarded = array(); //$guarded包含你不想被赋值的字段数组。
|
|||
|
|||
const UN_SHOW = 1; // 不显示
|
|||
const IS_SHOW = 0; // 显示
|
|||
|
|||
public static function getList(array $param) |
|||
{ |
|||
extract($param); //参数:group_id,limit,offset
|
|||
|
|||
$limit = isset($limit) ? $limit : 10; |
|||
$offset = isset($offset) ? $offset : 0; |
|||
|
|||
$where['status'] = self::IS_SHOW; |
|||
$model = new self; |
|||
|
|||
if($where){$model = $model->where($where);} |
|||
|
|||
$res['count'] = $model->count(); |
|||
$res['list'] = array(); |
|||
|
|||
if($res['count']>0) |
|||
{ |
|||
$res['list'] = $model->orderBy('listorder', 'asc')->skip($offset)->take($limit)->get(); |
|||
} |
|||
else |
|||
{ |
|||
return false; |
|||
} |
|||
|
|||
return $res; |
|||
} |
|||
|
|||
public static function getOne(array $where) |
|||
{ |
|||
extract($where); |
|||
|
|||
return self::where($where)->first(); |
|||
} |
|||
|
|||
public static function add(array $data) |
|||
{ |
|||
if ($id = self::insertGetId($data)) |
|||
{ |
|||
return $id; |
|||
} |
|||
|
|||
return false; |
|||
} |
|||
|
|||
public static function modify($where, array $data) |
|||
{ |
|||
if (self::where($where)->update($data) !== false) |
|||
{ |
|||
return true; |
|||
} |
|||
|
|||
return false; |
|||
} |
|||
|
|||
public static function remove($id) |
|||
{ |
|||
if (!self::whereIn('id', explode(',', $id))->delete()) |
|||
{ |
|||
return false; |
|||
} |
|||
|
|||
return true; |
|||
} |
|||
} |
@ -0,0 +1,84 @@ |
|||
<?php |
|||
namespace App\Http\Model; |
|||
|
|||
class UserMessage extends BaseModel |
|||
{ |
|||
//用户消息
|
|||
|
|||
protected $table = 'user_message'; |
|||
public $timestamps = false; |
|||
|
|||
/** |
|||
* 不能被批量赋值的属性 |
|||
* |
|||
* @var array |
|||
*/ |
|||
protected $guarded = array(); |
|||
|
|||
//获取列表
|
|||
public static function getList(array $param) |
|||
{ |
|||
extract($param); //参数:limit,offset
|
|||
|
|||
$limit = isset($limit) ? $limit : 10; |
|||
$offset = isset($offset) ? $offset : 0; |
|||
|
|||
$model = new self; |
|||
|
|||
if(isset($type)){$where['type'] = $type;} |
|||
if(isset($status)){$where['status'] = $status;} |
|||
|
|||
$model = $model->whereIn('user_id',array(0,$user_id)); |
|||
if(isset($where)){$model = $model->where($where);} |
|||
|
|||
$res['count'] = $model->count(); |
|||
$res['list'] = array(); |
|||
|
|||
if($res['count']>0) |
|||
{ |
|||
$res['list'] = $model->skip($offset)->take($limit)->orderBy('id','desc')->get(); |
|||
} |
|||
else |
|||
{ |
|||
return false; |
|||
} |
|||
|
|||
return $res; |
|||
} |
|||
|
|||
public static function getOne($where) |
|||
{ |
|||
return self::where($where)->first(); |
|||
} |
|||
|
|||
public static function add(array $data) |
|||
{ |
|||
if ($id = self::insertGetId($data)) |
|||
{ |
|||
return $id; |
|||
} |
|||
|
|||
return false; |
|||
} |
|||
|
|||
public static function modify($where, array $data) |
|||
{ |
|||
if (self::where($where)->update($data)) |
|||
{ |
|||
return true; |
|||
} |
|||
|
|||
return false; |
|||
} |
|||
|
|||
//删除一条记录
|
|||
public static function remove($id) |
|||
{ |
|||
if (!self::whereIn('id', explode(',', $id))->delete()) |
|||
{ |
|||
return false; |
|||
} |
|||
|
|||
return true; |
|||
} |
|||
} |
@ -0,0 +1,108 @@ |
|||
@extends('admin.layouts.app') |
|||
@section('title', '品牌添加') |
|||
|
|||
@section('content') |
|||
<h5 class="sub-header"><a href="/fladmin/goodbrand">品牌列表</a> > 品牌添加</h5> |
|||
|
|||
<form id="addarc" method="post" action="/fladmin/goodbrand/doadd" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }} |
|||
<table class="table table-striped table-bordered"> |
|||
<tbody> |
|||
<tr> |
|||
<td align="right">页面标题:</td> |
|||
<td><input name="title" type="text" id="title" value="" class="required" style="width:60%" placeholder="在此输入标题"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">别名:</td> |
|||
<td><input name="filename" type="text" id="filename" class="required" value="" size="30"> </td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">模板文件名:</td> |
|||
<td><input name="template" type="text" id="template" value="page" size="30"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">seoTitle:</td> |
|||
<td><input name="seotitle" type="text" id="seotitle" value="" style="width:60%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right" style="vertical-align:middle;">缩略图:</td> |
|||
<td style="vertical-align:middle;"><button type="button" onclick="upImage();">选择图片</button> <input name="litpic" type="text" id="litpic" value="" style="width:40%"> <img style="margin-left:20px;display:none;" src="" width="120" height="80" id="picview"></td> |
|||
</tr> |
|||
<script type="text/javascript"> |
|||
var _editor; |
|||
$(function() { |
|||
//重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
|
|||
_editor = UE.getEditor('ueditorimg'); |
|||
_editor.ready(function () { |
|||
//设置编辑器不可用
|
|||
_editor.setDisabled('insertimage'); |
|||
//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
|
|||
_editor.hide(); |
|||
//侦听图片上传
|
|||
_editor.addListener('beforeInsertImage', function (t, arg) { |
|||
//将地址赋值给相应的input,只取第一张图片的路径
|
|||
$('#litpic').val(arg[0].src); |
|||
//图片预览
|
|||
$('#picview').attr("src",arg[0].src).css("display","inline-block"); |
|||
}) |
|||
}); |
|||
}); |
|||
//弹出图片上传的对话框
|
|||
function upImage() |
|||
{ |
|||
var myImage = _editor.getDialog("insertimage"); |
|||
myImage.render(); |
|||
myImage.open(); |
|||
} |
|||
</script> |
|||
<script type="text/plain" id="ueditorimg"></script> |
|||
<tr> |
|||
<td align="right">页面关键字:</td> |
|||
<td><input type="text" name="keywords" id="keywords" style="width:50%" value=""> (用","分开)</td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right" style="vertical-align:middle;">页面摘要信息:</td> |
|||
<td><textarea name="description" rows="5" id="description" style="width:80%;height:70px;vertical-align:middle;"></textarea></td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2"><strong>页面内容:</strong></td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2"> |
|||
<!-- 加载编辑器的容器 --><script id="container" name="body" type="text/plain"></script> |
|||
<!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script> |
|||
<!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.js"></script> |
|||
<!-- 实例化编辑器 --><script type="text/javascript">var ue = UE.getEditor('container',{maximumWords:100000,initialFrameHeight:320,enableAutoSave:false});</script></td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button> <button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button><input type="hidden"></input></td> |
|||
</tr> |
|||
</tbody></table></form><!-- 表单结束 --> |
|||
<script> |
|||
$(function(){ |
|||
$(".required").blur(function(){ |
|||
var $parent = $(this).parent(); |
|||
$parent.find(".formtips").remove(); |
|||
if(this.value=="") |
|||
{ |
|||
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>'); |
|||
} |
|||
else |
|||
{ |
|||
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>'); |
|||
} |
|||
}); |
|||
|
|||
//重置
|
|||
$('#addarc input[type="reset"]').click(function(){ |
|||
$(".formtips").remove(); |
|||
}); |
|||
|
|||
$("#addarc").submit(function(){ |
|||
$(".required").trigger('blur'); |
|||
var numError = $('#addarc .onError').length; |
|||
|
|||
if(numError){return false;} |
|||
}); |
|||
}); |
|||
</script> |
|||
@endsection |
@ -0,0 +1,122 @@ |
|||
@extends('admin.layouts.app') |
|||
@section('title', '品牌修改') |
|||
|
|||
@section('content') |
|||
<h5 class="sub-header"><a href="/fladmin/page">品牌列表</a> > 品牌修改</h5> |
|||
|
|||
<form id="addarc" method="post" action="/fladmin/page/doedit" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }} |
|||
<table class="table table-striped table-bordered"> |
|||
<tbody> |
|||
<tr> |
|||
<td align="right">页面标题:</td> |
|||
<td><input name="title" type="text" id="title" value="<?php echo $post["title"]; ?>" class="required" style="width:60%" placeholder="在此输入标题"> <input style="display:none;" type="text" name="id" id="id" value="<?php echo $id; ?>"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">别名:</td> |
|||
<td><input name="filename" type="text" id="filename" class="required" value="<?php echo $post["filename"]; ?>" size="30"> </td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">模板文件名:</td> |
|||
<td><input name="template" type="text" id="template" value="<?php echo $post["template"]; ?>" size="30"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right">seoTitle:</td> |
|||
<td><input name="seotitle" type="text" id="seotitle" value="<?php echo $post["seotitle"]; ?>" style="width:60%"></td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right" style="vertical-align:middle;">缩略图:</td> |
|||
<td style="vertical-align:middle;"><button type="button" onclick="upImage();">选择图片</button> <input name="litpic" type="text" id="litpic" value="<?php echo $post["litpic"]; ?>" style="width:40%"> <img style="margin-left:20px;<?php if(empty($post["litpic"]) || !imgmatch($post["litpic"])){ echo "display:none;"; } ?>" src="<?php if(imgmatch($post["litpic"])){echo $post["litpic"];} ?>" width="120" height="80" id="picview" name="picview"></td> |
|||
</tr> |
|||
<script type="text/javascript"> |
|||
var _editor; |
|||
$(function() { |
|||
//重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
|
|||
_editor = UE.getEditor('ueditorimg'); |
|||
_editor.ready(function () { |
|||
//设置编辑器不可用
|
|||
_editor.setDisabled('insertimage'); |
|||
//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
|
|||
_editor.hide(); |
|||
//侦听图片上传
|
|||
_editor.addListener('beforeInsertImage', function (t, arg) { |
|||
//将地址赋值给相应的input,只取第一张图片的路径
|
|||
$('#litpic').val(arg[0].src); |
|||
//图片预览
|
|||
$('#picview').attr("src",arg[0].src).css("display","inline-block"); |
|||
}) |
|||
}); |
|||
}); |
|||
//弹出图片上传的对话框
|
|||
function upImage() |
|||
{ |
|||
var myImage = _editor.getDialog("insertimage"); |
|||
myImage.render(); |
|||
myImage.open(); |
|||
} |
|||
</script> |
|||
<script type="text/plain" id="ueditorimg"></script> |
|||
<tr> |
|||
<td align="right">页面关键字:</td> |
|||
<td><input type="text" name="keywords" id="keywords" style="width:50%" value="<?php echo $post["keywords"]; ?>"> (用","分开)</td> |
|||
</tr> |
|||
<tr> |
|||
<td align="right" style="vertical-align:middle;">页面摘要信息:</td> |
|||
<td><textarea name="description" rows="5" id="description" style="width:80%;height:70px;vertical-align:middle;"><?php echo $post["description"]; ?></textarea></td>
|
|||
</tr> |
|||
<tr> |
|||
<td colspan="2"><strong>页面内容:</strong></td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2"> |
|||
<!-- 加载编辑器的容器 --><script id="container" name="body" type="text/plain"><?php echo $post["body"]; ?></script>
|
|||
<!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script> |
|||
<!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.js"></script> |
|||
<!-- 实例化编辑器 --><script type="text/javascript">var ue = UE.getEditor('container',{maximumWords:100000,initialFrameHeight:320,enableAutoSave:false});</script></td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button> <button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button><input type="hidden"></input></td> |
|||
</tr> |
|||
</tbody></table></form><!-- 表单结束 --> |
|||
<script> |
|||
$(function(){ |
|||
$(".required").blur(function(){ |
|||
var $parent = $(this).parent(); |
|||
$parent.find(".formtips").remove(); |
|||
if(this.value=="") |
|||
{ |
|||
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>'); |
|||
} |
|||
else |
|||
{ |
|||
if( $(this).is('#filename') ){ |
|||
var reg = /^[a-zA-Z]+[0-9]*[a-zA-Z0-9]*$/;//验证是否为字母、数字
|
|||
if(!reg.test($("#filename").val())) |
|||
{ |
|||
$parent.append(' <small class="formtips onError"><font color="red">格式不正确!</font></small>'); |
|||
} |
|||
else |
|||
{ |
|||
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>'); |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>'); |
|||
} |
|||
} |
|||
}); |
|||
|
|||
//重置
|
|||
$('#addarc input[type="reset"]').click(function(){ |
|||
$(".formtips").remove(); |
|||
}); |
|||
|
|||
$("#addarc").submit(function(){ |
|||
$(".required").trigger('blur'); |
|||
var numError = $('#addarc .onError').length; |
|||
|
|||
if(numError){return false;} |
|||
}); |
|||
}); |
|||
</script> |
|||
@endsection |
@ -0,0 +1,29 @@ |
|||
@extends('admin.layouts.app') |
|||
@section('title', '品牌列表') |
|||
|
|||
@section('content') |
|||
<h2 class="sub-header">品牌管理</h2>[ <a href="/fladmin/goodsbrand/add">品牌添加</a> ]<br><br> |
|||
|
|||
<form name="listarc"><div class="table-responsive"><table class="table table-striped table-hover"> |
|||
<thead> |
|||
<tr> |
|||
<th>编号</th> |
|||
<th>名称</th> |
|||
<th>是否显示</th> |
|||
<th>更新时间</th> |
|||
<th>管理</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<?php if($posts){foreach($posts as $row){ ?>
|
|||
<tr> |
|||
<td><?php echo $row["id"]; ?></td>
|
|||
<td><a href="/fladmin/goodsbrand/edit?id=<?php echo $row["id"]; ?>"><?php echo $row["title"]; ?></a></td>
|
|||
<td><?php if(){echo $row["filename"];} ?></td>
|
|||
<td><?php echo date('Y-m-d',$row["pubdate"]); ?></td>
|
|||
<td><a target="_blank" href="<?php echo get_front_url(array("type"=>"page","pagename"=>$row["filename"])); ?>">预览</a> <a href="/fladmin/goodsbrand/edit?id=<?php echo $row["id"]; ?>">修改</a> <a onclick="delconfirm('/fladmin/goodsbrand/del?id=<?php echo $row["id"]; ?>')" href="javascript:;">删除</a></td> |
|||
</tr> |
|||
<?php }} ?>
|
|||
</tbody> |
|||
</table></div><!-- 表格结束 --></form><!-- 表单结束 --> |
|||
@endsection |
@ -0,0 +1,95 @@ |
|||
<!DOCTYPE html><html><head><meta http-equiv="content-type" content="text/html;charset=utf-8"/> |
|||
<title>消息</title><meta name="keywords" content="关键词"><meta name="description" content="描述"><meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"> |
|||
<link href="<?php echo env('APP_URL'); ?>/css/weixin/style.css" type="text/css" rel="stylesheet"> |
|||
<script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/jquery.min.js"></script> |
|||
<script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/weixin/mobile.js"></script></head><body> |
|||
<div class="classreturn loginsignup"> |
|||
<div class="ds-in-bl return"><a href="javascript:history.back(-1);"><img src="<?php echo env('APP_URL'); ?>/images/weixin/return.png" alt="返回"></a></div> |
|||
<div class="ds-in-bl tit center"><span>消息</span></div> |
|||
</div> |
|||
|
|||
<script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/layer/mobile/layer.js"></script> |
|||
<style> |
|||
.money_list li{padding:15px;border-bottom:1px solid #ddd;}
|
|||
.money_list .tit{color:#000;font-size:18px;margin-bottom:5px;}
|
|||
.money_list .des{color:#999;font-size:14px;margin-bottom:5px;}
|
|||
.money_list .time{color:#aaa;font-size:12px;}
|
|||
</style> |
|||
<div class="floor"> |
|||
<?php if($list){ ?>
|
|||
<ul class="money_list cl"> |
|||
<?php foreach($list as $k=>$v){ ?>
|
|||
<li> |
|||
<?php if($v['title']){ ?><p class="tit"><?php echo $v['title']; ?></p><?php } ?>
|
|||
<?php if($v['des']){ ?><p class="des"><?php echo $v['des']; ?></p><?php } ?>
|
|||
<p class="time"><?php echo date('Y-m-d H:i',$v['add_time']); ?></p>
|
|||
</li> |
|||
<?php } ?>
|
|||
</ul> |
|||
<?php }else{ ?>
|
|||
<div style="text-align:center;line-height:40px;color:#999;">暂无记录</div> |
|||
<?php } ?>
|
|||
</div> |
|||
<script> |
|||
$(function(){ |
|||
var ajaxload = false; |
|||
var maxpage = false; |
|||
var startpage = 1; |
|||
var totalpage = <?php echo $totalpage; ?>;
|
|||
|
|||
var tmp_url = window.location.href; |
|||
msg = tmp_url.split("#"); |
|||
tmp_url = msg[0]; |
|||
|
|||
$(window).scroll(function () |
|||
{ |
|||
var listheight = $(".money_list").outerHeight(); |
|||
|
|||
if ($(document).scrollTop() + $(window).height() >= listheight) |
|||
{ |
|||
if(startpage >= totalpage) |
|||
{ |
|||
//$("#submit_bt_one").html("已是最后一页,没有更多数据!");
|
|||
return false; |
|||
} |
|||
|
|||
if(!ajaxload && !maxpage) |
|||
{ |
|||
ajaxload = true; |
|||
//$("#submit_bt_one").html("努力加载中...");
|
|||
var url = tmp_url; |
|||
var nextpage = startpage+1; |
|||
|
|||
$.get(url,{page_ajax:1,page:nextpage},function(res) |
|||
{ |
|||
if(res) |
|||
{ |
|||
$(".money_list").append(res); |
|||
startpage++; |
|||
|
|||
if(startpage >= totalpage) |
|||
{ |
|||
maxpage = true; |
|||
//$("#submit_bt_one").html("已是最后一页,没有更多数据!");
|
|||
} |
|||
else |
|||
{ |
|||
//$("#submit_bt_one").html("点击加载更多");
|
|||
} |
|||
|
|||
ajaxload = false; |
|||
} |
|||
else |
|||
{ |
|||
//$("#submit_bt_one").html("请求失败,请稍候再试!");
|
|||
ajaxload = false; |
|||
} |
|||
},'json'); |
|||
} |
|||
} |
|||
}); |
|||
}); |
|||
</script> |
|||
|
|||
@include('weixin.common.footer') |
|||
</body></html> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue